@modular-rest/server 1.11.12 → 1.11.14
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.
- package/.nvmrc +1 -0
- package/.prettierrc.json +9 -0
- package/.releaserc.json +24 -0
- package/README.md +79 -94
- package/dist/index.js +79 -0
- package/docs/.keep +0 -0
- package/docs/system-access-type.md +26 -0
- package/package.json +58 -45
- package/src/application.ts +206 -0
- package/src/class/cms_trigger.ts +68 -0
- package/src/class/collection_definition.ts +134 -0
- package/src/class/combinator.ts +176 -0
- package/src/class/database_trigger.ts +99 -0
- package/src/class/db_schemas.ts +44 -0
- package/src/class/{directory.js → directory.ts} +40 -18
- package/src/class/paginator.ts +51 -0
- package/src/class/reply.ts +59 -0
- package/src/class/security.ts +250 -0
- package/src/class/trigger_operator.ts +142 -0
- package/src/class/user.ts +199 -0
- package/src/class/validator.ts +123 -0
- package/src/config.ts +122 -0
- package/src/defult-permissions.ts +31 -0
- package/src/events.ts +59 -0
- package/src/helper/data_insertion.ts +94 -0
- package/src/helper/presetup_services.ts +96 -0
- package/src/index.ts +146 -0
- package/src/middlewares.ts +75 -0
- package/src/play-test.ts +8 -0
- package/src/services/data_provider/router.ts +191 -0
- package/src/services/data_provider/service.ts +305 -0
- package/src/services/data_provider/typeCasters.ts +15 -0
- package/src/services/file/db.ts +29 -0
- package/src/services/file/router.ts +88 -0
- package/src/services/file/service.ts +387 -0
- package/src/services/functions/router.ts +34 -0
- package/src/services/functions/service.ts +203 -0
- package/src/services/jwt/router.ts +73 -0
- package/src/services/jwt/service.ts +139 -0
- package/src/services/user_manager/db.ts +87 -0
- package/src/services/user_manager/permissionManager.ts +49 -0
- package/src/services/user_manager/router.ts +193 -0
- package/src/services/user_manager/service.ts +698 -0
- package/tsconfig.json +16 -9
- package/typedoc.mjs +41 -0
- package/LICENSE +0 -21
- package/package-lock.json +0 -1373
- package/src/application.js +0 -239
- package/src/class/cms_trigger.js +0 -20
- package/src/class/collection_definition.js +0 -33
- package/src/class/combinator.js +0 -133
- package/src/class/database_trigger.js +0 -20
- package/src/class/db_schemas.js +0 -18
- package/src/class/paginator.js +0 -31
- package/src/class/reply.js +0 -37
- package/src/class/security.js +0 -141
- package/src/class/trigger_operator.js +0 -39
- package/src/class/user.js +0 -112
- package/src/class/validator.js +0 -91
- package/src/config.js +0 -67
- package/src/events.js +0 -15
- package/src/helper/data_insertion.js +0 -64
- package/src/helper/presetup_services.js +0 -31
- package/src/index.js +0 -66
- package/src/middlewares.js +0 -44
- package/src/services/data_provider/router.js +0 -552
- package/src/services/data_provider/service.js +0 -262
- package/src/services/data_provider/typeCasters.js +0 -10
- package/src/services/file/db.js +0 -29
- package/src/services/file/router.js +0 -92
- package/src/services/file/service.js +0 -231
- package/src/services/functions/router.js +0 -37
- package/src/services/functions/service.js +0 -74
- package/src/services/jwt/router.js +0 -70
- package/src/services/jwt/service.js +0 -37
- package/src/services/user_manager/db.js +0 -83
- package/src/services/user_manager/permissionManager.js +0 -43
- package/src/services/user_manager/router.js +0 -176
- package/src/services/user_manager/service.js +0 -377
- package/types/application.d.ts +0 -97
- package/types/class/cms_trigger.d.ts +0 -24
- package/types/class/collection_definition.d.ts +0 -36
- package/types/class/combinator.d.ts +0 -30
- package/types/class/database_trigger.d.ts +0 -28
- package/types/class/db_schemas.d.ts +0 -2
- package/types/class/directory.d.ts +0 -2
- package/types/class/paginator.d.ts +0 -8
- package/types/class/reply.d.ts +0 -8
- package/types/class/security.d.ts +0 -109
- package/types/class/trigger_operator.d.ts +0 -19
- package/types/class/user.d.ts +0 -24
- package/types/class/validator.d.ts +0 -9
- package/types/config.d.ts +0 -101
- package/types/events.d.ts +0 -7
- package/types/helper/data_insertion.d.ts +0 -4
- package/types/helper/presetup_services.d.ts +0 -5
- package/types/index.d.ts +0 -72
- package/types/middlewares.d.ts +0 -9
- package/types/services/data_provider/router.d.ts +0 -3
- package/types/services/data_provider/service.d.ts +0 -40
- package/types/services/data_provider/typeCasters.d.ts +0 -3
- package/types/services/file/db.d.ts +0 -3
- package/types/services/file/router.d.ts +0 -3
- package/types/services/file/service.d.ts +0 -81
- package/types/services/functions/router.d.ts +0 -3
- package/types/services/functions/service.d.ts +0 -23
- package/types/services/jwt/router.d.ts +0 -3
- package/types/services/jwt/service.d.ts +0 -10
- package/types/services/user_manager/db.d.ts +0 -3
- package/types/services/user_manager/permissionManager.d.ts +0 -3
- package/types/services/user_manager/router.d.ts +0 -3
- package/types/services/user_manager/service.d.ts +0 -131
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
export const name: "userManager";
|
|
2
|
-
export { instance as main };
|
|
3
|
-
/**
|
|
4
|
-
* import user type
|
|
5
|
-
*/
|
|
6
|
-
export type User = import('../../class/user');
|
|
7
|
-
declare var instance: UserManager;
|
|
8
|
-
/**
|
|
9
|
-
* import user type
|
|
10
|
-
* @typedef {import('../../class/user')} User
|
|
11
|
-
*/
|
|
12
|
-
declare class UserManager {
|
|
13
|
-
static get instance(): UserManager;
|
|
14
|
-
tempIds: {};
|
|
15
|
-
/**
|
|
16
|
-
* Sets a custom method for generating verification codes.
|
|
17
|
-
*
|
|
18
|
-
* @param {Function} generatorMethod - A function that returns a random verification code.
|
|
19
|
-
* @returns {void}
|
|
20
|
-
*/
|
|
21
|
-
setCustomVerificationCodeGeneratorMethod(generatorMethod: Function): void;
|
|
22
|
-
verificationCodeGeneratorMethod: Function;
|
|
23
|
-
/**
|
|
24
|
-
* Get a user by their ID.
|
|
25
|
-
*
|
|
26
|
-
* @param {string} id - The ID of the user.
|
|
27
|
-
* @returns {Promise<User>} A promise that resolves to the user.
|
|
28
|
-
* @throws {Error} If the user is not found.
|
|
29
|
-
*/
|
|
30
|
-
generateVerificationCode(id: string, idType: any): Promise<User>;
|
|
31
|
-
/**
|
|
32
|
-
* Get a user by their ID.
|
|
33
|
-
*
|
|
34
|
-
* @param {string} id - The ID of the user.
|
|
35
|
-
* @returns {Promise<User>} A promise that resolves to the user.
|
|
36
|
-
* @throws {string} If the user is not found.
|
|
37
|
-
*/
|
|
38
|
-
getUserById(id: string): Promise<User>;
|
|
39
|
-
/**
|
|
40
|
-
* Get a user by their identity.
|
|
41
|
-
*
|
|
42
|
-
* @param {string} id - The identity of the user.
|
|
43
|
-
* @param {string} idType - The type of the identity (phone or email).
|
|
44
|
-
* @returns {Promise<User>} A promise that resolves to the user.
|
|
45
|
-
* @throws {string} If the user is not found.
|
|
46
|
-
*/
|
|
47
|
-
getUserByIdentity(id: string, idType: string): Promise<User>;
|
|
48
|
-
/**
|
|
49
|
-
* Get a user by their token.
|
|
50
|
-
*
|
|
51
|
-
* @param {string} token - The token of the user.
|
|
52
|
-
* @returns {Promise<User>} A promise that resolves to the user.
|
|
53
|
-
*/
|
|
54
|
-
getUserByToken(token: string): Promise<User>;
|
|
55
|
-
/**
|
|
56
|
-
* Check if a verification code is valid.
|
|
57
|
-
*
|
|
58
|
-
* @param {string} id - The ID of the user.
|
|
59
|
-
* @param {string} code - The verification code.
|
|
60
|
-
* @returns {boolean} Whether the verification code is valid.
|
|
61
|
-
*/
|
|
62
|
-
isCodeValid(id: string, code: string): boolean;
|
|
63
|
-
/**
|
|
64
|
-
* Login a user and return their token.
|
|
65
|
-
*
|
|
66
|
-
* @param {string} id - The ID of the user.
|
|
67
|
-
* @param {string} idType - The type of the ID (phone or email).
|
|
68
|
-
* @param {string} password - The password of the user.
|
|
69
|
-
* @returns {Promise<string>} A promise that resolves to the token of the user.
|
|
70
|
-
* @throws {string} If the user is not found.
|
|
71
|
-
*/
|
|
72
|
-
loginUser(id?: string, idType?: string, password?: string): Promise<string>;
|
|
73
|
-
/**
|
|
74
|
-
* Issue a token for a user.
|
|
75
|
-
*
|
|
76
|
-
* @param {string} email - The email of the user.
|
|
77
|
-
* @returns {Promise<string>} A promise that resolves to the token of the user.
|
|
78
|
-
* @throws {string} If the user is not found.
|
|
79
|
-
*/
|
|
80
|
-
issueTokenForUser(email: string): Promise<string>;
|
|
81
|
-
/**
|
|
82
|
-
* Login as an anonymous user.
|
|
83
|
-
*
|
|
84
|
-
* @returns {Promise<string>} A promise that resolves to the token of the anonymous user.
|
|
85
|
-
* @throws {string} If the anonymous user is not found.
|
|
86
|
-
*/
|
|
87
|
-
loginAnonymous(): Promise<string>;
|
|
88
|
-
/**
|
|
89
|
-
* Register a temporary ID.
|
|
90
|
-
*
|
|
91
|
-
* @param {string} id - The ID to register.
|
|
92
|
-
* @param {string} type - The type of the ID.
|
|
93
|
-
* @param {string} code - The verification code.
|
|
94
|
-
*/
|
|
95
|
-
registerTemporaryID(id: string, type: string, code: string): void;
|
|
96
|
-
/**
|
|
97
|
-
* Submit a password for a temporary ID.
|
|
98
|
-
*
|
|
99
|
-
* @param {string} id - The ID.
|
|
100
|
-
* @param {string} password - The password.
|
|
101
|
-
* @param {string} code - The verification code.
|
|
102
|
-
* @returns {Promise<boolean>} A promise that resolves to whether the operation was successful.
|
|
103
|
-
*/
|
|
104
|
-
submitPasswordForTemporaryID(id: string, password: string, code: string): Promise<boolean>;
|
|
105
|
-
/**
|
|
106
|
-
* Change the password for a temporary ID.
|
|
107
|
-
*
|
|
108
|
-
* @param {string} id - The ID.
|
|
109
|
-
* @param {string} password - The new password.
|
|
110
|
-
* @param {string} code - The verification code.
|
|
111
|
-
* @returns {Promise<boolean>} A promise that resolves to whether the operation was successful.
|
|
112
|
-
*/
|
|
113
|
-
changePasswordForTemporaryID(id: string, password: string, code: string): Promise<boolean>;
|
|
114
|
-
/**
|
|
115
|
-
* Register a user.
|
|
116
|
-
*
|
|
117
|
-
* @param {Object} detail - The details of the user.
|
|
118
|
-
* @returns {Promise<string>} A promise that resolves to the ID of the new user.
|
|
119
|
-
* @throws {string} If the user could not be registered.
|
|
120
|
-
*/
|
|
121
|
-
registerUser(detail: any): Promise<string>;
|
|
122
|
-
/**
|
|
123
|
-
* Change the password of a user.
|
|
124
|
-
*
|
|
125
|
-
* @param {Object} query - The query to find the user.
|
|
126
|
-
* @param {string} newPass - The new password.
|
|
127
|
-
* @returns {Promise<void>} A promise that resolves when the operation is complete.
|
|
128
|
-
*/
|
|
129
|
-
changePassword(query: any, newPass: string): Promise<void>;
|
|
130
|
-
}
|
|
131
|
-
import User = require("../../class/user");
|