@nextorders/food-schema 0.3.0 → 0.3.2
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/index.d.mts +215 -31
- package/dist/index.d.ts +215 -31
- package/dist/index.mjs +47 -7
- package/package.json +2 -3
package/dist/index.mjs
CHANGED
|
@@ -363,10 +363,10 @@ const SelfPickupSchema = z.object({
|
|
|
363
363
|
warehouses: WarehouseSchema.array().optional()
|
|
364
364
|
});
|
|
365
365
|
const LinkSchema = z.object({
|
|
366
|
-
to: z.string(),
|
|
366
|
+
to: z.string().min(1),
|
|
367
367
|
label: LocaleValueSchema.array().optional(),
|
|
368
368
|
icon: z.string().optional(),
|
|
369
|
-
target: z.
|
|
369
|
+
target: z.enum(["_blank", "_self", "_parent", "_top"]).optional()
|
|
370
370
|
});
|
|
371
371
|
const LinksSchema = z.object({
|
|
372
372
|
aside: LinkSchema.array(),
|
|
@@ -492,7 +492,8 @@ const OptionsSchema = z.object({
|
|
|
492
492
|
currencyCode: CurrencyCodeSchema,
|
|
493
493
|
headLinks: HeadLinkSchema.array().optional(),
|
|
494
494
|
headScripts: HeadScriptSchema.array().optional(),
|
|
495
|
-
headStyles: HeadStyleSchema.array().optional()
|
|
495
|
+
headStyles: HeadStyleSchema.array().optional(),
|
|
496
|
+
addressSuggestEnabled: z.boolean().optional()
|
|
496
497
|
});
|
|
497
498
|
|
|
498
499
|
const DeliveryMethodSchema = z.enum([
|
|
@@ -526,7 +527,9 @@ const OrderDeliveryAddressSchema = z.object({
|
|
|
526
527
|
intercom: z.string().optional(),
|
|
527
528
|
entrance: z.string().optional(),
|
|
528
529
|
floor: z.string().optional(),
|
|
529
|
-
addressNote: z.string().optional()
|
|
530
|
+
addressNote: z.string().optional(),
|
|
531
|
+
lat: z.number().nullable().optional(),
|
|
532
|
+
lon: z.number().nullable().optional()
|
|
530
533
|
});
|
|
531
534
|
const OrderWarehouseAddressSchema = z.object({
|
|
532
535
|
type: z.literal("warehouseAddress"),
|
|
@@ -558,6 +561,12 @@ const OrderSchema = z.object({
|
|
|
558
561
|
/** Items included in the order */
|
|
559
562
|
items: OrderItemSchema.array()
|
|
560
563
|
});
|
|
564
|
+
const AddressSuggestionSchema = z.object({
|
|
565
|
+
value: z.string(),
|
|
566
|
+
lat: z.number().nullable(),
|
|
567
|
+
lon: z.number().nullable(),
|
|
568
|
+
data: z.record(z.string(), z.unknown()).optional()
|
|
569
|
+
});
|
|
561
570
|
|
|
562
571
|
const GatewayActionTypeSchema = z.enum([
|
|
563
572
|
"getOptions",
|
|
@@ -572,7 +581,9 @@ const GatewayActionTypeSchema = z.enum([
|
|
|
572
581
|
"getMenu",
|
|
573
582
|
"getDeliveryByCourierStatus",
|
|
574
583
|
"getSelfPickupStatus",
|
|
575
|
-
"getTimeSlots"
|
|
584
|
+
"getTimeSlots",
|
|
585
|
+
"suggestAddresses",
|
|
586
|
+
"checkDeliveryZone"
|
|
576
587
|
]);
|
|
577
588
|
const GatewayRequestSchema = z.object({
|
|
578
589
|
type: GatewayActionTypeSchema,
|
|
@@ -695,6 +706,33 @@ const GatewayGetTimeSlotsResponseSchema = BaseResponseSchema.extend({
|
|
|
695
706
|
type: z.literal("getTimeSlots"),
|
|
696
707
|
result: TimePeriodSchema.array()
|
|
697
708
|
});
|
|
709
|
+
const GatewaySuggestAddressesRequestSchema = GatewayRequestSchema.extend({
|
|
710
|
+
type: z.literal("suggestAddresses"),
|
|
711
|
+
body: z.object({
|
|
712
|
+
query: z.string().min(1).max(200),
|
|
713
|
+
limit: z.number().int().min(1).max(50).optional()
|
|
714
|
+
})
|
|
715
|
+
});
|
|
716
|
+
const GatewaySuggestAddressesResponseSchema = BaseResponseSchema.extend({
|
|
717
|
+
type: z.literal("suggestAddresses"),
|
|
718
|
+
result: z.array(AddressSuggestionSchema)
|
|
719
|
+
});
|
|
720
|
+
const DeliveryZoneInfoSchema = z.object({
|
|
721
|
+
name: z.string(),
|
|
722
|
+
deliveryPrice: z.number(),
|
|
723
|
+
minOrderAmount: z.number().nullable()
|
|
724
|
+
});
|
|
725
|
+
const GatewayCheckDeliveryZoneRequestSchema = GatewayRequestSchema.extend({
|
|
726
|
+
type: z.literal("checkDeliveryZone"),
|
|
727
|
+
body: z.object({
|
|
728
|
+
lat: z.number(),
|
|
729
|
+
lon: z.number()
|
|
730
|
+
})
|
|
731
|
+
});
|
|
732
|
+
const GatewayCheckDeliveryZoneResponseSchema = BaseResponseSchema.extend({
|
|
733
|
+
type: z.literal("checkDeliveryZone"),
|
|
734
|
+
result: DeliveryZoneInfoSchema.nullable()
|
|
735
|
+
});
|
|
698
736
|
const GatewayResponseSchema = z.discriminatedUnion("type", [
|
|
699
737
|
GatewayGetOptionsResponseSchema,
|
|
700
738
|
GatewayGetChannelsResponseSchema,
|
|
@@ -708,7 +746,9 @@ const GatewayResponseSchema = z.discriminatedUnion("type", [
|
|
|
708
746
|
GatewayGetMenuResponseSchema,
|
|
709
747
|
GatewayGetDeliveryByCourierStatusResponseSchema,
|
|
710
748
|
GatewayGetSelfPickupStatusResponseSchema,
|
|
711
|
-
GatewayGetTimeSlotsResponseSchema
|
|
749
|
+
GatewayGetTimeSlotsResponseSchema,
|
|
750
|
+
GatewaySuggestAddressesResponseSchema,
|
|
751
|
+
GatewayCheckDeliveryZoneResponseSchema
|
|
712
752
|
]);
|
|
713
753
|
|
|
714
|
-
export { BaseResponseSchema, ChannelSchema, CompositionIngredientSchema, CompositionProductSchema, CountryCodeSchema, CurrencyCodeSchema, DayScheduleSchema, DeliveryByCourierSchema, DeliveryMethodSchema, GatewayActionTypeSchema, GatewayAddOrderItemRequestSchema, GatewayAddOrderItemResponseSchema, GatewayCompleteOrderRequestSchema, GatewayCompleteOrderResponseSchema, GatewayCreateOrderRequestSchema, GatewayCreateOrderResponseSchema, GatewayDecrementOrderItemQuantityRequestSchema, GatewayDecrementOrderItemQuantityResponseSchema, GatewayGetChannelsRequestSchema, GatewayGetChannelsResponseSchema, GatewayGetDeliveryByCourierStatusRequestSchema, GatewayGetDeliveryByCourierStatusResponseSchema, GatewayGetMenuRequestSchema, GatewayGetMenuResponseSchema, GatewayGetOptionsRequestSchema, GatewayGetOptionsResponseSchema, GatewayGetOrderRequestSchema, GatewayGetOrderResponseSchema, GatewayGetSelfPickupStatusRequestSchema, GatewayGetSelfPickupStatusResponseSchema, GatewayGetTimeSlotsRequestSchema, GatewayGetTimeSlotsResponseSchema, GatewayIncrementOrderItemQuantityRequestSchema, GatewayIncrementOrderItemQuantityResponseSchema, GatewayRequestSchema, GatewayResponseSchema, GatewayUpdateOrderRequestSchema, GatewayUpdateOrderResponseSchema, HeadLinkSchema, HeadScriptSchema, HeadStyleSchema, ImageFormatSchema, ImageSchema, ImageSizeSchema, LinkSchema, LinksSchema, LocaleSchema, LocaleValueSchema, MenuCategorySchema, MenuSchema, NextOpeningSchema, NutritionFactsSchema, OpeningStatusSchema, OptionsSchema, OrderDeliveryAddressSchema, OrderItemChangeSchema, OrderItemSchema, OrderSchema, OrderStatusSchema, OrderWarehouseAddressSchema, PaymentMethodSchema, PaymentMethodTypeSchema, ProductBadgeSchema, ProductCompositionSchema, ProductSchema, ProductVariantSchema, RecommendedProductSchema, ScheduleSchema, SelfPickupSchema, TimePeriodSchema, TimeSchema, TimeTypeSchema, TimeZoneSchema, VideoSchema, VideoTypeSchema, WarehouseAddressSchema, WarehouseSchema, WeekDaySchema, WeightUnitSchema };
|
|
754
|
+
export { AddressSuggestionSchema, BaseResponseSchema, ChannelSchema, CompositionIngredientSchema, CompositionProductSchema, CountryCodeSchema, CurrencyCodeSchema, DayScheduleSchema, DeliveryByCourierSchema, DeliveryMethodSchema, DeliveryZoneInfoSchema, GatewayActionTypeSchema, GatewayAddOrderItemRequestSchema, GatewayAddOrderItemResponseSchema, GatewayCheckDeliveryZoneRequestSchema, GatewayCheckDeliveryZoneResponseSchema, GatewayCompleteOrderRequestSchema, GatewayCompleteOrderResponseSchema, GatewayCreateOrderRequestSchema, GatewayCreateOrderResponseSchema, GatewayDecrementOrderItemQuantityRequestSchema, GatewayDecrementOrderItemQuantityResponseSchema, GatewayGetChannelsRequestSchema, GatewayGetChannelsResponseSchema, GatewayGetDeliveryByCourierStatusRequestSchema, GatewayGetDeliveryByCourierStatusResponseSchema, GatewayGetMenuRequestSchema, GatewayGetMenuResponseSchema, GatewayGetOptionsRequestSchema, GatewayGetOptionsResponseSchema, GatewayGetOrderRequestSchema, GatewayGetOrderResponseSchema, GatewayGetSelfPickupStatusRequestSchema, GatewayGetSelfPickupStatusResponseSchema, GatewayGetTimeSlotsRequestSchema, GatewayGetTimeSlotsResponseSchema, GatewayIncrementOrderItemQuantityRequestSchema, GatewayIncrementOrderItemQuantityResponseSchema, GatewayRequestSchema, GatewayResponseSchema, GatewaySuggestAddressesRequestSchema, GatewaySuggestAddressesResponseSchema, GatewayUpdateOrderRequestSchema, GatewayUpdateOrderResponseSchema, HeadLinkSchema, HeadScriptSchema, HeadStyleSchema, ImageFormatSchema, ImageSchema, ImageSizeSchema, LinkSchema, LinksSchema, LocaleSchema, LocaleValueSchema, MenuCategorySchema, MenuSchema, NextOpeningSchema, NutritionFactsSchema, OpeningStatusSchema, OptionsSchema, OrderDeliveryAddressSchema, OrderItemChangeSchema, OrderItemSchema, OrderSchema, OrderStatusSchema, OrderWarehouseAddressSchema, PaymentMethodSchema, PaymentMethodTypeSchema, ProductBadgeSchema, ProductCompositionSchema, ProductSchema, ProductVariantSchema, RecommendedProductSchema, ScheduleSchema, SelfPickupSchema, TimePeriodSchema, TimeSchema, TimeTypeSchema, TimeZoneSchema, VideoSchema, VideoTypeSchema, WarehouseAddressSchema, WarehouseSchema, WeekDaySchema, WeightUnitSchema };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextorders/food-schema",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -36,7 +36,6 @@
|
|
|
36
36
|
"build": "unbuild",
|
|
37
37
|
"clean": "rm -rf dist",
|
|
38
38
|
"clean:modules": "rm -rf node_modules",
|
|
39
|
-
"typecheck": "tsc --noEmit --erasableSyntaxOnly"
|
|
40
|
-
"postinstall": "pnpm build"
|
|
39
|
+
"typecheck": "tsc --noEmit --erasableSyntaxOnly"
|
|
41
40
|
}
|
|
42
41
|
}
|