@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.
@@ -2275,8 +2275,21 @@ var Users = class {
2275
2275
  async verifyPhoneOtp(params) {
2276
2276
  return this.request("POST", "/user/phone/verify-otp", { body: params });
2277
2277
  }
2278
- async listRoles() {
2279
- return this.request("GET", "/user/role/list");
2278
+ /**
2279
+ * List all roles visible to the caller (predefined + custom).
2280
+ *
2281
+ * `GET /user/role/list`. With `groups: true` the response is the
2282
+ * parent-groups shape: `[{role_id, role_name, entity_type, role_scope,
2283
+ * parent_groups: [{name, description, scopes}]}]`; without it, the
2284
+ * deprecated flat `groups` shape.
2285
+ */
2286
+ async listRoles(params) {
2287
+ if (params === void 0) {
2288
+ return this.request("GET", "/user/role/list");
2289
+ }
2290
+ return this.request("GET", "/user/role/list", {
2291
+ query: { groups: params.groups, entity_type: params.entity_type }
2292
+ });
2280
2293
  }
2281
2294
  async listUserRoles(params) {
2282
2295
  return this.request("POST", "/user/employees", { body: params });
@@ -2400,6 +2413,15 @@ var Users = class {
2400
2413
  async updateRole(roleId, params) {
2401
2414
  return this.request("PUT", `/user/role/${encodeURIComponent(roleId)}`, { body: params });
2402
2415
  }
2416
+ /**
2417
+ * Delete a custom role. Predefined roles and roles still assigned to
2418
+ * team members are rejected by the backend with a 400.
2419
+ *
2420
+ * `DELETE /user/role/{roleId}`
2421
+ */
2422
+ async deleteRole(roleId) {
2423
+ return this.request("DELETE", `/user/role/${encodeURIComponent(roleId)}`);
2424
+ }
2403
2425
  };
2404
2426
 
2405
2427
  // src/resources/verification.ts
@@ -4084,4 +4106,4 @@ export {
4084
4106
  applyBrandingVariables,
4085
4107
  shadowFor
4086
4108
  };
4087
- //# sourceMappingURL=chunk-QH5ESES3.js.map
4109
+ //# sourceMappingURL=chunk-G2TIZ4KS.js.map