@delopay/sdk 0.190.0 → 0.193.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
@@ -3315,6 +3315,12 @@ var Routing = class {
3315
3315
  * Every account named must belong to this shop; one that does not is refused.
3316
3316
  * So is an amount cap without a `currency`, and a payment cap with one.
3317
3317
  *
3318
+ * An account may appear twice — a payment count and a budget — and never
3319
+ * twice in one `unit`. Re-send a range with its `limit_max`, or it is stored
3320
+ * as its bottom. Never re-send `current_limit` as `set_current_limit`: the
3321
+ * value read belongs to the window it was read in, and pinning it into a
3322
+ * window that has since reset is a limit nobody chose.
3323
+ *
3318
3324
  * `PUT /routing/connector-caps/{profileId}`
3319
3325
  */
3320
3326
  async setConnectorCaps(profileId, params) {
@@ -4107,6 +4113,15 @@ var Users = class {
4107
4113
  async listProfiles() {
4108
4114
  return this.request("GET", "/user/list/profile");
4109
4115
  }
4116
+ /**
4117
+ * Invite team members by email. `POST /user/employees/invite`
4118
+ *
4119
+ * `project_ids` grants a shop-level role on every shop of each project, once
4120
+ * the invitation is accepted. A refusal of `project_ids` is a `UR_23` error whose `data.reason` is one of
4121
+ * `project_not_in_merchant`, `role_not_grantable_on_project`,
4122
+ * `shop_in_granted_project`, `project_already_granted` or
4123
+ * `project_grant_requires_merchant_level`.
4124
+ */
4110
4125
  async inviteUsers(params) {
4111
4126
  return this.request("POST", "/user/employees/invite", { body: params });
4112
4127
  }
@@ -4120,7 +4135,11 @@ var Users = class {
4120
4135
  * not echoed back. Either way the member must change it on first sign-in.
4121
4136
  *
4122
4137
  * Same role rules as invite: you cannot grant a role above your own, and a
4123
- * shop-scoped caller can only target their own shop.
4138
+ * shop-scoped caller can only target their own shop. `project_ids` grants a
4139
+ * shop-level role on every shop of each project. A refusal of `project_ids` is a `UR_23` error whose `data.reason` is one of
4140
+ * `project_not_in_merchant`, `role_not_grantable_on_project`,
4141
+ * `shop_in_granted_project`, `project_already_granted` or
4142
+ * `project_grant_requires_merchant_level`.
4124
4143
  */
4125
4144
  async addUser(params) {
4126
4145
  return this.request("POST", "/user/employees/add", { body: params });
@@ -4233,6 +4252,12 @@ var Users = class {
4233
4252
  query: { groups: params.groups, entity_type: params.entity_type }
4234
4253
  });
4235
4254
  }
4255
+ /**
4256
+ * The roles a member holds, one entry per role. `POST /user/employees`
4257
+ *
4258
+ * A project-level role carries `project`: it applies to every shop of that
4259
+ * project.
4260
+ */
4236
4261
  async listUserRoles(params) {
4237
4262
  return this.request("POST", "/user/employees", { body: params });
4238
4263
  }
@@ -4257,7 +4282,9 @@ var Users = class {
4257
4282
  * Remove a team member. `DELETE /user/employees/delete`
4258
4283
  *
4259
4284
  * Pass `profile_id` to name the shop when managing a shop's team as a
4260
- * merchant-scoped admin — see {@link DeleteUserRoleRequest.profile_id}.
4285
+ * merchant-scoped admin — see {@link DeleteUserRoleRequest.profile_id}. Pass
4286
+ * `project_id` instead to remove a project-level role, which the member then
4287
+ * loses on every shop of the project.
4261
4288
  */
4262
4289
  async deleteUserRole(params) {
4263
4290
  return this.request("DELETE", "/user/employees/delete", { body: params });
@@ -4266,16 +4293,48 @@ var Users = class {
4266
4293
  * Move a team member between a merchant-level role and shop-level roles.
4267
4294
  * `POST /user/employees/change-scope`
4268
4295
  *
4269
- * A merchant-level `role_id` takes no `profile_ids`; a shop-level one needs
4270
- * at least one. Every earlier merchant- and shop-level binding of the member
4271
- * in your merchant is replaced. When the change takes a scope away, the
4296
+ * A merchant-level `role_id` takes no `profile_ids` or `project_ids`; a
4297
+ * shop-level one needs at least one shop or project. A project grants the
4298
+ * role on every shop of the project, including shops added later. Every
4299
+ * earlier merchant-, project- and shop-level binding of the member in your
4300
+ * merchant is replaced. When the change takes a scope away, the
4272
4301
  * member's sessions end (`sessions_revoked: true`). Needs a caller at
4273
4302
  * merchant level or above. A refusal is a `UR_23` error whose `data.reason`
4274
- * names the rule; an unknown `role_id` is `UR_22`.
4303
+ * names the rule; an unknown `role_id` is `UR_22`. The project rules add the
4304
+ * reasons `project_not_in_merchant`, `role_not_grantable_on_project`,
4305
+ * `shop_in_granted_project`, `project_already_granted` and
4306
+ * `project_grant_requires_merchant_level`.
4275
4307
  */
4276
4308
  async changeMemberScope(params) {
4277
4309
  return this.request("POST", "/user/employees/change-scope", { body: params });
4278
4310
  }
4311
+ /**
4312
+ * One member of your merchant, with the person fields the member list
4313
+ * omits. `GET /user/employees/{user_id}/details`
4314
+ *
4315
+ * Answers only for a member `listUsersInLineage` shows you. Any other id,
4316
+ * unknown or not yours, is a 404 `UR_68` with `data.reason:
4317
+ * 'member_not_found'`.
4318
+ */
4319
+ async getTeamMemberDetails(userId) {
4320
+ return this.request("GET", `/user/employees/${encodeURIComponent(userId)}/details`);
4321
+ }
4322
+ /**
4323
+ * Replace a team member's password with a temporary one, returned once.
4324
+ * `POST /user/employees/{user_id}/reset-password`
4325
+ *
4326
+ * Needs the *Users* write permission and the *Impersonation* permission,
4327
+ * and the member must be one you could sign in as with
4328
+ * `impersonateEmployee`. The member's sessions end, and their next sign-in
4329
+ * asks them to choose a new password. Two-factor authentication is left as
4330
+ * it is. `TeamMemberDetails.can_reset_password` answers the same rule. A
4331
+ * refusal is a `UR_68` error whose `data` is a {@link TeamMemberRefusal}.
4332
+ */
4333
+ async resetTeamMemberPassword(userId, params) {
4334
+ return this.request("POST", `/user/employees/${encodeURIComponent(userId)}/reset-password`, {
4335
+ body: params
4336
+ });
4337
+ }
4279
4338
  /** Sign in via OIDC. `POST /user/oidc` */
4280
4339
  async signInOidc(params) {
4281
4340
  return this.request("POST", "/user/oidc", { body: params });
@@ -4288,7 +4347,8 @@ var Users = class {
4288
4347
  * Invitations still waiting on the caller. `GET /user/list/invitation`
4289
4348
  *
4290
4349
  * Accepts an `accept_invite` step token as well as a session JWT, so it
4291
- * can feed `acceptInvitationsPreAuth` during sign-in.
4350
+ * can feed `acceptInvitationsPreAuth` during sign-in. An invitation to a
4351
+ * project carries `project_id`; pass it back unchanged when accepting.
4292
4352
  */
4293
4353
  async listInvitations() {
4294
4354
  return this.request("GET", "/user/list/invitation");