@delopay/sdk 0.366.0 → 0.370.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-ESYKTYJA.js → chunk-RD3HP3EY.js} +136 -41
- package/dist/chunk-RD3HP3EY.js.map +1 -0
- package/dist/{index-C2-7sIZx.d.cts → index-Goi7qJqZ.d.cts} +324 -5
- package/dist/{index-C2-7sIZx.d.ts → index-Goi7qJqZ.d.ts} +324 -5
- package/dist/index.cjs +136 -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 +264 -40
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +311 -3
- package/dist/internal.d.ts +311 -3
- package/dist/internal.js +129 -1
- package/dist/internal.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-ESYKTYJA.js.map +0 -1
package/dist/internal.cjs
CHANGED
|
@@ -37,8 +37,10 @@ __export(internal_exports, {
|
|
|
37
37
|
APPLE_PAY_BUTTON_TYPES: () => APPLE_PAY_BUTTON_TYPES,
|
|
38
38
|
Admin: () => Admin,
|
|
39
39
|
AdminBranding: () => AdminBranding,
|
|
40
|
+
AdminIndustries: () => AdminIndustries,
|
|
40
41
|
AdminLive: () => AdminLive,
|
|
41
42
|
AdminPortal: () => AdminPortal,
|
|
43
|
+
AdminSupport: () => AdminSupport,
|
|
42
44
|
Analytics: () => Analytics,
|
|
43
45
|
AnalyticsDashboard: () => AnalyticsDashboard,
|
|
44
46
|
Audit: () => Audit,
|
|
@@ -186,6 +188,7 @@ __export(internal_exports, {
|
|
|
186
188
|
Settlement: () => Settlement,
|
|
187
189
|
ShopLabels: () => ShopLabels,
|
|
188
190
|
Subscriptions: () => Subscriptions,
|
|
191
|
+
Support: () => Support,
|
|
189
192
|
UNKNOWN_SECTION_ORDER: () => UNKNOWN_SECTION_ORDER,
|
|
190
193
|
WCAG_AA_TEXT: () => WCAG_AA_TEXT,
|
|
191
194
|
WCAG_AA_UI: () => WCAG_AA_UI,
|
|
@@ -1273,9 +1276,9 @@ var Connectors = class {
|
|
|
1273
1276
|
* to a single event.
|
|
1274
1277
|
*/
|
|
1275
1278
|
async registerWebhook(merchantId, connectorId, params) {
|
|
1276
|
-
const
|
|
1277
|
-
if (params === void 0) return this.request("POST",
|
|
1278
|
-
return this.request("POST",
|
|
1279
|
+
const path4 = `/account/${encodeURIComponent(merchantId)}/connectors/webhooks/${encodeURIComponent(connectorId)}`;
|
|
1280
|
+
if (params === void 0) return this.request("POST", path4);
|
|
1281
|
+
return this.request("POST", path4, { body: params });
|
|
1279
1282
|
}
|
|
1280
1283
|
/**
|
|
1281
1284
|
* Register checkout/shop domains as Stripe payment method domains, so Apple
|
|
@@ -2073,11 +2076,11 @@ function negotiated(options, format, presentation) {
|
|
|
2073
2076
|
}
|
|
2074
2077
|
return format === "json" ? { ...options, headers } : { ...options, headers, responseType: "blob" };
|
|
2075
2078
|
}
|
|
2076
|
-
function runExport(request, method,
|
|
2079
|
+
function runExport(request, method, path4, base, options) {
|
|
2077
2080
|
const format = options?.format ?? "json";
|
|
2078
2081
|
return downloadExport(
|
|
2079
2082
|
request,
|
|
2080
|
-
{ method, path, request: negotiated(base, format, options?.presentation), format },
|
|
2083
|
+
{ method, path: path4, request: negotiated(base, format, options?.presentation), format },
|
|
2081
2084
|
options
|
|
2082
2085
|
);
|
|
2083
2086
|
}
|
|
@@ -3078,15 +3081,15 @@ var Payments = class {
|
|
|
3078
3081
|
* ```
|
|
3079
3082
|
*/
|
|
3080
3083
|
async retrieve(paymentId, options) {
|
|
3081
|
-
const
|
|
3082
|
-
if (options === void 0) return this.request("GET",
|
|
3084
|
+
const path4 = `/payments/${encodeURIComponent(paymentId)}`;
|
|
3085
|
+
if (options === void 0) return this.request("GET", path4);
|
|
3083
3086
|
const query = {};
|
|
3084
3087
|
if (options.force_sync !== void 0) query["force_sync"] = options.force_sync;
|
|
3085
3088
|
if (options.all_keys_required !== void 0) {
|
|
3086
3089
|
query["all_keys_required"] = options.all_keys_required;
|
|
3087
3090
|
}
|
|
3088
|
-
if (Object.keys(query).length === 0) return this.request("GET",
|
|
3089
|
-
return this.request("GET",
|
|
3091
|
+
if (Object.keys(query).length === 0) return this.request("GET", path4);
|
|
3092
|
+
return this.request("GET", path4, { query });
|
|
3090
3093
|
}
|
|
3091
3094
|
/**
|
|
3092
3095
|
* The payment's buyer risk evaluations, newest first (at most 50): each
|
|
@@ -3441,6 +3444,36 @@ var Payments = class {
|
|
|
3441
3444
|
options
|
|
3442
3445
|
);
|
|
3443
3446
|
}
|
|
3447
|
+
/**
|
|
3448
|
+
* The statement name and suffix each attempt of a payment asked for and was
|
|
3449
|
+
* sent to its provider with. A name the merchant, the shop or the connector
|
|
3450
|
+
* account configures replaces the payment's own: `name_ignored` /
|
|
3451
|
+
* `suffix_ignored` say the payment's value was not used, and a `null` sent
|
|
3452
|
+
* value leaves the provider account's own default.
|
|
3453
|
+
*
|
|
3454
|
+
* Only attempts with a record are listed: one that carried no name and was
|
|
3455
|
+
* sent none, or ran before the record existed, is absent.
|
|
3456
|
+
*
|
|
3457
|
+
* `GET /payments/{paymentId}/statement-descriptors`
|
|
3458
|
+
*
|
|
3459
|
+
* @param paymentId - The payment intent ID.
|
|
3460
|
+
* @param options - Optional per-call extras: extra `headers`, a `timeout`
|
|
3461
|
+
* override, and an `AbortSignal`.
|
|
3462
|
+
*
|
|
3463
|
+
* @example
|
|
3464
|
+
* ```typescript
|
|
3465
|
+
* const { attempts } = await delopay.payments.statementDescriptors('pay_abc123');
|
|
3466
|
+
* const last = attempts.at(-1);
|
|
3467
|
+
* if (last?.name_ignored) console.log(`Sent as ${last.sent_name}`);
|
|
3468
|
+
* ```
|
|
3469
|
+
*/
|
|
3470
|
+
async statementDescriptors(paymentId, options) {
|
|
3471
|
+
return this.request(
|
|
3472
|
+
"GET",
|
|
3473
|
+
`/payments/${encodeURIComponent(paymentId)}/statement-descriptors`,
|
|
3474
|
+
options
|
|
3475
|
+
);
|
|
3476
|
+
}
|
|
3444
3477
|
/**
|
|
3445
3478
|
* Open a playback of the payment's stored checkout recording: the audited
|
|
3446
3479
|
* act of watching. Answers the manifest — which slices exist, how long the
|
|
@@ -3966,9 +3999,9 @@ var Projects = class {
|
|
|
3966
3999
|
* @returns The project.
|
|
3967
4000
|
*/
|
|
3968
4001
|
async retrieve(projectId, merchantId) {
|
|
3969
|
-
const
|
|
3970
|
-
if (merchantId === void 0) return this.request("GET",
|
|
3971
|
-
return this.request("GET",
|
|
4002
|
+
const path4 = `/projects/${encodeURIComponent(projectId)}`;
|
|
4003
|
+
if (merchantId === void 0) return this.request("GET", path4);
|
|
4004
|
+
return this.request("GET", path4, { query: { merchant_id: merchantId } });
|
|
3972
4005
|
}
|
|
3973
4006
|
/**
|
|
3974
4007
|
* Update a project's details, or move it with `parent_id` (omitted keeps the
|
|
@@ -3986,9 +4019,9 @@ var Projects = class {
|
|
|
3986
4019
|
* @returns The updated project.
|
|
3987
4020
|
*/
|
|
3988
4021
|
async update(projectId, params, merchantId, options) {
|
|
3989
|
-
const
|
|
3990
|
-
if (merchantId === void 0) return this.request("PUT",
|
|
3991
|
-
return this.request("PUT",
|
|
4022
|
+
const path4 = `/projects/${encodeURIComponent(projectId)}`;
|
|
4023
|
+
if (merchantId === void 0) return this.request("PUT", path4, { body: params, ...options });
|
|
4024
|
+
return this.request("PUT", path4, {
|
|
3992
4025
|
body: params,
|
|
3993
4026
|
query: { merchant_id: merchantId },
|
|
3994
4027
|
...options
|
|
@@ -4005,9 +4038,9 @@ var Projects = class {
|
|
|
4005
4038
|
* @returns The deleted project object.
|
|
4006
4039
|
*/
|
|
4007
4040
|
async delete(projectId, merchantId) {
|
|
4008
|
-
const
|
|
4009
|
-
if (merchantId === void 0) return this.request("DELETE",
|
|
4010
|
-
return this.request("DELETE",
|
|
4041
|
+
const path4 = `/projects/${encodeURIComponent(projectId)}`;
|
|
4042
|
+
if (merchantId === void 0) return this.request("DELETE", path4);
|
|
4043
|
+
return this.request("DELETE", path4, { query: { merchant_id: merchantId } });
|
|
4011
4044
|
}
|
|
4012
4045
|
/**
|
|
4013
4046
|
* List all projects for a merchant, at every level, as a flat array. Rebuild
|
|
@@ -5012,9 +5045,9 @@ var Shops = class {
|
|
|
5012
5045
|
* ```
|
|
5013
5046
|
*/
|
|
5014
5047
|
async stats(merchantId, shopId, period) {
|
|
5015
|
-
const
|
|
5016
|
-
if (period === void 0) return this.request("GET",
|
|
5017
|
-
return this.request("GET",
|
|
5048
|
+
const path4 = `/shops/${encodeURIComponent(merchantId)}/${encodeURIComponent(shopId)}/stats`;
|
|
5049
|
+
if (period === void 0) return this.request("GET", path4);
|
|
5050
|
+
return this.request("GET", path4, { query: { period: String(period) } });
|
|
5018
5051
|
}
|
|
5019
5052
|
/**
|
|
5020
5053
|
* Upload a logo file for a shop. The file is stored in Delopay's configured
|
|
@@ -8299,6 +8332,69 @@ var Products = class {
|
|
|
8299
8332
|
}
|
|
8300
8333
|
};
|
|
8301
8334
|
|
|
8335
|
+
// src/resources/support.ts
|
|
8336
|
+
var path = (id) => `/support/conversations/${encodeURIComponent(id)}`;
|
|
8337
|
+
var Support = class {
|
|
8338
|
+
constructor(request) {
|
|
8339
|
+
this.request = request;
|
|
8340
|
+
}
|
|
8341
|
+
/** Start a conversation with its first message. `POST /support/conversations` */
|
|
8342
|
+
async create(body) {
|
|
8343
|
+
return this.request("POST", "/support/conversations", { body });
|
|
8344
|
+
}
|
|
8345
|
+
/** The conversations the caller may read. `GET /support/conversations` */
|
|
8346
|
+
async list(query) {
|
|
8347
|
+
return this.request("GET", "/support/conversations", {
|
|
8348
|
+
query: query === void 0 ? void 0 : { ...query }
|
|
8349
|
+
});
|
|
8350
|
+
}
|
|
8351
|
+
/** One conversation. `GET /support/conversations/{id}` */
|
|
8352
|
+
async retrieve(id) {
|
|
8353
|
+
return this.request("GET", path(id));
|
|
8354
|
+
}
|
|
8355
|
+
/** A conversation's messages. `GET /support/conversations/{id}/messages` */
|
|
8356
|
+
async messages(id, query) {
|
|
8357
|
+
return this.request("GET", `${path(id)}/messages`, {
|
|
8358
|
+
query: query === void 0 ? void 0 : { ...query }
|
|
8359
|
+
});
|
|
8360
|
+
}
|
|
8361
|
+
/** Answer in a conversation. `POST /support/conversations/{id}/messages` */
|
|
8362
|
+
async reply(id, body) {
|
|
8363
|
+
return this.request("POST", `${path(id)}/messages`, { body });
|
|
8364
|
+
}
|
|
8365
|
+
/**
|
|
8366
|
+
* Upload a file for a message. PNG, JPEG, WebP, PDF, text, MP4 or WebM, read from the
|
|
8367
|
+
* content; 10 MB, a video 25 MB. It belongs to the caller until a message names it in
|
|
8368
|
+
* `attachments`. Uploading again with the same `clientUploadId` returns the same file.
|
|
8369
|
+
* `POST /support/conversations/{id}/attachments`
|
|
8370
|
+
*/
|
|
8371
|
+
async uploadAttachment(id, file, clientUploadId, fileName) {
|
|
8372
|
+
const form = new FormData();
|
|
8373
|
+
form.append("client_upload_id", clientUploadId);
|
|
8374
|
+
if (fileName === void 0) form.append("file", file);
|
|
8375
|
+
else form.append("file", file, fileName);
|
|
8376
|
+
return this.request("POST", `${path(id)}/attachments`, { body: form });
|
|
8377
|
+
}
|
|
8378
|
+
/**
|
|
8379
|
+
* Fetch a file once its scan is clean. Refused with `support_attachment_checking` while
|
|
8380
|
+
* the scan runs, and `support_attachment_blocked` after a block.
|
|
8381
|
+
* `GET /support/conversations/{id}/attachments/{fileId}`
|
|
8382
|
+
*/
|
|
8383
|
+
async downloadAttachment(id, fileId) {
|
|
8384
|
+
return this.request("GET", `${path(id)}/attachments/${encodeURIComponent(fileId)}`, {
|
|
8385
|
+
responseType: "blob"
|
|
8386
|
+
});
|
|
8387
|
+
}
|
|
8388
|
+
/**
|
|
8389
|
+
* Clear the merchant's unread mark and read the conversation as it is now.
|
|
8390
|
+
* Someone acting as somebody else leaves the mark in place.
|
|
8391
|
+
* `POST /support/conversations/{id}/read`
|
|
8392
|
+
*/
|
|
8393
|
+
async markRead(id) {
|
|
8394
|
+
return this.request("POST", `${path(id)}/read`);
|
|
8395
|
+
}
|
|
8396
|
+
};
|
|
8397
|
+
|
|
8302
8398
|
// src/resources/invoices.ts
|
|
8303
8399
|
var Invoices = class {
|
|
8304
8400
|
constructor(request) {
|
|
@@ -10767,8 +10863,8 @@ var LiveEventStream = class {
|
|
|
10767
10863
|
return toLiveStreamEvent(dispatch.event, this._lastEventId, this._retry);
|
|
10768
10864
|
}
|
|
10769
10865
|
};
|
|
10770
|
-
async function openLiveStream(openStream,
|
|
10771
|
-
const connection = await openStream(
|
|
10866
|
+
async function openLiveStream(openStream, path4, options = {}) {
|
|
10867
|
+
const connection = await openStream(path4, {
|
|
10772
10868
|
...options.lastEventId ? { lastEventId: options.lastEventId } : {},
|
|
10773
10869
|
...options.signal ? { signal: options.signal } : {},
|
|
10774
10870
|
...options.idleTimeoutMs !== void 0 ? { idleTimeoutMs: options.idleTimeoutMs } : {},
|
|
@@ -10955,8 +11051,8 @@ var ProcessorImports = class {
|
|
|
10955
11051
|
|
|
10956
11052
|
// src/resources/deploymentBranding.ts
|
|
10957
11053
|
function brandingAssetPath(asset, version) {
|
|
10958
|
-
const
|
|
10959
|
-
return version ? `${
|
|
11054
|
+
const path4 = `/branding/assets/${encodeURIComponent(asset)}`;
|
|
11055
|
+
return version ? `${path4}?v=${encodeURIComponent(version)}` : path4;
|
|
10960
11056
|
}
|
|
10961
11057
|
var Branding = class {
|
|
10962
11058
|
constructor(request, baseUrl) {
|
|
@@ -11290,6 +11386,7 @@ var Delopay = class {
|
|
|
11290
11386
|
this.costRules = new CostRules(request);
|
|
11291
11387
|
this.externalRecords = new ExternalRecords(request);
|
|
11292
11388
|
this.products = new Products(request);
|
|
11389
|
+
this.support = new Support(request);
|
|
11293
11390
|
this.invoices = new Invoices(request);
|
|
11294
11391
|
this.invoiceSettings = new InvoiceSettingsResource(request);
|
|
11295
11392
|
this.processorCosts = new ProcessorCosts(request);
|
|
@@ -11350,8 +11447,8 @@ var Delopay = class {
|
|
|
11350
11447
|
return response;
|
|
11351
11448
|
}
|
|
11352
11449
|
/** `path` on the base URL, with the query string `query` makes. */
|
|
11353
|
-
buildUrl(
|
|
11354
|
-
let url = `${this.baseUrl}${
|
|
11450
|
+
buildUrl(path4, query) {
|
|
11451
|
+
let url = `${this.baseUrl}${path4}`;
|
|
11355
11452
|
if (query) {
|
|
11356
11453
|
const params = new URLSearchParams();
|
|
11357
11454
|
for (const [key, value] of Object.entries(query)) {
|
|
@@ -11421,8 +11518,8 @@ var Delopay = class {
|
|
|
11421
11518
|
* on a 2xx that is not `text/event-stream` (code `NOT_EVENT_STREAM`), and
|
|
11422
11519
|
* with `TIMEOUT`, `NETWORK` or `ABORTED` like `request()`.
|
|
11423
11520
|
*/
|
|
11424
|
-
async openEventStream(
|
|
11425
|
-
const url = this.buildUrl(
|
|
11521
|
+
async openEventStream(path4, options = {}) {
|
|
11522
|
+
const url = this.buildUrl(path4, options.query);
|
|
11426
11523
|
const lastEventId = options.lastEventId ?? "";
|
|
11427
11524
|
const headers = {
|
|
11428
11525
|
...this.authHeaders(),
|
|
@@ -11462,7 +11559,7 @@ var Delopay = class {
|
|
|
11462
11559
|
`Network error: ${cause instanceof Error ? cause.message : String(cause ?? "stream failed")}`,
|
|
11463
11560
|
{ status: 0, code: "NETWORK", type: "network_error" }
|
|
11464
11561
|
);
|
|
11465
|
-
this.log("request", { method: "GET", url: redactUrlForLogging(url), path });
|
|
11562
|
+
this.log("request", { method: "GET", url: redactUrlForLogging(url), path: path4 });
|
|
11466
11563
|
startIdleTimer();
|
|
11467
11564
|
let response;
|
|
11468
11565
|
try {
|
|
@@ -11474,7 +11571,7 @@ var Delopay = class {
|
|
|
11474
11571
|
throw network(err);
|
|
11475
11572
|
}
|
|
11476
11573
|
const requestId = response.headers?.get("x-request-id") ?? response.headers?.get("x-trace-id") ?? void 0;
|
|
11477
|
-
this.log("response", { status: response.status, method: "GET", path, requestId });
|
|
11574
|
+
this.log("response", { status: response.status, method: "GET", path: path4, requestId });
|
|
11478
11575
|
if (!response.ok) {
|
|
11479
11576
|
const error = await errorFromResponse(response, requestId);
|
|
11480
11577
|
release();
|
|
@@ -11560,8 +11657,8 @@ var Delopay = class {
|
|
|
11560
11657
|
* @throws {DelopayAuthenticationError} On 401 responses.
|
|
11561
11658
|
* @throws {DelopayError} On all other non-2xx responses, timeouts, and network errors.
|
|
11562
11659
|
*/
|
|
11563
|
-
async request(method,
|
|
11564
|
-
const url = this.buildUrl(
|
|
11660
|
+
async request(method, path4, options) {
|
|
11661
|
+
const url = this.buildUrl(path4, options?.query);
|
|
11565
11662
|
let headers = {
|
|
11566
11663
|
...this.authHeaders(),
|
|
11567
11664
|
...this.profileHeaders(options?.headers),
|
|
@@ -11625,7 +11722,7 @@ var Delopay = class {
|
|
|
11625
11722
|
const delay = Math.max(retryAfterOverrideMs ?? 0, jittered);
|
|
11626
11723
|
retryAfterOverrideMs = null;
|
|
11627
11724
|
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
11628
|
-
emit("retry", { attempt, maxRetries: this.maxRetries, method, path });
|
|
11725
|
+
emit("retry", { attempt, maxRetries: this.maxRetries, method, path: path4 });
|
|
11629
11726
|
}
|
|
11630
11727
|
const timeoutCtrl = new AbortController();
|
|
11631
11728
|
let timeoutId = setTimeout(() => timeoutCtrl.abort(), timeoutMs);
|
|
@@ -11638,7 +11735,7 @@ var Delopay = class {
|
|
|
11638
11735
|
callerSignal ? [timeoutCtrl.signal, callerSignal] : [timeoutCtrl.signal]
|
|
11639
11736
|
);
|
|
11640
11737
|
try {
|
|
11641
|
-
emit("request", { method, url: safeUrl(), path });
|
|
11738
|
+
emit("request", { method, url: safeUrl(), path: path4 });
|
|
11642
11739
|
const response = await fetch(url, {
|
|
11643
11740
|
method,
|
|
11644
11741
|
headers,
|
|
@@ -11647,7 +11744,7 @@ var Delopay = class {
|
|
|
11647
11744
|
...options?.keepalive !== void 0 ? { keepalive: options.keepalive } : {}
|
|
11648
11745
|
});
|
|
11649
11746
|
const requestId = response.headers?.get("x-request-id") ?? response.headers?.get("x-trace-id") ?? void 0;
|
|
11650
|
-
emit("response", { status: response.status, method, path, requestId });
|
|
11747
|
+
emit("response", { status: response.status, method, path: path4, requestId });
|
|
11651
11748
|
if (!response.ok) {
|
|
11652
11749
|
const error = await errorFromResponse(response, requestId);
|
|
11653
11750
|
const isTransientStatus = response.status >= 500 || response.status === 429;
|
|
@@ -16979,7 +17076,7 @@ function encodePanes(panes) {
|
|
|
16979
17076
|
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}$/;
|
|
16980
17077
|
function focusedCheckoutUrl(params) {
|
|
16981
17078
|
const base = params.checkoutBaseUrl.replace(/\/+$/, "");
|
|
16982
|
-
const
|
|
17079
|
+
const path4 = params.paymentLinkId && OPAQUE_PAYMENT_LINK_ID.test(params.paymentLinkId) ? `${base}/pay/${params.paymentLinkId}` : `${base}/pay/${encodeURIComponent(params.merchantId)}/${encodeURIComponent(
|
|
16983
17080
|
params.paymentId
|
|
16984
17081
|
)}`;
|
|
16985
17082
|
const query = new URLSearchParams({ pane: params.method });
|
|
@@ -16989,16 +17086,16 @@ function focusedCheckoutUrl(params) {
|
|
|
16989
17086
|
if (merchantConnectorId) query.set("mca", merchantConnectorId);
|
|
16990
17087
|
if (params.locale) query.set("locale", params.locale);
|
|
16991
17088
|
if (params.customFieldsCollected) query.set("cf", "1");
|
|
16992
|
-
return `${
|
|
17089
|
+
return `${path4}?${query.toString()}`;
|
|
16993
17090
|
}
|
|
16994
17091
|
function checkoutEntryUrl(params) {
|
|
16995
17092
|
const base = params.checkoutBaseUrl.replace(/\/+$/, "");
|
|
16996
|
-
const
|
|
17093
|
+
const path4 = params.paymentLinkId && OPAQUE_PAYMENT_LINK_ID.test(params.paymentLinkId) ? `${base}/pay/${params.paymentLinkId}` : `${base}/pay/${encodeURIComponent(params.merchantId)}/${encodeURIComponent(
|
|
16997
17094
|
params.paymentId
|
|
16998
17095
|
)}`;
|
|
16999
17096
|
const query = new URLSearchParams({ entry: params.entry.trim() });
|
|
17000
17097
|
if (params.locale) query.set("locale", params.locale);
|
|
17001
|
-
return `${
|
|
17098
|
+
return `${path4}?${query.toString()}`;
|
|
17002
17099
|
}
|
|
17003
17100
|
function isCheckoutOpenEntryMessage(data) {
|
|
17004
17101
|
if (typeof data !== "object" || data === null) return false;
|
|
@@ -17099,6 +17196,60 @@ var AdminBranding = class {
|
|
|
17099
17196
|
}
|
|
17100
17197
|
};
|
|
17101
17198
|
|
|
17199
|
+
// src/internal/resources/adminIndustries.ts
|
|
17200
|
+
var path2 = (id) => `/admin-portal/industries/${encodeURIComponent(id)}`;
|
|
17201
|
+
var AdminIndustries = class {
|
|
17202
|
+
constructor(request) {
|
|
17203
|
+
this.request = request;
|
|
17204
|
+
}
|
|
17205
|
+
/** The whole catalog, archived entries included. `GET /admin-portal/industries` */
|
|
17206
|
+
async list() {
|
|
17207
|
+
return this.request("GET", "/admin-portal/industries");
|
|
17208
|
+
}
|
|
17209
|
+
/**
|
|
17210
|
+
* Create an industry, or a sub-industry under `parent_id`. Without
|
|
17211
|
+
* `availability` it can be selected nowhere until availability is set.
|
|
17212
|
+
* `POST /admin-portal/industries`
|
|
17213
|
+
*/
|
|
17214
|
+
async create(body) {
|
|
17215
|
+
return this.request("POST", "/admin-portal/industries", { body });
|
|
17216
|
+
}
|
|
17217
|
+
/** Rename an entry; its id stays. `PATCH /admin-portal/industries/{industry_id}` */
|
|
17218
|
+
async rename(industryId, body) {
|
|
17219
|
+
return this.request("PATCH", path2(industryId), { body });
|
|
17220
|
+
}
|
|
17221
|
+
/**
|
|
17222
|
+
* Stop offering an entry, and for an industry its sub-industries, for new
|
|
17223
|
+
* selections. Existing selections keep it. `POST /admin-portal/industries/{industry_id}/archive`
|
|
17224
|
+
*/
|
|
17225
|
+
async archive(industryId) {
|
|
17226
|
+
return this.request("POST", `${path2(industryId)}/archive`);
|
|
17227
|
+
}
|
|
17228
|
+
/**
|
|
17229
|
+
* Offer an archived entry again. Refused while an active sibling holds its
|
|
17230
|
+
* name, or for a sub-industry while its industry is archived.
|
|
17231
|
+
* `POST /admin-portal/industries/{industry_id}/restore`
|
|
17232
|
+
*/
|
|
17233
|
+
async restore(industryId) {
|
|
17234
|
+
return this.request("POST", `${path2(industryId)}/restore`);
|
|
17235
|
+
}
|
|
17236
|
+
/**
|
|
17237
|
+
* Replace where an entry can be selected.
|
|
17238
|
+
* `PUT /admin-portal/industries/{industry_id}/availability`
|
|
17239
|
+
*/
|
|
17240
|
+
async setAvailability(industryId, body) {
|
|
17241
|
+
return this.request("PUT", `${path2(industryId)}/availability`, { body });
|
|
17242
|
+
}
|
|
17243
|
+
/**
|
|
17244
|
+
* Every entry as seen from one merchant, or one of its projects or shops:
|
|
17245
|
+
* whether it can be selected there, why, and which scope grants it.
|
|
17246
|
+
* `GET /admin-portal/industries/preview`
|
|
17247
|
+
*/
|
|
17248
|
+
async preview(query) {
|
|
17249
|
+
return this.request("GET", "/admin-portal/industries/preview", { query: { ...query } });
|
|
17250
|
+
}
|
|
17251
|
+
};
|
|
17252
|
+
|
|
17102
17253
|
// src/internal/resources/adminLive.ts
|
|
17103
17254
|
var AdminLive = class {
|
|
17104
17255
|
constructor(request, openStream) {
|
|
@@ -17659,6 +17810,15 @@ var AdminPortal = class {
|
|
|
17659
17810
|
query
|
|
17660
17811
|
});
|
|
17661
17812
|
}
|
|
17813
|
+
/**
|
|
17814
|
+
* Every shop's device intelligence account, with its assessments per environment and
|
|
17815
|
+
* its error rate over the last `window_days` days. The error rate counts finished
|
|
17816
|
+
* assessments: one still running and a payment naming no buyer are not errors.
|
|
17817
|
+
* `GET /admin-portal/device-intelligence`
|
|
17818
|
+
*/
|
|
17819
|
+
async deviceIntelligenceUsage() {
|
|
17820
|
+
return this.request("GET", "/admin-portal/device-intelligence");
|
|
17821
|
+
}
|
|
17662
17822
|
/**
|
|
17663
17823
|
* Device analytics over the canonical client-context observation per
|
|
17664
17824
|
* payment, rooted at all merchants and drillable via `merchant_id` /
|
|
@@ -18470,6 +18630,65 @@ function adminAccount(merchantId) {
|
|
|
18470
18630
|
return `/admin-portal/accounts/${encodeURIComponent(merchantId)}`;
|
|
18471
18631
|
}
|
|
18472
18632
|
|
|
18633
|
+
// src/internal/resources/adminSupport.ts
|
|
18634
|
+
var path3 = (id) => `/admin-portal/support/conversations/${encodeURIComponent(id)}`;
|
|
18635
|
+
var AdminSupport = class {
|
|
18636
|
+
constructor(request) {
|
|
18637
|
+
this.request = request;
|
|
18638
|
+
}
|
|
18639
|
+
/** The queue. `GET /admin-portal/support/conversations` */
|
|
18640
|
+
async list(query) {
|
|
18641
|
+
return this.request("GET", "/admin-portal/support/conversations", {
|
|
18642
|
+
query: query === void 0 ? void 0 : { ...query }
|
|
18643
|
+
});
|
|
18644
|
+
}
|
|
18645
|
+
/** One conversation. `GET /admin-portal/support/conversations/{id}` */
|
|
18646
|
+
async retrieve(id) {
|
|
18647
|
+
return this.request("GET", path3(id));
|
|
18648
|
+
}
|
|
18649
|
+
/** Change status, kind, category or assignee. `PATCH /admin-portal/support/conversations/{id}` */
|
|
18650
|
+
async update(id, body) {
|
|
18651
|
+
return this.request("PATCH", path3(id), { body });
|
|
18652
|
+
}
|
|
18653
|
+
/** Messages, notes included. `GET /admin-portal/support/conversations/{id}/messages` */
|
|
18654
|
+
async messages(id, query) {
|
|
18655
|
+
return this.request("GET", `${path3(id)}/messages`, {
|
|
18656
|
+
query: query === void 0 ? void 0 : { ...query }
|
|
18657
|
+
});
|
|
18658
|
+
}
|
|
18659
|
+
/** Answer, or leave a note. `POST /admin-portal/support/conversations/{id}/messages` */
|
|
18660
|
+
async reply(id, body) {
|
|
18661
|
+
return this.request("POST", `${path3(id)}/messages`, { body });
|
|
18662
|
+
}
|
|
18663
|
+
/**
|
|
18664
|
+
* Upload a file for a message from staff, scanned like a merchant's.
|
|
18665
|
+
* `POST /admin-portal/support/conversations/{id}/attachments`
|
|
18666
|
+
*/
|
|
18667
|
+
async uploadAttachment(id, file, clientUploadId, fileName) {
|
|
18668
|
+
const form = new FormData();
|
|
18669
|
+
form.append("client_upload_id", clientUploadId);
|
|
18670
|
+
if (fileName === void 0) form.append("file", file);
|
|
18671
|
+
else form.append("file", file, fileName);
|
|
18672
|
+
return this.request("POST", `${path3(id)}/attachments`, { body: form });
|
|
18673
|
+
}
|
|
18674
|
+
/**
|
|
18675
|
+
* Fetch a file once its scan is clean. A blocked file stays shut for staff too.
|
|
18676
|
+
* `GET /admin-portal/support/conversations/{id}/attachments/{fileId}`
|
|
18677
|
+
*/
|
|
18678
|
+
async downloadAttachment(id, fileId) {
|
|
18679
|
+
return this.request("GET", `${path3(id)}/attachments/${encodeURIComponent(fileId)}`, {
|
|
18680
|
+
responseType: "blob"
|
|
18681
|
+
});
|
|
18682
|
+
}
|
|
18683
|
+
/**
|
|
18684
|
+
* Clear the staff unread mark and read the conversation as it is now.
|
|
18685
|
+
* `POST /admin-portal/support/conversations/{id}/read`
|
|
18686
|
+
*/
|
|
18687
|
+
async markRead(id) {
|
|
18688
|
+
return this.request("POST", `${path3(id)}/read`);
|
|
18689
|
+
}
|
|
18690
|
+
};
|
|
18691
|
+
|
|
18473
18692
|
// src/internal/resources/auditLogs.ts
|
|
18474
18693
|
var AuditLogs = class {
|
|
18475
18694
|
constructor(request) {
|
|
@@ -19249,6 +19468,8 @@ var DelopayInternal = class extends Delopay {
|
|
|
19249
19468
|
const request = this.request.bind(this);
|
|
19250
19469
|
this.admin = new Admin(request);
|
|
19251
19470
|
this.adminPortal = new AdminPortal(request);
|
|
19471
|
+
this.adminSupport = new AdminSupport(request);
|
|
19472
|
+
this.adminIndustries = new AdminIndustries(request);
|
|
19252
19473
|
const openStream = this.openEventStream.bind(this);
|
|
19253
19474
|
this.adminLive = new AdminLive(request, openStream);
|
|
19254
19475
|
this.adminBranding = new AdminBranding(request);
|
|
@@ -19286,8 +19507,10 @@ var DelopayInternal = class extends Delopay {
|
|
|
19286
19507
|
APPLE_PAY_BUTTON_TYPES,
|
|
19287
19508
|
Admin,
|
|
19288
19509
|
AdminBranding,
|
|
19510
|
+
AdminIndustries,
|
|
19289
19511
|
AdminLive,
|
|
19290
19512
|
AdminPortal,
|
|
19513
|
+
AdminSupport,
|
|
19291
19514
|
Analytics,
|
|
19292
19515
|
AnalyticsDashboard,
|
|
19293
19516
|
Audit,
|
|
@@ -19435,6 +19658,7 @@ var DelopayInternal = class extends Delopay {
|
|
|
19435
19658
|
Settlement,
|
|
19436
19659
|
ShopLabels,
|
|
19437
19660
|
Subscriptions,
|
|
19661
|
+
Support,
|
|
19438
19662
|
UNKNOWN_SECTION_ORDER,
|
|
19439
19663
|
WCAG_AA_TEXT,
|
|
19440
19664
|
WCAG_AA_UI,
|