@flink-app/management-api-plugin 0.3.3 → 0.3.7

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.
@@ -1,4 +1,4 @@
1
- // Generated Wed Mar 02 2022 14:42:30 GMT+0100 (Central European Standard Time)
1
+ // Generated Wed Oct 12 2022 10:03:58 GMT+0200 (Central European Summer Time)
2
2
  import { autoRegisteredHandlers, HttpMethod } from "@flink-app/flink";
3
3
  import * as GetManagement_0 from "../src/handlers/Management/GetManagement";
4
4
  import * as DeleteByUserid_0 from "../src/handlers/User/DeleteByUserid";
@@ -1,4 +1,4 @@
1
- // Generated Wed Mar 02 2022 14:42:30 GMT+0100 (Central European Standard Time)
1
+ // Generated Wed Oct 12 2022 10:03:58 GMT+0200 (Central European Summer Time)
2
2
  import { autoRegisteredRepos } from "@flink-app/flink";
3
3
  import ManagementUserRepo from "../src/repos/ManagementUserRepo";
4
4
 
@@ -15,7 +15,7 @@ import { PostUserLoginRes } from "../../src/schemas/User/PostLoginRes";
15
15
  import { PutUserByUseridReq } from "../../src/schemas/User/PutByUseridReq";
16
16
  import { PutUserByUseridRes } from "../../src/schemas/User/PutByUseridRes";
17
17
 
18
- // Generated Wed Mar 02 2022 14:42:31 GMT+0100 (Central European Standard Time)
18
+ // Generated Wed Oct 12 2022 10:03:59 GMT+0200 (Central European Summer Time)
19
19
  export interface GetManagement_9_ReqSchema extends GetManagementReq {}
20
20
 
21
21
  export interface GetManagement_9_ResSchema extends GetManagementRes {}
package/.flink/start.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Generated Wed Mar 02 2022 14:42:30 GMT+0100 (Central European Standard Time)
1
+ // Generated Wed Oct 12 2022 10:03:58 GMT+0200 (Central European Summer Time)
2
2
  import "./generatedHandlers";
3
3
  import "./generatedRepos";
4
4
  import "../src/index";
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright (c) Frost Experience AB https://www.frost.se
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,270 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$ref": "#/definitions/Schemas",
4
+ "definitions": {
5
+ "ManagementUser": {
6
+ "type": "object",
7
+ "properties": {
8
+ "_id": {
9
+ "type": "string"
10
+ },
11
+ "username": {
12
+ "type": "string"
13
+ },
14
+ "password": {
15
+ "type": "string"
16
+ },
17
+ "salt": {
18
+ "type": "string"
19
+ }
20
+ },
21
+ "required": [
22
+ "_id",
23
+ "username",
24
+ "password",
25
+ "salt"
26
+ ],
27
+ "additionalProperties": false
28
+ },
29
+ "ManagementUserViewModel": {
30
+ "type": "object",
31
+ "additionalProperties": false,
32
+ "properties": {
33
+ "_id": {
34
+ "type": "string"
35
+ },
36
+ "username": {
37
+ "type": "string"
38
+ }
39
+ },
40
+ "required": [
41
+ "_id",
42
+ "username"
43
+ ]
44
+ },
45
+ "ModuleList": {
46
+ "type": "object",
47
+ "properties": {
48
+ "modules": {
49
+ "type": "array",
50
+ "items": {
51
+ "$ref": "#/definitions/Module"
52
+ }
53
+ }
54
+ },
55
+ "required": [
56
+ "modules"
57
+ ],
58
+ "additionalProperties": false
59
+ },
60
+ "Module": {
61
+ "type": "object",
62
+ "properties": {
63
+ "id": {
64
+ "type": "string"
65
+ },
66
+ "type": {
67
+ "type": "string"
68
+ },
69
+ "features": {
70
+ "type": "array",
71
+ "items": {
72
+ "type": "string"
73
+ }
74
+ },
75
+ "title": {
76
+ "type": "string"
77
+ },
78
+ "ui": {
79
+ "type": "string"
80
+ }
81
+ },
82
+ "required": [
83
+ "id",
84
+ "type",
85
+ "features",
86
+ "title",
87
+ "ui"
88
+ ],
89
+ "additionalProperties": false
90
+ },
91
+ "GetManagementReq": {
92
+ "type": "object",
93
+ "additionalProperties": false
94
+ },
95
+ "GetManagementRes": {
96
+ "type": "object",
97
+ "additionalProperties": false,
98
+ "properties": {
99
+ "modules": {
100
+ "type": "array",
101
+ "items": {
102
+ "$ref": "#/definitions/Module"
103
+ }
104
+ }
105
+ },
106
+ "required": [
107
+ "modules"
108
+ ]
109
+ },
110
+ "DeleteUserByUseridReq": {
111
+ "type": "object",
112
+ "additionalProperties": false
113
+ },
114
+ "DeleteUserByUseridRes": {
115
+ "type": "object",
116
+ "additionalProperties": false
117
+ },
118
+ "GetUserByUseridReq": {
119
+ "type": "object",
120
+ "additionalProperties": false
121
+ },
122
+ "GetUserByUseridRes": {
123
+ "type": "object",
124
+ "additionalProperties": false,
125
+ "properties": {
126
+ "_id": {
127
+ "type": "string"
128
+ },
129
+ "username": {
130
+ "type": "string"
131
+ }
132
+ },
133
+ "required": [
134
+ "_id",
135
+ "username"
136
+ ]
137
+ },
138
+ "GetUserListReq": {
139
+ "type": "object",
140
+ "additionalProperties": false
141
+ },
142
+ "GetUserListRes": {
143
+ "type": "object",
144
+ "properties": {
145
+ "users": {
146
+ "type": "array",
147
+ "items": {
148
+ "$ref": "#/definitions/ManagementUserViewModel"
149
+ }
150
+ }
151
+ },
152
+ "required": [
153
+ "users"
154
+ ],
155
+ "additionalProperties": false
156
+ },
157
+ "GetUserMeReq": {
158
+ "type": "object",
159
+ "additionalProperties": false
160
+ },
161
+ "GetUserMeRes": {
162
+ "type": "object",
163
+ "additionalProperties": false,
164
+ "properties": {
165
+ "user": {
166
+ "$ref": "#/definitions/ManagementUserViewModel"
167
+ },
168
+ "token": {
169
+ "type": "string"
170
+ }
171
+ },
172
+ "required": [
173
+ "token",
174
+ "user"
175
+ ]
176
+ },
177
+ "PostUserLoginReq": {
178
+ "type": "object",
179
+ "properties": {
180
+ "username": {
181
+ "type": "string"
182
+ },
183
+ "password": {
184
+ "type": "string"
185
+ }
186
+ },
187
+ "required": [
188
+ "username",
189
+ "password"
190
+ ],
191
+ "additionalProperties": false
192
+ },
193
+ "PostUserLoginRes": {
194
+ "type": "object",
195
+ "properties": {
196
+ "user": {
197
+ "$ref": "#/definitions/ManagementUserViewModel"
198
+ },
199
+ "token": {
200
+ "type": "string"
201
+ }
202
+ },
203
+ "required": [
204
+ "user",
205
+ "token"
206
+ ],
207
+ "additionalProperties": false
208
+ },
209
+ "PostUserReq": {
210
+ "type": "object",
211
+ "additionalProperties": false,
212
+ "properties": {
213
+ "username": {
214
+ "type": "string"
215
+ },
216
+ "password": {
217
+ "type": "string"
218
+ }
219
+ },
220
+ "required": [
221
+ "password",
222
+ "username"
223
+ ]
224
+ },
225
+ "PostUserRes": {
226
+ "type": "object",
227
+ "additionalProperties": false,
228
+ "properties": {
229
+ "_id": {
230
+ "type": "string"
231
+ },
232
+ "username": {
233
+ "type": "string"
234
+ }
235
+ },
236
+ "required": [
237
+ "_id",
238
+ "username"
239
+ ]
240
+ },
241
+ "PutUserByUseridReq": {
242
+ "type": "object",
243
+ "additionalProperties": false,
244
+ "properties": {
245
+ "username": {
246
+ "type": "string"
247
+ },
248
+ "password": {
249
+ "type": "string"
250
+ }
251
+ }
252
+ },
253
+ "PutUserByUseridRes": {
254
+ "type": "object",
255
+ "additionalProperties": false,
256
+ "properties": {
257
+ "_id": {
258
+ "type": "string"
259
+ },
260
+ "username": {
261
+ "type": "string"
262
+ }
263
+ },
264
+ "required": [
265
+ "_id",
266
+ "username"
267
+ ]
268
+ }
269
+ }
270
+ }
@@ -20,7 +20,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
20
20
  };
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.handlers = void 0;
23
- // Generated Wed Mar 02 2022 14:42:30 GMT+0100 (Central European Standard Time)
23
+ // Generated Wed Oct 12 2022 10:03:58 GMT+0200 (Central European Summer Time)
24
24
  var flink_1 = require("@flink-app/flink");
25
25
  var DeleteByUserid_0 = __importStar(require("../src/handlers/User/DeleteByUserid"));
26
26
  var GetByUserid_1 = __importStar(require("../src/handlers/User/GetByUserid"));
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.repos = void 0;
7
- // Generated Wed Mar 02 2022 14:42:30 GMT+0100 (Central European Standard Time)
7
+ // Generated Wed Oct 12 2022 10:03:58 GMT+0200 (Central European Summer Time)
8
8
  var flink_1 = require("@flink-app/flink");
9
9
  var ManagementUserRepo_1 = __importDefault(require("../src/repos/ManagementUserRepo"));
10
10
  exports.repos = [{ collectionName: "managementuser", repoInstanceName: "managementUserRepo", Repo: ManagementUserRepo_1.default }];
@@ -0,0 +1,722 @@
1
+ {
2
+ "GetManagementReq": {
3
+ "type": "object",
4
+ "additionalProperties": false
5
+ },
6
+ "Module": {
7
+ "type": "object",
8
+ "properties": {
9
+ "isPreloading": {
10
+ "description": "`true` if the module is running during the Node.js preload",
11
+ "type": "boolean"
12
+ },
13
+ "exports": {},
14
+ "require": {
15
+ "$ref": "#/definitions/NodeJS.Require"
16
+ },
17
+ "id": {
18
+ "type": "string"
19
+ },
20
+ "filename": {
21
+ "type": "string"
22
+ },
23
+ "loaded": {
24
+ "type": "boolean"
25
+ },
26
+ "parent": {
27
+ "$ref": "#/definitions/NodeJS.Module"
28
+ },
29
+ "children": {
30
+ "type": "array",
31
+ "items": {
32
+ "$ref": "#/definitions/NodeJS.Module"
33
+ }
34
+ },
35
+ "path": {
36
+ "type": "string"
37
+ },
38
+ "paths": {
39
+ "type": "array",
40
+ "items": {
41
+ "type": "string"
42
+ }
43
+ }
44
+ },
45
+ "additionalProperties": false,
46
+ "required": [
47
+ "children",
48
+ "exports",
49
+ "filename",
50
+ "id",
51
+ "isPreloading",
52
+ "loaded",
53
+ "parent",
54
+ "path",
55
+ "paths",
56
+ "require"
57
+ ]
58
+ },
59
+ "ManagementApiEndpoint": {
60
+ "type": "object",
61
+ "properties": {
62
+ "config": {
63
+ "type": "object",
64
+ "properties": {
65
+ "schema": {
66
+ "type": "object",
67
+ "properties": {
68
+ "reqSchema": {
69
+ "$ref": "#/definitions/Definition"
70
+ },
71
+ "resSchema": {
72
+ "$ref": "#/definitions/Definition"
73
+ }
74
+ },
75
+ "additionalProperties": false
76
+ },
77
+ "routeProps": {
78
+ "description": "Route props to control routing.\n\nEach handler needs to declare RouteProps which\ninstructs express web server how to route traffic.",
79
+ "type": "object",
80
+ "properties": {
81
+ "method": {
82
+ "description": "HTTP method which this handlers responds to.\n\nWill if not set attempt to extract HTTP method based\non handler file name prefix, for example `GetFoo.ts` will assume\nHTTP method `GET`.",
83
+ "enum": [
84
+ "delete",
85
+ "get",
86
+ "post",
87
+ "put"
88
+ ],
89
+ "type": "string"
90
+ },
91
+ "path": {
92
+ "description": "Route path including any path params.\nExample: `/user/:id`",
93
+ "type": "string"
94
+ },
95
+ "mockApi": {
96
+ "description": "Generates mock response based on handlers response schema.\n\nWill be ignored if handler does not have any response schema defined.\n\nThis should only be used during development 💥",
97
+ "type": "boolean"
98
+ },
99
+ "permissions": {
100
+ "description": "Set permissions needed to access route if route requires authentication.",
101
+ "anyOf": [
102
+ {
103
+ "type": "array",
104
+ "items": {
105
+ "type": "string"
106
+ }
107
+ },
108
+ {
109
+ "type": "string"
110
+ }
111
+ ]
112
+ },
113
+ "docs": {
114
+ "description": "Optional documentation of endpoint. Can be used for example in API docs.\nSupports markdown strings.",
115
+ "type": "string"
116
+ }
117
+ },
118
+ "additionalProperties": false,
119
+ "required": [
120
+ "path"
121
+ ]
122
+ },
123
+ "origin": {
124
+ "description": "I.e. filename or plugin name that describes where handler origins from",
125
+ "type": "string"
126
+ }
127
+ },
128
+ "additionalProperties": false,
129
+ "required": [
130
+ "routeProps"
131
+ ]
132
+ },
133
+ "handlerFn": {
134
+ "description": "Http handler function that handlers implements in order to\nhandle HTTP requests and return a JSON response.",
135
+ "type": "object",
136
+ "additionalProperties": false
137
+ }
138
+ },
139
+ "additionalProperties": false,
140
+ "required": [
141
+ "config",
142
+ "handlerFn"
143
+ ]
144
+ },
145
+ "ManagementApiType": {
146
+ "enum": [
147
+ "MANAGEMENT_USER",
148
+ "USER"
149
+ ],
150
+ "type": "string"
151
+ },
152
+ "ManagementApiModule": {
153
+ "type": "object",
154
+ "properties": {
155
+ "id": {
156
+ "type": "string"
157
+ },
158
+ "type": {
159
+ "enum": [
160
+ "MANAGEMENT_USER",
161
+ "USER"
162
+ ],
163
+ "type": "string"
164
+ },
165
+ "endpoints": {
166
+ "type": "array",
167
+ "items": {
168
+ "type": "object",
169
+ "properties": {
170
+ "config": {
171
+ "type": "object",
172
+ "properties": {
173
+ "schema": {
174
+ "type": "object",
175
+ "properties": {
176
+ "reqSchema": {
177
+ "$ref": "#/definitions/Definition"
178
+ },
179
+ "resSchema": {
180
+ "$ref": "#/definitions/Definition"
181
+ }
182
+ },
183
+ "additionalProperties": false
184
+ },
185
+ "routeProps": {
186
+ "description": "Route props to control routing.\n\nEach handler needs to declare RouteProps which\ninstructs express web server how to route traffic.",
187
+ "type": "object",
188
+ "properties": {
189
+ "method": {
190
+ "description": "HTTP method which this handlers responds to.\n\nWill if not set attempt to extract HTTP method based\non handler file name prefix, for example `GetFoo.ts` will assume\nHTTP method `GET`.",
191
+ "enum": [
192
+ "delete",
193
+ "get",
194
+ "post",
195
+ "put"
196
+ ],
197
+ "type": "string"
198
+ },
199
+ "path": {
200
+ "description": "Route path including any path params.\nExample: `/user/:id`",
201
+ "type": "string"
202
+ },
203
+ "mockApi": {
204
+ "description": "Generates mock response based on handlers response schema.\n\nWill be ignored if handler does not have any response schema defined.\n\nThis should only be used during development 💥",
205
+ "type": "boolean"
206
+ },
207
+ "permissions": {
208
+ "description": "Set permissions needed to access route if route requires authentication.",
209
+ "anyOf": [
210
+ {
211
+ "type": "array",
212
+ "items": {
213
+ "type": "string"
214
+ }
215
+ },
216
+ {
217
+ "type": "string"
218
+ }
219
+ ]
220
+ },
221
+ "docs": {
222
+ "description": "Optional documentation of endpoint. Can be used for example in API docs.\nSupports markdown strings.",
223
+ "type": "string"
224
+ }
225
+ },
226
+ "additionalProperties": false,
227
+ "required": [
228
+ "path"
229
+ ]
230
+ },
231
+ "origin": {
232
+ "description": "I.e. filename or plugin name that describes where handler origins from",
233
+ "type": "string"
234
+ }
235
+ },
236
+ "additionalProperties": false,
237
+ "required": [
238
+ "routeProps"
239
+ ]
240
+ },
241
+ "handlerFn": {
242
+ "description": "Http handler function that handlers implements in order to\nhandle HTTP requests and return a JSON response.",
243
+ "type": "object",
244
+ "additionalProperties": false
245
+ }
246
+ },
247
+ "additionalProperties": false,
248
+ "required": [
249
+ "config",
250
+ "handlerFn"
251
+ ]
252
+ }
253
+ },
254
+ "ui": {
255
+ "type": "object",
256
+ "additionalProperties": false
257
+ },
258
+ "uiSettings": {
259
+ "type": "object",
260
+ "properties": {
261
+ "title": {
262
+ "type": "string"
263
+ },
264
+ "icon": {
265
+ "type": "string"
266
+ }
267
+ },
268
+ "additionalProperties": false,
269
+ "required": [
270
+ "icon",
271
+ "title"
272
+ ]
273
+ }
274
+ },
275
+ "additionalProperties": false,
276
+ "required": [
277
+ "endpoints",
278
+ "id",
279
+ "type",
280
+ "ui"
281
+ ]
282
+ },
283
+ "ManagementApiOptions": {
284
+ "type": "object",
285
+ "properties": {
286
+ "token": {
287
+ "type": "string"
288
+ },
289
+ "baseUrl": {
290
+ "type": "string"
291
+ },
292
+ "jwtSecret": {
293
+ "type": "string"
294
+ },
295
+ "modules": {
296
+ "type": "array",
297
+ "items": {
298
+ "type": "object",
299
+ "properties": {
300
+ "id": {
301
+ "type": "string"
302
+ },
303
+ "type": {
304
+ "enum": [
305
+ "MANAGEMENT_USER",
306
+ "USER"
307
+ ],
308
+ "type": "string"
309
+ },
310
+ "endpoints": {
311
+ "type": "array",
312
+ "items": {
313
+ "type": "object",
314
+ "properties": {
315
+ "config": {
316
+ "type": "object",
317
+ "properties": {
318
+ "schema": {
319
+ "type": "object",
320
+ "properties": {
321
+ "reqSchema": {
322
+ "$ref": "#/definitions/Definition"
323
+ },
324
+ "resSchema": {
325
+ "$ref": "#/definitions/Definition"
326
+ }
327
+ },
328
+ "additionalProperties": false
329
+ },
330
+ "routeProps": {
331
+ "description": "Route props to control routing.\n\nEach handler needs to declare RouteProps which\ninstructs express web server how to route traffic.",
332
+ "type": "object",
333
+ "properties": {
334
+ "method": {
335
+ "description": "HTTP method which this handlers responds to.\n\nWill if not set attempt to extract HTTP method based\non handler file name prefix, for example `GetFoo.ts` will assume\nHTTP method `GET`.",
336
+ "enum": [
337
+ "delete",
338
+ "get",
339
+ "post",
340
+ "put"
341
+ ],
342
+ "type": "string"
343
+ },
344
+ "path": {
345
+ "description": "Route path including any path params.\nExample: `/user/:id`",
346
+ "type": "string"
347
+ },
348
+ "mockApi": {
349
+ "description": "Generates mock response based on handlers response schema.\n\nWill be ignored if handler does not have any response schema defined.\n\nThis should only be used during development 💥",
350
+ "type": "boolean"
351
+ },
352
+ "permissions": {
353
+ "description": "Set permissions needed to access route if route requires authentication.",
354
+ "anyOf": [
355
+ {
356
+ "type": "array",
357
+ "items": {
358
+ "type": "string"
359
+ }
360
+ },
361
+ {
362
+ "type": "string"
363
+ }
364
+ ]
365
+ },
366
+ "docs": {
367
+ "description": "Optional documentation of endpoint. Can be used for example in API docs.\nSupports markdown strings.",
368
+ "type": "string"
369
+ }
370
+ },
371
+ "additionalProperties": false,
372
+ "required": [
373
+ "path"
374
+ ]
375
+ },
376
+ "origin": {
377
+ "description": "I.e. filename or plugin name that describes where handler origins from",
378
+ "type": "string"
379
+ }
380
+ },
381
+ "additionalProperties": false,
382
+ "required": [
383
+ "routeProps"
384
+ ]
385
+ },
386
+ "handlerFn": {
387
+ "description": "Http handler function that handlers implements in order to\nhandle HTTP requests and return a JSON response.",
388
+ "type": "object",
389
+ "additionalProperties": false
390
+ }
391
+ },
392
+ "additionalProperties": false,
393
+ "required": [
394
+ "config",
395
+ "handlerFn"
396
+ ]
397
+ }
398
+ },
399
+ "ui": {
400
+ "type": "object",
401
+ "additionalProperties": false
402
+ },
403
+ "uiSettings": {
404
+ "type": "object",
405
+ "properties": {
406
+ "title": {
407
+ "type": "string"
408
+ },
409
+ "icon": {
410
+ "type": "string"
411
+ }
412
+ },
413
+ "additionalProperties": false,
414
+ "required": [
415
+ "icon",
416
+ "title"
417
+ ]
418
+ }
419
+ },
420
+ "additionalProperties": false,
421
+ "required": [
422
+ "endpoints",
423
+ "id",
424
+ "type",
425
+ "ui"
426
+ ]
427
+ }
428
+ }
429
+ },
430
+ "additionalProperties": false,
431
+ "required": [
432
+ "jwtSecret",
433
+ "modules",
434
+ "token"
435
+ ]
436
+ },
437
+ "ModuleList": {
438
+ "type": "object",
439
+ "properties": {
440
+ "modules": {
441
+ "type": "array",
442
+ "items": {
443
+ "type": "object",
444
+ "properties": {
445
+ "id": {
446
+ "type": "string"
447
+ },
448
+ "type": {
449
+ "type": "string"
450
+ },
451
+ "icon": {
452
+ "type": "string"
453
+ },
454
+ "title": {
455
+ "type": "string"
456
+ },
457
+ "ui": {
458
+ "type": "string"
459
+ }
460
+ },
461
+ "additionalProperties": false,
462
+ "required": [
463
+ "icon",
464
+ "id",
465
+ "title",
466
+ "type",
467
+ "ui"
468
+ ]
469
+ }
470
+ }
471
+ },
472
+ "additionalProperties": false,
473
+ "required": [
474
+ "modules"
475
+ ]
476
+ },
477
+ "GetManagementRes": {
478
+ "type": "object",
479
+ "properties": {
480
+ "modules": {
481
+ "type": "array",
482
+ "items": {
483
+ "type": "object",
484
+ "properties": {
485
+ "id": {
486
+ "type": "string"
487
+ },
488
+ "type": {
489
+ "type": "string"
490
+ },
491
+ "icon": {
492
+ "type": "string"
493
+ },
494
+ "title": {
495
+ "type": "string"
496
+ },
497
+ "ui": {
498
+ "type": "string"
499
+ }
500
+ },
501
+ "additionalProperties": false,
502
+ "required": [
503
+ "icon",
504
+ "id",
505
+ "title",
506
+ "type",
507
+ "ui"
508
+ ]
509
+ }
510
+ }
511
+ },
512
+ "additionalProperties": false,
513
+ "required": [
514
+ "modules"
515
+ ]
516
+ },
517
+ "ManagementUser": {
518
+ "type": "object",
519
+ "properties": {
520
+ "_id": {
521
+ "type": "string"
522
+ },
523
+ "username": {
524
+ "type": "string"
525
+ },
526
+ "password": {
527
+ "type": "string"
528
+ },
529
+ "salt": {
530
+ "type": "string"
531
+ }
532
+ },
533
+ "additionalProperties": false,
534
+ "required": [
535
+ "_id",
536
+ "password",
537
+ "salt",
538
+ "username"
539
+ ]
540
+ },
541
+ "ManagementUserViewModel": {
542
+ "type": "object",
543
+ "properties": {
544
+ "_id": {
545
+ "type": "string"
546
+ },
547
+ "username": {
548
+ "type": "string"
549
+ }
550
+ },
551
+ "additionalProperties": false,
552
+ "required": [
553
+ "_id",
554
+ "username"
555
+ ]
556
+ },
557
+ "DeleteUserByUseridReq": {
558
+ "type": "object",
559
+ "additionalProperties": false
560
+ },
561
+ "DeleteUserByUseridRes": {
562
+ "type": "object",
563
+ "additionalProperties": false
564
+ },
565
+ "GetUserByUseridReq": {
566
+ "type": "object",
567
+ "additionalProperties": false
568
+ },
569
+ "GetUserByUseridRes": {
570
+ "type": "object",
571
+ "properties": {
572
+ "_id": {
573
+ "type": "string"
574
+ },
575
+ "username": {
576
+ "type": "string"
577
+ }
578
+ },
579
+ "additionalProperties": false,
580
+ "required": [
581
+ "_id",
582
+ "username"
583
+ ]
584
+ },
585
+ "GetUserListReq": {
586
+ "type": "object",
587
+ "additionalProperties": false
588
+ },
589
+ "GetUserListRes": {
590
+ "type": "object",
591
+ "properties": {
592
+ "users": {
593
+ "type": "array",
594
+ "items": {
595
+ "type": "object",
596
+ "properties": {
597
+ "_id": {
598
+ "type": "string"
599
+ },
600
+ "username": {
601
+ "type": "string"
602
+ }
603
+ },
604
+ "additionalProperties": false,
605
+ "required": [
606
+ "_id",
607
+ "username"
608
+ ]
609
+ }
610
+ }
611
+ },
612
+ "additionalProperties": false,
613
+ "required": [
614
+ "users"
615
+ ]
616
+ },
617
+ "PostUserLoginReq": {
618
+ "type": "object",
619
+ "properties": {
620
+ "username": {
621
+ "type": "string"
622
+ },
623
+ "password": {
624
+ "type": "string"
625
+ }
626
+ },
627
+ "additionalProperties": false,
628
+ "required": [
629
+ "password",
630
+ "username"
631
+ ]
632
+ },
633
+ "PostUserLoginRes": {
634
+ "type": "object",
635
+ "properties": {
636
+ "user": {
637
+ "type": "object",
638
+ "properties": {
639
+ "_id": {
640
+ "type": "string"
641
+ },
642
+ "username": {
643
+ "type": "string"
644
+ }
645
+ },
646
+ "additionalProperties": false,
647
+ "required": [
648
+ "_id",
649
+ "username"
650
+ ]
651
+ },
652
+ "token": {
653
+ "type": "string"
654
+ }
655
+ },
656
+ "additionalProperties": false,
657
+ "required": [
658
+ "token",
659
+ "user"
660
+ ]
661
+ },
662
+ "PostUserReq": {
663
+ "type": "object",
664
+ "properties": {
665
+ "password": {
666
+ "type": "string"
667
+ },
668
+ "username": {
669
+ "type": "string"
670
+ }
671
+ },
672
+ "additionalProperties": false,
673
+ "required": [
674
+ "password",
675
+ "username"
676
+ ]
677
+ },
678
+ "PostUserRes": {
679
+ "type": "object",
680
+ "properties": {
681
+ "_id": {
682
+ "type": "string"
683
+ },
684
+ "username": {
685
+ "type": "string"
686
+ }
687
+ },
688
+ "additionalProperties": false,
689
+ "required": [
690
+ "_id",
691
+ "username"
692
+ ]
693
+ },
694
+ "PutUserByUseridReq": {
695
+ "type": "object",
696
+ "properties": {
697
+ "password": {
698
+ "type": "string"
699
+ },
700
+ "username": {
701
+ "type": "string"
702
+ }
703
+ },
704
+ "additionalProperties": false
705
+ },
706
+ "PutUserByUseridRes": {
707
+ "type": "object",
708
+ "properties": {
709
+ "_id": {
710
+ "type": "string"
711
+ },
712
+ "username": {
713
+ "type": "string"
714
+ }
715
+ },
716
+ "additionalProperties": false,
717
+ "required": [
718
+ "_id",
719
+ "username"
720
+ ]
721
+ }
722
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- // Generated Wed Mar 02 2022 14:42:30 GMT+0100 (Central European Standard Time)
3
+ // Generated Wed Oct 12 2022 10:03:58 GMT+0200 (Central European Summer Time)
4
4
  require("./generatedHandlers");
5
5
  require("./generatedRepos");
6
6
  require("../src/index");
@@ -0,0 +1,25 @@
1
+ import { Handler, HandlerConfigWithMethod } from "@flink-app/flink";
2
+ export interface ManagementApiEndpoint {
3
+ config: HandlerConfigWithMethod;
4
+ handlerFn: Handler<any>;
5
+ }
6
+ export declare enum ManagementApiType {
7
+ user = "USER",
8
+ managementUser = "MANAGEMENT_USER"
9
+ }
10
+ export interface ManagementApiModule {
11
+ id: string;
12
+ type: ManagementApiType;
13
+ endpoints: ManagementApiEndpoint[];
14
+ ui: Boolean;
15
+ uiSettings?: {
16
+ title: string;
17
+ icon: string;
18
+ };
19
+ }
20
+ export interface ManagementApiOptions {
21
+ token: string;
22
+ baseUrl?: string;
23
+ jwtSecret: string;
24
+ modules: ManagementApiModule[];
25
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ManagementApiType = void 0;
4
+ var ManagementApiType;
5
+ (function (ManagementApiType) {
6
+ ManagementApiType["user"] = "USER";
7
+ ManagementApiType["managementUser"] = "MANAGEMENT_USER";
8
+ })(ManagementApiType = exports.ManagementApiType || (exports.ManagementApiType = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flink-app/management-api-plugin",
3
- "version": "0.3.3",
3
+ "version": "0.3.7",
4
4
  "description": "Flink plugin that makes it possible to expose management api:s for other plugins",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\"",
@@ -23,7 +23,7 @@
23
23
  "jsonwebtoken": "^8.5.1"
24
24
  },
25
25
  "devDependencies": {
26
- "@flink-app/flink": "^0.3.0",
26
+ "@flink-app/flink": "^0.3.7",
27
27
  "@types/bcrypt": "^5.0.0",
28
28
  "@types/express": "4.17.11",
29
29
  "@types/express-fileupload": "^1.1.7",
@@ -32,5 +32,5 @@
32
32
  "ts-node": "^9.1.1",
33
33
  "typescript": "^4.2.4"
34
34
  },
35
- "gitHead": "31ca42f9020b2cfbc3ecbb7308d683135b35b49e"
35
+ "gitHead": "e61be35839aa8d459dc07613d9bfa919570361f2"
36
36
  }