@delopay/sdk 0.53.0 → 0.54.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.
package/dist/index.cjs CHANGED
@@ -2350,8 +2350,21 @@ var Users = class {
2350
2350
  async verifyPhoneOtp(params) {
2351
2351
  return this.request("POST", "/user/phone/verify-otp", { body: params });
2352
2352
  }
2353
- async listRoles() {
2354
- return this.request("GET", "/user/role/list");
2353
+ /**
2354
+ * List all roles visible to the caller (predefined + custom).
2355
+ *
2356
+ * `GET /user/role/list`. With `groups: true` the response is the
2357
+ * parent-groups shape: `[{role_id, role_name, entity_type, role_scope,
2358
+ * parent_groups: [{name, description, scopes}]}]`; without it, the
2359
+ * deprecated flat `groups` shape.
2360
+ */
2361
+ async listRoles(params) {
2362
+ if (params === void 0) {
2363
+ return this.request("GET", "/user/role/list");
2364
+ }
2365
+ return this.request("GET", "/user/role/list", {
2366
+ query: { groups: params.groups, entity_type: params.entity_type }
2367
+ });
2355
2368
  }
2356
2369
  async listUserRoles(params) {
2357
2370
  return this.request("POST", "/user/employees", { body: params });
@@ -2475,6 +2488,15 @@ var Users = class {
2475
2488
  async updateRole(roleId, params) {
2476
2489
  return this.request("PUT", `/user/role/${encodeURIComponent(roleId)}`, { body: params });
2477
2490
  }
2491
+ /**
2492
+ * Delete a custom role. Predefined roles and roles still assigned to
2493
+ * team members are rejected by the backend with a 400.
2494
+ *
2495
+ * `DELETE /user/role/{roleId}`
2496
+ */
2497
+ async deleteRole(roleId) {
2498
+ return this.request("DELETE", `/user/role/${encodeURIComponent(roleId)}`);
2499
+ }
2478
2500
  };
2479
2501
 
2480
2502
  // src/resources/verification.ts