@delopay/sdk 0.151.0 → 0.153.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-U4LI2HSJ.js → chunk-CRR4YKJV.js} +79 -6
- package/dist/chunk-CRR4YKJV.js.map +1 -0
- package/dist/index.cjs +79 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +266 -9
- package/dist/index.d.ts +266 -9
- package/dist/index.js +3 -1
- package/dist/internal.cjs +79 -5
- 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 +3 -1
- package/dist/internal.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-U4LI2HSJ.js.map +0 -1
|
@@ -939,10 +939,37 @@ var Customers = class {
|
|
|
939
939
|
};
|
|
940
940
|
|
|
941
941
|
// src/resources/disputes.ts
|
|
942
|
+
function workspaceQuery(params) {
|
|
943
|
+
if (!params) return void 0;
|
|
944
|
+
const { connector, currency, dispute_status, dispute_stage, ...query } = params;
|
|
945
|
+
return {
|
|
946
|
+
...query,
|
|
947
|
+
...connector?.length ? { connector: connector.join(",") } : {},
|
|
948
|
+
...currency?.length ? { currency: currency.join(",") } : {},
|
|
949
|
+
...dispute_status?.length ? { dispute_status: dispute_status.join(",") } : {},
|
|
950
|
+
...dispute_stage?.length ? { dispute_stage: dispute_stage.join(",") } : {}
|
|
951
|
+
};
|
|
952
|
+
}
|
|
942
953
|
var Disputes = class {
|
|
943
954
|
constructor(request) {
|
|
944
955
|
this.request = request;
|
|
945
956
|
}
|
|
957
|
+
/** Read native disputes and provider-only cases once, after shared authorization and filters. */
|
|
958
|
+
async workspace(params) {
|
|
959
|
+
return this.request("GET", "/disputes/workspace", { query: workspaceQuery(params) });
|
|
960
|
+
}
|
|
961
|
+
/** Read filter options over the same scoped case set; pagination is ignored. */
|
|
962
|
+
async workspaceFilters(params) {
|
|
963
|
+
return this.request("GET", "/disputes/workspace/filters", { query: workspaceQuery(params) });
|
|
964
|
+
}
|
|
965
|
+
/** Count the filtered case set, including unknown outcomes; pagination is ignored. */
|
|
966
|
+
async workspaceAggregate(params) {
|
|
967
|
+
return this.request("GET", "/disputes/workspace/aggregate", { query: workspaceQuery(params) });
|
|
968
|
+
}
|
|
969
|
+
/** Export the complete filtered set, or throw on the server's explicit export-limit refusal. */
|
|
970
|
+
async workspaceExport(params) {
|
|
971
|
+
return this.request("GET", "/disputes/workspace/export", { query: workspaceQuery(params) });
|
|
972
|
+
}
|
|
946
973
|
/**
|
|
947
974
|
* Retrieve a dispute by its ID.
|
|
948
975
|
*
|
|
@@ -4298,6 +4325,43 @@ var AvailabilityOverrides = class {
|
|
|
4298
4325
|
}
|
|
4299
4326
|
};
|
|
4300
4327
|
|
|
4328
|
+
// src/resources/checkoutMethods.ts
|
|
4329
|
+
var CheckoutMethods = class {
|
|
4330
|
+
constructor(request) {
|
|
4331
|
+
this.request = request;
|
|
4332
|
+
}
|
|
4333
|
+
/**
|
|
4334
|
+
* The shop's layout (stored, or derived from its accounts) and every item
|
|
4335
|
+
* it may place. `GET /checkout-methods/{profile_id}`
|
|
4336
|
+
*/
|
|
4337
|
+
async retrieve(merchantId, profileId) {
|
|
4338
|
+
return this.request("GET", `/checkout-methods/${encodeURIComponent(profileId)}`, {
|
|
4339
|
+
query: { merchant_id: merchantId }
|
|
4340
|
+
});
|
|
4341
|
+
}
|
|
4342
|
+
/**
|
|
4343
|
+
* Replace the shop's layout. The router refuses an express item that does
|
|
4344
|
+
* not draw its own button, more than two rows of two in the express strip,
|
|
4345
|
+
* a title without text, or an item no account of the shop offers.
|
|
4346
|
+
* `PUT /checkout-methods/{profile_id}`
|
|
4347
|
+
*/
|
|
4348
|
+
async update(merchantId, profileId, body) {
|
|
4349
|
+
return this.request("PUT", `/checkout-methods/${encodeURIComponent(profileId)}`, {
|
|
4350
|
+
query: { merchant_id: merchantId },
|
|
4351
|
+
body
|
|
4352
|
+
});
|
|
4353
|
+
}
|
|
4354
|
+
/**
|
|
4355
|
+
* Delete the stored layout; the shop is back on the derived one.
|
|
4356
|
+
* `DELETE /checkout-methods/{profile_id}`
|
|
4357
|
+
*/
|
|
4358
|
+
async reset(merchantId, profileId) {
|
|
4359
|
+
return this.request("DELETE", `/checkout-methods/${encodeURIComponent(profileId)}`, {
|
|
4360
|
+
query: { merchant_id: merchantId }
|
|
4361
|
+
});
|
|
4362
|
+
}
|
|
4363
|
+
};
|
|
4364
|
+
|
|
4301
4365
|
// src/resources/subscriptions.ts
|
|
4302
4366
|
var Subscriptions = class {
|
|
4303
4367
|
constructor(request) {
|
|
@@ -5180,6 +5244,7 @@ var Delopay = class {
|
|
|
5180
5244
|
this.forex = new Forex(request);
|
|
5181
5245
|
this.regions = new Regions(request);
|
|
5182
5246
|
this.availabilityOverrides = new AvailabilityOverrides(request);
|
|
5247
|
+
this.checkoutMethods = new CheckoutMethods(request);
|
|
5183
5248
|
this.analytics = new Analytics(request);
|
|
5184
5249
|
this.analyticsDashboard = new AnalyticsDashboard(request);
|
|
5185
5250
|
this.featureMatrix = new FeatureMatrix(request);
|
|
@@ -7576,19 +7641,23 @@ var CheckoutSession = class {
|
|
|
7576
7641
|
* discriminated union owned by the consuming checkout, which keeps its
|
|
7577
7642
|
* own types and runtime gates — hence the loose return type.
|
|
7578
7643
|
*
|
|
7579
|
-
* `theme`
|
|
7580
|
-
*
|
|
7644
|
+
* `theme` (a named checkout variant) and `country` are the route's declared
|
|
7645
|
+
* query parameters. `country` is a manual override of the buyer country the
|
|
7646
|
+
* router otherwise resolves from the client IP — it decides which payment
|
|
7647
|
+
* methods the layout shows — as an ISO 3166-1 alpha-2 code, sent uppercased
|
|
7648
|
+
* and omitted when empty. `locale` travels as `Accept-Language` — the only
|
|
7581
7649
|
* channel the backend's locale resolution reads; a `?locale=` query is
|
|
7582
7650
|
* silently ignored by this route.
|
|
7583
7651
|
*
|
|
7584
7652
|
* `GET /payment-link/data/{merchantId}/{paymentId}`
|
|
7585
7653
|
*/
|
|
7586
7654
|
async fetchCheckoutData(params, options) {
|
|
7655
|
+
const country = params?.country?.trim().toUpperCase();
|
|
7587
7656
|
return this.client.request(
|
|
7588
7657
|
"GET",
|
|
7589
7658
|
`/payment-link/data/${encodeURIComponent(this.merchantId)}/${encodeURIComponent(this.paymentId)}`,
|
|
7590
7659
|
{
|
|
7591
|
-
query: { theme: params?.theme },
|
|
7660
|
+
query: { theme: params?.theme, country: country || void 0 },
|
|
7592
7661
|
...options,
|
|
7593
7662
|
headers: {
|
|
7594
7663
|
...params?.locale ? {
|
|
@@ -7896,6 +7965,9 @@ var CheckoutSession = class {
|
|
|
7896
7965
|
|
|
7897
7966
|
// src/panes.ts
|
|
7898
7967
|
var PANE_VISIBILITIES = ["always", "embedded_only", "external_only"];
|
|
7968
|
+
function parseOpenTarget(raw) {
|
|
7969
|
+
return raw === "popup" || raw === "same_page" ? raw : "tab";
|
|
7970
|
+
}
|
|
7899
7971
|
function parseVisibility(raw) {
|
|
7900
7972
|
return PANE_VISIBILITIES.find((value) => value === raw) ?? "always";
|
|
7901
7973
|
}
|
|
@@ -8187,7 +8259,7 @@ function decodePanes(raw) {
|
|
|
8187
8259
|
// Anything unrecognised degrades to `always` rather than dropping the row.
|
|
8188
8260
|
visibility: parseVisibility(entry["visibility"]),
|
|
8189
8261
|
// Same tolerance: an unknown value degrades to the default `tab`.
|
|
8190
|
-
openIn: entry["open_in"]
|
|
8262
|
+
openIn: parseOpenTarget(entry["open_in"]),
|
|
8191
8263
|
nativeElement: parseNativeElement(entry["native_element"]),
|
|
8192
8264
|
preset: str(entry["preset"]),
|
|
8193
8265
|
style: str(entry["style"])
|
|
@@ -8242,7 +8314,7 @@ function encodePanes(panes) {
|
|
|
8242
8314
|
// never went through `decodePanes`. A decoded pane always holds a valid
|
|
8243
8315
|
// value, so this is a no-op on the round-trip path.
|
|
8244
8316
|
visibility: parseVisibility(pane.visibility),
|
|
8245
|
-
open_in: pane.openIn
|
|
8317
|
+
open_in: parseOpenTarget(pane.openIn),
|
|
8246
8318
|
// Omitted at the default: `everywhere` is what the router decodes an
|
|
8247
8319
|
// absent key to, so leaving it out changes nothing — and keeps a blob
|
|
8248
8320
|
// stored before the field existed byte-identical on re-encode, which
|
|
@@ -8311,6 +8383,7 @@ export {
|
|
|
8311
8383
|
Forex,
|
|
8312
8384
|
Regions,
|
|
8313
8385
|
AvailabilityOverrides,
|
|
8386
|
+
CheckoutMethods,
|
|
8314
8387
|
Subscriptions,
|
|
8315
8388
|
Audit,
|
|
8316
8389
|
Settlement,
|
|
@@ -8467,4 +8540,4 @@ export {
|
|
|
8467
8540
|
decodeNativePanes,
|
|
8468
8541
|
encodeNativePanes
|
|
8469
8542
|
};
|
|
8470
|
-
//# sourceMappingURL=chunk-
|
|
8543
|
+
//# sourceMappingURL=chunk-CRR4YKJV.js.map
|