@deliverart/sdk-js-integration 0.0.2 → 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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @deliverart/sdk-js-integration
2
2
 
3
+ ## 0.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 62f0a75: fix types
8
+
9
+ ## 0.0.3
10
+
11
+ ### Patch Changes
12
+
13
+ - 30f93b7: fix types
14
+
3
15
  ## 0.0.2
4
16
 
5
17
  ### Patch Changes
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(`^/integrations/${service}/[a-z_]+/[0-9a-fA-F-]{36}$`);
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(
@@ -1156,9 +1186,13 @@ var integrationDeliveryProviderCommonSchema = import_zod23.z.object({
1156
1186
  importTaggedItems: import_zod23.z.boolean(),
1157
1187
  tagsForImport: import_zod23.z.array(import_zod23.z.string()).optional(),
1158
1188
  isValidMenu: import_zod23.z.boolean(),
1159
- latestMenuSyncAt: import_sdk_js_global_types5.datetimeSchema,
1160
- latestMenuCheckAt: import_sdk_js_global_types5.datetimeSchema,
1161
- currentMenuVersion: menuVersionSchema.nullable(),
1189
+ latestMenuSyncAt: import_sdk_js_global_types5.datetimeSchema.nullable(),
1190
+ latestMenuCheckAt: import_sdk_js_global_types5.datetimeSchema.nullable(),
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({
@@ -1507,7 +1541,7 @@ var integrationJustEatSchema = integrationBaseSchema.omit({ service: true }).ext
1507
1541
  syncType: integrationJustEatSyncTypeSchema,
1508
1542
  defaultLanguage: import_zod27.z.string(),
1509
1543
  restaurantId: import_zod27.z.string(),
1510
- latestOpeningTimesSyncAt: import_sdk_js_global_types9.datetimeSchema,
1544
+ latestOpeningTimesSyncAt: import_sdk_js_global_types9.datetimeSchema.nullable(),
1511
1545
  service: integrationServiceSchema.extract(["justeat"]),
1512
1546
  autoAcceptOrders: import_zod27.z.boolean(),
1513
1547
  nextSyncMenuScheduledAt: import_sdk_js_global_types9.datetimeSchema.nullable()
@@ -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,