@delopay/sdk 0.272.0 → 0.277.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-42VYNDXJ.js → chunk-424242UX.js} +167 -6
- package/dist/chunk-424242UX.js.map +1 -0
- package/dist/index.cjs +166 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +327 -22
- package/dist/index.d.ts +327 -22
- package/dist/index.js +1 -1
- package/dist/internal.cjs +180 -5
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +49 -2
- package/dist/internal.d.ts +49 -2
- package/dist/internal.js +15 -1
- package/dist/internal.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-42VYNDXJ.js.map +0 -1
package/dist/index.js
CHANGED
package/dist/internal.cjs
CHANGED
|
@@ -927,6 +927,23 @@ var Connectors = class {
|
|
|
927
927
|
{ body: params }
|
|
928
928
|
);
|
|
929
929
|
}
|
|
930
|
+
/**
|
|
931
|
+
* Fold copies of the same provider account into this connector (todos#395).
|
|
932
|
+
* `POST /account/{accountId}/connectors/{connectorId}/consolidate`
|
|
933
|
+
*
|
|
934
|
+
* The copies' shops move to the connector with their on/off state, routing,
|
|
935
|
+
* checkout layout, currencies, saved credentials, mandates and
|
|
936
|
+
* subscriptions. A copy keeps answering for the payments made on it and
|
|
937
|
+
* serves no shop. Send `dry_run: true` first, then confirm with the
|
|
938
|
+
* preview's `preview_token` and a choice for every conflict.
|
|
939
|
+
*/
|
|
940
|
+
async consolidate(accountId, connectorId, params) {
|
|
941
|
+
return this.request(
|
|
942
|
+
"POST",
|
|
943
|
+
`/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/consolidate`,
|
|
944
|
+
{ body: params }
|
|
945
|
+
);
|
|
946
|
+
}
|
|
930
947
|
/**
|
|
931
948
|
* Switch a connector off, or back on, in one shop it serves.
|
|
932
949
|
* `POST /account/{accountId}/connectors/{connectorId}/shops/{profileId}`
|
|
@@ -6070,6 +6087,55 @@ var BuyerConversations = class {
|
|
|
6070
6087
|
body: params
|
|
6071
6088
|
});
|
|
6072
6089
|
}
|
|
6090
|
+
/**
|
|
6091
|
+
* A team member's internal note. Only the team reads it: the buyer never
|
|
6092
|
+
* sees a note, and a note does not move the conversation or mark it unread.
|
|
6093
|
+
* A closed conversation takes notes as well.
|
|
6094
|
+
* `POST /buyer-conversations/{id}/notes`
|
|
6095
|
+
*/
|
|
6096
|
+
async addNote(id, params) {
|
|
6097
|
+
return this.request("POST", `/buyer-conversations/${encodeURIComponent(id)}/notes`, {
|
|
6098
|
+
body: params
|
|
6099
|
+
});
|
|
6100
|
+
}
|
|
6101
|
+
/**
|
|
6102
|
+
* Upload a file for the caller's next answer, under the shop's attachment
|
|
6103
|
+
* rules (`attachment_rules` on the conversation). It belongs to the caller
|
|
6104
|
+
* until an answer names it in `attachments`; one no answer took within a
|
|
6105
|
+
* day is cleared. Uploading again with the same `clientUploadId` returns
|
|
6106
|
+
* the file the first upload stored.
|
|
6107
|
+
* `POST /buyer-conversation-files/{conversation}`
|
|
6108
|
+
*/
|
|
6109
|
+
async uploadFile(id, file, clientUploadId, fileName) {
|
|
6110
|
+
const form = new FormData();
|
|
6111
|
+
form.append("client_upload_id", clientUploadId);
|
|
6112
|
+
if (fileName === void 0) form.append("file", file);
|
|
6113
|
+
else form.append("file", file, fileName);
|
|
6114
|
+
return this.request("POST", `/buyer-conversation-files/${encodeURIComponent(id)}`, {
|
|
6115
|
+
body: form
|
|
6116
|
+
});
|
|
6117
|
+
}
|
|
6118
|
+
/**
|
|
6119
|
+
* Download a file a message of the conversation carries.
|
|
6120
|
+
* `GET /buyer-conversation-files/{conversation}/{file}`
|
|
6121
|
+
*/
|
|
6122
|
+
async downloadFile(id, fileId) {
|
|
6123
|
+
return this.request(
|
|
6124
|
+
"GET",
|
|
6125
|
+
`/buyer-conversation-files/${encodeURIComponent(id)}/${encodeURIComponent(fileId)}`,
|
|
6126
|
+
{ responseType: "blob" }
|
|
6127
|
+
);
|
|
6128
|
+
}
|
|
6129
|
+
/**
|
|
6130
|
+
* Remove a file the caller uploaded that no answer took.
|
|
6131
|
+
* `DELETE /buyer-conversation-files/{conversation}/{file}`
|
|
6132
|
+
*/
|
|
6133
|
+
async removeFile(id, fileId) {
|
|
6134
|
+
return this.request(
|
|
6135
|
+
"DELETE",
|
|
6136
|
+
`/buyer-conversation-files/${encodeURIComponent(id)}/${encodeURIComponent(fileId)}`
|
|
6137
|
+
);
|
|
6138
|
+
}
|
|
6073
6139
|
/**
|
|
6074
6140
|
* The team has read the conversation up to its last accepted message.
|
|
6075
6141
|
* `POST /buyer-conversations/{id}/read`
|
|
@@ -7862,8 +7928,9 @@ var BuyerAccount = class {
|
|
|
7862
7928
|
});
|
|
7863
7929
|
}
|
|
7864
7930
|
/**
|
|
7865
|
-
* A message from a confirmed record to one of its shops.
|
|
7866
|
-
*
|
|
7931
|
+
* A message from a confirmed record to one of its shops. A message to a
|
|
7932
|
+
* closed conversation reopens it. Sending again with the same
|
|
7933
|
+
* `client_message_id` returns the message the first send stored.
|
|
7867
7934
|
*/
|
|
7868
7935
|
async sendRecordMessage(record, message, options) {
|
|
7869
7936
|
return this.request("POST", `/buyer-account/records/${encodeURIComponent(record)}/messages`, {
|
|
@@ -7885,6 +7952,53 @@ var BuyerAccount = class {
|
|
|
7885
7952
|
}
|
|
7886
7953
|
);
|
|
7887
7954
|
}
|
|
7955
|
+
/**
|
|
7956
|
+
* Upload a file for the buyer's next message to one shop of a confirmed
|
|
7957
|
+
* record, under the shop's attachment rules (`attachment_rules` on the
|
|
7958
|
+
* message page). It belongs to the buyer until a message names it in
|
|
7959
|
+
* `attachments`; one no message took within a day is cleared. Uploading
|
|
7960
|
+
* again with the same `clientUploadId` returns the file the first upload
|
|
7961
|
+
* stored. `shop` is required here.
|
|
7962
|
+
*/
|
|
7963
|
+
async uploadRecordMessageFile(record, file, clientUploadId, query, options) {
|
|
7964
|
+
const { fileName, ...extras } = options ?? {};
|
|
7965
|
+
const form = new FormData();
|
|
7966
|
+
form.append("client_upload_id", clientUploadId);
|
|
7967
|
+
if (fileName === void 0) form.append("file", file);
|
|
7968
|
+
else form.append("file", file, fileName);
|
|
7969
|
+
return this.request(
|
|
7970
|
+
"POST",
|
|
7971
|
+
`/buyer-account/records/${encodeURIComponent(record)}/messages/files`,
|
|
7972
|
+
{
|
|
7973
|
+
body: form,
|
|
7974
|
+
query,
|
|
7975
|
+
...extras
|
|
7976
|
+
}
|
|
7977
|
+
);
|
|
7978
|
+
}
|
|
7979
|
+
/** Download a file a message of a record's conversation with one shop carries. */
|
|
7980
|
+
async downloadRecordMessageFile(record, fileId, query, options) {
|
|
7981
|
+
return this.request(
|
|
7982
|
+
"GET",
|
|
7983
|
+
`/buyer-account/records/${encodeURIComponent(record)}/messages/files/${encodeURIComponent(fileId)}`,
|
|
7984
|
+
{
|
|
7985
|
+
query,
|
|
7986
|
+
responseType: "blob",
|
|
7987
|
+
...options
|
|
7988
|
+
}
|
|
7989
|
+
);
|
|
7990
|
+
}
|
|
7991
|
+
/** Remove a file the buyer uploaded for a record's conversation that no message took. */
|
|
7992
|
+
async removeRecordMessageFile(record, fileId, query, options) {
|
|
7993
|
+
return this.request(
|
|
7994
|
+
"DELETE",
|
|
7995
|
+
`/buyer-account/records/${encodeURIComponent(record)}/messages/files/${encodeURIComponent(fileId)}`,
|
|
7996
|
+
{
|
|
7997
|
+
query,
|
|
7998
|
+
...options
|
|
7999
|
+
}
|
|
8000
|
+
);
|
|
8001
|
+
}
|
|
7888
8002
|
/**
|
|
7889
8003
|
* What the buyer spent in a period: paid purchases summed per currency,
|
|
7890
8004
|
* never converted, for the whole period, per day, week or month, per shop
|
|
@@ -8090,8 +8204,9 @@ var BuyerPortal = class {
|
|
|
8090
8204
|
});
|
|
8091
8205
|
}
|
|
8092
8206
|
/**
|
|
8093
|
-
* A message to the shop.
|
|
8094
|
-
*
|
|
8207
|
+
* A message to the shop. A message to a closed conversation reopens it.
|
|
8208
|
+
* Sending again with the same `client_message_id` returns the message the
|
|
8209
|
+
* first send stored.
|
|
8095
8210
|
*/
|
|
8096
8211
|
async sendMessage(message, options) {
|
|
8097
8212
|
return this.request("POST", "/buyer-portal/messages", { body: message, ...options });
|
|
@@ -8106,6 +8221,40 @@ var BuyerPortal = class {
|
|
|
8106
8221
|
...options
|
|
8107
8222
|
});
|
|
8108
8223
|
}
|
|
8224
|
+
/**
|
|
8225
|
+
* Upload a file for the buyer's next message to one shop, under the shop's
|
|
8226
|
+
* attachment rules (`attachment_rules` on the message page). It belongs to
|
|
8227
|
+
* the buyer until a message names it in `attachments`; one no message took
|
|
8228
|
+
* within a day is cleared. Uploading again with the same `clientUploadId`
|
|
8229
|
+
* returns the file the first upload stored.
|
|
8230
|
+
*/
|
|
8231
|
+
async uploadMessageFile(file, clientUploadId, query, options) {
|
|
8232
|
+
const { fileName, ...extras } = options ?? {};
|
|
8233
|
+
const form = new FormData();
|
|
8234
|
+
form.append("client_upload_id", clientUploadId);
|
|
8235
|
+
if (fileName === void 0) form.append("file", file);
|
|
8236
|
+
else form.append("file", file, fileName);
|
|
8237
|
+
return this.request("POST", "/buyer-portal/messages/files", {
|
|
8238
|
+
body: form,
|
|
8239
|
+
query,
|
|
8240
|
+
...extras
|
|
8241
|
+
});
|
|
8242
|
+
}
|
|
8243
|
+
/** Download a file a message of the buyer's conversation with one shop carries. */
|
|
8244
|
+
async downloadMessageFile(fileId, query, options) {
|
|
8245
|
+
return this.request("GET", `/buyer-portal/messages/files/${encodeURIComponent(fileId)}`, {
|
|
8246
|
+
query,
|
|
8247
|
+
responseType: "blob",
|
|
8248
|
+
...options
|
|
8249
|
+
});
|
|
8250
|
+
}
|
|
8251
|
+
/** Remove a file the buyer uploaded that no message took. */
|
|
8252
|
+
async removeMessageFile(fileId, query, options) {
|
|
8253
|
+
return this.request("DELETE", `/buyer-portal/messages/files/${encodeURIComponent(fileId)}`, {
|
|
8254
|
+
query,
|
|
8255
|
+
...options
|
|
8256
|
+
});
|
|
8257
|
+
}
|
|
8109
8258
|
/** The buyer's contact and billing details, and what they may change. */
|
|
8110
8259
|
async getProfile(options) {
|
|
8111
8260
|
return this.request("GET", "/buyer-portal/profile", { ...options });
|
|
@@ -12809,6 +12958,12 @@ var CheckoutSession = class {
|
|
|
12809
12958
|
* channel the backend's locale resolution reads; a `?locale=` query is
|
|
12810
12959
|
* silently ignored by this route.
|
|
12811
12960
|
*
|
|
12961
|
+
* `cardOnly` is a direct link to the card form (`payment_method=card`):
|
|
12962
|
+
* when the Stripe card form being prepared is the one the link names, its
|
|
12963
|
+
* PaymentIntent is created for `card` alone. `cardProvider` and
|
|
12964
|
+
* `cardAccount` name that form's connector and account; absent or blank
|
|
12965
|
+
* matches any.
|
|
12966
|
+
*
|
|
12812
12967
|
* `GET /payment-link/data/{merchantId}/{paymentId}`
|
|
12813
12968
|
*/
|
|
12814
12969
|
async fetchCheckoutData(params, options) {
|
|
@@ -12817,7 +12972,13 @@ var CheckoutSession = class {
|
|
|
12817
12972
|
"GET",
|
|
12818
12973
|
`/payment-link/data/${encodeURIComponent(this.merchantId)}/${encodeURIComponent(this.paymentId)}`,
|
|
12819
12974
|
{
|
|
12820
|
-
query: {
|
|
12975
|
+
query: {
|
|
12976
|
+
theme: params?.theme,
|
|
12977
|
+
country: country || void 0,
|
|
12978
|
+
card_only: params?.cardOnly || void 0,
|
|
12979
|
+
card_provider: params?.cardOnly ? params.cardProvider?.trim() || void 0 : void 0,
|
|
12980
|
+
card_account: params?.cardOnly ? params.cardAccount?.trim() || void 0 : void 0
|
|
12981
|
+
},
|
|
12821
12982
|
...options,
|
|
12822
12983
|
headers: {
|
|
12823
12984
|
...params?.locale ? {
|
|
@@ -14927,6 +15088,20 @@ var AdminPortal = class {
|
|
|
14927
15088
|
{ body: params }
|
|
14928
15089
|
);
|
|
14929
15090
|
}
|
|
15091
|
+
/**
|
|
15092
|
+
* Correct the funding type, issuing bank and issuing country recorded on
|
|
15093
|
+
* past card payments from the BIN table, across every merchant, oldest
|
|
15094
|
+
* first, one bounded page per call. Resume with the returned `next_after`
|
|
15095
|
+
* until it is `null`. A dry run, the default, reports without writing; a
|
|
15096
|
+
* payment that changed while the page ran is left alone and counted as a
|
|
15097
|
+
* conflict. Payments of merchants whose attempts are stored in Redis are
|
|
15098
|
+
* not corrected.
|
|
15099
|
+
*
|
|
15100
|
+
* `POST /admin-portal/card-funding/backfill`
|
|
15101
|
+
*/
|
|
15102
|
+
async backfillCardFunding(params = {}) {
|
|
15103
|
+
return this.request("POST", "/admin-portal/card-funding/backfill", { body: params });
|
|
15104
|
+
}
|
|
14930
15105
|
};
|
|
14931
15106
|
function transactionListQuery(params) {
|
|
14932
15107
|
if (!params) return void 0;
|