@mondaydotcomorg/monday-authorization 3.5.1 → 3.5.2-feat-shaime-support-entity-attributes-3-6202ab7

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.
Files changed (111) hide show
  1. package/dist/authorization-attributes-ms-service.d.ts +72 -0
  2. package/dist/authorization-attributes-ms-service.d.ts.map +1 -0
  3. package/dist/authorization-attributes-ms-service.js +279 -0
  4. package/dist/authorization-attributes-service.d.ts +25 -47
  5. package/dist/authorization-attributes-service.d.ts.map +1 -1
  6. package/dist/authorization-attributes-service.js +32 -171
  7. package/dist/authorization-attributes-sns-service.d.ts +70 -0
  8. package/dist/authorization-attributes-sns-service.d.ts.map +1 -0
  9. package/dist/authorization-attributes-sns-service.js +179 -0
  10. package/dist/base-attribute-assignment.d.ts +19 -0
  11. package/dist/base-attribute-assignment.d.ts.map +1 -0
  12. package/dist/base-attribute-assignment.js +34 -0
  13. package/dist/constants/sns.d.ts +12 -2
  14. package/dist/constants/sns.d.ts.map +1 -1
  15. package/dist/constants/sns.js +22 -2
  16. package/dist/entity-attribute-assignment.d.ts +16 -0
  17. package/dist/entity-attribute-assignment.d.ts.map +1 -0
  18. package/dist/entity-attribute-assignment.js +33 -0
  19. package/dist/entity-attributes-constants.d.ts +7 -0
  20. package/dist/entity-attributes-constants.d.ts.map +1 -0
  21. package/dist/entity-attributes-constants.js +11 -0
  22. package/dist/errors/argument-error.d.ts +4 -0
  23. package/dist/errors/argument-error.d.ts.map +1 -0
  24. package/dist/errors/argument-error.js +10 -0
  25. package/dist/esm/authorization-attributes-ms-service.d.ts +72 -0
  26. package/dist/esm/authorization-attributes-ms-service.d.ts.map +1 -0
  27. package/dist/esm/authorization-attributes-ms-service.mjs +277 -0
  28. package/dist/esm/authorization-attributes-service.d.ts +25 -47
  29. package/dist/esm/authorization-attributes-service.d.ts.map +1 -1
  30. package/dist/esm/authorization-attributes-service.mjs +32 -167
  31. package/dist/esm/authorization-attributes-sns-service.d.ts +70 -0
  32. package/dist/esm/authorization-attributes-sns-service.d.ts.map +1 -0
  33. package/dist/esm/authorization-attributes-sns-service.mjs +173 -0
  34. package/dist/esm/base-attribute-assignment.d.ts +19 -0
  35. package/dist/esm/base-attribute-assignment.d.ts.map +1 -0
  36. package/dist/esm/base-attribute-assignment.mjs +28 -0
  37. package/dist/esm/constants/sns.d.ts +12 -2
  38. package/dist/esm/constants/sns.d.ts.map +1 -1
  39. package/dist/esm/constants/sns.mjs +17 -3
  40. package/dist/esm/entity-attribute-assignment.d.ts +16 -0
  41. package/dist/esm/entity-attribute-assignment.d.ts.map +1 -0
  42. package/dist/esm/entity-attribute-assignment.mjs +31 -0
  43. package/dist/esm/entity-attributes-constants.d.ts +7 -0
  44. package/dist/esm/entity-attributes-constants.d.ts.map +1 -0
  45. package/dist/esm/entity-attributes-constants.mjs +9 -0
  46. package/dist/esm/errors/argument-error.d.ts +4 -0
  47. package/dist/esm/errors/argument-error.d.ts.map +1 -0
  48. package/dist/esm/errors/argument-error.mjs +8 -0
  49. package/dist/esm/resource-attribute-assignment.d.ts +16 -0
  50. package/dist/esm/resource-attribute-assignment.d.ts.map +1 -0
  51. package/dist/esm/resource-attribute-assignment.mjs +31 -0
  52. package/dist/esm/resource-attributes-constants.d.ts +25 -0
  53. package/dist/esm/resource-attributes-constants.d.ts.map +1 -0
  54. package/dist/esm/resource-attributes-constants.mjs +28 -0
  55. package/dist/esm/types/authorization-attributes-contracts.d.ts +26 -12
  56. package/dist/esm/types/authorization-attributes-contracts.d.ts.map +1 -1
  57. package/dist/esm/types/authorization-attributes-contracts.mjs +6 -6
  58. package/dist/esm/types/authorization-attributes-service.interface.d.ts +43 -0
  59. package/dist/esm/types/authorization-attributes-service.interface.d.ts.map +1 -0
  60. package/dist/esm/types/authorization-attributes-service.interface.mjs +1 -0
  61. package/dist/esm/types/general.d.ts +1 -1
  62. package/dist/esm/types/general.d.ts.map +1 -1
  63. package/dist/esm/utils/assigment-schema.d.ts +23 -0
  64. package/dist/esm/utils/assigment-schema.d.ts.map +1 -0
  65. package/dist/esm/utils/assigment-schema.mjs +29 -0
  66. package/dist/esm/utils/resource-schema.d.ts +17 -0
  67. package/dist/esm/utils/resource-schema.d.ts.map +1 -0
  68. package/dist/esm/utils/resource-schema.mjs +16 -0
  69. package/dist/esm/utils/validation.d.ts +26 -0
  70. package/dist/esm/utils/validation.d.ts.map +1 -0
  71. package/dist/esm/utils/validation.mjs +70 -0
  72. package/dist/resource-attribute-assignment.d.ts +16 -0
  73. package/dist/resource-attribute-assignment.d.ts.map +1 -0
  74. package/dist/resource-attribute-assignment.js +33 -0
  75. package/dist/resource-attributes-constants.d.ts +25 -0
  76. package/dist/resource-attributes-constants.d.ts.map +1 -0
  77. package/dist/resource-attributes-constants.js +31 -0
  78. package/dist/types/authorization-attributes-contracts.d.ts +26 -12
  79. package/dist/types/authorization-attributes-contracts.d.ts.map +1 -1
  80. package/dist/types/authorization-attributes-contracts.js +5 -5
  81. package/dist/types/authorization-attributes-service.interface.d.ts +43 -0
  82. package/dist/types/authorization-attributes-service.interface.d.ts.map +1 -0
  83. package/dist/types/authorization-attributes-service.interface.js +1 -0
  84. package/dist/types/general.d.ts +1 -1
  85. package/dist/types/general.d.ts.map +1 -1
  86. package/dist/utils/assigment-schema.d.ts +23 -0
  87. package/dist/utils/assigment-schema.d.ts.map +1 -0
  88. package/dist/utils/assigment-schema.js +36 -0
  89. package/dist/utils/resource-schema.d.ts +17 -0
  90. package/dist/utils/resource-schema.d.ts.map +1 -0
  91. package/dist/utils/resource-schema.js +22 -0
  92. package/dist/utils/validation.d.ts +26 -0
  93. package/dist/utils/validation.d.ts.map +1 -0
  94. package/dist/utils/validation.js +76 -0
  95. package/package.json +3 -1
  96. package/src/authorization-attributes-ms-service.ts +414 -0
  97. package/src/authorization-attributes-service.ts +34 -222
  98. package/src/authorization-attributes-sns-service.ts +257 -0
  99. package/src/base-attribute-assignment.ts +30 -0
  100. package/src/constants/sns.ts +19 -2
  101. package/src/entity-attribute-assignment.ts +33 -0
  102. package/src/entity-attributes-constants.ts +7 -0
  103. package/src/errors/argument-error.ts +6 -0
  104. package/src/resource-attribute-assignment.ts +36 -0
  105. package/src/resource-attributes-constants.ts +27 -0
  106. package/src/types/authorization-attributes-contracts.ts +34 -11
  107. package/src/types/authorization-attributes-service.interface.ts +70 -0
  108. package/src/types/general.ts +1 -1
  109. package/src/utils/assigment-schema.ts +29 -0
  110. package/src/utils/resource-schema.ts +21 -0
  111. package/src/utils/validation.ts +82 -0
@@ -0,0 +1,8 @@
1
+ class ArgumentError extends Error {
2
+ constructor(message) {
3
+ super(message);
4
+ this.name = 'ArgumentError';
5
+ }
6
+ }
7
+
8
+ export { ArgumentError };
@@ -0,0 +1,16 @@
1
+ import { ResourceType } from './resource-attributes-constants';
2
+ import { BaseAttributeAssignment } from './base-attribute-assignment';
3
+ import { ResourceAttributeAssignment as ResourceAttributeAssignmentContract } from './types/authorization-attributes-contracts';
4
+ export declare class ResourceAttributeAssignment extends BaseAttributeAssignment<ResourceType, ResourceAttributeAssignmentContract> {
5
+ readonly resourceId: number;
6
+ readonly resourceType: ResourceType;
7
+ constructor(resourceId: number, resourceType: ResourceType, attributeKey: string, attributeValue: string);
8
+ toDataTransferObject(): ResourceAttributeAssignmentContract;
9
+ /**
10
+ * Compares two assignments for equality
11
+ * @param other Another ResourceAttributeAssignment instance
12
+ * @returns true if all properties are equal
13
+ */
14
+ equals(other: ResourceAttributeAssignment): boolean;
15
+ }
16
+ //# sourceMappingURL=resource-attribute-assignment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource-attribute-assignment.d.ts","sourceRoot":"","sources":["../../src/resource-attribute-assignment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,2BAA2B,IAAI,mCAAmC,EAAE,MAAM,4CAA4C,CAAC;AAGhI,qBAAa,2BAA4B,SAAQ,uBAAuB,CACtE,YAAY,EACZ,mCAAmC,CACpC;IACC,SAAgB,UAAU,EAAE,MAAM,CAAC;IACnC,SAAgB,YAAY,EAAE,YAAY,CAAC;gBAE/B,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM;IAOxG,oBAAoB,IAAI,mCAAmC;IAQ3D;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,2BAA2B,GAAG,OAAO;CAGpD"}
@@ -0,0 +1,31 @@
1
+ import { BaseAttributeAssignment } from './base-attribute-assignment.mjs';
2
+ import { ValidationUtils } from './utils/validation.mjs';
3
+
4
+ class ResourceAttributeAssignment extends BaseAttributeAssignment {
5
+ resourceId;
6
+ resourceType;
7
+ constructor(resourceId, resourceType, attributeKey, attributeValue) {
8
+ ValidationUtils.validateResourceAssignment({ resourceId, resourceType, key: attributeKey, value: attributeValue });
9
+ super(resourceId, resourceType, attributeKey, attributeValue);
10
+ this.resourceId = resourceId;
11
+ this.resourceType = this.type;
12
+ }
13
+ toDataTransferObject() {
14
+ return {
15
+ resourceId: this.resourceId,
16
+ resourceType: this.resourceType,
17
+ key: this.attributeKey,
18
+ value: this.attributeValue,
19
+ };
20
+ }
21
+ /**
22
+ * Compares two assignments for equality
23
+ * @param other Another ResourceAttributeAssignment instance
24
+ * @returns true if all properties are equal
25
+ */
26
+ equals(other) {
27
+ return super.equals(other);
28
+ }
29
+ }
30
+
31
+ export { ResourceAttributeAssignment };
@@ -0,0 +1,25 @@
1
+ export declare const RESOURCE_ATTRIBUTES_CONSTANTS: Readonly<{
2
+ ACCOUNT_RESOURCE_ATTRIBUTES: {
3
+ ENABLE_MEMBERS_INVITE_FROM_NON_AUTH_DOMAIN: string;
4
+ };
5
+ WORKSPACE_RESOURCE_ATTRIBUTES: {
6
+ IS_DEFAULT_WORKSPACE: string;
7
+ };
8
+ BOARD_RESOURCE_ATTRIBUTES: {
9
+ IS_SYNCABLE_CHILD_ENTITY: string;
10
+ SYSTEM_ENTITY_TYPE: string;
11
+ };
12
+ }>;
13
+ export declare enum ResourceType {
14
+ Account = "account",
15
+ AccountProduct = "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
+ export declare const RESOURCE_TYPES: readonly ResourceType[];
25
+ //# sourceMappingURL=resource-attributes-constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource-attributes-constants.d.ts","sourceRoot":"","sources":["../../src/resource-attributes-constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B;;;;;;;;;;;EAWxC,CAAC;AAEH,oBAAY,YAAY;IACtB,OAAO,YAAY;IACnB,cAAc,oBAAoB;IAClC,SAAS,cAAc;IACvB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,GAAG,QAAQ;CACZ;AAGD,eAAO,MAAM,cAAc,yBAA6C,CAAC"}
@@ -0,0 +1,28 @@
1
+ const RESOURCE_ATTRIBUTES_CONSTANTS = Object.freeze({
2
+ ACCOUNT_RESOURCE_ATTRIBUTES: {
3
+ ENABLE_MEMBERS_INVITE_FROM_NON_AUTH_DOMAIN: 'enable_members_invite_from_non_auth_domain',
4
+ },
5
+ WORKSPACE_RESOURCE_ATTRIBUTES: {
6
+ IS_DEFAULT_WORKSPACE: 'is_default_workspace',
7
+ },
8
+ BOARD_RESOURCE_ATTRIBUTES: {
9
+ IS_SYNCABLE_CHILD_ENTITY: 'is_syncable_child_entity',
10
+ SYSTEM_ENTITY_TYPE: 'system_entity_type',
11
+ },
12
+ });
13
+ var ResourceType;
14
+ (function (ResourceType) {
15
+ ResourceType["Account"] = "account";
16
+ ResourceType["AccountProduct"] = "account_product";
17
+ ResourceType["Workspace"] = "workspace";
18
+ ResourceType["Board"] = "board";
19
+ ResourceType["Item"] = "item";
20
+ ResourceType["Team"] = "team";
21
+ ResourceType["Overview"] = "overview";
22
+ ResourceType["Document"] = "document";
23
+ ResourceType["Crm"] = "crm";
24
+ })(ResourceType || (ResourceType = {}));
25
+ // Define the array of strings and use 'as const' to make its contents literal types
26
+ const RESOURCE_TYPES = Object.freeze(Object.values(ResourceType));
27
+
28
+ export { RESOURCE_ATTRIBUTES_CONSTANTS, RESOURCE_TYPES, ResourceType };
@@ -1,28 +1,42 @@
1
1
  import { Resource } from './general';
2
- export interface ResourceAttributeAssignment {
3
- resourceType: Resource['type'];
4
- resourceId: Resource['id'];
2
+ import type { EntityType } from '../entity-attributes-constants';
3
+ import type { ResourceType } from '../resource-attributes-constants';
4
+ export interface AttributeAssignment {
5
5
  key: string;
6
6
  value: string;
7
7
  }
8
- export interface ResourceAttributeResponse {
9
- attributes: ResourceAttributeAssignment[];
8
+ export interface ResourceAttributeAssignment extends AttributeAssignment {
9
+ resourceId: number;
10
+ resourceType: ResourceType;
11
+ }
12
+ export interface EntityAttributeAssignment extends AttributeAssignment {
13
+ entityId: number;
14
+ entityType: EntityType;
10
15
  }
11
16
  export interface ResourceAttributeDelete {
12
17
  resourceType: Resource['type'];
13
18
  resourceId: Resource['id'];
14
19
  key: string;
15
20
  }
16
- export declare enum ResourceAttributeOperationEnum {
21
+ export interface EntityAttributeDelete {
22
+ entityType: EntityType;
23
+ entityId: number;
24
+ key: string;
25
+ }
26
+ export declare enum AttributeOperation {
17
27
  UPSERT = "upsert",
18
28
  DELETE = "delete"
19
29
  }
20
- interface UpsertResourceAttributeOperation extends ResourceAttributeAssignment {
21
- operationType: ResourceAttributeOperationEnum.UPSERT;
30
+ export interface ResourceAttributeResponse {
31
+ attributes: ResourceAttributeAssignment[];
32
+ }
33
+ export interface EntityAttributeResponse {
34
+ attributes: EntityAttributeAssignment[];
35
+ }
36
+ export interface ResourceAttributeOperation extends ResourceAttributeAssignment {
37
+ operationType: AttributeOperation;
22
38
  }
23
- interface DeleteResourceAttributeOperation extends ResourceAttributeDelete {
24
- operationType: ResourceAttributeOperationEnum.DELETE;
39
+ export interface EntityAttributeOperation extends EntityAttributeAssignment {
40
+ operationType: AttributeOperation;
25
41
  }
26
- export type ResourceAttributesOperation = UpsertResourceAttributeOperation | DeleteResourceAttributeOperation;
27
- export {};
28
42
  //# sourceMappingURL=authorization-attributes-contracts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"authorization-attributes-contracts.d.ts","sourceRoot":"","sources":["../../../src/types/authorization-attributes-contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,MAAM,WAAW,2BAA2B;IAC1C,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC/B,UAAU,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,yBAAyB;IACxC,UAAU,EAAE,2BAA2B,EAAE,CAAC;CAC3C;AAED,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC/B,UAAU,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAC;CACb;AAED,oBAAY,8BAA8B;IACxC,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB;AAED,UAAU,gCAAiC,SAAQ,2BAA2B;IAC5E,aAAa,EAAE,8BAA8B,CAAC,MAAM,CAAC;CACtD;AAED,UAAU,gCAAiC,SAAQ,uBAAuB;IACxE,aAAa,EAAE,8BAA8B,CAAC,MAAM,CAAC;CACtD;AAED,MAAM,MAAM,2BAA2B,GAAG,gCAAgC,GAAG,gCAAgC,CAAC"}
1
+ {"version":3,"file":"authorization-attributes-contracts.d.ts","sourceRoot":"","sources":["../../../src/types/authorization-attributes-contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAErE,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAGD,MAAM,WAAW,2BAA4B,SAAQ,mBAAmB;IACtE,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,YAAY,CAAC;CAC5B;AAID,MAAM,WAAW,yBAA0B,SAAQ,mBAAmB;IACpE,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,UAAU,CAAC;CACxB;AAGD,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC/B,UAAU,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,UAAU,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,oBAAY,kBAAkB;IAC5B,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB;AAGD,MAAM,WAAW,yBAAyB;IACxC,UAAU,EAAE,2BAA2B,EAAE,CAAC;CAC3C;AAED,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,yBAAyB,EAAE,CAAC;CACzC;AAED,MAAM,WAAW,0BAA2B,SAAQ,2BAA2B;IAC7E,aAAa,EAAE,kBAAkB,CAAC;CACnC;AAED,MAAM,WAAW,wBAAyB,SAAQ,yBAAyB;IACzE,aAAa,EAAE,kBAAkB,CAAC;CACnC"}
@@ -1,7 +1,7 @@
1
- var ResourceAttributeOperationEnum;
2
- (function (ResourceAttributeOperationEnum) {
3
- ResourceAttributeOperationEnum["UPSERT"] = "upsert";
4
- ResourceAttributeOperationEnum["DELETE"] = "delete";
5
- })(ResourceAttributeOperationEnum || (ResourceAttributeOperationEnum = {}));
1
+ var AttributeOperation;
2
+ (function (AttributeOperation) {
3
+ AttributeOperation["UPSERT"] = "upsert";
4
+ AttributeOperation["DELETE"] = "delete";
5
+ })(AttributeOperation || (AttributeOperation = {}));
6
6
 
7
- export { ResourceAttributeOperationEnum };
7
+ export { AttributeOperation };
@@ -0,0 +1,43 @@
1
+ import { EntityType } from '../entity-attributes-constants';
2
+ import { ResourceAttributeOperation, EntityAttributeOperation } from './authorization-attributes-contracts';
3
+ import { Resource } from './general';
4
+ /**
5
+ * Resource type compatible with both MS and SNS services
6
+ */
7
+ export interface CompatibleResource {
8
+ resourceType?: string;
9
+ resourceId?: number;
10
+ type?: string;
11
+ id?: number;
12
+ }
13
+ /**
14
+ * Interface for authorization attributes operations.
15
+ * Both MS (direct) and SNS (async) services implement this interface.
16
+ */
17
+ export interface AuthorizationAttributesService {
18
+ /**
19
+ * Deletes resource attributes.
20
+ * For MS service: returns Promise<void>
21
+ * For SNS service: requires appName and callerActionIdentifier, returns Promise<ResourceAttributesOperation[]>
22
+ */
23
+ deleteResourceAttributes(accountId: number, resource: CompatibleResource | Resource, attributeKeys: string[], appName?: string, callerActionIdentifier?: string): Promise<void | ResourceAttributeOperation[]>;
24
+ /**
25
+ * Deletes entity attributes.
26
+ * For MS service: returns Promise<void>
27
+ * For SNS service: requires appName and callerActionIdentifier, returns Promise<EntityAttributesOperation[]>
28
+ */
29
+ deleteEntityAttributes(accountId: number, entityType: EntityType | string, entityId: number, attributeKeys: string[], appName?: string, callerActionIdentifier?: string): Promise<void | EntityAttributeOperation[]>;
30
+ /**
31
+ * Updates resource attributes (batch operations).
32
+ * For MS service: may throw error or delegate to upsert/delete
33
+ * For SNS service: returns Promise<ResourceAttributesOperation[]>
34
+ */
35
+ updateResourceAttributes(accountId: number, appName: string, callerActionIdentifier: string, resourceAttributeOperations: ResourceAttributeOperation[]): Promise<ResourceAttributeOperation[]>;
36
+ /**
37
+ * Updates entity attributes (batch operations).
38
+ * For MS service: may throw error or delegate to upsert/delete
39
+ * For SNS service: returns Promise<EntityAttributesOperation[]>
40
+ */
41
+ updateEntityAttributes(accountId: number, appName: string, callerActionIdentifier: string, entityAttributeOperations: EntityAttributeOperation[]): Promise<EntityAttributeOperation[]>;
42
+ }
43
+ //# sourceMappingURL=authorization-attributes-service.interface.d.ts.map
@@ -0,0 +1 @@
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,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAC5G,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,8BAA8B;IAC7C;;;;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,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,6 +1,6 @@
1
1
  import type { Request, Response } from 'express';
2
2
  export interface Resource {
3
- id?: number;
3
+ id: number;
4
4
  type: string;
5
5
  wrapperData?: object;
6
6
  }
@@ -1 +1 @@
1
- {"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../../src/types/general.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEjD,MAAM,WAAW,QAAQ;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AACD,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAC5B,MAAM,WAAW,OAAO;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB;AACD,MAAM,WAAW,mBAAmB;IAClC,WAAW,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC7B,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAChC,YAAY,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC;IACvC,MAAM,EAAE,MAAM,CAAC;CAChB;AACD,MAAM,WAAW,mBAAmB;IAClC,oBAAoB,EAAE,mBAAmB,EAAE,CAAC;CAC7C;AAED,KAAK,WAAW,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC;AAE9C,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC;AACzC,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAC;AAC3C,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC;AAC7C,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC;AAC9C,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,mBAAmB,CAAC,CAAC;AAC7G,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AACtD,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,WAAW,KAAK,QAAQ,EAAE,CAAC;AAClE,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC"}
1
+ {"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../../src/types/general.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEjD,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AACD,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAC5B,MAAM,WAAW,OAAO;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB;AACD,MAAM,WAAW,mBAAmB;IAClC,WAAW,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC7B,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAChC,YAAY,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC;IACvC,MAAM,EAAE,MAAM,CAAC;CAChB;AACD,MAAM,WAAW,mBAAmB;IAClC,oBAAoB,EAAE,mBAAmB,EAAE,CAAC;CAC7C;AAED,KAAK,WAAW,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC;AAE9C,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC;AACzC,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAC;AAC3C,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC;AAC7C,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC;AAC9C,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,mBAAmB,CAAC,CAAC;AAC7G,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AACtD,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,WAAW,KAAK,QAAQ,EAAE,CAAC;AAClE,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC"}
@@ -0,0 +1,23 @@
1
+ export declare const entityAssignmentSchema: import("ajv").ValidateFunction<{
2
+ entityId: any;
3
+ entityType: any;
4
+ key: any;
5
+ } & {
6
+ entityId: any;
7
+ } & {
8
+ entityType: any;
9
+ } & {
10
+ key: any;
11
+ }>;
12
+ export declare const resourceAssignmentSchema: import("ajv").ValidateFunction<{
13
+ id: any;
14
+ type: any;
15
+ key: any;
16
+ } & {
17
+ id: any;
18
+ } & {
19
+ type: any;
20
+ } & {
21
+ key: any;
22
+ }>;
23
+ //# sourceMappingURL=assigment-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assigment-schema.d.ts","sourceRoot":"","sources":["../../../src/utils/assigment-schema.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,sBAAsB;;;;;;;;;;EAUjC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;EAUnC,CAAC"}
@@ -0,0 +1,29 @@
1
+ import Ajv from 'ajv';
2
+ import { EntityType } from '../entity-attributes-constants.mjs';
3
+ import { ResourceType } from '../resource-attributes-constants.mjs';
4
+
5
+ const ajv = new Ajv({ allErrors: true });
6
+ const entityAssignmentSchema = ajv.compile({
7
+ type: 'object',
8
+ properties: {
9
+ entityId: { type: 'number', multipleOf: 1 },
10
+ entityType: { type: 'string', enum: Object.values(EntityType) },
11
+ key: { type: 'string', minLength: 1 },
12
+ value: { type: 'string' },
13
+ },
14
+ required: ['entityId', 'entityType', 'key'],
15
+ additionalProperties: false,
16
+ });
17
+ const resourceAssignmentSchema = ajv.compile({
18
+ type: 'object',
19
+ properties: {
20
+ id: { type: 'number', multipleOf: 1 },
21
+ type: { type: 'string', enum: Object.values(ResourceType) },
22
+ key: { type: 'string', minLength: 1 },
23
+ value: { type: 'string' },
24
+ },
25
+ required: ['id', 'type', 'key'],
26
+ additionalProperties: false,
27
+ });
28
+
29
+ export { entityAssignmentSchema, resourceAssignmentSchema };
@@ -0,0 +1,17 @@
1
+ export interface Resource {
2
+ id?: number;
3
+ type: string;
4
+ wrapperData?: object;
5
+ }
6
+ export declare const resourceSchema: import("ajv").ValidateFunction<{
7
+ id: any;
8
+ type: any;
9
+ wrapperData: any;
10
+ } & {
11
+ id: any;
12
+ } & {
13
+ type: any;
14
+ } & {
15
+ wrapperData: any;
16
+ }>;
17
+ //# sourceMappingURL=resource-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource-schema.d.ts","sourceRoot":"","sources":["../../../src/utils/resource-schema.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,QAAQ;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,cAAc;;;;;;;;;;EASzB,CAAC"}
@@ -0,0 +1,16 @@
1
+ import Ajv from 'ajv';
2
+ import { RESOURCE_TYPES } from '../resource-attributes-constants.mjs';
3
+
4
+ const ajv = new Ajv({ allErrors: true });
5
+ const resourceSchema = ajv.compile({
6
+ type: 'object',
7
+ properties: {
8
+ id: { type: 'number', multipleOf: 1 },
9
+ type: { type: 'string', enum: RESOURCE_TYPES },
10
+ wrapperData: { type: 'string', minLength: 1 },
11
+ },
12
+ required: ['id', 'type', 'wrapperData'],
13
+ additionalProperties: false,
14
+ });
15
+
16
+ export { resourceSchema };
@@ -0,0 +1,26 @@
1
+ import { ResourceAttributeAssignment, EntityAttributeAssignment } from '../types/authorization-attributes-contracts';
2
+ import { Resource } from '../types/general';
3
+ /**
4
+ * Utility class for common validation operations using AJV
5
+ */
6
+ export declare class ValidationUtils {
7
+ private static ajv;
8
+ private static integerValidator;
9
+ private static stringValidator;
10
+ private static stringArrayValidator;
11
+ static validateInteger(value: number): void;
12
+ static validateString(value: string): void;
13
+ static validateStringArray(value: string[]): void;
14
+ static validateResource(resource: Resource): void;
15
+ /**
16
+ * Validates an attribute assignment object using a single AJV schema.
17
+ * Preserves legacy error messages for each field.
18
+ */
19
+ static validateResourceAssignment(resource: ResourceAttributeAssignment): void;
20
+ static validateEntityAssignment(entity: EntityAttributeAssignment): void;
21
+ /**
22
+ * Formats AJV validation errors into a readable error message
23
+ */
24
+ private static formatValidationErrors;
25
+ }
26
+ //# sourceMappingURL=validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../src/utils/validation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,2BAA2B,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AACrH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAI5C;;GAEG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAC,GAAG,CAAgC;IAElD,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAyE;IACxG,OAAO,CAAC,MAAM,CAAC,eAAe,CAAwE;IACtG,OAAO,CAAC,MAAM,CAAC,oBAAoB,CAGhC;WAEW,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;WAOpC,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;WAOnC,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI;WAO1C,gBAAgB,CAAC,QAAQ,EAAE,QAAQ;IAQjD;;;OAGG;IACH,MAAM,CAAC,0BAA0B,CAAC,QAAQ,EAAE,2BAA2B,GAAG,IAAI;IAY9E,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,yBAAyB,GAAG,IAAI;IAUxE;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;CAGtC"}
@@ -0,0 +1,70 @@
1
+ import Ajv from 'ajv';
2
+ import { ArgumentError } from '../errors/argument-error.mjs';
3
+ import { resourceAssignmentSchema, entityAssignmentSchema } from './assigment-schema.mjs';
4
+ import { resourceSchema } from './resource-schema.mjs';
5
+
6
+ /**
7
+ * Utility class for common validation operations using AJV
8
+ */
9
+ class ValidationUtils {
10
+ static ajv = new Ajv({ allErrors: true });
11
+ static integerValidator = this.ajv.compile({ type: 'number', multipleOf: 1 });
12
+ static stringValidator = this.ajv.compile({ type: 'string', minLength: 1 });
13
+ static stringArrayValidator = this.ajv.compile({
14
+ type: 'array',
15
+ items: { type: 'string' },
16
+ });
17
+ static validateInteger(value) {
18
+ const valid = this.integerValidator(value);
19
+ if (!valid) {
20
+ throw new ArgumentError('Invalid integer');
21
+ }
22
+ }
23
+ static validateString(value) {
24
+ const valid = this.stringValidator(value);
25
+ if (!valid) {
26
+ throw new ArgumentError('Invalid string');
27
+ }
28
+ }
29
+ static validateStringArray(value) {
30
+ const valid = this.stringArrayValidator(value);
31
+ if (!valid) {
32
+ throw new ArgumentError('Invalid string array');
33
+ }
34
+ }
35
+ static validateResource(resource) {
36
+ const isValid = resourceSchema(resource);
37
+ if (!isValid) {
38
+ const errorMessage = this.formatValidationErrors(resourceSchema.errors);
39
+ throw new ArgumentError(errorMessage ? `Invalid resource: ${errorMessage}` : 'Invalid resource');
40
+ }
41
+ }
42
+ /**
43
+ * Validates an attribute assignment object using a single AJV schema.
44
+ * Preserves legacy error messages for each field.
45
+ */
46
+ static validateResourceAssignment(resource) {
47
+ const valid = resourceAssignmentSchema(resource);
48
+ if (!valid) {
49
+ const errorMessage = this.formatValidationErrors(resourceAssignmentSchema.errors);
50
+ throw new ArgumentError(errorMessage
51
+ ? `Invalid resource attribute assignment: ${errorMessage}`
52
+ : 'Invalid resource attribute assignment');
53
+ }
54
+ }
55
+ static validateEntityAssignment(entity) {
56
+ const valid = entityAssignmentSchema(entity);
57
+ if (!valid) {
58
+ const errorMessage = this.formatValidationErrors(entityAssignmentSchema.errors);
59
+ throw new ArgumentError(errorMessage ? `Invalid entity attribute assignment: ${errorMessage}` : 'Invalid entity attribute assignment');
60
+ }
61
+ }
62
+ /**
63
+ * Formats AJV validation errors into a readable error message
64
+ */
65
+ static formatValidationErrors(errors) {
66
+ return (errors || []).join();
67
+ }
68
+ }
69
+
70
+ export { ValidationUtils };
@@ -0,0 +1,16 @@
1
+ import { ResourceType } from './resource-attributes-constants';
2
+ import { BaseAttributeAssignment } from './base-attribute-assignment';
3
+ import { ResourceAttributeAssignment as ResourceAttributeAssignmentContract } from './types/authorization-attributes-contracts';
4
+ export declare class ResourceAttributeAssignment extends BaseAttributeAssignment<ResourceType, ResourceAttributeAssignmentContract> {
5
+ readonly resourceId: number;
6
+ readonly resourceType: ResourceType;
7
+ constructor(resourceId: number, resourceType: ResourceType, attributeKey: string, attributeValue: string);
8
+ toDataTransferObject(): ResourceAttributeAssignmentContract;
9
+ /**
10
+ * Compares two assignments for equality
11
+ * @param other Another ResourceAttributeAssignment instance
12
+ * @returns true if all properties are equal
13
+ */
14
+ equals(other: ResourceAttributeAssignment): boolean;
15
+ }
16
+ //# sourceMappingURL=resource-attribute-assignment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource-attribute-assignment.d.ts","sourceRoot":"","sources":["../src/resource-attribute-assignment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,2BAA2B,IAAI,mCAAmC,EAAE,MAAM,4CAA4C,CAAC;AAGhI,qBAAa,2BAA4B,SAAQ,uBAAuB,CACtE,YAAY,EACZ,mCAAmC,CACpC;IACC,SAAgB,UAAU,EAAE,MAAM,CAAC;IACnC,SAAgB,YAAY,EAAE,YAAY,CAAC;gBAE/B,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM;IAOxG,oBAAoB,IAAI,mCAAmC;IAQ3D;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,2BAA2B,GAAG,OAAO;CAGpD"}
@@ -0,0 +1,33 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const baseAttributeAssignment = require('./base-attribute-assignment.js');
4
+ const utils_validation = require('./utils/validation.js');
5
+
6
+ class ResourceAttributeAssignment extends baseAttributeAssignment.BaseAttributeAssignment {
7
+ resourceId;
8
+ resourceType;
9
+ constructor(resourceId, resourceType, attributeKey, attributeValue) {
10
+ utils_validation.ValidationUtils.validateResourceAssignment({ resourceId, resourceType, key: attributeKey, value: attributeValue });
11
+ super(resourceId, resourceType, attributeKey, attributeValue);
12
+ this.resourceId = resourceId;
13
+ this.resourceType = this.type;
14
+ }
15
+ toDataTransferObject() {
16
+ return {
17
+ resourceId: this.resourceId,
18
+ resourceType: this.resourceType,
19
+ key: this.attributeKey,
20
+ value: this.attributeValue,
21
+ };
22
+ }
23
+ /**
24
+ * Compares two assignments for equality
25
+ * @param other Another ResourceAttributeAssignment instance
26
+ * @returns true if all properties are equal
27
+ */
28
+ equals(other) {
29
+ return super.equals(other);
30
+ }
31
+ }
32
+
33
+ exports.ResourceAttributeAssignment = ResourceAttributeAssignment;
@@ -0,0 +1,25 @@
1
+ export declare const RESOURCE_ATTRIBUTES_CONSTANTS: Readonly<{
2
+ ACCOUNT_RESOURCE_ATTRIBUTES: {
3
+ ENABLE_MEMBERS_INVITE_FROM_NON_AUTH_DOMAIN: string;
4
+ };
5
+ WORKSPACE_RESOURCE_ATTRIBUTES: {
6
+ IS_DEFAULT_WORKSPACE: string;
7
+ };
8
+ BOARD_RESOURCE_ATTRIBUTES: {
9
+ IS_SYNCABLE_CHILD_ENTITY: string;
10
+ SYSTEM_ENTITY_TYPE: string;
11
+ };
12
+ }>;
13
+ export declare enum ResourceType {
14
+ Account = "account",
15
+ AccountProduct = "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
+ export declare const RESOURCE_TYPES: readonly ResourceType[];
25
+ //# sourceMappingURL=resource-attributes-constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource-attributes-constants.d.ts","sourceRoot":"","sources":["../src/resource-attributes-constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B;;;;;;;;;;;EAWxC,CAAC;AAEH,oBAAY,YAAY;IACtB,OAAO,YAAY;IACnB,cAAc,oBAAoB;IAClC,SAAS,cAAc;IACvB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,GAAG,QAAQ;CACZ;AAGD,eAAO,MAAM,cAAc,yBAA6C,CAAC"}
@@ -0,0 +1,31 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const RESOURCE_ATTRIBUTES_CONSTANTS = Object.freeze({
4
+ ACCOUNT_RESOURCE_ATTRIBUTES: {
5
+ ENABLE_MEMBERS_INVITE_FROM_NON_AUTH_DOMAIN: 'enable_members_invite_from_non_auth_domain',
6
+ },
7
+ WORKSPACE_RESOURCE_ATTRIBUTES: {
8
+ IS_DEFAULT_WORKSPACE: 'is_default_workspace',
9
+ },
10
+ BOARD_RESOURCE_ATTRIBUTES: {
11
+ IS_SYNCABLE_CHILD_ENTITY: 'is_syncable_child_entity',
12
+ SYSTEM_ENTITY_TYPE: 'system_entity_type',
13
+ },
14
+ });
15
+ exports.ResourceType = void 0;
16
+ (function (ResourceType) {
17
+ ResourceType["Account"] = "account";
18
+ ResourceType["AccountProduct"] = "account_product";
19
+ ResourceType["Workspace"] = "workspace";
20
+ ResourceType["Board"] = "board";
21
+ ResourceType["Item"] = "item";
22
+ ResourceType["Team"] = "team";
23
+ ResourceType["Overview"] = "overview";
24
+ ResourceType["Document"] = "document";
25
+ ResourceType["Crm"] = "crm";
26
+ })(exports.ResourceType || (exports.ResourceType = {}));
27
+ // Define the array of strings and use 'as const' to make its contents literal types
28
+ const RESOURCE_TYPES = Object.freeze(Object.values(exports.ResourceType));
29
+
30
+ exports.RESOURCE_ATTRIBUTES_CONSTANTS = RESOURCE_ATTRIBUTES_CONSTANTS;
31
+ exports.RESOURCE_TYPES = RESOURCE_TYPES;
@@ -1,28 +1,42 @@
1
1
  import { Resource } from './general';
2
- export interface ResourceAttributeAssignment {
3
- resourceType: Resource['type'];
4
- resourceId: Resource['id'];
2
+ import type { EntityType } from '../entity-attributes-constants';
3
+ import type { ResourceType } from '../resource-attributes-constants';
4
+ export interface AttributeAssignment {
5
5
  key: string;
6
6
  value: string;
7
7
  }
8
- export interface ResourceAttributeResponse {
9
- attributes: ResourceAttributeAssignment[];
8
+ export interface ResourceAttributeAssignment extends AttributeAssignment {
9
+ resourceId: number;
10
+ resourceType: ResourceType;
11
+ }
12
+ export interface EntityAttributeAssignment extends AttributeAssignment {
13
+ entityId: number;
14
+ entityType: EntityType;
10
15
  }
11
16
  export interface ResourceAttributeDelete {
12
17
  resourceType: Resource['type'];
13
18
  resourceId: Resource['id'];
14
19
  key: string;
15
20
  }
16
- export declare enum ResourceAttributeOperationEnum {
21
+ export interface EntityAttributeDelete {
22
+ entityType: EntityType;
23
+ entityId: number;
24
+ key: string;
25
+ }
26
+ export declare enum AttributeOperation {
17
27
  UPSERT = "upsert",
18
28
  DELETE = "delete"
19
29
  }
20
- interface UpsertResourceAttributeOperation extends ResourceAttributeAssignment {
21
- operationType: ResourceAttributeOperationEnum.UPSERT;
30
+ export interface ResourceAttributeResponse {
31
+ attributes: ResourceAttributeAssignment[];
32
+ }
33
+ export interface EntityAttributeResponse {
34
+ attributes: EntityAttributeAssignment[];
35
+ }
36
+ export interface ResourceAttributeOperation extends ResourceAttributeAssignment {
37
+ operationType: AttributeOperation;
22
38
  }
23
- interface DeleteResourceAttributeOperation extends ResourceAttributeDelete {
24
- operationType: ResourceAttributeOperationEnum.DELETE;
39
+ export interface EntityAttributeOperation extends EntityAttributeAssignment {
40
+ operationType: AttributeOperation;
25
41
  }
26
- export type ResourceAttributesOperation = UpsertResourceAttributeOperation | DeleteResourceAttributeOperation;
27
- export {};
28
42
  //# sourceMappingURL=authorization-attributes-contracts.d.ts.map