@lyxa.ai/core 1.4.321 → 1.4.322-alpha.1

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.
Files changed (24) hide show
  1. package/dist/libraries/mongo/models/index.d.ts +3 -0
  2. package/dist/libraries/mongo/models/index.js +6 -3
  3. package/dist/libraries/mongo/models/index.js.map +1 -1
  4. package/dist/libraries/mongo/models/providers/global-coupon.model.d.ts +2 -0
  5. package/dist/libraries/mongo/models/providers/global-coupon.model.js +20 -0
  6. package/dist/libraries/mongo/models/providers/global-coupon.model.js.map +1 -1
  7. package/dist/libraries/mongo/models/user-coupon.model.d.ts +11 -0
  8. package/dist/libraries/mongo/models/user-coupon.model.js +52 -0
  9. package/dist/libraries/mongo/models/user-coupon.model.js.map +1 -0
  10. package/dist/libraries/mongo/models/user.model.d.ts +2 -1
  11. package/dist/libraries/mongo/models/user.model.js +6 -1
  12. package/dist/libraries/mongo/models/user.model.js.map +1 -1
  13. package/dist/libraries/socket/events/chatroom-message-send.socket.event.d.ts +8 -8
  14. package/dist/libraries/socket/events/order-actions.socket.event.d.ts +24 -24
  15. package/dist/libraries/socket/events/ticket-actions.socket.event.d.ts +4 -4
  16. package/dist/libraries/socket/events/ticket-assign.socket.event.d.ts +12 -12
  17. package/dist/libraries/trpc/middlewares/auth.d.ts +2 -2
  18. package/dist/libraries/trpc/middlewares/createRoleProtectedProcedure.d.ts +2 -2
  19. package/dist/libraries/trpc/middlewares/phone-verified.d.ts +2 -2
  20. package/dist/libraries/trpc/middlewares/publicUserDecoder.d.ts +2 -2
  21. package/dist/types/README.md +1 -1
  22. package/dist/types/package.json +1 -1
  23. package/dist/utilities/validation/common-validation.d.ts +118 -118
  24. package/package.json +1 -1
@@ -16,11 +16,11 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
16
16
  _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>]>;
17
17
  name: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
18
18
  }, "strip", z.ZodTypeAny, {
19
- _id: import("mongoose").Types.ObjectId;
20
19
  name: string;
20
+ _id: import("mongoose").Types.ObjectId;
21
21
  }, {
22
- _id: string | import("mongoose").Types.ObjectId;
23
22
  name: string;
23
+ _id: string | import("mongoose").Types.ObjectId;
24
24
  }>;
25
25
  orderStatus: z.ZodNativeEnum<typeof RegularOrderStatus>;
26
26
  orderAction: z.ZodNativeEnum<typeof OrderAction>;
@@ -40,19 +40,19 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
40
40
  secondaryRiderTips: z.ZodNumber;
41
41
  }, "strip", z.ZodTypeAny, {
42
42
  deliveryFee: number;
43
- total: number;
44
43
  secondaryDeliveryFee: number;
45
44
  riderTips: number;
46
45
  secondaryRiderTips: number;
46
+ total: number;
47
47
  secondaryTotal: number;
48
48
  paidAmount: number;
49
49
  secondaryPaidAmount: number;
50
50
  }, {
51
51
  deliveryFee: number;
52
- total: number;
53
52
  secondaryDeliveryFee: number;
54
53
  riderTips: number;
55
54
  secondaryRiderTips: number;
55
+ total: number;
56
56
  secondaryTotal: number;
57
57
  paidAmount: number;
58
58
  secondaryPaidAmount: number;
@@ -61,10 +61,10 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
61
61
  paymentMethod: PaymentMethod;
62
62
  pricing: {
63
63
  deliveryFee: number;
64
- total: number;
65
64
  secondaryDeliveryFee: number;
66
65
  riderTips: number;
67
66
  secondaryRiderTips: number;
67
+ total: number;
68
68
  secondaryTotal: number;
69
69
  paidAmount: number;
70
70
  secondaryPaidAmount: number;
@@ -74,10 +74,10 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
74
74
  paymentMethod: PaymentMethod;
75
75
  pricing: {
76
76
  deliveryFee: number;
77
- total: number;
78
77
  secondaryDeliveryFee: number;
79
78
  riderTips: number;
80
79
  secondaryRiderTips: number;
80
+ total: number;
81
81
  secondaryTotal: number;
82
82
  paidAmount: number;
83
83
  secondaryPaidAmount: number;
@@ -91,20 +91,20 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
91
91
  createdAt: Date;
92
92
  _id: import("mongoose").Types.ObjectId;
93
93
  user: {
94
- _id: import("mongoose").Types.ObjectId;
95
94
  name: string;
95
+ _id: import("mongoose").Types.ObjectId;
96
96
  };
97
- orderId: string;
98
97
  shopId: import("mongoose").Types.ObjectId;
98
+ orderId: string;
99
99
  triggerAt: Date;
100
100
  adjustedFinance: {
101
101
  paymentMethod: PaymentMethod;
102
102
  pricing: {
103
103
  deliveryFee: number;
104
- total: number;
105
104
  secondaryDeliveryFee: number;
106
105
  riderTips: number;
107
106
  secondaryRiderTips: number;
107
+ total: number;
108
108
  secondaryTotal: number;
109
109
  paidAmount: number;
110
110
  secondaryPaidAmount: number;
@@ -120,20 +120,20 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
120
120
  createdAt: Date;
121
121
  _id: string | import("mongoose").Types.ObjectId;
122
122
  user: {
123
- _id: string | import("mongoose").Types.ObjectId;
124
123
  name: string;
124
+ _id: string | import("mongoose").Types.ObjectId;
125
125
  };
126
- orderId: string;
127
126
  shopId: string | import("mongoose").Types.ObjectId;
127
+ orderId: string;
128
128
  triggerAt: Date;
129
129
  adjustedFinance: {
130
130
  paymentMethod: PaymentMethod;
131
131
  pricing: {
132
132
  deliveryFee: number;
133
- total: number;
134
133
  secondaryDeliveryFee: number;
135
134
  riderTips: number;
136
135
  secondaryRiderTips: number;
136
+ total: number;
137
137
  secondaryTotal: number;
138
138
  paidAmount: number;
139
139
  secondaryPaidAmount: number;
@@ -160,11 +160,11 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
160
160
  _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>]>;
161
161
  name: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
162
162
  }, "strip", z.ZodTypeAny, {
163
- _id: import("mongoose").Types.ObjectId;
164
163
  name: string;
164
+ _id: import("mongoose").Types.ObjectId;
165
165
  }, {
166
- _id: string | import("mongoose").Types.ObjectId;
167
166
  name: string;
167
+ _id: string | import("mongoose").Types.ObjectId;
168
168
  }>;
169
169
  orderStatus: z.ZodNativeEnum<typeof RegularOrderStatus>;
170
170
  orderAction: z.ZodNativeEnum<typeof OrderAction>;
@@ -184,19 +184,19 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
184
184
  secondaryRiderTips: z.ZodNumber;
185
185
  }, "strip", z.ZodTypeAny, {
186
186
  deliveryFee: number;
187
- total: number;
188
187
  secondaryDeliveryFee: number;
189
188
  riderTips: number;
190
189
  secondaryRiderTips: number;
190
+ total: number;
191
191
  secondaryTotal: number;
192
192
  paidAmount: number;
193
193
  secondaryPaidAmount: number;
194
194
  }, {
195
195
  deliveryFee: number;
196
- total: number;
197
196
  secondaryDeliveryFee: number;
198
197
  riderTips: number;
199
198
  secondaryRiderTips: number;
199
+ total: number;
200
200
  secondaryTotal: number;
201
201
  paidAmount: number;
202
202
  secondaryPaidAmount: number;
@@ -205,10 +205,10 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
205
205
  paymentMethod: PaymentMethod;
206
206
  pricing: {
207
207
  deliveryFee: number;
208
- total: number;
209
208
  secondaryDeliveryFee: number;
210
209
  riderTips: number;
211
210
  secondaryRiderTips: number;
211
+ total: number;
212
212
  secondaryTotal: number;
213
213
  paidAmount: number;
214
214
  secondaryPaidAmount: number;
@@ -218,10 +218,10 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
218
218
  paymentMethod: PaymentMethod;
219
219
  pricing: {
220
220
  deliveryFee: number;
221
- total: number;
222
221
  secondaryDeliveryFee: number;
223
222
  riderTips: number;
224
223
  secondaryRiderTips: number;
224
+ total: number;
225
225
  secondaryTotal: number;
226
226
  paidAmount: number;
227
227
  secondaryPaidAmount: number;
@@ -235,20 +235,20 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
235
235
  createdAt: Date;
236
236
  _id: import("mongoose").Types.ObjectId;
237
237
  user: {
238
- _id: import("mongoose").Types.ObjectId;
239
238
  name: string;
239
+ _id: import("mongoose").Types.ObjectId;
240
240
  };
241
- orderId: string;
242
241
  shopId: import("mongoose").Types.ObjectId;
242
+ orderId: string;
243
243
  triggerAt: Date;
244
244
  adjustedFinance: {
245
245
  paymentMethod: PaymentMethod;
246
246
  pricing: {
247
247
  deliveryFee: number;
248
- total: number;
249
248
  secondaryDeliveryFee: number;
250
249
  riderTips: number;
251
250
  secondaryRiderTips: number;
251
+ total: number;
252
252
  secondaryTotal: number;
253
253
  paidAmount: number;
254
254
  secondaryPaidAmount: number;
@@ -264,20 +264,20 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
264
264
  createdAt: Date;
265
265
  _id: string | import("mongoose").Types.ObjectId;
266
266
  user: {
267
- _id: string | import("mongoose").Types.ObjectId;
268
267
  name: string;
268
+ _id: string | import("mongoose").Types.ObjectId;
269
269
  };
270
- orderId: string;
271
270
  shopId: string | import("mongoose").Types.ObjectId;
271
+ orderId: string;
272
272
  triggerAt: Date;
273
273
  adjustedFinance: {
274
274
  paymentMethod: PaymentMethod;
275
275
  pricing: {
276
276
  deliveryFee: number;
277
- total: number;
278
277
  secondaryDeliveryFee: number;
279
278
  riderTips: number;
280
279
  secondaryRiderTips: number;
280
+ total: number;
281
281
  secondaryTotal: number;
282
282
  paidAmount: number;
283
283
  secondaryPaidAmount: number;
@@ -12,15 +12,15 @@ export declare const TicketActionsSocketOutputSchema: z.ZodObject<{
12
12
  title: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
13
13
  silent: z.ZodOptional<z.ZodBoolean>;
14
14
  }, "strip", z.ZodTypeAny, {
15
- _id: import("mongoose").Types.ObjectId;
16
15
  status: TicketStatus;
16
+ _id: import("mongoose").Types.ObjectId;
17
17
  type: TicketType;
18
18
  title?: string | undefined;
19
19
  content?: string | undefined;
20
20
  silent?: boolean | undefined;
21
21
  }, {
22
- _id: import("mongoose").Types.ObjectId;
23
22
  status: TicketStatus;
23
+ _id: import("mongoose").Types.ObjectId;
24
24
  type: TicketType;
25
25
  title?: string | undefined;
26
26
  content?: string | undefined;
@@ -59,15 +59,15 @@ export declare class TicketActionsSocketEvent extends BaseSocketEvent<typeof Tic
59
59
  title: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
60
60
  silent: z.ZodOptional<z.ZodBoolean>;
61
61
  }, "strip", z.ZodTypeAny, {
62
- _id: import("mongoose").Types.ObjectId;
63
62
  status: TicketStatus;
63
+ _id: import("mongoose").Types.ObjectId;
64
64
  type: TicketType;
65
65
  title?: string | undefined;
66
66
  content?: string | undefined;
67
67
  silent?: boolean | undefined;
68
68
  }, {
69
- _id: import("mongoose").Types.ObjectId;
70
69
  status: TicketStatus;
70
+ _id: import("mongoose").Types.ObjectId;
71
71
  type: TicketType;
72
72
  title?: string | undefined;
73
73
  content?: string | undefined;
@@ -13,13 +13,13 @@ export declare const TicketAssignSocketOutputSchema: z.ZodObject<{
13
13
  name: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
14
14
  profilePhoto: z.ZodNullable<z.ZodString> | z.ZodNullable<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
15
15
  }, "strip", z.ZodTypeAny, {
16
- _id: import("mongoose").Types.ObjectId;
17
16
  name: string;
17
+ _id: import("mongoose").Types.ObjectId;
18
18
  type: UserRef;
19
19
  profilePhoto: string | null;
20
20
  }, {
21
- _id: string | import("mongoose").Types.ObjectId;
22
21
  name: string;
22
+ _id: string | import("mongoose").Types.ObjectId;
23
23
  type: UserRef;
24
24
  profilePhoto: string | null;
25
25
  }>;
@@ -39,18 +39,18 @@ export declare const TicketAssignSocketOutputSchema: z.ZodObject<{
39
39
  }>;
40
40
  unreadCount: z.ZodNumber;
41
41
  }, "strip", z.ZodTypeAny, {
42
+ status: TicketStatus;
42
43
  createdAt: Date;
43
44
  updatedAt: Date;
44
45
  _id: import("mongoose").Types.ObjectId;
45
- status: TicketStatus;
46
46
  type: TicketType;
47
47
  lastMessage: {
48
48
  createdAt: Date;
49
49
  content: string;
50
50
  };
51
51
  client: {
52
- _id: import("mongoose").Types.ObjectId;
53
52
  name: string;
53
+ _id: import("mongoose").Types.ObjectId;
54
54
  type: UserRef;
55
55
  profilePhoto: string | null;
56
56
  };
@@ -58,18 +58,18 @@ export declare const TicketAssignSocketOutputSchema: z.ZodObject<{
58
58
  chatroomId: import("mongoose").Types.ObjectId;
59
59
  orderId?: import("mongoose").Types.ObjectId | undefined;
60
60
  }, {
61
+ status: TicketStatus;
61
62
  createdAt: string | Date;
62
63
  updatedAt: string | Date;
63
64
  _id: string | import("mongoose").Types.ObjectId;
64
- status: TicketStatus;
65
65
  type: TicketType;
66
66
  lastMessage: {
67
67
  createdAt: string | Date;
68
68
  content: string;
69
69
  };
70
70
  client: {
71
- _id: string | import("mongoose").Types.ObjectId;
72
71
  name: string;
72
+ _id: string | import("mongoose").Types.ObjectId;
73
73
  type: UserRef;
74
74
  profilePhoto: string | null;
75
75
  };
@@ -91,13 +91,13 @@ export declare class TicketAssignEvent extends BaseSocketEvent<typeof TicketAssi
91
91
  name: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
92
92
  profilePhoto: z.ZodNullable<z.ZodString> | z.ZodNullable<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
93
93
  }, "strip", z.ZodTypeAny, {
94
- _id: import("mongoose").Types.ObjectId;
95
94
  name: string;
95
+ _id: import("mongoose").Types.ObjectId;
96
96
  type: UserRef;
97
97
  profilePhoto: string | null;
98
98
  }, {
99
- _id: string | import("mongoose").Types.ObjectId;
100
99
  name: string;
100
+ _id: string | import("mongoose").Types.ObjectId;
101
101
  type: UserRef;
102
102
  profilePhoto: string | null;
103
103
  }>;
@@ -117,18 +117,18 @@ export declare class TicketAssignEvent extends BaseSocketEvent<typeof TicketAssi
117
117
  }>;
118
118
  unreadCount: z.ZodNumber;
119
119
  }, "strip", z.ZodTypeAny, {
120
+ status: TicketStatus;
120
121
  createdAt: Date;
121
122
  updatedAt: Date;
122
123
  _id: import("mongoose").Types.ObjectId;
123
- status: TicketStatus;
124
124
  type: TicketType;
125
125
  lastMessage: {
126
126
  createdAt: Date;
127
127
  content: string;
128
128
  };
129
129
  client: {
130
- _id: import("mongoose").Types.ObjectId;
131
130
  name: string;
131
+ _id: import("mongoose").Types.ObjectId;
132
132
  type: UserRef;
133
133
  profilePhoto: string | null;
134
134
  };
@@ -136,18 +136,18 @@ export declare class TicketAssignEvent extends BaseSocketEvent<typeof TicketAssi
136
136
  chatroomId: import("mongoose").Types.ObjectId;
137
137
  orderId?: import("mongoose").Types.ObjectId | undefined;
138
138
  }, {
139
+ status: TicketStatus;
139
140
  createdAt: string | Date;
140
141
  updatedAt: string | Date;
141
142
  _id: string | import("mongoose").Types.ObjectId;
142
- status: TicketStatus;
143
143
  type: TicketType;
144
144
  lastMessage: {
145
145
  createdAt: string | Date;
146
146
  content: string;
147
147
  };
148
148
  client: {
149
- _id: string | import("mongoose").Types.ObjectId;
150
149
  name: string;
150
+ _id: string | import("mongoose").Types.ObjectId;
151
151
  type: UserRef;
152
152
  profilePhoto: string | null;
153
153
  };
@@ -5,12 +5,12 @@ interface AuthOptions {
5
5
  autoRefresh?: boolean;
6
6
  }
7
7
  export declare function createAuthenticatedProcedure(options: AuthOptions): import("@trpc/server").TRPCProcedureBuilder<import("../context").LyxaHTTPContext, object, {
8
- entity: import("../context").EntityContext | undefined;
9
8
  requestId: string | undefined;
9
+ entity: import("../context").EntityContext | undefined;
10
10
  req: import("http").IncomingMessage;
11
11
  res: import("http").ServerResponse<import("http").IncomingMessage>;
12
+ tokenType: TokenType | undefined;
12
13
  usedRefreshToken: boolean | undefined;
13
14
  tokenRenewed: boolean | undefined;
14
- tokenType: TokenType | undefined;
15
15
  }, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, false>;
16
16
  export {};
@@ -4,12 +4,12 @@ interface RoleProtectedOptions {
4
4
  allowedRoles: string[];
5
5
  }
6
6
  export declare function createRoleProtectedProcedure(options: RoleProtectedOptions): import("@trpc/server").TRPCProcedureBuilder<import("../context").LyxaHTTPContext, object, {
7
- entity: import("../context").EntityContext | undefined;
8
7
  requestId: string | undefined;
8
+ entity: import("../context").EntityContext | undefined;
9
9
  req: import("http").IncomingMessage;
10
10
  res: import("http").ServerResponse<import("http").IncomingMessage>;
11
+ tokenType: import("../../auth").TokenType | undefined;
11
12
  usedRefreshToken: boolean | undefined;
12
13
  tokenRenewed: boolean | undefined;
13
- tokenType: import("../../auth").TokenType | undefined;
14
14
  }, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, false>;
15
15
  export {};
@@ -3,12 +3,12 @@ interface PhoneVerifiedOptions {
3
3
  entityTypes: AuthEntityType[];
4
4
  }
5
5
  export declare function createPhoneVerifiedProcedure(options: PhoneVerifiedOptions): import("@trpc/server").TRPCProcedureBuilder<import("../context").LyxaHTTPContext, object, {
6
- entity: import("../context").EntityContext | undefined;
7
6
  requestId: string | undefined;
7
+ entity: import("../context").EntityContext | undefined;
8
8
  req: import("http").IncomingMessage;
9
9
  res: import("http").ServerResponse<import("http").IncomingMessage>;
10
+ tokenType: import("../../auth").TokenType | undefined;
10
11
  usedRefreshToken: boolean | undefined;
11
12
  tokenRenewed: boolean | undefined;
12
- tokenType: import("../../auth").TokenType | undefined;
13
13
  }, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, false>;
14
14
  export {};
@@ -5,12 +5,12 @@ interface AuthOptions {
5
5
  autoRefresh?: boolean;
6
6
  }
7
7
  export declare function publicUserDecoder(options: AuthOptions): import("@trpc/server").TRPCProcedureBuilder<import("../context").LyxaHTTPContext, object, {
8
- entity: import("../context").EntityContext | undefined;
9
8
  requestId: string | undefined;
9
+ entity: import("../context").EntityContext | undefined;
10
10
  req: import("http").IncomingMessage;
11
11
  res: import("http").ServerResponse<import("http").IncomingMessage>;
12
+ tokenType: TokenType | undefined;
12
13
  usedRefreshToken: boolean | undefined;
13
14
  tokenRenewed: boolean | undefined;
14
- tokenType: TokenType | undefined;
15
15
  }, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, false>;
16
16
  export {};
@@ -22,7 +22,7 @@ Perfect for sharing types between frontend and backend applications.
22
22
 
23
23
  ## Version
24
24
 
25
- Version: 1.4.321
25
+ Version: 1.4.322-alpha.1
26
26
 
27
27
  ## Dependencies
28
28
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/types",
3
- "version": "1.4.321",
3
+ "version": "1.4.322-alpha.1",
4
4
  "description": "Lyxa type definitions and validation schemas for both frontend and backend",
5
5
  "author": "elie <42282499+Internalizable@users.noreply.github.com>",
6
6
  "license": "MIT",