@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.js CHANGED
@@ -216,7 +216,7 @@ import {
216
216
  validatePanes,
217
217
  verticalGapValue,
218
218
  visibleCustomFields
219
- } from "./chunk-BIAYMQN7.js";
219
+ } from "./chunk-AUVCCOH6.js";
220
220
  export {
221
221
  AIRWALLEX_AUTOFILL_TREATMENTS,
222
222
  AIRWALLEX_CARD_LAYOUTS,
package/dist/internal.cjs CHANGED
@@ -3913,6 +3913,31 @@ var Users = class {
3913
3913
  async signIn(params) {
3914
3914
  return this.request("POST", "/user/signin", { body: params });
3915
3915
  }
3916
+ /** Providers currently configured for dashboard sign-in. */
3917
+ async listOAuthProviders() {
3918
+ return this.request("GET", "/user/oauth/providers");
3919
+ }
3920
+ /** Current account's links; disabled providers remain visible. */
3921
+ async listLinkedOAuthProviders() {
3922
+ return this.request("GET", "/user/oauth/linked");
3923
+ }
3924
+ async startOAuthSignIn(params) {
3925
+ return this.request("POST", "/user/oauth/start", { body: params });
3926
+ }
3927
+ async startOAuthLink(params) {
3928
+ return this.request("POST", "/user/oauth/link/start", { body: params });
3929
+ }
3930
+ async completeOAuthSignIn(params) {
3931
+ return this.request("POST", "/user/oauth/complete", { body: params });
3932
+ }
3933
+ async completeOAuthLink(params) {
3934
+ return this.request("POST", "/user/oauth/link/complete", { body: params });
3935
+ }
3936
+ async disconnectOAuthProvider(provider, params) {
3937
+ return this.request("DELETE", `/user/oauth/linked/${encodeURIComponent(provider)}`, {
3938
+ body: params
3939
+ });
3940
+ }
3916
3941
  async signOut() {
3917
3942
  return this.request("POST", "/user/signout");
3918
3943
  }
@@ -4126,6 +4151,15 @@ var Users = class {
4126
4151
  async listProfiles() {
4127
4152
  return this.request("GET", "/user/list/profile");
4128
4153
  }
4154
+ /**
4155
+ * Invite team members by email. `POST /user/employees/invite`
4156
+ *
4157
+ * `project_ids` grants a shop-level role on every shop of each project, once
4158
+ * the invitation is accepted. A refusal of `project_ids` is a `UR_23` error whose `data.reason` is one of
4159
+ * `project_not_in_merchant`, `role_not_grantable_on_project`,
4160
+ * `shop_in_granted_project`, `project_already_granted` or
4161
+ * `project_grant_requires_merchant_level`.
4162
+ */
4129
4163
  async inviteUsers(params) {
4130
4164
  return this.request("POST", "/user/employees/invite", { body: params });
4131
4165
  }
@@ -4139,7 +4173,11 @@ var Users = class {
4139
4173
  * not echoed back. Either way the member must change it on first sign-in.
4140
4174
  *
4141
4175
  * Same role rules as invite: you cannot grant a role above your own, and a
4142
- * shop-scoped caller can only target their own shop.
4176
+ * shop-scoped caller can only target their own shop. `project_ids` grants a
4177
+ * 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
4178
+ * `project_not_in_merchant`, `role_not_grantable_on_project`,
4179
+ * `shop_in_granted_project`, `project_already_granted` or
4180
+ * `project_grant_requires_merchant_level`.
4143
4181
  */
4144
4182
  async addUser(params) {
4145
4183
  return this.request("POST", "/user/employees/add", { body: params });
@@ -4252,6 +4290,12 @@ var Users = class {
4252
4290
  query: { groups: params.groups, entity_type: params.entity_type }
4253
4291
  });
4254
4292
  }
4293
+ /**
4294
+ * The roles a member holds, one entry per role. `POST /user/employees`
4295
+ *
4296
+ * A project-level role carries `project`: it applies to every shop of that
4297
+ * project.
4298
+ */
4255
4299
  async listUserRoles(params) {
4256
4300
  return this.request("POST", "/user/employees", { body: params });
4257
4301
  }
@@ -4276,7 +4320,9 @@ var Users = class {
4276
4320
  * Remove a team member. `DELETE /user/employees/delete`
4277
4321
  *
4278
4322
  * Pass `profile_id` to name the shop when managing a shop's team as a
4279
- * merchant-scoped admin — see {@link DeleteUserRoleRequest.profile_id}.
4323
+ * merchant-scoped admin — see {@link DeleteUserRoleRequest.profile_id}. Pass
4324
+ * `project_id` instead to remove a project-level role, which the member then
4325
+ * loses on every shop of the project.
4280
4326
  */
4281
4327
  async deleteUserRole(params) {
4282
4328
  return this.request("DELETE", "/user/employees/delete", { body: params });
@@ -4285,12 +4331,17 @@ var Users = class {
4285
4331
  * Move a team member between a merchant-level role and shop-level roles.
4286
4332
  * `POST /user/employees/change-scope`
4287
4333
  *
4288
- * A merchant-level `role_id` takes no `profile_ids`; a shop-level one needs
4289
- * at least one. Every earlier merchant- and shop-level binding of the member
4290
- * in your merchant is replaced. When the change takes a scope away, the
4334
+ * A merchant-level `role_id` takes no `profile_ids` or `project_ids`; a
4335
+ * shop-level one needs at least one shop or project. A project grants the
4336
+ * role on every shop of the project, including shops added later. Every
4337
+ * earlier merchant-, project- and shop-level binding of the member in your
4338
+ * merchant is replaced. When the change takes a scope away, the
4291
4339
  * member's sessions end (`sessions_revoked: true`). Needs a caller at
4292
4340
  * merchant level or above. A refusal is a `UR_23` error whose `data.reason`
4293
- * names the rule; an unknown `role_id` is `UR_22`.
4341
+ * names the rule; an unknown `role_id` is `UR_22`. The project rules add the
4342
+ * reasons `project_not_in_merchant`, `role_not_grantable_on_project`,
4343
+ * `shop_in_granted_project`, `project_already_granted` and
4344
+ * `project_grant_requires_merchant_level`.
4294
4345
  */
4295
4346
  async changeMemberScope(params) {
4296
4347
  return this.request("POST", "/user/employees/change-scope", { body: params });
@@ -4334,7 +4385,8 @@ var Users = class {
4334
4385
  * Invitations still waiting on the caller. `GET /user/list/invitation`
4335
4386
  *
4336
4387
  * Accepts an `accept_invite` step token as well as a session JWT, so it
4337
- * can feed `acceptInvitationsPreAuth` during sign-in.
4388
+ * can feed `acceptInvitationsPreAuth` during sign-in. An invitation to a
4389
+ * project carries `project_id`; pass it back unchanged when accepting.
4338
4390
  */
4339
4391
  async listInvitations() {
4340
4392
  return this.request("GET", "/user/list/invitation");
@@ -5964,7 +6016,13 @@ var Subscriptions = class {
5964
6016
  ...options
5965
6017
  });
5966
6018
  }
5967
- /** Update a subscription's plan/price. `PUT /subscriptions/{subscriptionId}/update` */
6019
+ /**
6020
+ * Update a subscription's plan/price. `PUT /subscriptions/{subscriptionId}/update`
6021
+ *
6022
+ * From the dashboard this counts against the caller's `subscription_change`
6023
+ * operation limit; an over-limit call fails with `DE_01` and nothing reaches
6024
+ * the processor. Calls made with an API key are not limited.
6025
+ */
5968
6026
  async update(subscriptionId, params, options) {
5969
6027
  return this.request("PUT", `/subscriptions/${encodeURIComponent(subscriptionId)}/update`, {
5970
6028
  body: params,
@@ -6020,6 +6078,10 @@ var Subscriptions = class {
6020
6078
  /**
6021
6079
  * Pause a subscription. `POST /subscriptions/{subscriptionId}/pause`
6022
6080
  *
6081
+ * From the dashboard this counts against the caller's `subscription_change`
6082
+ * operation limit; an over-limit call fails with `DE_01` and nothing reaches
6083
+ * the processor. Calls made with an API key are not limited.
6084
+ *
6023
6085
  * The body defaults to `{}` so the request still carries
6024
6086
  * `Content-Type: application/json` even when no params are passed — the
6025
6087
  * backend rejects the POST otherwise ("Unsupported content type").
@@ -6030,7 +6092,13 @@ var Subscriptions = class {
6030
6092
  ...options
6031
6093
  });
6032
6094
  }
6033
- /** Resume a paused subscription. `POST /subscriptions/{subscriptionId}/resume` */
6095
+ /**
6096
+ * Resume a paused subscription. `POST /subscriptions/{subscriptionId}/resume`
6097
+ *
6098
+ * From the dashboard this counts against the caller's `subscription_change`
6099
+ * operation limit; an over-limit call fails with `DE_01` and nothing reaches
6100
+ * the processor. Calls made with an API key are not limited.
6101
+ */
6034
6102
  async resume(subscriptionId, params, options) {
6035
6103
  return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/resume`, {
6036
6104
  body: params ?? {},
@@ -6042,6 +6110,10 @@ var Subscriptions = class {
6042
6110
  *
6043
6111
  * A subscription in a state it cannot be cancelled from is refused with
6044
6112
  * `DE_11`; `error.data.reason` then names why (`SubscriptionActionRefusal`).
6113
+ *
6114
+ * From the dashboard this counts against the caller's `subscription_change`
6115
+ * operation limit; an over-limit call fails with `DE_01` and nothing reaches
6116
+ * the processor. Calls made with an API key are not limited.
6045
6117
  */
6046
6118
  async cancel(subscriptionId, params, options) {
6047
6119
  return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/cancel`, {
@@ -6546,10 +6618,13 @@ var Settlement = class {
6546
6618
  * Add a manual adjustment to a statement. Positive `amount_usd` charges
6547
6619
  * the shop (reducing their payout); negative credits them.
6548
6620
  *
6549
- * Subject to the caller's `settlement_adjustment` operation limit (amount
6550
- * dimensions only): an over-limit call fails with `DE_01` and no adjustment
6551
- * is added. A settlement rule can only block — approval is refund-only, for
6552
- * the reason given on `updateStatementPayout()`.
6621
+ * Subject to the caller's `settlement_adjustment` operation limit: an
6622
+ * over-limit call fails with `DE_01` and no adjustment is added. Both
6623
+ * windows count every add, and a credit counts at its magnitude. A
6624
+ * settlement rule can only block — approval is refund-only, for the reason
6625
+ * given on `updateStatementPayout()`. When another add by the same user
6626
+ * changes the window while this one is being admitted, the call fails with
6627
+ * HTTP 412 and nothing is written; retrying the same request is safe.
6553
6628
  *
6554
6629
  * `POST /settlement/statements/{statementId}/adjustments`
6555
6630
  */
@@ -6563,6 +6638,10 @@ var Settlement = class {
6563
6638
  /**
6564
6639
  * Remove a manual adjustment from a statement.
6565
6640
  *
6641
+ * The adjustment still counts against the caller's `settlement_adjustment`
6642
+ * limit window it was added in: removing it does not give back its count or
6643
+ * amount.
6644
+ *
6566
6645
  * `DELETE /settlement/statements/{statementId}/adjustments/{adjustmentId}`
6567
6646
  */
6568
6647
  async deleteStatementAdjustment(statementId, adjustmentId, options) {
@@ -11971,6 +12050,18 @@ var AdminPortal = class {
11971
12050
  async getPromoConfig() {
11972
12051
  return this.request("GET", "/admin-portal/promo-config");
11973
12052
  }
12053
+ /** OAuth credentials are encrypted server-side and never returned. */
12054
+ async getDashboardOAuthSettings() {
12055
+ return this.request("GET", "/admin-portal/dashboard-oauth");
12056
+ }
12057
+ async updateDashboardOAuthUrls(params) {
12058
+ return this.request("PUT", "/admin-portal/dashboard-oauth/urls", { body: params });
12059
+ }
12060
+ async updateDashboardOAuthProvider(provider, params) {
12061
+ return this.request("PUT", `/admin-portal/dashboard-oauth/${encodeURIComponent(provider)}`, {
12062
+ body: params
12063
+ });
12064
+ }
11974
12065
  /**
11975
12066
  * Update the global welcome promotional-credit config. Any subset of
11976
12067
  * `amount` (minor units) / `message` may be supplied; omitted fields are