@deliverart/sdk-js-integration 0.0.3 → 0.0.4
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 +6 -0
- package/dist/index.cjs +43 -2
- package/dist/index.d.cts +264 -2311
- package/dist/index.d.ts +264 -2311
- package/dist/index.js +36 -2
- package/package.json +1 -1
- 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(
|
|
@@ -1158,7 +1188,11 @@ var integrationDeliveryProviderCommonSchema = import_zod23.z.object({
|
|
|
1158
1188
|
isValidMenu: import_zod23.z.boolean(),
|
|
1159
1189
|
latestMenuSyncAt: import_sdk_js_global_types5.datetimeSchema.nullable(),
|
|
1160
1190
|
latestMenuCheckAt: import_sdk_js_global_types5.datetimeSchema.nullable(),
|
|
1161
|
-
currentMenuVersion:
|
|
1191
|
+
currentMenuVersion: import_zod23.z.union([
|
|
1192
|
+
integrationDeliverooMenuVersionNullablePathSchema,
|
|
1193
|
+
integrationGlovoMenuVersionNullablePathSchema,
|
|
1194
|
+
integrationJustEatMenuVersionNullablePathSchema
|
|
1195
|
+
]),
|
|
1162
1196
|
salesMode: import_sdk_js_sales_mode.salesModeNullablePathSchema
|
|
1163
1197
|
});
|
|
1164
1198
|
var integrationClientLogRequestSchema = import_zod23.z.object({
|
|
@@ -3596,6 +3630,8 @@ var UpdateIntegration = class extends import_sdk_js_core80.AbstractApiRequest {
|
|
|
3596
3630
|
integrationClientLogRequestMethods,
|
|
3597
3631
|
integrationClientLogRequestSchema,
|
|
3598
3632
|
integrationDeliverooDataSchema,
|
|
3633
|
+
integrationDeliverooMenuVersionNullablePathSchema,
|
|
3634
|
+
integrationDeliverooMenuVersionPathSchema,
|
|
3599
3635
|
integrationDeliverooNullablePathSchema,
|
|
3600
3636
|
integrationDeliverooPathSchema,
|
|
3601
3637
|
integrationDeliverooSiteStatusSchema,
|
|
@@ -3613,6 +3649,8 @@ var UpdateIntegration = class extends import_sdk_js_core80.AbstractApiRequest {
|
|
|
3613
3649
|
integrationGlovoDataSchema,
|
|
3614
3650
|
integrationGlovoMenuUpdateStatusSchema,
|
|
3615
3651
|
integrationGlovoMenuUpdateStatuses,
|
|
3652
|
+
integrationGlovoMenuVersionNullablePathSchema,
|
|
3653
|
+
integrationGlovoMenuVersionPathSchema,
|
|
3616
3654
|
integrationGlovoNullablePathSchema,
|
|
3617
3655
|
integrationGlovoPathSchema,
|
|
3618
3656
|
integrationGlovoStoreStatusSchema,
|
|
@@ -3622,6 +3660,8 @@ var UpdateIntegration = class extends import_sdk_js_core80.AbstractApiRequest {
|
|
|
3622
3660
|
integrationGlovoWebhookEventTypeSchema,
|
|
3623
3661
|
integrationGlovoWebhookEventTypes,
|
|
3624
3662
|
integrationJustEatDataSchema,
|
|
3663
|
+
integrationJustEatMenuVersionNullablePathSchema,
|
|
3664
|
+
integrationJustEatMenuVersionPathSchema,
|
|
3625
3665
|
integrationJustEatNullablePathSchema,
|
|
3626
3666
|
integrationJustEatPathSchema,
|
|
3627
3667
|
integrationJustEatRestaurantStatusSchema,
|
|
@@ -3632,6 +3672,7 @@ var UpdateIntegration = class extends import_sdk_js_core80.AbstractApiRequest {
|
|
|
3632
3672
|
integrationJustEatSyncOpeningHoursResponseSchema,
|
|
3633
3673
|
integrationJustEatSyncTypeSchema,
|
|
3634
3674
|
integrationJustEatSyncTypes,
|
|
3675
|
+
integrationMenuVersionPathSchemas,
|
|
3635
3676
|
integrationNullablePathSchema,
|
|
3636
3677
|
integrationPathSchema,
|
|
3637
3678
|
integrationPathSchemas,
|