@mondaydotcomorg/monday-authorization 3.4.0-feature-bashanye-add-membership-create-delete-api-9ba3b16 → 3.4.0-feature-bashanye-add-membership-create-delete-api-234505c

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/README.md CHANGED
@@ -47,8 +47,8 @@ startServer(...)
47
47
 
48
48
  - `prometheus` (optional) enables the legacy Prometheus summary `authorization_check_response_time` with labels `resourceType`, `action`, `isAuthorized`, and `responseStatus`.
49
49
  - `metrics` (optional) enables StatsD emission through `@mondaydotcomorg/monday-observability-kit` with:
50
- - `authorization.authorizationCheck.platform.duration` / `.graph.duration` (distributions per API path)
51
- - `authorization.authorizationCheck.platform.error` / `.graph.error` counters (with `statusCode` tag)
50
+ - `authorization.authorizationCheck.platform.<API>.duration` / `.graph.<API>.duration` (distributions per API path)
51
+ - `authorization.authorizationCheck.platform.<API>.error` / `.graph.<API>.error` counters (with `statusCode` tag)
52
52
  - When `metrics.disabled` is omitted, the SDK automatically disables StatsD in `test`/`development` environments.
53
53
  - StatsD requires `DOGSTATSD_HOST` / `DOGSTATSD_PORT` (or the defaults `localhost:8125`). Errors are logged and skipped if the client is unavailable.
54
54
 
@@ -6,7 +6,7 @@ export declare class MembershipsService {
6
6
  private httpClient;
7
7
  private fetchOptions;
8
8
  /**
9
- * Public constructor to create the AuthorizationAttributesService instance.
9
+ * Public constructor to create the MembershipsService instance.
10
10
  * @param httpClient The HTTP client to use for API requests, if not provided, the default HTTP client from Api will be used.
11
11
  * @param fetchOptions The fetch options to use for API requests, if not provided, the default fetch options will be used.
12
12
  */
@@ -21,9 +21,8 @@ export declare class MembershipsService {
21
21
  /**
22
22
  * Delete memberships synchronously, performing http call to the authorization MS to delete the given memberships.
23
23
  * @param accountId
24
- * @param resource - The resource (resourceType, resourceId) to delete the attributes for.
25
- * @param attributeKeys - Array of attribute keys to delete for the resource.
26
- * @returns ResourceAttributeResponse - The affected (deleted) resource attributes assignments in the `attributes` field.
24
+ * @param memberships - Array of memberships to delete.
25
+ * @returns MembershipDeleteResponse - The affected (deleted) memberships.
27
26
  */
28
27
  deleteMemberships(accountId: number, memberships: MembershipForDelete[]): Promise<MembershipDeleteResponse>;
29
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"memberships.d.ts","sourceRoot":"","sources":["../../src/memberships.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,aAAa,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAM3B,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,MAAM,CAAC,SAAS,CAGb;IACX,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,YAAY,CAAkC;IAEtD;;;;OAIG;gBACS,UAAU,CAAC,EAAE,UAAU,EAAE,YAAY,CAAC,EAAE,gBAAgB,CAAC,aAAa,CAAC;IAoBnF;;;;;OAKG;IACG,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,wBAAwB,CAAC;IA0BjH;;;;;;OAMG;IACG,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,wBAAwB,CAAC;CAyBlH"}
1
+ {"version":3,"file":"memberships.d.ts","sourceRoot":"","sources":["../../src/memberships.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,aAAa,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAM3B,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,MAAM,CAAC,SAAS,CAGb;IACX,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,YAAY,CAAkC;IAEtD;;;;OAIG;gBACS,UAAU,CAAC,EAAE,UAAU,EAAE,YAAY,CAAC,EAAE,gBAAgB,CAAC,aAAa,CAAC;IAoBnF;;;;;OAKG;IACG,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,wBAAwB,CAAC;IA0BjH;;;;;OAKG;IACG,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,wBAAwB,CAAC;CAyBlH"}
@@ -5,13 +5,13 @@ import { ERROR_MESSAGES, DEFAULT_FETCH_OPTIONS, APP_NAME } from './constants.mjs
5
5
 
6
6
  class MembershipsService {
7
7
  static API_PATHS = {
8
- UPSERT_RESOURCE_ATTRIBUTES: '/memberships/{accountId}',
9
- DELETE_RESOURCE_ATTRIBUTES: '/memberships/{accountId}',
8
+ UPSERT_MEMBERSHIPS: '/memberships/account/{accountId}',
9
+ DELETE_MEMBERSHIPS: '/memberships/account/{accountId}',
10
10
  };
11
11
  httpClient;
12
12
  fetchOptions;
13
13
  /**
14
- * Public constructor to create the AuthorizationAttributesService instance.
14
+ * Public constructor to create the MembershipsService instance.
15
15
  * @param httpClient The HTTP client to use for API requests, if not provided, the default HTTP client from Api will be used.
16
16
  * @param fetchOptions The fetch options to use for API requests, if not provided, the default fetch options will be used.
17
17
  */
@@ -46,7 +46,7 @@ class MembershipsService {
46
46
  return await this.httpClient.fetch({
47
47
  url: {
48
48
  appName: APP_NAME,
49
- path: MembershipsService.API_PATHS.UPSERT_RESOURCE_ATTRIBUTES.replace('{accountId}', accountId.toString()),
49
+ path: MembershipsService.API_PATHS.UPSERT_MEMBERSHIPS.replace('{accountId}', accountId.toString()),
50
50
  },
51
51
  method: 'PUT',
52
52
  query: {
@@ -66,9 +66,8 @@ class MembershipsService {
66
66
  /**
67
67
  * Delete memberships synchronously, performing http call to the authorization MS to delete the given memberships.
68
68
  * @param accountId
69
- * @param resource - The resource (resourceType, resourceId) to delete the attributes for.
70
- * @param attributeKeys - Array of attribute keys to delete for the resource.
71
- * @returns ResourceAttributeResponse - The affected (deleted) resource attributes assignments in the `attributes` field.
69
+ * @param memberships - Array of memberships to delete.
70
+ * @returns MembershipDeleteResponse - The affected (deleted) memberships.
72
71
  */
73
72
  async deleteMemberships(accountId, memberships) {
74
73
  const attributionHeaders = getAttributionsFromApi();
@@ -76,7 +75,7 @@ class MembershipsService {
76
75
  return await this.httpClient.fetch({
77
76
  url: {
78
77
  appName: APP_NAME,
79
- path: MembershipsService.API_PATHS.DELETE_RESOURCE_ATTRIBUTES.replace('{accountId}', accountId.toString()),
78
+ path: MembershipsService.API_PATHS.DELETE_MEMBERSHIPS.replace('{accountId}', accountId.toString()),
80
79
  },
81
80
  method: 'DELETE',
82
81
  query: {
@@ -10,7 +10,7 @@ export interface MembershipForCreate {
10
10
  export interface MembershipForDelete {
11
11
  entityId?: number;
12
12
  entityType: string;
13
- resourceId?: number;
13
+ resourceId: number;
14
14
  resourceType: string;
15
15
  }
16
16
  export interface Membership {
@@ -1 +1 @@
1
- {"version":3,"file":"memberships.d.ts","sourceRoot":"","sources":["../../../src/types/memberships.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MA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,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,IAAI,GAAG,MAAM,GAAG,SAAS,CAAC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IACpC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACvC;AAED,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,uBAAuB;IACtC,WAAW,EAAE,mBAAmB,EAAE,CAAC;CACpC;AAED,MAAM,WAAW,uBAAuB;IACtC,WAAW,EAAE,mBAAmB,EAAE,CAAC;CACpC"}
@@ -6,7 +6,7 @@ export declare class MembershipsService {
6
6
  private httpClient;
7
7
  private fetchOptions;
8
8
  /**
9
- * Public constructor to create the AuthorizationAttributesService instance.
9
+ * Public constructor to create the MembershipsService instance.
10
10
  * @param httpClient The HTTP client to use for API requests, if not provided, the default HTTP client from Api will be used.
11
11
  * @param fetchOptions The fetch options to use for API requests, if not provided, the default fetch options will be used.
12
12
  */
@@ -21,9 +21,8 @@ export declare class MembershipsService {
21
21
  /**
22
22
  * Delete memberships synchronously, performing http call to the authorization MS to delete the given memberships.
23
23
  * @param accountId
24
- * @param resource - The resource (resourceType, resourceId) to delete the attributes for.
25
- * @param attributeKeys - Array of attribute keys to delete for the resource.
26
- * @returns ResourceAttributeResponse - The affected (deleted) resource attributes assignments in the `attributes` field.
24
+ * @param memberships - Array of memberships to delete.
25
+ * @returns MembershipDeleteResponse - The affected (deleted) memberships.
27
26
  */
28
27
  deleteMemberships(accountId: number, memberships: MembershipForDelete[]): Promise<MembershipDeleteResponse>;
29
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"memberships.d.ts","sourceRoot":"","sources":["../src/memberships.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,aAAa,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAM3B,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,MAAM,CAAC,SAAS,CAGb;IACX,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,YAAY,CAAkC;IAEtD;;;;OAIG;gBACS,UAAU,CAAC,EAAE,UAAU,EAAE,YAAY,CAAC,EAAE,gBAAgB,CAAC,aAAa,CAAC;IAoBnF;;;;;OAKG;IACG,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,wBAAwB,CAAC;IA0BjH;;;;;;OAMG;IACG,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,wBAAwB,CAAC;CAyBlH"}
1
+ {"version":3,"file":"memberships.d.ts","sourceRoot":"","sources":["../src/memberships.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,aAAa,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAM3B,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,MAAM,CAAC,SAAS,CAGb;IACX,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,YAAY,CAAkC;IAEtD;;;;OAIG;gBACS,UAAU,CAAC,EAAE,UAAU,EAAE,YAAY,CAAC,EAAE,gBAAgB,CAAC,aAAa,CAAC;IAoBnF;;;;;OAKG;IACG,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,wBAAwB,CAAC;IA0BjH;;;;;OAKG;IACG,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,wBAAwB,CAAC;CAyBlH"}
@@ -7,13 +7,13 @@ const constants = require('./constants.js');
7
7
 
8
8
  class MembershipsService {
9
9
  static API_PATHS = {
10
- UPSERT_RESOURCE_ATTRIBUTES: '/memberships/{accountId}',
11
- DELETE_RESOURCE_ATTRIBUTES: '/memberships/{accountId}',
10
+ UPSERT_MEMBERSHIPS: '/memberships/account/{accountId}',
11
+ DELETE_MEMBERSHIPS: '/memberships/account/{accountId}',
12
12
  };
13
13
  httpClient;
14
14
  fetchOptions;
15
15
  /**
16
- * Public constructor to create the AuthorizationAttributesService instance.
16
+ * Public constructor to create the MembershipsService instance.
17
17
  * @param httpClient The HTTP client to use for API requests, if not provided, the default HTTP client from Api will be used.
18
18
  * @param fetchOptions The fetch options to use for API requests, if not provided, the default fetch options will be used.
19
19
  */
@@ -48,7 +48,7 @@ class MembershipsService {
48
48
  return await this.httpClient.fetch({
49
49
  url: {
50
50
  appName: constants.APP_NAME,
51
- path: MembershipsService.API_PATHS.UPSERT_RESOURCE_ATTRIBUTES.replace('{accountId}', accountId.toString()),
51
+ path: MembershipsService.API_PATHS.UPSERT_MEMBERSHIPS.replace('{accountId}', accountId.toString()),
52
52
  },
53
53
  method: 'PUT',
54
54
  query: {
@@ -68,9 +68,8 @@ class MembershipsService {
68
68
  /**
69
69
  * Delete memberships synchronously, performing http call to the authorization MS to delete the given memberships.
70
70
  * @param accountId
71
- * @param resource - The resource (resourceType, resourceId) to delete the attributes for.
72
- * @param attributeKeys - Array of attribute keys to delete for the resource.
73
- * @returns ResourceAttributeResponse - The affected (deleted) resource attributes assignments in the `attributes` field.
71
+ * @param memberships - Array of memberships to delete.
72
+ * @returns MembershipDeleteResponse - The affected (deleted) memberships.
74
73
  */
75
74
  async deleteMemberships(accountId, memberships) {
76
75
  const attributionHeaders = attributionsService.getAttributionsFromApi();
@@ -78,7 +77,7 @@ class MembershipsService {
78
77
  return await this.httpClient.fetch({
79
78
  url: {
80
79
  appName: constants.APP_NAME,
81
- path: MembershipsService.API_PATHS.DELETE_RESOURCE_ATTRIBUTES.replace('{accountId}', accountId.toString()),
80
+ path: MembershipsService.API_PATHS.DELETE_MEMBERSHIPS.replace('{accountId}', accountId.toString()),
82
81
  },
83
82
  method: 'DELETE',
84
83
  query: {
@@ -10,7 +10,7 @@ export interface MembershipForCreate {
10
10
  export interface MembershipForDelete {
11
11
  entityId?: number;
12
12
  entityType: string;
13
- resourceId?: number;
13
+ resourceId: number;
14
14
  resourceType: string;
15
15
  }
16
16
  export interface Membership {
@@ -1 +1 @@
1
- {"version":3,"file":"memberships.d.ts","sourceRoot":"","sources":["../../src/types/memberships.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,EA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CACtB;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,IAAI,GAAG,MAAM,GAAG,SAAS,CAAC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IACpC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACvC;AAED,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,uBAAuB;IACtC,WAAW,EAAE,mBAAmB,EAAE,CAAC;CACpC;AAED,MAAM,WAAW,uBAAuB;IACtC,WAAW,EAAE,mBAAmB,EAAE,CAAC;CACpC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mondaydotcomorg/monday-authorization",
3
- "version": "3.4.0-feature-bashanye-add-membership-create-delete-api-9ba3b16",
3
+ "version": "3.4.0-feature-bashanye-add-membership-create-delete-api-234505c",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "license": "BSD-3-Clause",
@@ -13,14 +13,14 @@ import { APP_NAME, DEFAULT_FETCH_OPTIONS, ERROR_MESSAGES } from './constants';
13
13
 
14
14
  export class MembershipsService {
15
15
  private static API_PATHS = {
16
- UPSERT_RESOURCE_ATTRIBUTES: '/memberships/{accountId}',
17
- DELETE_RESOURCE_ATTRIBUTES: '/memberships/{accountId}',
16
+ UPSERT_MEMBERSHIPS: '/memberships/account/{accountId}',
17
+ DELETE_MEMBERSHIPS: '/memberships/account/{accountId}',
18
18
  } as const;
19
19
  private httpClient: HttpClient;
20
20
  private fetchOptions: RecursivePartial<FetcherConfig>;
21
21
 
22
22
  /**
23
- * Public constructor to create the AuthorizationAttributesService instance.
23
+ * Public constructor to create the MembershipsService instance.
24
24
  * @param httpClient The HTTP client to use for API requests, if not provided, the default HTTP client from Api will be used.
25
25
  * @param fetchOptions The fetch options to use for API requests, if not provided, the default fetch options will be used.
26
26
  */
@@ -57,7 +57,7 @@ export class MembershipsService {
57
57
  {
58
58
  url: {
59
59
  appName: APP_NAME,
60
- path: MembershipsService.API_PATHS.UPSERT_RESOURCE_ATTRIBUTES.replace('{accountId}', accountId.toString()),
60
+ path: MembershipsService.API_PATHS.UPSERT_MEMBERSHIPS.replace('{accountId}', accountId.toString()),
61
61
  },
62
62
  method: 'PUT',
63
63
  query: {
@@ -79,9 +79,8 @@ export class MembershipsService {
79
79
  /**
80
80
  * Delete memberships synchronously, performing http call to the authorization MS to delete the given memberships.
81
81
  * @param accountId
82
- * @param resource - The resource (resourceType, resourceId) to delete the attributes for.
83
- * @param attributeKeys - Array of attribute keys to delete for the resource.
84
- * @returns ResourceAttributeResponse - The affected (deleted) resource attributes assignments in the `attributes` field.
82
+ * @param memberships - Array of memberships to delete.
83
+ * @returns MembershipDeleteResponse - The affected (deleted) memberships.
85
84
  */
86
85
  async deleteMemberships(accountId: number, memberships: MembershipForDelete[]): Promise<MembershipDeleteResponse> {
87
86
  const attributionHeaders = getAttributionsFromApi();
@@ -90,7 +89,7 @@ export class MembershipsService {
90
89
  {
91
90
  url: {
92
91
  appName: APP_NAME,
93
- path: MembershipsService.API_PATHS.DELETE_RESOURCE_ATTRIBUTES.replace('{accountId}', accountId.toString()),
92
+ path: MembershipsService.API_PATHS.DELETE_MEMBERSHIPS.replace('{accountId}', accountId.toString()),
94
93
  },
95
94
  method: 'DELETE',
96
95
  query: {
@@ -9,9 +9,9 @@ export interface MembershipForCreate {
9
9
  }
10
10
 
11
11
  export interface MembershipForDelete {
12
- entityId?: number; // Which entity has the role?
12
+ entityId?: number; // Which entity has the role? omit to delete all memberships to the resource
13
13
  entityType: string; // What type of entity is this?
14
- resourceId?: number; // What resource is this membership for?
14
+ resourceId: number; // What resource is this membership for?
15
15
  resourceType: string; // What type of resource is this membership for?
16
16
  }
17
17