@lenne.tech/nest-server 8.4.0 → 8.6.1
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/common/decorators/restricted.decorator.d.ts +3 -2
- package/dist/core/common/decorators/restricted.decorator.js +29 -8
- package/dist/core/common/decorators/restricted.decorator.js.map +1 -1
- package/dist/core/common/helpers/db.helper.d.ts +1 -1
- package/dist/core/common/helpers/db.helper.js +29 -5
- package/dist/core/common/helpers/db.helper.js.map +1 -1
- package/dist/core/common/helpers/service.helper.d.ts +12 -0
- package/dist/core/common/helpers/service.helper.js +42 -3
- package/dist/core/common/helpers/service.helper.js.map +1 -1
- package/dist/core/common/interfaces/prepare-input-options.interface.d.ts +8 -0
- package/dist/core/common/interfaces/prepare-input-options.interface.js +3 -0
- package/dist/core/common/interfaces/prepare-input-options.interface.js.map +1 -0
- package/dist/core/common/interfaces/prepare-output-options.interface.d.ts +7 -0
- package/dist/core/common/interfaces/prepare-output-options.interface.js +3 -0
- package/dist/core/common/interfaces/prepare-output-options.interface.js.map +1 -0
- package/dist/core/common/interfaces/service-options.interface.d.ts +5 -15
- package/dist/core/common/services/module.service.d.ts +1 -1
- package/dist/core/common/services/module.service.js +14 -8
- package/dist/core/common/services/module.service.js.map +1 -1
- package/dist/core/modules/auth/inputs/core-auth-sign-in.input.d.ts +5 -0
- package/dist/core/modules/auth/inputs/core-auth-sign-in.input.js +34 -0
- package/dist/core/modules/auth/inputs/core-auth-sign-in.input.js.map +1 -0
- package/dist/core/modules/auth/inputs/core-auth-sign-up.input.d.ts +5 -0
- package/dist/core/modules/auth/inputs/core-auth-sign-up.input.js +34 -0
- package/dist/core/modules/auth/inputs/core-auth-sign-up.input.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/server/modules/auth/auth.model.js +2 -2
- package/dist/server/modules/auth/auth.model.js.map +1 -1
- package/dist/server/modules/auth/auth.module.js +7 -2
- package/dist/server/modules/auth/auth.module.js.map +1 -1
- package/dist/server/modules/auth/auth.resolver.d.ts +8 -3
- package/dist/server/modules/auth/auth.resolver.js +33 -10
- package/dist/server/modules/auth/auth.resolver.js.map +1 -1
- package/dist/server/modules/auth/auth.service.d.ts +15 -0
- package/dist/server/modules/auth/auth.service.js +71 -0
- package/dist/server/modules/auth/auth.service.js.map +1 -0
- package/dist/server/modules/auth/inputs/auth-sign-in.input.d.ts +3 -0
- package/dist/server/modules/auth/inputs/auth-sign-in.input.js +18 -0
- package/dist/server/modules/auth/inputs/auth-sign-in.input.js.map +1 -0
- package/dist/server/modules/auth/inputs/auth-sign-up.input.d.ts +5 -0
- package/dist/server/modules/auth/inputs/auth-sign-up.input.js +34 -0
- package/dist/server/modules/auth/inputs/auth-sign-up.input.js.map +1 -0
- package/dist/server/modules/user/user.resolver.js +12 -11
- package/dist/server/modules/user/user.resolver.js.map +1 -1
- package/dist/server/modules/user/user.service.js +0 -4
- package/dist/server/modules/user/user.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/core/common/decorators/restricted.decorator.ts +50 -14
- package/src/core/common/helpers/db.helper.ts +27 -5
- package/src/core/common/helpers/service.helper.ts +72 -2
- package/src/core/common/interfaces/prepare-input-options.interface.ts +11 -0
- package/src/core/common/interfaces/prepare-output-options.interface.ts +10 -0
- package/src/core/common/interfaces/service-options.interface.ts +7 -17
- package/src/core/common/services/module.service.ts +17 -9
- package/src/core/modules/auth/inputs/core-auth-sign-in.input.ts +18 -0
- package/src/core/modules/auth/inputs/core-auth-sign-up.input.ts +18 -0
- package/src/index.ts +4 -0
- package/src/server/modules/auth/auth.model.ts +5 -5
- package/src/server/modules/auth/auth.module.ts +13 -2
- package/src/server/modules/auth/auth.resolver.ts +30 -12
- package/src/server/modules/auth/auth.service.ts +83 -0
- package/src/server/modules/auth/inputs/auth-sign-in.input.ts +10 -0
- package/src/server/modules/auth/inputs/auth-sign-up.input.ts +18 -0
- package/src/server/modules/user/user.resolver.ts +12 -11
- package/src/server/modules/user/user.service.ts +0 -8
|
@@ -6,8 +6,8 @@ export declare type RestrictedType = (string | RequireAtLeastOne<{
|
|
|
6
6
|
roles?: string | string[];
|
|
7
7
|
processType?: ProcessType;
|
|
8
8
|
}, 'memberOf' | 'roles'>)[];
|
|
9
|
-
export declare const Restricted: (...rolesOrMember: RestrictedType) => PropertyDecorator;
|
|
10
|
-
export declare const getRestricted: (object: unknown, propertyKey
|
|
9
|
+
export declare const Restricted: (...rolesOrMember: RestrictedType) => ClassDecorator & PropertyDecorator;
|
|
10
|
+
export declare const getRestricted: (object: unknown, propertyKey?: string) => RestrictedType;
|
|
11
11
|
export declare const checkRestricted: (data: any, user: {
|
|
12
12
|
id: any;
|
|
13
13
|
hasRole: (roles: string[]) => boolean;
|
|
@@ -15,5 +15,6 @@ export declare const checkRestricted: (data: any, user: {
|
|
|
15
15
|
dbObject?: any;
|
|
16
16
|
ignoreUndefined?: boolean;
|
|
17
17
|
processType?: ProcessType;
|
|
18
|
+
removeUndefinedFromResultArray?: boolean;
|
|
18
19
|
throwError?: boolean;
|
|
19
20
|
}, processedObjects?: any[]) => any;
|
|
@@ -11,12 +11,15 @@ const Restricted = (...rolesOrMember) => {
|
|
|
11
11
|
};
|
|
12
12
|
exports.Restricted = Restricted;
|
|
13
13
|
const getRestricted = (object, propertyKey) => {
|
|
14
|
+
if (!propertyKey) {
|
|
15
|
+
return Reflect.getMetadata(restrictedMetaKey, object);
|
|
16
|
+
}
|
|
14
17
|
return Reflect.getMetadata(restrictedMetaKey, object, propertyKey);
|
|
15
18
|
};
|
|
16
19
|
exports.getRestricted = getRestricted;
|
|
17
20
|
const checkRestricted = (data, user, options = {}, processedObjects = []) => {
|
|
18
|
-
var _a
|
|
19
|
-
const config = Object.assign({ ignoreUndefined: true, throwError: true }, options);
|
|
21
|
+
var _a;
|
|
22
|
+
const config = Object.assign({ ignoreUndefined: true, removeUndefinedFromResultArray: true, throwError: true }, options);
|
|
20
23
|
if (!data || typeof data !== 'object') {
|
|
21
24
|
return data;
|
|
22
25
|
}
|
|
@@ -25,13 +28,14 @@ const checkRestricted = (data, user, options = {}, processedObjects = []) => {
|
|
|
25
28
|
}
|
|
26
29
|
processedObjects.push(data);
|
|
27
30
|
if (Array.isArray(data)) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if (data[propertyKey] === undefined && config.ignoreUndefined) {
|
|
32
|
-
continue;
|
|
31
|
+
let result = data.map((item) => (0, exports.checkRestricted)(item, user, config, processedObjects));
|
|
32
|
+
if (!config.throwError && config.removeUndefinedFromResultArray) {
|
|
33
|
+
result = result.filter((item) => item !== undefined);
|
|
33
34
|
}
|
|
34
|
-
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
const validateRestricted = (restricted) => {
|
|
38
|
+
var _a, _b;
|
|
35
39
|
let valid = true;
|
|
36
40
|
if (restricted === null || restricted === void 0 ? void 0 : restricted.length) {
|
|
37
41
|
valid = false;
|
|
@@ -53,6 +57,7 @@ const checkRestricted = (data, user, options = {}, processedObjects = []) => {
|
|
|
53
57
|
});
|
|
54
58
|
if (roles.length) {
|
|
55
59
|
if ((user === null || user === void 0 ? void 0 : user.hasRole(roles)) ||
|
|
60
|
+
((user === null || user === void 0 ? void 0 : user.id) && roles.includes(role_enum_1.RoleEnum.S_USER)) ||
|
|
56
61
|
(roles.includes(role_enum_1.RoleEnum.S_CREATOR) && (0, db_helper_1.getIncludedIds)((_a = config.dbObject) === null || _a === void 0 ? void 0 : _a.createdBy, user))) {
|
|
57
62
|
valid = true;
|
|
58
63
|
}
|
|
@@ -91,6 +96,22 @@ const checkRestricted = (data, user, options = {}, processedObjects = []) => {
|
|
|
91
96
|
}
|
|
92
97
|
}
|
|
93
98
|
}
|
|
99
|
+
return valid;
|
|
100
|
+
};
|
|
101
|
+
const objectRestrictions = (0, exports.getRestricted)(data.constructor);
|
|
102
|
+
const objectIsValid = validateRestricted(objectRestrictions);
|
|
103
|
+
if (!objectIsValid) {
|
|
104
|
+
if (config.throwError) {
|
|
105
|
+
throw new common_1.UnauthorizedException('The current user has no access rights for ' + ((_a = data.constructor) === null || _a === void 0 ? void 0 : _a.name));
|
|
106
|
+
}
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
for (const propertyKey of Object.keys(data)) {
|
|
110
|
+
if (data[propertyKey] === undefined && config.ignoreUndefined) {
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
const restricted = (0, exports.getRestricted)(data, propertyKey);
|
|
114
|
+
const valid = validateRestricted(restricted);
|
|
94
115
|
if (valid) {
|
|
95
116
|
data[propertyKey] = (0, exports.checkRestricted)(data[propertyKey], user, config, processedObjects);
|
|
96
117
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restricted.decorator.js","sourceRoot":"","sources":["../../../../src/core/common/decorators/restricted.decorator.ts"],"names":[],"mappings":";;;AAAA,4BAA0B;AAC1B,2CAAuD;AAEvD,kDAA8C;AAC9C,oDAAsD;AAMtD,MAAM,iBAAiB,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"restricted.decorator.js","sourceRoot":"","sources":["../../../../src/core/common/decorators/restricted.decorator.ts"],"names":[],"mappings":";;;AAAA,4BAA0B;AAC1B,2CAAuD;AAEvD,kDAA8C;AAC9C,oDAAsD;AAMtD,MAAM,iBAAiB,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;AA2BxC,MAAM,UAAU,GAAG,CAAC,GAAG,aAA6B,EAAsC,EAAE;IACjG,OAAO,OAAO,CAAC,QAAQ,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC;AAC5D,CAAC,CAAC;AAFW,QAAA,UAAU,cAErB;AAKK,MAAM,aAAa,GAAG,CAAC,MAAe,EAAE,WAAoB,EAAkB,EAAE;IACrF,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO,OAAO,CAAC,WAA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AC;IAC3D,MAAM,aAAa,GAAG,kBAAkB,CAAC,kBAAkB,CAAC,CAAC;IAC7D,IAAI,CAAC,aAAa,EAAE;QAElB,IAAI,MAAM,CAAC,UAAU,EAAE;YACrB,MAAM,IAAI,8BAAqB,CAAC,4CAA4C,IAAG,MAAA,IAAI,CAAC,WAAW,0CAAE,IAAI,CAAA,CAAC,CAAC;SACxG;QACD,OAAO,IAAI,CAAC;KACb;IAGD,KAAK,MAAM,WAAW,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QAE3C,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,SAAS,IAAI,MAAM,CAAC,eAAe,EAAE;YAC7D,SAAS;SACV;QAGD,MAAM,UAAU,GAAG,IAAA,qBAAa,EAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QACpD,MAAM,KAAK,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;QAG7C,IAAI,KAAK,EAAE;YAET,IAAI,CAAC,WAAW,CAAC,GAAG,IAAA,uBAAe,EAAC,IAAI,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,gBAAgB,CAAC,CAAC;SACxF;aAAM;YAEL,IAAI,MAAM,CAAC,UAAU,EAAE;gBACrB,MAAM,IAAI,8BAAqB,CAAC,4CAA4C,GAAG,WAAW,CAAC,CAAC;aAC7F;YAGD,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC;SAC1B;KACF;IAGD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAlKW,QAAA,eAAe,mBAkK1B"}
|
|
@@ -25,7 +25,7 @@ export declare function getElementsViaIds<T = any>(ids: any | any[], array: T[],
|
|
|
25
25
|
splice?: boolean;
|
|
26
26
|
unique?: boolean;
|
|
27
27
|
}): T[];
|
|
28
|
-
export declare function getPopulateOptions(info: GraphQLResolveInfo,
|
|
28
|
+
export declare function getPopulateOptions(info: GraphQLResolveInfo, dotSeparatedSelect?: string): PopulateOptions[];
|
|
29
29
|
export declare function getPopulatOptionsFromSelections(selectionNodes: readonly SelectionNode[]): PopulateOptions[];
|
|
30
30
|
export declare function getJSONClone<T = any>(obj: T): Partial<T>;
|
|
31
31
|
export declare function objectIdsToStrings(element: any, prepared?: WeakMap<any, any>): any;
|
|
@@ -145,15 +145,39 @@ function getElementsViaIds(ids, array, options = {}) {
|
|
|
145
145
|
return elements;
|
|
146
146
|
}
|
|
147
147
|
exports.getElementsViaIds = getElementsViaIds;
|
|
148
|
-
function getPopulateOptions(info,
|
|
149
|
-
var _a, _b, _c, _d;
|
|
148
|
+
function getPopulateOptions(info, dotSeparatedSelect) {
|
|
149
|
+
var _a, _b, _c, _d, _e, _f;
|
|
150
150
|
const result = [];
|
|
151
151
|
if (!((_a = info === null || info === void 0 ? void 0 : info.fieldNodes) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
152
152
|
return result;
|
|
153
153
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
154
|
+
if (dotSeparatedSelect === null || dotSeparatedSelect === void 0 ? void 0 : dotSeparatedSelect.length) {
|
|
155
|
+
for (const fieldNode of info.fieldNodes) {
|
|
156
|
+
const selects = dotSeparatedSelect.split('.');
|
|
157
|
+
const fieldNodeName = selects.shift();
|
|
158
|
+
if (((_b = fieldNode === null || fieldNode === void 0 ? void 0 : fieldNode.name) === null || _b === void 0 ? void 0 : _b.value) === fieldNodeName && ((_d = (_c = fieldNode === null || fieldNode === void 0 ? void 0 : fieldNode.selectionSet) === null || _c === void 0 ? void 0 : _c.selections) === null || _d === void 0 ? void 0 : _d.length)) {
|
|
159
|
+
if (!selects.length) {
|
|
160
|
+
return getPopulatOptionsFromSelections(fieldNode.selectionSet.selections);
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
let selections = fieldNode.selectionSet.selections;
|
|
164
|
+
do {
|
|
165
|
+
if (!(selections === null || selections === void 0 ? void 0 : selections.length)) {
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
const select = selects.shift();
|
|
169
|
+
for (const selection of selections) {
|
|
170
|
+
if (((_e = selection === null || selection === void 0 ? void 0 : selection.name) === null || _e === void 0 ? void 0 : _e.value) === select) {
|
|
171
|
+
selections = (_f = selection === null || selection === void 0 ? void 0 : selection.selectionSet) === null || _f === void 0 ? void 0 : _f.selections;
|
|
172
|
+
if (!selects.length) {
|
|
173
|
+
return getPopulatOptionsFromSelections(selections);
|
|
174
|
+
}
|
|
175
|
+
break;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
} while (selects.length);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
157
181
|
}
|
|
158
182
|
}
|
|
159
183
|
return result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db.helper.js","sourceRoot":"","sources":["../../../../src/core/common/helpers/db.helper.ts"],"names":[],"mappings":";;;AACA,4BAA4B;AAC5B,uCAAsF;AAuBtF,SAAgB,MAAM,CACpB,MAAW,EACX,GAA0C,EAC1C,UAAgD,MAAM,EACtD,OAA8B;IAG9B,MAAM,MAAM,mBACV,MAAM,EAAE,IAAI,IACT,OAAO,CACX,CAAC;IAGF,IAAI,MAAM,GAAG,MAAa,CAAC;IAC3B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QAC1B,MAAM,GAAG,EAAE,CAAC;KACb;IACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QACvB,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;KACb;IAGD,IAAI,MAAM,CAAC,MAAM,EAAE;QACjB,SAAS,CAAC,GAAG,EAAE,MAAa,CAAC,CAAC;KAC/B;IAGD,IAAI,GAAG,CAAC,MAAM,EAAE;QAEd,IACE,MAAM,CAAC,MAAM;YACb,OAAO,KAAK,MAAM;YAClB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,gBAAK,CAAC,QAAQ,IAAI,CAAC,CAAC,GAAG,YAAY,gBAAK,CAAC,QAAQ,C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repareInputOptions } from '../interfaces/prepare-input-options.interface';
|
|
2
|
+
import { PrepareOutputOptions } from '../interfaces/prepare-output-options.interface';
|
|
3
|
+
import { ServiceOptions } from '../interfaces/service-options.interface';
|
|
1
4
|
export default class ServiceHelper {
|
|
2
5
|
static prepareInput<T = any>(input: T, currentUser: {
|
|
3
6
|
[key: string]: any;
|
|
@@ -29,6 +32,7 @@ export declare function prepareInput<T = any>(input: T, currentUser: {
|
|
|
29
32
|
clone?: boolean;
|
|
30
33
|
getNewArray?: boolean;
|
|
31
34
|
removeUndefined?: boolean;
|
|
35
|
+
targetModel?: new (...args: any[]) => T;
|
|
32
36
|
}): Promise<T>;
|
|
33
37
|
export declare function prepareOutput<T = {
|
|
34
38
|
[key: string]: any;
|
|
@@ -40,3 +44,11 @@ export declare function prepareOutput<T = {
|
|
|
40
44
|
removeUndefined?: boolean;
|
|
41
45
|
targetModel?: new (...args: any[]) => T;
|
|
42
46
|
}): Promise<T | T[] | any>;
|
|
47
|
+
export declare function prepareServiceOptions(serviceOptions: ServiceOptions, options?: {
|
|
48
|
+
clone?: boolean;
|
|
49
|
+
inputType?: any;
|
|
50
|
+
outputType?: any;
|
|
51
|
+
subFieldSelection?: string;
|
|
52
|
+
prepareInput?: PrepareInputOptions;
|
|
53
|
+
prepareOutput?: PrepareOutputOptions;
|
|
54
|
+
}): ServiceOptions;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.prepareOutput = exports.prepareInput = void 0;
|
|
3
|
+
exports.prepareServiceOptions = exports.prepareOutput = exports.prepareInput = void 0;
|
|
4
4
|
const common_1 = require("@nestjs/common");
|
|
5
5
|
const bcrypt = require("bcrypt");
|
|
6
|
+
const class_transformer_1 = require("class-transformer");
|
|
6
7
|
const _ = require("lodash");
|
|
7
8
|
const role_enum_1 = require("../enums/role.enum");
|
|
8
9
|
class ServiceHelper {
|
|
@@ -15,6 +16,7 @@ class ServiceHelper {
|
|
|
15
16
|
}
|
|
16
17
|
exports.default = ServiceHelper;
|
|
17
18
|
async function prepareInput(input, currentUser, options = {}) {
|
|
19
|
+
var _a;
|
|
18
20
|
const config = Object.assign({ checkRoles: false, clone: false, create: false, getNewArray: false, removeUndefined: false }, options);
|
|
19
21
|
if (typeof input !== 'object') {
|
|
20
22
|
return input;
|
|
@@ -31,6 +33,14 @@ async function prepareInput(input, currentUser, options = {}) {
|
|
|
31
33
|
input = _.cloneDeep(input);
|
|
32
34
|
}
|
|
33
35
|
}
|
|
36
|
+
if (config.targetModel && !(input instanceof config.targetModel)) {
|
|
37
|
+
if ((_a = config.targetModel) === null || _a === void 0 ? void 0 : _a.map) {
|
|
38
|
+
input = await config.targetModel.map(input);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
input = (0, class_transformer_1.plainToInstance)(config.targetModel, input);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
34
44
|
if (config.removeUndefined) {
|
|
35
45
|
Object.keys(input).forEach((key) => input[key] === undefined && delete input[key]);
|
|
36
46
|
}
|
|
@@ -62,6 +72,7 @@ async function prepareInput(input, currentUser, options = {}) {
|
|
|
62
72
|
}
|
|
63
73
|
exports.prepareInput = prepareInput;
|
|
64
74
|
async function prepareOutput(output, options = {}) {
|
|
75
|
+
var _a;
|
|
65
76
|
const config = Object.assign({ clone: false, getNewArray: false, removeUndefined: false, targetModel: undefined }, options);
|
|
66
77
|
if (typeof output !== 'object') {
|
|
67
78
|
return output;
|
|
@@ -78,8 +89,13 @@ async function prepareOutput(output, options = {}) {
|
|
|
78
89
|
output = _.cloneDeep(output);
|
|
79
90
|
}
|
|
80
91
|
}
|
|
81
|
-
if (config.targetModel) {
|
|
82
|
-
|
|
92
|
+
if (config.targetModel && !(output instanceof config.targetModel)) {
|
|
93
|
+
if ((_a = config.targetModel) === null || _a === void 0 ? void 0 : _a.map) {
|
|
94
|
+
output = await config.targetModel.map(output);
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
output = (0, class_transformer_1.plainToInstance)(config.targetModel, output);
|
|
98
|
+
}
|
|
83
99
|
}
|
|
84
100
|
if (output.password) {
|
|
85
101
|
output.password = undefined;
|
|
@@ -96,4 +112,27 @@ async function prepareOutput(output, options = {}) {
|
|
|
96
112
|
return output;
|
|
97
113
|
}
|
|
98
114
|
exports.prepareOutput = prepareOutput;
|
|
115
|
+
function prepareServiceOptions(serviceOptions, options) {
|
|
116
|
+
var _a;
|
|
117
|
+
const config = Object.assign({ clone: true }, options);
|
|
118
|
+
if (serviceOptions && config.clone) {
|
|
119
|
+
serviceOptions = _.cloneDeep(serviceOptions);
|
|
120
|
+
}
|
|
121
|
+
serviceOptions = serviceOptions || {};
|
|
122
|
+
serviceOptions.inputType = serviceOptions.inputType || (options === null || options === void 0 ? void 0 : options.inputType);
|
|
123
|
+
serviceOptions.outputType = serviceOptions.outputType || (options === null || options === void 0 ? void 0 : options.outputType);
|
|
124
|
+
if (!serviceOptions.prepareInput && 'prepareInput' in config) {
|
|
125
|
+
serviceOptions.prepareInput = config.prepareInput;
|
|
126
|
+
}
|
|
127
|
+
if (!serviceOptions.prepareOutput && 'prepareOutput' in config) {
|
|
128
|
+
serviceOptions.prepareOutput = config.prepareOutput;
|
|
129
|
+
}
|
|
130
|
+
if (config.subFieldSelection) {
|
|
131
|
+
if ((_a = serviceOptions.fieldSelection) === null || _a === void 0 ? void 0 : _a.select) {
|
|
132
|
+
serviceOptions.fieldSelection.select += '.' + config.subFieldSelection;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return serviceOptions;
|
|
136
|
+
}
|
|
137
|
+
exports.prepareServiceOptions = prepareServiceOptions;
|
|
99
138
|
//# sourceMappingURL=service.helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.helper.js","sourceRoot":"","sources":["../../../../src/core/common/helpers/service.helper.ts"],"names":[],"mappings":";;;AAAA,2CAAuD;AACvD,iCAAiC;AACjC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R,OAAO,CACX,CAAC;IAGF,IAAI,cAAc,IAAI,MAAM,CAAC,KAAK,EAAE;QAClC,cAAc,GAAG,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;KAC9C;IAGD,cAAc,GAAG,cAAc,IAAI,EAAE,CAAC;IAGtC,cAAc,CAAC,SAAS,GAAG,cAAc,CAAC,SAAS,KAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,CAAA,CAAC;IAC1E,cAAc,CAAC,UAAU,GAAG,cAAc,CAAC,UAAU,KAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,CAAA,CAAC;IAG7E,IAAI,CAAC,cAAc,CAAC,YAAY,IAAI,cAAc,IAAI,MAAM,EAAE;QAC5D,cAAc,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;KACnD;IACD,IAAI,CAAC,cAAc,CAAC,aAAa,IAAI,eAAe,IAAI,MAAM,EAAE;QAC9D,cAAc,CAAC,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;KACrD;IAGD,IAAI,MAAM,CAAC,iBAAiB,EAAE;QAC5B,IAAI,MAAC,cAAc,CAAC,cAAkC,0CAAE,MAAM,EAAE;YAC7D,cAAc,CAAC,cAAkC,CAAC,MAAM,IAAI,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC;SAC7F;KACF;IAGD,OAAO,cAAc,CAAC;AACxB,CAAC;AA9CD,sDA8CC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepare-input-options.interface.js","sourceRoot":"","sources":["../../../../src/core/common/interfaces/prepare-input-options.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepare-output-options.interface.js","sourceRoot":"","sources":["../../../../src/core/common/interfaces/prepare-output-options.interface.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Model } from 'mongoose';
|
|
2
2
|
import { FieldSelection } from '../types/field-selection.type';
|
|
3
|
+
import { PrepareInputOptions } from './prepare-input-options.interface';
|
|
4
|
+
import { PrepareOutputOptions } from './prepare-output-options.interface';
|
|
3
5
|
export interface ServiceOptions {
|
|
4
6
|
[key: string]: any;
|
|
5
7
|
checkRights?: boolean;
|
|
@@ -10,25 +12,13 @@ export interface ServiceOptions {
|
|
|
10
12
|
};
|
|
11
13
|
fieldSelection?: FieldSelection;
|
|
12
14
|
inputType?: new (...params: any[]) => any;
|
|
15
|
+
outputType?: new (...params: any[]) => any;
|
|
13
16
|
processFieldSelection?: {
|
|
14
17
|
model?: new (...args: any[]) => any;
|
|
15
18
|
dbModel?: Model<any>;
|
|
16
19
|
};
|
|
17
|
-
prepareInput?:
|
|
18
|
-
|
|
19
|
-
create?: boolean;
|
|
20
|
-
clone?: boolean;
|
|
21
|
-
getNewArray?: boolean;
|
|
22
|
-
removeUndefined?: boolean;
|
|
23
|
-
};
|
|
24
|
-
prepareOutput?: {
|
|
25
|
-
[key: string]: any;
|
|
26
|
-
clone?: boolean;
|
|
27
|
-
getNewArray?: boolean;
|
|
28
|
-
removeUndefined?: boolean;
|
|
29
|
-
targetModel?: new (...args: any[]) => any;
|
|
30
|
-
};
|
|
20
|
+
prepareInput?: PrepareInputOptions;
|
|
21
|
+
prepareOutput?: PrepareOutputOptions;
|
|
31
22
|
pubSub?: boolean;
|
|
32
|
-
resultType?: new (...params: any[]) => any;
|
|
33
23
|
roles?: string | string[];
|
|
34
24
|
}
|
|
@@ -31,7 +31,7 @@ export declare abstract class ModuleService<T extends CoreModel = any> {
|
|
|
31
31
|
input?: any;
|
|
32
32
|
serviceOptions?: ServiceOptions;
|
|
33
33
|
}): Promise<any>;
|
|
34
|
-
prepareInput(input: Record<string, any>, options?: ServiceOptions): Promise<
|
|
34
|
+
prepareInput(input: Record<string, any>, options?: ServiceOptions): Promise<any>;
|
|
35
35
|
prepareOutput(output: any, options?: ServiceOptions): Promise<any>;
|
|
36
36
|
processFieldSelection(data: any, fieldsSelection: FieldSelection, options?: {
|
|
37
37
|
model?: new (...args: any[]) => T;
|
|
@@ -18,7 +18,11 @@ class ModuleService {
|
|
|
18
18
|
async process(serviceFunc, options) {
|
|
19
19
|
const config = Object.assign({ checkRights: true, dbObject: options === null || options === void 0 ? void 0 : options.dbObject, input: options === null || options === void 0 ? void 0 : options.input, processFieldSelection: {}, prepareInput: {}, prepareOutput: {}, pubSub: true }, options === null || options === void 0 ? void 0 : options.serviceOptions);
|
|
20
20
|
if (config.prepareInput && this.prepareInput) {
|
|
21
|
-
|
|
21
|
+
const opts = config.prepareInput;
|
|
22
|
+
if (!opts.targetModel && config.inputType) {
|
|
23
|
+
opts.targetModel = config.inputType;
|
|
24
|
+
}
|
|
25
|
+
await this.prepareInput(config.input, opts);
|
|
22
26
|
}
|
|
23
27
|
if (config.dbObject && config.checkRights && this.checkRights) {
|
|
24
28
|
if (typeof config.dbObject === 'string' || config.dbObject instanceof mongoose_1.Types.ObjectId) {
|
|
@@ -31,7 +35,7 @@ class ModuleService {
|
|
|
31
35
|
if (config.input && config.checkRights && this.checkRights) {
|
|
32
36
|
const opts = { dbObject: config.dbObject, processType: process_type_enum_1.ProcessType.INPUT, roles: config.roles };
|
|
33
37
|
if (config.inputType) {
|
|
34
|
-
opts.metatype = config.
|
|
38
|
+
opts.metatype = config.inputType;
|
|
35
39
|
}
|
|
36
40
|
config.input = await this.checkRights(config.input, config.currentUser, opts);
|
|
37
41
|
}
|
|
@@ -40,10 +44,11 @@ class ModuleService {
|
|
|
40
44
|
await this.processFieldSelection(result, config.fieldSelection, config.processFieldSelection);
|
|
41
45
|
}
|
|
42
46
|
if (config.prepareOutput && this.prepareOutput) {
|
|
43
|
-
|
|
44
|
-
|
|
47
|
+
const opts = config.prepareOutput;
|
|
48
|
+
if (!opts.targetModel && config.outputType) {
|
|
49
|
+
opts.targetModel = config.outputType;
|
|
45
50
|
}
|
|
46
|
-
result = await this.prepareOutput(result,
|
|
51
|
+
result = await this.prepareOutput(result, opts);
|
|
47
52
|
}
|
|
48
53
|
if (config.checkRights && this.checkRights) {
|
|
49
54
|
const opts = {
|
|
@@ -52,15 +57,16 @@ class ModuleService {
|
|
|
52
57
|
roles: config.roles,
|
|
53
58
|
throwError: false,
|
|
54
59
|
};
|
|
55
|
-
if (config.
|
|
56
|
-
opts.metatype = config.
|
|
60
|
+
if (config.outputType) {
|
|
61
|
+
opts.metatype = config.outputType;
|
|
57
62
|
}
|
|
58
63
|
result = await this.checkRights(result, config.currentUser, opts);
|
|
59
64
|
}
|
|
60
65
|
return result;
|
|
61
66
|
}
|
|
62
67
|
async prepareInput(input, options = {}) {
|
|
63
|
-
|
|
68
|
+
const config = Object.assign({ targetModel: this.mainModelConstructor }, options === null || options === void 0 ? void 0 : options.prepareInput);
|
|
69
|
+
return (0, service_helper_1.prepareInput)(input, options.currentUser, config);
|
|
64
70
|
}
|
|
65
71
|
async prepareOutput(output, options = {}) {
|
|
66
72
|
const config = Object.assign({ targetModel: this.mainModelConstructor }, options === null || options === void 0 ? void 0 : options.prepareOutput);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.service.js","sourceRoot":"","sources":["../../../../src/core/common/services/module.service.ts"],"names":[],"mappings":";;;AAAA,uCAAkD;AAClD,kEAAyD;AACzD,oDAA+D;AAC/D,0DAAgD;AAChD,8DAAwE;AAQxE,MAAsB,aAAa;IAcjC,YAAsB,OAGrB;QACC,IAAI,CAAC,WAAW,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,CAAC;QACxC,IAAI,CAAC,oBAAoB,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,oBAAoB,CAAC;IAC5D,CAAC;IAKD,WAAW,CACT,KAAU,EACV,WAA+D,EAC/D,OAMC;QAED,MAAM,MAAM,mBACV,QAAQ,EAAE,IAAI,CAAC,oBAAoB,IAChC,OAAO,CACX,CAAC;QACF,OAAO,IAAA,oBAAK,EAAC,KAAK,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC;IAUD,KAAK,CAAC,OAAO,CACX,WAAoG,EACpG,OAKC;QAGD,MAAM,MAAM,mBACV,WAAW,EAAE,IAAI,EACjB,QAAQ,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,EAC3B,KAAK,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,EACrB,qBAAqB,EAAE,EAAE,EACzB,YAAY,EAAE,EAAE,EAChB,aAAa,EAAE,EAAE,EACjB,MAAM,EAAE,IAAI,IACT,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,cAAc,CAC3B,CAAC;QAGF,IAAI,MAAM,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY,EAAE;YAC5C,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"module.service.js","sourceRoot":"","sources":["../../../../src/core/common/services/module.service.ts"],"names":[],"mappings":";;;AAAA,uCAAkD;AAClD,kEAAyD;AACzD,oDAA+D;AAC/D,0DAAgD;AAChD,8DAAwE;AAQxE,MAAsB,aAAa;IAcjC,YAAsB,OAGrB;QACC,IAAI,CAAC,WAAW,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,CAAC;QACxC,IAAI,CAAC,oBAAoB,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,oBAAoB,CAAC;IAC5D,CAAC;IAKD,WAAW,CACT,KAAU,EACV,WAA+D,EAC/D,OAMC;QAED,MAAM,MAAM,mBACV,QAAQ,EAAE,IAAI,CAAC,oBAAoB,IAChC,OAAO,CACX,CAAC;QACF,OAAO,IAAA,oBAAK,EAAC,KAAK,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC;IAUD,KAAK,CAAC,OAAO,CACX,WAAoG,EACpG,OAKC;QAGD,MAAM,MAAM,mBACV,WAAW,EAAE,IAAI,EACjB,QAAQ,EAAE,OAAO,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AC,CAAC;SAC1E;QAGD,OAAO,MAAM,CAAC;IAChB,CAAC;IAKD,KAAK,CAAC,YAAY,CAAC,KAA0B,EAAE,UAA0B,EAAE;QACzE,MAAM,MAAM,mBACV,WAAW,EAAE,IAAI,CAAC,oBAAoB,IACnC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY,CACzB,CAAC;QACF,OAAO,IAAA,6BAAY,EAAC,KAAK,EAAE,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAC1D,CAAC;IAKD,KAAK,CAAC,aAAa,CAAC,MAAW,EAAE,UAA0B,EAAE;QAC3D,MAAM,MAAM,mBACV,WAAW,EAAE,IAAI,CAAC,oBAAoB,IACnC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,aAAa,CAC1B,CAAC;QACF,OAAO,IAAA,8BAAa,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,CAAC;IAMD,KAAK,CAAC,qBAAqB,CACzB,IAAS,EACT,eAA+B,EAC/B,UAGI,EAAE;QAEN,MAAM,MAAM,mBACV,KAAK,EAAE,IAAI,CAAC,oBAAoB,EAChC,OAAO,EAAE,IAAI,CAAC,WAAW,IACtB,OAAO,CACX,CAAC;QACF,OAAO,IAAA,qBAAS,EAAC,IAAI,EAAE,eAAe,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACxE,CAAC;CACF;AAhLD,sCAgLC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CoreAuthSignInInput = void 0;
|
|
13
|
+
const graphql_1 = require("@nestjs/graphql");
|
|
14
|
+
const core_input_input_1 = require("../../../common/inputs/core-input.input");
|
|
15
|
+
let CoreAuthSignInInput = class CoreAuthSignInInput extends core_input_input_1.CoreInput {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.email = undefined;
|
|
19
|
+
this.password = undefined;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, graphql_1.Field)({ description: 'Email', nullable: false }),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], CoreAuthSignInInput.prototype, "email", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, graphql_1.Field)({ description: 'Password', nullable: false }),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], CoreAuthSignInInput.prototype, "password", void 0);
|
|
30
|
+
CoreAuthSignInInput = __decorate([
|
|
31
|
+
(0, graphql_1.InputType)({ description: 'Sign-in input' })
|
|
32
|
+
], CoreAuthSignInInput);
|
|
33
|
+
exports.CoreAuthSignInInput = CoreAuthSignInInput;
|
|
34
|
+
//# sourceMappingURL=core-auth-sign-in.input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-auth-sign-in.input.js","sourceRoot":"","sources":["../../../../../src/core/modules/auth/inputs/core-auth-sign-in.input.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmD;AACnD,8EAAoE;AAMpE,IAAa,mBAAmB,GAAhC,MAAa,mBAAoB,SAAQ,4BAAS;IAAlD;;QAME,UAAK,GAAW,SAAS,CAAC;QAG1B,aAAQ,GAAW,SAAS,CAAC;IAC/B,CAAC;CAAA,CAAA;AAJC;IADC,IAAA,eAAK,EAAC,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;kDACvB;AAG1B;IADC,IAAA,eAAK,EAAC,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;qDACvB;AATlB,mBAAmB;IAD/B,IAAA,mBAAS,EAAC,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;GAC/B,mBAAmB,CAU/B;AAVY,kDAAmB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CoreAuthSignUpInput = void 0;
|
|
13
|
+
const graphql_1 = require("@nestjs/graphql");
|
|
14
|
+
const core_input_input_1 = require("../../../common/inputs/core-input.input");
|
|
15
|
+
let CoreAuthSignUpInput = class CoreAuthSignUpInput extends core_input_input_1.CoreInput {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.email = undefined;
|
|
19
|
+
this.password = undefined;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, graphql_1.Field)({ description: 'Email', nullable: false }),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], CoreAuthSignUpInput.prototype, "email", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, graphql_1.Field)({ description: 'Password', nullable: false }),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], CoreAuthSignUpInput.prototype, "password", void 0);
|
|
30
|
+
CoreAuthSignUpInput = __decorate([
|
|
31
|
+
(0, graphql_1.InputType)({ description: 'Sign-up input' })
|
|
32
|
+
], CoreAuthSignUpInput);
|
|
33
|
+
exports.CoreAuthSignUpInput = CoreAuthSignUpInput;
|
|
34
|
+
//# sourceMappingURL=core-auth-sign-up.input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-auth-sign-up.input.js","sourceRoot":"","sources":["../../../../../src/core/modules/auth/inputs/core-auth-sign-up.input.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmD;AACnD,8EAAoE;AAMpE,IAAa,mBAAmB,GAAhC,MAAa,mBAAoB,SAAQ,4BAAS;IAAlD;;QAME,UAAK,GAAW,SAAS,CAAC;QAG1B,aAAQ,GAAW,SAAS,CAAC;IAC/B,CAAC;CAAA,CAAA;AAJC;IADC,IAAA,eAAK,EAAC,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;kDACvB;AAG1B;IADC,IAAA,eAAK,EAAC,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;qDACvB;AATlB,mBAAmB;IAD/B,IAAA,mBAAS,EAAC,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;GAC/B,mBAAmB,CAU/B;AAVY,kDAAmB"}
|