@mondaydotcomorg/monday-authorization 3.5.3-feat-shaime-support-entity-attributes-in-authorization-sdk-ade64f6 → 3.6.0-feat-shaime-support-entity-attributes-1-4c8e283
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-service.d.ts +47 -26
- package/dist/authorization-attributes-service.d.ts.map +1 -1
- package/dist/authorization-attributes-service.js +172 -33
- 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 +6 -5
- package/dist/base-attribute-assignment.d.ts.map +1 -1
- package/dist/base-attribute-assignment.js +8 -17
- package/dist/constants/sns.d.ts +2 -12
- package/dist/constants/sns.d.ts.map +1 -1
- package/dist/constants/sns.js +2 -22
- package/dist/entity-attribute-assignment.d.ts +4 -2
- package/dist/entity-attribute-assignment.d.ts.map +1 -1
- package/dist/entity-attribute-assignment.js +13 -4
- 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-service.d.ts +47 -26
- package/dist/esm/authorization-attributes-service.d.ts.map +1 -1
- package/dist/esm/authorization-attributes-service.mjs +168 -33
- 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 +6 -5
- package/dist/esm/base-attribute-assignment.d.ts.map +1 -1
- package/dist/esm/base-attribute-assignment.mjs +4 -17
- package/dist/esm/constants/sns.d.ts +2 -12
- package/dist/esm/constants/sns.d.ts.map +1 -1
- package/dist/esm/constants/sns.mjs +3 -17
- package/dist/esm/entity-attribute-assignment.d.ts +4 -2
- package/dist/esm/entity-attribute-assignment.d.ts.map +1 -1
- package/dist/esm/entity-attribute-assignment.mjs +13 -4
- 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 +4 -2
- package/dist/esm/resource-attribute-assignment.d.ts.map +1 -1
- package/dist/esm/resource-attribute-assignment.mjs +11 -2
- package/dist/esm/resource-attributes-constants.d.ts +21 -11
- package/dist/esm/resource-attributes-constants.d.ts.map +1 -1
- package/dist/esm/resource-attributes-constants.mjs +17 -14
- package/dist/esm/testKit/index.d.ts +4 -4
- package/dist/esm/testKit/index.d.ts.map +1 -1
- package/dist/esm/types/authorization-attributes-contracts.d.ts +5 -4
- package/dist/esm/types/authorization-attributes-contracts.d.ts.map +1 -1
- package/dist/esm/types/authorization-attributes-service.interface.d.ts +7 -20
- 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/assigment-schema.d.ts +29 -0
- package/dist/esm/utils/assigment-schema.d.ts.map +1 -0
- package/dist/esm/utils/assigment-schema.mjs +29 -0
- package/dist/esm/utils/validation.d.ts +13 -38
- package/dist/esm/utils/validation.d.ts.map +1 -1
- package/dist/esm/utils/validation.mjs +38 -97
- 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 +4 -2
- package/dist/resource-attribute-assignment.d.ts.map +1 -1
- package/dist/resource-attribute-assignment.js +11 -2
- package/dist/resource-attributes-constants.d.ts +21 -11
- package/dist/resource-attributes-constants.d.ts.map +1 -1
- package/dist/resource-attributes-constants.js +16 -13
- package/dist/testKit/index.d.ts +4 -4
- package/dist/testKit/index.d.ts.map +1 -1
- package/dist/types/authorization-attributes-contracts.d.ts +5 -4
- package/dist/types/authorization-attributes-contracts.d.ts.map +1 -1
- package/dist/types/authorization-attributes-service.interface.d.ts +7 -20
- 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/assigment-schema.d.ts +29 -0
- package/dist/utils/assigment-schema.d.ts.map +1 -0
- package/dist/utils/assigment-schema.js +36 -0
- package/dist/utils/validation.d.ts +13 -38
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validation.js +42 -97
- package/package.json +3 -3
- package/src/authorization-attributes-service.ts +223 -35
- package/src/authorization-middleware.ts +2 -2
- package/src/authorization-service.ts +4 -4
- package/src/base-attribute-assignment.ts +10 -35
- package/src/constants/sns.ts +2 -19
- package/src/entity-attribute-assignment.ts +17 -5
- 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 +19 -12
- package/src/resource-attributes-constants.ts +15 -23
- package/src/testKit/index.ts +5 -5
- package/src/types/authorization-attributes-contracts.ts +5 -5
- package/src/types/authorization-attributes-service.interface.ts +12 -38
- package/src/types/general.ts +2 -3
- package/src/utils/assigment-schema.ts +29 -0
- package/src/utils/validation.ts +41 -92
- package/dist/authorization-attributes-ms-service.d.ts +0 -90
- package/dist/authorization-attributes-ms-service.d.ts.map +0 -1
- package/dist/authorization-attributes-ms-service.js +0 -369
- package/dist/authorization-attributes-sns-service.d.ts +0 -90
- package/dist/authorization-attributes-sns-service.d.ts.map +0 -1
- package/dist/authorization-attributes-sns-service.js +0 -217
- package/dist/esm/authorization-attributes-ms-service.d.ts +0 -90
- package/dist/esm/authorization-attributes-ms-service.d.ts.map +0 -1
- package/dist/esm/authorization-attributes-ms-service.mjs +0 -367
- package/dist/esm/authorization-attributes-sns-service.d.ts +0 -90
- package/dist/esm/authorization-attributes-sns-service.d.ts.map +0 -1
- package/dist/esm/authorization-attributes-sns-service.mjs +0 -211
- package/src/authorization-attributes-ms-service.ts +0 -531
- package/src/authorization-attributes-sns-service.ts +0 -312
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
3
|
-
const chunk = require('lodash/chunk.js');
|
|
4
|
-
const mondaySns = require('@mondaydotcomorg/monday-sns');
|
|
5
|
-
const types_authorizationAttributesContracts = require('./types/authorization-attributes-contracts.js');
|
|
6
|
-
const authorizationInternalService = require('./authorization-internal-service.js');
|
|
7
|
-
const constants_sns = require('./constants/sns.js');
|
|
8
|
-
|
|
9
|
-
const _interopDefault = e => e && e.__esModule ? e : { default: e };
|
|
10
|
-
|
|
11
|
-
const chunk__default = /*#__PURE__*/_interopDefault(chunk);
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Service class for managing resource attributes asynchronously via SNS.
|
|
15
|
-
* Provides asynchronous operations to create/update and delete attributes on resources.
|
|
16
|
-
*/
|
|
17
|
-
class AuthorizationAttributesSnsService {
|
|
18
|
-
static LOG_TAG = 'authorization_attributes';
|
|
19
|
-
resourceSnsArn;
|
|
20
|
-
entitySnsArn;
|
|
21
|
-
/**
|
|
22
|
-
* Public constructor to create the AuthorizationAttributesSnsService instance.
|
|
23
|
-
*/
|
|
24
|
-
constructor() {
|
|
25
|
-
this.resourceSnsArn = AuthorizationAttributesSnsService.getSnsTopicArn(constants_sns.SnsTopicType.RESOURCE);
|
|
26
|
-
this.entitySnsArn = AuthorizationAttributesSnsService.getSnsTopicArn(constants_sns.SnsTopicType.ENTITY);
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Async function to upsert resource attributes using SNS.
|
|
30
|
-
* Sends the updates request to SNS and returns before the change actually took place.
|
|
31
|
-
* @param accountId The account ID
|
|
32
|
-
* @param appName App name of the calling app
|
|
33
|
-
* @param callerActionIdentifier Action identifier
|
|
34
|
-
* @param resourceAttributeAssignments Array of resource attribute assignments to upsert
|
|
35
|
-
* @return Promise with array of sent operations
|
|
36
|
-
*/
|
|
37
|
-
async upsertResourceAttributes(accountId, resourceAttributeAssignments, appName, callerActionIdentifier) {
|
|
38
|
-
if (!appName || !callerActionIdentifier) {
|
|
39
|
-
throw new Error('appName and callerActionIdentifier are required for SNS service');
|
|
40
|
-
}
|
|
41
|
-
const operations = resourceAttributeAssignments.map(assignment => ({
|
|
42
|
-
...assignment,
|
|
43
|
-
operationType: types_authorizationAttributesContracts.AttributeOperation.UPSERT,
|
|
44
|
-
}));
|
|
45
|
-
return this.updateResourceAttributes(accountId, appName, callerActionIdentifier, operations);
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Async function to delete resource attributes using SNS.
|
|
49
|
-
* Sends the updates request to SNS and returns before the change actually took place.
|
|
50
|
-
* @param accountId The account ID
|
|
51
|
-
* @param appName App name of the calling app
|
|
52
|
-
* @param callerActionIdentifier Action identifier
|
|
53
|
-
* @param resource The resource (resourceType, resourceId)
|
|
54
|
-
* @param attributeKeys Array of attribute keys to delete
|
|
55
|
-
* @return Promise with array of sent operations
|
|
56
|
-
*/
|
|
57
|
-
async deleteResourceAttributes(accountId, resource, attributeKeys, appName, callerActionIdentifier) {
|
|
58
|
-
if (!appName || !callerActionIdentifier) {
|
|
59
|
-
throw new Error('appName and callerActionIdentifier are required for SNS service');
|
|
60
|
-
}
|
|
61
|
-
const operations = attributeKeys.map(key => ({
|
|
62
|
-
resourceType: resource.type,
|
|
63
|
-
resourceId: resource.id,
|
|
64
|
-
key,
|
|
65
|
-
operationType: types_authorizationAttributesContracts.AttributeOperation.DELETE,
|
|
66
|
-
}));
|
|
67
|
-
return this.updateResourceAttributes(accountId, appName, callerActionIdentifier, operations);
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Async function to upsert entity attributes using SNS.
|
|
71
|
-
* Sends the updates request to SNS and returns before the change actually took place.
|
|
72
|
-
* @param accountId The account ID
|
|
73
|
-
* @param appName App name of the calling app
|
|
74
|
-
* @param callerActionIdentifier Action identifier
|
|
75
|
-
* @param entityAttributeAssignments Array of entity attribute assignments to upsert
|
|
76
|
-
* @return Promise with array of sent operations
|
|
77
|
-
*/
|
|
78
|
-
async upsertEntityAttributes(accountId, entityAttributeAssignments, appName, callerActionIdentifier) {
|
|
79
|
-
if (!appName || !callerActionIdentifier) {
|
|
80
|
-
throw new Error('appName and callerActionIdentifier are required for SNS service');
|
|
81
|
-
}
|
|
82
|
-
const operations = entityAttributeAssignments.map(assignment => {
|
|
83
|
-
return {
|
|
84
|
-
entityId: assignment.entityId,
|
|
85
|
-
entityType: assignment.entityType,
|
|
86
|
-
key: assignment.attributeKey,
|
|
87
|
-
value: assignment.attributeValue,
|
|
88
|
-
operationType: types_authorizationAttributesContracts.AttributeOperation.UPSERT,
|
|
89
|
-
};
|
|
90
|
-
});
|
|
91
|
-
return this.updateEntityAttributes(accountId, appName, callerActionIdentifier, operations);
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Async function to delete entity attributes using SNS.
|
|
95
|
-
* Sends the updates request to SNS and returns before the change actually took place.
|
|
96
|
-
* @param accountId The account ID
|
|
97
|
-
* @param appName App name of the calling app
|
|
98
|
-
* @param callerActionIdentifier Action identifier
|
|
99
|
-
* @param entityType The entity type
|
|
100
|
-
* @param entityId The entity ID
|
|
101
|
-
* @param attributeKeys Array of attribute keys to delete
|
|
102
|
-
* @return Promise with array of sent operations
|
|
103
|
-
*/
|
|
104
|
-
async deleteEntityAttributes(accountId, entityType, entityId, attributeKeys, appName, callerActionIdentifier) {
|
|
105
|
-
if (!appName || !callerActionIdentifier) {
|
|
106
|
-
throw new Error('appName and callerActionIdentifier are required for SNS service');
|
|
107
|
-
}
|
|
108
|
-
const operations = attributeKeys.map(key => ({
|
|
109
|
-
entityType: entityType,
|
|
110
|
-
entityId,
|
|
111
|
-
key,
|
|
112
|
-
operationType: types_authorizationAttributesContracts.AttributeOperation.DELETE,
|
|
113
|
-
}));
|
|
114
|
-
return this.updateEntityAttributes(accountId, appName, callerActionIdentifier, operations);
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Async function, this function only send the updates request to SNS and return before the change actually took place
|
|
118
|
-
* @param accountId
|
|
119
|
-
* @param appName - App name of the calling app
|
|
120
|
-
* @param callerActionIdentifier - action identifier
|
|
121
|
-
* @param resourceAttributeOperations - Array of operations to do on resource attributes.
|
|
122
|
-
* @return {Promise<ResourceAttributesOperation[]>} Array of sent operations
|
|
123
|
-
* */
|
|
124
|
-
async updateResourceAttributes(accountId, appName, callerActionIdentifier, resourceAttributeOperations) {
|
|
125
|
-
const topicArn = this.resourceSnsArn;
|
|
126
|
-
const sendToSnsPromises = [];
|
|
127
|
-
const operationChucks = chunk__default.default(resourceAttributeOperations, constants_sns.ASYNC_RESOURCE_ATTRIBUTES_MAX_OPERATIONS_PER_MESSAGE);
|
|
128
|
-
for (const operationsChunk of operationChucks) {
|
|
129
|
-
sendToSnsPromises.push(this.sendSingleSnsMessage(topicArn, accountId, appName, callerActionIdentifier, operationsChunk, constants_sns.RESOURCE_ATTRIBUTES_SNS_UPDATE_OPERATION_MESSAGE_KIND, 'Authorization resource attributes async update: failed to send operations to SNS'));
|
|
130
|
-
}
|
|
131
|
-
return (await Promise.all(sendToSnsPromises)).flat();
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Async function, this function only send the updates request to SNS and return before the change actually took place
|
|
135
|
-
* @param accountId
|
|
136
|
-
* @param appName - App name of the calling app
|
|
137
|
-
* @param callerActionIdentifier - action identifier
|
|
138
|
-
* @param entityAttributeOperations - Array of operations to do on entity attributes.
|
|
139
|
-
* @return {Promise<EntityAttributeOperation[]>} Array of sent operations
|
|
140
|
-
* */
|
|
141
|
-
async updateEntityAttributes(accountId, appName, callerActionIdentifier, entityAttributeOperations) {
|
|
142
|
-
const topicArn = this.entitySnsArn;
|
|
143
|
-
const sendToSnsPromises = [];
|
|
144
|
-
const operationChucks = chunk__default.default(entityAttributeOperations, constants_sns.ASYNC_ENTITY_ATTRIBUTES_MAX_OPERATIONS_PER_MESSAGE);
|
|
145
|
-
for (const operationsChunk of operationChucks) {
|
|
146
|
-
sendToSnsPromises.push(this.sendSingleSnsMessage(topicArn, accountId, appName, callerActionIdentifier, operationsChunk, constants_sns.ENTITY_ATTRIBUTES_SNS_UPDATE_OPERATION_MESSAGE_KIND, 'Authorization entity attributes async update: failed to send operations to SNS'));
|
|
147
|
-
}
|
|
148
|
-
return (await Promise.all(sendToSnsPromises)).flat();
|
|
149
|
-
}
|
|
150
|
-
async sendSingleSnsMessage(topicArn, accountId, appName, callerActionIdentifier, operations, kind, errorLogMessage) {
|
|
151
|
-
const payload = {
|
|
152
|
-
kind,
|
|
153
|
-
payload: {
|
|
154
|
-
accountId: accountId,
|
|
155
|
-
callerAppName: appName,
|
|
156
|
-
callerActionIdentifier: callerActionIdentifier,
|
|
157
|
-
operations: operations,
|
|
158
|
-
},
|
|
159
|
-
};
|
|
160
|
-
try {
|
|
161
|
-
await mondaySns.sendToSns(payload, topicArn);
|
|
162
|
-
return operations;
|
|
163
|
-
}
|
|
164
|
-
catch (error) {
|
|
165
|
-
authorizationInternalService.logger.error({ error, tag: AuthorizationAttributesSnsService.LOG_TAG }, errorLogMessage);
|
|
166
|
-
return [];
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
static getSnsTopicArn(type) {
|
|
170
|
-
let envVarName;
|
|
171
|
-
let devTestName;
|
|
172
|
-
switch (type) {
|
|
173
|
-
case constants_sns.SnsTopicType.ENTITY:
|
|
174
|
-
envVarName = constants_sns.ENTITY_SNS_ARN_ENV_VAR_NAME;
|
|
175
|
-
devTestName = constants_sns.ENTITY_SNS_DEV_TEST_NAME;
|
|
176
|
-
break;
|
|
177
|
-
default:
|
|
178
|
-
// Default to resource SNS constants
|
|
179
|
-
envVarName = constants_sns.RESOURCE_SNS_ARN_ENV_VAR_NAME;
|
|
180
|
-
devTestName = constants_sns.RESOURCE_SNS_DEV_TEST_NAME;
|
|
181
|
-
break;
|
|
182
|
-
}
|
|
183
|
-
const arnFromEnv = process.env[envVarName];
|
|
184
|
-
if (arnFromEnv) {
|
|
185
|
-
return arnFromEnv;
|
|
186
|
-
}
|
|
187
|
-
if (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test') {
|
|
188
|
-
return devTestName;
|
|
189
|
-
}
|
|
190
|
-
throw new Error(`Unable to get ${type} sns topic arn from env variable`);
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* Checks we can contact the required SNS topic that used to send attribute updates to Authorization MS.
|
|
194
|
-
* This function can be used as health check for services that updating resource attributes in async is crucial.
|
|
195
|
-
* Note this function only verify the POD can contact AWS SDK and the topic exists, but the user still might get
|
|
196
|
-
* errors when pushing for the SNS (e.g: in case the AWS role of the POD don't have permissions to push messages).
|
|
197
|
-
* However, this is the best we can do without actually push dummy messages to the SNS.
|
|
198
|
-
* @return {Promise<boolean>} - true if succeeded
|
|
199
|
-
*/
|
|
200
|
-
async asyncResourceAttributesHealthCheck() {
|
|
201
|
-
try {
|
|
202
|
-
const requestedTopicArn = this.resourceSnsArn;
|
|
203
|
-
const attributes = await mondaySns.getTopicAttributes(requestedTopicArn);
|
|
204
|
-
const isHealthy = !(!attributes || !('TopicArn' in attributes) || attributes.TopicArn !== requestedTopicArn);
|
|
205
|
-
if (!isHealthy) {
|
|
206
|
-
authorizationInternalService.logger.error({ requestedTopicArn, snsReturnedAttributes: attributes, tag: AuthorizationAttributesSnsService.LOG_TAG }, 'authorization-attributes-service failed in health check');
|
|
207
|
-
}
|
|
208
|
-
return isHealthy;
|
|
209
|
-
}
|
|
210
|
-
catch (error) {
|
|
211
|
-
authorizationInternalService.logger.error({ error, tag: AuthorizationAttributesSnsService.LOG_TAG }, 'authorization-attributes-service got error during health check');
|
|
212
|
-
return false;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
exports.AuthorizationAttributesSnsService = AuthorizationAttributesSnsService;
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { ResourceAttributeAssignment } from './resource-attribute-assignment';
|
|
2
|
-
import { EntityAttributeAssignment } from './entity-attribute-assignment';
|
|
3
|
-
import { EntityType, ResourceAttributeOperation, EntityAttributeOperation } from './types/authorization-attributes-contracts';
|
|
4
|
-
import { IAuthorizationAttributesService } from './types/authorization-attributes-service.interface';
|
|
5
|
-
import { Resource } from './types/general';
|
|
6
|
-
/**
|
|
7
|
-
* Service class for managing resource attributes in the authorization microservice.
|
|
8
|
-
* Provides synchronous HTTP operations to create/update and delete attributes on resources.
|
|
9
|
-
*/
|
|
10
|
-
export declare class AuthorizationAttributesMsService implements IAuthorizationAttributesService {
|
|
11
|
-
private static LOG_TAG;
|
|
12
|
-
private static httpClient;
|
|
13
|
-
/**
|
|
14
|
-
* Creates or updates resource attributes synchronously.
|
|
15
|
-
* @param accountId The account ID
|
|
16
|
-
* @param resourceAttributeAssignments Array of ResourceAttributeAssignment objects
|
|
17
|
-
* @returns Promise<void>
|
|
18
|
-
*/
|
|
19
|
-
upsertResourceAttributes(accountId: number, resourceAttributeAssignments: ResourceAttributeAssignment[], _appName?: string, _callerActionIdentifier?: string): Promise<void>;
|
|
20
|
-
/**
|
|
21
|
-
* Deletes specific attributes from a resource synchronously.
|
|
22
|
-
* @param accountId The account ID
|
|
23
|
-
* @param resource Object with resourceType (string) and resourceId (number)
|
|
24
|
-
* @param attributeKeys Array of attribute key strings to delete
|
|
25
|
-
* @returns Promise<void>
|
|
26
|
-
*/
|
|
27
|
-
deleteResourceAttributes(accountId: number, resource: Resource, attributeKeys: string[], _appName?: string, _callerActionIdentifier?: string): Promise<void>;
|
|
28
|
-
/**
|
|
29
|
-
* Creates or updates entity attributes synchronously.
|
|
30
|
-
* @param accountId The account ID
|
|
31
|
-
* @param entityAttributeAssignments Array of EntityAttributeAssignment objects
|
|
32
|
-
* @returns Promise<void>
|
|
33
|
-
*/
|
|
34
|
-
upsertEntityAttributes(accountId: number, entityAttributeAssignments: EntityAttributeAssignment[], _appName?: string, _callerActionIdentifier?: string): Promise<void>;
|
|
35
|
-
/**
|
|
36
|
-
* Deletes specific attributes from an entity synchronously.
|
|
37
|
-
* @param accountId The account ID
|
|
38
|
-
* @param entityType The entity type
|
|
39
|
-
* @param entityId The entity ID
|
|
40
|
-
* @param attributeKeys Array of attribute key strings to delete
|
|
41
|
-
* @returns Promise<void>
|
|
42
|
-
*/
|
|
43
|
-
deleteEntityAttributes(accountId: number, entityType: EntityType | string, entityId: number, attributeKeys: string[], _appName?: string, _callerActionIdentifier?: string): Promise<void>;
|
|
44
|
-
/**
|
|
45
|
-
* Updates resource attributes (batch operations).
|
|
46
|
-
* Note: MS service does not support batch operations directly.
|
|
47
|
-
* This method processes operations sequentially using upsert/delete methods.
|
|
48
|
-
* @param accountId The account ID
|
|
49
|
-
* @param appName App name (required for interface compatibility, but not used in MS service)
|
|
50
|
-
* @param callerActionIdentifier Action identifier (required for interface compatibility, but not used in MS service)
|
|
51
|
-
* @param resourceAttributeOperations Array of operations to perform
|
|
52
|
-
* @returns Promise<ResourceAttributesOperation[]> Array of processed operations
|
|
53
|
-
*/
|
|
54
|
-
updateResourceAttributes(accountId: number, _appName: string, _callerActionIdentifier: string, resourceAttributeOperations: ResourceAttributeOperation[]): Promise<ResourceAttributeOperation[]>;
|
|
55
|
-
/**
|
|
56
|
-
* Updates entity attributes (batch operations).
|
|
57
|
-
* Note: MS service does not support batch operations directly.
|
|
58
|
-
* This method processes operations sequentially using upsert/delete methods.
|
|
59
|
-
* @param accountId The account ID
|
|
60
|
-
* @param appName App name (required for interface compatibility, but not used in MS service)
|
|
61
|
-
* @param callerActionIdentifier Action identifier (required for interface compatibility, but not used in MS service)
|
|
62
|
-
* @param entityAttributeOperations Array of operations to perform
|
|
63
|
-
* @returns Promise<EntityAttributesOperation[]> Array of processed operations
|
|
64
|
-
*/
|
|
65
|
-
updateEntityAttributes(accountId: number, _appName: string, _callerActionIdentifier: string, entityAttributeOperations: EntityAttributeOperation[]): Promise<EntityAttributeOperation[]>;
|
|
66
|
-
/**
|
|
67
|
-
* Replaces path template parameters with actual values
|
|
68
|
-
* @param template Path template with placeholders like {accountId}
|
|
69
|
-
* @param params Object with parameter names and values
|
|
70
|
-
* @returns Path with all placeholders replaced
|
|
71
|
-
*/
|
|
72
|
-
private static replacePathParams;
|
|
73
|
-
/**
|
|
74
|
-
* Generic helper for executing delete requests
|
|
75
|
-
*/
|
|
76
|
-
private static executeDeleteRequest;
|
|
77
|
-
/**
|
|
78
|
-
* Gets request headers including Authorization, Content-Type, and optional attribution headers
|
|
79
|
-
*/
|
|
80
|
-
private static getRequestHeaders;
|
|
81
|
-
/**
|
|
82
|
-
* Validates that all messages are instances of the specified message class
|
|
83
|
-
*/
|
|
84
|
-
private static validateMessages;
|
|
85
|
-
/**
|
|
86
|
-
* Generic helper for executing upsert requests
|
|
87
|
-
*/
|
|
88
|
-
private static executeUpsertRequest;
|
|
89
|
-
}
|
|
90
|
-
//# sourceMappingURL=authorization-attributes-ms-service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAEL,UAAU,EACV,0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