@delopay/sdk 0.186.0 → 0.188.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/{chunk-FRMLBRHG.js → chunk-7M6HDH2Q.js} +133 -11
- package/dist/chunk-7M6HDH2Q.js.map +1 -0
- package/dist/index.cjs +132 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +712 -31
- package/dist/index.d.ts +712 -31
- package/dist/index.js +1 -1
- package/dist/internal.cjs +132 -10
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-FRMLBRHG.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -4131,9 +4131,19 @@ var Users = class {
|
|
|
4131
4131
|
* Mints a session token **as** the given member, so the dashboard renders
|
|
4132
4132
|
* exactly what they see (useful for support and role verification). The
|
|
4133
4133
|
* caller needs the *Impersonation* permission, and the member's role must
|
|
4134
|
-
* rank **strictly below** the caller's
|
|
4135
|
-
*
|
|
4136
|
-
*
|
|
4134
|
+
* either rank **strictly below** the caller's
|
|
4135
|
+
* (`Profile < Merchant < Organization`), or sit at the caller's own
|
|
4136
|
+
* merchant-or-higher level and be **strictly narrower** than the caller's
|
|
4137
|
+
* role (grant nothing the caller's role does not, and less in total). The
|
|
4138
|
+
* server rejects self-impersonation and cross-merchant targets.
|
|
4139
|
+
* `MinimalRoleInfo.can_impersonate` in `listUsersInLineage` answers the same rule
|
|
4140
|
+
* per binding, so a UI can offer the action only where it will succeed.
|
|
4141
|
+
*
|
|
4142
|
+
* A role refusal is a `UR_33` error whose `data.reason` names the rule:
|
|
4143
|
+
* `impersonation_target_not_narrower` (the member's role is above, equal to,
|
|
4144
|
+
* or not contained in the caller's), or `act_as_token_cannot_impersonate`
|
|
4145
|
+
* (the caller is itself signed in as another member — start from your own
|
|
4146
|
+
* session).
|
|
4137
4147
|
*
|
|
4138
4148
|
* The returned token is tab-scoped by design: open it in a fresh tab (e.g.
|
|
4139
4149
|
* `/auth/impersonate?token=…`) rather than replacing the caller's own
|
|
@@ -5309,6 +5319,20 @@ var Products = class {
|
|
|
5309
5319
|
...this.scoped(profileId, options)
|
|
5310
5320
|
});
|
|
5311
5321
|
}
|
|
5322
|
+
/**
|
|
5323
|
+
* Delete an archived product, then carry out the chosen action at each
|
|
5324
|
+
* connected account it is tied to. An account not named in
|
|
5325
|
+
* `provider_actions` is kept as it is. A failed provider action does not
|
|
5326
|
+
* undo the delete: it is listed by {@link providerCleanups} and retried
|
|
5327
|
+
* with {@link providerArchive}.
|
|
5328
|
+
* `POST /products/{product_id}/delete`
|
|
5329
|
+
*/
|
|
5330
|
+
async deleteWithProviders(productId, request, profileId, options) {
|
|
5331
|
+
return this.request("POST", `/products/${encodeURIComponent(productId)}/delete`, {
|
|
5332
|
+
body: request,
|
|
5333
|
+
...this.scoped(profileId, options)
|
|
5334
|
+
});
|
|
5335
|
+
}
|
|
5312
5336
|
/**
|
|
5313
5337
|
* Add a price to an existing product.
|
|
5314
5338
|
* `POST /products/{product_id}/prices`
|
|
@@ -5550,9 +5574,12 @@ var Products = class {
|
|
|
5550
5574
|
}
|
|
5551
5575
|
/**
|
|
5552
5576
|
* Create a product for every new item and add the new prices of every
|
|
5553
|
-
* changed one, tied to the provider's ids. Nothing is edited or
|
|
5554
|
-
*
|
|
5555
|
-
*
|
|
5577
|
+
* changed one, tied to the provider's ids. Nothing else is edited or
|
|
5578
|
+
* removed, except that `options.archived: 'archive'` archives the catalog
|
|
5579
|
+
* product of every item the provider no longer offers (by default it is
|
|
5580
|
+
* left as it is). Nothing is written to the provider. A failed item is
|
|
5581
|
+
* reported with its reason and can be retried by naming it in
|
|
5582
|
+
* `connector_product_ids`.
|
|
5556
5583
|
* `POST /products/import/apply`
|
|
5557
5584
|
*/
|
|
5558
5585
|
async importApply(request, profileId, options) {
|
|
@@ -5609,6 +5636,53 @@ var Products = class {
|
|
|
5609
5636
|
...this.scoped(profileId, options)
|
|
5610
5637
|
});
|
|
5611
5638
|
}
|
|
5639
|
+
// --- provider lifecycle -----------------------------------------
|
|
5640
|
+
/**
|
|
5641
|
+
* The shop's connected accounts the catalog works with, and what each can
|
|
5642
|
+
* do: read, create, push, and how a delete can clean up there.
|
|
5643
|
+
* `GET /products/provider-accounts`
|
|
5644
|
+
*/
|
|
5645
|
+
async providerAccounts(profileId, options) {
|
|
5646
|
+
return this.request("GET", "/products/provider-accounts", {
|
|
5647
|
+
...this.scoped(profileId, options)
|
|
5648
|
+
});
|
|
5649
|
+
}
|
|
5650
|
+
/**
|
|
5651
|
+
* Provider clean-ups still to be carried out: deletes whose action at a
|
|
5652
|
+
* provider failed, or was recorded and never reached.
|
|
5653
|
+
* `GET /products/provider-cleanups`
|
|
5654
|
+
*/
|
|
5655
|
+
async providerCleanups(profileId, options) {
|
|
5656
|
+
return this.request("GET", "/products/provider-cleanups", {
|
|
5657
|
+
...this.scoped(profileId, options)
|
|
5658
|
+
});
|
|
5659
|
+
}
|
|
5660
|
+
/**
|
|
5661
|
+
* Create the product at a connected account it is not at yet. Without
|
|
5662
|
+
* `confirmed` nothing is written and the answer holds the plan to review;
|
|
5663
|
+
* send the plan's `fingerprint` back as `confirmed` to carry it out. When
|
|
5664
|
+
* the plan changed since, nothing is written and the answer carries
|
|
5665
|
+
* `confirmation_outdated: true` with the current plan.
|
|
5666
|
+
* `POST /products/{product_id}/provider-sync/create`
|
|
5667
|
+
*/
|
|
5668
|
+
async providerCreate(productId, request, profileId, options) {
|
|
5669
|
+
return this.request("POST", `/products/${encodeURIComponent(productId)}/provider-sync/create`, {
|
|
5670
|
+
body: request,
|
|
5671
|
+
...this.scoped(profileId, options)
|
|
5672
|
+
});
|
|
5673
|
+
}
|
|
5674
|
+
/**
|
|
5675
|
+
* Archive the product at one connected account, or retry a clean-up that
|
|
5676
|
+
* failed after the product was deleted. Existing subscriptions there keep
|
|
5677
|
+
* billing; the catalog is not changed.
|
|
5678
|
+
* `POST /products/{product_id}/provider-archive`
|
|
5679
|
+
*/
|
|
5680
|
+
async providerArchive(productId, request, profileId, options) {
|
|
5681
|
+
return this.request("POST", `/products/${encodeURIComponent(productId)}/provider-archive`, {
|
|
5682
|
+
body: request,
|
|
5683
|
+
...this.scoped(profileId, options)
|
|
5684
|
+
});
|
|
5685
|
+
}
|
|
5612
5686
|
};
|
|
5613
5687
|
|
|
5614
5688
|
// src/resources/processorCosts.ts
|
|
@@ -6504,6 +6578,23 @@ var OperationLimits = class {
|
|
|
6504
6578
|
async retrieveSettings(options) {
|
|
6505
6579
|
return this.request("GET", "/operation-limits/settings", options);
|
|
6506
6580
|
}
|
|
6581
|
+
/**
|
|
6582
|
+
* The caller's own usage against the limit on one operation: the rule that
|
|
6583
|
+
* applies to them, what they have used in the current window and what
|
|
6584
|
+
* remains.
|
|
6585
|
+
*
|
|
6586
|
+
* Refund usage needs merchant-wide refund read and is refused to a role
|
|
6587
|
+
* restricted to some connectors: the totals span every shop and connector,
|
|
6588
|
+
* as the budget does. Settlement usage needs merchant settlement read.
|
|
6589
|
+
*
|
|
6590
|
+
* `GET /operation-limits/usage`
|
|
6591
|
+
*/
|
|
6592
|
+
async retrieveUsage(params, options) {
|
|
6593
|
+
return this.request("GET", "/operation-limits/usage", {
|
|
6594
|
+
query: { operation: params.operation },
|
|
6595
|
+
...options
|
|
6596
|
+
});
|
|
6597
|
+
}
|
|
6507
6598
|
/**
|
|
6508
6599
|
* Update the enforcement settings. Only provided fields change.
|
|
6509
6600
|
*
|
|
@@ -6541,7 +6632,10 @@ var OperationLimits = class {
|
|
|
6541
6632
|
*
|
|
6542
6633
|
* Refused for the user who requested it, and for an approver whose own
|
|
6543
6634
|
* limit would not have covered the operation — the permission is necessary
|
|
6544
|
-
* and not sufficient.
|
|
6635
|
+
* and not sufficient. The requester stays refused while signed in as
|
|
6636
|
+
* another team member: that is a `DE_12` error (`approval_decision_refused`)
|
|
6637
|
+
* whose `data.reason` is `requester_acting_as_another_member`, and
|
|
6638
|
+
* {@link reject} refuses the same way.
|
|
6545
6639
|
*
|
|
6546
6640
|
* Approval and execution are two facts. A request that was approved but
|
|
6547
6641
|
* whose operation then failed comes back `approved` with `execution_error`
|
|
@@ -10091,19 +10185,26 @@ var CheckoutSession = class {
|
|
|
10091
10185
|
* is what a recorder should do: every ordinary slice compresses, and the last
|
|
10092
10186
|
* one is sent the way that actually arrives.
|
|
10093
10187
|
*
|
|
10188
|
+
* For a precompressed event array, pass `compressed_events` and `gzipBody`.
|
|
10189
|
+
* The latter receives the complete JSON request (including the session's
|
|
10190
|
+
* client secret) and must return gzip bytes synchronously. Fetch then starts
|
|
10191
|
+
* before this method yields, including on a page-navigation slice. A
|
|
10192
|
+
* keepalive request is used only when that prepared body is at most 60 KiB.
|
|
10193
|
+
*
|
|
10094
10194
|
* `POST /payments/{paymentId}/replay/slice` (publishable key)
|
|
10095
10195
|
*/
|
|
10096
10196
|
async storeReplaySlice(params, options) {
|
|
10097
|
-
const { keepalive, compress, ...extras } = options ?? {};
|
|
10197
|
+
const { keepalive, compress, gzipBody, ...extras } = options ?? {};
|
|
10098
10198
|
const body = { ...params, client_secret: this.requireClientSecret() };
|
|
10099
10199
|
const headers = this.pkHeaders(extras.headers);
|
|
10100
|
-
const
|
|
10200
|
+
const encoded = gzipBody?.(new TextEncoder().encode(JSON.stringify(body)));
|
|
10201
|
+
const gzipped = encoded ? Uint8Array.from(encoded).buffer : compress === true && keepalive !== true ? await gzipJson(body) : null;
|
|
10101
10202
|
return this.client.request(
|
|
10102
10203
|
"POST",
|
|
10103
10204
|
`/payments/${encodeURIComponent(this.paymentId)}/replay/slice`,
|
|
10104
10205
|
{
|
|
10105
10206
|
body: gzipped ?? body,
|
|
10106
|
-
...keepalive !== void 0 ? { keepalive } : {},
|
|
10207
|
+
...keepalive !== void 0 ? { keepalive: encoded ? keepalive && encoded.byteLength <= 60 * 1024 : keepalive } : {},
|
|
10107
10208
|
...extras,
|
|
10108
10209
|
// `Content-Type` has to be stated for the compressed body: the client
|
|
10109
10210
|
// only sets it for a body it serialises itself, and the bytes are
|
|
@@ -10304,6 +10405,27 @@ var CheckoutSession = class {
|
|
|
10304
10405
|
headers: this.bearerHeaders(options?.headers)
|
|
10305
10406
|
});
|
|
10306
10407
|
}
|
|
10408
|
+
/**
|
|
10409
|
+
* Make the buyer's add-on choice while the checkout data answers
|
|
10410
|
+
* `type: 'addon_choice'`.
|
|
10411
|
+
*
|
|
10412
|
+
* Only price ids and quantities are sent; the router prices them from the
|
|
10413
|
+
* catalog and judges every selection group's bounds. The payment's lines and
|
|
10414
|
+
* amount change together, once: the choice is final afterwards, the same
|
|
10415
|
+
* choice sent again answers the same result, and another is refused with
|
|
10416
|
+
* `IR_16` — as is a choice once anything could have been charged at the
|
|
10417
|
+
* previous amount. Fetch the checkout data again afterwards for the payment
|
|
10418
|
+
* methods at the final amount.
|
|
10419
|
+
*
|
|
10420
|
+
* `POST /payment-link/{merchantId}/{paymentId}/addons`
|
|
10421
|
+
*/
|
|
10422
|
+
async chooseAddons(params, options) {
|
|
10423
|
+
return this.client.request("POST", `${this.linkBase}/addons`, {
|
|
10424
|
+
body: params,
|
|
10425
|
+
...options,
|
|
10426
|
+
headers: this.bearerHeaders(options?.headers)
|
|
10427
|
+
});
|
|
10428
|
+
}
|
|
10307
10429
|
/**
|
|
10308
10430
|
* Ask whether NomuPay's COPYandPAY widget may submit a card, from the
|
|
10309
10431
|
* form's pre-submit hook.
|