@friggframework/core 2.0.0--canary.395.35c5a60.0 → 2.0.0--canary.395.91a7c18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -176,12 +176,15 @@ function setIntegrationRoutes(router, factory, getUserFromBearerToken) {
|
|
|
176
176
|
|
|
177
177
|
router.route('/api/integrations/:integrationId/config/options').get(
|
|
178
178
|
catchAsyncError(async (req, res) => {
|
|
179
|
-
await getUserFromBearerToken.execute(
|
|
179
|
+
const user = await getUserFromBearerToken.execute(
|
|
180
180
|
req.headers.authorization
|
|
181
181
|
);
|
|
182
182
|
const params = checkRequiredParams(req.params, ['integrationId']);
|
|
183
183
|
const integration =
|
|
184
|
-
await integrationFactory.getInstanceFromIntegrationId(
|
|
184
|
+
await integrationFactory.getInstanceFromIntegrationId({
|
|
185
|
+
integrationId: params.integrationId,
|
|
186
|
+
userId: user.getId(),
|
|
187
|
+
});
|
|
185
188
|
res.json(await integration.send('GET_CONFIG_OPTIONS'));
|
|
186
189
|
})
|
|
187
190
|
);
|
|
@@ -190,7 +193,7 @@ function setIntegrationRoutes(router, factory, getUserFromBearerToken) {
|
|
|
190
193
|
.route('/api/integrations/:integrationId/config/options/refresh')
|
|
191
194
|
.post(
|
|
192
195
|
catchAsyncError(async (req, res) => {
|
|
193
|
-
await getUserFromBearerToken.execute(
|
|
196
|
+
const user = await getUserFromBearerToken.execute(
|
|
194
197
|
req.headers.authorization
|
|
195
198
|
);
|
|
196
199
|
const params = checkRequiredParams(req.params, [
|
|
@@ -198,7 +201,10 @@ function setIntegrationRoutes(router, factory, getUserFromBearerToken) {
|
|
|
198
201
|
]);
|
|
199
202
|
const integration =
|
|
200
203
|
await integrationFactory.getInstanceFromIntegrationId(
|
|
201
|
-
|
|
204
|
+
{
|
|
205
|
+
integrationId: params.integrationId,
|
|
206
|
+
userId: user.getId(),
|
|
207
|
+
}
|
|
202
208
|
);
|
|
203
209
|
|
|
204
210
|
res.json(
|
|
@@ -208,12 +214,15 @@ function setIntegrationRoutes(router, factory, getUserFromBearerToken) {
|
|
|
208
214
|
);
|
|
209
215
|
router.route('/api/integrations/:integrationId/actions').all(
|
|
210
216
|
catchAsyncError(async (req, res) => {
|
|
211
|
-
await getUserFromBearerToken.execute(
|
|
217
|
+
const user = await getUserFromBearerToken.execute(
|
|
212
218
|
req.headers.authorization
|
|
213
219
|
);
|
|
214
220
|
const params = checkRequiredParams(req.params, ['integrationId']);
|
|
215
221
|
const integration =
|
|
216
|
-
await integrationFactory.getInstanceFromIntegrationId(
|
|
222
|
+
await integrationFactory.getInstanceFromIntegrationId({
|
|
223
|
+
integrationId: params.integrationId,
|
|
224
|
+
userId: user.getId(),
|
|
225
|
+
});
|
|
217
226
|
res.json(await integration.send('GET_USER_ACTIONS', req.body));
|
|
218
227
|
})
|
|
219
228
|
);
|
|
@@ -222,7 +231,7 @@ function setIntegrationRoutes(router, factory, getUserFromBearerToken) {
|
|
|
222
231
|
.route('/api/integrations/:integrationId/actions/:actionId/options')
|
|
223
232
|
.all(
|
|
224
233
|
catchAsyncError(async (req, res) => {
|
|
225
|
-
await getUserFromBearerToken.execute(
|
|
234
|
+
const user = await getUserFromBearerToken.execute(
|
|
226
235
|
req.headers.authorization
|
|
227
236
|
);
|
|
228
237
|
const params = checkRequiredParams(req.params, [
|
|
@@ -231,7 +240,10 @@ function setIntegrationRoutes(router, factory, getUserFromBearerToken) {
|
|
|
231
240
|
]);
|
|
232
241
|
const integration =
|
|
233
242
|
await integrationFactory.getInstanceFromIntegrationId(
|
|
234
|
-
|
|
243
|
+
{
|
|
244
|
+
integrationId: params.integrationId,
|
|
245
|
+
userId: user.getId(),
|
|
246
|
+
}
|
|
235
247
|
);
|
|
236
248
|
|
|
237
249
|
res.json(
|
|
@@ -249,7 +261,7 @@ function setIntegrationRoutes(router, factory, getUserFromBearerToken) {
|
|
|
249
261
|
)
|
|
250
262
|
.post(
|
|
251
263
|
catchAsyncError(async (req, res) => {
|
|
252
|
-
await getUserFromBearerToken.execute(
|
|
264
|
+
const user = await getUserFromBearerToken.execute(
|
|
253
265
|
req.headers.authorization
|
|
254
266
|
);
|
|
255
267
|
const params = checkRequiredParams(req.params, [
|
|
@@ -258,7 +270,10 @@ function setIntegrationRoutes(router, factory, getUserFromBearerToken) {
|
|
|
258
270
|
]);
|
|
259
271
|
const integration =
|
|
260
272
|
await integrationFactory.getInstanceFromIntegrationId(
|
|
261
|
-
|
|
273
|
+
{
|
|
274
|
+
integrationId: params.integrationId,
|
|
275
|
+
userId: user.getId(),
|
|
276
|
+
}
|
|
262
277
|
);
|
|
263
278
|
|
|
264
279
|
res.json(
|
|
@@ -272,7 +287,7 @@ function setIntegrationRoutes(router, factory, getUserFromBearerToken) {
|
|
|
272
287
|
|
|
273
288
|
router.route('/api/integrations/:integrationId/actions/:actionId').post(
|
|
274
289
|
catchAsyncError(async (req, res) => {
|
|
275
|
-
await getUserFromBearerToken.execute(
|
|
290
|
+
const user = await getUserFromBearerToken.execute(
|
|
276
291
|
req.headers.authorization
|
|
277
292
|
);
|
|
278
293
|
const params = checkRequiredParams(req.params, [
|
|
@@ -280,7 +295,10 @@ function setIntegrationRoutes(router, factory, getUserFromBearerToken) {
|
|
|
280
295
|
'actionId',
|
|
281
296
|
]);
|
|
282
297
|
const integration =
|
|
283
|
-
await integrationFactory.getInstanceFromIntegrationId(
|
|
298
|
+
await integrationFactory.getInstanceFromIntegrationId({
|
|
299
|
+
integrationId: params.integrationId,
|
|
300
|
+
userId: user.getId(),
|
|
301
|
+
});
|
|
284
302
|
|
|
285
303
|
res.json(await integration.send(params.actionId, req.body));
|
|
286
304
|
})
|
|
@@ -288,12 +306,15 @@ function setIntegrationRoutes(router, factory, getUserFromBearerToken) {
|
|
|
288
306
|
|
|
289
307
|
router.route('/api/integrations/:integrationId').get(
|
|
290
308
|
catchAsyncError(async (req, res) => {
|
|
291
|
-
await getUserFromBearerToken.execute(
|
|
309
|
+
const user = await getUserFromBearerToken.execute(
|
|
292
310
|
req.headers.authorization
|
|
293
311
|
);
|
|
294
312
|
const params = checkRequiredParams(req.params, ['integrationId']);
|
|
295
313
|
const integration = await IntegrationHelper.getIntegrationById(
|
|
296
|
-
|
|
314
|
+
{
|
|
315
|
+
integrationId: params.integrationId,
|
|
316
|
+
userId: user.getId(),
|
|
317
|
+
}
|
|
297
318
|
);
|
|
298
319
|
// We could perhaps augment router with dynamic options? Haven't decided yet, but here may be the place
|
|
299
320
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@friggframework/core",
|
|
3
3
|
"prettier": "@friggframework/prettier-config",
|
|
4
|
-
"version": "2.0.0--canary.395.
|
|
4
|
+
"version": "2.0.0--canary.395.91a7c18.0",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@hapi/boom": "^10.0.1",
|
|
7
7
|
"aws-sdk": "^2.1200.0",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"uuid": "^9.0.1"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@friggframework/eslint-config": "2.0.0--canary.395.
|
|
26
|
-
"@friggframework/prettier-config": "2.0.0--canary.395.
|
|
27
|
-
"@friggframework/test": "2.0.0--canary.395.
|
|
25
|
+
"@friggframework/eslint-config": "2.0.0--canary.395.91a7c18.0",
|
|
26
|
+
"@friggframework/prettier-config": "2.0.0--canary.395.91a7c18.0",
|
|
27
|
+
"@friggframework/test": "2.0.0--canary.395.91a7c18.0",
|
|
28
28
|
"@types/lodash": "4.17.15",
|
|
29
29
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
30
30
|
"chai": "^4.3.6",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
},
|
|
54
54
|
"homepage": "https://github.com/friggframework/frigg#readme",
|
|
55
55
|
"description": "",
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "91a7c181c35480ae2aecc540d5ecae0d4c3699ef"
|
|
57
57
|
}
|