@delopay/sdk 0.274.0 → 0.279.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/README.md +2 -0
- package/dist/{chunk-R6E57AD4.js → chunk-5FGSME7D.js} +731 -71
- package/dist/chunk-5FGSME7D.js.map +1 -0
- package/dist/index-BfFLiV95.d.cts +29423 -0
- package/dist/index-BfFLiV95.d.ts +29423 -0
- package/dist/index.cjs +731 -70
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -28877
- package/dist/index.d.ts +1 -28877
- package/dist/index.js +5 -1
- package/dist/internal.cjs +770 -70
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +31 -3
- package/dist/internal.d.ts +31 -3
- package/dist/internal.js +44 -1
- package/dist/internal.js.map +1 -1
- package/package.json +17 -18
- package/dist/chunk-R6E57AD4.js.map +0 -1
|
@@ -30,6 +30,100 @@ var DelopayAuthenticationError = class extends DelopayError {
|
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
+
// src/eventStream.ts
|
|
34
|
+
var LF = 10;
|
|
35
|
+
var CR = 13;
|
|
36
|
+
var EventStreamParser = class {
|
|
37
|
+
/**
|
|
38
|
+
* @param lastEventId - The id the stream resumes after, as `EventSource`
|
|
39
|
+
* carries it into a reconnection: a dispatch before the server names an
|
|
40
|
+
* id keeps this one.
|
|
41
|
+
*/
|
|
42
|
+
constructor(lastEventId = "") {
|
|
43
|
+
this.line = "";
|
|
44
|
+
/** The previous chunk ended in CR: a LF opening the next one belongs to it. */
|
|
45
|
+
this.skipLf = false;
|
|
46
|
+
this.data = "";
|
|
47
|
+
this.hasData = false;
|
|
48
|
+
this.eventType = "";
|
|
49
|
+
this.retry = null;
|
|
50
|
+
this.idBuffer = lastEventId;
|
|
51
|
+
}
|
|
52
|
+
/** Feed the next piece of decoded text; returns the dispatches it completed. */
|
|
53
|
+
push(text) {
|
|
54
|
+
const out = [];
|
|
55
|
+
if (text.length === 0) return out;
|
|
56
|
+
let start = 0;
|
|
57
|
+
if (this.skipLf) {
|
|
58
|
+
this.skipLf = false;
|
|
59
|
+
if (text.charCodeAt(0) === LF) start = 1;
|
|
60
|
+
}
|
|
61
|
+
for (let i = start; i < text.length; i++) {
|
|
62
|
+
const c = text.charCodeAt(i);
|
|
63
|
+
if (c !== LF && c !== CR) continue;
|
|
64
|
+
const line = this.line + text.slice(start, i);
|
|
65
|
+
this.line = "";
|
|
66
|
+
this.processLine(line, out);
|
|
67
|
+
if (c === CR) {
|
|
68
|
+
if (i + 1 < text.length) {
|
|
69
|
+
if (text.charCodeAt(i + 1) === LF) i++;
|
|
70
|
+
} else {
|
|
71
|
+
this.skipLf = true;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
start = i + 1;
|
|
75
|
+
}
|
|
76
|
+
this.line += text.slice(start);
|
|
77
|
+
return out;
|
|
78
|
+
}
|
|
79
|
+
processLine(line, out) {
|
|
80
|
+
if (line === "") {
|
|
81
|
+
this.dispatch(out);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (line.charCodeAt(0) === 58) return;
|
|
85
|
+
const colon = line.indexOf(":");
|
|
86
|
+
let field;
|
|
87
|
+
let value;
|
|
88
|
+
if (colon === -1) {
|
|
89
|
+
field = line;
|
|
90
|
+
value = "";
|
|
91
|
+
} else {
|
|
92
|
+
field = line.slice(0, colon);
|
|
93
|
+
value = line.slice(colon + 1);
|
|
94
|
+
if (value.charCodeAt(0) === 32) value = value.slice(1);
|
|
95
|
+
}
|
|
96
|
+
switch (field) {
|
|
97
|
+
case "event":
|
|
98
|
+
this.eventType = value;
|
|
99
|
+
break;
|
|
100
|
+
case "data":
|
|
101
|
+
this.data = this.hasData ? `${this.data}
|
|
102
|
+
${value}` : value;
|
|
103
|
+
this.hasData = true;
|
|
104
|
+
break;
|
|
105
|
+
case "id":
|
|
106
|
+
if (!value.includes("\0")) this.idBuffer = value;
|
|
107
|
+
break;
|
|
108
|
+
case "retry":
|
|
109
|
+
if (/^[0-9]+$/.test(value)) {
|
|
110
|
+
const ms = Number(value);
|
|
111
|
+
if (Number.isSafeInteger(ms)) this.retry = ms;
|
|
112
|
+
}
|
|
113
|
+
break;
|
|
114
|
+
default:
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
dispatch(out) {
|
|
119
|
+
const event = this.hasData ? { type: this.eventType || "message", data: this.data } : null;
|
|
120
|
+
out.push({ lastEventId: this.idBuffer, retry: this.retry, event });
|
|
121
|
+
this.data = "";
|
|
122
|
+
this.hasData = false;
|
|
123
|
+
this.eventType = "";
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
|
|
33
127
|
// src/resources/apiKeys.ts
|
|
34
128
|
var ApiKeys = class {
|
|
35
129
|
constructor(request) {
|
|
@@ -633,6 +727,23 @@ var Connectors = class {
|
|
|
633
727
|
{ body: params }
|
|
634
728
|
);
|
|
635
729
|
}
|
|
730
|
+
/**
|
|
731
|
+
* Fold copies of the same provider account into this connector (todos#395).
|
|
732
|
+
* `POST /account/{accountId}/connectors/{connectorId}/consolidate`
|
|
733
|
+
*
|
|
734
|
+
* The copies' shops move to the connector with their on/off state, routing,
|
|
735
|
+
* checkout layout, currencies, saved credentials, mandates and
|
|
736
|
+
* subscriptions. A copy keeps answering for the payments made on it and
|
|
737
|
+
* serves no shop. Send `dry_run: true` first, then confirm with the
|
|
738
|
+
* preview's `preview_token` and a choice for every conflict.
|
|
739
|
+
*/
|
|
740
|
+
async consolidate(accountId, connectorId, params) {
|
|
741
|
+
return this.request(
|
|
742
|
+
"POST",
|
|
743
|
+
`/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/consolidate`,
|
|
744
|
+
{ body: params }
|
|
745
|
+
);
|
|
746
|
+
}
|
|
636
747
|
/**
|
|
637
748
|
* Switch a connector off, or back on, in one shop it serves.
|
|
638
749
|
* `POST /account/{accountId}/connectors/{connectorId}/shops/{profileId}`
|
|
@@ -1258,8 +1369,8 @@ var Customers = class {
|
|
|
1258
1369
|
};
|
|
1259
1370
|
|
|
1260
1371
|
// src/recordCounter.ts
|
|
1261
|
-
var
|
|
1262
|
-
var
|
|
1372
|
+
var LF2 = 10;
|
|
1373
|
+
var CR2 = 13;
|
|
1263
1374
|
var QUOTE = 34;
|
|
1264
1375
|
var BACKSLASH = 92;
|
|
1265
1376
|
var OPEN_BRACE = 123;
|
|
@@ -1283,10 +1394,10 @@ var CsvRecordCounter = class {
|
|
|
1283
1394
|
lineHasContent = true;
|
|
1284
1395
|
} else if (inQuotes) {
|
|
1285
1396
|
lineHasContent = true;
|
|
1286
|
-
} else if (byte ===
|
|
1397
|
+
} else if (byte === LF2) {
|
|
1287
1398
|
newlines++;
|
|
1288
1399
|
lineHasContent = false;
|
|
1289
|
-
} else if (byte !==
|
|
1400
|
+
} else if (byte !== CR2) {
|
|
1290
1401
|
lineHasContent = true;
|
|
1291
1402
|
}
|
|
1292
1403
|
}
|
|
@@ -5776,6 +5887,55 @@ var BuyerConversations = class {
|
|
|
5776
5887
|
body: params
|
|
5777
5888
|
});
|
|
5778
5889
|
}
|
|
5890
|
+
/**
|
|
5891
|
+
* A team member's internal note. Only the team reads it: the buyer never
|
|
5892
|
+
* sees a note, and a note does not move the conversation or mark it unread.
|
|
5893
|
+
* A closed conversation takes notes as well.
|
|
5894
|
+
* `POST /buyer-conversations/{id}/notes`
|
|
5895
|
+
*/
|
|
5896
|
+
async addNote(id, params) {
|
|
5897
|
+
return this.request("POST", `/buyer-conversations/${encodeURIComponent(id)}/notes`, {
|
|
5898
|
+
body: params
|
|
5899
|
+
});
|
|
5900
|
+
}
|
|
5901
|
+
/**
|
|
5902
|
+
* Upload a file for the caller's next answer, under the shop's attachment
|
|
5903
|
+
* rules (`attachment_rules` on the conversation). It belongs to the caller
|
|
5904
|
+
* until an answer names it in `attachments`; one no answer took within a
|
|
5905
|
+
* day is cleared. Uploading again with the same `clientUploadId` returns
|
|
5906
|
+
* the file the first upload stored.
|
|
5907
|
+
* `POST /buyer-conversation-files/{conversation}`
|
|
5908
|
+
*/
|
|
5909
|
+
async uploadFile(id, file, clientUploadId, fileName) {
|
|
5910
|
+
const form = new FormData();
|
|
5911
|
+
form.append("client_upload_id", clientUploadId);
|
|
5912
|
+
if (fileName === void 0) form.append("file", file);
|
|
5913
|
+
else form.append("file", file, fileName);
|
|
5914
|
+
return this.request("POST", `/buyer-conversation-files/${encodeURIComponent(id)}`, {
|
|
5915
|
+
body: form
|
|
5916
|
+
});
|
|
5917
|
+
}
|
|
5918
|
+
/**
|
|
5919
|
+
* Download a file a message of the conversation carries.
|
|
5920
|
+
* `GET /buyer-conversation-files/{conversation}/{file}`
|
|
5921
|
+
*/
|
|
5922
|
+
async downloadFile(id, fileId) {
|
|
5923
|
+
return this.request(
|
|
5924
|
+
"GET",
|
|
5925
|
+
`/buyer-conversation-files/${encodeURIComponent(id)}/${encodeURIComponent(fileId)}`,
|
|
5926
|
+
{ responseType: "blob" }
|
|
5927
|
+
);
|
|
5928
|
+
}
|
|
5929
|
+
/**
|
|
5930
|
+
* Remove a file the caller uploaded that no answer took.
|
|
5931
|
+
* `DELETE /buyer-conversation-files/{conversation}/{file}`
|
|
5932
|
+
*/
|
|
5933
|
+
async removeFile(id, fileId) {
|
|
5934
|
+
return this.request(
|
|
5935
|
+
"DELETE",
|
|
5936
|
+
`/buyer-conversation-files/${encodeURIComponent(id)}/${encodeURIComponent(fileId)}`
|
|
5937
|
+
);
|
|
5938
|
+
}
|
|
5779
5939
|
/**
|
|
5780
5940
|
* The team has read the conversation up to its last accepted message.
|
|
5781
5941
|
* `POST /buyer-conversations/{id}/read`
|
|
@@ -7592,6 +7752,53 @@ var BuyerAccount = class {
|
|
|
7592
7752
|
}
|
|
7593
7753
|
);
|
|
7594
7754
|
}
|
|
7755
|
+
/**
|
|
7756
|
+
* Upload a file for the buyer's next message to one shop of a confirmed
|
|
7757
|
+
* record, under the shop's attachment rules (`attachment_rules` on the
|
|
7758
|
+
* message page). It belongs to the buyer until a message names it in
|
|
7759
|
+
* `attachments`; one no message took within a day is cleared. Uploading
|
|
7760
|
+
* again with the same `clientUploadId` returns the file the first upload
|
|
7761
|
+
* stored. `shop` is required here.
|
|
7762
|
+
*/
|
|
7763
|
+
async uploadRecordMessageFile(record, file, clientUploadId, query, options) {
|
|
7764
|
+
const { fileName, ...extras } = options ?? {};
|
|
7765
|
+
const form = new FormData();
|
|
7766
|
+
form.append("client_upload_id", clientUploadId);
|
|
7767
|
+
if (fileName === void 0) form.append("file", file);
|
|
7768
|
+
else form.append("file", file, fileName);
|
|
7769
|
+
return this.request(
|
|
7770
|
+
"POST",
|
|
7771
|
+
`/buyer-account/records/${encodeURIComponent(record)}/messages/files`,
|
|
7772
|
+
{
|
|
7773
|
+
body: form,
|
|
7774
|
+
query,
|
|
7775
|
+
...extras
|
|
7776
|
+
}
|
|
7777
|
+
);
|
|
7778
|
+
}
|
|
7779
|
+
/** Download a file a message of a record's conversation with one shop carries. */
|
|
7780
|
+
async downloadRecordMessageFile(record, fileId, query, options) {
|
|
7781
|
+
return this.request(
|
|
7782
|
+
"GET",
|
|
7783
|
+
`/buyer-account/records/${encodeURIComponent(record)}/messages/files/${encodeURIComponent(fileId)}`,
|
|
7784
|
+
{
|
|
7785
|
+
query,
|
|
7786
|
+
responseType: "blob",
|
|
7787
|
+
...options
|
|
7788
|
+
}
|
|
7789
|
+
);
|
|
7790
|
+
}
|
|
7791
|
+
/** Remove a file the buyer uploaded for a record's conversation that no message took. */
|
|
7792
|
+
async removeRecordMessageFile(record, fileId, query, options) {
|
|
7793
|
+
return this.request(
|
|
7794
|
+
"DELETE",
|
|
7795
|
+
`/buyer-account/records/${encodeURIComponent(record)}/messages/files/${encodeURIComponent(fileId)}`,
|
|
7796
|
+
{
|
|
7797
|
+
query,
|
|
7798
|
+
...options
|
|
7799
|
+
}
|
|
7800
|
+
);
|
|
7801
|
+
}
|
|
7595
7802
|
/**
|
|
7596
7803
|
* What the buyer spent in a period: paid purchases summed per currency,
|
|
7597
7804
|
* never converted, for the whole period, per day, week or month, per shop
|
|
@@ -7814,6 +8021,40 @@ var BuyerPortal = class {
|
|
|
7814
8021
|
...options
|
|
7815
8022
|
});
|
|
7816
8023
|
}
|
|
8024
|
+
/**
|
|
8025
|
+
* Upload a file for the buyer's next message to one shop, under the shop's
|
|
8026
|
+
* attachment rules (`attachment_rules` on the message page). It belongs to
|
|
8027
|
+
* the buyer until a message names it in `attachments`; one no message took
|
|
8028
|
+
* within a day is cleared. Uploading again with the same `clientUploadId`
|
|
8029
|
+
* returns the file the first upload stored.
|
|
8030
|
+
*/
|
|
8031
|
+
async uploadMessageFile(file, clientUploadId, query, options) {
|
|
8032
|
+
const { fileName, ...extras } = options ?? {};
|
|
8033
|
+
const form = new FormData();
|
|
8034
|
+
form.append("client_upload_id", clientUploadId);
|
|
8035
|
+
if (fileName === void 0) form.append("file", file);
|
|
8036
|
+
else form.append("file", file, fileName);
|
|
8037
|
+
return this.request("POST", "/buyer-portal/messages/files", {
|
|
8038
|
+
body: form,
|
|
8039
|
+
query,
|
|
8040
|
+
...extras
|
|
8041
|
+
});
|
|
8042
|
+
}
|
|
8043
|
+
/** Download a file a message of the buyer's conversation with one shop carries. */
|
|
8044
|
+
async downloadMessageFile(fileId, query, options) {
|
|
8045
|
+
return this.request("GET", `/buyer-portal/messages/files/${encodeURIComponent(fileId)}`, {
|
|
8046
|
+
query,
|
|
8047
|
+
responseType: "blob",
|
|
8048
|
+
...options
|
|
8049
|
+
});
|
|
8050
|
+
}
|
|
8051
|
+
/** Remove a file the buyer uploaded that no message took. */
|
|
8052
|
+
async removeMessageFile(fileId, query, options) {
|
|
8053
|
+
return this.request("DELETE", `/buyer-portal/messages/files/${encodeURIComponent(fileId)}`, {
|
|
8054
|
+
query,
|
|
8055
|
+
...options
|
|
8056
|
+
});
|
|
8057
|
+
}
|
|
7817
8058
|
/** The buyer's contact and billing details, and what they may change. */
|
|
7818
8059
|
async getProfile(options) {
|
|
7819
8060
|
return this.request("GET", "/buyer-portal/profile", { ...options });
|
|
@@ -8690,6 +8931,133 @@ var Risk = class {
|
|
|
8690
8931
|
}
|
|
8691
8932
|
};
|
|
8692
8933
|
|
|
8934
|
+
// src/resources/live.ts
|
|
8935
|
+
function readField(data, key) {
|
|
8936
|
+
let value;
|
|
8937
|
+
try {
|
|
8938
|
+
value = JSON.parse(data);
|
|
8939
|
+
} catch {
|
|
8940
|
+
return void 0;
|
|
8941
|
+
}
|
|
8942
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) return void 0;
|
|
8943
|
+
return Object.getOwnPropertyDescriptor(value, key)?.value;
|
|
8944
|
+
}
|
|
8945
|
+
function toLiveStreamEvent(event, id, retry) {
|
|
8946
|
+
switch (event.type) {
|
|
8947
|
+
case "ready": {
|
|
8948
|
+
const resumed = readField(event.data, "resumed");
|
|
8949
|
+
return { type: "ready", id, retry, resumed: typeof resumed === "boolean" ? resumed : null };
|
|
8950
|
+
}
|
|
8951
|
+
case "change": {
|
|
8952
|
+
const changes = readField(event.data, "changes");
|
|
8953
|
+
if (!Array.isArray(changes)) return { type: "resync", id };
|
|
8954
|
+
return { type: "change", id, changes };
|
|
8955
|
+
}
|
|
8956
|
+
case "resync":
|
|
8957
|
+
return { type: "resync", id };
|
|
8958
|
+
default:
|
|
8959
|
+
return null;
|
|
8960
|
+
}
|
|
8961
|
+
}
|
|
8962
|
+
var LiveEventStream = class {
|
|
8963
|
+
constructor(connection, lastEventId = null) {
|
|
8964
|
+
this.connection = connection;
|
|
8965
|
+
this._retry = null;
|
|
8966
|
+
this._lastEventId = lastEventId || null;
|
|
8967
|
+
}
|
|
8968
|
+
/**
|
|
8969
|
+
* The position to resume after: the id of the last event read, advanced by
|
|
8970
|
+
* keepalives too. `null` before the server named one. Send it as
|
|
8971
|
+
* `lastEventId` when reconnecting.
|
|
8972
|
+
*/
|
|
8973
|
+
get lastEventId() {
|
|
8974
|
+
return this._lastEventId;
|
|
8975
|
+
}
|
|
8976
|
+
/** The wait before reconnecting the server asked for, in ms; `null` until it says. */
|
|
8977
|
+
get retry() {
|
|
8978
|
+
return this._retry;
|
|
8979
|
+
}
|
|
8980
|
+
/** Close the stream; the iteration ends without an error. */
|
|
8981
|
+
close() {
|
|
8982
|
+
this.connection.close();
|
|
8983
|
+
}
|
|
8984
|
+
[Symbol.asyncIterator]() {
|
|
8985
|
+
this.iterator ?? (this.iterator = this.events());
|
|
8986
|
+
return this.iterator;
|
|
8987
|
+
}
|
|
8988
|
+
async *events() {
|
|
8989
|
+
for await (const dispatch of this.connection.dispatches) {
|
|
8990
|
+
const event = this.read(dispatch);
|
|
8991
|
+
if (event) yield event;
|
|
8992
|
+
}
|
|
8993
|
+
}
|
|
8994
|
+
read(dispatch) {
|
|
8995
|
+
this._lastEventId = dispatch.lastEventId || null;
|
|
8996
|
+
if (dispatch.retry !== null) this._retry = dispatch.retry;
|
|
8997
|
+
if (!dispatch.event) return null;
|
|
8998
|
+
return toLiveStreamEvent(dispatch.event, this._lastEventId, this._retry);
|
|
8999
|
+
}
|
|
9000
|
+
};
|
|
9001
|
+
async function openLiveStream(openStream, path, options = {}) {
|
|
9002
|
+
const connection = await openStream(path, {
|
|
9003
|
+
...options.lastEventId ? { lastEventId: options.lastEventId } : {},
|
|
9004
|
+
...options.signal ? { signal: options.signal } : {},
|
|
9005
|
+
...options.idleTimeoutMs !== void 0 ? { idleTimeoutMs: options.idleTimeoutMs } : {},
|
|
9006
|
+
...options.headers ? { headers: options.headers } : {}
|
|
9007
|
+
});
|
|
9008
|
+
return new LiveEventStream(connection, options.lastEventId ?? null);
|
|
9009
|
+
}
|
|
9010
|
+
var Live = class {
|
|
9011
|
+
constructor(request, openStream) {
|
|
9012
|
+
this.request = request;
|
|
9013
|
+
this.openStream = openStream;
|
|
9014
|
+
}
|
|
9015
|
+
/**
|
|
9016
|
+
* Open the stream of what changed in the caller's merchant, as their role
|
|
9017
|
+
* may read it. Resolves once the server answered; a `401` rejects with
|
|
9018
|
+
* `DelopayAuthenticationError`.
|
|
9019
|
+
*
|
|
9020
|
+
* The first event is `ready`. `change` names the kinds of record and, when
|
|
9021
|
+
* few, the ids that changed: read them again through the usual endpoints.
|
|
9022
|
+
* `resync`, and `ready` with `resumed: false`, mean read everything again.
|
|
9023
|
+
* The SDK does not reconnect — see {@link LiveEventStream}.
|
|
9024
|
+
*
|
|
9025
|
+
* `GET /live/stream`
|
|
9026
|
+
*
|
|
9027
|
+
* @example
|
|
9028
|
+
* ```typescript
|
|
9029
|
+
* const stream = await delopay.live.stream({ lastEventId, signal });
|
|
9030
|
+
* for await (const event of stream) {
|
|
9031
|
+
* if (event.type === 'change') refresh(event.changes);
|
|
9032
|
+
* else if (event.type === 'resync' || event.resumed === false) refreshAll();
|
|
9033
|
+
* }
|
|
9034
|
+
* lastEventId = stream.lastEventId; // reconnect after stream.retry
|
|
9035
|
+
* ```
|
|
9036
|
+
*/
|
|
9037
|
+
async stream(options) {
|
|
9038
|
+
return openLiveStream(this.openStream, "/live/stream", options);
|
|
9039
|
+
}
|
|
9040
|
+
/**
|
|
9041
|
+
* The current version of each kind of record named, in the caller's
|
|
9042
|
+
* merchant and shop. Read it before the record and send the entry's
|
|
9043
|
+
* `if_match` in the `If-Match` header of the save: a save over a newer
|
|
9044
|
+
* version is refused with `IR_16` (400), `error.data` a
|
|
9045
|
+
* `LiveChangedElsewhere` naming who made the change.
|
|
9046
|
+
*
|
|
9047
|
+
* `GET /live/versions`
|
|
9048
|
+
*/
|
|
9049
|
+
async versions(params, options) {
|
|
9050
|
+
return this.request("GET", "/live/versions", {
|
|
9051
|
+
query: {
|
|
9052
|
+
entities: params.entities.join(","),
|
|
9053
|
+
profile_id: params.profile_id,
|
|
9054
|
+
record_id: params.record_id
|
|
9055
|
+
},
|
|
9056
|
+
...options
|
|
9057
|
+
});
|
|
9058
|
+
}
|
|
9059
|
+
};
|
|
9060
|
+
|
|
8693
9061
|
// src/client.ts
|
|
8694
9062
|
var PRODUCTION_URL = "https://api.delopay.net";
|
|
8695
9063
|
var SANDBOX_URL = "https://sandbox.delopay.net";
|
|
@@ -8713,6 +9081,40 @@ function truncateRawBody(raw) {
|
|
|
8713
9081
|
if (!raw) return void 0;
|
|
8714
9082
|
return raw.length > MAX_RAW_BODY_BYTES ? raw.slice(0, MAX_RAW_BODY_BYTES) + "\u2026" : raw;
|
|
8715
9083
|
}
|
|
9084
|
+
async function errorFromResponse(response, requestId) {
|
|
9085
|
+
const rawBody = await response.text().catch(() => "");
|
|
9086
|
+
let parsed = {};
|
|
9087
|
+
if (rawBody) {
|
|
9088
|
+
try {
|
|
9089
|
+
parsed = JSON.parse(rawBody);
|
|
9090
|
+
} catch {
|
|
9091
|
+
}
|
|
9092
|
+
}
|
|
9093
|
+
const err = parsed.error ?? parsed;
|
|
9094
|
+
const message = err.message ?? `Request failed with status ${response.status}`;
|
|
9095
|
+
const code = err.code ?? "";
|
|
9096
|
+
const type = err.error_type ?? err.type ?? "";
|
|
9097
|
+
const data = err.data && typeof err.data === "object" && !Array.isArray(err.data) ? err.data : void 0;
|
|
9098
|
+
const truncatedRaw = truncateRawBody(rawBody);
|
|
9099
|
+
const isConnectorPassthrough = type === "connector" || code.startsWith("CE_");
|
|
9100
|
+
if (response.status === 401 && !isConnectorPassthrough) {
|
|
9101
|
+
return new DelopayAuthenticationError(message, {
|
|
9102
|
+
code,
|
|
9103
|
+
type,
|
|
9104
|
+
requestId,
|
|
9105
|
+
rawBody: truncatedRaw,
|
|
9106
|
+
data
|
|
9107
|
+
});
|
|
9108
|
+
}
|
|
9109
|
+
return new DelopayError(message, {
|
|
9110
|
+
status: response.status,
|
|
9111
|
+
code,
|
|
9112
|
+
type,
|
|
9113
|
+
requestId,
|
|
9114
|
+
rawBody: truncatedRaw,
|
|
9115
|
+
data
|
|
9116
|
+
});
|
|
9117
|
+
}
|
|
8716
9118
|
function findIdempotencyKey(headers) {
|
|
8717
9119
|
for (const [k, v] of Object.entries(headers)) {
|
|
8718
9120
|
if (k.toLowerCase() === "idempotency-key") return v;
|
|
@@ -8873,6 +9275,7 @@ function redactUrlForLogging(url) {
|
|
|
8873
9275
|
});
|
|
8874
9276
|
return `${base}?${parts.join("&")}`;
|
|
8875
9277
|
}
|
|
9278
|
+
var DEFAULT_STREAM_IDLE_TIMEOUT_MS = 45e3;
|
|
8876
9279
|
var Delopay = class {
|
|
8877
9280
|
/**
|
|
8878
9281
|
* Create a new Delopay client.
|
|
@@ -8895,6 +9298,7 @@ var Delopay = class {
|
|
|
8895
9298
|
this.baseUrl = PRODUCTION_URL;
|
|
8896
9299
|
}
|
|
8897
9300
|
const request = this.request.bind(this);
|
|
9301
|
+
const openStream = this.openEventStream.bind(this);
|
|
8898
9302
|
this.payments = new Payments(request);
|
|
8899
9303
|
this.refunds = new Refunds(request);
|
|
8900
9304
|
this.customers = new Customers(request);
|
|
@@ -8931,6 +9335,7 @@ var Delopay = class {
|
|
|
8931
9335
|
this.settings = new Settings(request);
|
|
8932
9336
|
this.messageTemplates = new MessageTemplates(request);
|
|
8933
9337
|
this.risk = new Risk(request);
|
|
9338
|
+
this.live = new Live(request, openStream);
|
|
8934
9339
|
this.subscriptions = new Subscriptions(request);
|
|
8935
9340
|
this.buyerPortal = new BuyerPortal(request);
|
|
8936
9341
|
this.buyerAccount = new BuyerAccount(request);
|
|
@@ -9007,24 +9412,12 @@ var Delopay = class {
|
|
|
9007
9412
|
this.setJwtToken(response.token);
|
|
9008
9413
|
return response;
|
|
9009
9414
|
}
|
|
9010
|
-
/**
|
|
9011
|
-
|
|
9012
|
-
*
|
|
9013
|
-
* You rarely need to call this directly — prefer the typed resource methods.
|
|
9014
|
-
* Use it only for endpoints not yet covered by a resource class.
|
|
9015
|
-
*
|
|
9016
|
-
* @param method - HTTP method (`GET`, `POST`, `PUT`, `PATCH`, `DELETE`).
|
|
9017
|
-
* @param path - API path starting with `/` (e.g. `/payments`).
|
|
9018
|
-
* @param options - Optional body, query parameters, and headers.
|
|
9019
|
-
* @returns Parsed JSON response body typed as `T`.
|
|
9020
|
-
* @throws {DelopayAuthenticationError} On 401 responses.
|
|
9021
|
-
* @throws {DelopayError} On all other non-2xx responses, timeouts, and network errors.
|
|
9022
|
-
*/
|
|
9023
|
-
async request(method, path, options) {
|
|
9415
|
+
/** `path` on the base URL, with the query string `query` makes. */
|
|
9416
|
+
buildUrl(path, query) {
|
|
9024
9417
|
let url = `${this.baseUrl}${path}`;
|
|
9025
|
-
if (
|
|
9418
|
+
if (query) {
|
|
9026
9419
|
const params = new URLSearchParams();
|
|
9027
|
-
for (const [key, value] of Object.entries(
|
|
9420
|
+
for (const [key, value] of Object.entries(query)) {
|
|
9028
9421
|
if (value === void 0 || value === null) continue;
|
|
9029
9422
|
if (Array.isArray(value)) {
|
|
9030
9423
|
for (const v of value) {
|
|
@@ -9039,8 +9432,189 @@ var Delopay = class {
|
|
|
9039
9432
|
url += `?${qs}`;
|
|
9040
9433
|
}
|
|
9041
9434
|
}
|
|
9435
|
+
return url;
|
|
9436
|
+
}
|
|
9437
|
+
/** The credential header: the JWT when one is set, else the API key. */
|
|
9438
|
+
authHeaders() {
|
|
9439
|
+
if (this.jwtToken) return { Authorization: `Bearer ${this.jwtToken}` };
|
|
9440
|
+
if (this.apiKey) return { "api-key": this.apiKey };
|
|
9441
|
+
return {};
|
|
9442
|
+
}
|
|
9443
|
+
/** One debug event, when `debug` is on. */
|
|
9444
|
+
log(event, data) {
|
|
9445
|
+
if (!this.debug) return;
|
|
9446
|
+
if (this.logger) {
|
|
9447
|
+
this.logger(event, data);
|
|
9448
|
+
return;
|
|
9449
|
+
}
|
|
9450
|
+
if (event === "request")
|
|
9451
|
+
console.log(`[delopay] ${data.method} ${data.url}`);
|
|
9452
|
+
else if (event === "response")
|
|
9453
|
+
console.log(
|
|
9454
|
+
`[delopay] ${data.status} ${data.method} ${data.path}`
|
|
9455
|
+
);
|
|
9456
|
+
else
|
|
9457
|
+
console.log(
|
|
9458
|
+
`[delopay] retry ${data.attempt}/${data.maxRetries} ${data.method} ${data.path}`
|
|
9459
|
+
);
|
|
9460
|
+
}
|
|
9461
|
+
/**
|
|
9462
|
+
* Open a `GET` `text/event-stream` and read it as it arrives.
|
|
9463
|
+
*
|
|
9464
|
+
* `request()` keeps every chunk of a body until the body ends, which a
|
|
9465
|
+
* stream that stays open for half an hour must not do; this reads the body
|
|
9466
|
+
* chunk by chunk through {@link EventStreamParser} and keeps nothing it has
|
|
9467
|
+
* dispatched. Credentials, the base URL, debug logging and the mapping of a
|
|
9468
|
+
* non-2xx answer to `DelopayError` / `DelopayAuthenticationError` are the
|
|
9469
|
+
* ones `request()` uses.
|
|
9470
|
+
*
|
|
9471
|
+
* Never retried, and never reconnected: the caller owns reconnection.
|
|
9472
|
+
* Resolves once the response headers arrive; rejects on a non-2xx answer,
|
|
9473
|
+
* on a 2xx that is not `text/event-stream` (code `NOT_EVENT_STREAM`), and
|
|
9474
|
+
* with `TIMEOUT`, `NETWORK` or `ABORTED` like `request()`.
|
|
9475
|
+
*/
|
|
9476
|
+
async openEventStream(path, options = {}) {
|
|
9477
|
+
const url = this.buildUrl(path, options.query);
|
|
9478
|
+
const lastEventId = options.lastEventId ?? "";
|
|
9479
|
+
const headers = {
|
|
9480
|
+
...this.authHeaders(),
|
|
9481
|
+
Accept: "text/event-stream",
|
|
9482
|
+
...lastEventId ? { "Last-Event-ID": lastEventId } : {},
|
|
9483
|
+
...options.headers
|
|
9484
|
+
};
|
|
9485
|
+
const idleMs = options.idleTimeoutMs ?? DEFAULT_STREAM_IDLE_TIMEOUT_MS;
|
|
9486
|
+
const callerSignal = options.signal;
|
|
9487
|
+
const aborted = () => new DelopayError("Request aborted", { status: 0, code: "ABORTED", type: "abort_error" });
|
|
9488
|
+
if (callerSignal?.aborted) throw aborted();
|
|
9489
|
+
const idleCtrl = new AbortController();
|
|
9490
|
+
const closeCtrl = new AbortController();
|
|
9491
|
+
let timer;
|
|
9492
|
+
const stopIdleTimer = () => {
|
|
9493
|
+
if (timer !== void 0) clearTimeout(timer);
|
|
9494
|
+
timer = void 0;
|
|
9495
|
+
};
|
|
9496
|
+
const startIdleTimer = () => {
|
|
9497
|
+
stopIdleTimer();
|
|
9498
|
+
if (!idleCtrl.signal.aborted) timer = setTimeout(() => idleCtrl.abort(), idleMs);
|
|
9499
|
+
};
|
|
9500
|
+
const combined = combineSignals(
|
|
9501
|
+
callerSignal ? [idleCtrl.signal, closeCtrl.signal, callerSignal] : [idleCtrl.signal, closeCtrl.signal]
|
|
9502
|
+
);
|
|
9503
|
+
const release = () => {
|
|
9504
|
+
stopIdleTimer();
|
|
9505
|
+
combined.dispose();
|
|
9506
|
+
};
|
|
9507
|
+
const timedOut = () => new DelopayError(`Event stream silent for ${idleMs} ms`, {
|
|
9508
|
+
status: 0,
|
|
9509
|
+
code: "TIMEOUT",
|
|
9510
|
+
type: "timeout_error"
|
|
9511
|
+
});
|
|
9512
|
+
const network = (cause) => new DelopayError(
|
|
9513
|
+
`Network error: ${cause instanceof Error ? cause.message : String(cause ?? "stream failed")}`,
|
|
9514
|
+
{ status: 0, code: "NETWORK", type: "network_error" }
|
|
9515
|
+
);
|
|
9516
|
+
this.log("request", { method: "GET", url: redactUrlForLogging(url), path });
|
|
9517
|
+
startIdleTimer();
|
|
9518
|
+
let response;
|
|
9519
|
+
try {
|
|
9520
|
+
response = await fetch(url, { method: "GET", headers, signal: combined.signal });
|
|
9521
|
+
} catch (err) {
|
|
9522
|
+
release();
|
|
9523
|
+
if (callerSignal?.aborted) throw aborted();
|
|
9524
|
+
if (idleCtrl.signal.aborted) throw timedOut();
|
|
9525
|
+
throw network(err);
|
|
9526
|
+
}
|
|
9527
|
+
const requestId = response.headers?.get("x-request-id") ?? response.headers?.get("x-trace-id") ?? void 0;
|
|
9528
|
+
this.log("response", { status: response.status, method: "GET", path, requestId });
|
|
9529
|
+
if (!response.ok) {
|
|
9530
|
+
const error = await errorFromResponse(response, requestId);
|
|
9531
|
+
release();
|
|
9532
|
+
throw error;
|
|
9533
|
+
}
|
|
9534
|
+
const body = response.body;
|
|
9535
|
+
const contentType = response.headers?.get("content-type") ?? "";
|
|
9536
|
+
const mediaType = (contentType.split(";")[0] ?? "").trim().toLowerCase();
|
|
9537
|
+
if (mediaType !== "text/event-stream" || !body || typeof body.getReader !== "function") {
|
|
9538
|
+
release();
|
|
9539
|
+
body?.cancel().catch(noop);
|
|
9540
|
+
throw new DelopayError(
|
|
9541
|
+
mediaType === "text/event-stream" ? "The event stream has no readable body" : `Expected a text/event-stream response, got ${contentType ? `"${contentType}"` : "no content type"}`,
|
|
9542
|
+
{
|
|
9543
|
+
status: response.status,
|
|
9544
|
+
code: "NOT_EVENT_STREAM",
|
|
9545
|
+
type: "invalid_response",
|
|
9546
|
+
requestId
|
|
9547
|
+
}
|
|
9548
|
+
);
|
|
9549
|
+
}
|
|
9550
|
+
stopIdleTimer();
|
|
9551
|
+
const reader = body.getReader();
|
|
9552
|
+
const parser = new EventStreamParser(lastEventId);
|
|
9553
|
+
const decoder = new TextDecoder();
|
|
9554
|
+
const stopped = () => Boolean(callerSignal?.aborted) || closeCtrl.signal.aborted;
|
|
9555
|
+
let finished = false;
|
|
9556
|
+
const finish = () => {
|
|
9557
|
+
if (finished) return;
|
|
9558
|
+
finished = true;
|
|
9559
|
+
release();
|
|
9560
|
+
reader.cancel().catch(noop);
|
|
9561
|
+
};
|
|
9562
|
+
async function* dispatches() {
|
|
9563
|
+
try {
|
|
9564
|
+
for (; ; ) {
|
|
9565
|
+
let result;
|
|
9566
|
+
startIdleTimer();
|
|
9567
|
+
try {
|
|
9568
|
+
result = await readChunk(reader, combined.signal);
|
|
9569
|
+
} catch (err) {
|
|
9570
|
+
if (callerSignal?.aborted || closeCtrl.signal.aborted) return;
|
|
9571
|
+
if (idleCtrl.signal.aborted) throw timedOut();
|
|
9572
|
+
throw network(err instanceof BodyStreamFailure ? err.cause : err);
|
|
9573
|
+
} finally {
|
|
9574
|
+
stopIdleTimer();
|
|
9575
|
+
}
|
|
9576
|
+
if (result.done) {
|
|
9577
|
+
for (const dispatch of parser.push(decoder.decode())) {
|
|
9578
|
+
if (stopped()) return;
|
|
9579
|
+
yield dispatch;
|
|
9580
|
+
}
|
|
9581
|
+
return;
|
|
9582
|
+
}
|
|
9583
|
+
if (!result.value || result.value.byteLength === 0) continue;
|
|
9584
|
+
for (const dispatch of parser.push(decoder.decode(result.value, { stream: true }))) {
|
|
9585
|
+
if (stopped()) return;
|
|
9586
|
+
yield dispatch;
|
|
9587
|
+
}
|
|
9588
|
+
}
|
|
9589
|
+
} finally {
|
|
9590
|
+
finish();
|
|
9591
|
+
}
|
|
9592
|
+
}
|
|
9593
|
+
return {
|
|
9594
|
+
dispatches: dispatches(),
|
|
9595
|
+
close: () => {
|
|
9596
|
+
closeCtrl.abort();
|
|
9597
|
+
finish();
|
|
9598
|
+
}
|
|
9599
|
+
};
|
|
9600
|
+
}
|
|
9601
|
+
/**
|
|
9602
|
+
* Make a raw HTTP request to the Delopay API.
|
|
9603
|
+
*
|
|
9604
|
+
* You rarely need to call this directly — prefer the typed resource methods.
|
|
9605
|
+
* Use it only for endpoints not yet covered by a resource class.
|
|
9606
|
+
*
|
|
9607
|
+
* @param method - HTTP method (`GET`, `POST`, `PUT`, `PATCH`, `DELETE`).
|
|
9608
|
+
* @param path - API path starting with `/` (e.g. `/payments`).
|
|
9609
|
+
* @param options - Optional body, query parameters, and headers.
|
|
9610
|
+
* @returns Parsed JSON response body typed as `T`.
|
|
9611
|
+
* @throws {DelopayAuthenticationError} On 401 responses.
|
|
9612
|
+
* @throws {DelopayError} On all other non-2xx responses, timeouts, and network errors.
|
|
9613
|
+
*/
|
|
9614
|
+
async request(method, path, options) {
|
|
9615
|
+
const url = this.buildUrl(path, options?.query);
|
|
9042
9616
|
let headers = {
|
|
9043
|
-
...this.
|
|
9617
|
+
...this.authHeaders(),
|
|
9044
9618
|
...options?.headers
|
|
9045
9619
|
};
|
|
9046
9620
|
const isRawBody = options?.body !== void 0 && options?.body !== null && (options.body instanceof FormData || options.body instanceof Blob || options.body instanceof ArrayBuffer || options.body instanceof URLSearchParams);
|
|
@@ -9093,23 +9667,7 @@ var Delopay = class {
|
|
|
9093
9667
|
let lastError;
|
|
9094
9668
|
let retryAfterOverrideMs = null;
|
|
9095
9669
|
const safeUrl = () => redactUrlForLogging(url);
|
|
9096
|
-
const emit = (event, data) =>
|
|
9097
|
-
if (!this.debug) return;
|
|
9098
|
-
if (this.logger) {
|
|
9099
|
-
this.logger(event, data);
|
|
9100
|
-
return;
|
|
9101
|
-
}
|
|
9102
|
-
if (event === "request")
|
|
9103
|
-
console.log(`[delopay] ${data.method} ${data.url}`);
|
|
9104
|
-
else if (event === "response")
|
|
9105
|
-
console.log(
|
|
9106
|
-
`[delopay] ${data.status} ${data.method} ${data.path}`
|
|
9107
|
-
);
|
|
9108
|
-
else
|
|
9109
|
-
console.log(
|
|
9110
|
-
`[delopay] retry ${data.attempt}/${data.maxRetries} ${data.method} ${data.path}`
|
|
9111
|
-
);
|
|
9112
|
-
};
|
|
9670
|
+
const emit = (event, data) => this.log(event, data);
|
|
9113
9671
|
for (let attempt = 0; attempt <= this.maxRetries; attempt++) {
|
|
9114
9672
|
if (attempt > 0) {
|
|
9115
9673
|
const base = Math.min(500 * 2 ** (attempt - 1), 5e3);
|
|
@@ -9141,38 +9699,7 @@ var Delopay = class {
|
|
|
9141
9699
|
const requestId = response.headers?.get("x-request-id") ?? response.headers?.get("x-trace-id") ?? void 0;
|
|
9142
9700
|
emit("response", { status: response.status, method, path, requestId });
|
|
9143
9701
|
if (!response.ok) {
|
|
9144
|
-
const
|
|
9145
|
-
let parsed = {};
|
|
9146
|
-
if (rawBody) {
|
|
9147
|
-
try {
|
|
9148
|
-
parsed = JSON.parse(rawBody);
|
|
9149
|
-
} catch {
|
|
9150
|
-
}
|
|
9151
|
-
}
|
|
9152
|
-
const err = parsed.error ?? parsed;
|
|
9153
|
-
const message = err.message ?? `Request failed with status ${response.status}`;
|
|
9154
|
-
const code = err.code ?? "";
|
|
9155
|
-
const type = err.error_type ?? err.type ?? "";
|
|
9156
|
-
const data = err.data && typeof err.data === "object" && !Array.isArray(err.data) ? err.data : void 0;
|
|
9157
|
-
const truncatedRaw = truncateRawBody(rawBody);
|
|
9158
|
-
const isConnectorPassthrough = type === "connector" || code.startsWith("CE_");
|
|
9159
|
-
if (response.status === 401 && !isConnectorPassthrough) {
|
|
9160
|
-
throw new DelopayAuthenticationError(message, {
|
|
9161
|
-
code,
|
|
9162
|
-
type,
|
|
9163
|
-
requestId,
|
|
9164
|
-
rawBody: truncatedRaw,
|
|
9165
|
-
data
|
|
9166
|
-
});
|
|
9167
|
-
}
|
|
9168
|
-
const error = new DelopayError(message, {
|
|
9169
|
-
status: response.status,
|
|
9170
|
-
code,
|
|
9171
|
-
type,
|
|
9172
|
-
requestId,
|
|
9173
|
-
rawBody: truncatedRaw,
|
|
9174
|
-
data
|
|
9175
|
-
});
|
|
9702
|
+
const error = await errorFromResponse(response, requestId);
|
|
9176
9703
|
const isTransientStatus = response.status >= 500 || response.status === 429;
|
|
9177
9704
|
if (isTransientStatus && isRetryable && attempt < this.maxRetries) {
|
|
9178
9705
|
if (response.status === 429) {
|
|
@@ -10640,6 +11167,13 @@ var DEFAULT_BRANDING_BASE = {
|
|
|
10640
11167
|
paypalFocusRing: "strong",
|
|
10641
11168
|
mollieFocusRing: "strong",
|
|
10642
11169
|
paypalValidTint: false,
|
|
11170
|
+
epayoutsCardLayout: "split",
|
|
11171
|
+
epayoutsLabelStyle: "above",
|
|
11172
|
+
epayoutsFieldChrome: "outlined",
|
|
11173
|
+
epayoutsFieldFontSize: "md",
|
|
11174
|
+
epayoutsFieldWeight: "regular",
|
|
11175
|
+
epayoutsFocusRing: "strong",
|
|
11176
|
+
epayoutsValidTint: false,
|
|
10643
11177
|
nomupayFormStyle: "plain",
|
|
10644
11178
|
nomupayShowLabels: true,
|
|
10645
11179
|
nomupayShowPlaceholders: true,
|
|
@@ -11670,6 +12204,66 @@ function decodeBranding(source) {
|
|
|
11670
12204
|
DEFAULT_BRANDING.whopSelection
|
|
11671
12205
|
),
|
|
11672
12206
|
paypalValidTint: parseBool(extras["paypalValidTint"], DEFAULT_BRANDING.paypalValidTint),
|
|
12207
|
+
// A look stored before todos#412 has no e-Payouts keys: the form keeps
|
|
12208
|
+
// the PayPal values it was drawn with until then.
|
|
12209
|
+
epayoutsCardLayout: pickEnum(
|
|
12210
|
+
extras["epayoutsCardLayout"],
|
|
12211
|
+
PAYPAL_CARD_LAYOUTS,
|
|
12212
|
+
pickEnum(
|
|
12213
|
+
extras["paypalCardLayout"],
|
|
12214
|
+
PAYPAL_CARD_LAYOUTS,
|
|
12215
|
+
DEFAULT_BRANDING.epayoutsCardLayout
|
|
12216
|
+
)
|
|
12217
|
+
),
|
|
12218
|
+
epayoutsLabelStyle: pickEnum(
|
|
12219
|
+
extras["epayoutsLabelStyle"],
|
|
12220
|
+
PAYPAL_LABEL_STYLES,
|
|
12221
|
+
pickEnum(
|
|
12222
|
+
extras["paypalLabelStyle"],
|
|
12223
|
+
PAYPAL_LABEL_STYLES,
|
|
12224
|
+
DEFAULT_BRANDING.epayoutsLabelStyle
|
|
12225
|
+
)
|
|
12226
|
+
),
|
|
12227
|
+
epayoutsFieldChrome: pickEnum(
|
|
12228
|
+
extras["epayoutsFieldChrome"],
|
|
12229
|
+
CARD_FIELD_CHROMES,
|
|
12230
|
+
pickEnum(
|
|
12231
|
+
extras["paypalFieldChrome"],
|
|
12232
|
+
CARD_FIELD_CHROMES,
|
|
12233
|
+
DEFAULT_BRANDING.epayoutsFieldChrome
|
|
12234
|
+
)
|
|
12235
|
+
),
|
|
12236
|
+
epayoutsFieldFontSize: pickEnum(
|
|
12237
|
+
extras["epayoutsFieldFontSize"],
|
|
12238
|
+
CARD_FIELD_FONT_SIZES,
|
|
12239
|
+
pickEnum(
|
|
12240
|
+
extras["paypalFieldFontSize"],
|
|
12241
|
+
CARD_FIELD_FONT_SIZES,
|
|
12242
|
+
DEFAULT_BRANDING.epayoutsFieldFontSize
|
|
12243
|
+
)
|
|
12244
|
+
),
|
|
12245
|
+
epayoutsFieldWeight: pickEnum(
|
|
12246
|
+
extras["epayoutsFieldWeight"],
|
|
12247
|
+
CARD_FIELD_WEIGHTS,
|
|
12248
|
+
pickEnum(
|
|
12249
|
+
extras["paypalFieldWeight"],
|
|
12250
|
+
CARD_FIELD_WEIGHTS,
|
|
12251
|
+
DEFAULT_BRANDING.epayoutsFieldWeight
|
|
12252
|
+
)
|
|
12253
|
+
),
|
|
12254
|
+
epayoutsFocusRing: pickEnum(
|
|
12255
|
+
extras["epayoutsFocusRing"],
|
|
12256
|
+
CARD_FOCUS_RINGS,
|
|
12257
|
+
pickEnum(
|
|
12258
|
+
extras["paypalFocusRing"],
|
|
12259
|
+
CARD_FOCUS_RINGS,
|
|
12260
|
+
DEFAULT_BRANDING.epayoutsFocusRing
|
|
12261
|
+
)
|
|
12262
|
+
),
|
|
12263
|
+
epayoutsValidTint: parseBool(
|
|
12264
|
+
extras["epayoutsValidTint"],
|
|
12265
|
+
parseBool(extras["paypalValidTint"], DEFAULT_BRANDING.epayoutsValidTint)
|
|
12266
|
+
),
|
|
11673
12267
|
nomupayFormStyle: pickEnum(
|
|
11674
12268
|
extras["nomupayFormStyle"],
|
|
11675
12269
|
NOMUPAY_FORM_STYLES,
|
|
@@ -11831,6 +12425,13 @@ function encodeBranding(branding, base) {
|
|
|
11831
12425
|
whopMethodIcons: String(branding.whopMethodIcons),
|
|
11832
12426
|
whopSelection: branding.whopSelection,
|
|
11833
12427
|
paypalValidTint: String(branding.paypalValidTint),
|
|
12428
|
+
epayoutsCardLayout: branding.epayoutsCardLayout,
|
|
12429
|
+
epayoutsLabelStyle: branding.epayoutsLabelStyle,
|
|
12430
|
+
epayoutsFieldChrome: branding.epayoutsFieldChrome,
|
|
12431
|
+
epayoutsFieldFontSize: branding.epayoutsFieldFontSize,
|
|
12432
|
+
epayoutsFieldWeight: branding.epayoutsFieldWeight,
|
|
12433
|
+
epayoutsFocusRing: branding.epayoutsFocusRing,
|
|
12434
|
+
epayoutsValidTint: String(branding.epayoutsValidTint),
|
|
11834
12435
|
nomupayFormStyle: branding.nomupayFormStyle,
|
|
11835
12436
|
nomupayShowLabels: String(branding.nomupayShowLabels),
|
|
11836
12437
|
nomupayShowPlaceholders: String(branding.nomupayShowPlaceholders),
|
|
@@ -12292,6 +12893,62 @@ function parseImportedBranding(raw) {
|
|
|
12292
12893
|
dflt.whopSelection
|
|
12293
12894
|
),
|
|
12294
12895
|
paypalValidTint: parseBool(root["paypalValidTint"], dflt.paypalValidTint),
|
|
12896
|
+
// A look stored before todos#412 has no e-Payouts keys: the form keeps
|
|
12897
|
+
// the PayPal values it was drawn with until then.
|
|
12898
|
+
epayoutsCardLayout: pickEnum(
|
|
12899
|
+
root["epayoutsCardLayout"],
|
|
12900
|
+
PAYPAL_CARD_LAYOUTS,
|
|
12901
|
+
pickEnum(
|
|
12902
|
+
root["paypalCardLayout"],
|
|
12903
|
+
PAYPAL_CARD_LAYOUTS,
|
|
12904
|
+
dflt.epayoutsCardLayout
|
|
12905
|
+
)
|
|
12906
|
+
),
|
|
12907
|
+
epayoutsLabelStyle: pickEnum(
|
|
12908
|
+
root["epayoutsLabelStyle"],
|
|
12909
|
+
PAYPAL_LABEL_STYLES,
|
|
12910
|
+
pickEnum(
|
|
12911
|
+
root["paypalLabelStyle"],
|
|
12912
|
+
PAYPAL_LABEL_STYLES,
|
|
12913
|
+
dflt.epayoutsLabelStyle
|
|
12914
|
+
)
|
|
12915
|
+
),
|
|
12916
|
+
epayoutsFieldChrome: pickEnum(
|
|
12917
|
+
root["epayoutsFieldChrome"],
|
|
12918
|
+
CARD_FIELD_CHROMES,
|
|
12919
|
+
pickEnum(
|
|
12920
|
+
root["paypalFieldChrome"],
|
|
12921
|
+
CARD_FIELD_CHROMES,
|
|
12922
|
+
dflt.epayoutsFieldChrome
|
|
12923
|
+
)
|
|
12924
|
+
),
|
|
12925
|
+
epayoutsFieldFontSize: pickEnum(
|
|
12926
|
+
root["epayoutsFieldFontSize"],
|
|
12927
|
+
CARD_FIELD_FONT_SIZES,
|
|
12928
|
+
pickEnum(
|
|
12929
|
+
root["paypalFieldFontSize"],
|
|
12930
|
+
CARD_FIELD_FONT_SIZES,
|
|
12931
|
+
dflt.epayoutsFieldFontSize
|
|
12932
|
+
)
|
|
12933
|
+
),
|
|
12934
|
+
epayoutsFieldWeight: pickEnum(
|
|
12935
|
+
root["epayoutsFieldWeight"],
|
|
12936
|
+
CARD_FIELD_WEIGHTS,
|
|
12937
|
+
pickEnum(
|
|
12938
|
+
root["paypalFieldWeight"],
|
|
12939
|
+
CARD_FIELD_WEIGHTS,
|
|
12940
|
+
dflt.epayoutsFieldWeight
|
|
12941
|
+
)
|
|
12942
|
+
),
|
|
12943
|
+
epayoutsFocusRing: pickEnum(
|
|
12944
|
+
root["epayoutsFocusRing"],
|
|
12945
|
+
CARD_FOCUS_RINGS,
|
|
12946
|
+
pickEnum(root["paypalFocusRing"], CARD_FOCUS_RINGS, dflt.epayoutsFocusRing)
|
|
12947
|
+
),
|
|
12948
|
+
epayoutsValidTint: parseBool(
|
|
12949
|
+
root["epayoutsValidTint"],
|
|
12950
|
+
parseBool(root["paypalValidTint"], dflt.epayoutsValidTint)
|
|
12951
|
+
),
|
|
12295
12952
|
nomupayFormStyle: pickEnum(
|
|
12296
12953
|
root["nomupayFormStyle"],
|
|
12297
12954
|
NOMUPAY_FORM_STYLES,
|
|
@@ -13805,6 +14462,9 @@ export {
|
|
|
13805
14462
|
Settings,
|
|
13806
14463
|
MessageTemplates,
|
|
13807
14464
|
Risk,
|
|
14465
|
+
LiveEventStream,
|
|
14466
|
+
openLiveStream,
|
|
14467
|
+
Live,
|
|
13808
14468
|
Delopay,
|
|
13809
14469
|
leaf,
|
|
13810
14470
|
allOf,
|
|
@@ -14022,4 +14682,4 @@ export {
|
|
|
14022
14682
|
decodeNativePanes,
|
|
14023
14683
|
encodeNativePanes
|
|
14024
14684
|
};
|
|
14025
|
-
//# sourceMappingURL=chunk-
|
|
14685
|
+
//# sourceMappingURL=chunk-5FGSME7D.js.map
|