@sdflc/backend-helpers 1.0.76 → 1.0.78
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/README.md +178 -178
- package/build/BaseCore.d.ts +88 -88
- package/build/BaseCore.js +819 -819
- package/build/BaseGateway.d.ts +49 -49
- package/build/BaseGateway.js +484 -483
- package/build/DataCache.d.ts +14 -14
- package/build/DataCache.js +104 -104
- package/build/Database.d.ts +32 -32
- package/build/Database.js +198 -198
- package/build/DbMigratorAndSeeder.d.ts +49 -49
- package/build/DbMigratorAndSeeder.js +238 -228
- package/build/RedisDataLoader.d.ts +41 -41
- package/build/RedisDataLoader.js +248 -248
- package/build/apiContext.d.ts +11 -11
- package/build/apiContext.js +143 -143
- package/build/{BaseController.d.ts → baseController.d.ts} +17 -17
- package/build/{BaseController.js → baseController.js} +66 -66
- package/build/checkItHelpers.d.ts +3 -3
- package/build/checkItHelpers.js +28 -28
- package/build/commonValidators.d.ts +17 -17
- package/build/commonValidators.js +298 -298
- package/build/configBulder.d.ts +2 -2
- package/build/configBulder.js +32 -32
- package/build/constants.d.ts +30 -30
- package/build/constants.js +80 -81
- package/build/dbHelpers.d.ts +43 -43
- package/build/dbHelpers.js +166 -166
- package/build/dbSeeder.d.ts +2 -2
- package/build/dbSeeder.js +92 -82
- package/build/dbTableHelpers.d.ts +11 -11
- package/build/dbTableHelpers.js +110 -110
- package/build/downloadHelpers.d.ts +2 -2
- package/build/downloadHelpers.js +83 -83
- package/build/index.d.ts +21 -21
- package/build/index.js +37 -37
- package/build/interfaces/ApiContext.d.ts +24 -24
- package/build/interfaces/ApiContext.js +2 -2
- package/build/interfaces/ApiContextInterface.d.ts +12 -12
- package/build/interfaces/ApiContextInterface.js +2 -2
- package/build/interfaces/BaseCoreActionsInterface.d.ts +38 -38
- package/build/interfaces/BaseCoreActionsInterface.js +2 -2
- package/build/interfaces/BaseCoreDoAuthOnActionInterface.d.ts +12 -12
- package/build/interfaces/BaseCoreDoAuthOnActionInterface.js +2 -2
- package/build/interfaces/BaseCoreDoingWhatInterface.d.ts +13 -13
- package/build/interfaces/BaseCoreDoingWhatInterface.js +2 -2
- package/build/interfaces/BaseCorePropsInterface.d.ts +36 -36
- package/build/interfaces/BaseCorePropsInterface.js +2 -2
- package/build/interfaces/BaseCoreValidatorsInterface.d.ts +13 -13
- package/build/interfaces/BaseCoreValidatorsInterface.js +2 -2
- package/build/interfaces/BaseGatewayPropsInterface.d.ts +39 -39
- package/build/interfaces/BaseGatewayPropsInterface.js +2 -2
- package/build/interfaces/BuildConfigOptions.d.ts +6 -6
- package/build/interfaces/BuildConfigOptions.js +2 -2
- package/build/interfaces/BuildDefaultResolversOptions.d.ts +17 -17
- package/build/interfaces/BuildDefaultResolversOptions.js +2 -2
- package/build/interfaces/BuildListQueryArgsInterface.d.ts +6 -6
- package/build/interfaces/BuildListQueryArgsInterface.js +2 -2
- package/build/interfaces/CacheInterface.d.ts +15 -15
- package/build/interfaces/CacheInterface.js +2 -2
- package/build/interfaces/CommonValidatorArgs.d.ts +3 -3
- package/build/interfaces/CommonValidatorArgs.js +2 -2
- package/build/interfaces/CoreActionInterface.d.ts +14 -14
- package/build/interfaces/CoreActionInterface.js +2 -2
- package/build/interfaces/CreateUserTokenArgs.d.ts +11 -11
- package/build/interfaces/CreateUserTokenArgs.js +2 -2
- package/build/interfaces/CreateUserTokenResult.d.ts +4 -4
- package/build/interfaces/CreateUserTokenResult.js +2 -2
- package/build/interfaces/DatabaseOptions.d.ts +22 -22
- package/build/interfaces/DatabaseOptions.js +2 -2
- package/build/interfaces/DatabaseReadInterface.d.ts +14 -14
- package/build/interfaces/DatabaseReadInterface.js +2 -2
- package/build/interfaces/DbFieldAddDefaultInterface.d.ts +9 -9
- package/build/interfaces/DbFieldAddDefaultInterface.js +2 -2
- package/build/interfaces/DownloadFileArgs.d.ts +6 -6
- package/build/interfaces/DownloadFileArgs.js +2 -2
- package/build/interfaces/ExtractCredentialsArgs.d.ts +19 -19
- package/build/interfaces/ExtractCredentialsArgs.js +2 -2
- package/build/interfaces/JwtTokenSecretAndSettings.d.ts +5 -5
- package/build/interfaces/JwtTokenSecretAndSettings.js +2 -2
- package/build/interfaces/ListArgsInterface.d.ts +5 -5
- package/build/interfaces/ListArgsInterface.js +2 -2
- package/build/interfaces/LoaderInterface.d.ts +4 -4
- package/build/interfaces/LoaderInterface.js +2 -2
- package/build/interfaces/PaginationInterface.d.ts +7 -7
- package/build/interfaces/PaginationInterface.js +2 -2
- package/build/interfaces/SortItemInterface.d.ts +4 -4
- package/build/interfaces/SortItemInterface.js +2 -2
- package/build/interfaces/UserTokenParams.d.ts +8 -8
- package/build/interfaces/UserTokenParams.js +2 -2
- package/build/interfaces/VerifyUserTokenArgs.d.ts +13 -13
- package/build/interfaces/VerifyUserTokenArgs.js +2 -2
- package/build/interfaces/index.d.ts +28 -28
- package/build/interfaces/index.js +43 -43
- package/build/knexConfigBuilder.d.ts +1 -1
- package/build/knexConfigBuilder.js +80 -80
- package/build/passwordHelpers.d.ts +5 -5
- package/build/passwordHelpers.js +30 -30
- package/build/redisClient.d.ts +17 -17
- package/build/redisClient.js +97 -97
- package/build/resolversHelpers.d.ts +3 -3
- package/build/resolversHelpers.js +62 -62
- package/build/userToken.d.ts +8 -8
- package/build/userToken.js +86 -86
- package/build/utils.d.ts +2 -2
- package/build/utils.js +21 -21
- package/package.json +71 -71
package/build/index.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export * from './constants';
|
|
2
|
-
export * from './interfaces';
|
|
3
|
-
export * from './configBulder';
|
|
4
|
-
export * from './Database';
|
|
5
|
-
export * from './dbHelpers';
|
|
6
|
-
export * from './DbMigratorAndSeeder';
|
|
7
|
-
export * from './dbSeeder';
|
|
8
|
-
export * from './knexConfigBuilder';
|
|
9
|
-
export * from './redisClient';
|
|
10
|
-
export * from './checkItHelpers';
|
|
11
|
-
export * from './DataCache';
|
|
12
|
-
export * from './BaseGateway';
|
|
13
|
-
export * from './BaseCore';
|
|
14
|
-
export * from './apiContext';
|
|
15
|
-
export * from './
|
|
16
|
-
export * from './dbTableHelpers';
|
|
17
|
-
export * from './resolversHelpers';
|
|
18
|
-
export * from './userToken';
|
|
19
|
-
export * from './passwordHelpers';
|
|
20
|
-
export * from './commonValidators';
|
|
21
|
-
export * from './downloadHelpers';
|
|
1
|
+
export * from './constants';
|
|
2
|
+
export * from './interfaces';
|
|
3
|
+
export * from './configBulder';
|
|
4
|
+
export * from './Database';
|
|
5
|
+
export * from './dbHelpers';
|
|
6
|
+
export * from './DbMigratorAndSeeder';
|
|
7
|
+
export * from './dbSeeder';
|
|
8
|
+
export * from './knexConfigBuilder';
|
|
9
|
+
export * from './redisClient';
|
|
10
|
+
export * from './checkItHelpers';
|
|
11
|
+
export * from './DataCache';
|
|
12
|
+
export * from './BaseGateway';
|
|
13
|
+
export * from './BaseCore';
|
|
14
|
+
export * from './apiContext';
|
|
15
|
+
export * from './baseController';
|
|
16
|
+
export * from './dbTableHelpers';
|
|
17
|
+
export * from './resolversHelpers';
|
|
18
|
+
export * from './userToken';
|
|
19
|
+
export * from './passwordHelpers';
|
|
20
|
+
export * from './commonValidators';
|
|
21
|
+
export * from './downloadHelpers';
|
package/build/index.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./constants"), exports);
|
|
18
|
-
__exportStar(require("./interfaces"), exports);
|
|
19
|
-
__exportStar(require("./configBulder"), exports);
|
|
20
|
-
__exportStar(require("./Database"), exports);
|
|
21
|
-
__exportStar(require("./dbHelpers"), exports);
|
|
22
|
-
__exportStar(require("./DbMigratorAndSeeder"), exports);
|
|
23
|
-
__exportStar(require("./dbSeeder"), exports);
|
|
24
|
-
__exportStar(require("./knexConfigBuilder"), exports);
|
|
25
|
-
__exportStar(require("./redisClient"), exports);
|
|
26
|
-
__exportStar(require("./checkItHelpers"), exports);
|
|
27
|
-
__exportStar(require("./DataCache"), exports);
|
|
28
|
-
__exportStar(require("./BaseGateway"), exports);
|
|
29
|
-
__exportStar(require("./BaseCore"), exports);
|
|
30
|
-
__exportStar(require("./apiContext"), exports);
|
|
31
|
-
__exportStar(require("./
|
|
32
|
-
__exportStar(require("./dbTableHelpers"), exports);
|
|
33
|
-
__exportStar(require("./resolversHelpers"), exports);
|
|
34
|
-
__exportStar(require("./userToken"), exports);
|
|
35
|
-
__exportStar(require("./passwordHelpers"), exports);
|
|
36
|
-
__exportStar(require("./commonValidators"), exports);
|
|
37
|
-
__exportStar(require("./downloadHelpers"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./constants"), exports);
|
|
18
|
+
__exportStar(require("./interfaces"), exports);
|
|
19
|
+
__exportStar(require("./configBulder"), exports);
|
|
20
|
+
__exportStar(require("./Database"), exports);
|
|
21
|
+
__exportStar(require("./dbHelpers"), exports);
|
|
22
|
+
__exportStar(require("./DbMigratorAndSeeder"), exports);
|
|
23
|
+
__exportStar(require("./dbSeeder"), exports);
|
|
24
|
+
__exportStar(require("./knexConfigBuilder"), exports);
|
|
25
|
+
__exportStar(require("./redisClient"), exports);
|
|
26
|
+
__exportStar(require("./checkItHelpers"), exports);
|
|
27
|
+
__exportStar(require("./DataCache"), exports);
|
|
28
|
+
__exportStar(require("./BaseGateway"), exports);
|
|
29
|
+
__exportStar(require("./BaseCore"), exports);
|
|
30
|
+
__exportStar(require("./apiContext"), exports);
|
|
31
|
+
__exportStar(require("./baseController"), exports);
|
|
32
|
+
__exportStar(require("./dbTableHelpers"), exports);
|
|
33
|
+
__exportStar(require("./resolversHelpers"), exports);
|
|
34
|
+
__exportStar(require("./userToken"), exports);
|
|
35
|
+
__exportStar(require("./passwordHelpers"), exports);
|
|
36
|
+
__exportStar(require("./commonValidators"), exports);
|
|
37
|
+
__exportStar(require("./downloadHelpers"), exports);
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Interface of application API interface which should be created on receiving of a request
|
|
3
|
-
*/
|
|
4
|
-
export interface ApiContext {
|
|
5
|
-
requestId: string;
|
|
6
|
-
cores: any;
|
|
7
|
-
gateways: any;
|
|
8
|
-
req: any;
|
|
9
|
-
spaceId?: string;
|
|
10
|
-
apiKey?: string;
|
|
11
|
-
managementApiKey?: string;
|
|
12
|
-
userAgent?: string;
|
|
13
|
-
referer?: string;
|
|
14
|
-
ipAddress?: string;
|
|
15
|
-
acceptLanguage?: string;
|
|
16
|
-
languages?: string[];
|
|
17
|
-
requestedLang?: string;
|
|
18
|
-
authorization?: string;
|
|
19
|
-
accountId?: string;
|
|
20
|
-
roleId?: string;
|
|
21
|
-
userId?: string;
|
|
22
|
-
lang?: string;
|
|
23
|
-
[key: string]: any;
|
|
24
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Interface of application API interface which should be created on receiving of a request
|
|
3
|
+
*/
|
|
4
|
+
export interface ApiContext {
|
|
5
|
+
requestId: string;
|
|
6
|
+
cores: any;
|
|
7
|
+
gateways: any;
|
|
8
|
+
req: any;
|
|
9
|
+
spaceId?: string;
|
|
10
|
+
apiKey?: string;
|
|
11
|
+
managementApiKey?: string;
|
|
12
|
+
userAgent?: string;
|
|
13
|
+
referer?: string;
|
|
14
|
+
ipAddress?: string;
|
|
15
|
+
acceptLanguage?: string;
|
|
16
|
+
languages?: string[];
|
|
17
|
+
requestedLang?: string;
|
|
18
|
+
authorization?: string;
|
|
19
|
+
accountId?: string;
|
|
20
|
+
roleId?: string;
|
|
21
|
+
userId?: string;
|
|
22
|
+
lang?: string;
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { BaseCorePropsInterface } from './BaseCorePropsInterface';
|
|
2
|
-
import { BaseGatewayPropsInterface } from './BaseGatewayPropsInterface';
|
|
3
|
-
export interface ApiContextInterface {
|
|
4
|
-
cores: any;
|
|
5
|
-
gateways: any;
|
|
6
|
-
req: any;
|
|
7
|
-
res: any;
|
|
8
|
-
requestId: any;
|
|
9
|
-
getCoreContext?(args: any): Promise<BaseCorePropsInterface>;
|
|
10
|
-
getGatewayContext?(args: any): Promise<BaseGatewayPropsInterface>;
|
|
11
|
-
extendContext?(args: any): any;
|
|
12
|
-
}
|
|
1
|
+
import { BaseCorePropsInterface } from './BaseCorePropsInterface';
|
|
2
|
+
import { BaseGatewayPropsInterface } from './BaseGatewayPropsInterface';
|
|
3
|
+
export interface ApiContextInterface {
|
|
4
|
+
cores: any;
|
|
5
|
+
gateways: any;
|
|
6
|
+
req: any;
|
|
7
|
+
res: any;
|
|
8
|
+
requestId: any;
|
|
9
|
+
getCoreContext?(args: any): Promise<BaseCorePropsInterface>;
|
|
10
|
+
getGatewayContext?(args: any): Promise<BaseGatewayPropsInterface>;
|
|
11
|
+
extendContext?(args: any): any;
|
|
12
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { BaseCore } from '..';
|
|
2
|
-
export interface BaseCoreActionsInterface {
|
|
3
|
-
/**
|
|
4
|
-
* Reference to the core object that processes the request
|
|
5
|
-
*/
|
|
6
|
-
core: BaseCore;
|
|
7
|
-
/**
|
|
8
|
-
* Sets current step when processing an action
|
|
9
|
-
* @param str Name of step
|
|
10
|
-
*/
|
|
11
|
-
setStep?(str: string): void;
|
|
12
|
-
/**
|
|
13
|
-
* The sameRequest is true when we call a core method when handling the same request (actual for GraphQL resolvers)
|
|
14
|
-
*/
|
|
15
|
-
sameRequest?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* The transaction is active when processing some of actions that configured to open transaction
|
|
18
|
-
*/
|
|
19
|
-
hasTransaction?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* The validatedItems exists after validator execution.
|
|
22
|
-
* It is expected that validator return an array in which second element is some
|
|
23
|
-
* items that were read from data or created otherwise during validation
|
|
24
|
-
*/
|
|
25
|
-
validatedItems?: any;
|
|
26
|
-
/**
|
|
27
|
-
* The exception object exists only when exception happened when processing an action
|
|
28
|
-
*/
|
|
29
|
-
exception?: any;
|
|
30
|
-
/**
|
|
31
|
-
* Name of action for exception error messages
|
|
32
|
-
*/
|
|
33
|
-
doingWhat?: string;
|
|
34
|
-
/**
|
|
35
|
-
* Object with incoming request params
|
|
36
|
-
*/
|
|
37
|
-
args?: any;
|
|
38
|
-
}
|
|
1
|
+
import { BaseCore } from '..';
|
|
2
|
+
export interface BaseCoreActionsInterface {
|
|
3
|
+
/**
|
|
4
|
+
* Reference to the core object that processes the request
|
|
5
|
+
*/
|
|
6
|
+
core: BaseCore;
|
|
7
|
+
/**
|
|
8
|
+
* Sets current step when processing an action
|
|
9
|
+
* @param str Name of step
|
|
10
|
+
*/
|
|
11
|
+
setStep?(str: string): void;
|
|
12
|
+
/**
|
|
13
|
+
* The sameRequest is true when we call a core method when handling the same request (actual for GraphQL resolvers)
|
|
14
|
+
*/
|
|
15
|
+
sameRequest?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* The transaction is active when processing some of actions that configured to open transaction
|
|
18
|
+
*/
|
|
19
|
+
hasTransaction?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The validatedItems exists after validator execution.
|
|
22
|
+
* It is expected that validator return an array in which second element is some
|
|
23
|
+
* items that were read from data or created otherwise during validation
|
|
24
|
+
*/
|
|
25
|
+
validatedItems?: any;
|
|
26
|
+
/**
|
|
27
|
+
* The exception object exists only when exception happened when processing an action
|
|
28
|
+
*/
|
|
29
|
+
exception?: any;
|
|
30
|
+
/**
|
|
31
|
+
* Name of action for exception error messages
|
|
32
|
+
*/
|
|
33
|
+
doingWhat?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Object with incoming request params
|
|
36
|
+
*/
|
|
37
|
+
args?: any;
|
|
38
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export interface BaseCoreDoAuthOnActionInterface {
|
|
2
|
-
list?: boolean;
|
|
3
|
-
get?: boolean;
|
|
4
|
-
getMany?: boolean;
|
|
5
|
-
create?: boolean;
|
|
6
|
-
createMany?: boolean;
|
|
7
|
-
update?: boolean;
|
|
8
|
-
updateMany?: boolean;
|
|
9
|
-
set?: boolean;
|
|
10
|
-
remove?: boolean;
|
|
11
|
-
removeMany?: boolean;
|
|
12
|
-
}
|
|
1
|
+
export interface BaseCoreDoAuthOnActionInterface {
|
|
2
|
+
list?: boolean;
|
|
3
|
+
get?: boolean;
|
|
4
|
+
getMany?: boolean;
|
|
5
|
+
create?: boolean;
|
|
6
|
+
createMany?: boolean;
|
|
7
|
+
update?: boolean;
|
|
8
|
+
updateMany?: boolean;
|
|
9
|
+
set?: boolean;
|
|
10
|
+
remove?: boolean;
|
|
11
|
+
removeMany?: boolean;
|
|
12
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export interface BaseCoreDoingWhatInterface {
|
|
2
|
-
list: string;
|
|
3
|
-
get: string;
|
|
4
|
-
getMany: string;
|
|
5
|
-
create: string;
|
|
6
|
-
createMany: string;
|
|
7
|
-
update: string;
|
|
8
|
-
updateMany: string;
|
|
9
|
-
set: string;
|
|
10
|
-
remove: string;
|
|
11
|
-
removeMany: string;
|
|
12
|
-
[key: string]: string;
|
|
13
|
-
}
|
|
1
|
+
export interface BaseCoreDoingWhatInterface {
|
|
2
|
+
list: string;
|
|
3
|
+
get: string;
|
|
4
|
+
getMany: string;
|
|
5
|
+
create: string;
|
|
6
|
+
createMany: string;
|
|
7
|
+
update: string;
|
|
8
|
+
updateMany: string;
|
|
9
|
+
set: string;
|
|
10
|
+
remove: string;
|
|
11
|
+
removeMany: string;
|
|
12
|
+
[key: string]: string;
|
|
13
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { Logger } from '@sdflc/utils';
|
|
2
|
-
import { Database } from '../Database';
|
|
3
|
-
import { BaseGateway } from '../BaseGateway';
|
|
4
|
-
import { BaseCoreValidatorsInterface } from './BaseCoreValidatorsInterface';
|
|
5
|
-
import { BaseCoreDoingWhatInterface } from './BaseCoreDoingWhatInterface';
|
|
6
|
-
import { VerifyUserTokenArgs } from './VerifyUserTokenArgs';
|
|
7
|
-
import { ApiContext } from './ApiContext';
|
|
8
|
-
import { ID_TYPES } from '../constants';
|
|
9
|
-
import { BaseCoreDoAuthOnActionInterface } from './BaseCoreDoAuthOnActionInterface';
|
|
10
|
-
export interface BaseCorePropsInterface {
|
|
11
|
-
/**
|
|
12
|
-
* Application API context with all necessary information about request
|
|
13
|
-
*/
|
|
14
|
-
context: ApiContext;
|
|
15
|
-
/**
|
|
16
|
-
* Database instance to handle queries to DB within one request
|
|
17
|
-
*/
|
|
18
|
-
db: Database;
|
|
19
|
-
/**
|
|
20
|
-
* Name of a gateway that will perform default CRUD operations, it should be initialized in the API context
|
|
21
|
-
*/
|
|
22
|
-
gatewayName: string;
|
|
23
|
-
isProduction: boolean;
|
|
24
|
-
logger: Logger;
|
|
25
|
-
name?: string;
|
|
26
|
-
doAuth: boolean;
|
|
27
|
-
doAuthOnAction?: BaseCoreDoAuthOnActionInterface;
|
|
28
|
-
doingWhat?: BaseCoreDoingWhatInterface;
|
|
29
|
-
validators?: BaseCoreValidatorsInterface;
|
|
30
|
-
spaceGw?: BaseGateway;
|
|
31
|
-
interserviceApiKey?: string;
|
|
32
|
-
jwtSecret?: string;
|
|
33
|
-
verifyTokenArgs?: VerifyUserTokenArgs;
|
|
34
|
-
hasOrderNo?: boolean;
|
|
35
|
-
idType?: ID_TYPES;
|
|
36
|
-
}
|
|
1
|
+
import { Logger } from '@sdflc/utils';
|
|
2
|
+
import { Database } from '../Database';
|
|
3
|
+
import { BaseGateway } from '../BaseGateway';
|
|
4
|
+
import { BaseCoreValidatorsInterface } from './BaseCoreValidatorsInterface';
|
|
5
|
+
import { BaseCoreDoingWhatInterface } from './BaseCoreDoingWhatInterface';
|
|
6
|
+
import { VerifyUserTokenArgs } from './VerifyUserTokenArgs';
|
|
7
|
+
import { ApiContext } from './ApiContext';
|
|
8
|
+
import { ID_TYPES } from '../constants';
|
|
9
|
+
import { BaseCoreDoAuthOnActionInterface } from './BaseCoreDoAuthOnActionInterface';
|
|
10
|
+
export interface BaseCorePropsInterface {
|
|
11
|
+
/**
|
|
12
|
+
* Application API context with all necessary information about request
|
|
13
|
+
*/
|
|
14
|
+
context: ApiContext;
|
|
15
|
+
/**
|
|
16
|
+
* Database instance to handle queries to DB within one request
|
|
17
|
+
*/
|
|
18
|
+
db: Database;
|
|
19
|
+
/**
|
|
20
|
+
* Name of a gateway that will perform default CRUD operations, it should be initialized in the API context
|
|
21
|
+
*/
|
|
22
|
+
gatewayName: string;
|
|
23
|
+
isProduction: boolean;
|
|
24
|
+
logger: Logger;
|
|
25
|
+
name?: string;
|
|
26
|
+
doAuth: boolean;
|
|
27
|
+
doAuthOnAction?: BaseCoreDoAuthOnActionInterface;
|
|
28
|
+
doingWhat?: BaseCoreDoingWhatInterface;
|
|
29
|
+
validators?: BaseCoreValidatorsInterface;
|
|
30
|
+
spaceGw?: BaseGateway;
|
|
31
|
+
interserviceApiKey?: string;
|
|
32
|
+
jwtSecret?: string;
|
|
33
|
+
verifyTokenArgs?: VerifyUserTokenArgs;
|
|
34
|
+
hasOrderNo?: boolean;
|
|
35
|
+
idType?: ID_TYPES;
|
|
36
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { BaseCoreActionsInterface } from './BaseCoreActionsInterface';
|
|
2
|
-
export interface BaseCoreValidatorsInterface {
|
|
3
|
-
list?(params: any, opt?: BaseCoreActionsInterface): Promise<any[]> | any[];
|
|
4
|
-
get?(params: any, opt?: BaseCoreActionsInterface): Promise<any[]> | any[];
|
|
5
|
-
getMany?(params: any, opt?: BaseCoreActionsInterface): Promise<any[]> | any[];
|
|
6
|
-
create?(params: any, opt?: BaseCoreActionsInterface): Promise<any[]> | any[];
|
|
7
|
-
createMany?(params: any, opt?: BaseCoreActionsInterface): Promise<any[]> | any[];
|
|
8
|
-
update?(params: any, opt?: BaseCoreActionsInterface): Promise<any[]> | any[];
|
|
9
|
-
updateMany?(params: any, opt?: BaseCoreActionsInterface): Promise<any[]> | any[];
|
|
10
|
-
set?(params: any, opt?: BaseCoreActionsInterface): Promise<any[]> | any[];
|
|
11
|
-
remove?(params: any, opt?: BaseCoreActionsInterface): Promise<any[]> | any[];
|
|
12
|
-
removeMany?(params: any, opt?: BaseCoreActionsInterface): Promise<any[]> | any[];
|
|
13
|
-
}
|
|
1
|
+
import { BaseCoreActionsInterface } from './BaseCoreActionsInterface';
|
|
2
|
+
export interface BaseCoreValidatorsInterface {
|
|
3
|
+
list?(params: any, opt?: BaseCoreActionsInterface): Promise<any[]> | any[];
|
|
4
|
+
get?(params: any, opt?: BaseCoreActionsInterface): Promise<any[]> | any[];
|
|
5
|
+
getMany?(params: any, opt?: BaseCoreActionsInterface): Promise<any[]> | any[];
|
|
6
|
+
create?(params: any, opt?: BaseCoreActionsInterface): Promise<any[]> | any[];
|
|
7
|
+
createMany?(params: any, opt?: BaseCoreActionsInterface): Promise<any[]> | any[];
|
|
8
|
+
update?(params: any, opt?: BaseCoreActionsInterface): Promise<any[]> | any[];
|
|
9
|
+
updateMany?(params: any, opt?: BaseCoreActionsInterface): Promise<any[]> | any[];
|
|
10
|
+
set?(params: any, opt?: BaseCoreActionsInterface): Promise<any[]> | any[];
|
|
11
|
+
remove?(params: any, opt?: BaseCoreActionsInterface): Promise<any[]> | any[];
|
|
12
|
+
removeMany?(params: any, opt?: BaseCoreActionsInterface): Promise<any[]> | any[];
|
|
13
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { Logger } from '@sdflc/utils';
|
|
2
|
-
import { ApiContext } from '.';
|
|
3
|
-
import { CacheInterface } from '..';
|
|
4
|
-
import { LoaderInterface } from './LoaderInterface';
|
|
5
|
-
import { SortItemInterface } from './SortItemInterface';
|
|
6
|
-
export interface BaseGatewayPropsInterface extends CacheInterface {
|
|
7
|
-
context: ApiContext;
|
|
8
|
-
table?: string;
|
|
9
|
-
idField?: string;
|
|
10
|
-
idFieldUpdateRemove?: string;
|
|
11
|
-
idFieldAs?: string;
|
|
12
|
-
setFields?: string[] | string;
|
|
13
|
-
mergeFields?: string[];
|
|
14
|
-
hasStatus?: boolean;
|
|
15
|
-
hasCreatedBy?: boolean;
|
|
16
|
-
hasUpdatedBy?: boolean;
|
|
17
|
-
hasRemovedBy?: boolean;
|
|
18
|
-
hasCreatedAt?: boolean;
|
|
19
|
-
hasUpdatedAt?: boolean;
|
|
20
|
-
hasRemovedAt?: boolean;
|
|
21
|
-
hasRemovedAtStr?: boolean;
|
|
22
|
-
hasSpace?: boolean;
|
|
23
|
-
hasVersion?: boolean;
|
|
24
|
-
hasLang?: boolean;
|
|
25
|
-
hasUserId?: boolean;
|
|
26
|
-
localizationForField?: string;
|
|
27
|
-
defaultSorting?: SortItemInterface[];
|
|
28
|
-
fieldForKeyword?: string;
|
|
29
|
-
filterByUserField?: string;
|
|
30
|
-
insertChunkSize?: number;
|
|
31
|
-
hardRemove?: boolean;
|
|
32
|
-
loader?: LoaderInterface;
|
|
33
|
-
noCache?: boolean;
|
|
34
|
-
returnFields?: any[];
|
|
35
|
-
activeStatuses?: number[];
|
|
36
|
-
logger: Logger;
|
|
37
|
-
isProduction: boolean;
|
|
38
|
-
usedKeyPrefixes?: any;
|
|
39
|
-
}
|
|
1
|
+
import { Logger } from '@sdflc/utils';
|
|
2
|
+
import { ApiContext } from '.';
|
|
3
|
+
import { CacheInterface } from '..';
|
|
4
|
+
import { LoaderInterface } from './LoaderInterface';
|
|
5
|
+
import { SortItemInterface } from './SortItemInterface';
|
|
6
|
+
export interface BaseGatewayPropsInterface extends CacheInterface {
|
|
7
|
+
context: ApiContext;
|
|
8
|
+
table?: string;
|
|
9
|
+
idField?: string;
|
|
10
|
+
idFieldUpdateRemove?: string;
|
|
11
|
+
idFieldAs?: string;
|
|
12
|
+
setFields?: string[] | string;
|
|
13
|
+
mergeFields?: string[];
|
|
14
|
+
hasStatus?: boolean;
|
|
15
|
+
hasCreatedBy?: boolean;
|
|
16
|
+
hasUpdatedBy?: boolean;
|
|
17
|
+
hasRemovedBy?: boolean;
|
|
18
|
+
hasCreatedAt?: boolean;
|
|
19
|
+
hasUpdatedAt?: boolean;
|
|
20
|
+
hasRemovedAt?: boolean;
|
|
21
|
+
hasRemovedAtStr?: boolean;
|
|
22
|
+
hasSpace?: boolean;
|
|
23
|
+
hasVersion?: boolean;
|
|
24
|
+
hasLang?: boolean;
|
|
25
|
+
hasUserId?: boolean;
|
|
26
|
+
localizationForField?: string;
|
|
27
|
+
defaultSorting?: SortItemInterface[];
|
|
28
|
+
fieldForKeyword?: string;
|
|
29
|
+
filterByUserField?: string;
|
|
30
|
+
insertChunkSize?: number;
|
|
31
|
+
hardRemove?: boolean;
|
|
32
|
+
loader?: LoaderInterface;
|
|
33
|
+
noCache?: boolean;
|
|
34
|
+
returnFields?: any[];
|
|
35
|
+
activeStatuses?: number[];
|
|
36
|
+
logger: Logger;
|
|
37
|
+
isProduction: boolean;
|
|
38
|
+
usedKeyPrefixes?: any;
|
|
39
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export interface BuildConfigOptions {
|
|
2
|
-
envFile?: string;
|
|
3
|
-
envFileExample?: string;
|
|
4
|
-
defaultNodeEnv?: string;
|
|
5
|
-
allowEmptyValues?: boolean;
|
|
6
|
-
}
|
|
1
|
+
export interface BuildConfigOptions {
|
|
2
|
+
envFile?: string;
|
|
3
|
+
envFileExample?: string;
|
|
4
|
+
defaultNodeEnv?: string;
|
|
5
|
+
allowEmptyValues?: boolean;
|
|
6
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export interface BuildDefaultResolvers {
|
|
2
|
-
prefix: string;
|
|
3
|
-
core: string;
|
|
4
|
-
query?: any;
|
|
5
|
-
mutation?: any;
|
|
6
|
-
types?: any;
|
|
7
|
-
disableList?: boolean;
|
|
8
|
-
disableGet?: boolean;
|
|
9
|
-
disableGetMany?: boolean;
|
|
10
|
-
disableCreate?: boolean;
|
|
11
|
-
disableCreateMany?: boolean;
|
|
12
|
-
disableUpdate?: boolean;
|
|
13
|
-
disableUpdateMany?: boolean;
|
|
14
|
-
disableSet?: boolean;
|
|
15
|
-
disableRemove?: boolean;
|
|
16
|
-
disableRemoveMany?: boolean;
|
|
17
|
-
}
|
|
1
|
+
export interface BuildDefaultResolvers {
|
|
2
|
+
prefix: string;
|
|
3
|
+
core: string;
|
|
4
|
+
query?: any;
|
|
5
|
+
mutation?: any;
|
|
6
|
+
types?: any;
|
|
7
|
+
disableList?: boolean;
|
|
8
|
+
disableGet?: boolean;
|
|
9
|
+
disableGetMany?: boolean;
|
|
10
|
+
disableCreate?: boolean;
|
|
11
|
+
disableCreateMany?: boolean;
|
|
12
|
+
disableUpdate?: boolean;
|
|
13
|
+
disableUpdateMany?: boolean;
|
|
14
|
+
disableSet?: boolean;
|
|
15
|
+
disableRemove?: boolean;
|
|
16
|
+
disableRemoveMany?: boolean;
|
|
17
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export interface BuildListQueryArgsInterface {
|
|
2
|
-
filter: any;
|
|
3
|
-
params: any;
|
|
4
|
-
fieldsToUse: any;
|
|
5
|
-
useCache: boolean;
|
|
6
|
-
}
|
|
1
|
+
export interface BuildListQueryArgsInterface {
|
|
2
|
+
filter: any;
|
|
3
|
+
params: any;
|
|
4
|
+
fieldsToUse: any;
|
|
5
|
+
useCache: boolean;
|
|
6
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|