@deliverart/sdk-js-integration 0.0.3 → 0.0.5
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/CHANGELOG.md +12 -0
- package/dist/index.cjs +54 -6
- package/dist/index.d.cts +264 -2311
- package/dist/index.d.ts +264 -2311
- package/dist/index.js +47 -6
- package/package.json +1 -1
- package/src/cancellation-request-types.ts +12 -4
- package/src/schemas.ts +8 -1
- package/src/types.ts +57 -1
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -283,6 +283,8 @@ __export(index_exports, {
|
|
|
283
283
|
integrationClientLogRequestMethods: () => integrationClientLogRequestMethods,
|
|
284
284
|
integrationClientLogRequestSchema: () => integrationClientLogRequestSchema,
|
|
285
285
|
integrationDeliverooDataSchema: () => integrationDeliverooDataSchema,
|
|
286
|
+
integrationDeliverooMenuVersionNullablePathSchema: () => integrationDeliverooMenuVersionNullablePathSchema,
|
|
287
|
+
integrationDeliverooMenuVersionPathSchema: () => integrationDeliverooMenuVersionPathSchema,
|
|
286
288
|
integrationDeliverooNullablePathSchema: () => integrationDeliverooNullablePathSchema,
|
|
287
289
|
integrationDeliverooPathSchema: () => integrationDeliverooPathSchema,
|
|
288
290
|
integrationDeliverooSiteStatusSchema: () => integrationDeliverooSiteStatusSchema,
|
|
@@ -300,6 +302,8 @@ __export(index_exports, {
|
|
|
300
302
|
integrationGlovoDataSchema: () => integrationGlovoDataSchema,
|
|
301
303
|
integrationGlovoMenuUpdateStatusSchema: () => integrationGlovoMenuUpdateStatusSchema,
|
|
302
304
|
integrationGlovoMenuUpdateStatuses: () => integrationGlovoMenuUpdateStatuses,
|
|
305
|
+
integrationGlovoMenuVersionNullablePathSchema: () => integrationGlovoMenuVersionNullablePathSchema,
|
|
306
|
+
integrationGlovoMenuVersionPathSchema: () => integrationGlovoMenuVersionPathSchema,
|
|
303
307
|
integrationGlovoNullablePathSchema: () => integrationGlovoNullablePathSchema,
|
|
304
308
|
integrationGlovoPathSchema: () => integrationGlovoPathSchema,
|
|
305
309
|
integrationGlovoStoreStatusSchema: () => integrationGlovoStoreStatusSchema,
|
|
@@ -309,6 +313,8 @@ __export(index_exports, {
|
|
|
309
313
|
integrationGlovoWebhookEventTypeSchema: () => integrationGlovoWebhookEventTypeSchema,
|
|
310
314
|
integrationGlovoWebhookEventTypes: () => integrationGlovoWebhookEventTypes,
|
|
311
315
|
integrationJustEatDataSchema: () => integrationJustEatDataSchema,
|
|
316
|
+
integrationJustEatMenuVersionNullablePathSchema: () => integrationJustEatMenuVersionNullablePathSchema,
|
|
317
|
+
integrationJustEatMenuVersionPathSchema: () => integrationJustEatMenuVersionPathSchema,
|
|
312
318
|
integrationJustEatNullablePathSchema: () => integrationJustEatNullablePathSchema,
|
|
313
319
|
integrationJustEatPathSchema: () => integrationJustEatPathSchema,
|
|
314
320
|
integrationJustEatRestaurantStatusSchema: () => integrationJustEatRestaurantStatusSchema,
|
|
@@ -319,6 +325,7 @@ __export(index_exports, {
|
|
|
319
325
|
integrationJustEatSyncOpeningHoursResponseSchema: () => integrationJustEatSyncOpeningHoursResponseSchema,
|
|
320
326
|
integrationJustEatSyncTypeSchema: () => integrationJustEatSyncTypeSchema,
|
|
321
327
|
integrationJustEatSyncTypes: () => integrationJustEatSyncTypes,
|
|
328
|
+
integrationMenuVersionPathSchemas: () => integrationMenuVersionPathSchemas,
|
|
322
329
|
integrationNullablePathSchema: () => integrationNullablePathSchema,
|
|
323
330
|
integrationPathSchema: () => integrationPathSchema,
|
|
324
331
|
integrationPathSchemas: () => integrationPathSchemas,
|
|
@@ -446,7 +453,9 @@ var integrationCassaInCloudWebHookEventEventSchema = import_zod.z.enum(
|
|
|
446
453
|
integrationCassaInCloudWebHookEventEvents
|
|
447
454
|
);
|
|
448
455
|
function createIntegrationPathSchemas(service) {
|
|
449
|
-
const regex = new RegExp(
|
|
456
|
+
const regex = new RegExp(
|
|
457
|
+
`^/integrations/${service}/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$`
|
|
458
|
+
);
|
|
450
459
|
const pathSchema = import_zod.z.string().refine((val) => regex.test(val), {
|
|
451
460
|
message: `Invalid integration ${service} path format`
|
|
452
461
|
});
|
|
@@ -455,15 +464,36 @@ function createIntegrationPathSchemas(service) {
|
|
|
455
464
|
});
|
|
456
465
|
return { pathSchema, nullablePathSchema };
|
|
457
466
|
}
|
|
467
|
+
function createIntegrationMenuVersionPathSchemas(service) {
|
|
468
|
+
const regex = new RegExp(
|
|
469
|
+
`^/integrations/${service}/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/menu_versions/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$`
|
|
470
|
+
);
|
|
471
|
+
const pathSchema = import_zod.z.string().refine((val) => regex.test(val), {
|
|
472
|
+
message: `Invalid integration ${service} menu version path format`
|
|
473
|
+
});
|
|
474
|
+
const nullablePathSchema = import_zod.z.string().nullable().refine((val) => val == null || regex.test(val), {
|
|
475
|
+
message: `Invalid integration ${service} menu version path format`
|
|
476
|
+
});
|
|
477
|
+
return { pathSchema, nullablePathSchema };
|
|
478
|
+
}
|
|
458
479
|
var integrationPathSchemas = Object.fromEntries(
|
|
459
480
|
integrationServices.map((service) => [service, createIntegrationPathSchemas(service)])
|
|
460
481
|
);
|
|
482
|
+
var integrationMenuVersionPathSchemas = Object.fromEntries(
|
|
483
|
+
integrationServices.map((service) => [service, createIntegrationMenuVersionPathSchemas(service)])
|
|
484
|
+
);
|
|
461
485
|
var integrationDeliverooPathSchema = integrationPathSchemas.deliveroo.pathSchema;
|
|
462
486
|
var integrationDeliverooNullablePathSchema = integrationPathSchemas.deliveroo.nullablePathSchema;
|
|
487
|
+
var integrationDeliverooMenuVersionPathSchema = integrationMenuVersionPathSchemas.deliveroo.pathSchema;
|
|
488
|
+
var integrationDeliverooMenuVersionNullablePathSchema = integrationMenuVersionPathSchemas.deliveroo.nullablePathSchema;
|
|
463
489
|
var integrationGlovoPathSchema = integrationPathSchemas.glovo.pathSchema;
|
|
464
490
|
var integrationGlovoNullablePathSchema = integrationPathSchemas.glovo.nullablePathSchema;
|
|
491
|
+
var integrationGlovoMenuVersionPathSchema = integrationMenuVersionPathSchemas.glovo.pathSchema;
|
|
492
|
+
var integrationGlovoMenuVersionNullablePathSchema = integrationMenuVersionPathSchemas.glovo.nullablePathSchema;
|
|
465
493
|
var integrationJustEatPathSchema = integrationPathSchemas.justeat.pathSchema;
|
|
466
494
|
var integrationJustEatNullablePathSchema = integrationPathSchemas.justeat.nullablePathSchema;
|
|
495
|
+
var integrationJustEatMenuVersionPathSchema = integrationMenuVersionPathSchemas.justeat.pathSchema;
|
|
496
|
+
var integrationJustEatMenuVersionNullablePathSchema = integrationMenuVersionPathSchemas.justeat.nullablePathSchema;
|
|
467
497
|
var integrationCassaInCloudPathSchema = integrationPathSchemas.cassa_in_cloud.pathSchema;
|
|
468
498
|
var integrationCassaInCloudNullablePathSchema = integrationPathSchemas.cassa_in_cloud.nullablePathSchema;
|
|
469
499
|
var integrationPathSchema = import_zod.z.string().refine(
|
|
@@ -640,13 +670,20 @@ var integrationCancellationRequestStatuses = ["pending", "aborted", "completed"]
|
|
|
640
670
|
var integrationCancellationRequestStatusSchema = import_zod6.z.enum(
|
|
641
671
|
integrationCancellationRequestStatuses
|
|
642
672
|
);
|
|
643
|
-
var integrationCancellationRequestPathSchema = import_zod6.z.string().refine(
|
|
644
|
-
|
|
645
|
-
|
|
673
|
+
var integrationCancellationRequestPathSchema = import_zod6.z.string().refine(
|
|
674
|
+
(val) => /^\/integrations\/cancellation_requests\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(
|
|
675
|
+
val
|
|
676
|
+
),
|
|
677
|
+
{
|
|
678
|
+
message: "Invalid integration cancellation request path format"
|
|
679
|
+
}
|
|
680
|
+
);
|
|
646
681
|
var integrationCancellationRequestNullablePathSchema = import_zod6.z.string().nullable().refine(
|
|
647
682
|
(val) => {
|
|
648
683
|
if (!val) return true;
|
|
649
|
-
return /^\/integrations\/cancellation_requests\/[
|
|
684
|
+
return /^\/integrations\/cancellation_requests\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(
|
|
685
|
+
val
|
|
686
|
+
);
|
|
650
687
|
},
|
|
651
688
|
{
|
|
652
689
|
message: "Invalid integration cancellation request path format"
|
|
@@ -1158,7 +1195,11 @@ var integrationDeliveryProviderCommonSchema = import_zod23.z.object({
|
|
|
1158
1195
|
isValidMenu: import_zod23.z.boolean(),
|
|
1159
1196
|
latestMenuSyncAt: import_sdk_js_global_types5.datetimeSchema.nullable(),
|
|
1160
1197
|
latestMenuCheckAt: import_sdk_js_global_types5.datetimeSchema.nullable(),
|
|
1161
|
-
currentMenuVersion:
|
|
1198
|
+
currentMenuVersion: import_zod23.z.union([
|
|
1199
|
+
integrationDeliverooMenuVersionNullablePathSchema,
|
|
1200
|
+
integrationGlovoMenuVersionNullablePathSchema,
|
|
1201
|
+
integrationJustEatMenuVersionNullablePathSchema
|
|
1202
|
+
]),
|
|
1162
1203
|
salesMode: import_sdk_js_sales_mode.salesModeNullablePathSchema
|
|
1163
1204
|
});
|
|
1164
1205
|
var integrationClientLogRequestSchema = import_zod23.z.object({
|
|
@@ -3596,6 +3637,8 @@ var UpdateIntegration = class extends import_sdk_js_core80.AbstractApiRequest {
|
|
|
3596
3637
|
integrationClientLogRequestMethods,
|
|
3597
3638
|
integrationClientLogRequestSchema,
|
|
3598
3639
|
integrationDeliverooDataSchema,
|
|
3640
|
+
integrationDeliverooMenuVersionNullablePathSchema,
|
|
3641
|
+
integrationDeliverooMenuVersionPathSchema,
|
|
3599
3642
|
integrationDeliverooNullablePathSchema,
|
|
3600
3643
|
integrationDeliverooPathSchema,
|
|
3601
3644
|
integrationDeliverooSiteStatusSchema,
|
|
@@ -3613,6 +3656,8 @@ var UpdateIntegration = class extends import_sdk_js_core80.AbstractApiRequest {
|
|
|
3613
3656
|
integrationGlovoDataSchema,
|
|
3614
3657
|
integrationGlovoMenuUpdateStatusSchema,
|
|
3615
3658
|
integrationGlovoMenuUpdateStatuses,
|
|
3659
|
+
integrationGlovoMenuVersionNullablePathSchema,
|
|
3660
|
+
integrationGlovoMenuVersionPathSchema,
|
|
3616
3661
|
integrationGlovoNullablePathSchema,
|
|
3617
3662
|
integrationGlovoPathSchema,
|
|
3618
3663
|
integrationGlovoStoreStatusSchema,
|
|
@@ -3622,6 +3667,8 @@ var UpdateIntegration = class extends import_sdk_js_core80.AbstractApiRequest {
|
|
|
3622
3667
|
integrationGlovoWebhookEventTypeSchema,
|
|
3623
3668
|
integrationGlovoWebhookEventTypes,
|
|
3624
3669
|
integrationJustEatDataSchema,
|
|
3670
|
+
integrationJustEatMenuVersionNullablePathSchema,
|
|
3671
|
+
integrationJustEatMenuVersionPathSchema,
|
|
3625
3672
|
integrationJustEatNullablePathSchema,
|
|
3626
3673
|
integrationJustEatPathSchema,
|
|
3627
3674
|
integrationJustEatRestaurantStatusSchema,
|
|
@@ -3632,6 +3679,7 @@ var UpdateIntegration = class extends import_sdk_js_core80.AbstractApiRequest {
|
|
|
3632
3679
|
integrationJustEatSyncOpeningHoursResponseSchema,
|
|
3633
3680
|
integrationJustEatSyncTypeSchema,
|
|
3634
3681
|
integrationJustEatSyncTypes,
|
|
3682
|
+
integrationMenuVersionPathSchemas,
|
|
3635
3683
|
integrationNullablePathSchema,
|
|
3636
3684
|
integrationPathSchema,
|
|
3637
3685
|
integrationPathSchemas,
|