@synergy-server/core 0.0.1 → 0.0.2
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/dist/core/services/app.service.d.ts +7 -6
- package/dist/core/services/common.service.d.ts +24 -5
- package/dist/core/services/controller.service.d.ts +1 -1
- package/dist/core/services/reportToPdf.service.d.ts +1 -1
- package/dist/core/services/seeder.service.d.ts +9 -1
- package/dist/core/services/userAccess.service.d.ts +9 -8
- package/dist/core/services/userRights.service.d.ts +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
interface ReturnObject<T = any> {
|
|
2
|
+
value: T | null;
|
|
3
|
+
message: string;
|
|
4
|
+
status: number | null;
|
|
5
|
+
}
|
|
1
6
|
declare const _default: {
|
|
2
|
-
getSetting(settingName: string): Promise<
|
|
3
|
-
|
|
4
|
-
message: string;
|
|
5
|
-
status: any;
|
|
6
|
-
}>;
|
|
7
|
-
setSetting(settingName: string, settingValue: any, model: string): Promise<Record<string, any>>;
|
|
7
|
+
getSetting(settingName: string): Promise<ReturnObject<any>>;
|
|
8
|
+
setSetting(settingName: string, settingValue: any): Promise<ReturnObject<any>>;
|
|
8
9
|
};
|
|
9
10
|
export default _default;
|
|
@@ -1,10 +1,29 @@
|
|
|
1
1
|
import { Model, ModelStatic } from 'sequelize';
|
|
2
2
|
import { Request } from 'express';
|
|
3
|
+
interface IncludeOptions {
|
|
4
|
+
model: ModelStatic<Model<any, any>>;
|
|
5
|
+
as: string;
|
|
6
|
+
attributes?: string[];
|
|
7
|
+
where?: Record<string, unknown>;
|
|
8
|
+
include?: IncludeOptions[];
|
|
9
|
+
}
|
|
10
|
+
interface TranslateData {
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
lang?: {
|
|
13
|
+
[key: string]: {
|
|
14
|
+
[langCode: string]: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
}
|
|
3
18
|
declare const _default: {
|
|
4
|
-
prepareIncludes(object: ModelStatic<Model<any, any>>, params:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
19
|
+
prepareIncludes(object: ModelStatic<Model<any, any>>, params: {
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
}, attributes?: string[], filters?: Record<string, unknown>, order?: any[], extraAttributes?: string[]): IncludeOptions[] | {
|
|
22
|
+
all: true;
|
|
23
|
+
};
|
|
24
|
+
setAuthor(objectData: Record<string, unknown>, req: Request): Promise<void>;
|
|
25
|
+
executeConditionCode(str: string, args: unknown): unknown;
|
|
26
|
+
translateField(rowData: TranslateData, fieldName: string, langCode: string): string;
|
|
27
|
+
initEnums(): Promise<Record<string, string[]>>;
|
|
9
28
|
};
|
|
10
29
|
export default _default;
|
|
@@ -19,7 +19,7 @@ declare const _default: {
|
|
|
19
19
|
};
|
|
20
20
|
}>;
|
|
21
21
|
findPredefinedItem(req: Request, res: Response, next: NextFunction, object: AppObject, params?: Record<string, any>): Promise<any>;
|
|
22
|
-
createItem(req: Request, res: Response, next: NextFunction, object: AppObject, params?: Record<string, any>, afterCreate?:
|
|
22
|
+
createItem(req: Request, res: Response, next: NextFunction, object: AppObject, params?: Record<string, any>, afterCreate?: Function | undefined): Promise<{
|
|
23
23
|
status: StatusCodes;
|
|
24
24
|
responseData: any;
|
|
25
25
|
}>;
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import { ModelStatic, Model } from 'sequelize';
|
|
2
2
|
import { AppObject } from '@/src/types';
|
|
3
|
+
interface Params {
|
|
4
|
+
event?: 'update' | 'delete';
|
|
5
|
+
oldValue?: AppObject;
|
|
6
|
+
newValue?: Record<string, unknown>;
|
|
7
|
+
objectId?: string;
|
|
8
|
+
changeDeletionMark?: boolean;
|
|
9
|
+
serverModule?: string;
|
|
10
|
+
}
|
|
3
11
|
declare const _default: {
|
|
4
|
-
updateInitialData(object: ModelStatic<Model<any, any>>, filename: string, params?:
|
|
12
|
+
updateInitialData(object: ModelStatic<Model<any, any>>, filename: string, params?: Params): Promise<void>;
|
|
5
13
|
updatePredefinedInitialData(object: AppObject): Promise<void>;
|
|
6
14
|
};
|
|
7
15
|
export default _default;
|
|
@@ -5,17 +5,18 @@ interface UserAccessRole {
|
|
|
5
5
|
canRead: boolean;
|
|
6
6
|
canModify: boolean;
|
|
7
7
|
}
|
|
8
|
+
interface Restrictions {
|
|
9
|
+
use: boolean;
|
|
10
|
+
users: string[];
|
|
11
|
+
}
|
|
8
12
|
declare const _default: {
|
|
9
13
|
getUserAccessRoles(userId: string, canRead?: boolean, canModify?: boolean): Promise<UserAccessRole[]>;
|
|
10
|
-
getUserAccessRoleId(userId:
|
|
11
|
-
getUserRoleByKey(roleKey:
|
|
12
|
-
getUserRoleById(roleId: string): Promise<Record<any, any
|
|
14
|
+
getUserAccessRoleId(userId: string, canRead?: boolean, canModify?: boolean): Promise<Record<any, any>[]>;
|
|
15
|
+
getUserRoleByKey(roleKey: string): Promise<Record<any, any> | null>;
|
|
16
|
+
getUserRoleById(roleId: string): Promise<Record<any, any> | null>;
|
|
13
17
|
checkUserAccess(userId: string, role: Record<string, any>, canRead?: boolean, canModify?: boolean): Promise<boolean | Error>;
|
|
14
|
-
getAllSubDepartments(department: Record<string, any>, include: Record<string, any>): Promise<any[]>;
|
|
15
|
-
accessRestrictions(req: Request, object: AppObject): Promise<
|
|
16
|
-
use: boolean;
|
|
17
|
-
users: any[];
|
|
18
|
-
}>;
|
|
18
|
+
getAllSubDepartments(department: Record<string, any>, include: Record<string, any>): Promise<Record<any, any>[]>;
|
|
19
|
+
accessRestrictions(req: Request, object: AppObject): Promise<Restrictions>;
|
|
19
20
|
getUserAccessNavigation(userId: string): Promise<any[]>;
|
|
20
21
|
};
|
|
21
22
|
export default _default;
|
|
@@ -4,7 +4,7 @@ declare const _default: {
|
|
|
4
4
|
getVendorsAndCustomersFilter(counterparies: string[]): Promise<string[]>;
|
|
5
5
|
getCustomerFilter(req: Request): Promise<{
|
|
6
6
|
fullAccess: boolean;
|
|
7
|
-
counterparties:
|
|
7
|
+
counterparties: string[];
|
|
8
8
|
}>;
|
|
9
9
|
getForwarderFilter(req: Request): Promise<{
|
|
10
10
|
fullAccess: boolean;
|