@or-sdk/permissions-lambda 2.1.1-beta.4019.0 → 2.1.1-beta.4045.0
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.
|
@@ -1,20 +1,113 @@
|
|
|
1
1
|
import { AllPermissionsResponse, AvailablePermissionsResponse, ApiTokenPermissionsResponse, BulkApiTokenPermissionsResponse, GetAllPayload, GetApiTokenPayload, GetBulkApiTokenPayload, GetByAccountUserPayload, GetByServicePayload, LambdaConfig, Permission, PermissionsByServiceResponse, RegisterServiceDto, SetApiTokenPermissionsPayload, UpdateEntityDto, UserPermissionsResponse } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Client for interacting with the Permissions Lambda function
|
|
4
|
+
* ## Installation:
|
|
5
|
+
* ```
|
|
6
|
+
* $ npm i @or-sdk/permissions-lambda
|
|
7
|
+
* ```
|
|
8
|
+
*/
|
|
2
9
|
export declare class PermissionsLambda {
|
|
10
|
+
/**
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import { PermissionsLambda } from '@or-sdk/permissions-lambda'
|
|
13
|
+
* const permissionsLambda = new PermissionsLambda({
|
|
14
|
+
* isLocal: false,
|
|
15
|
+
* functionName: permissions-core-function-name
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
3
19
|
private readonly lambda;
|
|
4
20
|
private readonly functionName;
|
|
5
21
|
constructor(params: LambdaConfig);
|
|
6
22
|
private invoke;
|
|
23
|
+
/**
|
|
24
|
+
* Registers a new service with its permissions
|
|
25
|
+
* @param {RegisterServiceParams} data - Service registration data
|
|
26
|
+
* @param {string} data.service - Service identifier
|
|
27
|
+
* @param {string} data.serviceLabel - Human-readable service name
|
|
28
|
+
* @param {Permission[]} data.permissions - List of permissions to register
|
|
29
|
+
* @returns {Promise<Permission[]>} Registered permissions
|
|
30
|
+
*/
|
|
7
31
|
registerService(data: RegisterServiceDto): Promise<Permission[]>;
|
|
32
|
+
/**
|
|
33
|
+
* Gets all available permissions across all services
|
|
34
|
+
* @returns {Promise<AvailablePermissionsResponse>} List of services with their available permissions
|
|
35
|
+
*/
|
|
8
36
|
getAllAvailablePermissions(): Promise<AvailablePermissionsResponse>;
|
|
37
|
+
/**
|
|
38
|
+
* Gets user permissions for a specific service
|
|
39
|
+
* @param {GetUserPermissionsParams} data - Request parameters
|
|
40
|
+
* @param {string} data.multiUserId - Multi-user identifier
|
|
41
|
+
* @param {string} data.userId - Single-user identifier
|
|
42
|
+
* @param {string} data.service - Service identifier
|
|
43
|
+
* @returns {Promise<GetPermissionByServiceResponse>} Map of permission names to their effects
|
|
44
|
+
*/
|
|
9
45
|
getByService(data: GetByServicePayload): Promise<PermissionsByServiceResponse>;
|
|
46
|
+
/**
|
|
47
|
+
* Gets all permissions for a user across all services
|
|
48
|
+
* @param {GetAllUserPermissionsParams} data - Request parameters
|
|
49
|
+
* @param {string} data.multiUserId - Multi-user identifier
|
|
50
|
+
* @param {string} data.userId - Single-user identifier, optional (will return only multi user level if not present)
|
|
51
|
+
* @returns {Promise<GetAllPermissionsResponse>} List of services with their permissions
|
|
52
|
+
*/
|
|
10
53
|
getAll(data: GetAllPayload): Promise<AllPermissionsResponse>;
|
|
54
|
+
/**
|
|
55
|
+
* Gets permissions for a specific user within an account
|
|
56
|
+
* @param {UserPermissionByAccountParams} data - Request parameters
|
|
57
|
+
* @param {string} data.userId - User identifier
|
|
58
|
+
* @param {string} data.accountId - Account identifier
|
|
59
|
+
* @returns {Promise<UserPermissionsResponse>} List of services with detailed permissions
|
|
60
|
+
*/
|
|
11
61
|
getByUserIdAndAccount(data: GetByAccountUserPayload): Promise<UserPermissionsResponse>;
|
|
62
|
+
/**
|
|
63
|
+
* Updates permissions for a SingleUser
|
|
64
|
+
* @param {UpdateEntityDto} data - Update parameters
|
|
65
|
+
* @param {string} data.userId - Single User Id
|
|
66
|
+
* @param {Object} data.permissions - Map of service names to permission overrides
|
|
67
|
+
* @returns {Promise<AllPermissionsResponse>}
|
|
68
|
+
*/
|
|
12
69
|
updateSingleUser(data: UpdateEntityDto): Promise<AllPermissionsResponse>;
|
|
70
|
+
/**
|
|
71
|
+
* Updates permissions for a MultiUser
|
|
72
|
+
* @param {UpdateEntityDto} data - Update parameters
|
|
73
|
+
* @param {string} data.userId - Multi User Id
|
|
74
|
+
* @param {Object} data.permissions - Map of service names to permission overrides
|
|
75
|
+
* @returns {Promise<AllPermissionsResponse>}
|
|
76
|
+
*/
|
|
13
77
|
updateMultiUser(data: UpdateEntityDto): Promise<AllPermissionsResponse>;
|
|
78
|
+
/**
|
|
79
|
+
* Checks if user has the specified permission scopes
|
|
80
|
+
* @param {string[]} scope - List of permission scopes to check
|
|
81
|
+
* @returns {Promise<boolean>} True if user has all specified scopes, false otherwise
|
|
82
|
+
*/
|
|
14
83
|
checkScope(scope: string[]): Promise<boolean>;
|
|
84
|
+
/**
|
|
85
|
+
* Gets all permissions for an API token
|
|
86
|
+
* @param {GetApiTokenPayload} data - Request parameters
|
|
87
|
+
* @param {string} data.tokenId - API Token identifier
|
|
88
|
+
* @returns {Promise<ApiTokenPermissionsResponse>} List of services with their permissions
|
|
89
|
+
*/
|
|
15
90
|
getApiTokenPermissions(data: GetApiTokenPayload): Promise<ApiTokenPermissionsResponse>;
|
|
91
|
+
/**
|
|
92
|
+
* Gets permissions for multiple API tokens
|
|
93
|
+
* @param {GetBulkApiTokenPayload} data - Request parameters
|
|
94
|
+
* @param {string[]} data.tokenIds - List of API Token identifiers
|
|
95
|
+
* @returns {Promise<BulkApiTokenPermissionsResponse>} Map of token IDs to their permissions
|
|
96
|
+
*/
|
|
16
97
|
getBulkApiTokenPermissions(data: GetBulkApiTokenPayload): Promise<BulkApiTokenPermissionsResponse>;
|
|
98
|
+
/**
|
|
99
|
+
* Sets permissions for an API token
|
|
100
|
+
* @param {SetApiTokenPermissionsPayload} data - Update parameters
|
|
101
|
+
* @param {string} data.tokenId - API Token identifier
|
|
102
|
+
* @param {Object} data.permissions - Map of service names to permission overrides
|
|
103
|
+
* @returns {Promise<ApiTokenPermissionsResponse>} Updated permissions
|
|
104
|
+
*/
|
|
17
105
|
setApiTokenPermissions(data: SetApiTokenPermissionsPayload): Promise<ApiTokenPermissionsResponse>;
|
|
106
|
+
/**
|
|
107
|
+
* Deletes all permissions for an API token
|
|
108
|
+
* @param {string} tokenId - API Token identifier
|
|
109
|
+
* @returns {Promise<{ success: boolean }>}
|
|
110
|
+
*/
|
|
18
111
|
deleteApiTokenPermissions(tokenId: string): Promise<{
|
|
19
112
|
success: boolean;
|
|
20
113
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PermissionsLambda.d.ts","sourceRoot":"","sources":["../../src/PermissionsLambda.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC5B,2BAA2B,EAC3B,+BAA+B,EAC/B,aAAa,EACb,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,mBAAmB,EACnB,YAAY,EAEZ,UAAU,EACV,4BAA4B,EAC5B,kBAAkB,EAClB,6BAA6B,EAC7B,eAAe,EACf,uBAAuB,EACxB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"PermissionsLambda.d.ts","sourceRoot":"","sources":["../../src/PermissionsLambda.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC5B,2BAA2B,EAC3B,+BAA+B,EAC/B,aAAa,EACb,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,mBAAmB,EACnB,YAAY,EAEZ,UAAU,EACV,4BAA4B,EAC5B,kBAAkB,EAClB,6BAA6B,EAC7B,eAAe,EACf,uBAAuB,EACxB,MAAM,SAAS,CAAC;AAEjB;;;;;;GAMG;AACH,qBAAa,iBAAiB;IAC5B;;;;;;;;OAQG;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;gBAE1B,MAAM,EAAE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