@mondaydotcomorg/monday-authorization 3.5.0-feat-use-profile-for-graph-can-action-in-scope-f1451ab → 3.5.0-feat-shaime-support-entity-attributes-in-authorization-sdk-397ce54

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 (60) hide show
  1. package/dist/authorization-attributes-ms-service.d.ts +37 -0
  2. package/dist/authorization-attributes-ms-service.d.ts.map +1 -0
  3. package/dist/authorization-attributes-ms-service.js +232 -0
  4. package/dist/authorization-attributes-service.d.ts +45 -1
  5. package/dist/authorization-attributes-service.d.ts.map +1 -1
  6. package/dist/authorization-attributes-service.js +262 -0
  7. package/dist/clients/graph-api.d.ts.map +1 -1
  8. package/dist/clients/graph-api.js +0 -1
  9. package/dist/constants.d.ts +0 -3
  10. package/dist/constants.d.ts.map +1 -1
  11. package/dist/constants.js +0 -4
  12. package/dist/errors/argument-error.d.ts +4 -0
  13. package/dist/errors/argument-error.d.ts.map +1 -0
  14. package/dist/errors/argument-error.js +11 -0
  15. package/dist/esm/authorization-attributes-ms-service.d.ts +37 -0
  16. package/dist/esm/authorization-attributes-ms-service.d.ts.map +1 -0
  17. package/dist/esm/authorization-attributes-ms-service.mjs +230 -0
  18. package/dist/esm/authorization-attributes-service.d.ts +45 -1
  19. package/dist/esm/authorization-attributes-service.d.ts.map +1 -1
  20. package/dist/esm/authorization-attributes-service.mjs +263 -1
  21. package/dist/esm/clients/graph-api.d.ts.map +1 -1
  22. package/dist/esm/clients/graph-api.mjs +1 -2
  23. package/dist/esm/constants.d.ts +0 -3
  24. package/dist/esm/constants.d.ts.map +1 -1
  25. package/dist/esm/constants.mjs +1 -5
  26. package/dist/esm/errors/argument-error.d.ts +4 -0
  27. package/dist/esm/errors/argument-error.d.ts.map +1 -0
  28. package/dist/esm/errors/argument-error.mjs +9 -0
  29. package/dist/esm/index.d.ts +5 -0
  30. package/dist/esm/index.d.ts.map +1 -1
  31. package/dist/esm/index.mjs +4 -0
  32. package/dist/esm/resource-attribute-assignment.d.ts +25 -0
  33. package/dist/esm/resource-attribute-assignment.d.ts.map +1 -0
  34. package/dist/esm/resource-attribute-assignment.mjs +60 -0
  35. package/dist/esm/resource-attributes-constants.d.ts +25 -0
  36. package/dist/esm/resource-attributes-constants.d.ts.map +1 -0
  37. package/dist/esm/resource-attributes-constants.mjs +25 -0
  38. package/dist/esm/types/authorization-attributes-contracts.d.ts +19 -3
  39. package/dist/esm/types/authorization-attributes-contracts.d.ts.map +1 -1
  40. package/dist/index.d.ts +5 -0
  41. package/dist/index.d.ts.map +1 -1
  42. package/dist/index.js +9 -0
  43. package/dist/resource-attribute-assignment.d.ts +25 -0
  44. package/dist/resource-attribute-assignment.d.ts.map +1 -0
  45. package/dist/resource-attribute-assignment.js +62 -0
  46. package/dist/resource-attributes-constants.d.ts +25 -0
  47. package/dist/resource-attributes-constants.d.ts.map +1 -0
  48. package/dist/resource-attributes-constants.js +28 -0
  49. package/dist/types/authorization-attributes-contracts.d.ts +19 -3
  50. package/dist/types/authorization-attributes-contracts.d.ts.map +1 -1
  51. package/package.json +1 -1
  52. package/src/authorization-attributes-ms-service.ts +327 -0
  53. package/src/authorization-attributes-service.ts +325 -0
  54. package/src/clients/graph-api.ts +1 -2
  55. package/src/constants.ts +0 -4
  56. package/src/errors/argument-error.ts +8 -0
  57. package/src/index.ts +16 -0
  58. package/src/resource-attribute-assignment.ts +70 -0
  59. package/src/resource-attributes-constants.ts +27 -0
  60. package/src/types/authorization-attributes-contracts.ts +49 -3
@@ -2,9 +2,6 @@ import { RecursivePartial } from '@mondaydotcomorg/monday-fetch-api';
2
2
  import { FetcherConfig } from '@mondaydotcomorg/trident-backend-api';
3
3
  export declare const APP_NAME = "authorization";
4
4
  export declare const GRAPH_APP_NAME = "authorization-graph";
5
- export declare enum GraphProfile {
6
- PERMISSION = "authorization-graph-permission"
7
- }
8
5
  export declare const ERROR_MESSAGES: {
9
6
  readonly HTTP_CLIENT_NOT_INITIALIZED: "MondayAuthorization: HTTP client is not initialized";
10
7
  readonly REQUEST_FAILED: (method: string, status: number, reason: string) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAErE,eAAO,MAAM,QAAQ,kBAAkB,CAAC;AACxC,eAAO,MAAM,cAAc,wBAAwB,CAAC;AAEpD,oBAAY,YAAY;IACtB,UAAU,mCAAmC;CAC9C;AAED,eAAO,MAAM,cAAc;;sCAEA,MAAM,UAAU,MAAM,UAAU,MAAM;CAEvD,CAAC;AAEX,eAAO,MAAM,qBAAqB,EAAE,gBAAgB,CAAC,aAAa,CAUjE,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAErE,eAAO,MAAM,QAAQ,kBAAkB,CAAC;AACxC,eAAO,MAAM,cAAc,wBAAwB,CAAC;AAEpD,eAAO,MAAM,cAAc;;sCAEA,MAAM,UAAU,MAAM,UAAU,MAAM;CAEvD,CAAC;AAEX,eAAO,MAAM,qBAAqB,EAAE,gBAAgB,CAAC,aAAa,CAUjE,CAAC"}
@@ -1,9 +1,5 @@
1
1
  const APP_NAME = 'authorization';
2
2
  const GRAPH_APP_NAME = 'authorization-graph';
3
- var GraphProfile;
4
- (function (GraphProfile) {
5
- GraphProfile["PERMISSION"] = "authorization-graph-permission";
6
- })(GraphProfile || (GraphProfile = {}));
7
3
  const ERROR_MESSAGES = {
8
4
  HTTP_CLIENT_NOT_INITIALIZED: 'MondayAuthorization: HTTP client is not initialized',
9
5
  REQUEST_FAILED: (method, status, reason) => `MondayAuthorization: [${method}] request failed with status ${status} with reason: ${reason}`,
@@ -20,4 +16,4 @@ const DEFAULT_FETCH_OPTIONS = {
20
16
  },
21
17
  };
22
18
 
23
- export { APP_NAME, DEFAULT_FETCH_OPTIONS, ERROR_MESSAGES, GRAPH_APP_NAME, GraphProfile };
19
+ export { APP_NAME, DEFAULT_FETCH_OPTIONS, ERROR_MESSAGES, GRAPH_APP_NAME };
@@ -0,0 +1,4 @@
1
+ export declare class ArgumentError extends Error {
2
+ constructor(message: string);
3
+ }
4
+ //# sourceMappingURL=argument-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"argument-error.d.ts","sourceRoot":"","sources":["../../../src/errors/argument-error.ts"],"names":[],"mappings":"AAAA,qBAAa,aAAc,SAAQ,KAAK;gBAC1B,OAAO,EAAE,MAAM;CAK5B"}
@@ -0,0 +1,9 @@
1
+ class ArgumentError extends Error {
2
+ constructor(message) {
3
+ super(message);
4
+ this.name = 'ArgumentError';
5
+ Object.setPrototypeOf(this, ArgumentError.prototype);
6
+ }
7
+ }
8
+
9
+ export { ArgumentError };
@@ -19,6 +19,11 @@ export declare function init(options?: InitOptions): Promise<void>;
19
19
  export { authorizationCheckMiddleware, getAuthorizationMiddleware, skipAuthorizationMiddleware, } from './authorization-middleware';
20
20
  export { AuthorizationService, AuthorizeResponse } from './authorization-service';
21
21
  export { AuthorizationAttributesService } from './authorization-attributes-service';
22
+ export { AuthorizationAttributesMsService } from './authorization-attributes-ms-service';
23
+ export { ResourceAttributeAssignment } from './resource-attribute-assignment';
24
+ export { RESOURCE_TYPES, RESOURCE_ATTRIBUTES_CONSTANTS } from './resource-attributes-constants';
25
+ export { ArgumentError } from './errors/argument-error';
26
+ export { EntityAttributeAssignment, ResourceAttributeResponse, EntityAttributeResponse, ResourceType, EntityType, ResourceAttributeKeyType, EntityAttributeKeyType, CommonAttributeKey, ResourceAttributeKey, EntityAttributeKey, } from './types/authorization-attributes-contracts';
22
27
  export { RolesService } from './roles-service';
23
28
  export { MembershipsService } from './memberships';
24
29
  export { AuthorizationObject, Resource, BaseRequest, ResourceGetter, ContextGetter } from './types/general';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAGnE,OAAO,EAAqB,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC,UAAU,kBAAkB;IAC1B,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,sCAAsC,CAAC,EAAE,MAAM,CAAC;IAChD,OAAO,CAAC,EAAE,kBAAkB,CAAC;CAC9B;AAED,wBAAsB,IAAI,CAAC,OAAO,GAAE,WAAgB,iBA6BnD;AAED,OAAO,EACL,4BAA4B,EAC5B,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAE,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;AACpF,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC5G,OAAO,EACL,WAAW,EACX,YAAY,EACZ,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAErH,OAAO,EAAE,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAGnE,OAAO,EAAqB,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC,UAAU,kBAAkB;IAC1B,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,sCAAsC,CAAC,EAAE,MAAM,CAAC;IAChD,OAAO,CAAC,EAAE,kBAAkB,CAAC;CAC9B;AAED,wBAAsB,IAAI,CAAC,OAAO,GAAE,WAAgB,iBA6BnD;AAED,OAAO,EACL,4BAA4B,EAC5B,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAE,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;AACpF,OAAO,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAC;AACzF,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChG,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,uBAAuB,EACvB,YAAY,EACZ,UAAU,EACV,wBAAwB,EACxB,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC5G,OAAO,EACL,WAAW,EACX,YAAY,EACZ,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAErH,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -6,6 +6,10 @@ import * as testKit_index from './testKit/index.mjs';
6
6
  export { testKit_index as TestKit };
7
7
  export { authorizationCheckMiddleware, getAuthorizationMiddleware, skipAuthorizationMiddleware } from './authorization-middleware.mjs';
8
8
  export { AuthorizationAttributesService } from './authorization-attributes-service.mjs';
9
+ export { AuthorizationAttributesMsService } from './authorization-attributes-ms-service.mjs';
10
+ export { ResourceAttributeAssignment } from './resource-attribute-assignment.mjs';
11
+ export { RESOURCE_ATTRIBUTES_CONSTANTS, RESOURCE_TYPES } from './resource-attributes-constants.mjs';
12
+ export { ArgumentError } from './errors/argument-error.mjs';
9
13
  export { RolesService } from './roles-service.mjs';
10
14
  export { MembershipsService } from './memberships.mjs';
11
15
  export { RoleType } from './types/roles.mjs';
@@ -0,0 +1,25 @@
1
+ import { ResourceType } from './resource-attributes-constants';
2
+ export declare class ResourceAttributeAssignment {
3
+ readonly resourceId: number;
4
+ readonly resourceType: ResourceType;
5
+ readonly attributeKey: string;
6
+ readonly attributeValue: string;
7
+ constructor(resourceId: number, resourceType: string, attributeKey: string, attributeValue: string);
8
+ /**
9
+ * Converts the assignment to hash format with camelCase keys
10
+ * @returns Object with camelCase keys: { resourceId, resourceType, key, value }
11
+ */
12
+ toH(): {
13
+ resourceId: number;
14
+ resourceType: string;
15
+ key: string;
16
+ value: string;
17
+ };
18
+ /**
19
+ * Compares two assignments for equality
20
+ * @param other Another ResourceAttributeAssignment instance
21
+ * @returns true if all properties are equal
22
+ */
23
+ equals(other: ResourceAttributeAssignment): boolean;
24
+ }
25
+ //# 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,EAAkB,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAG/E,qBAAa,2BAA2B;IACtC,SAAgB,UAAU,EAAE,MAAM,CAAC;IACnC,SAAgB,YAAY,EAAE,YAAY,CAAC;IAC3C,SAAgB,YAAY,EAAE,MAAM,CAAC;IACrC,SAAgB,cAAc,EAAE,MAAM,CAAC;gBAE3B,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM;IA8BlG;;;OAGG;IACH,GAAG,IAAI;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE;IAS/E;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,2BAA2B,GAAG,OAAO;CAWpD"}
@@ -0,0 +1,60 @@
1
+ import { RESOURCE_TYPES } from './resource-attributes-constants.mjs';
2
+ import { ArgumentError } from './errors/argument-error.mjs';
3
+
4
+ class ResourceAttributeAssignment {
5
+ resourceId;
6
+ resourceType;
7
+ attributeKey;
8
+ attributeValue;
9
+ constructor(resourceId, resourceType, attributeKey, attributeValue) {
10
+ // Validate resourceId
11
+ if (!Number.isInteger(resourceId)) {
12
+ throw new ArgumentError(`resourceId must be an integer, got: ${resourceId}`);
13
+ }
14
+ // Validate resourceType
15
+ const validResourceTypes = Object.values(RESOURCE_TYPES);
16
+ if (!validResourceTypes.includes(resourceType)) {
17
+ throw new ArgumentError(`resourceType must be one of [${validResourceTypes.join(', ')}], got: ${resourceType}`);
18
+ }
19
+ // Validate attributeKey
20
+ if (typeof attributeKey !== 'string') {
21
+ throw new ArgumentError(`attributeKey must be a string, got: ${typeof attributeKey}`);
22
+ }
23
+ // Validate attributeValue
24
+ if (typeof attributeValue !== 'string') {
25
+ throw new ArgumentError(`attributeValue must be a string, got: ${typeof attributeValue}`);
26
+ }
27
+ this.resourceId = resourceId;
28
+ this.resourceType = resourceType;
29
+ this.attributeKey = attributeKey;
30
+ this.attributeValue = attributeValue;
31
+ }
32
+ /**
33
+ * Converts the assignment to hash format with camelCase keys
34
+ * @returns Object with camelCase keys: { resourceId, resourceType, key, value }
35
+ */
36
+ toH() {
37
+ return {
38
+ resourceId: this.resourceId,
39
+ resourceType: this.resourceType,
40
+ key: this.attributeKey,
41
+ value: this.attributeValue,
42
+ };
43
+ }
44
+ /**
45
+ * Compares two assignments for equality
46
+ * @param other Another ResourceAttributeAssignment instance
47
+ * @returns true if all properties are equal
48
+ */
49
+ equals(other) {
50
+ if (!(other instanceof ResourceAttributeAssignment)) {
51
+ return false;
52
+ }
53
+ return (this.resourceId === other.resourceId &&
54
+ this.resourceType === other.resourceType &&
55
+ this.attributeKey === other.attributeKey &&
56
+ this.attributeValue === other.attributeValue);
57
+ }
58
+ }
59
+
60
+ export { ResourceAttributeAssignment };
@@ -0,0 +1,25 @@
1
+ export declare const RESOURCE_TYPES: {
2
+ readonly ACCOUNT: "account";
3
+ readonly ACCOUNT_PRODUCT: "account_product";
4
+ readonly WORKSPACE: "workspace";
5
+ readonly BOARD: "board";
6
+ readonly ITEM: "item";
7
+ readonly TEAM: "team";
8
+ readonly OVERVIEW: "overview";
9
+ readonly DOCUMENT: "document";
10
+ readonly CRM: "crm";
11
+ };
12
+ export declare const RESOURCE_ATTRIBUTES_CONSTANTS: {
13
+ readonly ACCOUNT_RESOURCE_ATTRIBUTES: {
14
+ readonly ENABLE_MEMBERS_INVITE_FROM_NON_AUTH_DOMAIN: "enable_members_invite_from_non_auth_domain";
15
+ };
16
+ readonly WORKSPACE_RESOURCE_ATTRIBUTES: {
17
+ readonly IS_DEFAULT_WORKSPACE: "is_default_workspace";
18
+ };
19
+ readonly BOARD_RESOURCE_ATTRIBUTES: {
20
+ readonly IS_SYNCABLE_CHILD_ENTITY: "is_syncable_child_entity";
21
+ readonly SYSTEM_ENTITY_TYPE: "system_entity_type";
22
+ };
23
+ };
24
+ export type ResourceType = typeof RESOURCE_TYPES[keyof typeof RESOURCE_TYPES];
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,cAAc;;;;;;;;;;CAUjB,CAAC;AAEX,eAAO,MAAM,6BAA6B;;;;;;;;;;;CAWhC,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,OAAO,cAAc,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC"}
@@ -0,0 +1,25 @@
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
+ const RESOURCE_ATTRIBUTES_CONSTANTS = {
13
+ ACCOUNT_RESOURCE_ATTRIBUTES: {
14
+ ENABLE_MEMBERS_INVITE_FROM_NON_AUTH_DOMAIN: 'enable_members_invite_from_non_auth_domain',
15
+ },
16
+ WORKSPACE_RESOURCE_ATTRIBUTES: {
17
+ IS_DEFAULT_WORKSPACE: 'is_default_workspace',
18
+ },
19
+ BOARD_RESOURCE_ATTRIBUTES: {
20
+ IS_SYNCABLE_CHILD_ENTITY: 'is_syncable_child_entity',
21
+ SYSTEM_ENTITY_TYPE: 'system_entity_type',
22
+ },
23
+ };
24
+
25
+ export { RESOURCE_ATTRIBUTES_CONSTANTS, RESOURCE_TYPES };
@@ -1,13 +1,29 @@
1
1
  import { Resource } from './general';
2
+ export type ResourceType = 'account' | 'account_product' | 'workspace' | 'board' | 'item' | 'team' | 'overview' | 'document' | 'crm';
3
+ export type EntityType = 'user' | 'team' | 'account';
4
+ export type CommonAttributeKey = string;
5
+ export type ResourceAttributeKey = string;
6
+ export type EntityAttributeKey = string;
7
+ export type ResourceAttributeKeyType = CommonAttributeKey | ResourceAttributeKey;
8
+ export type EntityAttributeKeyType = CommonAttributeKey | EntityAttributeKey;
2
9
  export interface ResourceAttributeAssignment {
3
- resourceType: Resource['type'];
4
- resourceId: Resource['id'];
5
- key: string;
10
+ resourceId: number;
11
+ resourceType: ResourceType;
12
+ key: ResourceAttributeKeyType;
13
+ value: string;
14
+ }
15
+ export interface EntityAttributeAssignment {
16
+ entityId: number;
17
+ entityType: EntityType;
18
+ key: EntityAttributeKeyType;
6
19
  value: string;
7
20
  }
8
21
  export interface ResourceAttributeResponse {
9
22
  attributes: ResourceAttributeAssignment[];
10
23
  }
24
+ export interface EntityAttributeResponse {
25
+ attributes: EntityAttributeAssignment[];
26
+ }
11
27
  export interface ResourceAttributeDelete {
12
28
  resourceType: Resource['type'];
13
29
  resourceId: Resource['id'];
@@ -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;AAGrC,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,iBAAiB,GACjB,WAAW,GACX,OAAO,GACP,MAAM,GACN,MAAM,GACN,UAAU,GACV,UAAU,GACV,KAAK,CAAC;AAGV,MAAM,MAAM,UAAU,GAClB,MAAM,GACN,MAAM,GACN,SAAS,CAAC;AAGd,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAGxC,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAG1C,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAGxC,MAAM,MAAM,wBAAwB,GAAG,kBAAkB,GAAG,oBAAoB,CAAC;AACjF,MAAM,MAAM,sBAAsB,GAAG,kBAAkB,GAAG,kBAAkB,CAAC;AAG7E,MAAM,WAAW,2BAA2B;IAC1C,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,YAAY,CAAC;IAC3B,GAAG,EAAE,wBAAwB,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;CACf;AAGD,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,UAAU,CAAC;IACvB,GAAG,EAAE,sBAAsB,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;CACf;AAGD,MAAM,WAAW,yBAAyB;IACxC,UAAU,EAAE,2BAA2B,EAAE,CAAC;CAC3C;AAED,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,yBAAyB,EAAE,CAAC;CACzC;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,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"}
package/dist/index.d.ts CHANGED
@@ -19,6 +19,11 @@ export declare function init(options?: InitOptions): Promise<void>;
19
19
  export { authorizationCheckMiddleware, getAuthorizationMiddleware, skipAuthorizationMiddleware, } from './authorization-middleware';
20
20
  export { AuthorizationService, AuthorizeResponse } from './authorization-service';
21
21
  export { AuthorizationAttributesService } from './authorization-attributes-service';
22
+ export { AuthorizationAttributesMsService } from './authorization-attributes-ms-service';
23
+ export { ResourceAttributeAssignment } from './resource-attribute-assignment';
24
+ export { RESOURCE_TYPES, RESOURCE_ATTRIBUTES_CONSTANTS } from './resource-attributes-constants';
25
+ export { ArgumentError } from './errors/argument-error';
26
+ export { EntityAttributeAssignment, ResourceAttributeResponse, EntityAttributeResponse, ResourceType, EntityType, ResourceAttributeKeyType, EntityAttributeKeyType, CommonAttributeKey, ResourceAttributeKey, EntityAttributeKey, } from './types/authorization-attributes-contracts';
22
27
  export { RolesService } from './roles-service';
23
28
  export { MembershipsService } from './memberships';
24
29
  export { AuthorizationObject, Resource, BaseRequest, ResourceGetter, ContextGetter } from './types/general';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAGnE,OAAO,EAAqB,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC,UAAU,kBAAkB;IAC1B,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,sCAAsC,CAAC,EAAE,MAAM,CAAC;IAChD,OAAO,CAAC,EAAE,kBAAkB,CAAC;CAC9B;AAED,wBAAsB,IAAI,CAAC,OAAO,GAAE,WAAgB,iBA6BnD;AAED,OAAO,EACL,4BAA4B,EAC5B,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAE,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;AACpF,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC5G,OAAO,EACL,WAAW,EACX,YAAY,EACZ,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAErH,OAAO,EAAE,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAGnE,OAAO,EAAqB,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC,UAAU,kBAAkB;IAC1B,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,sCAAsC,CAAC,EAAE,MAAM,CAAC;IAChD,OAAO,CAAC,EAAE,kBAAkB,CAAC;CAC9B;AAED,wBAAsB,IAAI,CAAC,OAAO,GAAE,WAAgB,iBA6BnD;AAED,OAAO,EACL,4BAA4B,EAC5B,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAE,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;AACpF,OAAO,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAC;AACzF,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChG,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,uBAAuB,EACvB,YAAY,EACZ,UAAU,EACV,wBAAwB,EACxB,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC5G,OAAO,EACL,WAAW,EACX,YAAY,EACZ,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAErH,OAAO,EAAE,OAAO,EAAE,CAAC"}
package/dist/index.js CHANGED
@@ -6,6 +6,10 @@ const metricsService = require('./metrics-service.js');
6
6
  const testKit_index = require('./testKit/index.js');
7
7
  const authorizationMiddleware = require('./authorization-middleware.js');
8
8
  const authorizationAttributesService = require('./authorization-attributes-service.js');
9
+ const authorizationAttributesMsService = require('./authorization-attributes-ms-service.js');
10
+ const resourceAttributeAssignment = require('./resource-attribute-assignment.js');
11
+ const resourceAttributesConstants = require('./resource-attributes-constants.js');
12
+ const errors_argumentError = require('./errors/argument-error.js');
9
13
  const rolesService = require('./roles-service.js');
10
14
  const memberships = require('./memberships.js');
11
15
  const types_roles = require('./types/roles.js');
@@ -44,6 +48,11 @@ exports.authorizationCheckMiddleware = authorizationMiddleware.authorizationChec
44
48
  exports.getAuthorizationMiddleware = authorizationMiddleware.getAuthorizationMiddleware;
45
49
  exports.skipAuthorizationMiddleware = authorizationMiddleware.skipAuthorizationMiddleware;
46
50
  exports.AuthorizationAttributesService = authorizationAttributesService.AuthorizationAttributesService;
51
+ exports.AuthorizationAttributesMsService = authorizationAttributesMsService.AuthorizationAttributesMsService;
52
+ exports.ResourceAttributeAssignment = resourceAttributeAssignment.ResourceAttributeAssignment;
53
+ exports.RESOURCE_ATTRIBUTES_CONSTANTS = resourceAttributesConstants.RESOURCE_ATTRIBUTES_CONSTANTS;
54
+ exports.RESOURCE_TYPES = resourceAttributesConstants.RESOURCE_TYPES;
55
+ exports.ArgumentError = errors_argumentError.ArgumentError;
47
56
  exports.RolesService = rolesService.RolesService;
48
57
  exports.MembershipsService = memberships.MembershipsService;
49
58
  Object.defineProperty(exports, 'RoleType', {
@@ -0,0 +1,25 @@
1
+ import { ResourceType } from './resource-attributes-constants';
2
+ export declare class ResourceAttributeAssignment {
3
+ readonly resourceId: number;
4
+ readonly resourceType: ResourceType;
5
+ readonly attributeKey: string;
6
+ readonly attributeValue: string;
7
+ constructor(resourceId: number, resourceType: string, attributeKey: string, attributeValue: string);
8
+ /**
9
+ * Converts the assignment to hash format with camelCase keys
10
+ * @returns Object with camelCase keys: { resourceId, resourceType, key, value }
11
+ */
12
+ toH(): {
13
+ resourceId: number;
14
+ resourceType: string;
15
+ key: string;
16
+ value: string;
17
+ };
18
+ /**
19
+ * Compares two assignments for equality
20
+ * @param other Another ResourceAttributeAssignment instance
21
+ * @returns true if all properties are equal
22
+ */
23
+ equals(other: ResourceAttributeAssignment): boolean;
24
+ }
25
+ //# 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,EAAkB,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAG/E,qBAAa,2BAA2B;IACtC,SAAgB,UAAU,EAAE,MAAM,CAAC;IACnC,SAAgB,YAAY,EAAE,YAAY,CAAC;IAC3C,SAAgB,YAAY,EAAE,MAAM,CAAC;IACrC,SAAgB,cAAc,EAAE,MAAM,CAAC;gBAE3B,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM;IA8BlG;;;OAGG;IACH,GAAG,IAAI;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE;IAS/E;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,2BAA2B,GAAG,OAAO;CAWpD"}
@@ -0,0 +1,62 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const resourceAttributesConstants = require('./resource-attributes-constants.js');
4
+ const errors_argumentError = require('./errors/argument-error.js');
5
+
6
+ class ResourceAttributeAssignment {
7
+ resourceId;
8
+ resourceType;
9
+ attributeKey;
10
+ attributeValue;
11
+ constructor(resourceId, resourceType, attributeKey, attributeValue) {
12
+ // Validate resourceId
13
+ if (!Number.isInteger(resourceId)) {
14
+ throw new errors_argumentError.ArgumentError(`resourceId must be an integer, got: ${resourceId}`);
15
+ }
16
+ // Validate resourceType
17
+ const validResourceTypes = Object.values(resourceAttributesConstants.RESOURCE_TYPES);
18
+ if (!validResourceTypes.includes(resourceType)) {
19
+ throw new errors_argumentError.ArgumentError(`resourceType must be one of [${validResourceTypes.join(', ')}], got: ${resourceType}`);
20
+ }
21
+ // Validate attributeKey
22
+ if (typeof attributeKey !== 'string') {
23
+ throw new errors_argumentError.ArgumentError(`attributeKey must be a string, got: ${typeof attributeKey}`);
24
+ }
25
+ // Validate attributeValue
26
+ if (typeof attributeValue !== 'string') {
27
+ throw new errors_argumentError.ArgumentError(`attributeValue must be a string, got: ${typeof attributeValue}`);
28
+ }
29
+ this.resourceId = resourceId;
30
+ this.resourceType = resourceType;
31
+ this.attributeKey = attributeKey;
32
+ this.attributeValue = attributeValue;
33
+ }
34
+ /**
35
+ * Converts the assignment to hash format with camelCase keys
36
+ * @returns Object with camelCase keys: { resourceId, resourceType, key, value }
37
+ */
38
+ toH() {
39
+ return {
40
+ resourceId: this.resourceId,
41
+ resourceType: this.resourceType,
42
+ key: this.attributeKey,
43
+ value: this.attributeValue,
44
+ };
45
+ }
46
+ /**
47
+ * Compares two assignments for equality
48
+ * @param other Another ResourceAttributeAssignment instance
49
+ * @returns true if all properties are equal
50
+ */
51
+ equals(other) {
52
+ if (!(other instanceof ResourceAttributeAssignment)) {
53
+ return false;
54
+ }
55
+ return (this.resourceId === other.resourceId &&
56
+ this.resourceType === other.resourceType &&
57
+ this.attributeKey === other.attributeKey &&
58
+ this.attributeValue === other.attributeValue);
59
+ }
60
+ }
61
+
62
+ exports.ResourceAttributeAssignment = ResourceAttributeAssignment;
@@ -0,0 +1,25 @@
1
+ export declare const RESOURCE_TYPES: {
2
+ readonly ACCOUNT: "account";
3
+ readonly ACCOUNT_PRODUCT: "account_product";
4
+ readonly WORKSPACE: "workspace";
5
+ readonly BOARD: "board";
6
+ readonly ITEM: "item";
7
+ readonly TEAM: "team";
8
+ readonly OVERVIEW: "overview";
9
+ readonly DOCUMENT: "document";
10
+ readonly CRM: "crm";
11
+ };
12
+ export declare const RESOURCE_ATTRIBUTES_CONSTANTS: {
13
+ readonly ACCOUNT_RESOURCE_ATTRIBUTES: {
14
+ readonly ENABLE_MEMBERS_INVITE_FROM_NON_AUTH_DOMAIN: "enable_members_invite_from_non_auth_domain";
15
+ };
16
+ readonly WORKSPACE_RESOURCE_ATTRIBUTES: {
17
+ readonly IS_DEFAULT_WORKSPACE: "is_default_workspace";
18
+ };
19
+ readonly BOARD_RESOURCE_ATTRIBUTES: {
20
+ readonly IS_SYNCABLE_CHILD_ENTITY: "is_syncable_child_entity";
21
+ readonly SYSTEM_ENTITY_TYPE: "system_entity_type";
22
+ };
23
+ };
24
+ export type ResourceType = typeof RESOURCE_TYPES[keyof typeof RESOURCE_TYPES];
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,cAAc;;;;;;;;;;CAUjB,CAAC;AAEX,eAAO,MAAM,6BAA6B;;;;;;;;;;;CAWhC,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,OAAO,cAAc,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC"}
@@ -0,0 +1,28 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const RESOURCE_TYPES = {
4
+ ACCOUNT: 'account',
5
+ ACCOUNT_PRODUCT: 'account_product',
6
+ WORKSPACE: 'workspace',
7
+ BOARD: 'board',
8
+ ITEM: 'item',
9
+ TEAM: 'team',
10
+ OVERVIEW: 'overview',
11
+ DOCUMENT: 'document',
12
+ CRM: 'crm',
13
+ };
14
+ const RESOURCE_ATTRIBUTES_CONSTANTS = {
15
+ ACCOUNT_RESOURCE_ATTRIBUTES: {
16
+ ENABLE_MEMBERS_INVITE_FROM_NON_AUTH_DOMAIN: 'enable_members_invite_from_non_auth_domain',
17
+ },
18
+ WORKSPACE_RESOURCE_ATTRIBUTES: {
19
+ IS_DEFAULT_WORKSPACE: 'is_default_workspace',
20
+ },
21
+ BOARD_RESOURCE_ATTRIBUTES: {
22
+ IS_SYNCABLE_CHILD_ENTITY: 'is_syncable_child_entity',
23
+ SYSTEM_ENTITY_TYPE: 'system_entity_type',
24
+ },
25
+ };
26
+
27
+ exports.RESOURCE_ATTRIBUTES_CONSTANTS = RESOURCE_ATTRIBUTES_CONSTANTS;
28
+ exports.RESOURCE_TYPES = RESOURCE_TYPES;
@@ -1,13 +1,29 @@
1
1
  import { Resource } from './general';
2
+ export type ResourceType = 'account' | 'account_product' | 'workspace' | 'board' | 'item' | 'team' | 'overview' | 'document' | 'crm';
3
+ export type EntityType = 'user' | 'team' | 'account';
4
+ export type CommonAttributeKey = string;
5
+ export type ResourceAttributeKey = string;
6
+ export type EntityAttributeKey = string;
7
+ export type ResourceAttributeKeyType = CommonAttributeKey | ResourceAttributeKey;
8
+ export type EntityAttributeKeyType = CommonAttributeKey | EntityAttributeKey;
2
9
  export interface ResourceAttributeAssignment {
3
- resourceType: Resource['type'];
4
- resourceId: Resource['id'];
5
- key: string;
10
+ resourceId: number;
11
+ resourceType: ResourceType;
12
+ key: ResourceAttributeKeyType;
13
+ value: string;
14
+ }
15
+ export interface EntityAttributeAssignment {
16
+ entityId: number;
17
+ entityType: EntityType;
18
+ key: EntityAttributeKeyType;
6
19
  value: string;
7
20
  }
8
21
  export interface ResourceAttributeResponse {
9
22
  attributes: ResourceAttributeAssignment[];
10
23
  }
24
+ export interface EntityAttributeResponse {
25
+ attributes: EntityAttributeAssignment[];
26
+ }
11
27
  export interface ResourceAttributeDelete {
12
28
  resourceType: Resource['type'];
13
29
  resourceId: Resource['id'];
@@ -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;AAGrC,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,iBAAiB,GACjB,WAAW,GACX,OAAO,GACP,MAAM,GACN,MAAM,GACN,UAAU,GACV,UAAU,GACV,KAAK,CAAC;AAGV,MAAM,MAAM,UAAU,GAClB,MAAM,GACN,MAAM,GACN,SAAS,CAAC;AAGd,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAGxC,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAG1C,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAGxC,MAAM,MAAM,wBAAwB,GAAG,kBAAkB,GAAG,oBAAoB,CAAC;AACjF,MAAM,MAAM,sBAAsB,GAAG,kBAAkB,GAAG,kBAAkB,CAAC;AAG7E,MAAM,WAAW,2BAA2B;IAC1C,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,YAAY,CAAC;IAC3B,GAAG,EAAE,wBAAwB,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;CACf;AAGD,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,UAAU,CAAC;IACvB,GAAG,EAAE,sBAAsB,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;CACf;AAGD,MAAM,WAAW,yBAAyB;IACxC,UAAU,EAAE,2BAA2B,EAAE,CAAC;CAC3C;AAED,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,yBAAyB,EAAE,CAAC;CACzC;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,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mondaydotcomorg/monday-authorization",
3
- "version": "3.5.0-feat-use-profile-for-graph-can-action-in-scope-f1451ab",
3
+ "version": "3.5.0-feat-shaime-support-entity-attributes-in-authorization-sdk-397ce54",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "license": "BSD-3-Clause",