@mondaydotcomorg/monday-authorization 3.5.0-feat-shaime-support-entity-attributes-in-authorization-sdk-a98616f → 3.5.0-feat-shaime-support-entity-attributes-in-authorization-sdk-8d846f1
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 +17 -0
- package/dist/authorization-attributes-ms-service.d.ts.map +1 -1
- package/dist/authorization-attributes-ms-service.js +165 -0
- package/dist/authorization-attributes-service.d.ts +52 -66
- package/dist/authorization-attributes-service.d.ts.map +1 -1
- package/dist/authorization-attributes-service.js +105 -353
- package/dist/constants/sns.d.ts +2 -0
- package/dist/constants/sns.d.ts.map +1 -1
- package/dist/constants/sns.js +4 -0
- package/dist/esm/authorization-attributes-ms-service.d.ts +17 -0
- package/dist/esm/authorization-attributes-ms-service.d.ts.map +1 -1
- package/dist/esm/authorization-attributes-ms-service.mjs +165 -0
- package/dist/esm/authorization-attributes-service.d.ts +52 -66
- package/dist/esm/authorization-attributes-service.d.ts.map +1 -1
- package/dist/esm/authorization-attributes-service.mjs +107 -355
- package/dist/esm/constants/sns.d.ts +2 -0
- package/dist/esm/constants/sns.d.ts.map +1 -1
- package/dist/esm/constants/sns.mjs +3 -1
- package/dist/esm/types/authorization-attributes-contracts.d.ts +16 -0
- package/dist/esm/types/authorization-attributes-contracts.d.ts.map +1 -1
- package/dist/esm/types/authorization-attributes-contracts.mjs +6 -1
- package/dist/types/authorization-attributes-contracts.d.ts +16 -0
- package/dist/types/authorization-attributes-contracts.d.ts.map +1 -1
- package/dist/types/authorization-attributes-contracts.js +5 -0
- package/package.json +1 -1
- package/src/authorization-attributes-ms-service.ts +246 -0
- package/src/authorization-attributes-service.ts +147 -426
- package/src/constants/sns.ts +2 -0
- package/src/types/authorization-attributes-contracts.ts +20 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ResourceAttributeAssignment } from './resource-attribute-assignment';
|
|
2
|
+
import { EntityAttributeAssignment, EntityType, EntityAttributeKeyType } from './types/authorization-attributes-contracts';
|
|
2
3
|
interface Resource {
|
|
3
4
|
resourceType: string;
|
|
4
5
|
resourceId: number;
|
|
@@ -32,6 +33,22 @@ export declare class AuthorizationAttributesMsService {
|
|
|
32
33
|
* @returns Promise<void>
|
|
33
34
|
*/
|
|
34
35
|
static deleteResourceAttributesSync(accountId: number, resource: Resource, attributeKeys: string[]): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Creates or updates entity attributes synchronously.
|
|
38
|
+
* @param accountId The account ID
|
|
39
|
+
* @param entityAttributeAssignments Array of EntityAttributeAssignment objects
|
|
40
|
+
* @returns Promise<void>
|
|
41
|
+
*/
|
|
42
|
+
static upsertEntityAttributesSync(accountId: number, entityAttributeAssignments: EntityAttributeAssignment[]): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Deletes specific attributes from an entity synchronously.
|
|
45
|
+
* @param accountId The account ID
|
|
46
|
+
* @param entityType The entity type
|
|
47
|
+
* @param entityId The entity ID
|
|
48
|
+
* @param attributeKeys Array of attribute key strings to delete
|
|
49
|
+
* @returns Promise<void>
|
|
50
|
+
*/
|
|
51
|
+
static deleteEntityAttributesSync(accountId: number, entityType: EntityType, entityId: number, attributeKeys: EntityAttributeKeyType[]): Promise<void>;
|
|
35
52
|
}
|
|
36
53
|
export {};
|
|
37
54
|
//# sourceMappingURL=authorization-attributes-ms-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorization-attributes-ms-service.d.ts","sourceRoot":"","sources":["../src/authorization-attributes-ms-service.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"authorization-attributes-ms-service.d.ts","sourceRoot":"","sources":["../src/authorization-attributes-ms-service.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,EACL,yBAAyB,EACzB,UAAU,EACV,sBAAsB,EACvB,MAAM,4CAA4C,CAAC;AAYpD,UAAU,QAAQ;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB;AAwBD;;;GAGG;AACH,qBAAa,gCAAgC;IAC3C,OAAO,CAAC,MAAM,CAAC,OAAO,CAAiC;IAEvD;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,iBAAiB;IA+ChC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAmB/B;;;;;OAKG;WACU,4BAA4B,CACvC,SAAS,EAAE,MAAM,EACjB,4BAA4B,EAAE,2BAA2B,EAAE,GAC1D,OAAO,CAAC,IAAI,CAAC;IAwFhB;;;;;;OAMG;WACU,4BAA4B,CACvC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,MAAM,EAAE,GACtB,OAAO,CAAC,IAAI,CAAC;IAwGhB;;;;;OAKG;WACU,0BAA0B,CACrC,SAAS,EAAE,MAAM,EACjB,0BAA0B,EAAE,yBAAyB,EAAE,GACtD,OAAO,CAAC,IAAI,CAAC;IAwGhB;;;;;;;OAOG;WACU,0BAA0B,CACrC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,sBAAsB,EAAE,GACtC,OAAO,CAAC,IAAI,CAAC;CAuGjB"}
|
|
@@ -12,6 +12,8 @@ const constants = require('./constants.js');
|
|
|
12
12
|
const INTERNAL_APP_NAME = 'internal_ms';
|
|
13
13
|
const UPSERT_RESOURCE_ATTRIBUTES_PATH = '/attributes/{accountId}/resource';
|
|
14
14
|
const DELETE_RESOURCE_ATTRIBUTES_PATH = '/attributes/{accountId}/resource/{resourceType}/{resourceId}';
|
|
15
|
+
const UPSERT_ENTITY_ATTRIBUTES_PATH = '/attributes/{accountId}/entity';
|
|
16
|
+
const DELETE_ENTITY_ATTRIBUTES_PATH = '/attributes/{accountId}/entity/{entityType}/{entityId}';
|
|
15
17
|
/**
|
|
16
18
|
* Service class for managing resource attributes in the authorization microservice.
|
|
17
19
|
* Provides synchronous HTTP operations to create/update and delete attributes on resources.
|
|
@@ -227,6 +229,169 @@ class AuthorizationAttributesMsService {
|
|
|
227
229
|
throw err;
|
|
228
230
|
}
|
|
229
231
|
}
|
|
232
|
+
/**
|
|
233
|
+
* Creates or updates entity attributes synchronously.
|
|
234
|
+
* @param accountId The account ID
|
|
235
|
+
* @param entityAttributeAssignments Array of EntityAttributeAssignment objects
|
|
236
|
+
* @returns Promise<void>
|
|
237
|
+
*/
|
|
238
|
+
static async upsertEntityAttributesSync(accountId, entityAttributeAssignments) {
|
|
239
|
+
// Skip HTTP requests in test environment
|
|
240
|
+
if (process.env.NODE_ENV === 'test') {
|
|
241
|
+
authorizationInternalService.logger.debug({ tag: this.LOG_TAG, accountId, count: entityAttributeAssignments.length }, 'Skipping upsertEntityAttributesSync in test environment');
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
// Validate inputs
|
|
245
|
+
if (!Number.isInteger(accountId)) {
|
|
246
|
+
throw new errors_argumentError.ArgumentError(`accountId must be an integer, got: ${accountId}`);
|
|
247
|
+
}
|
|
248
|
+
if (!Array.isArray(entityAttributeAssignments)) {
|
|
249
|
+
throw new errors_argumentError.ArgumentError('entityAttributeAssignments must be an array');
|
|
250
|
+
}
|
|
251
|
+
if (entityAttributeAssignments.length === 0) {
|
|
252
|
+
authorizationInternalService.logger.warn({ tag: this.LOG_TAG, accountId }, 'upsertEntityAttributesSync called with empty array');
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
// Validate each assignment
|
|
256
|
+
for (let i = 0; i < entityAttributeAssignments.length; i++) {
|
|
257
|
+
const assignment = entityAttributeAssignments[i];
|
|
258
|
+
if (!assignment.entityId || typeof assignment.entityId !== 'number') {
|
|
259
|
+
throw new errors_argumentError.ArgumentError(`entityAttributeAssignments[${i}].entityId is required and must be a number`);
|
|
260
|
+
}
|
|
261
|
+
if (!assignment.entityType || typeof assignment.entityType !== 'string') {
|
|
262
|
+
throw new errors_argumentError.ArgumentError(`entityAttributeAssignments[${i}].entityType is required and must be a string`);
|
|
263
|
+
}
|
|
264
|
+
if (!assignment.key || typeof assignment.key !== 'string') {
|
|
265
|
+
throw new errors_argumentError.ArgumentError(`entityAttributeAssignments[${i}].key is required and must be a string`);
|
|
266
|
+
}
|
|
267
|
+
if (assignment.value === undefined || typeof assignment.value !== 'string') {
|
|
268
|
+
throw new errors_argumentError.ArgumentError(`entityAttributeAssignments[${i}].value is required and must be a string`);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
// Build request body
|
|
272
|
+
const requestBody = {
|
|
273
|
+
entityAttributeAssignments: entityAttributeAssignments.map(assignment => ({
|
|
274
|
+
entityId: assignment.entityId,
|
|
275
|
+
entityType: assignment.entityType,
|
|
276
|
+
key: assignment.key,
|
|
277
|
+
value: assignment.value,
|
|
278
|
+
})),
|
|
279
|
+
};
|
|
280
|
+
const httpClient = tridentBackendApi.Api.getPart('httpClient');
|
|
281
|
+
if (!httpClient) {
|
|
282
|
+
throw new Error('AuthorizationAttributesMsService: HTTP client is not initialized');
|
|
283
|
+
}
|
|
284
|
+
const path = UPSERT_ENTITY_ATTRIBUTES_PATH.replace('{accountId}', accountId.toString());
|
|
285
|
+
const headers = this.getRequestHeaders(accountId);
|
|
286
|
+
try {
|
|
287
|
+
authorizationInternalService.logger.info({ tag: this.LOG_TAG, accountId, count: entityAttributeAssignments.length }, 'Upserting entity attributes');
|
|
288
|
+
await httpClient.fetch({
|
|
289
|
+
url: {
|
|
290
|
+
appName: constants.APP_NAME,
|
|
291
|
+
path,
|
|
292
|
+
},
|
|
293
|
+
method: 'POST',
|
|
294
|
+
headers,
|
|
295
|
+
body: JSON.stringify(requestBody),
|
|
296
|
+
}, {
|
|
297
|
+
timeout: authorizationInternalService.AuthorizationInternalService.getRequestTimeout(),
|
|
298
|
+
retryPolicy: authorizationInternalService.AuthorizationInternalService.getRetriesPolicy(),
|
|
299
|
+
});
|
|
300
|
+
authorizationInternalService.logger.info({ tag: this.LOG_TAG, accountId, count: entityAttributeAssignments.length }, 'Successfully upserted entity attributes');
|
|
301
|
+
}
|
|
302
|
+
catch (err) {
|
|
303
|
+
authorizationInternalService.logger.error({
|
|
304
|
+
tag: this.LOG_TAG,
|
|
305
|
+
accountId,
|
|
306
|
+
method: 'upsertEntityAttributesSync',
|
|
307
|
+
error: err instanceof Error ? err.message : String(err),
|
|
308
|
+
}, 'Failed to upsert entity attributes');
|
|
309
|
+
if (err instanceof mondayFetchApi.HttpFetcherError) {
|
|
310
|
+
throw new Error(`AuthorizationAttributesMsService: [upsertEntityAttributesSync] request failed with status ${err.status}: ${err.message}`);
|
|
311
|
+
}
|
|
312
|
+
throw err;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Deletes specific attributes from an entity synchronously.
|
|
317
|
+
* @param accountId The account ID
|
|
318
|
+
* @param entityType The entity type
|
|
319
|
+
* @param entityId The entity ID
|
|
320
|
+
* @param attributeKeys Array of attribute key strings to delete
|
|
321
|
+
* @returns Promise<void>
|
|
322
|
+
*/
|
|
323
|
+
static async deleteEntityAttributesSync(accountId, entityType, entityId, attributeKeys) {
|
|
324
|
+
// Skip HTTP requests in test environment
|
|
325
|
+
if (process.env.NODE_ENV === 'test') {
|
|
326
|
+
authorizationInternalService.logger.debug({ tag: this.LOG_TAG, accountId, entityType, entityId, attributeKeys }, 'Skipping deleteEntityAttributesSync in test environment');
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
// Validate inputs
|
|
330
|
+
if (!Number.isInteger(accountId)) {
|
|
331
|
+
throw new errors_argumentError.ArgumentError(`accountId must be an integer, got: ${accountId}`);
|
|
332
|
+
}
|
|
333
|
+
if (!entityType || typeof entityType !== 'string') {
|
|
334
|
+
throw new errors_argumentError.ArgumentError(`entityType must be a string, got: ${typeof entityType}`);
|
|
335
|
+
}
|
|
336
|
+
if (!Number.isInteger(entityId)) {
|
|
337
|
+
throw new errors_argumentError.ArgumentError(`entityId must be an integer, got: ${entityId}`);
|
|
338
|
+
}
|
|
339
|
+
if (!Array.isArray(attributeKeys)) {
|
|
340
|
+
throw new errors_argumentError.ArgumentError('attributeKeys must be an array');
|
|
341
|
+
}
|
|
342
|
+
if (attributeKeys.length === 0) {
|
|
343
|
+
authorizationInternalService.logger.warn({ tag: this.LOG_TAG, accountId, entityType, entityId }, 'deleteEntityAttributesSync called with empty keys array');
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
// Validate all keys are strings
|
|
347
|
+
for (let i = 0; i < attributeKeys.length; i++) {
|
|
348
|
+
if (typeof attributeKeys[i] !== 'string') {
|
|
349
|
+
throw new errors_argumentError.ArgumentError(`All attributeKeys must be strings, but item at index ${i} is not`);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
// Build request body
|
|
353
|
+
const requestBody = {
|
|
354
|
+
keys: attributeKeys,
|
|
355
|
+
};
|
|
356
|
+
const httpClient = tridentBackendApi.Api.getPart('httpClient');
|
|
357
|
+
if (!httpClient) {
|
|
358
|
+
throw new Error('AuthorizationAttributesMsService: HTTP client is not initialized');
|
|
359
|
+
}
|
|
360
|
+
const path = DELETE_ENTITY_ATTRIBUTES_PATH.replace('{accountId}', accountId.toString())
|
|
361
|
+
.replace('{entityType}', entityType)
|
|
362
|
+
.replace('{entityId}', entityId.toString());
|
|
363
|
+
const headers = this.getRequestHeaders(accountId);
|
|
364
|
+
try {
|
|
365
|
+
authorizationInternalService.logger.info({ tag: this.LOG_TAG, accountId, entityType, entityId, keys: attributeKeys }, 'Deleting entity attributes');
|
|
366
|
+
await httpClient.fetch({
|
|
367
|
+
url: {
|
|
368
|
+
appName: constants.APP_NAME,
|
|
369
|
+
path,
|
|
370
|
+
},
|
|
371
|
+
method: 'DELETE',
|
|
372
|
+
headers,
|
|
373
|
+
body: JSON.stringify(requestBody),
|
|
374
|
+
}, {
|
|
375
|
+
timeout: authorizationInternalService.AuthorizationInternalService.getRequestTimeout(),
|
|
376
|
+
retryPolicy: authorizationInternalService.AuthorizationInternalService.getRetriesPolicy(),
|
|
377
|
+
});
|
|
378
|
+
authorizationInternalService.logger.info({ tag: this.LOG_TAG, accountId, entityType, entityId, keys: attributeKeys }, 'Successfully deleted entity attributes');
|
|
379
|
+
}
|
|
380
|
+
catch (err) {
|
|
381
|
+
authorizationInternalService.logger.error({
|
|
382
|
+
tag: this.LOG_TAG,
|
|
383
|
+
accountId,
|
|
384
|
+
method: 'deleteEntityAttributesSync',
|
|
385
|
+
entityType,
|
|
386
|
+
entityId,
|
|
387
|
+
error: err instanceof Error ? err.message : String(err),
|
|
388
|
+
}, 'Failed to delete entity attributes');
|
|
389
|
+
if (err instanceof mondayFetchApi.HttpFetcherError) {
|
|
390
|
+
throw new Error(`AuthorizationAttributesMsService: [deleteEntityAttributesSync] request failed with status ${err.status}: ${err.message}`);
|
|
391
|
+
}
|
|
392
|
+
throw err;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
230
395
|
}
|
|
231
396
|
|
|
232
397
|
exports.AuthorizationAttributesMsService = AuthorizationAttributesMsService;
|
|
@@ -1,35 +1,55 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { RecursivePartial } from '@mondaydotcomorg/monday-fetch-api';
|
|
3
|
-
import { ResourceAttributeAssignment, ResourceAttributeResponse, ResourceAttributesOperation, EntityAttributeAssignment, EntityAttributeResponse, ResourceType, EntityType, ResourceAttributeKeyType, EntityAttributeKeyType } from './types/authorization-attributes-contracts';
|
|
1
|
+
import { ResourceAttributeAssignment, ResourceAttributesOperation, EntityAttributeAssignment, EntityAttributesOperation } from './types/authorization-attributes-contracts';
|
|
4
2
|
import { Resource } from './types/general';
|
|
5
3
|
export declare class AuthorizationAttributesService {
|
|
6
4
|
private static LOG_TAG;
|
|
7
|
-
private static API_PATHS;
|
|
8
|
-
private httpClient;
|
|
9
|
-
private fetchOptions;
|
|
10
5
|
private snsArn;
|
|
11
6
|
/**
|
|
12
7
|
* Public constructor to create the AuthorizationAttributesService instance.
|
|
13
|
-
* @param httpClient The HTTP client to use for API requests, if not provided, the default HTTP client from Api will be used.
|
|
14
|
-
* @param fetchOptions The fetch options to use for API requests, if not provided, the default fetch options will be used.
|
|
15
8
|
*/
|
|
16
|
-
constructor(
|
|
9
|
+
constructor();
|
|
17
10
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* @param
|
|
21
|
-
*
|
|
22
|
-
* @
|
|
11
|
+
* Async function to upsert resource attributes using SNS.
|
|
12
|
+
* Sends the updates request to SNS and returns before the change actually took place.
|
|
13
|
+
* @param accountId The account ID
|
|
14
|
+
* @param appName App name of the calling app
|
|
15
|
+
* @param callerActionIdentifier Action identifier
|
|
16
|
+
* @param resourceAttributeAssignments Array of resource attribute assignments to upsert
|
|
17
|
+
* @return Promise with array of sent operations
|
|
23
18
|
*/
|
|
24
|
-
|
|
19
|
+
upsertResourceAttributesAsync(accountId: number, appName: string, callerActionIdentifier: string, resourceAttributeAssignments: ResourceAttributeAssignment[]): Promise<ResourceAttributesOperation[]>;
|
|
25
20
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* @param
|
|
29
|
-
* @param
|
|
30
|
-
* @
|
|
21
|
+
* Async function to delete resource attributes using SNS.
|
|
22
|
+
* Sends the updates request to SNS and returns before the change actually took place.
|
|
23
|
+
* @param accountId The account ID
|
|
24
|
+
* @param appName App name of the calling app
|
|
25
|
+
* @param callerActionIdentifier Action identifier
|
|
26
|
+
* @param resource The resource (resourceType, resourceId)
|
|
27
|
+
* @param attributeKeys Array of attribute keys to delete
|
|
28
|
+
* @return Promise with array of sent operations
|
|
29
|
+
*/
|
|
30
|
+
deleteResourceAttributesAsync(accountId: number, appName: string, callerActionIdentifier: string, resource: Resource, attributeKeys: string[]): Promise<ResourceAttributesOperation[]>;
|
|
31
|
+
/**
|
|
32
|
+
* Async function to upsert entity attributes using SNS.
|
|
33
|
+
* Sends the updates request to SNS and returns before the change actually took place.
|
|
34
|
+
* @param accountId The account ID
|
|
35
|
+
* @param appName App name of the calling app
|
|
36
|
+
* @param callerActionIdentifier Action identifier
|
|
37
|
+
* @param entityAttributeAssignments Array of entity attribute assignments to upsert
|
|
38
|
+
* @return Promise with array of sent operations
|
|
39
|
+
*/
|
|
40
|
+
upsertEntityAttributesAsync(accountId: number, appName: string, callerActionIdentifier: string, entityAttributeAssignments: EntityAttributeAssignment[]): Promise<EntityAttributesOperation[]>;
|
|
41
|
+
/**
|
|
42
|
+
* Async function to delete entity attributes using SNS.
|
|
43
|
+
* Sends the updates request to SNS and returns before the change actually took place.
|
|
44
|
+
* @param accountId The account ID
|
|
45
|
+
* @param appName App name of the calling app
|
|
46
|
+
* @param callerActionIdentifier Action identifier
|
|
47
|
+
* @param entityType The entity type
|
|
48
|
+
* @param entityId The entity ID
|
|
49
|
+
* @param attributeKeys Array of attribute keys to delete
|
|
50
|
+
* @return Promise with array of sent operations
|
|
31
51
|
*/
|
|
32
|
-
|
|
52
|
+
deleteEntityAttributesAsync(accountId: number, appName: string, callerActionIdentifier: string, entityType: string, entityId: number, attributeKeys: string[]): Promise<EntityAttributesOperation[]>;
|
|
33
53
|
/**
|
|
34
54
|
* Async function, this function only send the updates request to SNS and return before the change actually took place
|
|
35
55
|
* @param accountId
|
|
@@ -39,7 +59,17 @@ export declare class AuthorizationAttributesService {
|
|
|
39
59
|
* @return {Promise<ResourceAttributesOperation[]>} Array of sent operations
|
|
40
60
|
* */
|
|
41
61
|
updateResourceAttributesAsync(accountId: number, appName: string, callerActionIdentifier: string, resourceAttributeOperations: ResourceAttributesOperation[]): Promise<ResourceAttributesOperation[]>;
|
|
42
|
-
|
|
62
|
+
/**
|
|
63
|
+
* Async function, this function only send the updates request to SNS and return before the change actually took place
|
|
64
|
+
* @param accountId
|
|
65
|
+
* @param appName - App name of the calling app
|
|
66
|
+
* @param callerActionIdentifier - action identifier
|
|
67
|
+
* @param entityAttributeOperations - Array of operations to do on entity attributes.
|
|
68
|
+
* @return {Promise<EntityAttributesOperation[]>} Array of sent operations
|
|
69
|
+
* */
|
|
70
|
+
updateEntityAttributesAsync(accountId: number, appName: string, callerActionIdentifier: string, entityAttributeOperations: EntityAttributesOperation[]): Promise<EntityAttributesOperation[]>;
|
|
71
|
+
private sendSingleResourceSnsMessage;
|
|
72
|
+
private sendSingleEntitySnsMessage;
|
|
43
73
|
private static getSnsTopicArn;
|
|
44
74
|
/**
|
|
45
75
|
* Checks we can contact the required SNS topic that used to send attribute updates to Authorization MS.
|
|
@@ -50,49 +80,5 @@ export declare class AuthorizationAttributesService {
|
|
|
50
80
|
* @return {Promise<boolean>} - true if succeeded
|
|
51
81
|
*/
|
|
52
82
|
asyncResourceAttributesHealthCheck(): Promise<boolean>;
|
|
53
|
-
/**
|
|
54
|
-
* Validates resource attribute assignments array
|
|
55
|
-
*/
|
|
56
|
-
private static validateResourceAttributeAssignments;
|
|
57
|
-
/**
|
|
58
|
-
* Validates entity attribute assignments array
|
|
59
|
-
*/
|
|
60
|
-
private static validateEntityAttributeAssignments;
|
|
61
|
-
/**
|
|
62
|
-
* Upsert resource attributes synchronously.
|
|
63
|
-
* Matches API endpoint: POST /attributes/:accountId/resource
|
|
64
|
-
* @param accountId The account ID
|
|
65
|
-
* @param resourceAttributeAssignments Array of ResourceAttributeAssignment objects (1-100 items)
|
|
66
|
-
* @returns Promise with response containing affected attributes
|
|
67
|
-
*/
|
|
68
|
-
static upsertResourceAttributesSync(accountId: number, resourceAttributeAssignments: ResourceAttributeAssignment[]): Promise<ResourceAttributeResponse>;
|
|
69
|
-
/**
|
|
70
|
-
* Delete resource attributes synchronously.
|
|
71
|
-
* Matches API endpoint: DELETE /attributes/:accountId/resource/:resourceType/:resourceId
|
|
72
|
-
* @param accountId The account ID
|
|
73
|
-
* @param resourceType The resource type
|
|
74
|
-
* @param resourceId The resource ID
|
|
75
|
-
* @param keys Array of attribute keys to delete
|
|
76
|
-
* @returns Promise with response containing affected attributes
|
|
77
|
-
*/
|
|
78
|
-
static deleteResourceAttributesSync(accountId: number, resourceType: ResourceType, resourceId: number, keys: ResourceAttributeKeyType[]): Promise<ResourceAttributeResponse>;
|
|
79
|
-
/**
|
|
80
|
-
* Upsert entity attributes synchronously.
|
|
81
|
-
* Matches API endpoint: POST /attributes/:accountId/entity
|
|
82
|
-
* @param accountId The account ID
|
|
83
|
-
* @param entityAttributeAssignments Array of EntityAttributeAssignment objects (1-100 items)
|
|
84
|
-
* @returns Promise with response containing affected attributes
|
|
85
|
-
*/
|
|
86
|
-
static upsertEntityAttributesSync(accountId: number, entityAttributeAssignments: EntityAttributeAssignment[]): Promise<EntityAttributeResponse>;
|
|
87
|
-
/**
|
|
88
|
-
* Delete entity attributes synchronously.
|
|
89
|
-
* Matches API endpoint: DELETE /attributes/:accountId/entity/:entityType/:entityId
|
|
90
|
-
* @param accountId The account ID
|
|
91
|
-
* @param entityType The entity type
|
|
92
|
-
* @param entityId The entity ID
|
|
93
|
-
* @param keys Array of attribute keys to delete
|
|
94
|
-
* @returns Promise with response containing affected attributes
|
|
95
|
-
*/
|
|
96
|
-
static deleteEntityAttributesSync(accountId: number, entityType: EntityType, entityId: number, keys: EntityAttributeKeyType[]): Promise<EntityAttributeResponse>;
|
|
97
83
|
}
|
|
98
84
|
//# sourceMappingURL=authorization-attributes-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorization-attributes-service.d.ts","sourceRoot":"","sources":["../src/authorization-attributes-service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"authorization-attributes-service.d.ts","sourceRoot":"","sources":["../src/authorization-attributes-service.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,2BAA2B,EAC3B,2BAA2B,EAC3B,yBAAyB,EACzB,yBAAyB,EAG1B,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAY3C,qBAAa,8BAA8B;IACzC,OAAO,CAAC,MAAM,CAAC,OAAO,CAA8B;IACpD,OAAO,CAAC,MAAM,CAAS;IAEvB;;OAEG;;IAKH;;;;;;;;OAQG;IACG,6BAA6B,CACjC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,sBAAsB,EAAE,MAAM,EAC9B,4BAA4B,EAAE,2BAA2B,EAAE,GAC1D,OAAO,CAAC,2BAA2B,EAAE,CAAC;IAQzC;;;;;;;;;OASG;IACG,6BAA6B,CACjC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,sBAAsB,EAAE,MAAM,EAC9B,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,MAAM,EAAE,GACtB,OAAO,CAAC,2BAA2B,EAAE,CAAC;IAUzC;;;;;;;;OAQG;IACG,2BAA2B,CAC/B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,sBAAsB,EAAE,MAAM,EAC9B,0BAA0B,EAAE,yBAAyB,EAAE,GACtD,OAAO,CAAC,yBAAyB,EAAE,CAAC;IAQvC;;;;;;;;;;OAUG;IACG,2BAA2B,CAC/B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,sBAAsB,EAAE,MAAM,EAC9B,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EAAE,GACtB,OAAO,CAAC,yBAAyB,EAAE,CAAC;IAUvC;;;;;;;UAOM;IACA,6BAA6B,CACjC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,sBAAsB,EAAE,MAAM,EAC9B,2BAA2B,EAAE,2BAA2B,EAAE,GACzD,OAAO,CAAC,2BAA2B,EAAE,CAAC;IAYzC;;;;;;;UAOM;IACA,2BAA2B,CAC/B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,sBAAsB,EAAE,MAAM,EAC9B,yBAAyB,EAAE,yBAAyB,EAAE,GACrD,OAAO,CAAC,yBAAyB,EAAE,CAAC;YAYzB,4BAA4B;YA4B5B,0BAA0B;IA4BxC,OAAO,CAAC,MAAM,CAAC,cAAc;IAW7B;;;;;;;OAOG;IACG,kCAAkC,IAAI,OAAO,CAAC,OAAO,CAAC;CAoB7D"}
|