@lyxa.ai/core 1.4.11 → 1.4.13
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/mongo/models/service-booking.model.d.ts +3 -2
- package/dist/libraries/mongo/models/service-booking.model.js +9 -4
- package/dist/libraries/mongo/models/service-booking.model.js.map +1 -1
- package/dist/libraries/mongo/models/vendor-access-control.model.d.ts +6 -5
- package/dist/libraries/mongo/models/vendor-access-control.model.js +5 -0
- package/dist/libraries/mongo/models/vendor-access-control.model.js.map +1 -1
- package/dist/libraries/trpc/middlewares/auth.d.ts +1 -1
- package/dist/libraries/trpc/middlewares/createRoleProtectedProcedure.d.ts +1 -1
- package/dist/libraries/trpc/middlewares/phone-verified.d.ts +1 -1
- package/dist/libraries/trpc/middlewares/publicUserDecoder.d.ts +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
|
@@ -29,9 +29,10 @@ export declare class ServiceBooking extends TimeStamps {
|
|
|
29
29
|
processedAt?: Date;
|
|
30
30
|
placedAt?: Date;
|
|
31
31
|
startedAt?: Date;
|
|
32
|
-
|
|
32
|
+
estimatedCompletionAt?: Date;
|
|
33
|
+
estimatedCompletionInMinutes?: number;
|
|
33
34
|
completedAt?: Date;
|
|
34
|
-
|
|
35
|
+
actualCompletionInMinutes?: number;
|
|
35
36
|
isUrgentOrder?: boolean;
|
|
36
37
|
urgentAt?: Date;
|
|
37
38
|
isOverdue?: boolean;
|
|
@@ -42,9 +42,10 @@ let ServiceBooking = class ServiceBooking extends defaultClasses_1.TimeStamps {
|
|
|
42
42
|
processedAt;
|
|
43
43
|
placedAt;
|
|
44
44
|
startedAt;
|
|
45
|
-
|
|
45
|
+
estimatedCompletionAt;
|
|
46
|
+
estimatedCompletionInMinutes;
|
|
46
47
|
completedAt;
|
|
47
|
-
|
|
48
|
+
actualCompletionInMinutes;
|
|
48
49
|
isUrgentOrder;
|
|
49
50
|
urgentAt;
|
|
50
51
|
isOverdue;
|
|
@@ -128,7 +129,11 @@ __decorate([
|
|
|
128
129
|
__decorate([
|
|
129
130
|
(0, typegoose_1.prop)({ type: Date }),
|
|
130
131
|
__metadata("design:type", Date)
|
|
131
|
-
], ServiceBooking.prototype, "
|
|
132
|
+
], ServiceBooking.prototype, "estimatedCompletionAt", void 0);
|
|
133
|
+
__decorate([
|
|
134
|
+
(0, typegoose_1.prop)({ type: Number }),
|
|
135
|
+
__metadata("design:type", Number)
|
|
136
|
+
], ServiceBooking.prototype, "estimatedCompletionInMinutes", void 0);
|
|
132
137
|
__decorate([
|
|
133
138
|
(0, typegoose_1.prop)({ type: Date }),
|
|
134
139
|
__metadata("design:type", Date)
|
|
@@ -136,7 +141,7 @@ __decorate([
|
|
|
136
141
|
__decorate([
|
|
137
142
|
(0, typegoose_1.prop)({ type: Number }),
|
|
138
143
|
__metadata("design:type", Number)
|
|
139
|
-
], ServiceBooking.prototype, "
|
|
144
|
+
], ServiceBooking.prototype, "actualCompletionInMinutes", void 0);
|
|
140
145
|
__decorate([
|
|
141
146
|
(0, typegoose_1.prop)({ type: Boolean, default: false }),
|
|
142
147
|
__metadata("design:type", Boolean)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-booking.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-booking.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAoE;AACpE,6CAAoC;AACpC,iDAAwC;AACxC,kDAAyG;AACzG,6DAAoD;AACpD,sFAA2E;AAC3E,6DAAmD;AACnD,4FAAiF;AACjF,sHAG+D;AAC/D,4EAAgF;AAChF,kEAA6D;AAC7D,wBAAuD;AACvD,0DAA6D;AAC7D,4DAAyD;AACzD,4EAAqE;AAQ9D,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,2BAAU;IAEtC,OAAO,CAAU;IAGjB,IAAI,CAAa;IAGjB,MAAM,CAAe;IAGr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AO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;gEACE;AAOnC;IALN,IAAA,gBAAI,EAAC;QACL,GAAG,EAAE,GAAG,EAAE,CAAC,SAAM;QACjB,YAAY,EAAE,gBAAgB;QAC9B,UAAU,EAAE,KAAK;KACjB,CAAC;;+CAC6B;yBA1GnB,cAAc;IAN1B,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,iBAAiB,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;IACpF,IAAA,eAAG,EAAiB,MAAM,EAAE,KAAK;QACjC,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,IAAI,CAAC,OAAO,GAAG,MAAM,IAAA,yBAAU,EAAC,eAAY,EAAE,kBAAW,CAAC,OAAO,CAAC,CAAC;QACpE,CAAC;IACF,CAAC,CAAC;GACW,cAAc,CA2G1B","sourcesContent":["import { modelOptions, pre, prop, Ref } from '@typegoose/typegoose';\nimport { User } from './user.model';\nimport { Vendor } from './vendor.model';\nimport { ServiceBookingStatus, CounterType, ServiceType, SubServiceType } from '../../../utilities/enum';\nimport { Professional } from './professional.model';\nimport { ServiceBookingFlag } from './embedded/service-booking-flag.model';\nimport { ServiceCart } from './service-cart.model';\nimport { ServiceBookingFinance } from './embedded/service-booking-finance.model';\nimport {\n\tServiceBookingCancelllationDetails,\n\tServiceBookingEndorseLoss,\n} from './embedded/service-booking-cancellation-details.model';\nimport { ServiceBookingStatusTimeline } from './embedded/status-timeline.model';\nimport { generateId } from '../../../utilities/id-generator';\nimport { CounterModel, Review, VendorParent } from '.';\nimport { RegularOrderAddress } from './shared/address.model';\nimport { OrderSlotRange } from './shared/duration.model';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\n\n@modelOptions({ schemaOptions: { collection: 'serviceBookings', timestamps: true } })\n@pre<ServiceBooking>('save', async function () {\n\tif (this.isNew) {\n\t\tthis.orderId = await generateId(CounterModel, CounterType.BOOKING);\n\t}\n})\nexport class ServiceBooking extends TimeStamps {\n\t@prop({ type: String, unique: true })\n\tpublic orderId?: string;\n\n\t@prop({ required: true, ref: () => User })\n\tpublic user!: Ref<User>;\n\n\t@prop({ required: true, ref: () => Vendor })\n\tpublic vendor!: Ref<Vendor>;\n\n\t@prop({ required: true, ref: () => VendorParent })\n\tpublic parent!: Ref<VendorParent>;\n\n\t@prop({ required: true, type: String, enum: ServiceType })\n\tpublic serviceType!: ServiceType;\n\n\t@prop({ type: String, enum: SubServiceType })\n\tpublic subServiceType?: SubServiceType;\n\n\t@prop({ required: true, ref: () => ServiceCart })\n\tpublic cart!: Ref<ServiceCart>;\n\n\t@prop({ required: true, type: () => RegularOrderAddress })\n\tpublic userAddress!: RegularOrderAddress;\n\n\t@prop({ required: true, type: OrderSlotRange, _id: false })\n\tpublic slotRange!: OrderSlotRange;\n\n\t@prop({ type: String, enum: ServiceBookingStatus, default: ServiceBookingStatus.PENDING })\n\tpublic status!: ServiceBookingStatus;\n\n\t@prop({ ref: () => Professional })\n\tpublic professionals?: Ref<Professional>[];\n\n\t@prop({ ref: () => Professional })\n\tpublic responsibleProfessional?: Ref<Professional>;\n\n\t@prop({ type: () => ServiceBookingFlag, _id: false })\n\tpublic flag?: ServiceBookingFlag;\n\n\t@prop({ type: Date, default: new Date() })\n\tpublic processedAt?: Date;\n\n\t@prop({ type: Date })\n\tpublic placedAt?: Date;\n\n\t@prop({ type: Date })\n\tpublic startedAt?: Date;\n\n\t@prop({ type: Date })\n\tpublic estimatedCompletionAt?: Date;\n\n\t@prop({ type: Number })\n\tpublic estimatedCompletionInMinutes?: number;\n\n\t@prop({ type: Date })\n\tpublic completedAt?: Date;\n\n\t@prop({ type: Number })\n\tpublic actualCompletionInMinutes?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isUrgentOrder?: boolean;\n\n\t@prop({ type: Date })\n\tpublic urgentAt?: Date;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isOverdue?: boolean;\n\n\t@prop({ type: Date })\n\tpublic overdueAt?: Date;\n\n\t@prop({ required: true, type: ServiceBookingFinance, _id: false })\n\tpublic finance!: ServiceBookingFinance;\n\n\t@prop({ required: true, type: ServiceBookingFinance, _id: false })\n\tpublic adjustedFinance!: ServiceBookingFinance;\n\n\t@prop({ type: () => ServiceBookingCancelllationDetails, _id: false })\n\tpublic cancellationDetails?: ServiceBookingCancelllationDetails;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isEndorseLossApplied?: boolean;\n\n\t@prop({ type: () => ServiceBookingEndorseLoss, _id: false })\n\tpublic endorseLossInformation?: ServiceBookingEndorseLoss;\n\n\t@prop({ type: () => [ServiceBookingStatusTimeline], default: [] })\n\tpublic statusTimeline?: ServiceBookingStatusTimeline[];\n\n\t@prop({ type: Number })\n\tpublic bufferTime?: number; // minutes\n\n\t// Review feature\n\t@prop({ type: Boolean, default: false })\n\tpublic isReviewed?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isReviewNotificationSent?: boolean;\n\n\t@prop({\n\t\tref: () => Review,\n\t\tforeignField: 'serviceBooking',\n\t\tlocalField: '_id',\n\t})\n\tpublic reviews?: Ref<Review>[];\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Ref } from
|
|
2
|
-
import { TimeStamps } from
|
|
3
|
-
import { Vendor } from
|
|
4
|
-
import { VendorRole } from
|
|
5
|
-
import { VendorParent } from
|
|
1
|
+
import { Ref } from '@typegoose/typegoose';
|
|
2
|
+
import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
|
|
3
|
+
import { Vendor } from './vendor.model';
|
|
4
|
+
import { VendorRole } from '../../../utilities/enum';
|
|
5
|
+
import { VendorParent } from './vendor-parent.model';
|
|
6
6
|
export declare class VendorAccessControl extends TimeStamps {
|
|
7
7
|
name: string;
|
|
8
8
|
email: string;
|
|
@@ -10,4 +10,5 @@ export declare class VendorAccessControl extends TimeStamps {
|
|
|
10
10
|
parent?: Ref<VendorParent>;
|
|
11
11
|
vendors?: Ref<Vendor>[];
|
|
12
12
|
role: VendorRole;
|
|
13
|
+
status?: string;
|
|
13
14
|
}
|
|
@@ -23,6 +23,7 @@ let VendorAccessControl = class VendorAccessControl extends defaultClasses_1.Tim
|
|
|
23
23
|
parent;
|
|
24
24
|
vendors;
|
|
25
25
|
role;
|
|
26
|
+
status;
|
|
26
27
|
};
|
|
27
28
|
exports.VendorAccessControl = VendorAccessControl;
|
|
28
29
|
__decorate([
|
|
@@ -49,6 +50,10 @@ __decorate([
|
|
|
49
50
|
(0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.VendorRole }),
|
|
50
51
|
__metadata("design:type", String)
|
|
51
52
|
], VendorAccessControl.prototype, "role", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typegoose_1.prop)({ type: String, enum: enum_1.Status, default: enum_1.Status.ACTIVE }),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], VendorAccessControl.prototype, "status", void 0);
|
|
52
57
|
exports.VendorAccessControl = VendorAccessControl = __decorate([
|
|
53
58
|
(0, typegoose_1.pre)('save', async function (next) {
|
|
54
59
|
if (this.isModified('password')) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vendor-access-control.model.js","sourceRoot":"/","sources":["libraries/mongo/models/vendor-access-control.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2E;AAC3E,4EAAqE;AACrE,iDAAwC;AACxC,
|
|
1
|
+
{"version":3,"file":"vendor-access-control.model.js","sourceRoot":"/","sources":["libraries/mongo/models/vendor-access-control.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2E;AAC3E,4EAAqE;AACrE,iDAAwC;AACxC,kDAA6D;AAC7D,0DAA2D;AAE3D,+DAAqD;AAkB9C,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,2BAAU;IAE3C,IAAI,CAAU;IAGd,KAAK,CAAU;IAGf,QAAQ,CAAU;IAGlB,MAAM,CAAqB;I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BAAkB,EAAE,KAAK,WAAW,IAAI;QAC7E,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAyB,CAAC;QACvD,IAAI,MAAM,EAAE,QAAQ,EAAE,CAAC;YACtB,MAAM,CAAC,QAAQ,GAAG,MAAM,IAAA,uBAAY,EAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YACtD,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACxB,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;IACD,IAAA,iBAAK,EAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IACnF,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,sBAAsB,EAAE,EAAE,CAAC;GAC3D,mBAAmB,CAqB/B","sourcesContent":["import { index, modelOptions, pre, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { Vendor } from './vendor.model';\nimport { Status, VendorRole } from '../../../utilities/enum';\nimport { hashPassword } from '../../../utilities/password';\nimport { Query } from 'mongoose';\nimport { VendorParent } from './vendor-parent.model';\n\n@pre<VendorAccessControl>('save', async function (next) {\n\tif (this.isModified('password')) {\n\t\tthis.password = await hashPassword(this.password);\n\t}\n\tnext();\n})\n@pre<Query<any, VendorAccessControl>>('findOneAndUpdate', async function (next) {\n\tconst update = this.getUpdate() as Record<string, any>;\n\tif (update?.password) {\n\t\tupdate.password = await hashPassword(update.password);\n\t\tthis.setUpdate(update);\n\t}\n\tnext();\n})\n@index({ email: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@modelOptions({ schemaOptions: { collection: 'vendorAccessControls' } })\nexport class VendorAccessControl extends TimeStamps {\n\t@prop({ required: true, type: String, maxlength: 50 })\n\tpublic name!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic email!: string;\n\n\t@prop({ required: true, type: String, minlength: 8 })\n\tpublic password!: string;\n\n\t@prop({ required: true, ref: () => VendorParent })\n\tpublic parent?: Ref<VendorParent>;\n\n\t@prop({ ref: () => Vendor, default: [] })\n\tpublic vendors?: Ref<Vendor>[];\n\n\t@prop({ required: true, type: String, enum: VendorRole })\n\tpublic role!: VendorRole;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status?: string;\n}\n"]}
|
|
@@ -5,10 +5,10 @@ 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
|
-
req: import("http").IncomingMessage;
|
|
9
8
|
res: import("http").ServerResponse<import("http").IncomingMessage>;
|
|
10
9
|
tokenType: TokenType | undefined;
|
|
11
10
|
entity: import("../context").EntityContext | undefined;
|
|
11
|
+
req: import("http").IncomingMessage;
|
|
12
12
|
requestId: string | undefined;
|
|
13
13
|
usedRefreshToken: boolean | undefined;
|
|
14
14
|
tokenRenewed: boolean | undefined;
|
|
@@ -4,10 +4,10 @@ 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
|
-
req: import("http").IncomingMessage;
|
|
8
7
|
res: import("http").ServerResponse<import("http").IncomingMessage>;
|
|
9
8
|
tokenType: import("../../auth").TokenType | undefined;
|
|
10
9
|
entity: import("../context").EntityContext | undefined;
|
|
10
|
+
req: import("http").IncomingMessage;
|
|
11
11
|
requestId: string | undefined;
|
|
12
12
|
usedRefreshToken: boolean | undefined;
|
|
13
13
|
tokenRenewed: boolean | undefined;
|
|
@@ -3,10 +3,10 @@ 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
|
-
req: import("http").IncomingMessage;
|
|
7
6
|
res: import("http").ServerResponse<import("http").IncomingMessage>;
|
|
8
7
|
tokenType: import("../../auth").TokenType | undefined;
|
|
9
8
|
entity: import("../context").EntityContext | undefined;
|
|
9
|
+
req: import("http").IncomingMessage;
|
|
10
10
|
requestId: string | undefined;
|
|
11
11
|
usedRefreshToken: boolean | undefined;
|
|
12
12
|
tokenRenewed: boolean | undefined;
|
|
@@ -5,10 +5,10 @@ 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
|
-
req: import("http").IncomingMessage;
|
|
9
8
|
res: import("http").ServerResponse<import("http").IncomingMessage>;
|
|
10
9
|
tokenType: TokenType | undefined;
|
|
11
10
|
entity: import("../context").EntityContext | undefined;
|
|
11
|
+
req: import("http").IncomingMessage;
|
|
12
12
|
requestId: string | undefined;
|
|
13
13
|
usedRefreshToken: boolean | undefined;
|
|
14
14
|
tokenRenewed: boolean | undefined;
|
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
|
-
populate?: any;
|
|
30
29
|
select?: Record<string, 0 | 1> | undefined;
|
|
30
|
+
populate?: any;
|
|
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
|
-
populate?: any;
|
|
40
39
|
select?: Record<string, 0 | 1> | undefined;
|
|
40
|
+
populate?: any;
|
|
41
41
|
query?: Record<string, any> | undefined;
|
|
42
42
|
page?: number | undefined;
|
|
43
43
|
}>>;
|
|
@@ -736,12 +736,12 @@ export declare const GetByIdInputSchema: z.ZodObject<{
|
|
|
736
736
|
populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
|
|
737
737
|
}, "strip", z.ZodTypeAny, {
|
|
738
738
|
_id: import("mongoose").Types.ObjectId;
|
|
739
|
-
populate?: any;
|
|
740
739
|
select?: Record<string, 0 | 1> | undefined;
|
|
740
|
+
populate?: any;
|
|
741
741
|
}, {
|
|
742
742
|
_id: string | import("mongoose").Types.ObjectId;
|
|
743
|
-
populate?: any;
|
|
744
743
|
select?: Record<string, 0 | 1> | undefined;
|
|
744
|
+
populate?: any;
|
|
745
745
|
}>;
|
|
746
746
|
export type GetByIdInputDTO = DTO<typeof GetByIdInputSchema>;
|
|
747
747
|
export declare const GetProductByIdInputSchema: z.ZodObject<{
|
|
@@ -754,12 +754,12 @@ export declare const GetProductByIdInputSchema: z.ZodObject<{
|
|
|
754
754
|
_id: import("mongoose").Types.ObjectId;
|
|
755
755
|
withAttributeHiddenItems: boolean;
|
|
756
756
|
withAddonsHiddenItems: boolean;
|
|
757
|
-
populate?: any;
|
|
758
757
|
select?: Record<string, 0 | 1> | undefined;
|
|
758
|
+
populate?: any;
|
|
759
759
|
}, {
|
|
760
760
|
_id: string | import("mongoose").Types.ObjectId;
|
|
761
|
-
populate?: any;
|
|
762
761
|
select?: Record<string, 0 | 1> | undefined;
|
|
762
|
+
populate?: any;
|
|
763
763
|
withAttributeHiddenItems?: boolean | undefined;
|
|
764
764
|
withAddonsHiddenItems?: boolean | undefined;
|
|
765
765
|
}>;
|
|
@@ -772,14 +772,14 @@ export declare const GetOrderByIdInputSchema: z.ZodObject<{
|
|
|
772
772
|
userOrderCompletionScope: z.ZodOptional<z.ZodNativeEnum<typeof UserOrderCompletionScope>>;
|
|
773
773
|
}, "strip", z.ZodTypeAny, {
|
|
774
774
|
_id: import("mongoose").Types.ObjectId;
|
|
775
|
-
populate?: any;
|
|
776
775
|
select?: Record<string, 0 | 1> | undefined;
|
|
776
|
+
populate?: any;
|
|
777
777
|
groupByCategories?: boolean | undefined;
|
|
778
778
|
userOrderCompletionScope?: UserOrderCompletionScope | undefined;
|
|
779
779
|
}, {
|
|
780
780
|
_id: string | import("mongoose").Types.ObjectId;
|
|
781
|
-
populate?: any;
|
|
782
781
|
select?: Record<string, 0 | 1> | undefined;
|
|
782
|
+
populate?: any;
|
|
783
783
|
groupByCategories?: boolean | undefined;
|
|
784
784
|
userOrderCompletionScope?: UserOrderCompletionScope | undefined;
|
|
785
785
|
}>;
|
|
@@ -788,11 +788,11 @@ export declare const GetByTokenInputSchema: z.ZodOptional<z.ZodObject<{
|
|
|
788
788
|
select: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>>>;
|
|
789
789
|
populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
|
|
790
790
|
}, "strip", z.ZodTypeAny, {
|
|
791
|
-
populate?: any;
|
|
792
791
|
select?: Record<string, 0 | 1> | undefined;
|
|
793
|
-
}, {
|
|
794
792
|
populate?: any;
|
|
793
|
+
}, {
|
|
795
794
|
select?: Record<string, 0 | 1> | undefined;
|
|
795
|
+
populate?: any;
|
|
796
796
|
}>>;
|
|
797
797
|
export type GetByTokenInputDTO = DTO<typeof GetByTokenInputSchema>;
|
|
798
798
|
export declare const GetOneQuerySchema: z.ZodObject<{
|
|
@@ -800,12 +800,12 @@ export declare const GetOneQuerySchema: z.ZodObject<{
|
|
|
800
800
|
select: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>>>;
|
|
801
801
|
populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
|
|
802
802
|
}, "strip", z.ZodTypeAny, {
|
|
803
|
-
populate?: any;
|
|
804
803
|
select?: Record<string, 0 | 1> | undefined;
|
|
804
|
+
populate?: any;
|
|
805
805
|
query?: Record<string, any> | undefined;
|
|
806
806
|
}, {
|
|
807
|
-
populate?: any;
|
|
808
807
|
select?: Record<string, 0 | 1> | undefined;
|
|
808
|
+
populate?: any;
|
|
809
809
|
query?: Record<string, any> | undefined;
|
|
810
810
|
}>;
|
|
811
811
|
export type GetOneQueryDTO = DTO<typeof GetOneQuerySchema>;
|