@mondaydotcomorg/monday-authorization 3.6.0-feat-shaime-support-entity-attributes-3-78dca48 → 3.6.0-feat-shaime-support-entity-attributes-3-31fcbe3
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/esm/index.d.ts +4 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.mjs +3 -0
- package/dist/esm/types/authorization-attributes-contracts.d.ts +0 -17
- package/dist/esm/types/authorization-attributes-contracts.d.ts.map +1 -1
- package/dist/esm/utils/assignment-schema.d.ts +5 -5
- package/dist/esm/utils/assignment-schema.mjs +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/types/authorization-attributes-contracts.d.ts +0 -17
- package/dist/types/authorization-attributes-contracts.d.ts.map +1 -1
- package/dist/utils/assignment-schema.d.ts +5 -5
- package/dist/utils/assignment-schema.js +1 -1
- package/package.json +1 -1
- package/src/index.ts +16 -1
- package/src/types/authorization-attributes-contracts.ts +0 -24
- package/src/utils/assignment-schema.ts +1 -1
package/dist/esm/index.d.ts
CHANGED
|
@@ -21,10 +21,14 @@ export { AuthorizationService, AuthorizeResponse } from './authorization-service
|
|
|
21
21
|
export { AuthorizationAttributesService } from './authorization-attributes-service';
|
|
22
22
|
export * from './resource-attributes-constants';
|
|
23
23
|
export * from './entity-attributes-constants';
|
|
24
|
+
export { ResourceAttributeAssignment } from './resource-attribute-assignment';
|
|
25
|
+
export { EntityAttributeAssignment } from './entity-attribute-assignment';
|
|
24
26
|
export { RolesService } from './roles-service';
|
|
25
27
|
export { MembershipsService } from './memberships';
|
|
26
28
|
export { AuthorizationObject, Resource, BaseRequest, ResourceGetter, ContextGetter } from './types/general';
|
|
27
29
|
export { Translation, ScopedAction, ScopedActionResponseObject, ScopedActionPermit, } from './types/scoped-actions-contracts';
|
|
28
30
|
export { CustomRole, BasicRole, RoleType, RoleCreateRequest, RoleUpdateRequest, RolesResponse } from './types/roles';
|
|
31
|
+
export { AttributeAssignment, AttributeOperation, ResourceAttributeDeleteAssignment, ResourceAttributeUpsertOperation, ResourceAttributeDeleteOperation, EntityAttributeDeleteAssignment, EntityAttributeUpsertOperation, EntityAttributeDeleteOperation, ResourceAttributeAssignment as ResourceAttributeAssignmentContract, EntityAttributeAssignment as EntityAttributeAssignmentContract, } from './types/authorization-attributes-contracts';
|
|
32
|
+
export { AuthorizationAttributesService as IAuthorizationAttributesService } from './types/authorization-attributes-service.interface';
|
|
29
33
|
export { TestKit };
|
|
30
34
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -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,OAA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,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;AACrH,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,iCAAiC,EACjC,gCAAgC,EAChC,gCAAgC,EAChC,+BAA+B,EAC/B,8BAA8B,EAC9B,8BAA8B,EAC9B,2BAA2B,IAAI,mCAAmC,EAClE,yBAAyB,IAAI,iCAAiC,GAC/D,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,8BAA8B,IAAI,+BAA+B,EAAE,MAAM,oDAAoD,CAAC;AAEvI,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -8,9 +8,12 @@ export { authorizationCheckMiddleware, getAuthorizationMiddleware, skipAuthoriza
|
|
|
8
8
|
export { AuthorizationAttributesService } from './authorization-attributes-service.mjs';
|
|
9
9
|
export { RESOURCE_ATTRIBUTES_CONSTANTS, RESOURCE_TYPES, ResourceType } from './resource-attributes-constants.mjs';
|
|
10
10
|
export { ENTITY_TYPES, EntityType } from './entity-attributes-constants.mjs';
|
|
11
|
+
export { ResourceAttributeAssignment } from './resource-attribute-assignment.mjs';
|
|
12
|
+
export { EntityAttributeAssignment } from './entity-attribute-assignment.mjs';
|
|
11
13
|
export { RolesService } from './roles-service.mjs';
|
|
12
14
|
export { MembershipsService } from './memberships.mjs';
|
|
13
15
|
export { RoleType } from './types/roles.mjs';
|
|
16
|
+
export { AttributeOperation } from './types/authorization-attributes-contracts.mjs';
|
|
14
17
|
|
|
15
18
|
async function init(options = {}) {
|
|
16
19
|
if (options.prometheus) {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Resource } from './general';
|
|
2
1
|
import type { EntityType } from '../entity-attributes-constants';
|
|
3
2
|
import type { ResourceType } from '../resource-attributes-constants';
|
|
4
3
|
export interface AttributeAssignment {
|
|
@@ -15,26 +14,10 @@ export interface EntityAttributeAssignment extends AttributeAssignment {
|
|
|
15
14
|
entityType: EntityType;
|
|
16
15
|
}
|
|
17
16
|
export type EntityAttributeDeleteAssignment = Omit<EntityAttributeAssignment, 'value'>;
|
|
18
|
-
export interface ResourceAttributeDelete {
|
|
19
|
-
resourceType: Resource['type'];
|
|
20
|
-
resourceId: Resource['id'];
|
|
21
|
-
key: string;
|
|
22
|
-
}
|
|
23
|
-
export interface EntityAttributeDelete {
|
|
24
|
-
entityType: EntityType;
|
|
25
|
-
entityId: number;
|
|
26
|
-
key: string;
|
|
27
|
-
}
|
|
28
17
|
export declare enum AttributeOperation {
|
|
29
18
|
UPSERT = "upsert",
|
|
30
19
|
DELETE = "delete"
|
|
31
20
|
}
|
|
32
|
-
export interface ResourceAttributeResponse {
|
|
33
|
-
attributes: ResourceAttributeAssignment[];
|
|
34
|
-
}
|
|
35
|
-
export interface EntityAttributeResponse {
|
|
36
|
-
attributes: EntityAttributeAssignment[];
|
|
37
|
-
}
|
|
38
21
|
export interface ResourceAttributeUpsertOperation extends ResourceAttributeAssignment {
|
|
39
22
|
operationType: AttributeOperation;
|
|
40
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorization-attributes-contracts.d.ts","sourceRoot":"","sources":["../../../src/types/authorization-attributes-contracts.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"authorization-attributes-contracts.d.ts","sourceRoot":"","sources":["../../../src/types/authorization-attributes-contracts.ts"],"names":[],"mappings":"AAAA,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;AACD,MAAM,MAAM,iCAAiC,GAAG,IAAI,CAAC,2BAA2B,EAAE,OAAO,CAAC,CAAC;AAI3F,MAAM,WAAW,yBAA0B,SAAQ,mBAAmB;IACpE,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,UAAU,CAAC;CACxB;AACD,MAAM,MAAM,+BAA+B,GAAG,IAAI,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;AAEvF,oBAAY,kBAAkB;IAC5B,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB;AACD,MAAM,WAAW,gCAAiC,SAAQ,2BAA2B;IACnF,aAAa,EAAE,kBAAkB,CAAC;CACnC;AACD,MAAM,MAAM,gCAAgC,GAAG,IAAI,CAAC,gCAAgC,EAAE,OAAO,CAAC,CAAC;AAE/F,MAAM,WAAW,8BAA+B,SAAQ,yBAAyB;IAC/E,aAAa,EAAE,kBAAkB,CAAC;CACnC;AACD,MAAM,MAAM,8BAA8B,GAAG,IAAI,CAAC,8BAA8B,EAAE,OAAO,CAAC,CAAC"}
|
|
@@ -24,15 +24,15 @@ export declare const entityDeleteAssignmentSchema: import("ajv").ValidateFunctio
|
|
|
24
24
|
entityType: any;
|
|
25
25
|
}>;
|
|
26
26
|
export declare const resourceDeleteAssignmentSchema: import("ajv").ValidateFunction<{
|
|
27
|
-
|
|
27
|
+
resourceId: any;
|
|
28
|
+
resourceType: any;
|
|
28
29
|
key: any;
|
|
29
|
-
type: any;
|
|
30
30
|
} & {
|
|
31
|
-
|
|
31
|
+
resourceId: any;
|
|
32
|
+
} & {
|
|
33
|
+
resourceType: any;
|
|
32
34
|
} & {
|
|
33
35
|
key: any;
|
|
34
|
-
} & {
|
|
35
|
-
type: any;
|
|
36
36
|
}>;
|
|
37
37
|
export declare const resourceUpsertAssignmentSchema: import("ajv").ValidateFunction<{
|
|
38
38
|
value: any;
|
|
@@ -31,7 +31,7 @@ const resourceDeleteAssignmentSchema = ajv.compile({
|
|
|
31
31
|
resourceType: { type: 'string', enum: Object.values(ResourceType) },
|
|
32
32
|
key: { type: 'string', minLength: 1 },
|
|
33
33
|
},
|
|
34
|
-
required: ['
|
|
34
|
+
required: ['resourceId', 'resourceType', 'key'],
|
|
35
35
|
additionalProperties: false,
|
|
36
36
|
});
|
|
37
37
|
const resourceUpsertAssignmentSchema = ajv.compile({
|
package/dist/index.d.ts
CHANGED
|
@@ -21,10 +21,14 @@ export { AuthorizationService, AuthorizeResponse } from './authorization-service
|
|
|
21
21
|
export { AuthorizationAttributesService } from './authorization-attributes-service';
|
|
22
22
|
export * from './resource-attributes-constants';
|
|
23
23
|
export * from './entity-attributes-constants';
|
|
24
|
+
export { ResourceAttributeAssignment } from './resource-attribute-assignment';
|
|
25
|
+
export { EntityAttributeAssignment } from './entity-attribute-assignment';
|
|
24
26
|
export { RolesService } from './roles-service';
|
|
25
27
|
export { MembershipsService } from './memberships';
|
|
26
28
|
export { AuthorizationObject, Resource, BaseRequest, ResourceGetter, ContextGetter } from './types/general';
|
|
27
29
|
export { Translation, ScopedAction, ScopedActionResponseObject, ScopedActionPermit, } from './types/scoped-actions-contracts';
|
|
28
30
|
export { CustomRole, BasicRole, RoleType, RoleCreateRequest, RoleUpdateRequest, RolesResponse } from './types/roles';
|
|
31
|
+
export { AttributeAssignment, AttributeOperation, ResourceAttributeDeleteAssignment, ResourceAttributeUpsertOperation, ResourceAttributeDeleteOperation, EntityAttributeDeleteAssignment, EntityAttributeUpsertOperation, EntityAttributeDeleteOperation, ResourceAttributeAssignment as ResourceAttributeAssignmentContract, EntityAttributeAssignment as EntityAttributeAssignmentContract, } from './types/authorization-attributes-contracts';
|
|
32
|
+
export { AuthorizationAttributesService as IAuthorizationAttributesService } from './types/authorization-attributes-service.interface';
|
|
29
33
|
export { TestKit };
|
|
30
34
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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,cAAc,+BAA+B,CAAC;AAC9C,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"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,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;AACrH,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,iCAAiC,EACjC,gCAAgC,EAChC,gCAAgC,EAChC,+BAA+B,EAC/B,8BAA8B,EAC9B,8BAA8B,EAC9B,2BAA2B,IAAI,mCAAmC,EAClE,yBAAyB,IAAI,iCAAiC,GAC/D,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,8BAA8B,IAAI,+BAA+B,EAAE,MAAM,oDAAoD,CAAC;AAEvI,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -8,9 +8,12 @@ const authorizationMiddleware = require('./authorization-middleware.js');
|
|
|
8
8
|
const authorizationAttributesService = require('./authorization-attributes-service.js');
|
|
9
9
|
const resourceAttributesConstants = require('./resource-attributes-constants.js');
|
|
10
10
|
const entityAttributesConstants = require('./entity-attributes-constants.js');
|
|
11
|
+
const resourceAttributeAssignment = require('./resource-attribute-assignment.js');
|
|
12
|
+
const entityAttributeAssignment = require('./entity-attribute-assignment.js');
|
|
11
13
|
const rolesService = require('./roles-service.js');
|
|
12
14
|
const memberships = require('./memberships.js');
|
|
13
15
|
const types_roles = require('./types/roles.js');
|
|
16
|
+
const types_authorizationAttributesContracts = require('./types/authorization-attributes-contracts.js');
|
|
14
17
|
|
|
15
18
|
async function init(options = {}) {
|
|
16
19
|
if (options.prometheus) {
|
|
@@ -57,10 +60,16 @@ Object.defineProperty(exports, 'EntityType', {
|
|
|
57
60
|
enumerable: true,
|
|
58
61
|
get: () => entityAttributesConstants.EntityType
|
|
59
62
|
});
|
|
63
|
+
exports.ResourceAttributeAssignment = resourceAttributeAssignment.ResourceAttributeAssignment;
|
|
64
|
+
exports.EntityAttributeAssignment = entityAttributeAssignment.EntityAttributeAssignment;
|
|
60
65
|
exports.RolesService = rolesService.RolesService;
|
|
61
66
|
exports.MembershipsService = memberships.MembershipsService;
|
|
62
67
|
Object.defineProperty(exports, 'RoleType', {
|
|
63
68
|
enumerable: true,
|
|
64
69
|
get: () => types_roles.RoleType
|
|
65
70
|
});
|
|
71
|
+
Object.defineProperty(exports, 'AttributeOperation', {
|
|
72
|
+
enumerable: true,
|
|
73
|
+
get: () => types_authorizationAttributesContracts.AttributeOperation
|
|
74
|
+
});
|
|
66
75
|
exports.init = init;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Resource } from './general';
|
|
2
1
|
import type { EntityType } from '../entity-attributes-constants';
|
|
3
2
|
import type { ResourceType } from '../resource-attributes-constants';
|
|
4
3
|
export interface AttributeAssignment {
|
|
@@ -15,26 +14,10 @@ export interface EntityAttributeAssignment extends AttributeAssignment {
|
|
|
15
14
|
entityType: EntityType;
|
|
16
15
|
}
|
|
17
16
|
export type EntityAttributeDeleteAssignment = Omit<EntityAttributeAssignment, 'value'>;
|
|
18
|
-
export interface ResourceAttributeDelete {
|
|
19
|
-
resourceType: Resource['type'];
|
|
20
|
-
resourceId: Resource['id'];
|
|
21
|
-
key: string;
|
|
22
|
-
}
|
|
23
|
-
export interface EntityAttributeDelete {
|
|
24
|
-
entityType: EntityType;
|
|
25
|
-
entityId: number;
|
|
26
|
-
key: string;
|
|
27
|
-
}
|
|
28
17
|
export declare enum AttributeOperation {
|
|
29
18
|
UPSERT = "upsert",
|
|
30
19
|
DELETE = "delete"
|
|
31
20
|
}
|
|
32
|
-
export interface ResourceAttributeResponse {
|
|
33
|
-
attributes: ResourceAttributeAssignment[];
|
|
34
|
-
}
|
|
35
|
-
export interface EntityAttributeResponse {
|
|
36
|
-
attributes: EntityAttributeAssignment[];
|
|
37
|
-
}
|
|
38
21
|
export interface ResourceAttributeUpsertOperation extends ResourceAttributeAssignment {
|
|
39
22
|
operationType: AttributeOperation;
|
|
40
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorization-attributes-contracts.d.ts","sourceRoot":"","sources":["../../src/types/authorization-attributes-contracts.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"authorization-attributes-contracts.d.ts","sourceRoot":"","sources":["../../src/types/authorization-attributes-contracts.ts"],"names":[],"mappings":"AAAA,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;AACD,MAAM,MAAM,iCAAiC,GAAG,IAAI,CAAC,2BAA2B,EAAE,OAAO,CAAC,CAAC;AAI3F,MAAM,WAAW,yBAA0B,SAAQ,mBAAmB;IACpE,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,UAAU,CAAC;CACxB;AACD,MAAM,MAAM,+BAA+B,GAAG,IAAI,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;AAEvF,oBAAY,kBAAkB;IAC5B,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB;AACD,MAAM,WAAW,gCAAiC,SAAQ,2BAA2B;IACnF,aAAa,EAAE,kBAAkB,CAAC;CACnC;AACD,MAAM,MAAM,gCAAgC,GAAG,IAAI,CAAC,gCAAgC,EAAE,OAAO,CAAC,CAAC;AAE/F,MAAM,WAAW,8BAA+B,SAAQ,yBAAyB;IAC/E,aAAa,EAAE,kBAAkB,CAAC;CACnC;AACD,MAAM,MAAM,8BAA8B,GAAG,IAAI,CAAC,8BAA8B,EAAE,OAAO,CAAC,CAAC"}
|
|
@@ -24,15 +24,15 @@ export declare const entityDeleteAssignmentSchema: import("ajv").ValidateFunctio
|
|
|
24
24
|
entityType: any;
|
|
25
25
|
}>;
|
|
26
26
|
export declare const resourceDeleteAssignmentSchema: import("ajv").ValidateFunction<{
|
|
27
|
-
|
|
27
|
+
resourceId: any;
|
|
28
|
+
resourceType: any;
|
|
28
29
|
key: any;
|
|
29
|
-
type: any;
|
|
30
30
|
} & {
|
|
31
|
-
|
|
31
|
+
resourceId: any;
|
|
32
|
+
} & {
|
|
33
|
+
resourceType: any;
|
|
32
34
|
} & {
|
|
33
35
|
key: any;
|
|
34
|
-
} & {
|
|
35
|
-
type: any;
|
|
36
36
|
}>;
|
|
37
37
|
export declare const resourceUpsertAssignmentSchema: import("ajv").ValidateFunction<{
|
|
38
38
|
value: any;
|
|
@@ -37,7 +37,7 @@ const resourceDeleteAssignmentSchema = ajv.compile({
|
|
|
37
37
|
resourceType: { type: 'string', enum: Object.values(resourceAttributesConstants.ResourceType) },
|
|
38
38
|
key: { type: 'string', minLength: 1 },
|
|
39
39
|
},
|
|
40
|
-
required: ['
|
|
40
|
+
required: ['resourceId', 'resourceType', 'key'],
|
|
41
41
|
additionalProperties: false,
|
|
42
42
|
});
|
|
43
43
|
const resourceUpsertAssignmentSchema = ajv.compile({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mondaydotcomorg/monday-authorization",
|
|
3
|
-
"version": "3.6.0-feat-shaime-support-entity-attributes-3-
|
|
3
|
+
"version": "3.6.0-feat-shaime-support-entity-attributes-3-31fcbe3",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"license": "BSD-3-Clause",
|
package/src/index.ts
CHANGED
|
@@ -58,8 +58,10 @@ export {
|
|
|
58
58
|
} from './authorization-middleware';
|
|
59
59
|
export { AuthorizationService, AuthorizeResponse } from './authorization-service';
|
|
60
60
|
export { AuthorizationAttributesService } from './authorization-attributes-service';
|
|
61
|
-
export * from 'resource-attributes-constants';
|
|
61
|
+
export * from './resource-attributes-constants';
|
|
62
62
|
export * from './entity-attributes-constants';
|
|
63
|
+
export { ResourceAttributeAssignment } from './resource-attribute-assignment';
|
|
64
|
+
export { EntityAttributeAssignment } from './entity-attribute-assignment';
|
|
63
65
|
export { RolesService } from './roles-service';
|
|
64
66
|
export { MembershipsService } from './memberships';
|
|
65
67
|
export { AuthorizationObject, Resource, BaseRequest, ResourceGetter, ContextGetter } from './types/general';
|
|
@@ -70,5 +72,18 @@ export {
|
|
|
70
72
|
ScopedActionPermit,
|
|
71
73
|
} from './types/scoped-actions-contracts';
|
|
72
74
|
export { CustomRole, BasicRole, RoleType, RoleCreateRequest, RoleUpdateRequest, RolesResponse } from './types/roles';
|
|
75
|
+
export {
|
|
76
|
+
AttributeAssignment,
|
|
77
|
+
AttributeOperation,
|
|
78
|
+
ResourceAttributeDeleteAssignment,
|
|
79
|
+
ResourceAttributeUpsertOperation,
|
|
80
|
+
ResourceAttributeDeleteOperation,
|
|
81
|
+
EntityAttributeDeleteAssignment,
|
|
82
|
+
EntityAttributeUpsertOperation,
|
|
83
|
+
EntityAttributeDeleteOperation,
|
|
84
|
+
ResourceAttributeAssignment as ResourceAttributeAssignmentContract,
|
|
85
|
+
EntityAttributeAssignment as EntityAttributeAssignmentContract,
|
|
86
|
+
} from './types/authorization-attributes-contracts';
|
|
87
|
+
export { AuthorizationAttributesService as IAuthorizationAttributesService } from './types/authorization-attributes-service.interface';
|
|
73
88
|
|
|
74
89
|
export { TestKit };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Resource } from './general';
|
|
2
1
|
import type { EntityType } from '../entity-attributes-constants';
|
|
3
2
|
import type { ResourceType } from '../resource-attributes-constants';
|
|
4
3
|
|
|
@@ -22,33 +21,10 @@ export interface EntityAttributeAssignment extends AttributeAssignment {
|
|
|
22
21
|
}
|
|
23
22
|
export type EntityAttributeDeleteAssignment = Omit<EntityAttributeAssignment, 'value'>;
|
|
24
23
|
|
|
25
|
-
// Legacy types for backward compatibility
|
|
26
|
-
export interface ResourceAttributeDelete {
|
|
27
|
-
resourceType: Resource['type'];
|
|
28
|
-
resourceId: Resource['id'];
|
|
29
|
-
key: string;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface EntityAttributeDelete {
|
|
33
|
-
entityType: EntityType;
|
|
34
|
-
entityId: number;
|
|
35
|
-
key: string;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
24
|
export enum AttributeOperation {
|
|
39
25
|
UPSERT = 'upsert',
|
|
40
26
|
DELETE = 'delete',
|
|
41
27
|
}
|
|
42
|
-
|
|
43
|
-
// Response types
|
|
44
|
-
export interface ResourceAttributeResponse {
|
|
45
|
-
attributes: ResourceAttributeAssignment[];
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export interface EntityAttributeResponse {
|
|
49
|
-
attributes: EntityAttributeAssignment[];
|
|
50
|
-
}
|
|
51
|
-
|
|
52
28
|
export interface ResourceAttributeUpsertOperation extends ResourceAttributeAssignment {
|
|
53
29
|
operationType: AttributeOperation;
|
|
54
30
|
}
|
|
@@ -34,7 +34,7 @@ export const resourceDeleteAssignmentSchema = ajv.compile({
|
|
|
34
34
|
resourceType: { type: 'string', enum: Object.values(ResourceType) },
|
|
35
35
|
key: { type: 'string', minLength: 1 },
|
|
36
36
|
},
|
|
37
|
-
required: ['
|
|
37
|
+
required: ['resourceId', 'resourceType', 'key'],
|
|
38
38
|
additionalProperties: false,
|
|
39
39
|
});
|
|
40
40
|
|