@mondaydotcomorg/monday-authorization 3.5.3-feat-shaime-support-entity-attributes-in-authorization-sdk-e355942 → 3.5.3-feat-shaime-support-entity-attributes-in-authorization-sdk-ade64f6
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 -22
- package/dist/authorization-attributes-ms-service.d.ts.map +1 -1
- package/dist/authorization-attributes-ms-service.js +201 -194
- package/dist/authorization-attributes-sns-service.d.ts +1 -2
- package/dist/authorization-attributes-sns-service.d.ts.map +1 -1
- package/dist/authorization-attributes-sns-service.js +1 -1
- package/dist/esm/authorization-attributes-ms-service.d.ts +17 -22
- package/dist/esm/authorization-attributes-ms-service.d.ts.map +1 -1
- package/dist/esm/authorization-attributes-ms-service.mjs +201 -194
- package/dist/esm/authorization-attributes-sns-service.d.ts +1 -2
- package/dist/esm/authorization-attributes-sns-service.d.ts.map +1 -1
- package/dist/esm/authorization-attributes-sns-service.mjs +1 -1
- package/dist/esm/prometheus-service.d.ts.map +1 -1
- package/dist/esm/resource-attribute-assignment.d.ts +0 -10
- package/dist/esm/resource-attribute-assignment.d.ts.map +1 -1
- package/dist/esm/resource-attribute-assignment.mjs +0 -12
- package/dist/esm/resource-attributes-constants.d.ts +1 -1
- package/dist/esm/resource-attributes-constants.d.ts.map +1 -1
- package/dist/esm/resource-attributes-constants.mjs +11 -11
- package/dist/esm/types/authorization-attributes-service.interface.d.ts +1 -2
- package/dist/esm/types/authorization-attributes-service.interface.d.ts.map +1 -1
- package/dist/prometheus-service.d.ts.map +1 -1
- package/dist/resource-attribute-assignment.d.ts +0 -10
- package/dist/resource-attribute-assignment.d.ts.map +1 -1
- package/dist/resource-attribute-assignment.js +0 -12
- package/dist/resource-attributes-constants.d.ts +1 -1
- package/dist/resource-attributes-constants.d.ts.map +1 -1
- package/dist/resource-attributes-constants.js +11 -11
- package/dist/types/authorization-attributes-service.interface.d.ts +1 -2
- package/dist/types/authorization-attributes-service.interface.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/authorization-attributes-ms-service.ts +335 -332
- package/src/authorization-attributes-sns-service.ts +2 -2
- package/src/prometheus-service.ts +0 -1
- package/src/resource-attribute-assignment.ts +0 -14
- package/src/resource-attributes-constants.ts +12 -12
- package/src/types/authorization-attributes-service.interface.ts +2 -1
|
@@ -23,10 +23,186 @@ class AuthorizationAttributesMsService {
|
|
|
23
23
|
static LOG_TAG = 'authorization_attributes_ms';
|
|
24
24
|
static httpClient = Api.getPart('httpClient');
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* Creates or updates resource attributes synchronously.
|
|
27
|
+
* @param accountId The account ID
|
|
28
|
+
* @param resourceAttributeAssignments Array of ResourceAttributeAssignment objects
|
|
29
|
+
* @returns Promise<void>
|
|
30
|
+
*/
|
|
31
|
+
async upsertResourceAttributes(accountId, resourceAttributeAssignments, _appName, _callerActionIdentifier) {
|
|
32
|
+
return AuthorizationAttributesMsService.executeUpsertRequest(accountId, resourceAttributeAssignments, UPSERT_RESOURCE_ATTRIBUTES_PATH, 'resourceAttributeAssignments', ResourceAttributeAssignment, 'resource', 'upsertResourceAttributes');
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Deletes specific attributes from a resource synchronously.
|
|
36
|
+
* @param accountId The account ID
|
|
37
|
+
* @param resource Object with resourceType (string) and resourceId (number)
|
|
38
|
+
* @param attributeKeys Array of attribute key strings to delete
|
|
39
|
+
* @returns Promise<void>
|
|
40
|
+
*/
|
|
41
|
+
async deleteResourceAttributes(accountId, resource, attributeKeys, _appName, _callerActionIdentifier) {
|
|
42
|
+
// Validate resource object
|
|
43
|
+
if (!resource || typeof resource !== 'object') {
|
|
44
|
+
throw new ArgumentError('resource must be an object');
|
|
45
|
+
}
|
|
46
|
+
if (!resource.id) {
|
|
47
|
+
throw new ArgumentError('resource.id is required');
|
|
48
|
+
}
|
|
49
|
+
ValidationUtils.validateInteger(resource.id, 'resource.id');
|
|
50
|
+
ValidationUtils.validateString(resource.type, 'resource.type');
|
|
51
|
+
return AuthorizationAttributesMsService.executeDeleteRequest(accountId, DELETE_RESOURCE_ATTRIBUTES_PATH, {
|
|
52
|
+
resourceType: resource.type,
|
|
53
|
+
resourceId: resource.id,
|
|
54
|
+
}, attributeKeys, 'resource', 'deleteResourceAttributesSync', { resource });
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Creates or updates entity attributes synchronously.
|
|
58
|
+
* @param accountId The account ID
|
|
59
|
+
* @param entityAttributeAssignments Array of EntityAttributeAssignment objects
|
|
60
|
+
* @returns Promise<void>
|
|
61
|
+
*/
|
|
62
|
+
async upsertEntityAttributes(accountId, entityAttributeAssignments, _appName, _callerActionIdentifier) {
|
|
63
|
+
return AuthorizationAttributesMsService.executeUpsertRequest(accountId, entityAttributeAssignments, UPSERT_ENTITY_ATTRIBUTES_PATH, 'entityAttributeAssignments', EntityAttributeAssignment, 'entity', 'upsertEntityAttributesSync');
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Deletes specific attributes from an entity synchronously.
|
|
67
|
+
* @param accountId The account ID
|
|
68
|
+
* @param entityType The entity type
|
|
69
|
+
* @param entityId The entity ID
|
|
70
|
+
* @param attributeKeys Array of attribute key strings to delete
|
|
71
|
+
* @returns Promise<void>
|
|
27
72
|
*/
|
|
28
|
-
|
|
29
|
-
|
|
73
|
+
async deleteEntityAttributes(accountId, entityType, entityId, attributeKeys, _appName, _callerActionIdentifier) {
|
|
74
|
+
if (!entityType || typeof entityType !== 'string' || entityType.trim() === '') {
|
|
75
|
+
throw new ArgumentError(`entityType must be a non-empty string, got: ${entityType}`);
|
|
76
|
+
}
|
|
77
|
+
ValidationUtils.validateInteger(entityId, 'entityId');
|
|
78
|
+
return AuthorizationAttributesMsService.executeDeleteRequest(accountId, DELETE_ENTITY_ATTRIBUTES_PATH, {
|
|
79
|
+
entityType,
|
|
80
|
+
entityId,
|
|
81
|
+
}, attributeKeys, 'entity', 'deleteEntityAttributesSync', { entityType, entityId });
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Updates resource attributes (batch operations).
|
|
85
|
+
* Note: MS service does not support batch operations directly.
|
|
86
|
+
* This method processes operations sequentially using upsert/delete methods.
|
|
87
|
+
* @param accountId The account ID
|
|
88
|
+
* @param appName App name (required for interface compatibility, but not used in MS service)
|
|
89
|
+
* @param callerActionIdentifier Action identifier (required for interface compatibility, but not used in MS service)
|
|
90
|
+
* @param resourceAttributeOperations Array of operations to perform
|
|
91
|
+
* @returns Promise<ResourceAttributesOperation[]> Array of processed operations
|
|
92
|
+
*/
|
|
93
|
+
async updateResourceAttributes(accountId, _appName, _callerActionIdentifier, resourceAttributeOperations) {
|
|
94
|
+
const processedOperations = [];
|
|
95
|
+
for (const operation of resourceAttributeOperations) {
|
|
96
|
+
if (operation.operationType === AttributeOperation.UPSERT) {
|
|
97
|
+
if (!operation.resourceId) {
|
|
98
|
+
throw new ArgumentError('resourceId is required for upsert operation');
|
|
99
|
+
}
|
|
100
|
+
await this.upsertResourceAttributes(accountId, [
|
|
101
|
+
new ResourceAttributeAssignment(operation.resourceId, operation.resourceType, operation.key, operation.value || ''),
|
|
102
|
+
]);
|
|
103
|
+
processedOperations.push(operation);
|
|
104
|
+
}
|
|
105
|
+
else if (operation.operationType === AttributeOperation.DELETE) {
|
|
106
|
+
if (!operation.resourceId) {
|
|
107
|
+
throw new ArgumentError('resourceId is required for delete operation');
|
|
108
|
+
}
|
|
109
|
+
await this.deleteResourceAttributes(accountId, {
|
|
110
|
+
type: operation.resourceType,
|
|
111
|
+
id: operation.resourceId,
|
|
112
|
+
}, [operation.key]);
|
|
113
|
+
processedOperations.push(operation);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return processedOperations;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Updates entity attributes (batch operations).
|
|
120
|
+
* Note: MS service does not support batch operations directly.
|
|
121
|
+
* This method processes operations sequentially using upsert/delete methods.
|
|
122
|
+
* @param accountId The account ID
|
|
123
|
+
* @param appName App name (required for interface compatibility, but not used in MS service)
|
|
124
|
+
* @param callerActionIdentifier Action identifier (required for interface compatibility, but not used in MS service)
|
|
125
|
+
* @param entityAttributeOperations Array of operations to perform
|
|
126
|
+
* @returns Promise<EntityAttributesOperation[]> Array of processed operations
|
|
127
|
+
*/
|
|
128
|
+
async updateEntityAttributes(accountId, _appName, _callerActionIdentifier, entityAttributeOperations) {
|
|
129
|
+
const processedOperations = [];
|
|
130
|
+
for (const operation of entityAttributeOperations) {
|
|
131
|
+
if (operation.operationType === 'upsert') {
|
|
132
|
+
await this.upsertEntityAttributes(accountId, [
|
|
133
|
+
new EntityAttributeAssignment(operation.entityId, operation.entityType, operation.key, operation.value || ''),
|
|
134
|
+
]);
|
|
135
|
+
processedOperations.push(operation);
|
|
136
|
+
}
|
|
137
|
+
else if (operation.operationType === 'delete') {
|
|
138
|
+
await this.deleteEntityAttributes(accountId, operation.entityType, operation.entityId, [operation.key]);
|
|
139
|
+
processedOperations.push(operation);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return processedOperations;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Replaces path template parameters with actual values
|
|
146
|
+
* @param template Path template with placeholders like {accountId}
|
|
147
|
+
* @param params Object with parameter names and values
|
|
148
|
+
* @returns Path with all placeholders replaced
|
|
149
|
+
*/
|
|
150
|
+
static replacePathParams(template, params) {
|
|
151
|
+
let path = template;
|
|
152
|
+
for (const [key, value] of Object.entries(params)) {
|
|
153
|
+
path = path.replace(`{${key}}`, String(value));
|
|
154
|
+
}
|
|
155
|
+
return path;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Generic helper for executing delete requests
|
|
159
|
+
*/
|
|
160
|
+
static async executeDeleteRequest(accountId, pathTemplate, pathParams, keys, logPrefix, methodName, context = {}) {
|
|
161
|
+
// Validate inputs
|
|
162
|
+
ValidationUtils.validateInteger(accountId, 'accountId');
|
|
163
|
+
ValidationUtils.validateArray(keys, 'attributeKeys');
|
|
164
|
+
if (!keys.length) {
|
|
165
|
+
logger.warn({ tag: this.LOG_TAG, accountId, ...pathParams }, `${methodName} called with empty keys array`);
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
// Validate all keys are strings
|
|
169
|
+
ValidationUtils.validateStringArray(keys, 'attributeKeys');
|
|
170
|
+
// Build request body
|
|
171
|
+
const requestBody = {
|
|
172
|
+
keys,
|
|
173
|
+
};
|
|
174
|
+
if (!AuthorizationAttributesMsService.httpClient) {
|
|
175
|
+
throw new Error('AuthorizationAttributesMsService: HTTP client is not initialized');
|
|
176
|
+
}
|
|
177
|
+
const path = AuthorizationAttributesMsService.replacePathParams(pathTemplate, { accountId, ...pathParams });
|
|
178
|
+
const headers = AuthorizationAttributesMsService.getRequestHeaders(accountId);
|
|
179
|
+
try {
|
|
180
|
+
logger.info({ tag: AuthorizationAttributesMsService.LOG_TAG, accountId, ...pathParams, keys }, `Deleting ${logPrefix} attributes`);
|
|
181
|
+
await AuthorizationAttributesMsService.httpClient.fetch({
|
|
182
|
+
url: {
|
|
183
|
+
appName: APP_NAME,
|
|
184
|
+
path,
|
|
185
|
+
},
|
|
186
|
+
method: 'DELETE',
|
|
187
|
+
headers,
|
|
188
|
+
body: JSON.stringify(requestBody),
|
|
189
|
+
}, {
|
|
190
|
+
timeout: AuthorizationInternalService.getRequestTimeout(),
|
|
191
|
+
retryPolicy: AuthorizationInternalService.getRetriesPolicy(),
|
|
192
|
+
});
|
|
193
|
+
logger.info({ tag: AuthorizationAttributesMsService.LOG_TAG, accountId, ...pathParams, keys }, `Successfully deleted ${logPrefix} attributes`);
|
|
194
|
+
}
|
|
195
|
+
catch (err) {
|
|
196
|
+
logger.error({
|
|
197
|
+
tag: AuthorizationAttributesMsService.LOG_TAG,
|
|
198
|
+
method: methodName,
|
|
199
|
+
accountId,
|
|
200
|
+
...pathParams,
|
|
201
|
+
...context,
|
|
202
|
+
error: err instanceof Error ? err.message : String(err),
|
|
203
|
+
}, `Failed in ${methodName}`);
|
|
204
|
+
throw err;
|
|
205
|
+
}
|
|
30
206
|
}
|
|
31
207
|
/**
|
|
32
208
|
* Gets request headers including Authorization, Content-Type, and optional attribution headers
|
|
@@ -134,9 +310,27 @@ class AuthorizationAttributesMsService {
|
|
|
134
310
|
}
|
|
135
311
|
// Validate all assignments are instances of the correct class
|
|
136
312
|
AuthorizationAttributesMsService.validateMessages(assignments, assignmentClass);
|
|
313
|
+
const compatibileAssignments = assignments.map(assignment => {
|
|
314
|
+
if (assignment instanceof ResourceAttributeAssignment) {
|
|
315
|
+
return {
|
|
316
|
+
resourceId: assignment.resourceId,
|
|
317
|
+
resourceType: assignment.resourceType,
|
|
318
|
+
key: assignment.attributeKey,
|
|
319
|
+
value: assignment.attributeValue,
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
else {
|
|
323
|
+
return {
|
|
324
|
+
entityId: assignment.entityId,
|
|
325
|
+
entityType: assignment.entityType,
|
|
326
|
+
key: assignment.attributeKey,
|
|
327
|
+
value: assignment.attributeValue,
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
});
|
|
137
331
|
const requestBody = requestBodyKey === 'resourceAttributeAssignments'
|
|
138
|
-
? { resourceAttributeAssignments:
|
|
139
|
-
: { entityAttributeAssignments:
|
|
332
|
+
? { resourceAttributeAssignments: compatibileAssignments }
|
|
333
|
+
: { entityAttributeAssignments: compatibileAssignments };
|
|
140
334
|
if (!AuthorizationAttributesMsService.httpClient) {
|
|
141
335
|
throw new Error('AuthorizationAttributesMsService: HTTP client is not initialized');
|
|
142
336
|
}
|
|
@@ -159,202 +353,15 @@ class AuthorizationAttributesMsService {
|
|
|
159
353
|
logger.debug({ tag: AuthorizationAttributesMsService.LOG_TAG, accountId, count: assignments.length }, `Successfully upserted ${logPrefix} attributes`);
|
|
160
354
|
}
|
|
161
355
|
catch (err) {
|
|
162
|
-
const error = err;
|
|
163
356
|
logger.error({
|
|
164
357
|
tag: AuthorizationAttributesMsService.LOG_TAG,
|
|
165
358
|
method: methodName,
|
|
166
359
|
accountId,
|
|
167
|
-
error:
|
|
360
|
+
error: err instanceof Error ? err.message : String(err),
|
|
168
361
|
}, `Failed in ${methodName}`);
|
|
169
|
-
throw
|
|
362
|
+
throw err;
|
|
170
363
|
}
|
|
171
364
|
}
|
|
172
|
-
/**
|
|
173
|
-
* Generic helper for executing delete requests
|
|
174
|
-
*/
|
|
175
|
-
static async executeDeleteRequest(accountId, pathTemplate, pathParams, keys, logPrefix, methodName, context = {}) {
|
|
176
|
-
// Validate inputs
|
|
177
|
-
ValidationUtils.validateInteger(accountId, 'accountId');
|
|
178
|
-
ValidationUtils.validateArray(keys, 'attributeKeys');
|
|
179
|
-
if (!keys.length) {
|
|
180
|
-
logger.warn({ tag: this.LOG_TAG, accountId, ...pathParams }, `${methodName} called with empty keys array`);
|
|
181
|
-
return;
|
|
182
|
-
}
|
|
183
|
-
// Validate all keys are strings
|
|
184
|
-
ValidationUtils.validateStringArray(keys, 'attributeKeys');
|
|
185
|
-
// Build request body
|
|
186
|
-
const requestBody = {
|
|
187
|
-
keys,
|
|
188
|
-
};
|
|
189
|
-
if (!AuthorizationAttributesMsService.httpClient) {
|
|
190
|
-
throw new Error('AuthorizationAttributesMsService: HTTP client is not initialized');
|
|
191
|
-
}
|
|
192
|
-
const path = AuthorizationAttributesMsService.replacePathParams(pathTemplate, { accountId, ...pathParams });
|
|
193
|
-
const headers = AuthorizationAttributesMsService.getRequestHeaders(accountId);
|
|
194
|
-
try {
|
|
195
|
-
logger.info({ tag: AuthorizationAttributesMsService.LOG_TAG, accountId, ...pathParams, keys }, `Deleting ${logPrefix} attributes`);
|
|
196
|
-
await AuthorizationAttributesMsService.httpClient.fetch({
|
|
197
|
-
url: {
|
|
198
|
-
appName: APP_NAME,
|
|
199
|
-
path,
|
|
200
|
-
},
|
|
201
|
-
method: 'DELETE',
|
|
202
|
-
headers,
|
|
203
|
-
body: JSON.stringify(requestBody),
|
|
204
|
-
}, {
|
|
205
|
-
timeout: AuthorizationInternalService.getRequestTimeout(),
|
|
206
|
-
retryPolicy: AuthorizationInternalService.getRetriesPolicy(),
|
|
207
|
-
});
|
|
208
|
-
logger.info({ tag: AuthorizationAttributesMsService.LOG_TAG, accountId, ...pathParams, keys }, `Successfully deleted ${logPrefix} attributes`);
|
|
209
|
-
}
|
|
210
|
-
catch (err) {
|
|
211
|
-
const error = err;
|
|
212
|
-
logger.error({
|
|
213
|
-
tag: AuthorizationAttributesMsService.LOG_TAG,
|
|
214
|
-
method: methodName,
|
|
215
|
-
accountId,
|
|
216
|
-
...pathParams,
|
|
217
|
-
...context,
|
|
218
|
-
error: error instanceof Error ? error.message : String(error),
|
|
219
|
-
}, `Failed in ${methodName}`);
|
|
220
|
-
throw error;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* Creates or updates resource attributes synchronously.
|
|
225
|
-
* @param accountId The account ID
|
|
226
|
-
* @param resourceAttributeAssignments Array of ResourceAttributeAssignment objects
|
|
227
|
-
* @returns Promise<void>
|
|
228
|
-
*/
|
|
229
|
-
async upsertResourceAttributes(accountId, resourceAttributeAssignments, _appName, _callerActionIdentifier) {
|
|
230
|
-
return AuthorizationAttributesMsService.executeUpsertRequest(accountId, resourceAttributeAssignments, UPSERT_RESOURCE_ATTRIBUTES_PATH, 'resourceAttributeAssignments', ResourceAttributeAssignment, 'resource', 'upsertResourceAttributesSync');
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Deletes specific attributes from a resource synchronously.
|
|
234
|
-
* @param accountId The account ID
|
|
235
|
-
* @param resource Object with resourceType (string) and resourceId (number)
|
|
236
|
-
* @param attributeKeys Array of attribute key strings to delete
|
|
237
|
-
* @returns Promise<void>
|
|
238
|
-
*/
|
|
239
|
-
async deleteResourceAttributes(accountId, resource, attributeKeys, _appName, _callerActionIdentifier) {
|
|
240
|
-
// Validate resource object
|
|
241
|
-
if (!resource || typeof resource !== 'object') {
|
|
242
|
-
throw new ArgumentError('resource must be an object');
|
|
243
|
-
}
|
|
244
|
-
if (!resource.id) {
|
|
245
|
-
throw new ArgumentError('resource.id is required');
|
|
246
|
-
}
|
|
247
|
-
ValidationUtils.validateInteger(resource.id, 'resource.id');
|
|
248
|
-
ValidationUtils.validateString(resource.type, 'resource.type');
|
|
249
|
-
return AuthorizationAttributesMsService.executeDeleteRequest(accountId, DELETE_RESOURCE_ATTRIBUTES_PATH, {
|
|
250
|
-
resourceType: resource.type,
|
|
251
|
-
resourceId: resource.id,
|
|
252
|
-
}, attributeKeys, 'resource', 'deleteResourceAttributesSync', { resource });
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* Creates or updates entity attributes synchronously.
|
|
256
|
-
* @param accountId The account ID
|
|
257
|
-
* @param entityAttributeAssignments Array of EntityAttributeAssignment objects
|
|
258
|
-
* @returns Promise<void>
|
|
259
|
-
*/
|
|
260
|
-
async upsertEntityAttributes(accountId, entityAttributeAssignments, _appName, _callerActionIdentifier) {
|
|
261
|
-
return AuthorizationAttributesMsService.executeUpsertRequest(accountId, entityAttributeAssignments, UPSERT_ENTITY_ATTRIBUTES_PATH, 'entityAttributeAssignments', EntityAttributeAssignment, 'entity', 'upsertEntityAttributesSync');
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* Deletes specific attributes from an entity synchronously.
|
|
265
|
-
* @param accountId The account ID
|
|
266
|
-
* @param entityType The entity type
|
|
267
|
-
* @param entityId The entity ID
|
|
268
|
-
* @param attributeKeys Array of attribute key strings to delete
|
|
269
|
-
* @returns Promise<void>
|
|
270
|
-
*/
|
|
271
|
-
async deleteEntityAttributes(accountId, entityType, entityId, attributeKeys, _appName, _callerActionIdentifier) {
|
|
272
|
-
if (!entityType || typeof entityType !== 'string' || entityType.trim() === '') {
|
|
273
|
-
throw new ArgumentError(`entityType must be a non-empty string, got: ${entityType}`);
|
|
274
|
-
}
|
|
275
|
-
ValidationUtils.validateInteger(entityId, 'entityId');
|
|
276
|
-
return AuthorizationAttributesMsService.executeDeleteRequest(accountId, DELETE_ENTITY_ATTRIBUTES_PATH, {
|
|
277
|
-
entityType,
|
|
278
|
-
entityId,
|
|
279
|
-
}, attributeKeys, 'entity', 'deleteEntityAttributesSync', { entityType, entityId });
|
|
280
|
-
}
|
|
281
|
-
/**
|
|
282
|
-
* Updates resource attributes (batch operations).
|
|
283
|
-
* Note: MS service does not support batch operations directly.
|
|
284
|
-
* This method processes operations sequentially using upsert/delete methods.
|
|
285
|
-
* @param accountId The account ID
|
|
286
|
-
* @param appName App name (required for interface compatibility, but not used in MS service)
|
|
287
|
-
* @param callerActionIdentifier Action identifier (required for interface compatibility, but not used in MS service)
|
|
288
|
-
* @param resourceAttributeOperations Array of operations to perform
|
|
289
|
-
* @returns Promise<ResourceAttributesOperation[]> Array of processed operations
|
|
290
|
-
*/
|
|
291
|
-
async updateResourceAttributes(accountId, _appName, _callerActionIdentifier, resourceAttributeOperations) {
|
|
292
|
-
const processedOperations = [];
|
|
293
|
-
for (const operation of resourceAttributeOperations) {
|
|
294
|
-
if (operation.operationType === AttributeOperation.UPSERT) {
|
|
295
|
-
if (!operation.resourceId) {
|
|
296
|
-
throw new ArgumentError('resourceId is required for upsert operation');
|
|
297
|
-
}
|
|
298
|
-
await this.upsertResourceAttributes(accountId, [
|
|
299
|
-
new ResourceAttributeAssignment(operation.resourceId, operation.resourceType, operation.key, operation.value || ''),
|
|
300
|
-
]);
|
|
301
|
-
processedOperations.push(operation);
|
|
302
|
-
}
|
|
303
|
-
else if (operation.operationType === AttributeOperation.DELETE) {
|
|
304
|
-
if (!operation.resourceId) {
|
|
305
|
-
throw new ArgumentError('resourceId is required for delete operation');
|
|
306
|
-
}
|
|
307
|
-
await this.deleteResourceAttributes(accountId, {
|
|
308
|
-
type: operation.resourceType,
|
|
309
|
-
id: operation.resourceId,
|
|
310
|
-
}, [operation.key]);
|
|
311
|
-
processedOperations.push(operation);
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
return processedOperations;
|
|
315
|
-
}
|
|
316
|
-
/**
|
|
317
|
-
* Updates entity attributes (batch operations).
|
|
318
|
-
* Note: MS service does not support batch operations directly.
|
|
319
|
-
* This method processes operations sequentially using upsert/delete methods.
|
|
320
|
-
* @param accountId The account ID
|
|
321
|
-
* @param appName App name (required for interface compatibility, but not used in MS service)
|
|
322
|
-
* @param callerActionIdentifier Action identifier (required for interface compatibility, but not used in MS service)
|
|
323
|
-
* @param entityAttributeOperations Array of operations to perform
|
|
324
|
-
* @returns Promise<EntityAttributesOperation[]> Array of processed operations
|
|
325
|
-
*/
|
|
326
|
-
async updateEntityAttributes(accountId, _appName, _callerActionIdentifier, entityAttributeOperations) {
|
|
327
|
-
const processedOperations = [];
|
|
328
|
-
for (const operation of entityAttributeOperations) {
|
|
329
|
-
if (operation.operationType === 'upsert') {
|
|
330
|
-
const upsertOp = operation;
|
|
331
|
-
await this.upsertEntityAttributes(accountId, [
|
|
332
|
-
new EntityAttributeAssignment(operation.entityId, operation.entityType, operation.key, upsertOp.value || ''),
|
|
333
|
-
]);
|
|
334
|
-
processedOperations.push(operation);
|
|
335
|
-
}
|
|
336
|
-
else if (operation.operationType === 'delete') {
|
|
337
|
-
await this.deleteEntityAttributes(accountId, operation.entityType, operation.entityId, [
|
|
338
|
-
operation.key,
|
|
339
|
-
]);
|
|
340
|
-
processedOperations.push(operation);
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
return processedOperations;
|
|
344
|
-
}
|
|
345
|
-
/**
|
|
346
|
-
* Replaces path template parameters with actual values
|
|
347
|
-
* @param template Path template with placeholders like {accountId}
|
|
348
|
-
* @param params Object with parameter names and values
|
|
349
|
-
* @returns Path with all placeholders replaced
|
|
350
|
-
*/
|
|
351
|
-
static replacePathParams(template, params) {
|
|
352
|
-
let path = template;
|
|
353
|
-
for (const [key, value] of Object.entries(params)) {
|
|
354
|
-
path = path.replace(`{${key}}`, String(value));
|
|
355
|
-
}
|
|
356
|
-
return path;
|
|
357
|
-
}
|
|
358
365
|
}
|
|
359
366
|
|
|
360
367
|
export { AuthorizationAttributesMsService };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { ResourceAttributeAssignment, ResourceAttributeOperation, EntityAttributeOperation } from './types/authorization-attributes-contracts';
|
|
1
|
+
import { ResourceAttributeAssignment, ResourceAttributeOperation, EntityAttributeOperation, EntityType } from './types/authorization-attributes-contracts';
|
|
2
2
|
import { EntityAttributeAssignment } from './entity-attribute-assignment';
|
|
3
3
|
import { Resource } from './types/general';
|
|
4
4
|
import { IAuthorizationAttributesService } from './types/authorization-attributes-service.interface';
|
|
5
|
-
import { EntityType } from './types/authorization-attributes-contracts';
|
|
6
5
|
/**
|
|
7
6
|
* Service class for managing resource attributes asynchronously via SNS.
|
|
8
7
|
* Provides asynchronous operations to create/update and delete attributes on resources.
|
|
@@ -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,EAExB,UAAU,EACX,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAc3C,OAAO,EAAE,+BAA+B,EAAE,MAAM,oDAAoD,CAAC;AAErG;;;GAGG;AACH,qBAAa,iCAAkC,YAAW,+BAA+B;IACvF,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,8 +1,8 @@
|
|
|
1
1
|
import chunk from 'lodash/chunk.js';
|
|
2
2
|
import { sendToSns, getTopicAttributes } from '@mondaydotcomorg/monday-sns';
|
|
3
|
+
import { AttributeOperation } from './types/authorization-attributes-contracts.mjs';
|
|
3
4
|
import { logger } from './authorization-internal-service.mjs';
|
|
4
5
|
import { SnsTopicType, ASYNC_RESOURCE_ATTRIBUTES_MAX_OPERATIONS_PER_MESSAGE, RESOURCE_ATTRIBUTES_SNS_UPDATE_OPERATION_MESSAGE_KIND, ASYNC_ENTITY_ATTRIBUTES_MAX_OPERATIONS_PER_MESSAGE, ENTITY_ATTRIBUTES_SNS_UPDATE_OPERATION_MESSAGE_KIND, RESOURCE_SNS_ARN_ENV_VAR_NAME, RESOURCE_SNS_DEV_TEST_NAME, ENTITY_SNS_ARN_ENV_VAR_NAME, ENTITY_SNS_DEV_TEST_NAME } from './constants/sns.mjs';
|
|
5
|
-
import { AttributeOperation } from './types/authorization-attributes-contracts.mjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Service class for managing resource attributes asynchronously via SNS.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prometheus-service.d.ts","sourceRoot":"","sources":["../../src/prometheus-service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prometheus-service.d.ts","sourceRoot":"","sources":["../../src/prometheus-service.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO;;;;CAInB,CAAC;AAQF,wBAAgB,aAAa,CAAC,gBAAgB,KAAA,QAa7C;AAED,wBAAgB,iBAAiB,QAEhC;AAED,wBAAgB,wCAAwC,CACtD,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,OAAO,EACrB,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,MAAM,QASb"}
|
|
@@ -4,16 +4,6 @@ export declare class ResourceAttributeAssignment extends BaseAttributeAssignment
|
|
|
4
4
|
readonly resourceId: number;
|
|
5
5
|
readonly resourceType: ResourceType;
|
|
6
6
|
constructor(resourceId: number, resourceType: string, attributeKey: string, attributeValue: string);
|
|
7
|
-
/**
|
|
8
|
-
* Converts the assignment to a plain object with camelCase keys
|
|
9
|
-
* @returns Plain object with camelCase keys: { resourceId, resourceType, key, value }
|
|
10
|
-
*/
|
|
11
|
-
toPlainObject(): {
|
|
12
|
-
resourceId: number;
|
|
13
|
-
resourceType: string;
|
|
14
|
-
key: string;
|
|
15
|
-
value: string;
|
|
16
|
-
};
|
|
17
7
|
/**
|
|
18
8
|
* Compares two assignments for equality
|
|
19
9
|
* @param other Another ResourceAttributeAssignment instance
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-attribute-assignment.d.ts","sourceRoot":"","sources":["../../src/resource-attribute-assignment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,qBAAa,2BAA4B,SAAQ,uBAAuB,CAAC,MAAM,EAAE,YAAY,CAAC;IAC5F,SAAgB,UAAU,EAAE,MAAM,CAAC;IACnC,SAAgB,YAAY,EAAE,YAAY,CAAC;gBAE/B,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"resource-attribute-assignment.d.ts","sourceRoot":"","sources":["../../src/resource-attribute-assignment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,qBAAa,2BAA4B,SAAQ,uBAAuB,CAAC,MAAM,EAAE,YAAY,CAAC;IAC5F,SAAgB,UAAU,EAAE,MAAM,CAAC;IACnC,SAAgB,YAAY,EAAE,YAAY,CAAC;gBAE/B,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM;IAalG;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,2BAA2B,GAAG,OAAO;CAGpD"}
|
|
@@ -9,18 +9,6 @@ class ResourceAttributeAssignment extends BaseAttributeAssignment {
|
|
|
9
9
|
this.resourceId = resourceId;
|
|
10
10
|
this.resourceType = this.type;
|
|
11
11
|
}
|
|
12
|
-
/**
|
|
13
|
-
* Converts the assignment to a plain object with camelCase keys
|
|
14
|
-
* @returns Plain object with camelCase keys: { resourceId, resourceType, key, value }
|
|
15
|
-
*/
|
|
16
|
-
toPlainObject() {
|
|
17
|
-
return {
|
|
18
|
-
resourceId: this.resourceId,
|
|
19
|
-
resourceType: this.resourceType,
|
|
20
|
-
key: this.attributeKey,
|
|
21
|
-
value: this.attributeValue,
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
12
|
/**
|
|
25
13
|
* Compares two assignments for equality
|
|
26
14
|
* @param other Another ResourceAttributeAssignment instance
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export declare const RESOURCE_TYPES: Record<string, ResourceType>;
|
|
2
1
|
export declare const RESOURCE_ATTRIBUTES_CONSTANTS: {
|
|
3
2
|
readonly ACCOUNT_RESOURCE_ATTRIBUTES: {
|
|
4
3
|
readonly ENABLE_MEMBERS_INVITE_FROM_NON_AUTH_DOMAIN: "enable_members_invite_from_non_auth_domain";
|
|
@@ -12,4 +11,5 @@ export declare const RESOURCE_ATTRIBUTES_CONSTANTS: {
|
|
|
12
11
|
};
|
|
13
12
|
};
|
|
14
13
|
export type ResourceType = 'account' | 'account_product' | 'workspace' | 'board' | 'item' | 'team' | 'overview' | 'document' | 'crm';
|
|
14
|
+
export declare const RESOURCE_TYPES: Record<string, ResourceType>;
|
|
15
15
|
//# sourceMappingURL=resource-attributes-constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-attributes-constants.d.ts","sourceRoot":"","sources":["../../src/resource-attributes-constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"resource-attributes-constants.d.ts","sourceRoot":"","sources":["../../src/resource-attributes-constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B;;;;;;;;;;;CAWhC,CAAC;AAEX,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,iBAAiB,GACjB,WAAW,GACX,OAAO,GACP,MAAM,GACN,MAAM,GACN,UAAU,GACV,UAAU,GACV,KAAK,CAAC;AAEV,eAAO,MAAM,cAAc,EAUtB,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC"}
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
const RESOURCE_TYPES = {
|
|
2
|
-
ACCOUNT: 'account',
|
|
3
|
-
ACCOUNT_PRODUCT: 'account_product',
|
|
4
|
-
WORKSPACE: 'workspace',
|
|
5
|
-
BOARD: 'board',
|
|
6
|
-
ITEM: 'item',
|
|
7
|
-
TEAM: 'team',
|
|
8
|
-
OVERVIEW: 'overview',
|
|
9
|
-
DOCUMENT: 'document',
|
|
10
|
-
CRM: 'crm',
|
|
11
|
-
};
|
|
12
1
|
const RESOURCE_ATTRIBUTES_CONSTANTS = {
|
|
13
2
|
ACCOUNT_RESOURCE_ATTRIBUTES: {
|
|
14
3
|
ENABLE_MEMBERS_INVITE_FROM_NON_AUTH_DOMAIN: 'enable_members_invite_from_non_auth_domain',
|
|
@@ -21,5 +10,16 @@ const RESOURCE_ATTRIBUTES_CONSTANTS = {
|
|
|
21
10
|
SYSTEM_ENTITY_TYPE: 'system_entity_type',
|
|
22
11
|
},
|
|
23
12
|
};
|
|
13
|
+
const RESOURCE_TYPES = {
|
|
14
|
+
ACCOUNT: 'account',
|
|
15
|
+
ACCOUNT_PRODUCT: 'account_product',
|
|
16
|
+
WORKSPACE: 'workspace',
|
|
17
|
+
BOARD: 'board',
|
|
18
|
+
ITEM: 'item',
|
|
19
|
+
TEAM: 'team',
|
|
20
|
+
OVERVIEW: 'overview',
|
|
21
|
+
DOCUMENT: 'document',
|
|
22
|
+
CRM: 'crm',
|
|
23
|
+
};
|
|
24
24
|
|
|
25
25
|
export { RESOURCE_ATTRIBUTES_CONSTANTS, RESOURCE_TYPES };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { ResourceAttributeAssignment as ResourceAttributeAssignmentContract, EntityAttributeAssignment as EntityAttributeAssignmentContract, EntityType } from './authorization-attributes-contracts';
|
|
2
|
-
import { ResourceAttributeOperation, EntityAttributeOperation } from './authorization-attributes-contracts';
|
|
1
|
+
import { ResourceAttributeAssignment as ResourceAttributeAssignmentContract, EntityAttributeAssignment as EntityAttributeAssignmentContract, EntityType, ResourceAttributeOperation, EntityAttributeOperation } from './authorization-attributes-contracts';
|
|
3
2
|
import { ResourceAttributeAssignment } from '../resource-attribute-assignment';
|
|
4
3
|
import { EntityAttributeAssignment } from '../entity-attribute-assignment';
|
|
5
4
|
import { Resource } from './general';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorization-attributes-service.interface.d.ts","sourceRoot":"","sources":["../../../src/types/authorization-attributes-service.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,IAAI,mCAAmC,EAClE,yBAAyB,IAAI,iCAAiC,EAC9D,UAAU,
|
|
1
|
+
{"version":3,"file":"authorization-attributes-service.interface.d.ts","sourceRoot":"","sources":["../../../src/types/authorization-attributes-service.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,IAAI,mCAAmC,EAClE,yBAAyB,IAAI,iCAAiC,EAC9D,UAAU,EACV,0BAA0B,EAC1B,wBAAwB,EACzB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;;GAGG;AACH,MAAM,WAAW,+BAA+B;IAC9C;;;;OAIG;IACH,wBAAwB,CACtB,SAAS,EAAE,MAAM,EACjB,4BAA4B,EAAE,2BAA2B,EAAE,GAAG,mCAAmC,EAAE,EACnG,OAAO,CAAC,EAAE,MAAM,EAChB,sBAAsB,CAAC,EAAE,MAAM,GAC9B,OAAO,CAAC,IAAI,GAAG,0BAA0B,EAAE,CAAC,CAAC;IAEhD;;;;OAIG;IACH,wBAAwB,CACtB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,kBAAkB,GAAG,QAAQ,EACvC,aAAa,EAAE,MAAM,EAAE,EACvB,OAAO,CAAC,EAAE,MAAM,EAChB,sBAAsB,CAAC,EAAE,MAAM,GAC9B,OAAO,CAAC,IAAI,GAAG,0BAA0B,EAAE,CAAC,CAAC;IAEhD;;;;OAIG;IACH,sBAAsB,CACpB,SAAS,EAAE,MAAM,EACjB,0BAA0B,EAAE,yBAAyB,EAAE,GAAG,iCAAiC,EAAE,EAC7F,OAAO,CAAC,EAAE,MAAM,EAChB,sBAAsB,CAAC,EAAE,MAAM,GAC9B,OAAO,CAAC,IAAI,GAAG,wBAAwB,EAAE,CAAC,CAAC;IAE9C;;;;OAIG;IACH,sBAAsB,CACpB,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,IAAI,GAAG,wBAAwB,EAAE,CAAC,CAAC;IAE9C;;;;OAIG;IACH,wBAAwB,CACtB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,sBAAsB,EAAE,MAAM,EAC9B,2BAA2B,EAAE,0BAA0B,EAAE,GACxD,OAAO,CAAC,0BAA0B,EAAE,CAAC,CAAC;IAEzC;;;;OAIG;IACH,sBAAsB,CACpB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,sBAAsB,EAAE,MAAM,EAC9B,yBAAyB,EAAE,wBAAwB,EAAE,GACpD,OAAO,CAAC,wBAAwB,EAAE,CAAC,CAAC;CACxC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prometheus-service.d.ts","sourceRoot":"","sources":["../src/prometheus-service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prometheus-service.d.ts","sourceRoot":"","sources":["../src/prometheus-service.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO;;;;CAInB,CAAC;AAQF,wBAAgB,aAAa,CAAC,gBAAgB,KAAA,QAa7C;AAED,wBAAgB,iBAAiB,QAEhC;AAED,wBAAgB,wCAAwC,CACtD,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,OAAO,EACrB,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,MAAM,QASb"}
|
|
@@ -4,16 +4,6 @@ export declare class ResourceAttributeAssignment extends BaseAttributeAssignment
|
|
|
4
4
|
readonly resourceId: number;
|
|
5
5
|
readonly resourceType: ResourceType;
|
|
6
6
|
constructor(resourceId: number, resourceType: string, attributeKey: string, attributeValue: string);
|
|
7
|
-
/**
|
|
8
|
-
* Converts the assignment to a plain object with camelCase keys
|
|
9
|
-
* @returns Plain object with camelCase keys: { resourceId, resourceType, key, value }
|
|
10
|
-
*/
|
|
11
|
-
toPlainObject(): {
|
|
12
|
-
resourceId: number;
|
|
13
|
-
resourceType: string;
|
|
14
|
-
key: string;
|
|
15
|
-
value: string;
|
|
16
|
-
};
|
|
17
7
|
/**
|
|
18
8
|
* Compares two assignments for equality
|
|
19
9
|
* @param other Another ResourceAttributeAssignment instance
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-attribute-assignment.d.ts","sourceRoot":"","sources":["../src/resource-attribute-assignment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,qBAAa,2BAA4B,SAAQ,uBAAuB,CAAC,MAAM,EAAE,YAAY,CAAC;IAC5F,SAAgB,UAAU,EAAE,MAAM,CAAC;IACnC,SAAgB,YAAY,EAAE,YAAY,CAAC;gBAE/B,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"resource-attribute-assignment.d.ts","sourceRoot":"","sources":["../src/resource-attribute-assignment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,qBAAa,2BAA4B,SAAQ,uBAAuB,CAAC,MAAM,EAAE,YAAY,CAAC;IAC5F,SAAgB,UAAU,EAAE,MAAM,CAAC;IACnC,SAAgB,YAAY,EAAE,YAAY,CAAC;gBAE/B,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM;IAalG;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,2BAA2B,GAAG,OAAO;CAGpD"}
|
|
@@ -11,18 +11,6 @@ class ResourceAttributeAssignment extends baseAttributeAssignment.BaseAttributeA
|
|
|
11
11
|
this.resourceId = resourceId;
|
|
12
12
|
this.resourceType = this.type;
|
|
13
13
|
}
|
|
14
|
-
/**
|
|
15
|
-
* Converts the assignment to a plain object with camelCase keys
|
|
16
|
-
* @returns Plain object with camelCase keys: { resourceId, resourceType, key, value }
|
|
17
|
-
*/
|
|
18
|
-
toPlainObject() {
|
|
19
|
-
return {
|
|
20
|
-
resourceId: this.resourceId,
|
|
21
|
-
resourceType: this.resourceType,
|
|
22
|
-
key: this.attributeKey,
|
|
23
|
-
value: this.attributeValue,
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
14
|
/**
|
|
27
15
|
* Compares two assignments for equality
|
|
28
16
|
* @param other Another ResourceAttributeAssignment instance
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export declare const RESOURCE_TYPES: Record<string, ResourceType>;
|
|
2
1
|
export declare const RESOURCE_ATTRIBUTES_CONSTANTS: {
|
|
3
2
|
readonly ACCOUNT_RESOURCE_ATTRIBUTES: {
|
|
4
3
|
readonly ENABLE_MEMBERS_INVITE_FROM_NON_AUTH_DOMAIN: "enable_members_invite_from_non_auth_domain";
|
|
@@ -12,4 +11,5 @@ export declare const RESOURCE_ATTRIBUTES_CONSTANTS: {
|
|
|
12
11
|
};
|
|
13
12
|
};
|
|
14
13
|
export type ResourceType = 'account' | 'account_product' | 'workspace' | 'board' | 'item' | 'team' | 'overview' | 'document' | 'crm';
|
|
14
|
+
export declare const RESOURCE_TYPES: Record<string, ResourceType>;
|
|
15
15
|
//# sourceMappingURL=resource-attributes-constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-attributes-constants.d.ts","sourceRoot":"","sources":["../src/resource-attributes-constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"resource-attributes-constants.d.ts","sourceRoot":"","sources":["../src/resource-attributes-constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B;;;;;;;;;;;CAWhC,CAAC;AAEX,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,iBAAiB,GACjB,WAAW,GACX,OAAO,GACP,MAAM,GACN,MAAM,GACN,UAAU,GACV,UAAU,GACV,KAAK,CAAC;AAEV,eAAO,MAAM,cAAc,EAUtB,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC"}
|