@mondaydotcomorg/monday-authorization 3.6.0-feat-shaime-support-entity-attributes-3-edf2a0b → 3.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/authorization-attributes-ms-service.d.ts +2 -2
- package/dist/authorization-attributes-ms-service.d.ts.map +1 -1
- package/dist/authorization-attributes-ms-service.js +10 -28
- package/dist/authorization-attributes-service.d.ts +12 -10
- package/dist/authorization-attributes-service.d.ts.map +1 -1
- package/dist/authorization-attributes-service.js +17 -15
- package/dist/authorization-attributes-sns-service.d.ts +2 -2
- package/dist/authorization-attributes-sns-service.d.ts.map +1 -1
- package/dist/authorization-attributes-sns-service.js +7 -23
- package/dist/base-authorization-attributes-service.d.ts +32 -0
- package/dist/base-authorization-attributes-service.d.ts.map +1 -0
- package/dist/base-authorization-attributes-service.js +63 -0
- package/dist/esm/authorization-attributes-ms-service.d.ts +2 -2
- package/dist/esm/authorization-attributes-ms-service.d.ts.map +1 -1
- package/dist/esm/authorization-attributes-ms-service.mjs +10 -28
- package/dist/esm/authorization-attributes-service.d.ts +12 -10
- package/dist/esm/authorization-attributes-service.d.ts.map +1 -1
- package/dist/esm/authorization-attributes-service.mjs +17 -15
- package/dist/esm/authorization-attributes-sns-service.d.ts +2 -2
- package/dist/esm/authorization-attributes-sns-service.d.ts.map +1 -1
- package/dist/esm/authorization-attributes-sns-service.mjs +7 -23
- package/dist/esm/base-authorization-attributes-service.d.ts +32 -0
- package/dist/esm/base-authorization-attributes-service.d.ts.map +1 -0
- package/dist/esm/base-authorization-attributes-service.mjs +61 -0
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.mjs +1 -0
- package/dist/esm/resource-attribute-assignment.d.ts.map +1 -1
- package/dist/esm/resource-attribute-assignment.mjs +7 -0
- package/dist/esm/resource-attributes-constants.d.ts +2 -1
- package/dist/esm/resource-attributes-constants.d.ts.map +1 -1
- package/dist/esm/resource-attributes-constants.mjs +1 -0
- package/dist/esm/utils/validation.mjs +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/resource-attribute-assignment.d.ts.map +1 -1
- package/dist/resource-attribute-assignment.js +7 -0
- package/dist/resource-attributes-constants.d.ts +2 -1
- package/dist/resource-attributes-constants.d.ts.map +1 -1
- package/dist/resource-attributes-constants.js +1 -0
- package/dist/utils/validation.js +2 -2
- package/package.json +1 -1
- package/src/authorization-attributes-ms-service.ts +19 -31
- package/src/authorization-attributes-service.ts +18 -16
- package/src/authorization-attributes-sns-service.ts +15 -23
- package/src/base-authorization-attributes-service.ts +90 -0
- package/src/index.ts +1 -1
- package/src/resource-attribute-assignment.ts +7 -0
- package/src/resource-attributes-constants.ts +1 -0
- package/src/utils/validation.ts +2 -2
- package/dist/esm/types/authorization-attributes-service.interface.d.ts +0 -32
- package/dist/esm/types/authorization-attributes-service.interface.d.ts.map +0 -1
- package/dist/esm/types/authorization-attributes-service.interface.mjs +0 -1
- package/dist/types/authorization-attributes-service.interface.d.ts +0 -32
- package/dist/types/authorization-attributes-service.interface.d.ts.map +0 -1
- package/dist/types/authorization-attributes-service.interface.js +0 -1
- package/src/types/authorization-attributes-service.interface.ts +0 -63
|
@@ -1,46 +1,48 @@
|
|
|
1
1
|
import { AuthorizationAttributesMsService } from './authorization-attributes-ms-service';
|
|
2
2
|
import { AuthorizationAttributesSnsService } from './authorization-attributes-sns-service';
|
|
3
|
-
import {
|
|
3
|
+
import { BaseAuthorizationAttributesService as IAuthorizationAttributesService } from './base-authorization-attributes-service';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Main service class for managing resource and entity attributes.
|
|
7
|
-
* Provides access to both direct
|
|
7
|
+
* Provides access to both HTTP (direct microservice) and SNS (async messaging) operations.
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* const service = new AuthorizationAttributesService();
|
|
11
11
|
*
|
|
12
|
-
* // Use direct
|
|
13
|
-
* await service.
|
|
12
|
+
* // Use HTTP operations (direct calls to microservice)
|
|
13
|
+
* await service.http().updateResourceAttributes(accountId, appName, actionId, operation);
|
|
14
14
|
*
|
|
15
|
-
* // Use SNS operations
|
|
16
|
-
* await service.sns().
|
|
15
|
+
* // Use SNS operations (async messaging, then to microservice)
|
|
16
|
+
* await service.sns().updateResourceAttributes(accountId, appName, actionId, operation);
|
|
17
17
|
* ```
|
|
18
18
|
*/
|
|
19
19
|
export class AuthorizationAttributesService {
|
|
20
|
-
private
|
|
21
|
-
private
|
|
20
|
+
private httpService: AuthorizationAttributesMsService | null = null;
|
|
21
|
+
private snsService: AuthorizationAttributesSnsService | null = null;
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
* Gets the
|
|
24
|
+
* Gets the HTTP service instance.
|
|
25
|
+
* Performs direct HTTP calls to the authorization microservice.
|
|
25
26
|
* Initializes the service on first access (lazy initialization).
|
|
26
27
|
* @returns IAuthorizationAttributesService instance
|
|
27
28
|
*/
|
|
28
|
-
|
|
29
|
-
if (this.
|
|
30
|
-
this.
|
|
29
|
+
http(): IAuthorizationAttributesService {
|
|
30
|
+
if (this.httpService === null) {
|
|
31
|
+
this.httpService = new AuthorizationAttributesMsService();
|
|
31
32
|
}
|
|
32
|
-
return this.
|
|
33
|
+
return this.httpService;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
/**
|
|
36
37
|
* Gets the SNS service instance.
|
|
38
|
+
* Sends operations via SNS messaging, which are then processed by the microservice asynchronously.
|
|
37
39
|
* Initializes the service on first access (lazy initialization).
|
|
38
40
|
* @returns IAuthorizationAttributesService instance
|
|
39
41
|
*/
|
|
40
42
|
sns(): IAuthorizationAttributesService {
|
|
41
|
-
if (this.
|
|
42
|
-
this.
|
|
43
|
+
if (this.snsService === null) {
|
|
44
|
+
this.snsService = new AuthorizationAttributesSnsService();
|
|
43
45
|
}
|
|
44
|
-
return this.
|
|
46
|
+
return this.snsService;
|
|
45
47
|
}
|
|
46
48
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import chunk from 'lodash/chunk.js';
|
|
2
2
|
import { getTopicAttributes, sendToSns } from '@mondaydotcomorg/monday-sns';
|
|
3
3
|
import {
|
|
4
|
-
AttributeOperation,
|
|
5
4
|
ResourceAttributeUpsertOperation,
|
|
6
5
|
EntityAttributeUpsertOperation,
|
|
7
6
|
EntityAttributeDeleteOperation,
|
|
@@ -20,16 +19,15 @@ import {
|
|
|
20
19
|
ENTITY_SNS_DEV_TEST_NAME,
|
|
21
20
|
SnsTopicType,
|
|
22
21
|
} from './constants/sns';
|
|
23
|
-
import {
|
|
22
|
+
import { BaseAuthorizationAttributesService } from './base-authorization-attributes-service';
|
|
24
23
|
import { EntityType } from './entity-attributes-constants';
|
|
25
|
-
import { ValidationUtils } from './utils/validation';
|
|
26
24
|
import type { TopicAttributesMap } from 'aws-sdk/clients/sns';
|
|
27
25
|
|
|
28
26
|
/**
|
|
29
27
|
* Service class for managing resource attributes asynchronously via SNS.
|
|
30
28
|
* Provides asynchronous operations to create/update and delete attributes on resources.
|
|
31
29
|
*/
|
|
32
|
-
export class AuthorizationAttributesSnsService
|
|
30
|
+
export class AuthorizationAttributesSnsService extends BaseAuthorizationAttributesService {
|
|
33
31
|
private static LOG_TAG = 'authorization_attributes';
|
|
34
32
|
private resourceSnsArn: string;
|
|
35
33
|
private entitySnsArn: string;
|
|
@@ -38,6 +36,7 @@ export class AuthorizationAttributesSnsService implements AuthorizationAttribute
|
|
|
38
36
|
* Public constructor to create the AuthorizationAttributesSnsService instance.
|
|
39
37
|
*/
|
|
40
38
|
constructor() {
|
|
39
|
+
super();
|
|
41
40
|
this.resourceSnsArn = AuthorizationAttributesSnsService.getSnsTopicArn(SnsTopicType.RESOURCE);
|
|
42
41
|
this.entitySnsArn = AuthorizationAttributesSnsService.getSnsTopicArn(SnsTopicType.ENTITY);
|
|
43
42
|
}
|
|
@@ -62,17 +61,11 @@ export class AuthorizationAttributesSnsService implements AuthorizationAttribute
|
|
|
62
61
|
if (!appName || !callerActionIdentifier) {
|
|
63
62
|
throw new Error('appName and callerActionIdentifier are required for SNS service');
|
|
64
63
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const operation: ResourceAttributeDeleteOperation = {
|
|
71
|
-
resourceType: resource.type,
|
|
72
|
-
resourceId: resource.id,
|
|
73
|
-
key: attributeKey,
|
|
74
|
-
operationType: AttributeOperation.DELETE,
|
|
75
|
-
};
|
|
64
|
+
const operation: ResourceAttributeDeleteOperation = await super.deleteResourceAttributes(
|
|
65
|
+
accountId,
|
|
66
|
+
resource,
|
|
67
|
+
attributeKey
|
|
68
|
+
);
|
|
76
69
|
const [result] = await this.sendOperationsToSns(
|
|
77
70
|
this.resourceSnsArn,
|
|
78
71
|
accountId,
|
|
@@ -108,13 +101,12 @@ export class AuthorizationAttributesSnsService implements AuthorizationAttribute
|
|
|
108
101
|
if (!appName || !callerActionIdentifier) {
|
|
109
102
|
throw new Error('appName and callerActionIdentifier are required for SNS service');
|
|
110
103
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
entityType
|
|
104
|
+
const operation: EntityAttributeDeleteOperation = await super.deleteEntityAttributes(
|
|
105
|
+
accountId,
|
|
106
|
+
entityType,
|
|
114
107
|
entityId,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
};
|
|
108
|
+
attributeKey
|
|
109
|
+
);
|
|
118
110
|
const [result] = await this.sendOperationsToSns(
|
|
119
111
|
this.entitySnsArn,
|
|
120
112
|
accountId,
|
|
@@ -142,7 +134,7 @@ export class AuthorizationAttributesSnsService implements AuthorizationAttribute
|
|
|
142
134
|
callerActionIdentifier: string,
|
|
143
135
|
resourceAttributeOperation: ResourceAttributeUpsertOperation
|
|
144
136
|
): Promise<ResourceAttributeUpsertOperation> {
|
|
145
|
-
|
|
137
|
+
await super.updateResourceAttributes(accountId, appName, callerActionIdentifier, resourceAttributeOperation);
|
|
146
138
|
const [result] = await this.sendOperationsToSns(
|
|
147
139
|
this.resourceSnsArn,
|
|
148
140
|
accountId,
|
|
@@ -170,7 +162,7 @@ export class AuthorizationAttributesSnsService implements AuthorizationAttribute
|
|
|
170
162
|
callerActionIdentifier: string,
|
|
171
163
|
entityAttributeOperation: EntityAttributeUpsertOperation
|
|
172
164
|
): Promise<EntityAttributeUpsertOperation> {
|
|
173
|
-
|
|
165
|
+
await super.updateEntityAttributes(accountId, appName, callerActionIdentifier, entityAttributeOperation);
|
|
174
166
|
const [result] = await this.sendOperationsToSns(
|
|
175
167
|
this.entitySnsArn,
|
|
176
168
|
accountId,
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { EntityType } from './entity-attributes-constants';
|
|
2
|
+
import {
|
|
3
|
+
ResourceAttributeDeleteOperation,
|
|
4
|
+
EntityAttributeDeleteOperation,
|
|
5
|
+
ResourceAttributeUpsertOperation,
|
|
6
|
+
EntityAttributeUpsertOperation,
|
|
7
|
+
AttributeOperation,
|
|
8
|
+
} from './types/authorization-attributes-contracts';
|
|
9
|
+
import { Resource } from './types/general';
|
|
10
|
+
import { ValidationUtils } from './utils/validation';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Abstract base class for authorization attributes operations.
|
|
14
|
+
* Both MS (HTTP) and SNS (async) services extend this class.
|
|
15
|
+
*/
|
|
16
|
+
export abstract class BaseAuthorizationAttributesService {
|
|
17
|
+
/**
|
|
18
|
+
* Deletes a resource attribute.
|
|
19
|
+
* Returns Promise<ResourceAttributeDeleteOperation>
|
|
20
|
+
*/
|
|
21
|
+
deleteResourceAttributes(
|
|
22
|
+
accountId: number,
|
|
23
|
+
resource: Resource,
|
|
24
|
+
attributeKey: string,
|
|
25
|
+
_appName?: string,
|
|
26
|
+
_callerActionIdentifier?: string
|
|
27
|
+
): Promise<ResourceAttributeDeleteOperation> {
|
|
28
|
+
const operation: ResourceAttributeDeleteOperation = {
|
|
29
|
+
resourceType: resource.type,
|
|
30
|
+
resourceId: resource.id,
|
|
31
|
+
key: attributeKey,
|
|
32
|
+
operationType: AttributeOperation.DELETE,
|
|
33
|
+
};
|
|
34
|
+
ValidationUtils.validateInteger(accountId);
|
|
35
|
+
ValidationUtils.validatDeleteResourceAssignment(operation);
|
|
36
|
+
return Promise.resolve(operation);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Deletes an entity attribute.
|
|
41
|
+
* Returns Promise<EntityAttributeDeleteOperation>
|
|
42
|
+
*/
|
|
43
|
+
deleteEntityAttributes(
|
|
44
|
+
accountId: number,
|
|
45
|
+
entityType: EntityType,
|
|
46
|
+
entityId: number,
|
|
47
|
+
attributeKey: string
|
|
48
|
+
): Promise<EntityAttributeDeleteOperation> {
|
|
49
|
+
const operation: EntityAttributeDeleteOperation = {
|
|
50
|
+
entityType: entityType,
|
|
51
|
+
entityId: entityId,
|
|
52
|
+
key: attributeKey,
|
|
53
|
+
operationType: AttributeOperation.DELETE,
|
|
54
|
+
};
|
|
55
|
+
ValidationUtils.validateInteger(accountId);
|
|
56
|
+
ValidationUtils.validatDeleteEntityAssignment(operation);
|
|
57
|
+
return Promise.resolve(operation);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Updates a resource attribute (single operation - upsert only).
|
|
62
|
+
* For MS service: performs upsert operation
|
|
63
|
+
* For SNS service: returns Promise<ResourceAttributeUpsertOperation>
|
|
64
|
+
*/
|
|
65
|
+
updateResourceAttributes(
|
|
66
|
+
accountId: number,
|
|
67
|
+
_appName: string,
|
|
68
|
+
_callerActionIdentifier: string,
|
|
69
|
+
resourceAttributeOperation: ResourceAttributeUpsertOperation
|
|
70
|
+
): Promise<ResourceAttributeUpsertOperation> {
|
|
71
|
+
ValidationUtils.validateInteger(accountId);
|
|
72
|
+
ValidationUtils.validatUpsertResourceAssignment(resourceAttributeOperation);
|
|
73
|
+
return Promise.resolve(resourceAttributeOperation);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Updates an entity attribute (single operation - upsert only).
|
|
77
|
+
* For MS service: performs upsert operation
|
|
78
|
+
* For SNS service: returns Promise<EntityAttributeUpsertOperation>
|
|
79
|
+
*/
|
|
80
|
+
updateEntityAttributes(
|
|
81
|
+
accountId: number,
|
|
82
|
+
_appName: string,
|
|
83
|
+
_callerActionIdentifier: string,
|
|
84
|
+
entityAttributeOperation: EntityAttributeUpsertOperation
|
|
85
|
+
): Promise<EntityAttributeUpsertOperation> {
|
|
86
|
+
ValidationUtils.validateInteger(accountId);
|
|
87
|
+
ValidationUtils.validatUpsertEntityAssignment(entityAttributeOperation);
|
|
88
|
+
return Promise.resolve(entityAttributeOperation);
|
|
89
|
+
}
|
|
90
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -84,6 +84,6 @@ export {
|
|
|
84
84
|
ResourceAttributeAssignment as ResourceAttributeAssignmentContract,
|
|
85
85
|
EntityAttributeAssignment as EntityAttributeAssignmentContract,
|
|
86
86
|
} from './types/authorization-attributes-contracts';
|
|
87
|
-
export {
|
|
87
|
+
export { BaseAuthorizationAttributesService as IAuthorizationAttributesService } from './base-authorization-attributes-service';
|
|
88
88
|
|
|
89
89
|
export { TestKit };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ResourceType } from './resource-attributes-constants';
|
|
2
2
|
import { BaseAttributeAssignment } from './base-attribute-assignment';
|
|
3
3
|
import { ResourceAttributeAssignment as ResourceAttributeAssignmentContract } from './types/authorization-attributes-contracts';
|
|
4
|
+
import { ValidationUtils } from './utils/validation';
|
|
4
5
|
|
|
5
6
|
export class ResourceAttributeAssignment extends BaseAttributeAssignment<
|
|
6
7
|
ResourceType,
|
|
@@ -10,6 +11,12 @@ export class ResourceAttributeAssignment extends BaseAttributeAssignment<
|
|
|
10
11
|
public readonly resourceType: ResourceType;
|
|
11
12
|
|
|
12
13
|
constructor(resourceId: number, resourceType: ResourceType, attributeKey: string, attributeValue: string) {
|
|
14
|
+
ValidationUtils.validatUpsertResourceAssignment({
|
|
15
|
+
resourceId,
|
|
16
|
+
resourceType,
|
|
17
|
+
key: attributeKey,
|
|
18
|
+
value: attributeValue,
|
|
19
|
+
});
|
|
13
20
|
super(resourceId, resourceType, attributeKey, attributeValue);
|
|
14
21
|
this.resourceId = resourceId;
|
|
15
22
|
this.resourceType = this.type;
|
package/src/utils/validation.ts
CHANGED
|
@@ -76,7 +76,7 @@ export class ValidationUtils {
|
|
|
76
76
|
static validatDeleteResourceAssignment(resource: ResourceAttributeDeleteAssignment): void {
|
|
77
77
|
const valid = resourceDeleteAssignmentSchema(resource);
|
|
78
78
|
if (!valid) {
|
|
79
|
-
const errorMessage = this.formatValidationErrors(
|
|
79
|
+
const errorMessage = this.formatValidationErrors(resourceDeleteAssignmentSchema.errors);
|
|
80
80
|
throw new ArgumentError(
|
|
81
81
|
errorMessage
|
|
82
82
|
? `Invalid resource attribute assignment: ${errorMessage}`
|
|
@@ -108,7 +108,7 @@ export class ValidationUtils {
|
|
|
108
108
|
* Formats AJV validation errors into a readable error message
|
|
109
109
|
*/
|
|
110
110
|
private static formatValidationErrors(errors: ErrorObject[] | null | undefined): string {
|
|
111
|
-
if (!errors || errors.length
|
|
111
|
+
if (!errors || !errors.length) {
|
|
112
112
|
return '';
|
|
113
113
|
}
|
|
114
114
|
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { EntityType } from '../entity-attributes-constants';
|
|
2
|
-
import { ResourceAttributeDeleteOperation, EntityAttributeDeleteOperation, ResourceAttributeUpsertOperation, EntityAttributeUpsertOperation } from './authorization-attributes-contracts';
|
|
3
|
-
import { Resource } from './general';
|
|
4
|
-
/**
|
|
5
|
-
* Interface for authorization attributes operations.
|
|
6
|
-
* Both MS (direct) and SNS (async) services implement this interface.
|
|
7
|
-
*/
|
|
8
|
-
export interface AuthorizationAttributesService {
|
|
9
|
-
/**
|
|
10
|
-
* Deletes a resource attribute.
|
|
11
|
-
* Returns Promise<ResourceAttributeDeleteOperation>
|
|
12
|
-
*/
|
|
13
|
-
deleteResourceAttributes(accountId: number, resource: Resource, attributeKey: string, appName?: string, callerActionIdentifier?: string): Promise<ResourceAttributeDeleteOperation>;
|
|
14
|
-
/**
|
|
15
|
-
* Deletes an entity attribute.
|
|
16
|
-
* Returns Promise<EntityAttributeDeleteOperation>
|
|
17
|
-
*/
|
|
18
|
-
deleteEntityAttributes(accountId: number, entityType: EntityType | string, entityId: number, attributeKey: string, appName?: string, callerActionIdentifier?: string): Promise<EntityAttributeDeleteOperation>;
|
|
19
|
-
/**
|
|
20
|
-
* Updates a resource attribute (single operation - upsert only).
|
|
21
|
-
* For MS service: performs upsert operation
|
|
22
|
-
* For SNS service: returns Promise<ResourceAttributeUpsertOperation>
|
|
23
|
-
*/
|
|
24
|
-
updateResourceAttributes(accountId: number, appName: string, callerActionIdentifier: string, resourceAttributeOperation: ResourceAttributeUpsertOperation): Promise<ResourceAttributeUpsertOperation>;
|
|
25
|
-
/**
|
|
26
|
-
* Updates an entity attribute (single operation - upsert only).
|
|
27
|
-
* For MS service: performs upsert operation
|
|
28
|
-
* For SNS service: returns Promise<EntityAttributeUpsertOperation>
|
|
29
|
-
*/
|
|
30
|
-
updateEntityAttributes(accountId: number, appName: string, callerActionIdentifier: string, entityAttributeOperation: EntityAttributeUpsertOperation): Promise<EntityAttributeUpsertOperation>;
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=authorization-attributes-service.interface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authorization-attributes-service.interface.d.ts","sourceRoot":"","sources":["../../../src/types/authorization-attributes-service.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EACL,gCAAgC,EAChC,8BAA8B,EAC9B,gCAAgC,EAChC,8BAA8B,EAC/B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC;;;GAGG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;;OAGG;IACH,wBAAwB,CACtB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,MAAM,EAChB,sBAAsB,CAAC,EAAE,MAAM,GAC9B,OAAO,CAAC,gCAAgC,CAAC,CAAC;IAE7C;;;OAGG;IACH,sBAAsB,CACpB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,UAAU,GAAG,MAAM,EAC/B,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,MAAM,EAChB,sBAAsB,CAAC,EAAE,MAAM,GAC9B,OAAO,CAAC,8BAA8B,CAAC,CAAC;IAE3C;;;;OAIG;IACH,wBAAwB,CACtB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,sBAAsB,EAAE,MAAM,EAC9B,0BAA0B,EAAE,gCAAgC,GAC3D,OAAO,CAAC,gCAAgC,CAAC,CAAC;IAE7C;;;;OAIG;IACH,sBAAsB,CACpB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,sBAAsB,EAAE,MAAM,EAC9B,wBAAwB,EAAE,8BAA8B,GACvD,OAAO,CAAC,8BAA8B,CAAC,CAAC;CAC5C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { EntityType } from '../entity-attributes-constants';
|
|
2
|
-
import { ResourceAttributeDeleteOperation, EntityAttributeDeleteOperation, ResourceAttributeUpsertOperation, EntityAttributeUpsertOperation } from './authorization-attributes-contracts';
|
|
3
|
-
import { Resource } from './general';
|
|
4
|
-
/**
|
|
5
|
-
* Interface for authorization attributes operations.
|
|
6
|
-
* Both MS (direct) and SNS (async) services implement this interface.
|
|
7
|
-
*/
|
|
8
|
-
export interface AuthorizationAttributesService {
|
|
9
|
-
/**
|
|
10
|
-
* Deletes a resource attribute.
|
|
11
|
-
* Returns Promise<ResourceAttributeDeleteOperation>
|
|
12
|
-
*/
|
|
13
|
-
deleteResourceAttributes(accountId: number, resource: Resource, attributeKey: string, appName?: string, callerActionIdentifier?: string): Promise<ResourceAttributeDeleteOperation>;
|
|
14
|
-
/**
|
|
15
|
-
* Deletes an entity attribute.
|
|
16
|
-
* Returns Promise<EntityAttributeDeleteOperation>
|
|
17
|
-
*/
|
|
18
|
-
deleteEntityAttributes(accountId: number, entityType: EntityType | string, entityId: number, attributeKey: string, appName?: string, callerActionIdentifier?: string): Promise<EntityAttributeDeleteOperation>;
|
|
19
|
-
/**
|
|
20
|
-
* Updates a resource attribute (single operation - upsert only).
|
|
21
|
-
* For MS service: performs upsert operation
|
|
22
|
-
* For SNS service: returns Promise<ResourceAttributeUpsertOperation>
|
|
23
|
-
*/
|
|
24
|
-
updateResourceAttributes(accountId: number, appName: string, callerActionIdentifier: string, resourceAttributeOperation: ResourceAttributeUpsertOperation): Promise<ResourceAttributeUpsertOperation>;
|
|
25
|
-
/**
|
|
26
|
-
* Updates an entity attribute (single operation - upsert only).
|
|
27
|
-
* For MS service: performs upsert operation
|
|
28
|
-
* For SNS service: returns Promise<EntityAttributeUpsertOperation>
|
|
29
|
-
*/
|
|
30
|
-
updateEntityAttributes(accountId: number, appName: string, callerActionIdentifier: string, entityAttributeOperation: EntityAttributeUpsertOperation): Promise<EntityAttributeUpsertOperation>;
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=authorization-attributes-service.interface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authorization-attributes-service.interface.d.ts","sourceRoot":"","sources":["../../src/types/authorization-attributes-service.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EACL,gCAAgC,EAChC,8BAA8B,EAC9B,gCAAgC,EAChC,8BAA8B,EAC/B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC;;;GAGG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;;OAGG;IACH,wBAAwB,CACtB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,MAAM,EAChB,sBAAsB,CAAC,EAAE,MAAM,GAC9B,OAAO,CAAC,gCAAgC,CAAC,CAAC;IAE7C;;;OAGG;IACH,sBAAsB,CACpB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,UAAU,GAAG,MAAM,EAC/B,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,MAAM,EAChB,sBAAsB,CAAC,EAAE,MAAM,GAC9B,OAAO,CAAC,8BAA8B,CAAC,CAAC;IAE3C;;;;OAIG;IACH,wBAAwB,CACtB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,sBAAsB,EAAE,MAAM,EAC9B,0BAA0B,EAAE,gCAAgC,GAC3D,OAAO,CAAC,gCAAgC,CAAC,CAAC;IAE7C;;;;OAIG;IACH,sBAAsB,CACpB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,sBAAsB,EAAE,MAAM,EAC9B,wBAAwB,EAAE,8BAA8B,GACvD,OAAO,CAAC,8BAA8B,CAAC,CAAC;CAC5C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { EntityType } from '../entity-attributes-constants';
|
|
2
|
-
import {
|
|
3
|
-
ResourceAttributeDeleteOperation,
|
|
4
|
-
EntityAttributeDeleteOperation,
|
|
5
|
-
ResourceAttributeUpsertOperation,
|
|
6
|
-
EntityAttributeUpsertOperation,
|
|
7
|
-
} from './authorization-attributes-contracts';
|
|
8
|
-
import { Resource } from './general';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Interface for authorization attributes operations.
|
|
12
|
-
* Both MS (direct) and SNS (async) services implement this interface.
|
|
13
|
-
*/
|
|
14
|
-
export interface AuthorizationAttributesService {
|
|
15
|
-
/**
|
|
16
|
-
* Deletes a resource attribute.
|
|
17
|
-
* Returns Promise<ResourceAttributeDeleteOperation>
|
|
18
|
-
*/
|
|
19
|
-
deleteResourceAttributes(
|
|
20
|
-
accountId: number,
|
|
21
|
-
resource: Resource,
|
|
22
|
-
attributeKey: string,
|
|
23
|
-
appName?: string,
|
|
24
|
-
callerActionIdentifier?: string
|
|
25
|
-
): Promise<ResourceAttributeDeleteOperation>;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Deletes an entity attribute.
|
|
29
|
-
* Returns Promise<EntityAttributeDeleteOperation>
|
|
30
|
-
*/
|
|
31
|
-
deleteEntityAttributes(
|
|
32
|
-
accountId: number,
|
|
33
|
-
entityType: EntityType | string,
|
|
34
|
-
entityId: number,
|
|
35
|
-
attributeKey: string,
|
|
36
|
-
appName?: string,
|
|
37
|
-
callerActionIdentifier?: string
|
|
38
|
-
): Promise<EntityAttributeDeleteOperation>;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Updates a resource attribute (single operation - upsert only).
|
|
42
|
-
* For MS service: performs upsert operation
|
|
43
|
-
* For SNS service: returns Promise<ResourceAttributeUpsertOperation>
|
|
44
|
-
*/
|
|
45
|
-
updateResourceAttributes(
|
|
46
|
-
accountId: number,
|
|
47
|
-
appName: string,
|
|
48
|
-
callerActionIdentifier: string,
|
|
49
|
-
resourceAttributeOperation: ResourceAttributeUpsertOperation
|
|
50
|
-
): Promise<ResourceAttributeUpsertOperation>;
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Updates an entity attribute (single operation - upsert only).
|
|
54
|
-
* For MS service: performs upsert operation
|
|
55
|
-
* For SNS service: returns Promise<EntityAttributeUpsertOperation>
|
|
56
|
-
*/
|
|
57
|
-
updateEntityAttributes(
|
|
58
|
-
accountId: number,
|
|
59
|
-
appName: string,
|
|
60
|
-
callerActionIdentifier: string,
|
|
61
|
-
entityAttributeOperation: EntityAttributeUpsertOperation
|
|
62
|
-
): Promise<EntityAttributeUpsertOperation>;
|
|
63
|
-
}
|