@delopay/sdk 0.365.0 → 0.368.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-DBE6IDBL.js → chunk-RD3HP3EY.js} +164 -41
- package/dist/chunk-RD3HP3EY.js.map +1 -0
- package/dist/{index-Cuci87K7.d.cts → index-DW1C5mFq.d.cts} +456 -6
- package/dist/{index-Cuci87K7.d.ts → index-DW1C5mFq.d.ts} +456 -6
- package/dist/index.cjs +164 -40
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -1
- package/dist/internal.cjs +256 -40
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +137 -3
- package/dist/internal.d.ts +137 -3
- package/dist/internal.js +94 -1
- package/dist/internal.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-DBE6IDBL.js.map +0 -1
package/dist/internal.cjs
CHANGED
|
@@ -39,6 +39,7 @@ __export(internal_exports, {
|
|
|
39
39
|
AdminBranding: () => AdminBranding,
|
|
40
40
|
AdminLive: () => AdminLive,
|
|
41
41
|
AdminPortal: () => AdminPortal,
|
|
42
|
+
AdminSupport: () => AdminSupport,
|
|
42
43
|
Analytics: () => Analytics,
|
|
43
44
|
AnalyticsDashboard: () => AnalyticsDashboard,
|
|
44
45
|
Audit: () => Audit,
|
|
@@ -186,6 +187,7 @@ __export(internal_exports, {
|
|
|
186
187
|
Settlement: () => Settlement,
|
|
187
188
|
ShopLabels: () => ShopLabels,
|
|
188
189
|
Subscriptions: () => Subscriptions,
|
|
190
|
+
Support: () => Support,
|
|
189
191
|
UNKNOWN_SECTION_ORDER: () => UNKNOWN_SECTION_ORDER,
|
|
190
192
|
WCAG_AA_TEXT: () => WCAG_AA_TEXT,
|
|
191
193
|
WCAG_AA_UI: () => WCAG_AA_UI,
|
|
@@ -1273,9 +1275,9 @@ var Connectors = class {
|
|
|
1273
1275
|
* to a single event.
|
|
1274
1276
|
*/
|
|
1275
1277
|
async registerWebhook(merchantId, connectorId, params) {
|
|
1276
|
-
const
|
|
1277
|
-
if (params === void 0) return this.request("POST",
|
|
1278
|
-
return this.request("POST",
|
|
1278
|
+
const path3 = `/account/${encodeURIComponent(merchantId)}/connectors/webhooks/${encodeURIComponent(connectorId)}`;
|
|
1279
|
+
if (params === void 0) return this.request("POST", path3);
|
|
1280
|
+
return this.request("POST", path3, { body: params });
|
|
1279
1281
|
}
|
|
1280
1282
|
/**
|
|
1281
1283
|
* Register checkout/shop domains as Stripe payment method domains, so Apple
|
|
@@ -2073,11 +2075,11 @@ function negotiated(options, format, presentation) {
|
|
|
2073
2075
|
}
|
|
2074
2076
|
return format === "json" ? { ...options, headers } : { ...options, headers, responseType: "blob" };
|
|
2075
2077
|
}
|
|
2076
|
-
function runExport(request, method,
|
|
2078
|
+
function runExport(request, method, path3, base, options) {
|
|
2077
2079
|
const format = options?.format ?? "json";
|
|
2078
2080
|
return downloadExport(
|
|
2079
2081
|
request,
|
|
2080
|
-
{ method, path, request: negotiated(base, format, options?.presentation), format },
|
|
2082
|
+
{ method, path: path3, request: negotiated(base, format, options?.presentation), format },
|
|
2081
2083
|
options
|
|
2082
2084
|
);
|
|
2083
2085
|
}
|
|
@@ -2338,6 +2340,34 @@ var ChargebackPrevention = class {
|
|
|
2338
2340
|
async retrieveCase(caseId) {
|
|
2339
2341
|
return this.request("GET", `/chargeback-prevention/cases/${encodeURIComponent(caseId)}`);
|
|
2340
2342
|
}
|
|
2343
|
+
/**
|
|
2344
|
+
* The refund rule of every connected account and environment; version `0`
|
|
2345
|
+
* and off for one never saved. Needs a merchant-wide key or sign-in.
|
|
2346
|
+
*/
|
|
2347
|
+
async listRefundRules() {
|
|
2348
|
+
return this.request("GET", "/chargeback-prevention/refund-rules");
|
|
2349
|
+
}
|
|
2350
|
+
/**
|
|
2351
|
+
* Save a refund rule over the version read. Dashboard sign-in only, by a
|
|
2352
|
+
* merchant-wide user who may write refunds; an API key is refused. A rule
|
|
2353
|
+
* saved since the version named is not overwritten: the call fails.
|
|
2354
|
+
*/
|
|
2355
|
+
async saveRefundRule(body) {
|
|
2356
|
+
return this.request("PUT", "/chargeback-prevention/refund-rules", { body });
|
|
2357
|
+
}
|
|
2358
|
+
/**
|
|
2359
|
+
* What the stored rule, or unsaved `settings`, would do with each open
|
|
2360
|
+
* alert of the account now. Nothing is refunded.
|
|
2361
|
+
*/
|
|
2362
|
+
async previewRefundRule(body) {
|
|
2363
|
+
return this.request("POST", "/chargeback-prevention/refund-rules/preview", { body });
|
|
2364
|
+
}
|
|
2365
|
+
/** What the merchant's refund rules did, newest first. */
|
|
2366
|
+
async listRefundActions(params) {
|
|
2367
|
+
return this.request("GET", "/chargeback-prevention/refund-actions", {
|
|
2368
|
+
query: params
|
|
2369
|
+
});
|
|
2370
|
+
}
|
|
2341
2371
|
};
|
|
2342
2372
|
|
|
2343
2373
|
// src/resources/paypalDisputes.ts
|
|
@@ -3050,15 +3080,15 @@ var Payments = class {
|
|
|
3050
3080
|
* ```
|
|
3051
3081
|
*/
|
|
3052
3082
|
async retrieve(paymentId, options) {
|
|
3053
|
-
const
|
|
3054
|
-
if (options === void 0) return this.request("GET",
|
|
3083
|
+
const path3 = `/payments/${encodeURIComponent(paymentId)}`;
|
|
3084
|
+
if (options === void 0) return this.request("GET", path3);
|
|
3055
3085
|
const query = {};
|
|
3056
3086
|
if (options.force_sync !== void 0) query["force_sync"] = options.force_sync;
|
|
3057
3087
|
if (options.all_keys_required !== void 0) {
|
|
3058
3088
|
query["all_keys_required"] = options.all_keys_required;
|
|
3059
3089
|
}
|
|
3060
|
-
if (Object.keys(query).length === 0) return this.request("GET",
|
|
3061
|
-
return this.request("GET",
|
|
3090
|
+
if (Object.keys(query).length === 0) return this.request("GET", path3);
|
|
3091
|
+
return this.request("GET", path3, { query });
|
|
3062
3092
|
}
|
|
3063
3093
|
/**
|
|
3064
3094
|
* The payment's buyer risk evaluations, newest first (at most 50): each
|
|
@@ -3413,6 +3443,36 @@ var Payments = class {
|
|
|
3413
3443
|
options
|
|
3414
3444
|
);
|
|
3415
3445
|
}
|
|
3446
|
+
/**
|
|
3447
|
+
* The statement name and suffix each attempt of a payment asked for and was
|
|
3448
|
+
* sent to its provider with. A name the merchant, the shop or the connector
|
|
3449
|
+
* account configures replaces the payment's own: `name_ignored` /
|
|
3450
|
+
* `suffix_ignored` say the payment's value was not used, and a `null` sent
|
|
3451
|
+
* value leaves the provider account's own default.
|
|
3452
|
+
*
|
|
3453
|
+
* Only attempts with a record are listed: one that carried no name and was
|
|
3454
|
+
* sent none, or ran before the record existed, is absent.
|
|
3455
|
+
*
|
|
3456
|
+
* `GET /payments/{paymentId}/statement-descriptors`
|
|
3457
|
+
*
|
|
3458
|
+
* @param paymentId - The payment intent ID.
|
|
3459
|
+
* @param options - Optional per-call extras: extra `headers`, a `timeout`
|
|
3460
|
+
* override, and an `AbortSignal`.
|
|
3461
|
+
*
|
|
3462
|
+
* @example
|
|
3463
|
+
* ```typescript
|
|
3464
|
+
* const { attempts } = await delopay.payments.statementDescriptors('pay_abc123');
|
|
3465
|
+
* const last = attempts.at(-1);
|
|
3466
|
+
* if (last?.name_ignored) console.log(`Sent as ${last.sent_name}`);
|
|
3467
|
+
* ```
|
|
3468
|
+
*/
|
|
3469
|
+
async statementDescriptors(paymentId, options) {
|
|
3470
|
+
return this.request(
|
|
3471
|
+
"GET",
|
|
3472
|
+
`/payments/${encodeURIComponent(paymentId)}/statement-descriptors`,
|
|
3473
|
+
options
|
|
3474
|
+
);
|
|
3475
|
+
}
|
|
3416
3476
|
/**
|
|
3417
3477
|
* Open a playback of the payment's stored checkout recording: the audited
|
|
3418
3478
|
* act of watching. Answers the manifest — which slices exist, how long the
|
|
@@ -3938,9 +3998,9 @@ var Projects = class {
|
|
|
3938
3998
|
* @returns The project.
|
|
3939
3999
|
*/
|
|
3940
4000
|
async retrieve(projectId, merchantId) {
|
|
3941
|
-
const
|
|
3942
|
-
if (merchantId === void 0) return this.request("GET",
|
|
3943
|
-
return this.request("GET",
|
|
4001
|
+
const path3 = `/projects/${encodeURIComponent(projectId)}`;
|
|
4002
|
+
if (merchantId === void 0) return this.request("GET", path3);
|
|
4003
|
+
return this.request("GET", path3, { query: { merchant_id: merchantId } });
|
|
3944
4004
|
}
|
|
3945
4005
|
/**
|
|
3946
4006
|
* Update a project's details, or move it with `parent_id` (omitted keeps the
|
|
@@ -3958,9 +4018,9 @@ var Projects = class {
|
|
|
3958
4018
|
* @returns The updated project.
|
|
3959
4019
|
*/
|
|
3960
4020
|
async update(projectId, params, merchantId, options) {
|
|
3961
|
-
const
|
|
3962
|
-
if (merchantId === void 0) return this.request("PUT",
|
|
3963
|
-
return this.request("PUT",
|
|
4021
|
+
const path3 = `/projects/${encodeURIComponent(projectId)}`;
|
|
4022
|
+
if (merchantId === void 0) return this.request("PUT", path3, { body: params, ...options });
|
|
4023
|
+
return this.request("PUT", path3, {
|
|
3964
4024
|
body: params,
|
|
3965
4025
|
query: { merchant_id: merchantId },
|
|
3966
4026
|
...options
|
|
@@ -3977,9 +4037,9 @@ var Projects = class {
|
|
|
3977
4037
|
* @returns The deleted project object.
|
|
3978
4038
|
*/
|
|
3979
4039
|
async delete(projectId, merchantId) {
|
|
3980
|
-
const
|
|
3981
|
-
if (merchantId === void 0) return this.request("DELETE",
|
|
3982
|
-
return this.request("DELETE",
|
|
4040
|
+
const path3 = `/projects/${encodeURIComponent(projectId)}`;
|
|
4041
|
+
if (merchantId === void 0) return this.request("DELETE", path3);
|
|
4042
|
+
return this.request("DELETE", path3, { query: { merchant_id: merchantId } });
|
|
3983
4043
|
}
|
|
3984
4044
|
/**
|
|
3985
4045
|
* List all projects for a merchant, at every level, as a flat array. Rebuild
|
|
@@ -4984,9 +5044,9 @@ var Shops = class {
|
|
|
4984
5044
|
* ```
|
|
4985
5045
|
*/
|
|
4986
5046
|
async stats(merchantId, shopId, period) {
|
|
4987
|
-
const
|
|
4988
|
-
if (period === void 0) return this.request("GET",
|
|
4989
|
-
return this.request("GET",
|
|
5047
|
+
const path3 = `/shops/${encodeURIComponent(merchantId)}/${encodeURIComponent(shopId)}/stats`;
|
|
5048
|
+
if (period === void 0) return this.request("GET", path3);
|
|
5049
|
+
return this.request("GET", path3, { query: { period: String(period) } });
|
|
4990
5050
|
}
|
|
4991
5051
|
/**
|
|
4992
5052
|
* Upload a logo file for a shop. The file is stored in Delopay's configured
|
|
@@ -8271,6 +8331,69 @@ var Products = class {
|
|
|
8271
8331
|
}
|
|
8272
8332
|
};
|
|
8273
8333
|
|
|
8334
|
+
// src/resources/support.ts
|
|
8335
|
+
var path = (id) => `/support/conversations/${encodeURIComponent(id)}`;
|
|
8336
|
+
var Support = class {
|
|
8337
|
+
constructor(request) {
|
|
8338
|
+
this.request = request;
|
|
8339
|
+
}
|
|
8340
|
+
/** Start a conversation with its first message. `POST /support/conversations` */
|
|
8341
|
+
async create(body) {
|
|
8342
|
+
return this.request("POST", "/support/conversations", { body });
|
|
8343
|
+
}
|
|
8344
|
+
/** The conversations the caller may read. `GET /support/conversations` */
|
|
8345
|
+
async list(query) {
|
|
8346
|
+
return this.request("GET", "/support/conversations", {
|
|
8347
|
+
query: query === void 0 ? void 0 : { ...query }
|
|
8348
|
+
});
|
|
8349
|
+
}
|
|
8350
|
+
/** One conversation. `GET /support/conversations/{id}` */
|
|
8351
|
+
async retrieve(id) {
|
|
8352
|
+
return this.request("GET", path(id));
|
|
8353
|
+
}
|
|
8354
|
+
/** A conversation's messages. `GET /support/conversations/{id}/messages` */
|
|
8355
|
+
async messages(id, query) {
|
|
8356
|
+
return this.request("GET", `${path(id)}/messages`, {
|
|
8357
|
+
query: query === void 0 ? void 0 : { ...query }
|
|
8358
|
+
});
|
|
8359
|
+
}
|
|
8360
|
+
/** Answer in a conversation. `POST /support/conversations/{id}/messages` */
|
|
8361
|
+
async reply(id, body) {
|
|
8362
|
+
return this.request("POST", `${path(id)}/messages`, { body });
|
|
8363
|
+
}
|
|
8364
|
+
/**
|
|
8365
|
+
* Upload a file for a message. PNG, JPEG, WebP, PDF, text, MP4 or WebM, read from the
|
|
8366
|
+
* content; 10 MB, a video 25 MB. It belongs to the caller until a message names it in
|
|
8367
|
+
* `attachments`. Uploading again with the same `clientUploadId` returns the same file.
|
|
8368
|
+
* `POST /support/conversations/{id}/attachments`
|
|
8369
|
+
*/
|
|
8370
|
+
async uploadAttachment(id, file, clientUploadId, fileName) {
|
|
8371
|
+
const form = new FormData();
|
|
8372
|
+
form.append("client_upload_id", clientUploadId);
|
|
8373
|
+
if (fileName === void 0) form.append("file", file);
|
|
8374
|
+
else form.append("file", file, fileName);
|
|
8375
|
+
return this.request("POST", `${path(id)}/attachments`, { body: form });
|
|
8376
|
+
}
|
|
8377
|
+
/**
|
|
8378
|
+
* Fetch a file once its scan is clean. Refused with `support_attachment_checking` while
|
|
8379
|
+
* the scan runs, and `support_attachment_blocked` after a block.
|
|
8380
|
+
* `GET /support/conversations/{id}/attachments/{fileId}`
|
|
8381
|
+
*/
|
|
8382
|
+
async downloadAttachment(id, fileId) {
|
|
8383
|
+
return this.request("GET", `${path(id)}/attachments/${encodeURIComponent(fileId)}`, {
|
|
8384
|
+
responseType: "blob"
|
|
8385
|
+
});
|
|
8386
|
+
}
|
|
8387
|
+
/**
|
|
8388
|
+
* Clear the merchant's unread mark and read the conversation as it is now.
|
|
8389
|
+
* Someone acting as somebody else leaves the mark in place.
|
|
8390
|
+
* `POST /support/conversations/{id}/read`
|
|
8391
|
+
*/
|
|
8392
|
+
async markRead(id) {
|
|
8393
|
+
return this.request("POST", `${path(id)}/read`);
|
|
8394
|
+
}
|
|
8395
|
+
};
|
|
8396
|
+
|
|
8274
8397
|
// src/resources/invoices.ts
|
|
8275
8398
|
var Invoices = class {
|
|
8276
8399
|
constructor(request) {
|
|
@@ -10739,8 +10862,8 @@ var LiveEventStream = class {
|
|
|
10739
10862
|
return toLiveStreamEvent(dispatch.event, this._lastEventId, this._retry);
|
|
10740
10863
|
}
|
|
10741
10864
|
};
|
|
10742
|
-
async function openLiveStream(openStream,
|
|
10743
|
-
const connection = await openStream(
|
|
10865
|
+
async function openLiveStream(openStream, path3, options = {}) {
|
|
10866
|
+
const connection = await openStream(path3, {
|
|
10744
10867
|
...options.lastEventId ? { lastEventId: options.lastEventId } : {},
|
|
10745
10868
|
...options.signal ? { signal: options.signal } : {},
|
|
10746
10869
|
...options.idleTimeoutMs !== void 0 ? { idleTimeoutMs: options.idleTimeoutMs } : {},
|
|
@@ -10927,8 +11050,8 @@ var ProcessorImports = class {
|
|
|
10927
11050
|
|
|
10928
11051
|
// src/resources/deploymentBranding.ts
|
|
10929
11052
|
function brandingAssetPath(asset, version) {
|
|
10930
|
-
const
|
|
10931
|
-
return version ? `${
|
|
11053
|
+
const path3 = `/branding/assets/${encodeURIComponent(asset)}`;
|
|
11054
|
+
return version ? `${path3}?v=${encodeURIComponent(version)}` : path3;
|
|
10932
11055
|
}
|
|
10933
11056
|
var Branding = class {
|
|
10934
11057
|
constructor(request, baseUrl) {
|
|
@@ -11262,6 +11385,7 @@ var Delopay = class {
|
|
|
11262
11385
|
this.costRules = new CostRules(request);
|
|
11263
11386
|
this.externalRecords = new ExternalRecords(request);
|
|
11264
11387
|
this.products = new Products(request);
|
|
11388
|
+
this.support = new Support(request);
|
|
11265
11389
|
this.invoices = new Invoices(request);
|
|
11266
11390
|
this.invoiceSettings = new InvoiceSettingsResource(request);
|
|
11267
11391
|
this.processorCosts = new ProcessorCosts(request);
|
|
@@ -11322,8 +11446,8 @@ var Delopay = class {
|
|
|
11322
11446
|
return response;
|
|
11323
11447
|
}
|
|
11324
11448
|
/** `path` on the base URL, with the query string `query` makes. */
|
|
11325
|
-
buildUrl(
|
|
11326
|
-
let url = `${this.baseUrl}${
|
|
11449
|
+
buildUrl(path3, query) {
|
|
11450
|
+
let url = `${this.baseUrl}${path3}`;
|
|
11327
11451
|
if (query) {
|
|
11328
11452
|
const params = new URLSearchParams();
|
|
11329
11453
|
for (const [key, value] of Object.entries(query)) {
|
|
@@ -11393,8 +11517,8 @@ var Delopay = class {
|
|
|
11393
11517
|
* on a 2xx that is not `text/event-stream` (code `NOT_EVENT_STREAM`), and
|
|
11394
11518
|
* with `TIMEOUT`, `NETWORK` or `ABORTED` like `request()`.
|
|
11395
11519
|
*/
|
|
11396
|
-
async openEventStream(
|
|
11397
|
-
const url = this.buildUrl(
|
|
11520
|
+
async openEventStream(path3, options = {}) {
|
|
11521
|
+
const url = this.buildUrl(path3, options.query);
|
|
11398
11522
|
const lastEventId = options.lastEventId ?? "";
|
|
11399
11523
|
const headers = {
|
|
11400
11524
|
...this.authHeaders(),
|
|
@@ -11434,7 +11558,7 @@ var Delopay = class {
|
|
|
11434
11558
|
`Network error: ${cause instanceof Error ? cause.message : String(cause ?? "stream failed")}`,
|
|
11435
11559
|
{ status: 0, code: "NETWORK", type: "network_error" }
|
|
11436
11560
|
);
|
|
11437
|
-
this.log("request", { method: "GET", url: redactUrlForLogging(url), path });
|
|
11561
|
+
this.log("request", { method: "GET", url: redactUrlForLogging(url), path: path3 });
|
|
11438
11562
|
startIdleTimer();
|
|
11439
11563
|
let response;
|
|
11440
11564
|
try {
|
|
@@ -11446,7 +11570,7 @@ var Delopay = class {
|
|
|
11446
11570
|
throw network(err);
|
|
11447
11571
|
}
|
|
11448
11572
|
const requestId = response.headers?.get("x-request-id") ?? response.headers?.get("x-trace-id") ?? void 0;
|
|
11449
|
-
this.log("response", { status: response.status, method: "GET", path, requestId });
|
|
11573
|
+
this.log("response", { status: response.status, method: "GET", path: path3, requestId });
|
|
11450
11574
|
if (!response.ok) {
|
|
11451
11575
|
const error = await errorFromResponse(response, requestId);
|
|
11452
11576
|
release();
|
|
@@ -11532,8 +11656,8 @@ var Delopay = class {
|
|
|
11532
11656
|
* @throws {DelopayAuthenticationError} On 401 responses.
|
|
11533
11657
|
* @throws {DelopayError} On all other non-2xx responses, timeouts, and network errors.
|
|
11534
11658
|
*/
|
|
11535
|
-
async request(method,
|
|
11536
|
-
const url = this.buildUrl(
|
|
11659
|
+
async request(method, path3, options) {
|
|
11660
|
+
const url = this.buildUrl(path3, options?.query);
|
|
11537
11661
|
let headers = {
|
|
11538
11662
|
...this.authHeaders(),
|
|
11539
11663
|
...this.profileHeaders(options?.headers),
|
|
@@ -11597,7 +11721,7 @@ var Delopay = class {
|
|
|
11597
11721
|
const delay = Math.max(retryAfterOverrideMs ?? 0, jittered);
|
|
11598
11722
|
retryAfterOverrideMs = null;
|
|
11599
11723
|
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
11600
|
-
emit("retry", { attempt, maxRetries: this.maxRetries, method, path });
|
|
11724
|
+
emit("retry", { attempt, maxRetries: this.maxRetries, method, path: path3 });
|
|
11601
11725
|
}
|
|
11602
11726
|
const timeoutCtrl = new AbortController();
|
|
11603
11727
|
let timeoutId = setTimeout(() => timeoutCtrl.abort(), timeoutMs);
|
|
@@ -11610,7 +11734,7 @@ var Delopay = class {
|
|
|
11610
11734
|
callerSignal ? [timeoutCtrl.signal, callerSignal] : [timeoutCtrl.signal]
|
|
11611
11735
|
);
|
|
11612
11736
|
try {
|
|
11613
|
-
emit("request", { method, url: safeUrl(), path });
|
|
11737
|
+
emit("request", { method, url: safeUrl(), path: path3 });
|
|
11614
11738
|
const response = await fetch(url, {
|
|
11615
11739
|
method,
|
|
11616
11740
|
headers,
|
|
@@ -11619,7 +11743,7 @@ var Delopay = class {
|
|
|
11619
11743
|
...options?.keepalive !== void 0 ? { keepalive: options.keepalive } : {}
|
|
11620
11744
|
});
|
|
11621
11745
|
const requestId = response.headers?.get("x-request-id") ?? response.headers?.get("x-trace-id") ?? void 0;
|
|
11622
|
-
emit("response", { status: response.status, method, path, requestId });
|
|
11746
|
+
emit("response", { status: response.status, method, path: path3, requestId });
|
|
11623
11747
|
if (!response.ok) {
|
|
11624
11748
|
const error = await errorFromResponse(response, requestId);
|
|
11625
11749
|
const isTransientStatus = response.status >= 500 || response.status === 429;
|
|
@@ -16951,7 +17075,7 @@ function encodePanes(panes) {
|
|
|
16951
17075
|
var OPAQUE_PAYMENT_LINK_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
|
|
16952
17076
|
function focusedCheckoutUrl(params) {
|
|
16953
17077
|
const base = params.checkoutBaseUrl.replace(/\/+$/, "");
|
|
16954
|
-
const
|
|
17078
|
+
const path3 = params.paymentLinkId && OPAQUE_PAYMENT_LINK_ID.test(params.paymentLinkId) ? `${base}/pay/${params.paymentLinkId}` : `${base}/pay/${encodeURIComponent(params.merchantId)}/${encodeURIComponent(
|
|
16955
17079
|
params.paymentId
|
|
16956
17080
|
)}`;
|
|
16957
17081
|
const query = new URLSearchParams({ pane: params.method });
|
|
@@ -16961,16 +17085,16 @@ function focusedCheckoutUrl(params) {
|
|
|
16961
17085
|
if (merchantConnectorId) query.set("mca", merchantConnectorId);
|
|
16962
17086
|
if (params.locale) query.set("locale", params.locale);
|
|
16963
17087
|
if (params.customFieldsCollected) query.set("cf", "1");
|
|
16964
|
-
return `${
|
|
17088
|
+
return `${path3}?${query.toString()}`;
|
|
16965
17089
|
}
|
|
16966
17090
|
function checkoutEntryUrl(params) {
|
|
16967
17091
|
const base = params.checkoutBaseUrl.replace(/\/+$/, "");
|
|
16968
|
-
const
|
|
17092
|
+
const path3 = params.paymentLinkId && OPAQUE_PAYMENT_LINK_ID.test(params.paymentLinkId) ? `${base}/pay/${params.paymentLinkId}` : `${base}/pay/${encodeURIComponent(params.merchantId)}/${encodeURIComponent(
|
|
16969
17093
|
params.paymentId
|
|
16970
17094
|
)}`;
|
|
16971
17095
|
const query = new URLSearchParams({ entry: params.entry.trim() });
|
|
16972
17096
|
if (params.locale) query.set("locale", params.locale);
|
|
16973
|
-
return `${
|
|
17097
|
+
return `${path3}?${query.toString()}`;
|
|
16974
17098
|
}
|
|
16975
17099
|
function isCheckoutOpenEntryMessage(data) {
|
|
16976
17100
|
if (typeof data !== "object" || data === null) return false;
|
|
@@ -17446,6 +17570,27 @@ var AdminPortal = class {
|
|
|
17446
17570
|
query: { ...preventionCaseQuery(filters), ...merchant_id ? { merchant_id } : {} }
|
|
17447
17571
|
});
|
|
17448
17572
|
}
|
|
17573
|
+
/** Chargeback prevention refund rules across merchants, or of one merchant. */
|
|
17574
|
+
async listChargebackPreventionRefundRules(params) {
|
|
17575
|
+
return this.request("GET", "/admin-portal/chargeback-prevention/refund-rules", {
|
|
17576
|
+
query: params
|
|
17577
|
+
});
|
|
17578
|
+
}
|
|
17579
|
+
/**
|
|
17580
|
+
* Turn a merchant's refund rule off. Its settings are kept, and what it
|
|
17581
|
+
* already did is still settled and reported.
|
|
17582
|
+
*/
|
|
17583
|
+
async stopChargebackPreventionRefundRule(body) {
|
|
17584
|
+
return this.request("POST", "/admin-portal/chargeback-prevention/refund-rules/disable", {
|
|
17585
|
+
body
|
|
17586
|
+
});
|
|
17587
|
+
}
|
|
17588
|
+
/** What refund rules did, across merchants or for one merchant. */
|
|
17589
|
+
async listChargebackPreventionRefundActions(params) {
|
|
17590
|
+
return this.request("GET", "/admin-portal/chargeback-prevention/refund-actions", {
|
|
17591
|
+
query: params
|
|
17592
|
+
});
|
|
17593
|
+
}
|
|
17449
17594
|
/** One chargeback prevention case of any merchant, with its history. */
|
|
17450
17595
|
async getChargebackPreventionCase(caseId) {
|
|
17451
17596
|
return this.request(
|
|
@@ -17610,6 +17755,15 @@ var AdminPortal = class {
|
|
|
17610
17755
|
query
|
|
17611
17756
|
});
|
|
17612
17757
|
}
|
|
17758
|
+
/**
|
|
17759
|
+
* Every shop's device intelligence account, with its assessments per environment and
|
|
17760
|
+
* its error rate over the last `window_days` days. The error rate counts finished
|
|
17761
|
+
* assessments: one still running and a payment naming no buyer are not errors.
|
|
17762
|
+
* `GET /admin-portal/device-intelligence`
|
|
17763
|
+
*/
|
|
17764
|
+
async deviceIntelligenceUsage() {
|
|
17765
|
+
return this.request("GET", "/admin-portal/device-intelligence");
|
|
17766
|
+
}
|
|
17613
17767
|
/**
|
|
17614
17768
|
* Device analytics over the canonical client-context observation per
|
|
17615
17769
|
* payment, rooted at all merchants and drillable via `merchant_id` /
|
|
@@ -18421,6 +18575,65 @@ function adminAccount(merchantId) {
|
|
|
18421
18575
|
return `/admin-portal/accounts/${encodeURIComponent(merchantId)}`;
|
|
18422
18576
|
}
|
|
18423
18577
|
|
|
18578
|
+
// src/internal/resources/adminSupport.ts
|
|
18579
|
+
var path2 = (id) => `/admin-portal/support/conversations/${encodeURIComponent(id)}`;
|
|
18580
|
+
var AdminSupport = class {
|
|
18581
|
+
constructor(request) {
|
|
18582
|
+
this.request = request;
|
|
18583
|
+
}
|
|
18584
|
+
/** The queue. `GET /admin-portal/support/conversations` */
|
|
18585
|
+
async list(query) {
|
|
18586
|
+
return this.request("GET", "/admin-portal/support/conversations", {
|
|
18587
|
+
query: query === void 0 ? void 0 : { ...query }
|
|
18588
|
+
});
|
|
18589
|
+
}
|
|
18590
|
+
/** One conversation. `GET /admin-portal/support/conversations/{id}` */
|
|
18591
|
+
async retrieve(id) {
|
|
18592
|
+
return this.request("GET", path2(id));
|
|
18593
|
+
}
|
|
18594
|
+
/** Change status, kind, category or assignee. `PATCH /admin-portal/support/conversations/{id}` */
|
|
18595
|
+
async update(id, body) {
|
|
18596
|
+
return this.request("PATCH", path2(id), { body });
|
|
18597
|
+
}
|
|
18598
|
+
/** Messages, notes included. `GET /admin-portal/support/conversations/{id}/messages` */
|
|
18599
|
+
async messages(id, query) {
|
|
18600
|
+
return this.request("GET", `${path2(id)}/messages`, {
|
|
18601
|
+
query: query === void 0 ? void 0 : { ...query }
|
|
18602
|
+
});
|
|
18603
|
+
}
|
|
18604
|
+
/** Answer, or leave a note. `POST /admin-portal/support/conversations/{id}/messages` */
|
|
18605
|
+
async reply(id, body) {
|
|
18606
|
+
return this.request("POST", `${path2(id)}/messages`, { body });
|
|
18607
|
+
}
|
|
18608
|
+
/**
|
|
18609
|
+
* Upload a file for a message from staff, scanned like a merchant's.
|
|
18610
|
+
* `POST /admin-portal/support/conversations/{id}/attachments`
|
|
18611
|
+
*/
|
|
18612
|
+
async uploadAttachment(id, file, clientUploadId, fileName) {
|
|
18613
|
+
const form = new FormData();
|
|
18614
|
+
form.append("client_upload_id", clientUploadId);
|
|
18615
|
+
if (fileName === void 0) form.append("file", file);
|
|
18616
|
+
else form.append("file", file, fileName);
|
|
18617
|
+
return this.request("POST", `${path2(id)}/attachments`, { body: form });
|
|
18618
|
+
}
|
|
18619
|
+
/**
|
|
18620
|
+
* Fetch a file once its scan is clean. A blocked file stays shut for staff too.
|
|
18621
|
+
* `GET /admin-portal/support/conversations/{id}/attachments/{fileId}`
|
|
18622
|
+
*/
|
|
18623
|
+
async downloadAttachment(id, fileId) {
|
|
18624
|
+
return this.request("GET", `${path2(id)}/attachments/${encodeURIComponent(fileId)}`, {
|
|
18625
|
+
responseType: "blob"
|
|
18626
|
+
});
|
|
18627
|
+
}
|
|
18628
|
+
/**
|
|
18629
|
+
* Clear the staff unread mark and read the conversation as it is now.
|
|
18630
|
+
* `POST /admin-portal/support/conversations/{id}/read`
|
|
18631
|
+
*/
|
|
18632
|
+
async markRead(id) {
|
|
18633
|
+
return this.request("POST", `${path2(id)}/read`);
|
|
18634
|
+
}
|
|
18635
|
+
};
|
|
18636
|
+
|
|
18424
18637
|
// src/internal/resources/auditLogs.ts
|
|
18425
18638
|
var AuditLogs = class {
|
|
18426
18639
|
constructor(request) {
|
|
@@ -19200,6 +19413,7 @@ var DelopayInternal = class extends Delopay {
|
|
|
19200
19413
|
const request = this.request.bind(this);
|
|
19201
19414
|
this.admin = new Admin(request);
|
|
19202
19415
|
this.adminPortal = new AdminPortal(request);
|
|
19416
|
+
this.adminSupport = new AdminSupport(request);
|
|
19203
19417
|
const openStream = this.openEventStream.bind(this);
|
|
19204
19418
|
this.adminLive = new AdminLive(request, openStream);
|
|
19205
19419
|
this.adminBranding = new AdminBranding(request);
|
|
@@ -19239,6 +19453,7 @@ var DelopayInternal = class extends Delopay {
|
|
|
19239
19453
|
AdminBranding,
|
|
19240
19454
|
AdminLive,
|
|
19241
19455
|
AdminPortal,
|
|
19456
|
+
AdminSupport,
|
|
19242
19457
|
Analytics,
|
|
19243
19458
|
AnalyticsDashboard,
|
|
19244
19459
|
Audit,
|
|
@@ -19386,6 +19601,7 @@ var DelopayInternal = class extends Delopay {
|
|
|
19386
19601
|
Settlement,
|
|
19387
19602
|
ShopLabels,
|
|
19388
19603
|
Subscriptions,
|
|
19604
|
+
Support,
|
|
19389
19605
|
UNKNOWN_SECTION_ORDER,
|
|
19390
19606
|
WCAG_AA_TEXT,
|
|
19391
19607
|
WCAG_AA_UI,
|