@flink-app/management-api-plugin 0.5.2 → 0.7.0-alpha.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.
Files changed (33) hide show
  1. package/.flink/generatedHandlers.ts +6 -9
  2. package/.flink/generatedJobs.ts +1 -1
  3. package/.flink/generatedRepos.ts +1 -1
  4. package/.flink/schemas/schemas.json +0 -151
  5. package/.flink/schemas/schemas.ts +1 -1
  6. package/.flink/start.ts +1 -1
  7. package/dist/.flink/generated-schemas.json +270 -0
  8. package/dist/.flink/generatedHandlers.d.ts +227 -9
  9. package/dist/.flink/generatedHandlers.js +6 -6
  10. package/dist/.flink/generatedJobs.js +1 -1
  11. package/dist/.flink/generatedRepos.js +1 -1
  12. package/dist/.flink/schemas/schemas.json +0 -151
  13. package/dist/.flink/schemas.json +722 -0
  14. package/dist/.flink/start.js +1 -1
  15. package/dist/src/handlers/Management/GetManagement.d.ts +0 -2
  16. package/dist/src/handlers/Management/GetManagement.js +0 -3
  17. package/dist/src/handlers/User/DeleteByUserid.d.ts +0 -2
  18. package/dist/src/handlers/User/DeleteByUserid.js +1 -3
  19. package/dist/src/handlers/User/GetByUserid.d.ts +0 -2
  20. package/dist/src/handlers/User/GetByUserid.js +1 -3
  21. package/dist/src/handlers/User/GetList.d.ts +0 -2
  22. package/dist/src/handlers/User/GetList.js +0 -3
  23. package/dist/src/handlers/User/GetMe.d.ts +0 -2
  24. package/dist/src/handlers/User/GetMe.js +0 -3
  25. package/dist/src/handlers/User/Post.d.ts +0 -2
  26. package/dist/src/handlers/User/Post.js +1 -3
  27. package/dist/src/handlers/User/PostLogin.d.ts +0 -2
  28. package/dist/src/handlers/User/PostLogin.js +1 -3
  29. package/dist/src/handlers/User/PutByUserid.d.ts +0 -2
  30. package/dist/src/handlers/User/PutByUserid.js +1 -3
  31. package/dist/src/schemas/ManagementApi.d.ts +25 -0
  32. package/dist/src/schemas/ManagementApi.js +8 -0
  33. package/package.json +3 -3
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- // Generated Mon Apr 24 2023 14:44:34 GMT+0200 (Central European Summer Time)
3
+ // Generated Mon Jul 10 2023 18:13:33 GMT+0200 (Central European Summer Time)
4
4
  require("./generatedHandlers");
5
5
  require("./generatedRepos");
6
6
  require("./generatedJobs");
@@ -4,5 +4,3 @@ import { GetManagementReq } from "../../schemas/Management/GetReq";
4
4
  import { GetManagementRes } from "../../schemas/Management/GetRes";
5
5
  declare const GetManagement: Handler<Ctx, GetManagementReq, GetManagementRes>;
6
6
  export default GetManagement;
7
- export declare const __assumedHttpMethod = "get", __file = "GetManagement.ts", __query: never[], __params: never[];
8
- export declare const __schemas: any;
@@ -36,7 +36,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.__schemas = exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = void 0;
40
39
  var GetManagement = function (_a) {
41
40
  var ctx = _a.ctx, req = _a.req;
42
41
  return __awaiter(void 0, void 0, void 0, function () {
@@ -49,5 +48,3 @@ var GetManagement = function (_a) {
49
48
  });
50
49
  };
51
50
  exports.default = GetManagement;
52
- exports.__assumedHttpMethod = "get", exports.__file = "GetManagement.ts", exports.__query = [], exports.__params = [];
53
- exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": {}, "definitions": {} }, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "modules": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" }, "features": { "type": "array", "items": { "type": "string" } }, "title": { "type": "string" }, "ui": { "type": "string" }, "data": { "type": "object" }, "endpoints": { "type": "array", "items": { "type": "object", "properties": { "method": { "type": "string" }, "url": { "type": "string" } }, "required": ["method", "url"], "additionalProperties": false } } }, "required": ["id", "type", "features", "title", "ui", "data", "endpoints"], "additionalProperties": false } } }, "required": ["modules"], "definitions": {} } };
@@ -5,5 +5,3 @@ import { DeleteUserByUseridRes } from "../../schemas/User/DeleteByUseridRes";
5
5
  export declare const Route: RouteProps;
6
6
  declare const DeleteUserByUserid: Handler<Ctx, DeleteUserByUseridReq, DeleteUserByUseridRes>;
7
7
  export default DeleteUserByUserid;
8
- export declare const __assumedHttpMethod = "delete", __file = "DeleteByUserid.ts", __query: never[], __params: never[];
9
- export declare const __schemas: any;
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.__schemas = exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = exports.Route = void 0;
39
+ exports.Route = void 0;
40
40
  var flink_1 = require("@flink-app/flink");
41
41
  exports.Route = {
42
42
  path: "/user/:userid",
@@ -66,5 +66,3 @@ var DeleteUserByUserid = function (_a) {
66
66
  });
67
67
  };
68
68
  exports.default = DeleteUserByUserid;
69
- exports.__assumedHttpMethod = "delete", exports.__file = "DeleteByUserid.ts", exports.__query = [], exports.__params = [];
70
- exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": {}, "definitions": {} }, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": {}, "definitions": {} } };
@@ -5,5 +5,3 @@ import { Ctx } from "../../Ctx";
5
5
  export declare const Route: RouteProps;
6
6
  declare const GetUserByUserid: Handler<Ctx, GetUserByUseridReq, GetUserByUseridRes>;
7
7
  export default GetUserByUserid;
8
- export declare const __assumedHttpMethod = "get", __file = "GetByUserid.ts", __query: never[], __params: never[];
9
- export declare const __schemas: any;
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.__schemas = exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = exports.Route = void 0;
39
+ exports.Route = void 0;
40
40
  var flink_1 = require("@flink-app/flink");
41
41
  var ManagementUserViewModel_1 = require("../../schemas/ManagementUserViewModel");
42
42
  exports.Route = {
@@ -67,5 +67,3 @@ var GetUserByUserid = function (_a) {
67
67
  });
68
68
  };
69
69
  exports.default = GetUserByUserid;
70
- exports.__assumedHttpMethod = "get", exports.__file = "GetByUserid.ts", exports.__query = [], exports.__params = [];
71
- exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": {}, "definitions": {} }, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "_id": { "type": "string" }, "username": { "type": "string" } }, "required": ["_id", "username"], "definitions": {} } };
@@ -5,5 +5,3 @@ import { Ctx } from "../../Ctx";
5
5
  declare type Params = {};
6
6
  declare const GetUserList: Handler<Ctx, GetUserListReq, GetUserListRes, Params>;
7
7
  export default GetUserList;
8
- export declare const __assumedHttpMethod = "get", __file = "GetList.ts", __query: never[], __params: never[];
9
- export declare const __schemas: any;
@@ -36,7 +36,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.__schemas = exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = void 0;
40
39
  var ManagementUserViewModel_1 = require("../../schemas/ManagementUserViewModel");
41
40
  var GetUserList = function (_a) {
42
41
  var ctx = _a.ctx, req = _a.req;
@@ -60,5 +59,3 @@ var GetUserList = function (_a) {
60
59
  });
61
60
  };
62
61
  exports.default = GetUserList;
63
- exports.__assumedHttpMethod = "get", exports.__file = "GetList.ts", exports.__query = [], exports.__params = [];
64
- exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": {}, "definitions": {} }, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "users": { "type": "array", "items": { "type": "object", "additionalProperties": false, "properties": { "_id": { "type": "string" }, "username": { "type": "string" } }, "required": ["_id", "username"] } } }, "required": ["users"], "definitions": {} } };
@@ -4,5 +4,3 @@ import { GetUserMeReq } from "../../schemas/User/GetMeReq";
4
4
  import { GetUserMeRes } from "../../schemas/User/GetMeRes";
5
5
  declare const GetUserMe: Handler<Ctx, GetUserMeReq, GetUserMeRes>;
6
6
  export default GetUserMe;
7
- export declare const __assumedHttpMethod = "get", __file = "GetMe.ts", __query: never[], __params: never[];
8
- export declare const __schemas: any;
@@ -50,7 +50,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
50
50
  return (mod && mod.__esModule) ? mod : { "default": mod };
51
51
  };
52
52
  Object.defineProperty(exports, "__esModule", { value: true });
53
- exports.__schemas = exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = void 0;
54
53
  var flink_1 = require("@flink-app/flink");
55
54
  var jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
56
55
  var GetUserMe = function (_a) {
@@ -77,5 +76,3 @@ var GetUserMe = function (_a) {
77
76
  });
78
77
  };
79
78
  exports.default = GetUserMe;
80
- exports.__assumedHttpMethod = "get", exports.__file = "GetMe.ts", exports.__query = [], exports.__params = [];
81
- exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": {}, "definitions": {} }, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "user": { "type": "object", "additionalProperties": false, "properties": { "_id": { "type": "string" }, "username": { "type": "string" } }, "required": ["_id", "username"] }, "token": { "type": "string" } }, "required": ["token", "user"], "definitions": {} } };
@@ -6,5 +6,3 @@ export declare const Route: RouteProps;
6
6
  declare type Params = {};
7
7
  declare const PostUser: Handler<Ctx, PostUserReq, PostUserRes, Params>;
8
8
  export default PostUser;
9
- export declare const __assumedHttpMethod = "post", __file = "Post.ts", __query: never[], __params: never[];
10
- export declare const __schemas: any;
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.__schemas = exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = exports.Route = void 0;
39
+ exports.Route = void 0;
40
40
  var flink_1 = require("@flink-app/flink");
41
41
  var bcrypt_1 = require("../../utils/bcrypt");
42
42
  var ManagementUserViewModel_1 = require("../../schemas/ManagementUserViewModel");
@@ -83,5 +83,3 @@ var PostUser = function (_a) {
83
83
  });
84
84
  };
85
85
  exports.default = PostUser;
86
- exports.__assumedHttpMethod = "post", exports.__file = "Post.ts", exports.__query = [], exports.__params = [];
87
- exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "username": { "type": "string" }, "password": { "type": "string" } }, "required": ["password", "username"], "definitions": {} }, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "_id": { "type": "string" }, "username": { "type": "string" } }, "required": ["_id", "username"], "definitions": {} } };
@@ -6,5 +6,3 @@ export declare const Route: RouteProps;
6
6
  declare type Params = {};
7
7
  declare const PostUserLogin: Handler<Ctx, PostUserLoginReq, PostUserLoginRes, Params>;
8
8
  export default PostUserLogin;
9
- export declare const __assumedHttpMethod = "post", __file = "PostLogin.ts", __query: never[], __params: never[];
10
- export declare const __schemas: any;
@@ -39,7 +39,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
39
39
  return (mod && mod.__esModule) ? mod : { "default": mod };
40
40
  };
41
41
  Object.defineProperty(exports, "__esModule", { value: true });
42
- exports.__schemas = exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = exports.Route = void 0;
42
+ exports.Route = void 0;
43
43
  var flink_1 = require("@flink-app/flink");
44
44
  var jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
45
45
  var ManagementUserViewModel_1 = require("../../schemas/ManagementUserViewModel");
@@ -82,5 +82,3 @@ var PostUserLogin = function (_a) {
82
82
  });
83
83
  };
84
84
  exports.default = PostUserLogin;
85
- exports.__assumedHttpMethod = "post", exports.__file = "PostLogin.ts", exports.__query = [], exports.__params = [];
86
- exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "username": { "type": "string" }, "password": { "type": "string" } }, "required": ["password", "username"], "definitions": {} }, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "user": { "type": "object", "additionalProperties": false, "properties": { "_id": { "type": "string" }, "username": { "type": "string" } }, "required": ["_id", "username"] }, "token": { "type": "string" } }, "required": ["token", "user"], "definitions": {} } };
@@ -5,5 +5,3 @@ import { PutUserByUseridRes } from "../../schemas/User/PutByUseridRes";
5
5
  export declare const Route: RouteProps;
6
6
  declare const PutUserByUserid: Handler<Ctx, PutUserByUseridReq, PutUserByUseridRes>;
7
7
  export default PutUserByUserid;
8
- export declare const __assumedHttpMethod = "put", __file = "PutByUserid.ts", __query: never[], __params: never[];
9
- export declare const __schemas: any;
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.__schemas = exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = exports.Route = void 0;
39
+ exports.Route = void 0;
40
40
  var flink_1 = require("@flink-app/flink");
41
41
  var ManagementUserViewModel_1 = require("../../schemas/ManagementUserViewModel");
42
42
  var bcrypt_1 = require("../../utils/bcrypt");
@@ -93,5 +93,3 @@ var PutUserByUserid = function (_a) {
93
93
  });
94
94
  };
95
95
  exports.default = PutUserByUserid;
96
- exports.__assumedHttpMethod = "put", exports.__file = "PutByUserid.ts", exports.__query = [], exports.__params = [];
97
- exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "username": { "type": "string" }, "password": { "type": "string" } }, "definitions": {} }, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "_id": { "type": "string" }, "username": { "type": "string" } }, "required": ["_id", "username"], "definitions": {} } };
@@ -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.5.2",
3
+ "version": "0.7.0-alpha.0",
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.5.0",
26
+ "@flink-app/flink": "^0.7.0-alpha.0",
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": "be187fbc7eaccd2dd18db7e15e703bfa811c9375"
35
+ "gitHead": "1e656eeb0e76d6ad8c6cc48200161aa445e365df"
36
36
  }