diff options
author | kytwb <kytwb@pm.me> | 2022-01-02 00:40:42 +0100 |
---|---|---|
committer | kytwb <kytwb@pm.me> | 2022-01-02 00:40:42 +0100 |
commit | 55dd67d28e691338b4ecbe928436c4f2a41ad5cb (patch) | |
tree | b73fa0fb7398673c936888f72c8027456bfb463f /src/internal-server | |
parent | Revert "Removed 'Most Popular' services since it alludes to user-tracking (#1... (diff) | |
download | ferdium-app-55dd67d28e691338b4ecbe928436c4f2a41ad5cb.tar.gz ferdium-app-55dd67d28e691338b4ecbe928436c4f2a41ad5cb.tar.zst ferdium-app-55dd67d28e691338b4ecbe928436c4f2a41ad5cb.zip |
Revert "Removed straggling code related to popular services."
This reverts commit a9c1abc6f11cb193388fad505c0304f1efe60a30.
Diffstat (limited to 'src/internal-server')
-rw-r--r-- | src/internal-server/app/Controllers/Http/StaticController.js | 195 | ||||
-rw-r--r-- | src/internal-server/start/routes.js | 2 |
2 files changed, 197 insertions, 0 deletions
diff --git a/src/internal-server/app/Controllers/Http/StaticController.js b/src/internal-server/app/Controllers/Http/StaticController.js new file mode 100644 index 000000000..ef5764881 --- /dev/null +++ b/src/internal-server/app/Controllers/Http/StaticController.js | |||
@@ -0,0 +1,195 @@ | |||
1 | /** | ||
2 | * Controller for routes with static responses | ||
3 | */ | ||
4 | |||
5 | class StaticController { | ||
6 | // Enable all features | ||
7 | features({ | ||
8 | response, | ||
9 | }) { | ||
10 | return response.send({ | ||
11 | isServiceProxyEnabled: true, | ||
12 | isWorkspaceEnabled: true, | ||
13 | isAnnouncementsEnabled: true, | ||
14 | isSettingsWSEnabled: false, | ||
15 | isMagicBarEnabled: true, | ||
16 | isTodosEnabled: true, | ||
17 | subscribeURL: 'https://getferdi.com', | ||
18 | hasInlineCheckout: true, | ||
19 | }); | ||
20 | } | ||
21 | |||
22 | // Return an empty array | ||
23 | emptyArray({ | ||
24 | response, | ||
25 | }) { | ||
26 | return response.send([]); | ||
27 | } | ||
28 | |||
29 | // Return list of popular recipes (copy of the response Franz's API is returning) | ||
30 | popularRecipes({ | ||
31 | response, | ||
32 | }) { | ||
33 | return response.send([{ | ||
34 | // TODO: Why is this list hardcoded? | ||
35 | author: 'Stefan Malzner <stefan@adlk.io>', | ||
36 | featured: false, | ||
37 | id: 'slack', | ||
38 | name: 'Slack', | ||
39 | version: '1.0.4', | ||
40 | icons: { | ||
41 | png: 'https://cdn.franzinfra.com/recipes/dist/slack/src/icon.png', | ||
42 | svg: 'https://cdn.franzinfra.com/recipes/dist/slack/src/icon.svg', | ||
43 | }, | ||
44 | }, { | ||
45 | author: 'Stefan Malzner <stefan@adlk.io>', | ||
46 | featured: false, | ||
47 | id: 'whatsapp', | ||
48 | name: 'WhatsApp', | ||
49 | version: '1.0.1', | ||
50 | icons: { | ||
51 | png: 'https://cdn.franzinfra.com/recipes/dist/whatsapp/src/icon.png', | ||
52 | svg: 'https://cdn.franzinfra.com/recipes/dist/whatsapp/src/icon.svg', | ||
53 | }, | ||
54 | }, { | ||
55 | author: 'Stefan Malzner <stefan@adlk.io>', | ||
56 | featured: false, | ||
57 | id: 'messenger', | ||
58 | name: 'Messenger', | ||
59 | version: '1.0.6', | ||
60 | icons: { | ||
61 | png: 'https://cdn.franzinfra.com/recipes/dist/messenger/src/icon.png', | ||
62 | svg: 'https://cdn.franzinfra.com/recipes/dist/messenger/src/icon.svg', | ||
63 | }, | ||
64 | }, { | ||
65 | author: 'Stefan Malzner <stefan@adlk.io>', | ||
66 | featured: false, | ||
67 | id: 'telegram', | ||
68 | name: 'Telegram', | ||
69 | version: '1.0.0', | ||
70 | icons: { | ||
71 | png: 'https://cdn.franzinfra.com/recipes/dist/telegram/src/icon.png', | ||
72 | svg: 'https://cdn.franzinfra.com/recipes/dist/telegram/src/icon.svg', | ||
73 | }, | ||
74 | }, { | ||
75 | author: 'Stefan Malzner <stefan@adlk.io>', | ||
76 | featured: false, | ||
77 | id: 'gmail', | ||
78 | name: 'Gmail', | ||
79 | version: '1.0.0', | ||
80 | icons: { | ||
81 | png: 'https://cdn.franzinfra.com/recipes/dist/gmail/src/icon.png', | ||
82 | svg: 'https://cdn.franzinfra.com/recipes/dist/gmail/src/icon.svg', | ||
83 | }, | ||
84 | }, { | ||
85 | author: 'Stefan Malzner <stefan@adlk.io>', | ||
86 | featured: false, | ||
87 | id: 'skype', | ||
88 | name: 'Skype', | ||
89 | version: '1.0.0', | ||
90 | icons: { | ||
91 | png: 'https://cdn.franzinfra.com/recipes/dist/skype/src/icon.png', | ||
92 | svg: 'https://cdn.franzinfra.com/recipes/dist/skype/src/icon.svg', | ||
93 | }, | ||
94 | }, { | ||
95 | author: 'Stefan Malzner <stefan@adlk.io>', | ||
96 | featured: false, | ||
97 | id: 'hangouts', | ||
98 | name: 'Hangouts', | ||
99 | version: '1.0.0', | ||
100 | icons: { | ||
101 | png: 'https://cdn.franzinfra.com/recipes/dist/hangouts/src/icon.png', | ||
102 | svg: 'https://cdn.franzinfra.com/recipes/dist/hangouts/src/icon.svg', | ||
103 | }, | ||
104 | }, { | ||
105 | author: 'Stefan Malzner <stefan@adlk.io>', | ||
106 | featured: false, | ||
107 | id: 'discord', | ||
108 | name: 'Discord', | ||
109 | version: '1.0.0', | ||
110 | icons: { | ||
111 | png: 'https://cdn.franzinfra.com/recipes/dist/discord/src/icon.png', | ||
112 | svg: 'https://cdn.franzinfra.com/recipes/dist/discord/src/icon.svg', | ||
113 | }, | ||
114 | }, { | ||
115 | author: 'Stefan Malzner <stefan@adlk.io>', | ||
116 | featured: false, | ||
117 | id: 'tweetdeck', | ||
118 | name: 'Tweetdeck', | ||
119 | version: '1.0.1', | ||
120 | icons: { | ||
121 | png: 'https://cdn.franzinfra.com/recipes/dist/tweetdeck/src/icon.png', | ||
122 | svg: 'https://cdn.franzinfra.com/recipes/dist/tweetdeck/src/icon.svg', | ||
123 | }, | ||
124 | }, { | ||
125 | author: 'Stefan Malzner <stefan@adlk.io>', | ||
126 | featured: false, | ||
127 | id: 'hipchat', | ||
128 | name: 'HipChat', | ||
129 | version: '1.0.1', | ||
130 | icons: { | ||
131 | png: 'https://cdn.franzinfra.com/recipes/dist/hipchat/src/icon.png', | ||
132 | svg: 'https://cdn.franzinfra.com/recipes/dist/hipchat/src/icon.svg', | ||
133 | }, | ||
134 | }, { | ||
135 | author: 'Stefan Malzner <stefan@adlk.io>', | ||
136 | featured: false, | ||
137 | id: 'rocketchat', | ||
138 | name: 'Rocket.Chat', | ||
139 | version: '1.0.1', | ||
140 | icons: { | ||
141 | png: 'https://cdn.franzinfra.com/recipes/dist/rocketchat/src/icon.png', | ||
142 | svg: 'https://cdn.franzinfra.com/recipes/dist/rocketchat/src/icon.svg', | ||
143 | }, | ||
144 | }, { | ||
145 | author: 'Brian Gilbert <brian@briangilbert.net>', | ||
146 | featured: false, | ||
147 | id: 'gitter', | ||
148 | name: 'Gitter', | ||
149 | version: '1.0.0', | ||
150 | icons: { | ||
151 | png: 'https://cdn.franzinfra.com/recipes/dist/gitter/src/icon.png', | ||
152 | svg: 'https://cdn.franzinfra.com/recipes/dist/gitter/src/icon.svg', | ||
153 | }, | ||
154 | }, { | ||
155 | author: 'Stefan Malzner <stefan@adlk.io>', | ||
156 | featured: false, | ||
157 | id: 'mattermost', | ||
158 | name: 'Mattermost', | ||
159 | version: '1.0.0', | ||
160 | icons: { | ||
161 | png: 'https://cdn.franzinfra.com/recipes/dist/mattermost/src/icon.png', | ||
162 | svg: 'https://cdn.franzinfra.com/recipes/dist/mattermost/src/icon.svg', | ||
163 | }, | ||
164 | }, { | ||
165 | author: 'Franz <recipe@meetfranz.com>', | ||
166 | featured: false, | ||
167 | id: 'toggl', | ||
168 | name: 'Toggl', | ||
169 | version: '1.0.0', | ||
170 | icons: { | ||
171 | png: 'https://cdn.franzinfra.com/recipes/dist/toggl/src/icon.png', | ||
172 | svg: 'https://cdn.franzinfra.com/recipes/dist/toggl/src/icon.svg', | ||
173 | }, | ||
174 | }, { | ||
175 | author: 'Stuart Clark <stuart@realityloop.com>', | ||
176 | featured: false, | ||
177 | id: 'twist', | ||
178 | name: 'Twist', | ||
179 | version: '1.0.0', | ||
180 | icons: { | ||
181 | png: 'https://cdn.franzinfra.com/recipes/dist/twist/src/icon.png', | ||
182 | svg: 'https://cdn.franzinfra.com/recipes/dist/twist/src/icon.svg', | ||
183 | }, | ||
184 | }]); | ||
185 | } | ||
186 | |||
187 | // Show announcements | ||
188 | announcement({ | ||
189 | response, | ||
190 | }) { | ||
191 | return response.send({}); | ||
192 | } | ||
193 | } | ||
194 | |||
195 | module.exports = StaticController; | ||
diff --git a/src/internal-server/start/routes.js b/src/internal-server/start/routes.js index 177035dac..4a63b51f2 100644 --- a/src/internal-server/start/routes.js +++ b/src/internal-server/start/routes.js | |||
@@ -55,6 +55,8 @@ Route.group(() => { | |||
55 | Route.get('recipes', 'RecipeController.list'); | 55 | Route.get('recipes', 'RecipeController.list'); |
56 | Route.get('recipes/download/:recipe', 'RecipeController.download'); | 56 | Route.get('recipes/download/:recipe', 'RecipeController.download'); |
57 | Route.get('recipes/search', 'RecipeController.search'); | 57 | Route.get('recipes/search', 'RecipeController.search'); |
58 | Route.get('recipes/popular', 'StaticController.popularRecipes'); | ||
59 | Route.get('recipes/update', 'StaticController.emptyArray'); | ||
58 | 60 | ||
59 | // Workspaces | 61 | // Workspaces |
60 | Route.put('workspace/:id', 'WorkspaceController.edit'); | 62 | Route.put('workspace/:id', 'WorkspaceController.edit'); |