@mondaydotcomorg/monday-authorization 3.0.0-feature-bashanye-create-custom-roles-sdk.9c70903 → 3.0.0-feature-bashanye-create-custom-roles-sdk.b34d2d3
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/roles.d.ts +1 -1
- package/dist/esm/roles.d.ts.map +1 -1
- package/dist/esm/roles.mjs +5 -6
- package/dist/roles.d.ts +1 -1
- package/dist/roles.d.ts.map +1 -1
- package/dist/roles.js +5 -6
- package/package.json +1 -1
package/dist/esm/roles.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export declare class CustomRoles {
|
|
|
14
14
|
/**
|
|
15
15
|
* Get all roles for an account
|
|
16
16
|
* @param accountId - The account ID
|
|
17
|
-
* @returns - The roles for the account, both basic and custom roles. Note that role ids are in A style and not B style.
|
|
17
|
+
* @returns - The roles for the account, both basic and custom roles. Note that basic role ids are returned in A style and not B style.
|
|
18
18
|
*/
|
|
19
19
|
getRoles(accountId: number, resourceTypes: string[]): Promise<RolesResponse>;
|
|
20
20
|
createCustomRole(accountId: number, roles: CustomRole[]): Promise<RolesResponse>;
|
package/dist/esm/roles.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../src/roles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,aAAa,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,EAAoB,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAEvF,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAMpE,qBAAa,WAAW;IACtB,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,YAAY,CAAkC;IACtD,OAAO,CAAC,kBAAkB,CAA4B;IAEtD;;;;OAIG;gBACS,UAAU,CAAC,EAAE,UAAU,EAAE,YAAY,CAAC,EAAE,gBAAg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,aAAa,CAAC;IAM9E,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,aAAa,CAAC;YAMjF,eAAe;CA2B9B"}
|
package/dist/esm/roles.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { ERROR_MESSAGES, DEFAULT_FETCH_OPTIONS, APP_NAME } from './constants.mjs
|
|
|
4
4
|
import { getAttributionsFromApi } from './attributions-service.mjs';
|
|
5
5
|
|
|
6
6
|
const API_PATH = '/roles/account/{accountId}';
|
|
7
|
-
const
|
|
7
|
+
const A_STYLE_NAME = 'A';
|
|
8
8
|
class CustomRoles {
|
|
9
9
|
httpClient;
|
|
10
10
|
fetchOptions;
|
|
@@ -37,10 +37,10 @@ class CustomRoles {
|
|
|
37
37
|
/**
|
|
38
38
|
* Get all roles for an account
|
|
39
39
|
* @param accountId - The account ID
|
|
40
|
-
* @returns - The roles for the account, both basic and custom roles. Note that role ids are in A style and not B style.
|
|
40
|
+
* @returns - The roles for the account, both basic and custom roles. Note that basic role ids are returned in A style and not B style.
|
|
41
41
|
*/
|
|
42
42
|
async getRoles(accountId, resourceTypes) {
|
|
43
|
-
return await this.sendRoleRequest('GET', accountId, {
|
|
43
|
+
return await this.sendRoleRequest('GET', accountId, { resourceTypes: resourceTypes.join(',') });
|
|
44
44
|
}
|
|
45
45
|
async createCustomRole(accountId, roles) {
|
|
46
46
|
if (roles.length === 0) {
|
|
@@ -69,7 +69,7 @@ class CustomRoles {
|
|
|
69
69
|
customRoles: updateRequests,
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
-
async sendRoleRequest(method, accountId, body
|
|
72
|
+
async sendRoleRequest(method, accountId, body) {
|
|
73
73
|
try {
|
|
74
74
|
return await this.httpClient.fetch({
|
|
75
75
|
url: {
|
|
@@ -77,8 +77,7 @@ class CustomRoles {
|
|
|
77
77
|
path: API_PATH.replace('{accountId}', accountId.toString()),
|
|
78
78
|
},
|
|
79
79
|
query: {
|
|
80
|
-
style:
|
|
81
|
-
...additionalQueryParams,
|
|
80
|
+
style: A_STYLE_NAME,
|
|
82
81
|
},
|
|
83
82
|
method,
|
|
84
83
|
headers: {
|
package/dist/roles.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export declare class CustomRoles {
|
|
|
14
14
|
/**
|
|
15
15
|
* Get all roles for an account
|
|
16
16
|
* @param accountId - The account ID
|
|
17
|
-
* @returns - The roles for the account, both basic and custom roles. Note that role ids are in A style and not B style.
|
|
17
|
+
* @returns - The roles for the account, both basic and custom roles. Note that basic role ids are returned in A style and not B style.
|
|
18
18
|
*/
|
|
19
19
|
getRoles(accountId: number, resourceTypes: string[]): Promise<RolesResponse>;
|
|
20
20
|
createCustomRole(accountId: number, roles: CustomRole[]): Promise<RolesResponse>;
|
package/dist/roles.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../src/roles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,aAAa,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,EAAoB,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAEvF,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAMpE,qBAAa,WAAW;IACtB,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,YAAY,CAAkC;IACtD,OAAO,CAAC,kBAAkB,CAA4B;IAEtD;;;;OAIG;gBACS,UAAU,CAAC,EAAE,UAAU,EAAE,YAAY,CAAC,EAAE,gBAAgB,CAAC,aAAa,CAAC;IAqBnF;;;;OAIG;IACG,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,aAAa,CAAC;IAI5E,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,aAAa,CAAC;IAkBhF,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,aAAa,CAAC;IAM9E,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,aAAa,CAAC;YAMjF,eAAe;
|
|
1
|
+
{"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../src/roles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,aAAa,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,EAAoB,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAEvF,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAMpE,qBAAa,WAAW;IACtB,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,YAAY,CAAkC;IACtD,OAAO,CAAC,kBAAkB,CAA4B;IAEtD;;;;OAIG;gBACS,UAAU,CAAC,EAAE,UAAU,EAAE,YAAY,CAAC,EAAE,gBAAgB,CAAC,aAAa,CAAC;IAqBnF;;;;OAIG;IACG,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,aAAa,CAAC;IAI5E,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,aAAa,CAAC;IAkBhF,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,aAAa,CAAC;IAM9E,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,aAAa,CAAC;YAMjF,eAAe;CA2B9B"}
|
package/dist/roles.js
CHANGED
|
@@ -6,7 +6,7 @@ const constants = require('./constants.js');
|
|
|
6
6
|
const attributionsService = require('./attributions-service.js');
|
|
7
7
|
|
|
8
8
|
const API_PATH = '/roles/account/{accountId}';
|
|
9
|
-
const
|
|
9
|
+
const A_STYLE_NAME = 'A';
|
|
10
10
|
class CustomRoles {
|
|
11
11
|
httpClient;
|
|
12
12
|
fetchOptions;
|
|
@@ -39,10 +39,10 @@ class CustomRoles {
|
|
|
39
39
|
/**
|
|
40
40
|
* Get all roles for an account
|
|
41
41
|
* @param accountId - The account ID
|
|
42
|
-
* @returns - The roles for the account, both basic and custom roles. Note that role ids are in A style and not B style.
|
|
42
|
+
* @returns - The roles for the account, both basic and custom roles. Note that basic role ids are returned in A style and not B style.
|
|
43
43
|
*/
|
|
44
44
|
async getRoles(accountId, resourceTypes) {
|
|
45
|
-
return await this.sendRoleRequest('GET', accountId, {
|
|
45
|
+
return await this.sendRoleRequest('GET', accountId, { resourceTypes: resourceTypes.join(',') });
|
|
46
46
|
}
|
|
47
47
|
async createCustomRole(accountId, roles) {
|
|
48
48
|
if (roles.length === 0) {
|
|
@@ -71,7 +71,7 @@ class CustomRoles {
|
|
|
71
71
|
customRoles: updateRequests,
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
|
-
async sendRoleRequest(method, accountId, body
|
|
74
|
+
async sendRoleRequest(method, accountId, body) {
|
|
75
75
|
try {
|
|
76
76
|
return await this.httpClient.fetch({
|
|
77
77
|
url: {
|
|
@@ -79,8 +79,7 @@ class CustomRoles {
|
|
|
79
79
|
path: API_PATH.replace('{accountId}', accountId.toString()),
|
|
80
80
|
},
|
|
81
81
|
query: {
|
|
82
|
-
style:
|
|
83
|
-
...additionalQueryParams,
|
|
82
|
+
style: A_STYLE_NAME,
|
|
84
83
|
},
|
|
85
84
|
method,
|
|
86
85
|
headers: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mondaydotcomorg/monday-authorization",
|
|
3
|
-
"version": "3.0.0-feature-bashanye-create-custom-roles-sdk.
|
|
3
|
+
"version": "3.0.0-feature-bashanye-create-custom-roles-sdk.b34d2d3",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"license": "BSD-3-Clause",
|