@mondaydotcomorg/monday-authorization 3.5.3-feat-shaime-support-entity-attributes-in-authorization-sdk-a77c130 → 3.7.0-feat-shaime-support-entity-attributes-4-49e1de0
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/authorization-attributes-ms-service.d.ts +6 -8
- package/dist/authorization-attributes-ms-service.d.ts.map +1 -1
- package/dist/authorization-attributes-ms-service.js +13 -75
- package/dist/authorization-attributes-service.d.ts +1 -2
- package/dist/authorization-attributes-service.d.ts.map +1 -1
- package/dist/authorization-attributes-service.js +0 -1
- package/dist/authorization-attributes-sns-service.d.ts +4 -3
- package/dist/authorization-attributes-sns-service.d.ts.map +1 -1
- package/dist/authorization-middleware.d.ts +2 -2
- package/dist/authorization-middleware.d.ts.map +1 -1
- package/dist/authorization-service.d.ts +3 -3
- package/dist/authorization-service.d.ts.map +1 -1
- package/dist/base-attribute-assignment.d.ts +2 -0
- package/dist/base-attribute-assignment.d.ts.map +1 -1
- package/dist/base-attribute-assignment.js +11 -18
- package/dist/entity-attribute-assignment.js +1 -1
- package/dist/entity-attributes-constants.d.ts +6 -6
- package/dist/entity-attributes-constants.d.ts.map +1 -1
- package/dist/entity-attributes-constants.js +7 -5
- package/dist/errors/argument-error.d.ts.map +1 -1
- package/dist/errors/argument-error.js +0 -1
- package/dist/esm/authorization-attributes-ms-service.d.ts +6 -8
- package/dist/esm/authorization-attributes-ms-service.d.ts.map +1 -1
- package/dist/esm/authorization-attributes-ms-service.mjs +13 -75
- package/dist/esm/authorization-attributes-service.d.ts +1 -2
- package/dist/esm/authorization-attributes-service.d.ts.map +1 -1
- package/dist/esm/authorization-attributes-service.mjs +0 -1
- package/dist/esm/authorization-attributes-sns-service.d.ts +4 -3
- package/dist/esm/authorization-attributes-sns-service.d.ts.map +1 -1
- package/dist/esm/authorization-middleware.d.ts +2 -2
- package/dist/esm/authorization-middleware.d.ts.map +1 -1
- package/dist/esm/authorization-service.d.ts +3 -3
- package/dist/esm/authorization-service.d.ts.map +1 -1
- package/dist/esm/base-attribute-assignment.d.ts +2 -0
- package/dist/esm/base-attribute-assignment.d.ts.map +1 -1
- package/dist/esm/base-attribute-assignment.mjs +7 -18
- package/dist/esm/entity-attribute-assignment.mjs +1 -1
- package/dist/esm/entity-attributes-constants.d.ts +6 -6
- package/dist/esm/entity-attributes-constants.d.ts.map +1 -1
- package/dist/esm/entity-attributes-constants.mjs +8 -6
- package/dist/esm/errors/argument-error.d.ts.map +1 -1
- package/dist/esm/errors/argument-error.mjs +0 -1
- package/dist/esm/index.d.ts +0 -9
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.mjs +0 -7
- package/dist/esm/prometheus-service.d.ts +2 -1
- package/dist/esm/prometheus-service.d.ts.map +1 -1
- package/dist/esm/resource-attribute-assignment.d.ts +1 -1
- package/dist/esm/resource-attribute-assignment.d.ts.map +1 -1
- package/dist/esm/resource-attributes-constants.d.ts +12 -2
- package/dist/esm/resource-attributes-constants.d.ts.map +1 -1
- package/dist/esm/resource-attributes-constants.mjs +15 -12
- package/dist/esm/types/authorization-attributes-contracts.d.ts +1 -1
- package/dist/esm/types/authorization-attributes-contracts.d.ts.map +1 -1
- package/dist/esm/types/authorization-attributes-service.interface.d.ts +4 -3
- package/dist/esm/types/authorization-attributes-service.interface.d.ts.map +1 -1
- package/dist/esm/types/general.d.ts +2 -1
- package/dist/esm/types/general.d.ts.map +1 -1
- package/dist/esm/utils/validation.d.ts +30 -30
- package/dist/esm/utils/validation.d.ts.map +1 -1
- package/dist/esm/utils/validation.mjs +121 -86
- package/dist/index.d.ts +0 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -15
- package/dist/prometheus-service.d.ts +2 -1
- package/dist/prometheus-service.d.ts.map +1 -1
- package/dist/resource-attribute-assignment.d.ts +1 -1
- package/dist/resource-attribute-assignment.d.ts.map +1 -1
- package/dist/resource-attributes-constants.d.ts +12 -2
- package/dist/resource-attributes-constants.d.ts.map +1 -1
- package/dist/resource-attributes-constants.js +14 -11
- package/dist/types/authorization-attributes-contracts.d.ts +1 -1
- package/dist/types/authorization-attributes-contracts.d.ts.map +1 -1
- package/dist/types/authorization-attributes-service.interface.d.ts +4 -3
- package/dist/types/authorization-attributes-service.interface.d.ts.map +1 -1
- package/dist/types/general.d.ts +2 -1
- package/dist/types/general.d.ts.map +1 -1
- package/dist/utils/validation.d.ts +30 -30
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validation.js +125 -86
- package/package.json +4 -3
- package/src/authorization-attributes-ms-service.ts +20 -97
- package/src/authorization-attributes-service.ts +1 -2
- package/src/authorization-attributes-sns-service.ts +3 -3
- package/src/authorization-middleware.ts +2 -2
- package/src/authorization-service.ts +4 -4
- package/src/base-attribute-assignment.ts +14 -23
- package/src/entity-attribute-assignment.ts +1 -1
- package/src/entity-attributes-constants.ts +6 -6
- package/src/errors/argument-error.ts +0 -1
- package/src/index.ts +0 -9
- package/src/prometheus-service.ts +3 -1
- package/src/resource-attribute-assignment.ts +1 -1
- package/src/resource-attributes-constants.ts +13 -21
- package/src/types/authorization-attributes-contracts.ts +0 -2
- package/src/types/authorization-attributes-service.interface.ts +3 -3
- package/src/types/general.ts +2 -3
- package/src/utils/validation.ts +139 -82
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { ResourceAttributeAssignment } from './resource-attribute-assignment';
|
|
2
2
|
import { EntityAttributeAssignment } from './entity-attribute-assignment';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { ResourceAttributeOperation, EntityAttributeOperation } from './types/authorization-attributes-contracts';
|
|
4
|
+
import { EntityType } from './entity-attributes-constants';
|
|
5
|
+
import { AuthorizationAttributesService } from './types/authorization-attributes-service.interface';
|
|
5
6
|
import { Resource } from './types/general';
|
|
6
7
|
/**
|
|
7
8
|
* Service class for managing resource attributes in the authorization microservice.
|
|
8
9
|
* Provides synchronous HTTP operations to create/update and delete attributes on resources.
|
|
9
10
|
*/
|
|
10
|
-
export declare class AuthorizationAttributesMsService implements
|
|
11
|
+
export declare class AuthorizationAttributesMsService implements AuthorizationAttributesService {
|
|
11
12
|
private static LOG_TAG;
|
|
12
13
|
private static httpClient;
|
|
14
|
+
static destroyHttpClient(): void;
|
|
13
15
|
/**
|
|
14
16
|
* Creates or updates resource attributes synchronously.
|
|
15
17
|
* @param accountId The account ID
|
|
@@ -40,7 +42,7 @@ export declare class AuthorizationAttributesMsService implements IAuthorizationA
|
|
|
40
42
|
* @param attributeKeys Array of attribute key strings to delete
|
|
41
43
|
* @returns Promise<void>
|
|
42
44
|
*/
|
|
43
|
-
deleteEntityAttributes(accountId: number, entityType: EntityType
|
|
45
|
+
deleteEntityAttributes(accountId: number, entityType: EntityType, entityId: number, attributeKeys: string[], _appName?: string, _callerActionIdentifier?: string): Promise<void>;
|
|
44
46
|
/**
|
|
45
47
|
* Updates resource attributes (batch operations).
|
|
46
48
|
* Note: MS service does not support batch operations directly.
|
|
@@ -78,10 +80,6 @@ export declare class AuthorizationAttributesMsService implements IAuthorizationA
|
|
|
78
80
|
* Gets request headers including Authorization, Content-Type, and optional attribution headers
|
|
79
81
|
*/
|
|
80
82
|
private static getRequestHeaders;
|
|
81
|
-
/**
|
|
82
|
-
* Validates that all messages are instances of the specified message class
|
|
83
|
-
*/
|
|
84
|
-
private static validateMessages;
|
|
85
83
|
/**
|
|
86
84
|
* Generic helper for executing upsert requests
|
|
87
85
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorization-attributes-ms-service.d.ts","sourceRoot":"","sources":["../src/authorization-attributes-ms-service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"authorization-attributes-ms-service.d.ts","sourceRoot":"","sources":["../src/authorization-attributes-ms-service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,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AAwB,CAC5B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,uBAAuB,EAAE,MAAM,EAC/B,2BAA2B,EAAE,0BAA0B,EAAE,GACxD,OAAO,CAAC,0BAA0B,EAAE,CAAC;IAoCxC;;;;;;;;;OASG;IACG,sBAAsB,CAC1B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,uBAAuB,EAAE,MAAM,EAC/B,yBAAyB,EAAE,wBAAwB,EAAE,GACpD,OAAO,CAAC,wBAAwB,EAAE,CAAC;IAiBtC;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAQhC;;OAEG;mBACkB,oBAAoB;IAmEzC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,iBAAiB;IA+ChC;;OAEG;mBACkB,oBAAoB;CAkE1C"}
|
|
@@ -2,7 +2,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
|
|
3
3
|
const tridentBackendApi = require('@mondaydotcomorg/trident-backend-api');
|
|
4
4
|
const mondayJwt = require('@mondaydotcomorg/monday-jwt');
|
|
5
|
-
const zod = require('zod');
|
|
6
5
|
const resourceAttributeAssignment = require('./resource-attribute-assignment.js');
|
|
7
6
|
const entityAttributeAssignment = require('./entity-attribute-assignment.js');
|
|
8
7
|
const types_authorizationAttributesContracts = require('./types/authorization-attributes-contracts.js');
|
|
@@ -23,7 +22,10 @@ const DELETE_ENTITY_ATTRIBUTES_PATH = '/attributes/{accountId}/entity/{entityTyp
|
|
|
23
22
|
*/
|
|
24
23
|
class AuthorizationAttributesMsService {
|
|
25
24
|
static LOG_TAG = 'authorization_attributes_ms';
|
|
26
|
-
static httpClient = tridentBackendApi.Api.getPart('httpClient');
|
|
25
|
+
static httpClient = tridentBackendApi.Api.getPart('httpClient') ?? null;
|
|
26
|
+
static destroyHttpClient() {
|
|
27
|
+
AuthorizationAttributesMsService.httpClient = null;
|
|
28
|
+
}
|
|
27
29
|
/**
|
|
28
30
|
* Creates or updates resource attributes synchronously.
|
|
29
31
|
* @param accountId The account ID
|
|
@@ -41,15 +43,8 @@ class AuthorizationAttributesMsService {
|
|
|
41
43
|
* @returns Promise<void>
|
|
42
44
|
*/
|
|
43
45
|
async deleteResourceAttributes(accountId, resource, attributeKeys, _appName, _callerActionIdentifier) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
throw new errors_argumentError.ArgumentError('resource must be an object');
|
|
47
|
-
}
|
|
48
|
-
if (!resource.id) {
|
|
49
|
-
throw new errors_argumentError.ArgumentError('resource.id is required');
|
|
50
|
-
}
|
|
51
|
-
utils_validation.ValidationUtils.validateInteger(resource.id, 'resource.id');
|
|
52
|
-
utils_validation.ValidationUtils.validateString(resource.type, 'resource.type');
|
|
46
|
+
utils_validation.ValidationUtils.validateResource(resource);
|
|
47
|
+
utils_validation.ValidationUtils.validateStringArray(attributeKeys);
|
|
53
48
|
return AuthorizationAttributesMsService.executeDeleteRequest(accountId, DELETE_RESOURCE_ATTRIBUTES_PATH, {
|
|
54
49
|
resourceType: resource.type,
|
|
55
50
|
resourceId: resource.id,
|
|
@@ -76,7 +71,7 @@ class AuthorizationAttributesMsService {
|
|
|
76
71
|
if (!entityType || typeof entityType !== 'string' || entityType.trim() === '') {
|
|
77
72
|
throw new errors_argumentError.ArgumentError(`entityType must be a non-empty string, got: ${entityType}`);
|
|
78
73
|
}
|
|
79
|
-
utils_validation.ValidationUtils.validateInteger(entityId
|
|
74
|
+
utils_validation.ValidationUtils.validateInteger(entityId);
|
|
80
75
|
return AuthorizationAttributesMsService.executeDeleteRequest(accountId, DELETE_ENTITY_ATTRIBUTES_PATH, {
|
|
81
76
|
entityType,
|
|
82
77
|
entityId,
|
|
@@ -161,18 +156,13 @@ class AuthorizationAttributesMsService {
|
|
|
161
156
|
*/
|
|
162
157
|
static async executeDeleteRequest(accountId, pathTemplate, pathParams, keys, logPrefix, methodName, context = {}) {
|
|
163
158
|
// Validate inputs
|
|
164
|
-
utils_validation.ValidationUtils.validateInteger(accountId
|
|
165
|
-
utils_validation.ValidationUtils.
|
|
159
|
+
utils_validation.ValidationUtils.validateInteger(accountId);
|
|
160
|
+
utils_validation.ValidationUtils.validateStringArray(keys);
|
|
166
161
|
if (!keys.length) {
|
|
167
162
|
authorizationInternalService.logger.warn({ tag: this.LOG_TAG, accountId, ...pathParams }, `${methodName} called with empty keys array`);
|
|
168
163
|
return;
|
|
169
164
|
}
|
|
170
|
-
|
|
171
|
-
utils_validation.ValidationUtils.validateStringArray(keys, 'attributeKeys');
|
|
172
|
-
// Build request body
|
|
173
|
-
const requestBody = {
|
|
174
|
-
keys,
|
|
175
|
-
};
|
|
165
|
+
const requestBody = { keys };
|
|
176
166
|
if (!AuthorizationAttributesMsService.httpClient) {
|
|
177
167
|
throw new Error('AuthorizationAttributesMsService: HTTP client is not initialized');
|
|
178
168
|
}
|
|
@@ -192,7 +182,7 @@ class AuthorizationAttributesMsService {
|
|
|
192
182
|
timeout: authorizationInternalService.AuthorizationInternalService.getRequestTimeout(),
|
|
193
183
|
retryPolicy: authorizationInternalService.AuthorizationInternalService.getRetriesPolicy(),
|
|
194
184
|
});
|
|
195
|
-
authorizationInternalService.logger.
|
|
185
|
+
authorizationInternalService.logger.debug({ tag: AuthorizationAttributesMsService.LOG_TAG, accountId, ...pathParams, keys }, `Successfully deleted ${logPrefix} attributes`);
|
|
196
186
|
}
|
|
197
187
|
catch (err) {
|
|
198
188
|
authorizationInternalService.logger.error({
|
|
@@ -251,67 +241,15 @@ class AuthorizationAttributesMsService {
|
|
|
251
241
|
headers['X-REQUEST-START'] = Math.floor(Date.now() / 1000).toString();
|
|
252
242
|
return headers;
|
|
253
243
|
}
|
|
254
|
-
/**
|
|
255
|
-
* Validates that all messages are instances of the specified message class
|
|
256
|
-
*/
|
|
257
|
-
static validateMessages(attributesMessages, messageClass) {
|
|
258
|
-
// Validate messageClass is a function using Zod
|
|
259
|
-
const classSchema = zod.z.custom(value => typeof value === 'function', {
|
|
260
|
-
message: 'messageClass must be a class/constructor function',
|
|
261
|
-
});
|
|
262
|
-
try {
|
|
263
|
-
classSchema.parse(messageClass);
|
|
264
|
-
}
|
|
265
|
-
catch (error) {
|
|
266
|
-
if (error instanceof zod.z.ZodError) {
|
|
267
|
-
const firstError = error.issues[0];
|
|
268
|
-
throw new errors_argumentError.ArgumentError(firstError.message);
|
|
269
|
-
}
|
|
270
|
-
throw error;
|
|
271
|
-
}
|
|
272
|
-
const className = messageClass.name || 'ResourceAttributeAssignment';
|
|
273
|
-
// First validate it's an array
|
|
274
|
-
utils_validation.ValidationUtils.validateArray(attributesMessages, 'attributesMessages');
|
|
275
|
-
// Then use Zod to validate each item is an instance of the class
|
|
276
|
-
const schema = zod.z.array(zod.z.any()).refine(items => {
|
|
277
|
-
for (let i = 0; i < items.length; i++) {
|
|
278
|
-
if (!(items[i] instanceof messageClass)) {
|
|
279
|
-
return false;
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
return true;
|
|
283
|
-
}, {
|
|
284
|
-
message: `All attributesMessages must be instances of ${className}`,
|
|
285
|
-
});
|
|
286
|
-
try {
|
|
287
|
-
schema.parse(attributesMessages);
|
|
288
|
-
}
|
|
289
|
-
catch (error) {
|
|
290
|
-
if (error instanceof zod.z.ZodError) {
|
|
291
|
-
// Find the first invalid index for a more specific error message
|
|
292
|
-
const invalidIndex = attributesMessages.findIndex(item => !(item instanceof messageClass));
|
|
293
|
-
if (invalidIndex !== -1) {
|
|
294
|
-
throw new errors_argumentError.ArgumentError(`All attributesMessages must be instances of ${className}, but item at index ${invalidIndex} is not`);
|
|
295
|
-
}
|
|
296
|
-
const firstError = error.issues[0];
|
|
297
|
-
throw new errors_argumentError.ArgumentError(firstError.message);
|
|
298
|
-
}
|
|
299
|
-
throw error;
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
244
|
/**
|
|
303
245
|
* Generic helper for executing upsert requests
|
|
304
246
|
*/
|
|
305
247
|
static async executeUpsertRequest(accountId, assignments, pathTemplate, requestBodyKey, assignmentClass, logPrefix, methodName) {
|
|
306
|
-
|
|
307
|
-
utils_validation.ValidationUtils.
|
|
308
|
-
utils_validation.ValidationUtils.validateArray(assignments, 'assignments');
|
|
248
|
+
utils_validation.ValidationUtils.validateInteger(accountId);
|
|
249
|
+
utils_validation.ValidationUtils.validateArrayTypeOf(assignments, assignmentClass);
|
|
309
250
|
if (!assignments.length) {
|
|
310
|
-
authorizationInternalService.logger.warn({ tag: AuthorizationAttributesMsService.LOG_TAG, accountId }, `${methodName} called with empty array`);
|
|
311
251
|
return;
|
|
312
252
|
}
|
|
313
|
-
// Validate all assignments are instances of the correct class
|
|
314
|
-
AuthorizationAttributesMsService.validateMessages(assignments, assignmentClass);
|
|
315
253
|
const assignmentDto = assignments.map(assignment => assignment.toDataTransferObject());
|
|
316
254
|
const requestBody = requestBodyKey === 'resourceAttributeAssignments'
|
|
317
255
|
? { resourceAttributeAssignments: assignmentDto }
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { IAuthorizationAttributesService } from './types/authorization-attributes-service.interface';
|
|
1
|
+
import { AuthorizationAttributesService as IAuthorizationAttributesService } from './types/authorization-attributes-service.interface';
|
|
2
2
|
/**
|
|
3
3
|
* Main service class for managing resource and entity attributes.
|
|
4
4
|
* Provides access to both direct (MS) and SNS operations.
|
|
5
5
|
*
|
|
6
6
|
* @example
|
|
7
|
-
* ```typescript
|
|
8
7
|
* const service = new AuthorizationAttributesService();
|
|
9
8
|
*
|
|
10
9
|
* // Use direct operations
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorization-attributes-service.d.ts","sourceRoot":"","sources":["../src/authorization-attributes-service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,+BAA+B,EAAE,MAAM,oDAAoD,CAAC;
|
|
1
|
+
{"version":3,"file":"authorization-attributes-service.d.ts","sourceRoot":"","sources":["../src/authorization-attributes-service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,8BAA8B,IAAI,+BAA+B,EAAE,MAAM,oDAAoD,CAAC;AAEvI;;;;;;;;;;;;;GAaG;AACH,qBAAa,8BAA8B;IACzC,OAAO,CAAC,cAAc,CAAiD;IACvE,OAAO,CAAC,WAAW,CAAkD;IAErE;;;;OAIG;IACH,MAAM,IAAI,+BAA+B;IAOzC;;;;OAIG;IACH,GAAG,IAAI,+BAA+B;CAMvC"}
|
|
@@ -8,7 +8,6 @@ const authorizationAttributesSnsService = require('./authorization-attributes-sn
|
|
|
8
8
|
* Provides access to both direct (MS) and SNS operations.
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
11
|
-
* ```typescript
|
|
12
11
|
* const service = new AuthorizationAttributesService();
|
|
13
12
|
*
|
|
14
13
|
* // Use direct operations
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { ResourceAttributeAssignment, ResourceAttributeOperation, EntityAttributeOperation
|
|
1
|
+
import { ResourceAttributeAssignment, ResourceAttributeOperation, EntityAttributeOperation } from './types/authorization-attributes-contracts';
|
|
2
2
|
import { EntityAttributeAssignment } from './entity-attribute-assignment';
|
|
3
3
|
import { Resource } from './types/general';
|
|
4
|
-
import {
|
|
4
|
+
import { AuthorizationAttributesService } from './types/authorization-attributes-service.interface';
|
|
5
|
+
import { EntityType } from './entity-attributes-constants';
|
|
5
6
|
/**
|
|
6
7
|
* Service class for managing resource attributes asynchronously via SNS.
|
|
7
8
|
* Provides asynchronous operations to create/update and delete attributes on resources.
|
|
8
9
|
*/
|
|
9
|
-
export declare class AuthorizationAttributesSnsService implements
|
|
10
|
+
export declare class AuthorizationAttributesSnsService implements AuthorizationAttributesService {
|
|
10
11
|
private static LOG_TAG;
|
|
11
12
|
private resourceSnsArn;
|
|
12
13
|
private entitySnsArn;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorization-attributes-sns-service.d.ts","sourceRoot":"","sources":["../src/authorization-attributes-sns-service.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC1B,wBAAwB,
|
|
1
|
+
{"version":3,"file":"authorization-attributes-sns-service.d.ts","sourceRoot":"","sources":["../src/authorization-attributes-sns-service.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC1B,wBAAwB,EAEzB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAc3C,OAAO,EAAE,8BAA8B,EAAE,MAAM,oDAAoD,CAAC;AACpG,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D;;;GAGG;AACH,qBAAa,iCAAkC,YAAW,8BAA8B;IACtF,OAAO,CAAC,MAAM,CAAC,OAAO,CAA8B;IACpD,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,YAAY,CAAS;IAE7B;;OAEG;;IAMH;;;;;;;;OAQG;IACG,wBAAwB,CAC5B,SAAS,EAAE,MAAM,EACjB,4BAA4B,EAAE,2BAA2B,EAAE,EAC3D,OAAO,CAAC,EAAE,MAAM,EAChB,sBAAsB,CAAC,EAAE,MAAM,GAC9B,OAAO,CAAC,0BAA0B,EAAE,CAAC;IAWxC;;;;;;;;;OASG;IACG,wBAAwB,CAC5B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,MAAM,EAAE,EACvB,OAAO,CAAC,EAAE,MAAM,EAChB,sBAAsB,CAAC,EAAE,MAAM,GAC9B,OAAO,CAAC,0BAA0B,EAAE,CAAC;IAgBxC;;;;;;;;OAQG;IACG,sBAAsB,CAC1B,SAAS,EAAE,MAAM,EACjB,0BAA0B,EAAE,yBAAyB,EAAE,EACvD,OAAO,CAAC,EAAE,MAAM,EAChB,sBAAsB,CAAC,EAAE,MAAM,GAC9B,OAAO,CAAC,wBAAwB,EAAE,CAAC;IAgBtC;;;;;;;;;;OAUG;IACG,sBAAsB,CAC1B,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,UAAU,GAAG,MAAM,EAC/B,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EAAE,EACvB,OAAO,CAAC,EAAE,MAAM,EAChB,sBAAsB,CAAC,EAAE,MAAM,GAC9B,OAAO,CAAC,wBAAwB,EAAE,CAAC;IAgBtC;;;;;;;UAOM;IACA,wBAAwB,CAC5B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,sBAAsB,EAAE,MAAM,EAC9B,2BAA2B,EAAE,0BAA0B,EAAE,GACxD,OAAO,CAAC,0BAA0B,EAAE,CAAC;IAoBxC;;;;;;;UAOM;IACA,sBAAsB,CAC1B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,sBAAsB,EAAE,MAAM,EAC9B,yBAAyB,EAAE,wBAAwB,EAAE,GACpD,OAAO,CAAC,wBAAwB,EAAE,CAAC;YAoBxB,oBAAoB;IA2BlC,OAAO,CAAC,MAAM,CAAC,cAAc;IA0B7B;;;;;;;OAOG;IACG,kCAAkC,IAAI,OAAO,CAAC,OAAO,CAAC;CAoB7D"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BaseRequest, BaseResponse, Context, ContextGetter, ResourceGetter } from './types/general';
|
|
1
|
+
import { Action, BaseRequest, BaseResponse, Context, ContextGetter, ResourceGetter } from './types/general';
|
|
2
2
|
import type { NextFunction } from 'express';
|
|
3
|
-
export declare function getAuthorizationMiddleware(action:
|
|
3
|
+
export declare function getAuthorizationMiddleware(action: Action, resourceGetter: ResourceGetter, contextGetter?: ContextGetter): (request: BaseRequest, response: BaseResponse, next: NextFunction) => Promise<void>;
|
|
4
4
|
export declare function skipAuthorizationMiddleware(request: BaseRequest, response: BaseResponse, next: NextFunction): void;
|
|
5
5
|
export declare function authorizationCheckMiddleware(request: BaseRequest, response: BaseResponse, next: NextFunction): void;
|
|
6
6
|
export declare function defaultContextGetter(request: BaseRequest): Context;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorization-middleware.d.ts","sourceRoot":"","sources":["../src/authorization-middleware.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"authorization-middleware.d.ts","sourceRoot":"","sources":["../src/authorization-middleware.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC5G,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI5C,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,cAAc,EAC9B,aAAa,CAAC,EAAE,aAAa,IAG3B,SAAS,WAAW,EACpB,UAAU,YAAY,EACtB,MAAM,YAAY,KACjB,OAAO,CAAC,IAAI,CAAC,CAajB;AAED,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,CAGlH;AAED,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,CASnH;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAElE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MondayFetchOptions } from '@mondaydotcomorg/monday-fetch';
|
|
2
2
|
import { IgniteClient } from '@mondaydotcomorg/ignite-sdk';
|
|
3
|
-
import { AuthorizationObject, AuthorizationParams, Resource } from './types/general';
|
|
3
|
+
import { Action, AuthorizationObject, AuthorizationParams, Resource } from './types/general';
|
|
4
4
|
import { ScopedAction, ScopedActionPermit, ScopedActionResponseObject, ScopeOptions } from './types/scoped-actions-contracts';
|
|
5
5
|
export interface AuthorizeResponse {
|
|
6
6
|
isAuthorized: boolean;
|
|
@@ -21,7 +21,7 @@ export declare class AuthorizationService {
|
|
|
21
21
|
* @deprecated use the second form with authorizationRequestObjects instead,
|
|
22
22
|
* support of this function will be dropped gradually
|
|
23
23
|
*/
|
|
24
|
-
static isAuthorized(accountId: number, userId: number, resources: Resource[], action:
|
|
24
|
+
static isAuthorized(accountId: number, userId: number, resources: Resource[], action: Action): Promise<AuthorizeResponse>;
|
|
25
25
|
static isAuthorized(accountId: number, userId: number, authorizationRequestObjects: AuthorizationObject[]): Promise<AuthorizeResponse>;
|
|
26
26
|
/**
|
|
27
27
|
* @deprecated - Please use Ignite instead: https://github.com/DaPulse/ignite-monorepo/blob/master/packages/ignite-sdk/README.md
|
|
@@ -40,5 +40,5 @@ export declare class AuthorizationService {
|
|
|
40
40
|
}
|
|
41
41
|
export declare function setRedisClient(client: any, grantedFeatureRedisExpirationInSeconds?: number): void;
|
|
42
42
|
export declare function setIgniteClient(): Promise<void>;
|
|
43
|
-
export declare function createAuthorizationParams(resources: Resource[], action:
|
|
43
|
+
export declare function createAuthorizationParams(resources: Resource[], action: Action): AuthorizationParams;
|
|
44
44
|
//# sourceMappingURL=authorization-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorization-service.d.ts","sourceRoot":"","sources":["../src/authorization-service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAGnE,OAAO,EAAmB,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"authorization-service.d.ts","sourceRoot":"","sources":["../src/authorization-service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,C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,GAAE;QAAE,eAAe,CAAC,EAAE,OAAO,CAAA;KAAO,GAC1C,OAAO,CAAC,OAAO,CAAC;mBAkBE,6BAA6B;IAclD,OAAO,CAAC,MAAM,CAAC,gBAAgB;WAIlB,gBAAgB,CAC3B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,YAAY,GAClB,OAAO,CAAC,kBAAkB,CAAC;IAM9B,OAAO,CAAC,MAAM,CAAC,UAAU;WAsBZ,wBAAwB,CACnC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,YAAY,EAAE,GAC5B,OAAO,CAAC,0BAA0B,EAAE,CAAC;mBA4CnB,oBAAoB;mBAUpB,oBAAoB;CAmF1C;AAED,wBAAgB,cAAc,CAC5B,MAAM,KAAA,EACN,sCAAsC,GAAE,MAAiD,QAY1F;AAED,wBAAsB,eAAe,kBAMpC;AAED,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,mBAAmB,CAepG"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EntityAttributeAssignment, ResourceAttributeDelete } from './types/authorization-attributes-contracts';
|
|
1
2
|
/**
|
|
2
3
|
* Base class for attribute assignments (Resource or Entity)
|
|
3
4
|
* Provides common validation and functionality
|
|
@@ -14,5 +15,6 @@ export declare abstract class BaseAttributeAssignment<TId extends number, TType
|
|
|
14
15
|
* @returns true if all properties are equal
|
|
15
16
|
*/
|
|
16
17
|
equals(other: BaseAttributeAssignment<TId, TType>): boolean;
|
|
18
|
+
abstract toDataTransferObject(): EntityAttributeAssignment | ResourceAttributeDelete;
|
|
17
19
|
}
|
|
18
20
|
//# sourceMappingURL=base-attribute-assignment.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-attribute-assignment.d.ts","sourceRoot":"","sources":["../src/base-attribute-assignment.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,8BAAsB,uBAAuB,CAAC,GAAG,SAAS,MAAM,EAAE,KAAK,SAAS,MAAM;IACpF,SAAgB,EAAE,EAAE,GAAG,CAAC;IACxB,SAAgB,IAAI,EAAE,KAAK,CAAC;IAC5B,SAAgB,YAAY,EAAE,MAAM,CAAC;IACrC,SAAgB,cAAc,EAAE,MAAM,CAAC;gBAGrC,EAAE,EAAE,GAAG,EACP,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"base-attribute-assignment.d.ts","sourceRoot":"","sources":["../src/base-attribute-assignment.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AAEhH;;;GAGG;AACH,8BAAsB,uBAAuB,CAAC,GAAG,SAAS,MAAM,EAAE,KAAK,SAAS,MAAM;IACpF,SAAgB,EAAE,EAAE,GAAG,CAAC;IACxB,SAAgB,IAAI,EAAE,KAAK,CAAC;IAC5B,SAAgB,YAAY,EAAE,MAAM,CAAC;IACrC,SAAgB,cAAc,EAAE,MAAM,CAAC;gBAGrC,EAAE,EAAE,GAAG,EACP,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,MAAM;IAcvB;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,uBAAuB,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,OAAO;IAI3D,QAAQ,CAAC,oBAAoB,IAAI,yBAAyB,GAAG,uBAAuB;CACrF"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
|
|
3
3
|
const utils_validation = require('./utils/validation.js');
|
|
4
|
+
const isEqual = require('lodash/isEqual.js');
|
|
5
|
+
|
|
6
|
+
const _interopDefault = e => e && e.__esModule ? e : { default: e };
|
|
7
|
+
|
|
8
|
+
const isEqual__default = /*#__PURE__*/_interopDefault(isEqual);
|
|
4
9
|
|
|
5
10
|
/**
|
|
6
11
|
* Base class for attribute assignments (Resource or Entity)
|
|
@@ -12,17 +17,11 @@ class BaseAttributeAssignment {
|
|
|
12
17
|
attributeKey;
|
|
13
18
|
attributeValue;
|
|
14
19
|
constructor(id, type, attributeKey, attributeValue, validTypes, idFieldName, typeFieldName) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
this.
|
|
19
|
-
|
|
20
|
-
utils_validation.ValidationUtils.validateString(attributeKey, 'attributeKey');
|
|
21
|
-
// Validate attributeValue
|
|
22
|
-
utils_validation.ValidationUtils.validateString(attributeValue, 'attributeValue');
|
|
23
|
-
this.id = id;
|
|
24
|
-
this.attributeKey = attributeKey;
|
|
25
|
-
this.attributeValue = attributeValue;
|
|
20
|
+
const validated = utils_validation.ValidationUtils.validateAssignment({ id, type, attributeKey, attributeValue }, validTypes, { id: idFieldName, type: typeFieldName });
|
|
21
|
+
this.id = validated.id;
|
|
22
|
+
this.type = validated.type;
|
|
23
|
+
this.attributeKey = validated.attributeKey;
|
|
24
|
+
this.attributeValue = validated.attributeValue;
|
|
26
25
|
}
|
|
27
26
|
/**
|
|
28
27
|
* Compares two assignments for equality
|
|
@@ -30,13 +29,7 @@ class BaseAttributeAssignment {
|
|
|
30
29
|
* @returns true if all properties are equal
|
|
31
30
|
*/
|
|
32
31
|
equals(other) {
|
|
33
|
-
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
return (this.id === other.id &&
|
|
37
|
-
this.type === other.type &&
|
|
38
|
-
this.attributeKey === other.attributeKey &&
|
|
39
|
-
this.attributeValue === other.attributeValue);
|
|
32
|
+
return isEqual__default.default(this, other);
|
|
40
33
|
}
|
|
41
34
|
}
|
|
42
35
|
|
|
@@ -7,7 +7,7 @@ class EntityAttributeAssignment extends baseAttributeAssignment.BaseAttributeAss
|
|
|
7
7
|
entityId;
|
|
8
8
|
entityType;
|
|
9
9
|
constructor(entityId, entityType, attributeKey, attributeValue) {
|
|
10
|
-
super(entityId, entityType, attributeKey, attributeValue,
|
|
10
|
+
super(entityId, entityType, attributeKey, attributeValue, entityAttributesConstants.ENTITY_TYPES, 'entityId', 'entityType');
|
|
11
11
|
this.entityId = entityId;
|
|
12
12
|
this.entityType = this.type;
|
|
13
13
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
export
|
|
1
|
+
export declare enum EntityType {
|
|
2
|
+
User = "user",
|
|
3
|
+
Team = "team",
|
|
4
|
+
Account = "account"
|
|
5
|
+
}
|
|
6
|
+
export declare const ENTITY_TYPES: readonly EntityType[];
|
|
7
7
|
//# sourceMappingURL=entity-attributes-constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-attributes-constants.d.ts","sourceRoot":"","sources":["../src/entity-attributes-constants.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"entity-attributes-constants.d.ts","sourceRoot":"","sources":["../src/entity-attributes-constants.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU;IACpB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,OAAO,YAAY;CACpB;AAED,eAAO,MAAM,YAAY,uBAA2C,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
exports.EntityType = void 0;
|
|
4
|
+
(function (EntityType) {
|
|
5
|
+
EntityType["User"] = "user";
|
|
6
|
+
EntityType["Team"] = "team";
|
|
7
|
+
EntityType["Account"] = "account";
|
|
8
|
+
})(exports.EntityType || (exports.EntityType = {}));
|
|
9
|
+
const ENTITY_TYPES = Object.freeze(Object.values(exports.EntityType));
|
|
8
10
|
|
|
9
11
|
exports.ENTITY_TYPES = ENTITY_TYPES;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"argument-error.d.ts","sourceRoot":"","sources":["../../src/errors/argument-error.ts"],"names":[],"mappings":"AAAA,qBAAa,aAAc,SAAQ,KAAK;gBAC1B,OAAO,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"argument-error.d.ts","sourceRoot":"","sources":["../../src/errors/argument-error.ts"],"names":[],"mappings":"AAAA,qBAAa,aAAc,SAAQ,KAAK;gBAC1B,OAAO,EAAE,MAAM;CAI5B"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { ResourceAttributeAssignment } from './resource-attribute-assignment';
|
|
2
2
|
import { EntityAttributeAssignment } from './entity-attribute-assignment';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { ResourceAttributeOperation, EntityAttributeOperation } from './types/authorization-attributes-contracts';
|
|
4
|
+
import { EntityType } from './entity-attributes-constants';
|
|
5
|
+
import { AuthorizationAttributesService } from './types/authorization-attributes-service.interface';
|
|
5
6
|
import { Resource } from './types/general';
|
|
6
7
|
/**
|
|
7
8
|
* Service class for managing resource attributes in the authorization microservice.
|
|
8
9
|
* Provides synchronous HTTP operations to create/update and delete attributes on resources.
|
|
9
10
|
*/
|
|
10
|
-
export declare class AuthorizationAttributesMsService implements
|
|
11
|
+
export declare class AuthorizationAttributesMsService implements AuthorizationAttributesService {
|
|
11
12
|
private static LOG_TAG;
|
|
12
13
|
private static httpClient;
|
|
14
|
+
static destroyHttpClient(): void;
|
|
13
15
|
/**
|
|
14
16
|
* Creates or updates resource attributes synchronously.
|
|
15
17
|
* @param accountId The account ID
|
|
@@ -40,7 +42,7 @@ export declare class AuthorizationAttributesMsService implements IAuthorizationA
|
|
|
40
42
|
* @param attributeKeys Array of attribute key strings to delete
|
|
41
43
|
* @returns Promise<void>
|
|
42
44
|
*/
|
|
43
|
-
deleteEntityAttributes(accountId: number, entityType: EntityType
|
|
45
|
+
deleteEntityAttributes(accountId: number, entityType: EntityType, entityId: number, attributeKeys: string[], _appName?: string, _callerActionIdentifier?: string): Promise<void>;
|
|
44
46
|
/**
|
|
45
47
|
* Updates resource attributes (batch operations).
|
|
46
48
|
* Note: MS service does not support batch operations directly.
|
|
@@ -78,10 +80,6 @@ export declare class AuthorizationAttributesMsService implements IAuthorizationA
|
|
|
78
80
|
* Gets request headers including Authorization, Content-Type, and optional attribution headers
|
|
79
81
|
*/
|
|
80
82
|
private static getRequestHeaders;
|
|
81
|
-
/**
|
|
82
|
-
* Validates that all messages are instances of the specified message class
|
|
83
|
-
*/
|
|
84
|
-
private static validateMessages;
|
|
85
83
|
/**
|
|
86
84
|
* Generic helper for executing upsert requests
|
|
87
85
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorization-attributes-ms-service.d.ts","sourceRoot":"","sources":["../../src/authorization-attributes-ms-service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"authorization-attributes-ms-service.d.ts","sourceRoot":"","sources":["../../src/authorization-attributes-ms-service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAEL,0BAA0B,EAC1B,wBAAwB,EACzB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAM3D,OAAO,EAAE,8BAA8B,EAAE,MAAM,oDAAoD,CAAC;AACpG,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAW3C;;;GAGG;AACH,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