@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.d.cts CHANGED
@@ -4168,7 +4168,18 @@ declare class Users {
4168
4168
  verifyRecoveryCode(params: Record<string, unknown>): Promise<AuthResponse>;
4169
4169
  sendPhoneOtp(params: PhoneOtpRequest): Promise<PhoneOtpResponse>;
4170
4170
  verifyPhoneOtp(params: PhoneOtpVerifyRequest): Promise<PhoneOtpVerifyResponse>;
4171
- listRoles(): Promise<Record<string, unknown>[]>;
4171
+ /**
4172
+ * List all roles visible to the caller (predefined + custom).
4173
+ *
4174
+ * `GET /user/role/list`. With `groups: true` the response is the
4175
+ * parent-groups shape: `[{role_id, role_name, entity_type, role_scope,
4176
+ * parent_groups: [{name, description, scopes}]}]`; without it, the
4177
+ * deprecated flat `groups` shape.
4178
+ */
4179
+ listRoles(params?: {
4180
+ groups?: boolean;
4181
+ entity_type?: string;
4182
+ }): Promise<Record<string, unknown>[]>;
4172
4183
  listUserRoles(params?: Record<string, unknown>): Promise<Record<string, unknown>[]>;
4173
4184
  updateUserRole(params: Record<string, unknown>): Promise<Record<string, unknown>>;
4174
4185
  deleteUserRole(params: Record<string, unknown>): Promise<Record<string, unknown>>;
@@ -4235,6 +4246,13 @@ declare class Users {
4235
4246
  getRoleById(roleId: string): Promise<Record<string, unknown>>;
4236
4247
  /** Update role by ID. `PUT /user/role/{roleId}` */
4237
4248
  updateRole(roleId: string, params: Record<string, unknown>): Promise<Record<string, unknown>>;
4249
+ /**
4250
+ * Delete a custom role. Predefined roles and roles still assigned to
4251
+ * team members are rejected by the backend with a 400.
4252
+ *
4253
+ * `DELETE /user/role/{roleId}`
4254
+ */
4255
+ deleteRole(roleId: string): Promise<Record<string, unknown>>;
4238
4256
  }
4239
4257
 
4240
4258
  declare class Verification {
package/dist/index.d.ts CHANGED
@@ -4168,7 +4168,18 @@ declare class Users {
4168
4168
  verifyRecoveryCode(params: Record<string, unknown>): Promise<AuthResponse>;
4169
4169
  sendPhoneOtp(params: PhoneOtpRequest): Promise<PhoneOtpResponse>;
4170
4170
  verifyPhoneOtp(params: PhoneOtpVerifyRequest): Promise<PhoneOtpVerifyResponse>;
4171
- listRoles(): Promise<Record<string, unknown>[]>;
4171
+ /**
4172
+ * List all roles visible to the caller (predefined + custom).
4173
+ *
4174
+ * `GET /user/role/list`. With `groups: true` the response is the
4175
+ * parent-groups shape: `[{role_id, role_name, entity_type, role_scope,
4176
+ * parent_groups: [{name, description, scopes}]}]`; without it, the
4177
+ * deprecated flat `groups` shape.
4178
+ */
4179
+ listRoles(params?: {
4180
+ groups?: boolean;
4181
+ entity_type?: string;
4182
+ }): Promise<Record<string, unknown>[]>;
4172
4183
  listUserRoles(params?: Record<string, unknown>): Promise<Record<string, unknown>[]>;
4173
4184
  updateUserRole(params: Record<string, unknown>): Promise<Record<string, unknown>>;
4174
4185
  deleteUserRole(params: Record<string, unknown>): Promise<Record<string, unknown>>;
@@ -4235,6 +4246,13 @@ declare class Users {
4235
4246
  getRoleById(roleId: string): Promise<Record<string, unknown>>;
4236
4247
  /** Update role by ID. `PUT /user/role/{roleId}` */
4237
4248
  updateRole(roleId: string, params: Record<string, unknown>): Promise<Record<string, unknown>>;
4249
+ /**
4250
+ * Delete a custom role. Predefined roles and roles still assigned to
4251
+ * team members are rejected by the backend with a 400.
4252
+ *
4253
+ * `DELETE /user/role/{roleId}`
4254
+ */
4255
+ deleteRole(roleId: string): Promise<Record<string, unknown>>;
4238
4256
  }
4239
4257
 
4240
4258
  declare class Verification {
package/dist/index.js CHANGED
@@ -49,7 +49,7 @@ import {
49
49
  shadowFor,
50
50
  surfacePadValue,
51
51
  verticalGapValue
52
- } from "./chunk-QH5ESES3.js";
52
+ } from "./chunk-G2TIZ4KS.js";
53
53
  export {
54
54
  Analytics,
55
55
  AnalyticsDashboard,
package/dist/internal.cjs CHANGED
@@ -2362,8 +2362,21 @@ var Users = class {
2362
2362
  async verifyPhoneOtp(params) {
2363
2363
  return this.request("POST", "/user/phone/verify-otp", { body: params });
2364
2364
  }
2365
- async listRoles() {
2366
- return this.request("GET", "/user/role/list");
2365
+ /**
2366
+ * List all roles visible to the caller (predefined + custom).
2367
+ *
2368
+ * `GET /user/role/list`. With `groups: true` the response is the
2369
+ * parent-groups shape: `[{role_id, role_name, entity_type, role_scope,
2370
+ * parent_groups: [{name, description, scopes}]}]`; without it, the
2371
+ * deprecated flat `groups` shape.
2372
+ */
2373
+ async listRoles(params) {
2374
+ if (params === void 0) {
2375
+ return this.request("GET", "/user/role/list");
2376
+ }
2377
+ return this.request("GET", "/user/role/list", {
2378
+ query: { groups: params.groups, entity_type: params.entity_type }
2379
+ });
2367
2380
  }
2368
2381
  async listUserRoles(params) {
2369
2382
  return this.request("POST", "/user/employees", { body: params });
@@ -2487,6 +2500,15 @@ var Users = class {
2487
2500
  async updateRole(roleId, params) {
2488
2501
  return this.request("PUT", `/user/role/${encodeURIComponent(roleId)}`, { body: params });
2489
2502
  }
2503
+ /**
2504
+ * Delete a custom role. Predefined roles and roles still assigned to
2505
+ * team members are rejected by the backend with a 400.
2506
+ *
2507
+ * `DELETE /user/role/{roleId}`
2508
+ */
2509
+ async deleteRole(roleId) {
2510
+ return this.request("DELETE", `/user/role/${encodeURIComponent(roleId)}`);
2511
+ }
2490
2512
  };
2491
2513
 
2492
2514
  // src/resources/verification.ts