@lyxa.ai/core 1.3.267 → 1.3.268
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/libraries/socket/events/order-actions.socket.event.d.ts +2 -1
- package/dist/libraries/socket/events/order-actions.socket.event.js +1 -0
- package/dist/libraries/socket/events/order-actions.socket.event.js.map +1 -1
- package/dist/types/README.md +1 -1
- package/dist/types/package.json +1 -1
- package/dist/types/utilities/validation/common-validation.d.ts +12 -12
- package/package.json +1 -1
|
@@ -5,7 +5,8 @@ import { BaseSocketEvent } from '../BaseSocketEvent';
|
|
|
5
5
|
export declare enum OrderAction {
|
|
6
6
|
PLACED = "placed",
|
|
7
7
|
ADJUSTMENT = "adjustment",
|
|
8
|
-
REPLACEMENT = "replacement"
|
|
8
|
+
REPLACEMENT = "replacement",
|
|
9
|
+
CANCELLED = "cancelled"
|
|
9
10
|
}
|
|
10
11
|
export declare const OrderActionsOutputSchema: z.ZodObject<{
|
|
11
12
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>;
|
|
@@ -11,6 +11,7 @@ var OrderAction;
|
|
|
11
11
|
OrderAction["PLACED"] = "placed";
|
|
12
12
|
OrderAction["ADJUSTMENT"] = "adjustment";
|
|
13
13
|
OrderAction["REPLACEMENT"] = "replacement";
|
|
14
|
+
OrderAction["CANCELLED"] = "cancelled";
|
|
14
15
|
})(OrderAction || (exports.OrderAction = OrderAction = {}));
|
|
15
16
|
const OrderUserSchema = zod_1.z.object({
|
|
16
17
|
_id: validation_1.ZodValidation.objectId('User ID'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order-actions.socket.event.js","sourceRoot":"/","sources":["libraries/socket/events/order-actions.socket.event.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,+DAAoE;AACpE,kDAA6F;AAC7F,wDAAqD;AACrD,uEAAoE;AAGpE,IAAY,
|
|
1
|
+
{"version":3,"file":"order-actions.socket.event.js","sourceRoot":"/","sources":["libraries/socket/events/order-actions.socket.event.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,+DAAoE;AACpE,kDAA6F;AAC7F,wDAAqD;AACrD,uEAAoE;AAGpE,IAAY,WAKX;AALD,WAAY,WAAW;IACtB,gCAAiB,CAAA;IACjB,wCAAyB,CAAA;IACzB,0CAA2B,CAAA;IAC3B,sCAAuB,CAAA;AACxB,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB;AAED,MAAM,eAAe,GAAG,OAAC,CAAC,MAAM,CAAC;IAChC,GAAG,EAAE,0BAAa,CAAC,QAAQ,CAAC,SAAS,CAAC;IACtC,IAAI,EAAE,0BAAa,CAAC,MAAM,CAAC,WAAW,CAAC;CACvC,CAAC,CAAC;AAEU,QAAA,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IAChD,GAAG,EAAE,0BAAa,CAAC,QAAQ,CAAC,UAAU,CAAC;IACvC,MAAM,EAAE,0BAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC;IACxC,OAAO,EAAE,0BAAa,CAAC,MAAM,CAAC,mBAAmB,CAAC;IAClD,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,0BAAa,CAAC,QAAQ,CAAC,yBAAkB,EAAE,QAAQ,CAAC;IACjE,WAAW,EAAE,0BAAa,CAAC,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC;IAC/D,aAAa,EAAE,0BAAa,CAAC,QAAQ,CAAC,oBAAa,EAAE,eAAe,CAAC;IACrE,sBAAsB,EAAE,0BAAa,CAAC,MAAM,CAAC,4BAA4B,EAAE;QAC1E,aAAa,EAAE,IAAI;KACnB,CAAC;IACF,eAAe,EAAE,OAAC,CAAC,MAAM,CAAC;QACzB,aAAa,EAAE,0BAAa,CAAC,QAAQ,CAAC,oBAAa,EAAE,eAAe,CAAC;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O,yBAAyB,CAAC;YAClC;gBACC,OAAO,cAAc,CAAC;QACxB,CAAC;IACF,CAAC;IAED,YAAY,OAAmC;QAC9C,MAAM,OAAO,GAAG,uBAAuB,CAAC,mBAAmB,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QACjF,MAAM,uBAAuB,GAAG,IAAI,iDAAuB,CAAC;YAC3D,OAAO;YACP,gBAAgB,EAAE,sBAAe,CAAC,aAAa;YAC/C,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,eAAe,EAAE,OAAO,CAAC,WAAW;SACpC,CAAC,CAAC;QAEH,KAAK,CACJ,sBAAe,CAAC,aAAa,EAC7B,uBAAuB,CAAC,OAAO,EAC/B,OAAO,EACP,SAAS,EACT,uBAAuB,CACvB,CAAC;IACH,CAAC;IAES,aAAa;QACtB,OAAO,SAAS,CAAC;IAClB,CAAC;;AA3CF,0DA4CC","sourcesContent":["import { z } from 'zod';\nimport { DTO, ZodValidation } from '../../../utilities/validation/';\nimport { PaymentMethod, RegularOrderStatus, SocketEventType } from '../../../utilities/enum';\nimport { BaseSocketEvent } from '../BaseSocketEvent';\nimport { SocketNotificationEvent } from './socketNotificationEvent';\nimport { EventFactory } from '../core';\n\nexport enum OrderAction {\n\tPLACED = 'placed',\n\tADJUSTMENT = 'adjustment',\n\tREPLACEMENT = 'replacement',\n\tCANCELLED = 'cancelled',\n}\n\nconst OrderUserSchema = z.object({\n\t_id: ZodValidation.objectId('User ID'),\n\tname: ZodValidation.string('User Name'),\n});\n\nexport const OrderActionsOutputSchema = z.object({\n\t_id: ZodValidation.objectId('Order ID'),\n\tshopId: ZodValidation.objectId('shopId'),\n\torderId: ZodValidation.string('Readable Order ID'),\n\tuser: OrderUserSchema,\n\torderStatus: ZodValidation.enumType(RegularOrderStatus, 'status'),\n\torderAction: ZodValidation.enumType(OrderAction, 'orderAction'),\n\tpaymentMethod: ZodValidation.enumType(PaymentMethod, 'paymentMethod'),\n\tpreparationTimeMinutes: ZodValidation.number('Preparation Time (minutes)', {\n\t\tisNonnegative: true,\n\t}),\n\tadjustedFinance: z.object({\n\t\tpaymentMethod: ZodValidation.enumType(PaymentMethod, 'paymentMethod'),\n\t\tshopProfit: ZodValidation.number('shopProfit'),\n\t\tpricing: z.object({\n\t\t\ttotal: ZodValidation.number('total'),\n\t\t\tsecondaryTotal: ZodValidation.number('secondaryTotal'),\n\t\t\tpaidAmount: ZodValidation.number('paidAmount'),\n\t\t\tsecondaryPaidAmount: ZodValidation.number('secondaryPaidAmount'),\n\t\t\tdeliveryFee: ZodValidation.number('deliveryFee'),\n\t\t\tsecondaryDeliveryFee: ZodValidation.number('secondaryDeliveryFee'),\n\t\t\triderTips: ZodValidation.number('riderTip'),\n\t\t\tsecondaryRiderTips: ZodValidation.number('secondaryRiderTips'),\n\t\t}),\n\t}),\n\tcreatedAt: ZodValidation.coerce.date('Order Creation Date'),\n\ttriggerAt: ZodValidation.coerce.date('Order Trigger Date'),\n\torderActionType: ZodValidation.enumType(OrderAction, 'order action type'),\n});\n\nexport const OrderActionsInputSchema = z.undefined();\n\nexport type OrderActionSocketInputDTO = DTO<typeof OrderActionsInputSchema>;\nexport type OrderActionSocketOutputDTO = DTO<typeof OrderActionsOutputSchema>;\n\nexport class OrderActionsSocketEvent extends BaseSocketEvent<\n\ttypeof OrderActionsInputSchema,\n\ttypeof OrderActionsOutputSchema\n> {\n\tstatic readonly schemas = {\n\t\tinput: OrderActionsInputSchema,\n\t\toutput: OrderActionsOutputSchema,\n\t};\n\n\t// Map each OrderAction to its message\n\tprivate static getMessageForAction(orderAction: OrderAction): string {\n\t\tswitch (orderAction) {\n\t\t\tcase OrderAction.PLACED:\n\t\t\t\treturn 'New Order!';\n\t\t\tcase OrderAction.ADJUSTMENT:\n\t\t\t\treturn 'Order has been adjusted';\n\t\t\tcase OrderAction.REPLACEMENT:\n\t\t\t\treturn 'Order has been replaced';\n\t\t\tdefault:\n\t\t\t\treturn 'Order update';\n\t\t}\n\t}\n\n\tconstructor(payload: OrderActionSocketOutputDTO) {\n\t\tconst message = OrderActionsSocketEvent.getMessageForAction(payload.orderAction);\n\t\tconst socketNotificationEvent = new SocketNotificationEvent({\n\t\t\tmessage,\n\t\t\tnotificationType: SocketEventType.ORDER_ACTIONS,\n\t\t\t_id: payload._id,\n\t\t\torderActionType: payload.orderAction,\n\t\t});\n\n\t\tsuper(\n\t\t\tSocketEventType.ORDER_ACTIONS,\n\t\t\tOrderActionsSocketEvent.schemas,\n\t\t\tpayload,\n\t\t\tundefined,\n\t\t\tsocketNotificationEvent\n\t\t);\n\t}\n\n\tprotected getIdentifier(): string {\n\t\treturn 'default';\n\t}\n}\n"]}
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED
|
@@ -26,8 +26,8 @@ export declare const FilterSchema: z.ZodOptional<z.ZodObject<{
|
|
|
26
26
|
searchFields?: string[] | undefined;
|
|
27
27
|
} | undefined;
|
|
28
28
|
sort?: Record<string, 1 | -1> | undefined;
|
|
29
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
30
29
|
populate?: any;
|
|
30
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
31
31
|
query?: Record<string, any> | undefined;
|
|
32
32
|
}, {
|
|
33
33
|
search?: {
|
|
@@ -36,8 +36,8 @@ export declare const FilterSchema: z.ZodOptional<z.ZodObject<{
|
|
|
36
36
|
} | undefined;
|
|
37
37
|
sort?: Record<string, 1 | -1> | undefined;
|
|
38
38
|
size?: number | undefined;
|
|
39
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
40
39
|
populate?: any;
|
|
40
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
41
41
|
query?: Record<string, any> | undefined;
|
|
42
42
|
page?: number | undefined;
|
|
43
43
|
}>>;
|
|
@@ -733,12 +733,12 @@ export declare const GetByIdInputSchema: z.ZodObject<{
|
|
|
733
733
|
populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
|
|
734
734
|
}, "strip", z.ZodTypeAny, {
|
|
735
735
|
_id: import("mongoose").Types.ObjectId;
|
|
736
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
737
736
|
populate?: any;
|
|
737
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
738
738
|
}, {
|
|
739
739
|
_id: string | import("mongoose").Types.ObjectId;
|
|
740
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
741
740
|
populate?: any;
|
|
741
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
742
742
|
}>;
|
|
743
743
|
export type GetByIdInputDTO = DTO<typeof GetByIdInputSchema>;
|
|
744
744
|
export declare const GetProductByIdInputSchema: z.ZodObject<{
|
|
@@ -751,12 +751,12 @@ export declare const GetProductByIdInputSchema: z.ZodObject<{
|
|
|
751
751
|
_id: import("mongoose").Types.ObjectId;
|
|
752
752
|
withAttributeHiddenItems: boolean;
|
|
753
753
|
withAddonsHiddenItems: boolean;
|
|
754
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
755
754
|
populate?: any;
|
|
755
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
756
756
|
}, {
|
|
757
757
|
_id: string | import("mongoose").Types.ObjectId;
|
|
758
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
759
758
|
populate?: any;
|
|
759
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
760
760
|
withAttributeHiddenItems?: boolean | undefined;
|
|
761
761
|
withAddonsHiddenItems?: boolean | undefined;
|
|
762
762
|
}>;
|
|
@@ -768,13 +768,13 @@ export declare const GetOrderByIdInputSchema: z.ZodObject<{
|
|
|
768
768
|
userOrderCompletionScope: z.ZodOptional<z.ZodNativeEnum<typeof UserOrderCompletionScope>>;
|
|
769
769
|
}, "strip", z.ZodTypeAny, {
|
|
770
770
|
_id: import("mongoose").Types.ObjectId;
|
|
771
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
772
771
|
populate?: any;
|
|
772
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
773
773
|
userOrderCompletionScope?: UserOrderCompletionScope | undefined;
|
|
774
774
|
}, {
|
|
775
775
|
_id: string | import("mongoose").Types.ObjectId;
|
|
776
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
777
776
|
populate?: any;
|
|
777
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
778
778
|
userOrderCompletionScope?: UserOrderCompletionScope | undefined;
|
|
779
779
|
}>;
|
|
780
780
|
export type GetOrderByIdInputDTO = DTO<typeof GetOrderByIdInputSchema>;
|
|
@@ -782,11 +782,11 @@ export declare const GetByTokenInputSchema: z.ZodOptional<z.ZodObject<{
|
|
|
782
782
|
select: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>>>;
|
|
783
783
|
populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
|
|
784
784
|
}, "strip", z.ZodTypeAny, {
|
|
785
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
786
785
|
populate?: any;
|
|
787
|
-
}, {
|
|
788
786
|
select?: Record<string, 0 | 1> | undefined;
|
|
787
|
+
}, {
|
|
789
788
|
populate?: any;
|
|
789
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
790
790
|
}>>;
|
|
791
791
|
export type GetByTokenInputDTO = DTO<typeof GetByTokenInputSchema>;
|
|
792
792
|
export declare const GetOneQuerySchema: z.ZodObject<{
|
|
@@ -794,12 +794,12 @@ export declare const GetOneQuerySchema: z.ZodObject<{
|
|
|
794
794
|
select: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>>>;
|
|
795
795
|
populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
|
|
796
796
|
}, "strip", z.ZodTypeAny, {
|
|
797
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
798
797
|
populate?: any;
|
|
798
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
799
799
|
query?: Record<string, any> | undefined;
|
|
800
800
|
}, {
|
|
801
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
802
801
|
populate?: any;
|
|
802
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
803
803
|
query?: Record<string, any> | undefined;
|
|
804
804
|
}>;
|
|
805
805
|
export type GetOneQueryDTO = DTO<typeof GetOneQuerySchema>;
|