@delopay/sdk 0.186.0 → 0.187.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.
@@ -3889,9 +3889,19 @@ var Users = class {
3889
3889
  * Mints a session token **as** the given member, so the dashboard renders
3890
3890
  * exactly what they see (useful for support and role verification). The
3891
3891
  * caller needs the *Impersonation* permission, and the member's role must
3892
- * rank **strictly below** the caller's (`Profile < Merchant < Organization`);
3893
- * the server rejects self-impersonation, cross-merchant targets, and
3894
- * equal/higher roles.
3892
+ * either rank **strictly below** the caller's
3893
+ * (`Profile < Merchant < Organization`), or sit at the caller's own
3894
+ * merchant-or-higher level and be **strictly narrower** than the caller's
3895
+ * role (grant nothing the caller's role does not, and less in total). The
3896
+ * server rejects self-impersonation and cross-merchant targets.
3897
+ * `MinimalRoleInfo.can_impersonate` in `listUsersInLineage` answers the same rule
3898
+ * per binding, so a UI can offer the action only where it will succeed.
3899
+ *
3900
+ * A role refusal is a `UR_33` error whose `data.reason` names the rule:
3901
+ * `impersonation_target_not_narrower` (the member's role is above, equal to,
3902
+ * or not contained in the caller's), or `act_as_token_cannot_impersonate`
3903
+ * (the caller is itself signed in as another member — start from your own
3904
+ * session).
3895
3905
  *
3896
3906
  * The returned token is tab-scoped by design: open it in a fresh tab (e.g.
3897
3907
  * `/auth/impersonate?token=…`) rather than replacing the caller's own
@@ -5067,6 +5077,20 @@ var Products = class {
5067
5077
  ...this.scoped(profileId, options)
5068
5078
  });
5069
5079
  }
5080
+ /**
5081
+ * Delete an archived product, then carry out the chosen action at each
5082
+ * connected account it is tied to. An account not named in
5083
+ * `provider_actions` is kept as it is. A failed provider action does not
5084
+ * undo the delete: it is listed by {@link providerCleanups} and retried
5085
+ * with {@link providerArchive}.
5086
+ * `POST /products/{product_id}/delete`
5087
+ */
5088
+ async deleteWithProviders(productId, request, profileId, options) {
5089
+ return this.request("POST", `/products/${encodeURIComponent(productId)}/delete`, {
5090
+ body: request,
5091
+ ...this.scoped(profileId, options)
5092
+ });
5093
+ }
5070
5094
  /**
5071
5095
  * Add a price to an existing product.
5072
5096
  * `POST /products/{product_id}/prices`
@@ -5308,9 +5332,12 @@ var Products = class {
5308
5332
  }
5309
5333
  /**
5310
5334
  * Create a product for every new item and add the new prices of every
5311
- * changed one, tied to the provider's ids. Nothing is edited or removed, and
5312
- * nothing is written to the provider. A failed item is reported with its
5313
- * reason and can be retried by naming it in `connector_product_ids`.
5335
+ * changed one, tied to the provider's ids. Nothing else is edited or
5336
+ * removed, except that `options.archived: 'archive'` archives the catalog
5337
+ * product of every item the provider no longer offers (by default it is
5338
+ * left as it is). Nothing is written to the provider. A failed item is
5339
+ * reported with its reason and can be retried by naming it in
5340
+ * `connector_product_ids`.
5314
5341
  * `POST /products/import/apply`
5315
5342
  */
5316
5343
  async importApply(request, profileId, options) {
@@ -5367,6 +5394,53 @@ var Products = class {
5367
5394
  ...this.scoped(profileId, options)
5368
5395
  });
5369
5396
  }
5397
+ // --- provider lifecycle -----------------------------------------
5398
+ /**
5399
+ * The shop's connected accounts the catalog works with, and what each can
5400
+ * do: read, create, push, and how a delete can clean up there.
5401
+ * `GET /products/provider-accounts`
5402
+ */
5403
+ async providerAccounts(profileId, options) {
5404
+ return this.request("GET", "/products/provider-accounts", {
5405
+ ...this.scoped(profileId, options)
5406
+ });
5407
+ }
5408
+ /**
5409
+ * Provider clean-ups still to be carried out: deletes whose action at a
5410
+ * provider failed, or was recorded and never reached.
5411
+ * `GET /products/provider-cleanups`
5412
+ */
5413
+ async providerCleanups(profileId, options) {
5414
+ return this.request("GET", "/products/provider-cleanups", {
5415
+ ...this.scoped(profileId, options)
5416
+ });
5417
+ }
5418
+ /**
5419
+ * Create the product at a connected account it is not at yet. Without
5420
+ * `confirmed` nothing is written and the answer holds the plan to review;
5421
+ * send the plan's `fingerprint` back as `confirmed` to carry it out. When
5422
+ * the plan changed since, nothing is written and the answer carries
5423
+ * `confirmation_outdated: true` with the current plan.
5424
+ * `POST /products/{product_id}/provider-sync/create`
5425
+ */
5426
+ async providerCreate(productId, request, profileId, options) {
5427
+ return this.request("POST", `/products/${encodeURIComponent(productId)}/provider-sync/create`, {
5428
+ body: request,
5429
+ ...this.scoped(profileId, options)
5430
+ });
5431
+ }
5432
+ /**
5433
+ * Archive the product at one connected account, or retry a clean-up that
5434
+ * failed after the product was deleted. Existing subscriptions there keep
5435
+ * billing; the catalog is not changed.
5436
+ * `POST /products/{product_id}/provider-archive`
5437
+ */
5438
+ async providerArchive(productId, request, profileId, options) {
5439
+ return this.request("POST", `/products/${encodeURIComponent(productId)}/provider-archive`, {
5440
+ body: request,
5441
+ ...this.scoped(profileId, options)
5442
+ });
5443
+ }
5370
5444
  };
5371
5445
 
5372
5446
  // src/resources/processorCosts.ts
@@ -6299,7 +6373,10 @@ var OperationLimits = class {
6299
6373
  *
6300
6374
  * Refused for the user who requested it, and for an approver whose own
6301
6375
  * limit would not have covered the operation — the permission is necessary
6302
- * and not sufficient.
6376
+ * and not sufficient. The requester stays refused while signed in as
6377
+ * another team member: that is a `DE_12` error (`approval_decision_refused`)
6378
+ * whose `data.reason` is `requester_acting_as_another_member`, and
6379
+ * {@link reject} refuses the same way.
6303
6380
  *
6304
6381
  * Approval and execution are two facts. A request that was approved but
6305
6382
  * whose operation then failed comes back `approved` with `execution_error`
@@ -10062,6 +10139,27 @@ var CheckoutSession = class {
10062
10139
  headers: this.bearerHeaders(options?.headers)
10063
10140
  });
10064
10141
  }
10142
+ /**
10143
+ * Make the buyer's add-on choice while the checkout data answers
10144
+ * `type: 'addon_choice'`.
10145
+ *
10146
+ * Only price ids and quantities are sent; the router prices them from the
10147
+ * catalog and judges every selection group's bounds. The payment's lines and
10148
+ * amount change together, once: the choice is final afterwards, the same
10149
+ * choice sent again answers the same result, and another is refused with
10150
+ * `IR_16` — as is a choice once anything could have been charged at the
10151
+ * previous amount. Fetch the checkout data again afterwards for the payment
10152
+ * methods at the final amount.
10153
+ *
10154
+ * `POST /payment-link/{merchantId}/{paymentId}/addons`
10155
+ */
10156
+ async chooseAddons(params, options) {
10157
+ return this.client.request("POST", `${this.linkBase}/addons`, {
10158
+ body: params,
10159
+ ...options,
10160
+ headers: this.bearerHeaders(options?.headers)
10161
+ });
10162
+ }
10065
10163
  /**
10066
10164
  * Ask whether NomuPay's COPYandPAY widget may submit a card, from the
10067
10165
  * form's pre-submit hook.
@@ -10816,4 +10914,4 @@ export {
10816
10914
  decodeNativePanes,
10817
10915
  encodeNativePanes
10818
10916
  };
10819
- //# sourceMappingURL=chunk-FRMLBRHG.js.map
10917
+ //# sourceMappingURL=chunk-UI54GG2H.js.map