@delopay/sdk 0.192.0 → 0.198.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
@@ -3900,6 +3900,31 @@ var Users = class {
3900
3900
  async signIn(params) {
3901
3901
  return this.request("POST", "/user/signin", { body: params });
3902
3902
  }
3903
+ /** Providers currently configured for dashboard sign-in. */
3904
+ async listOAuthProviders() {
3905
+ return this.request("GET", "/user/oauth/providers");
3906
+ }
3907
+ /** Current account's links; disabled providers remain visible. */
3908
+ async listLinkedOAuthProviders() {
3909
+ return this.request("GET", "/user/oauth/linked");
3910
+ }
3911
+ async startOAuthSignIn(params) {
3912
+ return this.request("POST", "/user/oauth/start", { body: params });
3913
+ }
3914
+ async startOAuthLink(params) {
3915
+ return this.request("POST", "/user/oauth/link/start", { body: params });
3916
+ }
3917
+ async completeOAuthSignIn(params) {
3918
+ return this.request("POST", "/user/oauth/complete", { body: params });
3919
+ }
3920
+ async completeOAuthLink(params) {
3921
+ return this.request("POST", "/user/oauth/link/complete", { body: params });
3922
+ }
3923
+ async disconnectOAuthProvider(provider, params) {
3924
+ return this.request("DELETE", `/user/oauth/linked/${encodeURIComponent(provider)}`, {
3925
+ body: params
3926
+ });
3927
+ }
3903
3928
  async signOut() {
3904
3929
  return this.request("POST", "/user/signout");
3905
3930
  }
@@ -4113,6 +4138,15 @@ var Users = class {
4113
4138
  async listProfiles() {
4114
4139
  return this.request("GET", "/user/list/profile");
4115
4140
  }
4141
+ /**
4142
+ * Invite team members by email. `POST /user/employees/invite`
4143
+ *
4144
+ * `project_ids` grants a shop-level role on every shop of each project, once
4145
+ * the invitation is accepted. A refusal of `project_ids` is a `UR_23` error whose `data.reason` is one of
4146
+ * `project_not_in_merchant`, `role_not_grantable_on_project`,
4147
+ * `shop_in_granted_project`, `project_already_granted` or
4148
+ * `project_grant_requires_merchant_level`.
4149
+ */
4116
4150
  async inviteUsers(params) {
4117
4151
  return this.request("POST", "/user/employees/invite", { body: params });
4118
4152
  }
@@ -4126,7 +4160,11 @@ var Users = class {
4126
4160
  * not echoed back. Either way the member must change it on first sign-in.
4127
4161
  *
4128
4162
  * Same role rules as invite: you cannot grant a role above your own, and a
4129
- * shop-scoped caller can only target their own shop.
4163
+ * shop-scoped caller can only target their own shop. `project_ids` grants a
4164
+ * 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
4165
+ * `project_not_in_merchant`, `role_not_grantable_on_project`,
4166
+ * `shop_in_granted_project`, `project_already_granted` or
4167
+ * `project_grant_requires_merchant_level`.
4130
4168
  */
4131
4169
  async addUser(params) {
4132
4170
  return this.request("POST", "/user/employees/add", { body: params });
@@ -4239,6 +4277,12 @@ var Users = class {
4239
4277
  query: { groups: params.groups, entity_type: params.entity_type }
4240
4278
  });
4241
4279
  }
4280
+ /**
4281
+ * The roles a member holds, one entry per role. `POST /user/employees`
4282
+ *
4283
+ * A project-level role carries `project`: it applies to every shop of that
4284
+ * project.
4285
+ */
4242
4286
  async listUserRoles(params) {
4243
4287
  return this.request("POST", "/user/employees", { body: params });
4244
4288
  }
@@ -4263,7 +4307,9 @@ var Users = class {
4263
4307
  * Remove a team member. `DELETE /user/employees/delete`
4264
4308
  *
4265
4309
  * Pass `profile_id` to name the shop when managing a shop's team as a
4266
- * merchant-scoped admin — see {@link DeleteUserRoleRequest.profile_id}.
4310
+ * merchant-scoped admin — see {@link DeleteUserRoleRequest.profile_id}. Pass
4311
+ * `project_id` instead to remove a project-level role, which the member then
4312
+ * loses on every shop of the project.
4267
4313
  */
4268
4314
  async deleteUserRole(params) {
4269
4315
  return this.request("DELETE", "/user/employees/delete", { body: params });
@@ -4272,12 +4318,17 @@ var Users = class {
4272
4318
  * Move a team member between a merchant-level role and shop-level roles.
4273
4319
  * `POST /user/employees/change-scope`
4274
4320
  *
4275
- * A merchant-level `role_id` takes no `profile_ids`; a shop-level one needs
4276
- * at least one. Every earlier merchant- and shop-level binding of the member
4277
- * in your merchant is replaced. When the change takes a scope away, the
4321
+ * A merchant-level `role_id` takes no `profile_ids` or `project_ids`; a
4322
+ * shop-level one needs at least one shop or project. A project grants the
4323
+ * role on every shop of the project, including shops added later. Every
4324
+ * earlier merchant-, project- and shop-level binding of the member in your
4325
+ * merchant is replaced. When the change takes a scope away, the
4278
4326
  * member's sessions end (`sessions_revoked: true`). Needs a caller at
4279
4327
  * merchant level or above. A refusal is a `UR_23` error whose `data.reason`
4280
- * names the rule; an unknown `role_id` is `UR_22`.
4328
+ * names the rule; an unknown `role_id` is `UR_22`. The project rules add the
4329
+ * reasons `project_not_in_merchant`, `role_not_grantable_on_project`,
4330
+ * `shop_in_granted_project`, `project_already_granted` and
4331
+ * `project_grant_requires_merchant_level`.
4281
4332
  */
4282
4333
  async changeMemberScope(params) {
4283
4334
  return this.request("POST", "/user/employees/change-scope", { body: params });
@@ -4321,7 +4372,8 @@ var Users = class {
4321
4372
  * Invitations still waiting on the caller. `GET /user/list/invitation`
4322
4373
  *
4323
4374
  * Accepts an `accept_invite` step token as well as a session JWT, so it
4324
- * can feed `acceptInvitationsPreAuth` during sign-in.
4375
+ * can feed `acceptInvitationsPreAuth` during sign-in. An invitation to a
4376
+ * project carries `project_id`; pass it back unchanged when accepting.
4325
4377
  */
4326
4378
  async listInvitations() {
4327
4379
  return this.request("GET", "/user/list/invitation");
@@ -5951,7 +6003,13 @@ var Subscriptions = class {
5951
6003
  ...options
5952
6004
  });
5953
6005
  }
5954
- /** Update a subscription's plan/price. `PUT /subscriptions/{subscriptionId}/update` */
6006
+ /**
6007
+ * Update a subscription's plan/price. `PUT /subscriptions/{subscriptionId}/update`
6008
+ *
6009
+ * From the dashboard this counts against the caller's `subscription_change`
6010
+ * operation limit; an over-limit call fails with `DE_01` and nothing reaches
6011
+ * the processor. Calls made with an API key are not limited.
6012
+ */
5955
6013
  async update(subscriptionId, params, options) {
5956
6014
  return this.request("PUT", `/subscriptions/${encodeURIComponent(subscriptionId)}/update`, {
5957
6015
  body: params,
@@ -6007,6 +6065,10 @@ var Subscriptions = class {
6007
6065
  /**
6008
6066
  * Pause a subscription. `POST /subscriptions/{subscriptionId}/pause`
6009
6067
  *
6068
+ * From the dashboard this counts against the caller's `subscription_change`
6069
+ * operation limit; an over-limit call fails with `DE_01` and nothing reaches
6070
+ * the processor. Calls made with an API key are not limited.
6071
+ *
6010
6072
  * The body defaults to `{}` so the request still carries
6011
6073
  * `Content-Type: application/json` even when no params are passed — the
6012
6074
  * backend rejects the POST otherwise ("Unsupported content type").
@@ -6017,7 +6079,13 @@ var Subscriptions = class {
6017
6079
  ...options
6018
6080
  });
6019
6081
  }
6020
- /** Resume a paused subscription. `POST /subscriptions/{subscriptionId}/resume` */
6082
+ /**
6083
+ * Resume a paused subscription. `POST /subscriptions/{subscriptionId}/resume`
6084
+ *
6085
+ * From the dashboard this counts against the caller's `subscription_change`
6086
+ * operation limit; an over-limit call fails with `DE_01` and nothing reaches
6087
+ * the processor. Calls made with an API key are not limited.
6088
+ */
6021
6089
  async resume(subscriptionId, params, options) {
6022
6090
  return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/resume`, {
6023
6091
  body: params ?? {},
@@ -6029,6 +6097,10 @@ var Subscriptions = class {
6029
6097
  *
6030
6098
  * A subscription in a state it cannot be cancelled from is refused with
6031
6099
  * `DE_11`; `error.data.reason` then names why (`SubscriptionActionRefusal`).
6100
+ *
6101
+ * From the dashboard this counts against the caller's `subscription_change`
6102
+ * operation limit; an over-limit call fails with `DE_01` and nothing reaches
6103
+ * the processor. Calls made with an API key are not limited.
6032
6104
  */
6033
6105
  async cancel(subscriptionId, params, options) {
6034
6106
  return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/cancel`, {
@@ -6533,10 +6605,13 @@ var Settlement = class {
6533
6605
  * Add a manual adjustment to a statement. Positive `amount_usd` charges
6534
6606
  * the shop (reducing their payout); negative credits them.
6535
6607
  *
6536
- * Subject to the caller's `settlement_adjustment` operation limit (amount
6537
- * dimensions only): an over-limit call fails with `DE_01` and no adjustment
6538
- * is added. A settlement rule can only block — approval is refund-only, for
6539
- * the reason given on `updateStatementPayout()`.
6608
+ * Subject to the caller's `settlement_adjustment` operation limit: an
6609
+ * over-limit call fails with `DE_01` and no adjustment is added. Both
6610
+ * windows count every add, and a credit counts at its magnitude. A
6611
+ * settlement rule can only block — approval is refund-only, for the reason
6612
+ * given on `updateStatementPayout()`. When another add by the same user
6613
+ * changes the window while this one is being admitted, the call fails with
6614
+ * HTTP 412 and nothing is written; retrying the same request is safe.
6540
6615
  *
6541
6616
  * `POST /settlement/statements/{statementId}/adjustments`
6542
6617
  */
@@ -6550,6 +6625,10 @@ var Settlement = class {
6550
6625
  /**
6551
6626
  * Remove a manual adjustment from a statement.
6552
6627
  *
6628
+ * The adjustment still counts against the caller's `settlement_adjustment`
6629
+ * limit window it was added in: removing it does not give back its count or
6630
+ * amount.
6631
+ *
6553
6632
  * `DELETE /settlement/statements/{statementId}/adjustments/{adjustmentId}`
6554
6633
  */
6555
6634
  async deleteStatementAdjustment(statementId, adjustmentId, options) {