@shushed/helpers 0.0.202 → 0.0.203-bug-erp-770-20251208155429
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/cjs/contracts/order/payment.schema.json +5 -5
- package/dist/cjs/dist-dereferenced/messages/order/delivered.js +1 -1
- package/dist/cjs/dist-dereferenced/messages/order/new.js +1 -1
- package/dist/cjs/dist-dereferenced/messages/order/processed.js +1 -1
- package/dist/cjs/dist-dereferenced/messages/order/return-initiated.js +1 -1
- package/dist/cjs/dist-dereferenced/messages/order/returned.js +1 -1
- package/dist/cjs/dist-dereferenced/messages/order/shipped.js +1 -1
- package/dist/cjs/dist-dereferenced/order/orderMain.js +1 -1
- package/dist/cjs/dist-dereferenced/order/payment.js +1 -1
- package/dist/cjs/src-public/bcOrder.js +403 -71
- package/dist/cjs/src-public/dato.js +244 -10
- package/dist/types/dist-dereferenced/messages/order/delivered.d.ts +4 -4
- package/dist/types/dist-dereferenced/messages/order/new.d.ts +4 -4
- package/dist/types/dist-dereferenced/messages/order/processed.d.ts +4 -4
- package/dist/types/dist-dereferenced/messages/order/return-initiated.d.ts +4 -4
- package/dist/types/dist-dereferenced/messages/order/returned.d.ts +4 -4
- package/dist/types/dist-dereferenced/messages/order/shipped.d.ts +4 -4
- package/dist/types/dist-dereferenced/order/index.d.ts +4 -4
- package/dist/types/dist-dereferenced/order/orderMain.d.ts +4 -4
- package/dist/types/dist-dereferenced/order/payment.d.ts +4 -4
- package/dist/types/dist-types/messages/order/delivered.d.ts +2 -2
- package/dist/types/dist-types/messages/order/new.d.ts +2 -2
- package/dist/types/dist-types/messages/order/processed.d.ts +2 -2
- package/dist/types/dist-types/messages/order/return-initiated.d.ts +2 -2
- package/dist/types/dist-types/messages/order/returned.d.ts +2 -2
- package/dist/types/dist-types/messages/order/shipped.d.ts +2 -2
- package/dist/types/dist-types/order/orderMain.d.ts +2 -2
- package/dist/types/dist-types/order/payment.d.ts +2 -2
- package/dist/types/src-public/dato.d.ts +27 -1
- package/package.json +1 -1
|
@@ -72,6 +72,11 @@ class DatoHelper extends runtime_1.default {
|
|
|
72
72
|
return response;
|
|
73
73
|
}
|
|
74
74
|
async createAssetFromUpload(uploadId, opts, uploadCollectionId) {
|
|
75
|
+
const normalizedTags = Array.isArray(opts.tags) && opts.tags.length > 0
|
|
76
|
+
? opts.tags
|
|
77
|
+
: ["integrations"];
|
|
78
|
+
const safeTitle = opts.title && opts.title.trim().length > 0 ? opts.title : "untitled";
|
|
79
|
+
const safeAlt = opts.alt && opts.alt.trim().length > 0 ? opts.alt : safeTitle;
|
|
75
80
|
const body = {
|
|
76
81
|
data: {
|
|
77
82
|
type: 'upload',
|
|
@@ -80,13 +85,35 @@ class DatoHelper extends runtime_1.default {
|
|
|
80
85
|
author: opts.author,
|
|
81
86
|
copyright: opts.copyright,
|
|
82
87
|
notes: opts.notes || null,
|
|
88
|
+
title: safeTitle,
|
|
89
|
+
alt: safeAlt,
|
|
83
90
|
default_field_metadata: {
|
|
91
|
+
"en-GB": {
|
|
92
|
+
title: safeTitle,
|
|
93
|
+
alt: safeAlt,
|
|
94
|
+
custom_data: {
|
|
95
|
+
source: normalizedTags[0] || "uploaded-by-integrations",
|
|
96
|
+
tags: normalizedTags,
|
|
97
|
+
}
|
|
98
|
+
},
|
|
84
99
|
en: {
|
|
85
|
-
title:
|
|
86
|
-
alt:
|
|
100
|
+
title: safeTitle,
|
|
101
|
+
alt: safeAlt,
|
|
102
|
+
custom_data: {
|
|
103
|
+
source: normalizedTags[0] || "uploaded-by-integrations",
|
|
104
|
+
tags: normalizedTags,
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"en-US": {
|
|
108
|
+
title: safeTitle,
|
|
109
|
+
alt: safeAlt,
|
|
110
|
+
custom_data: {
|
|
111
|
+
source: normalizedTags[0] || "uploaded-by-integrations",
|
|
112
|
+
tags: normalizedTags,
|
|
113
|
+
}
|
|
87
114
|
}
|
|
88
115
|
},
|
|
89
|
-
tags:
|
|
116
|
+
tags: normalizedTags || [],
|
|
90
117
|
},
|
|
91
118
|
},
|
|
92
119
|
};
|
|
@@ -155,8 +182,119 @@ class DatoHelper extends runtime_1.default {
|
|
|
155
182
|
this.logging.error(timeoutMsg);
|
|
156
183
|
throw new Error(timeoutMsg);
|
|
157
184
|
}
|
|
185
|
+
updateUpload = async (options) => {
|
|
186
|
+
try {
|
|
187
|
+
this.logging.log(`Starting update upload - ${JSON.stringify(options)}`);
|
|
188
|
+
if (!options.id)
|
|
189
|
+
throw new Error("updateUpload requires 'id' in options");
|
|
190
|
+
const safeTitle = options.title && options.title.trim().length > 0
|
|
191
|
+
? options.title.trim()
|
|
192
|
+
: options.filename?.trim().split(".")[0] || "untitled";
|
|
193
|
+
const safeAlt = options.alt && options.alt.trim().length > 0
|
|
194
|
+
? options.alt.trim()
|
|
195
|
+
: safeTitle;
|
|
196
|
+
const normalizedTags = Array.isArray(options.tags) && options.tags.length > 0
|
|
197
|
+
? options.tags
|
|
198
|
+
: ["integrations"];
|
|
199
|
+
const body = {
|
|
200
|
+
data: {
|
|
201
|
+
type: "upload",
|
|
202
|
+
id: options.id,
|
|
203
|
+
attributes: {
|
|
204
|
+
author: options.author,
|
|
205
|
+
copyright: options.copyright,
|
|
206
|
+
tags: normalizedTags,
|
|
207
|
+
notes: options.notes || null,
|
|
208
|
+
default_field_metadata: {
|
|
209
|
+
"en-GB": {
|
|
210
|
+
title: safeTitle,
|
|
211
|
+
alt: safeAlt,
|
|
212
|
+
custom_data: {
|
|
213
|
+
source: normalizedTags[0] || "uploaded-by-integrations",
|
|
214
|
+
tags: normalizedTags,
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
en: {
|
|
218
|
+
title: safeTitle,
|
|
219
|
+
alt: safeAlt,
|
|
220
|
+
custom_data: {
|
|
221
|
+
source: normalizedTags[0] || "uploaded-by-integrations",
|
|
222
|
+
tags: normalizedTags,
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
"en-US": {
|
|
226
|
+
title: safeTitle,
|
|
227
|
+
alt: safeAlt,
|
|
228
|
+
custom_data: {
|
|
229
|
+
source: normalizedTags[0] || "uploaded-by-integrations",
|
|
230
|
+
tags: normalizedTags,
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
};
|
|
237
|
+
if (options.uploadCollectionId) {
|
|
238
|
+
body.data.relationships = {
|
|
239
|
+
upload_collection: {
|
|
240
|
+
data: {
|
|
241
|
+
type: "upload_collection",
|
|
242
|
+
id: options.uploadCollectionId,
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
const response = await fetch(`${this.baseUrl}/uploads/${options.id}`, {
|
|
248
|
+
method: "PATCH",
|
|
249
|
+
headers: {
|
|
250
|
+
Authorization: `Bearer ${this.apiToken}`,
|
|
251
|
+
"X-Api-Version": "3",
|
|
252
|
+
"X-Environment": this.environment,
|
|
253
|
+
"Content-Type": "application/vnd.api+json",
|
|
254
|
+
Accept: "application/json",
|
|
255
|
+
},
|
|
256
|
+
body: JSON.stringify(body),
|
|
257
|
+
});
|
|
258
|
+
if (!response.ok) {
|
|
259
|
+
const errorText = await response.text();
|
|
260
|
+
this.logging.error(`Failed to update upload: ${response.statusText} - ${errorText}`);
|
|
261
|
+
throw new Error(`Failed to update upload: ${response.statusText} - ${errorText}`);
|
|
262
|
+
}
|
|
263
|
+
const updated = await response.json();
|
|
264
|
+
if (Array.isArray(updated.data) && updated.data[0]?.type === "api_error") {
|
|
265
|
+
const errorCode = updated.data[0].attributes?.code || "UNKNOWN_ERROR";
|
|
266
|
+
const errorMsg = `DatoCMS API error: ${errorCode}`;
|
|
267
|
+
this.logging.error(errorMsg);
|
|
268
|
+
throw new Error(errorMsg);
|
|
269
|
+
}
|
|
270
|
+
if (updated.data?.type === "job") {
|
|
271
|
+
this.logging.log(`Waiting for job completion: ${updated.data.id}`);
|
|
272
|
+
const jobPayload = await this.waitForJobCompletion(updated.data.id);
|
|
273
|
+
const assetId = jobPayload?.data?.id;
|
|
274
|
+
const assetUrl = jobPayload?.data?.attributes?.url;
|
|
275
|
+
if (!assetId || !assetUrl) {
|
|
276
|
+
throw new Error(`Job completed but payload missing expected fields: ${JSON.stringify(jobPayload)}`);
|
|
277
|
+
}
|
|
278
|
+
this.logging.log(`Job completed for upload: ${assetId}`);
|
|
279
|
+
return { success: true, assetId, upload: assetUrl };
|
|
280
|
+
}
|
|
281
|
+
if (updated.data?.type === "upload") {
|
|
282
|
+
const { id, attributes } = updated.data;
|
|
283
|
+
this.logging.log(`Upload updated successfully: ${id}`);
|
|
284
|
+
return { success: true, assetId: id, upload: attributes.url };
|
|
285
|
+
}
|
|
286
|
+
const errMsg = `Unexpected update response: ${JSON.stringify(updated)}`;
|
|
287
|
+
this.logging.error(errMsg);
|
|
288
|
+
throw new Error(errMsg);
|
|
289
|
+
}
|
|
290
|
+
catch (err) {
|
|
291
|
+
const msg = err?.message ?? JSON.stringify(err);
|
|
292
|
+
this.logging.error(`[updateUpload] failed: ${msg}`);
|
|
293
|
+
throw new Error(msg);
|
|
294
|
+
}
|
|
295
|
+
};
|
|
158
296
|
async uploadFromUrl(options) {
|
|
159
|
-
const { url, filename, uploadCollectionId } = options;
|
|
297
|
+
const { url, filename, uploadCollectionId, skipCreationIfAlreadyExists } = options;
|
|
160
298
|
this.logging.log(`Starting upload from URL: ${url}`);
|
|
161
299
|
const fileResponse = await fetch(url);
|
|
162
300
|
if (!fileResponse.ok) {
|
|
@@ -164,9 +302,43 @@ class DatoHelper extends runtime_1.default {
|
|
|
164
302
|
this.logging.error(errorMsg);
|
|
165
303
|
throw new Error(errorMsg);
|
|
166
304
|
}
|
|
167
|
-
let finalFilename = filename || path_1.default.basename(new URL(url).pathname) ||
|
|
168
|
-
|
|
169
|
-
|
|
305
|
+
let finalFilename = filename || path_1.default.basename(new URL(url).pathname) ||
|
|
306
|
+
`bs-${this.triggerId}-${Date.now()}`;
|
|
307
|
+
if (filename && !path_1.default.extname(finalFilename)) {
|
|
308
|
+
const urlObj = new URL(url);
|
|
309
|
+
const pathname = urlObj.pathname;
|
|
310
|
+
if (pathname.includes(".")) {
|
|
311
|
+
const urlExtension = path_1.default.extname(pathname);
|
|
312
|
+
if (urlExtension) {
|
|
313
|
+
finalFilename += urlExtension;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
if (!path_1.default.extname(finalFilename) && fileResponse.headers.has('content-type')) {
|
|
317
|
+
const ext = (0, mime_types_1.extension)(fileResponse.headers.get('content-type'));
|
|
318
|
+
if (typeof ext === "string" && ext.length > 0) {
|
|
319
|
+
finalFilename += `.${ext}`;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
else if (!filename) {
|
|
324
|
+
if (!path_1.default.extname(finalFilename) && fileResponse.headers.has('content-type')) {
|
|
325
|
+
const ext = (0, mime_types_1.extension)(fileResponse.headers.get('content-type'));
|
|
326
|
+
if (typeof ext === "string" && ext.length > 0) {
|
|
327
|
+
finalFilename += `.${ext}`;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
if (skipCreationIfAlreadyExists) {
|
|
332
|
+
const existing = await this.findUploadByFilename(finalFilename);
|
|
333
|
+
if (existing) {
|
|
334
|
+
this.logging.log(`Skipping upload: existing asset found for "${finalFilename}"`);
|
|
335
|
+
return {
|
|
336
|
+
success: true,
|
|
337
|
+
assetId: existing.id,
|
|
338
|
+
upload: existing.attributes.url,
|
|
339
|
+
skipped: true,
|
|
340
|
+
};
|
|
341
|
+
}
|
|
170
342
|
}
|
|
171
343
|
const uploadRequest = await this.requestUploadParameters(finalFilename);
|
|
172
344
|
const uploadId = uploadRequest.data.id;
|
|
@@ -183,6 +355,7 @@ class DatoHelper extends runtime_1.default {
|
|
|
183
355
|
success: true,
|
|
184
356
|
upload: assetPayload.data.attributes.url,
|
|
185
357
|
assetId: assetPayload.data.id,
|
|
358
|
+
skipped: false,
|
|
186
359
|
};
|
|
187
360
|
}
|
|
188
361
|
async uploadFromFile(options) {
|
|
@@ -264,7 +437,14 @@ class DatoHelper extends runtime_1.default {
|
|
|
264
437
|
}
|
|
265
438
|
async findUploadByFilename(filename) {
|
|
266
439
|
try {
|
|
267
|
-
|
|
440
|
+
if (!filename || typeof filename !== 'string') {
|
|
441
|
+
this.logging.log(`findUploadByFilename called with invalid filename: ${String(filename)}`);
|
|
442
|
+
return null;
|
|
443
|
+
}
|
|
444
|
+
const normalizedTarget = filename.trim().toLowerCase().replace(/\.[^.]+$/, '');
|
|
445
|
+
const query = encodeURIComponent(normalizedTarget);
|
|
446
|
+
this.logging.log(`Searching uploads with query="${normalizedTarget}" for filename="${filename}"`);
|
|
447
|
+
const response = await fetch(`${this.baseUrl}/uploads?filter[query]=${query}&page[limit]=100`, {
|
|
268
448
|
headers: {
|
|
269
449
|
'Authorization': `Bearer ${this.apiToken}`,
|
|
270
450
|
'X-Api-Version': '3',
|
|
@@ -281,10 +461,32 @@ class DatoHelper extends runtime_1.default {
|
|
|
281
461
|
this.logging.error(`Failed to parse JSON in findUploadByFilename: ${err.message}`);
|
|
282
462
|
return null;
|
|
283
463
|
});
|
|
284
|
-
|
|
464
|
+
const uploads = data?.data || [];
|
|
465
|
+
if (!uploads.length) {
|
|
466
|
+
this.logging.log(`No uploads returned for query="${normalizedTarget}"`);
|
|
467
|
+
return null;
|
|
468
|
+
}
|
|
469
|
+
const targetFull = filename.trim().toLowerCase();
|
|
470
|
+
const match = uploads.find((u) => {
|
|
471
|
+
const storedFull = u?.attributes?.filename?.toLowerCase();
|
|
472
|
+
if (!storedFull)
|
|
473
|
+
return false;
|
|
474
|
+
if (storedFull === targetFull)
|
|
475
|
+
return true;
|
|
476
|
+
const storedNormalized = storedFull.replace(/\.[^.]+$/, '');
|
|
477
|
+
if (storedNormalized === normalizedTarget)
|
|
478
|
+
return true;
|
|
479
|
+
return false;
|
|
480
|
+
});
|
|
481
|
+
if (match) {
|
|
482
|
+
this.logging.log(`Found existing upload for "${filename}" -> asset_id=${match.id}, storedFilename=${match.attributes?.filename}`);
|
|
483
|
+
return match;
|
|
484
|
+
}
|
|
485
|
+
this.logging.log(`No exact filename match found among ${uploads.length} uploads for "${filename}" (query="${normalizedTarget}")`);
|
|
486
|
+
return null;
|
|
285
487
|
}
|
|
286
488
|
catch (err) {
|
|
287
|
-
this.logging.error(`Error in findUploadByFilename: ${err
|
|
489
|
+
this.logging.error(`Error in findUploadByFilename: ${err?.message ?? String(err)}`);
|
|
288
490
|
return null;
|
|
289
491
|
}
|
|
290
492
|
}
|
|
@@ -399,5 +601,37 @@ class DatoHelper extends runtime_1.default {
|
|
|
399
601
|
throw err;
|
|
400
602
|
}
|
|
401
603
|
}
|
|
604
|
+
async updateProductSwatch(productId, uploadId) {
|
|
605
|
+
try {
|
|
606
|
+
const res = await fetch(`${this.baseUrl}/items/${productId}`, {
|
|
607
|
+
method: "PATCH",
|
|
608
|
+
headers: {
|
|
609
|
+
Authorization: `Bearer ${this.apiToken}`,
|
|
610
|
+
"X-Api-Version": "3",
|
|
611
|
+
"X-Environment": this.environment,
|
|
612
|
+
"Content-Type": "application/vnd.api+json",
|
|
613
|
+
Accept: "application/json",
|
|
614
|
+
},
|
|
615
|
+
body: JSON.stringify({
|
|
616
|
+
data: {
|
|
617
|
+
type: "item",
|
|
618
|
+
id: productId,
|
|
619
|
+
attributes: {
|
|
620
|
+
swatch: { upload_id: uploadId },
|
|
621
|
+
},
|
|
622
|
+
},
|
|
623
|
+
}),
|
|
624
|
+
});
|
|
625
|
+
if (!res.ok) {
|
|
626
|
+
const errorText = await res.text();
|
|
627
|
+
throw new Error(`Failed to update product swatch: ${res.status} ${res.statusText} - ${errorText}`);
|
|
628
|
+
}
|
|
629
|
+
return await res.json();
|
|
630
|
+
}
|
|
631
|
+
catch (err) {
|
|
632
|
+
this.logging.error(`updateProductSwatch failed: ${err.message}`);
|
|
633
|
+
throw err;
|
|
634
|
+
}
|
|
635
|
+
}
|
|
402
636
|
}
|
|
403
637
|
exports.default = DatoHelper;
|
|
@@ -81,11 +81,11 @@ declare const schema: {
|
|
|
81
81
|
readonly maximum: 2085;
|
|
82
82
|
};
|
|
83
83
|
readonly journey_label: {
|
|
84
|
-
readonly type: readonly ["string"];
|
|
85
|
-
readonly enum: readonly ["CHECKOUT", "POS", "EXPRESS", "MOTO", "SYSTEM"];
|
|
84
|
+
readonly type: readonly ["string", "null"];
|
|
85
|
+
readonly enum: readonly ["CHECKOUT", "POS", "EXPRESS", "MOTO", "SYSTEM", null];
|
|
86
86
|
};
|
|
87
87
|
readonly psp_reference: {
|
|
88
|
-
readonly type:
|
|
88
|
+
readonly type: "string";
|
|
89
89
|
};
|
|
90
90
|
readonly card_brand: {
|
|
91
91
|
readonly type: readonly ["string", "null"];
|
|
@@ -136,7 +136,7 @@ declare const schema: {
|
|
|
136
136
|
readonly created_by: {
|
|
137
137
|
readonly anyOf: readonly [{
|
|
138
138
|
readonly type: "string";
|
|
139
|
-
readonly enum: readonly ["CUSTOMER", "SYSTEM"];
|
|
139
|
+
readonly enum: readonly ["CUSTOMER", "SYSTEM", "CENTRA", "SITOO", "STOREFRONT", "MOTO"];
|
|
140
140
|
}, {
|
|
141
141
|
readonly type: "string";
|
|
142
142
|
readonly format: "email";
|
|
@@ -81,11 +81,11 @@ declare const schema: {
|
|
|
81
81
|
readonly maximum: 2085;
|
|
82
82
|
};
|
|
83
83
|
readonly journey_label: {
|
|
84
|
-
readonly type: readonly ["string"];
|
|
85
|
-
readonly enum: readonly ["CHECKOUT", "POS", "EXPRESS", "MOTO", "SYSTEM"];
|
|
84
|
+
readonly type: readonly ["string", "null"];
|
|
85
|
+
readonly enum: readonly ["CHECKOUT", "POS", "EXPRESS", "MOTO", "SYSTEM", null];
|
|
86
86
|
};
|
|
87
87
|
readonly psp_reference: {
|
|
88
|
-
readonly type:
|
|
88
|
+
readonly type: "string";
|
|
89
89
|
};
|
|
90
90
|
readonly card_brand: {
|
|
91
91
|
readonly type: readonly ["string", "null"];
|
|
@@ -136,7 +136,7 @@ declare const schema: {
|
|
|
136
136
|
readonly created_by: {
|
|
137
137
|
readonly anyOf: readonly [{
|
|
138
138
|
readonly type: "string";
|
|
139
|
-
readonly enum: readonly ["CUSTOMER", "SYSTEM"];
|
|
139
|
+
readonly enum: readonly ["CUSTOMER", "SYSTEM", "CENTRA", "SITOO", "STOREFRONT", "MOTO"];
|
|
140
140
|
}, {
|
|
141
141
|
readonly type: "string";
|
|
142
142
|
readonly format: "email";
|
|
@@ -81,11 +81,11 @@ declare const schema: {
|
|
|
81
81
|
readonly maximum: 2085;
|
|
82
82
|
};
|
|
83
83
|
readonly journey_label: {
|
|
84
|
-
readonly type: readonly ["string"];
|
|
85
|
-
readonly enum: readonly ["CHECKOUT", "POS", "EXPRESS", "MOTO", "SYSTEM"];
|
|
84
|
+
readonly type: readonly ["string", "null"];
|
|
85
|
+
readonly enum: readonly ["CHECKOUT", "POS", "EXPRESS", "MOTO", "SYSTEM", null];
|
|
86
86
|
};
|
|
87
87
|
readonly psp_reference: {
|
|
88
|
-
readonly type:
|
|
88
|
+
readonly type: "string";
|
|
89
89
|
};
|
|
90
90
|
readonly card_brand: {
|
|
91
91
|
readonly type: readonly ["string", "null"];
|
|
@@ -136,7 +136,7 @@ declare const schema: {
|
|
|
136
136
|
readonly created_by: {
|
|
137
137
|
readonly anyOf: readonly [{
|
|
138
138
|
readonly type: "string";
|
|
139
|
-
readonly enum: readonly ["CUSTOMER", "SYSTEM"];
|
|
139
|
+
readonly enum: readonly ["CUSTOMER", "SYSTEM", "CENTRA", "SITOO", "STOREFRONT", "MOTO"];
|
|
140
140
|
}, {
|
|
141
141
|
readonly type: "string";
|
|
142
142
|
readonly format: "email";
|
|
@@ -81,11 +81,11 @@ declare const schema: {
|
|
|
81
81
|
readonly maximum: 2085;
|
|
82
82
|
};
|
|
83
83
|
readonly journey_label: {
|
|
84
|
-
readonly type: readonly ["string"];
|
|
85
|
-
readonly enum: readonly ["CHECKOUT", "POS", "EXPRESS", "MOTO", "SYSTEM"];
|
|
84
|
+
readonly type: readonly ["string", "null"];
|
|
85
|
+
readonly enum: readonly ["CHECKOUT", "POS", "EXPRESS", "MOTO", "SYSTEM", null];
|
|
86
86
|
};
|
|
87
87
|
readonly psp_reference: {
|
|
88
|
-
readonly type:
|
|
88
|
+
readonly type: "string";
|
|
89
89
|
};
|
|
90
90
|
readonly card_brand: {
|
|
91
91
|
readonly type: readonly ["string", "null"];
|
|
@@ -136,7 +136,7 @@ declare const schema: {
|
|
|
136
136
|
readonly created_by: {
|
|
137
137
|
readonly anyOf: readonly [{
|
|
138
138
|
readonly type: "string";
|
|
139
|
-
readonly enum: readonly ["CUSTOMER", "SYSTEM"];
|
|
139
|
+
readonly enum: readonly ["CUSTOMER", "SYSTEM", "CENTRA", "SITOO", "STOREFRONT", "MOTO"];
|
|
140
140
|
}, {
|
|
141
141
|
readonly type: "string";
|
|
142
142
|
readonly format: "email";
|
|
@@ -81,11 +81,11 @@ declare const schema: {
|
|
|
81
81
|
readonly maximum: 2085;
|
|
82
82
|
};
|
|
83
83
|
readonly journey_label: {
|
|
84
|
-
readonly type: readonly ["string"];
|
|
85
|
-
readonly enum: readonly ["CHECKOUT", "POS", "EXPRESS", "MOTO", "SYSTEM"];
|
|
84
|
+
readonly type: readonly ["string", "null"];
|
|
85
|
+
readonly enum: readonly ["CHECKOUT", "POS", "EXPRESS", "MOTO", "SYSTEM", null];
|
|
86
86
|
};
|
|
87
87
|
readonly psp_reference: {
|
|
88
|
-
readonly type:
|
|
88
|
+
readonly type: "string";
|
|
89
89
|
};
|
|
90
90
|
readonly card_brand: {
|
|
91
91
|
readonly type: readonly ["string", "null"];
|
|
@@ -136,7 +136,7 @@ declare const schema: {
|
|
|
136
136
|
readonly created_by: {
|
|
137
137
|
readonly anyOf: readonly [{
|
|
138
138
|
readonly type: "string";
|
|
139
|
-
readonly enum: readonly ["CUSTOMER", "SYSTEM"];
|
|
139
|
+
readonly enum: readonly ["CUSTOMER", "SYSTEM", "CENTRA", "SITOO", "STOREFRONT", "MOTO"];
|
|
140
140
|
}, {
|
|
141
141
|
readonly type: "string";
|
|
142
142
|
readonly format: "email";
|
|
@@ -80,11 +80,11 @@ declare const schema: {
|
|
|
80
80
|
readonly maximum: 2085;
|
|
81
81
|
};
|
|
82
82
|
readonly journey_label: {
|
|
83
|
-
readonly type: readonly ["string"];
|
|
84
|
-
readonly enum: readonly ["CHECKOUT", "POS", "EXPRESS", "MOTO", "SYSTEM"];
|
|
83
|
+
readonly type: readonly ["string", "null"];
|
|
84
|
+
readonly enum: readonly ["CHECKOUT", "POS", "EXPRESS", "MOTO", "SYSTEM", null];
|
|
85
85
|
};
|
|
86
86
|
readonly psp_reference: {
|
|
87
|
-
readonly type:
|
|
87
|
+
readonly type: "string";
|
|
88
88
|
};
|
|
89
89
|
readonly card_brand: {
|
|
90
90
|
readonly type: readonly ["string", "null"];
|
|
@@ -135,7 +135,7 @@ declare const schema: {
|
|
|
135
135
|
readonly created_by: {
|
|
136
136
|
readonly anyOf: readonly [{
|
|
137
137
|
readonly type: "string";
|
|
138
|
-
readonly enum: readonly ["CUSTOMER", "SYSTEM"];
|
|
138
|
+
readonly enum: readonly ["CUSTOMER", "SYSTEM", "CENTRA", "SITOO", "STOREFRONT", "MOTO"];
|
|
139
139
|
}, {
|
|
140
140
|
readonly type: "string";
|
|
141
141
|
readonly format: "email";
|
|
@@ -82,11 +82,11 @@ declare const MainModuleObj: {
|
|
|
82
82
|
readonly maximum: 2085;
|
|
83
83
|
};
|
|
84
84
|
readonly journey_label: {
|
|
85
|
-
readonly type: readonly ["string"];
|
|
86
|
-
readonly enum: readonly ["CHECKOUT", "POS", "EXPRESS", "MOTO", "SYSTEM"];
|
|
85
|
+
readonly type: readonly ["string", "null"];
|
|
86
|
+
readonly enum: readonly ["CHECKOUT", "POS", "EXPRESS", "MOTO", "SYSTEM", null];
|
|
87
87
|
};
|
|
88
88
|
readonly psp_reference: {
|
|
89
|
-
readonly type:
|
|
89
|
+
readonly type: "string";
|
|
90
90
|
};
|
|
91
91
|
readonly card_brand: {
|
|
92
92
|
readonly type: readonly ["string", "null"];
|
|
@@ -137,7 +137,7 @@ declare const MainModuleObj: {
|
|
|
137
137
|
readonly created_by: {
|
|
138
138
|
readonly anyOf: readonly [{
|
|
139
139
|
readonly type: "string";
|
|
140
|
-
readonly enum: readonly ["CUSTOMER", "SYSTEM"];
|
|
140
|
+
readonly enum: readonly ["CUSTOMER", "SYSTEM", "CENTRA", "SITOO", "STOREFRONT", "MOTO"];
|
|
141
141
|
}, {
|
|
142
142
|
readonly type: "string";
|
|
143
143
|
readonly format: "email";
|
|
@@ -77,11 +77,11 @@ declare const schema: {
|
|
|
77
77
|
readonly maximum: 2085;
|
|
78
78
|
};
|
|
79
79
|
readonly journey_label: {
|
|
80
|
-
readonly type: readonly ["string"];
|
|
81
|
-
readonly enum: readonly ["CHECKOUT", "POS", "EXPRESS", "MOTO", "SYSTEM"];
|
|
80
|
+
readonly type: readonly ["string", "null"];
|
|
81
|
+
readonly enum: readonly ["CHECKOUT", "POS", "EXPRESS", "MOTO", "SYSTEM", null];
|
|
82
82
|
};
|
|
83
83
|
readonly psp_reference: {
|
|
84
|
-
readonly type:
|
|
84
|
+
readonly type: "string";
|
|
85
85
|
};
|
|
86
86
|
readonly card_brand: {
|
|
87
87
|
readonly type: readonly ["string", "null"];
|
|
@@ -132,7 +132,7 @@ declare const schema: {
|
|
|
132
132
|
readonly created_by: {
|
|
133
133
|
readonly anyOf: readonly [{
|
|
134
134
|
readonly type: "string";
|
|
135
|
-
readonly enum: readonly ["CUSTOMER", "SYSTEM"];
|
|
135
|
+
readonly enum: readonly ["CUSTOMER", "SYSTEM", "CENTRA", "SITOO", "STOREFRONT", "MOTO"];
|
|
136
136
|
}, {
|
|
137
137
|
readonly type: "string";
|
|
138
138
|
readonly format: "email";
|
|
@@ -42,11 +42,11 @@ declare const schema: {
|
|
|
42
42
|
readonly maximum: 2085;
|
|
43
43
|
};
|
|
44
44
|
readonly journey_label: {
|
|
45
|
-
readonly type: readonly ["string"];
|
|
46
|
-
readonly enum: readonly ["CHECKOUT", "POS", "EXPRESS", "MOTO", "SYSTEM"];
|
|
45
|
+
readonly type: readonly ["string", "null"];
|
|
46
|
+
readonly enum: readonly ["CHECKOUT", "POS", "EXPRESS", "MOTO", "SYSTEM", null];
|
|
47
47
|
};
|
|
48
48
|
readonly psp_reference: {
|
|
49
|
-
readonly type:
|
|
49
|
+
readonly type: "string";
|
|
50
50
|
};
|
|
51
51
|
readonly card_brand: {
|
|
52
52
|
readonly type: readonly ["string", "null"];
|
|
@@ -97,7 +97,7 @@ declare const schema: {
|
|
|
97
97
|
readonly created_by: {
|
|
98
98
|
readonly anyOf: readonly [{
|
|
99
99
|
readonly type: "string";
|
|
100
|
-
readonly enum: readonly ["CUSTOMER", "SYSTEM"];
|
|
100
|
+
readonly enum: readonly ["CUSTOMER", "SYSTEM", "CENTRA", "SITOO", "STOREFRONT", "MOTO"];
|
|
101
101
|
}, {
|
|
102
102
|
readonly type: "string";
|
|
103
103
|
readonly format: "email";
|
|
@@ -108,12 +108,12 @@ export interface Payment {
|
|
|
108
108
|
card_token?: (string | null);
|
|
109
109
|
expiration_month?: (number | null);
|
|
110
110
|
expiration_year?: (number | null);
|
|
111
|
-
journey_label: ("CHECKOUT" | "POS" | "EXPRESS" | "MOTO" | "SYSTEM");
|
|
111
|
+
journey_label: ("CHECKOUT" | "POS" | "EXPRESS" | "MOTO" | "SYSTEM" | null);
|
|
112
112
|
psp_reference: string;
|
|
113
113
|
card_brand?: (string | null);
|
|
114
114
|
status: ("CAPTURED" | "FAILED" | "FAILED-3DS" | "CANCELLED");
|
|
115
115
|
amount: Money;
|
|
116
|
-
created_by: (("CUSTOMER" | "SYSTEM") | string);
|
|
116
|
+
created_by: (("CUSTOMER" | "SYSTEM" | "CENTRA" | "SITOO" | "STOREFRONT" | "MOTO") | string);
|
|
117
117
|
[k: string]: unknown;
|
|
118
118
|
}
|
|
119
119
|
export interface Money {
|
|
@@ -108,12 +108,12 @@ export interface Payment {
|
|
|
108
108
|
card_token?: (string | null);
|
|
109
109
|
expiration_month?: (number | null);
|
|
110
110
|
expiration_year?: (number | null);
|
|
111
|
-
journey_label: ("CHECKOUT" | "POS" | "EXPRESS" | "MOTO" | "SYSTEM");
|
|
111
|
+
journey_label: ("CHECKOUT" | "POS" | "EXPRESS" | "MOTO" | "SYSTEM" | null);
|
|
112
112
|
psp_reference: string;
|
|
113
113
|
card_brand?: (string | null);
|
|
114
114
|
status: ("CAPTURED" | "FAILED" | "FAILED-3DS" | "CANCELLED");
|
|
115
115
|
amount: Money;
|
|
116
|
-
created_by: (("CUSTOMER" | "SYSTEM") | string);
|
|
116
|
+
created_by: (("CUSTOMER" | "SYSTEM" | "CENTRA" | "SITOO" | "STOREFRONT" | "MOTO") | string);
|
|
117
117
|
[k: string]: unknown;
|
|
118
118
|
}
|
|
119
119
|
export interface Money {
|
|
@@ -108,12 +108,12 @@ export interface Payment {
|
|
|
108
108
|
card_token?: (string | null);
|
|
109
109
|
expiration_month?: (number | null);
|
|
110
110
|
expiration_year?: (number | null);
|
|
111
|
-
journey_label: ("CHECKOUT" | "POS" | "EXPRESS" | "MOTO" | "SYSTEM");
|
|
111
|
+
journey_label: ("CHECKOUT" | "POS" | "EXPRESS" | "MOTO" | "SYSTEM" | null);
|
|
112
112
|
psp_reference: string;
|
|
113
113
|
card_brand?: (string | null);
|
|
114
114
|
status: ("CAPTURED" | "FAILED" | "FAILED-3DS" | "CANCELLED");
|
|
115
115
|
amount: Money;
|
|
116
|
-
created_by: (("CUSTOMER" | "SYSTEM") | string);
|
|
116
|
+
created_by: (("CUSTOMER" | "SYSTEM" | "CENTRA" | "SITOO" | "STOREFRONT" | "MOTO") | string);
|
|
117
117
|
[k: string]: unknown;
|
|
118
118
|
}
|
|
119
119
|
export interface Money {
|
|
@@ -108,12 +108,12 @@ export interface Payment {
|
|
|
108
108
|
card_token?: (string | null);
|
|
109
109
|
expiration_month?: (number | null);
|
|
110
110
|
expiration_year?: (number | null);
|
|
111
|
-
journey_label: ("CHECKOUT" | "POS" | "EXPRESS" | "MOTO" | "SYSTEM");
|
|
111
|
+
journey_label: ("CHECKOUT" | "POS" | "EXPRESS" | "MOTO" | "SYSTEM" | null);
|
|
112
112
|
psp_reference: string;
|
|
113
113
|
card_brand?: (string | null);
|
|
114
114
|
status: ("CAPTURED" | "FAILED" | "FAILED-3DS" | "CANCELLED");
|
|
115
115
|
amount: Money;
|
|
116
|
-
created_by: (("CUSTOMER" | "SYSTEM") | string);
|
|
116
|
+
created_by: (("CUSTOMER" | "SYSTEM" | "CENTRA" | "SITOO" | "STOREFRONT" | "MOTO") | string);
|
|
117
117
|
[k: string]: unknown;
|
|
118
118
|
}
|
|
119
119
|
export interface Money {
|
|
@@ -109,12 +109,12 @@ export interface Payment {
|
|
|
109
109
|
card_token?: (string | null);
|
|
110
110
|
expiration_month?: (number | null);
|
|
111
111
|
expiration_year?: (number | null);
|
|
112
|
-
journey_label: ("CHECKOUT" | "POS" | "EXPRESS" | "MOTO" | "SYSTEM");
|
|
112
|
+
journey_label: ("CHECKOUT" | "POS" | "EXPRESS" | "MOTO" | "SYSTEM" | null);
|
|
113
113
|
psp_reference: string;
|
|
114
114
|
card_brand?: (string | null);
|
|
115
115
|
status: ("CAPTURED" | "FAILED" | "FAILED-3DS" | "CANCELLED");
|
|
116
116
|
amount: Money;
|
|
117
|
-
created_by: (("CUSTOMER" | "SYSTEM") | string);
|
|
117
|
+
created_by: (("CUSTOMER" | "SYSTEM" | "CENTRA" | "SITOO" | "STOREFRONT" | "MOTO") | string);
|
|
118
118
|
[k: string]: unknown;
|
|
119
119
|
}
|
|
120
120
|
export interface Money {
|
|
@@ -109,12 +109,12 @@ export interface Payment {
|
|
|
109
109
|
card_token?: (string | null);
|
|
110
110
|
expiration_month?: (number | null);
|
|
111
111
|
expiration_year?: (number | null);
|
|
112
|
-
journey_label: ("CHECKOUT" | "POS" | "EXPRESS" | "MOTO" | "SYSTEM");
|
|
112
|
+
journey_label: ("CHECKOUT" | "POS" | "EXPRESS" | "MOTO" | "SYSTEM" | null);
|
|
113
113
|
psp_reference: string;
|
|
114
114
|
card_brand?: (string | null);
|
|
115
115
|
status: ("CAPTURED" | "FAILED" | "FAILED-3DS" | "CANCELLED");
|
|
116
116
|
amount: Money;
|
|
117
|
-
created_by: (("CUSTOMER" | "SYSTEM") | string);
|
|
117
|
+
created_by: (("CUSTOMER" | "SYSTEM" | "CENTRA" | "SITOO" | "STOREFRONT" | "MOTO") | string);
|
|
118
118
|
[k: string]: unknown;
|
|
119
119
|
}
|
|
120
120
|
export interface Money {
|
|
@@ -105,12 +105,12 @@ export interface Payment {
|
|
|
105
105
|
card_token?: (string | null);
|
|
106
106
|
expiration_month?: (number | null);
|
|
107
107
|
expiration_year?: (number | null);
|
|
108
|
-
journey_label: ("CHECKOUT" | "POS" | "EXPRESS" | "MOTO" | "SYSTEM");
|
|
108
|
+
journey_label: ("CHECKOUT" | "POS" | "EXPRESS" | "MOTO" | "SYSTEM" | null);
|
|
109
109
|
psp_reference: string;
|
|
110
110
|
card_brand?: (string | null);
|
|
111
111
|
status: ("CAPTURED" | "FAILED" | "FAILED-3DS" | "CANCELLED");
|
|
112
112
|
amount: Money;
|
|
113
|
-
created_by: (("CUSTOMER" | "SYSTEM") | string);
|
|
113
|
+
created_by: (("CUSTOMER" | "SYSTEM" | "CENTRA" | "SITOO" | "STOREFRONT" | "MOTO") | string);
|
|
114
114
|
[k: string]: unknown;
|
|
115
115
|
}
|
|
116
116
|
export interface Money {
|