@lyxa.ai/core 1.4.175 → 1.4.177
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-package.model.js +1 -1
- package/dist/libraries/mongo/models/service-package.model.js.map +1 -1
- package/dist/libraries/mongo/models/user-action.model.d.ts +4 -0
- package/dist/libraries/mongo/models/user-action.model.js +13 -1
- package/dist/libraries/mongo/models/user-action.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
|
@@ -60,7 +60,7 @@ __decorate([
|
|
|
60
60
|
__metadata("design:type", String)
|
|
61
61
|
], ServicePackage.prototype, "subServiceType", void 0);
|
|
62
62
|
__decorate([
|
|
63
|
-
(0, typegoose_1.prop)({ type: String, trim: true
|
|
63
|
+
(0, typegoose_1.prop)({ type: String, trim: true }),
|
|
64
64
|
__metadata("design:type", String)
|
|
65
65
|
], ServicePackage.prototype, "description", void 0);
|
|
66
66
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-package.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-package.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAmF;AACnF,4EAAqE;AACrE,kDAA8E;AAC9E,iDAAwC;AACxC,qEAA2D;AAC3D,mCAA4D;AAC5D,0EAAgE;AAChE,gFAAsE;AACtE,8EAAyE;AA4BlE,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,2BAAU;IAEtC,IAAI,CAAU;IAGd,cAAc,CAAU;IAGxB,MAAM,CAAe;IAGrB,WAAW,CAAe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C,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,iBAAiB,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;IACpF,IAAA,iBAAK,EAAC,EAAE,cAAc,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IACvG,IAAA,iBAAK,EAAC,EAAE,cAAc,EAAE,CAAC,EAAE,EAAE,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IAC9E,IAAA,eAAG,EAAiB,MAAM,EAAE,KAAK,WAAW,IAAI;QAEhD,IAAI,IAAI,CAAC,KAAK,IAAI,OAAO,IAAI,CAAC,YAAY,KAAK,WAAW,EAAE,CAAC;YAC5D,IAAI,CAAC;gBAEJ,MAAM,eAAe,GAAG,MAAM,2BAAmB,CAAC,SAAS,CAA8B;oBACxF;wBACC,MAAM,EAAE;4BACP,GAAG,EAAE,IAAI;4BACT,eAAe,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE;yBAC1C;qBACD;iBACD,CAAC,CAAC,IAAI,EAAE,CAAC;gBAGV,IAAI,CAAC,YAAY,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;YACrE,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,OAAO,IAAI,CAAC,KAAc,CAAC,CAAC;YAC7B,CAAC;QACF,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;IACD,IAAA,kBAAM,EAAC,6CAAoB,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;GACnC,cAAc,CAmD1B","sourcesContent":["import { index, modelOptions, plugin, pre, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ServiceType, Status, SubServiceType } from '../../../utilities/enum';\nimport { Vendor } from './vendor.model';\nimport { ServiceCategory } from './service-category.model';\nimport { ServiceAddon, ServicePackageModel } from './index';\nimport { PreparingTime } from './embedded/preparing-time.model';\nimport { CleaningMaterial } from './embedded/cleaning-material.model';\nimport { normalizeFieldPlugin } from '../plugins/normalize-field.plugin';\n\n@modelOptions({ schemaOptions: { collection: 'servicePackages', timestamps: true } })\n@index({ nameNormalized: 1, vendor: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@index({ nameNormalized: 1 }, { partialFilterExpression: { deletedAt: null } })\n@pre<ServicePackage>('save', async function (next) {\n\t// Only set sortingOrder if it's a new document or sortingOrder is not set\n\tif (this.isNew || typeof this.sortingOrder === 'undefined') {\n\t\ttry {\n\t\t\t// Find the maximum sortingOrder for shops with the same itemType that aren't deleted\n\t\t\tconst maxSortingOrder = await ServicePackageModel.aggregate<{ maxSortingOrder: number }>([\n\t\t\t\t{\n\t\t\t\t\t$group: {\n\t\t\t\t\t\t_id: null,\n\t\t\t\t\t\tmaxSortingOrder: { $max: '$sortingOrder' },\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t]).exec();\n\n\t\t\t// Set the new sortingOrder to max + 1 (or 0 if no items found)\n\t\t\tthis.sortingOrder = (maxSortingOrder[0]?.maxSortingOrder ?? -1) + 1;\n\t\t} catch (error) {\n\t\t\treturn next(error as Error);\n\t\t}\n\t}\n\tnext();\n})\n@plugin(normalizeFieldPlugin, { field: 'name' })\nexport class ServicePackage extends TimeStamps {\n\t@prop({ required: true, type: String, trim: true, maxlength: 20 })\n\tpublic name!: string;\n\n\t@prop({ type: String, trim: true, lowercase: true, select: false })\n\tpublic nameNormalized?: string;\n\n\t@prop({ required: true, ref: () => Vendor })\n\tpublic vendor!: Ref<Vendor>;\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({ type: String, trim: true })\n\tpublic description?: string;\n\n\t@prop({ required: true, ref: () => ServiceCategory })\n\tpublic category!: Ref<ServiceCategory>;\n\n\t@prop({ required: true, type: Number, min: 0 })\n\tpublic price!: number;\n\n\t@prop({ required: true, type: PreparingTime })\n\tpublic duration!: PreparingTime;\n\n\t@prop({ required: true, type: Number, min: 1 })\n\tpublic numberOfProfessionals!: number;\n\n\t@prop({ required: true, type: String })\n\tpublic image!: string;\n\n\t@prop({ type: String, maxlength: 250 })\n\tpublic vendorNotes?: string;\n\n\t@prop({ ref: () => ServiceAddon, default: [] })\n\tpublic addons?: Ref<ServiceAddon>[];\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status: Status;\n\n\t@prop({ required: true, type: CleaningMaterial })\n\tpublic cleaningMaterial!: CleaningMaterial;\n\n\t@prop({ type: Number })\n\tpublic sortingOrder?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic avgRating?: number;\n}\n"]}
|
|
@@ -4,6 +4,8 @@ import { User } from './user.model';
|
|
|
4
4
|
import { UserActionReason, UserActionType } from '../../../utilities/enum';
|
|
5
5
|
import { Order } from './order.model';
|
|
6
6
|
import { ServiceBooking } from './service-booking.model';
|
|
7
|
+
import { PaymentRecord } from './embedded/payment-record.model';
|
|
8
|
+
import { Card } from './card.model';
|
|
7
9
|
export declare class UserActionContext {
|
|
8
10
|
oldTotal: number;
|
|
9
11
|
secondaryOldTotal: number;
|
|
@@ -11,6 +13,8 @@ export declare class UserActionContext {
|
|
|
11
13
|
secondaryNewTotal: number;
|
|
12
14
|
diffPaidAmount: number;
|
|
13
15
|
secondaryDiffPaidAmount: number;
|
|
16
|
+
card?: Ref<Card>;
|
|
17
|
+
paymentRecords?: PaymentRecord[];
|
|
14
18
|
[key: string]: any;
|
|
15
19
|
}
|
|
16
20
|
export declare class UserAction extends TimeStamps {
|
|
@@ -16,6 +16,8 @@ const user_model_1 = require("./user.model");
|
|
|
16
16
|
const enum_1 = require("../../../utilities/enum");
|
|
17
17
|
const order_model_1 = require("./order.model");
|
|
18
18
|
const service_booking_model_1 = require("./service-booking.model");
|
|
19
|
+
const payment_record_model_1 = require("./embedded/payment-record.model");
|
|
20
|
+
const card_model_1 = require("./card.model");
|
|
19
21
|
let UserActionContext = class UserActionContext {
|
|
20
22
|
oldTotal;
|
|
21
23
|
secondaryOldTotal;
|
|
@@ -23,6 +25,8 @@ let UserActionContext = class UserActionContext {
|
|
|
23
25
|
secondaryNewTotal;
|
|
24
26
|
diffPaidAmount;
|
|
25
27
|
secondaryDiffPaidAmount;
|
|
28
|
+
card;
|
|
29
|
+
paymentRecords;
|
|
26
30
|
};
|
|
27
31
|
exports.UserActionContext = UserActionContext;
|
|
28
32
|
__decorate([
|
|
@@ -49,8 +53,16 @@ __decorate([
|
|
|
49
53
|
(0, typegoose_1.prop)({ required: true, type: Number }),
|
|
50
54
|
__metadata("design:type", Number)
|
|
51
55
|
], UserActionContext.prototype, "secondaryDiffPaidAmount", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, typegoose_1.prop)({ ref: () => card_model_1.Card }),
|
|
58
|
+
__metadata("design:type", Object)
|
|
59
|
+
], UserActionContext.prototype, "card", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, typegoose_1.prop)({ type: () => [payment_record_model_1.PaymentRecord], _id: false, default: [] }),
|
|
62
|
+
__metadata("design:type", Array)
|
|
63
|
+
], UserActionContext.prototype, "paymentRecords", void 0);
|
|
52
64
|
exports.UserActionContext = UserActionContext = __decorate([
|
|
53
|
-
(0, typegoose_1.modelOptions)({ options: { allowMixed: typegoose_1.Severity.ALLOW } })
|
|
65
|
+
(0, typegoose_1.modelOptions)({ schemaOptions: { strict: false, _id: false }, options: { allowMixed: typegoose_1.Severity.ALLOW } })
|
|
54
66
|
], UserActionContext);
|
|
55
67
|
let UserAction = class UserAction extends defaultClasses_1.TimeStamps {
|
|
56
68
|
user;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-action.model.js","sourceRoot":"/","sources":["libraries/mongo/models/user-action.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAyE;AACzE,4EAAqE;AACrE,6CAAoC;AACpC,kDAA2E;AAC3E,+CAAsC;AACtC,mEAAyD;
|
|
1
|
+
{"version":3,"file":"user-action.model.js","sourceRoot":"/","sources":["libraries/mongo/models/user-action.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAyE;AACzE,4EAAqE;AACrE,6CAAoC;AACpC,kDAA2E;AAC3E,+CAAsC;AACtC,mEAAyD;AACzD,0EAAgE;AAChE,6CAAoC;AAG7B,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAEtB,QAAQ,CAAU;IAGlB,iBAAiB,CAAU;IAG3B,QAAQ,CAAU;IAGlB,iBAAiB,CAAU;IAG3B,cAAc,CAAU;IAGxB,uBAAuB,CAAU;IAGjC,IAAI,CAAa;IAGjB,cAAc,CAAmB;CAIxC,CAAA;AA3BY,8CAAiB;AAEtB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;mDACd;AAGlB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;4DACL;AAG3B;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;mDACd;AAGlB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;4DACL;AAG3B;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yDACR;AAGxB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;kEACC;AAGjC;IADN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IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAgB,EAAE,CAAC;;gDACxB;AAGhC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;8CACZ;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,iBAAiB,EAAE,CAAC;8BACvB,iBAAiB;2CAAC;qBAvBvB,UAAU;IADtB,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,aAAa,EAAE,EAAE,OAAO,EAAE,EAAE,UAAU,EAAE,oBAAQ,CAAC,KAAK,EAAE,EAAE,CAAC;GAC3F,UAAU,CAwBtB","sourcesContent":["import { modelOptions, prop, Ref, Severity } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { User } from './user.model';\nimport { UserActionReason, UserActionType } from '../../../utilities/enum';\nimport { Order } from './order.model';\nimport { ServiceBooking } from './service-booking.model';\nimport { PaymentRecord } from './embedded/payment-record.model';\nimport { Card } from './card.model';\n\n@modelOptions({ schemaOptions: { strict: false, _id: false }, options: { allowMixed: Severity.ALLOW } })\nexport class UserActionContext {\n\t@prop({ required: true, type: Number })\n\tpublic oldTotal!: number;\n\n\t@prop({ required: true, type: Number })\n\tpublic secondaryOldTotal!: number;\n\n\t@prop({ required: true, type: Number })\n\tpublic newTotal!: number;\n\n\t@prop({ required: true, type: Number })\n\tpublic secondaryNewTotal!: number;\n\n\t@prop({ required: true, type: Number })\n\tpublic diffPaidAmount!: number;\n\n\t@prop({ required: true, type: Number })\n\tpublic secondaryDiffPaidAmount!: number;\n\n\t@prop({ ref: () => Card })\n\tpublic card?: Ref<Card>;\n\n\t@prop({ type: () => [PaymentRecord], _id: false, default: [] })\n\tpublic paymentRecords?: PaymentRecord[];\n\n\t// any other freeform keys are still allowed via Severity.ALLOW\n\t[key: string]: any;\n}\n\n@modelOptions({ schemaOptions: { collection: 'userActions' }, options: { allowMixed: Severity.ALLOW } })\nexport class UserAction extends TimeStamps {\n\t@prop({ required: true, ref: () => User })\n\tpublic user!: Ref<User>;\n\n\t@prop({ ref: () => Order })\n\tpublic order?: Ref<Order>;\n\n\t@prop({ ref: () => ServiceBooking })\n\tpublic serviceBooking?: Ref<ServiceBooking>;\n\n\t@prop({ required: true, type: String })\n\tpublic orderId!: string;\n\n\t@prop({ required: true, type: String, enum: UserActionType })\n\tpublic actionType!: UserActionType;\n\n\t@prop({ required: true, type: String, enum: UserActionReason })\n\tpublic actionReason!: UserActionReason;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isResolved?: boolean;\n\n\t@prop({ type: () => UserActionContext })\n\tpublic context?: UserActionContext;\n}\n"]}
|
|
@@ -5,9 +5,9 @@ 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;
|
|
8
9
|
res: import("http").ServerResponse<import("http").IncomingMessage>;
|
|
9
10
|
tokenType: TokenType | undefined;
|
|
10
|
-
req: import("http").IncomingMessage;
|
|
11
11
|
requestId: string | undefined;
|
|
12
12
|
entity: import("../context").EntityContext | undefined;
|
|
13
13
|
usedRefreshToken: boolean | undefined;
|
|
@@ -4,9 +4,9 @@ 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;
|
|
7
8
|
res: import("http").ServerResponse<import("http").IncomingMessage>;
|
|
8
9
|
tokenType: import("../../auth").TokenType | undefined;
|
|
9
|
-
req: import("http").IncomingMessage;
|
|
10
10
|
requestId: string | undefined;
|
|
11
11
|
entity: import("../context").EntityContext | undefined;
|
|
12
12
|
usedRefreshToken: boolean | undefined;
|
|
@@ -3,9 +3,9 @@ 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;
|
|
6
7
|
res: import("http").ServerResponse<import("http").IncomingMessage>;
|
|
7
8
|
tokenType: import("../../auth").TokenType | undefined;
|
|
8
|
-
req: import("http").IncomingMessage;
|
|
9
9
|
requestId: string | undefined;
|
|
10
10
|
entity: import("../context").EntityContext | undefined;
|
|
11
11
|
usedRefreshToken: boolean | undefined;
|
|
@@ -5,9 +5,9 @@ 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;
|
|
8
9
|
res: import("http").ServerResponse<import("http").IncomingMessage>;
|
|
9
10
|
tokenType: TokenType | undefined;
|
|
10
|
-
req: import("http").IncomingMessage;
|
|
11
11
|
requestId: string | undefined;
|
|
12
12
|
entity: import("../context").EntityContext | undefined;
|
|
13
13
|
usedRefreshToken: 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
|
-
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
|
}>>;
|
|
@@ -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
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
740
739
|
populate?: any;
|
|
740
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
741
741
|
}, {
|
|
742
742
|
_id: string | import("mongoose").Types.ObjectId;
|
|
743
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
744
743
|
populate?: any;
|
|
744
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
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
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
758
757
|
populate?: any;
|
|
758
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
759
759
|
}, {
|
|
760
760
|
_id: string | import("mongoose").Types.ObjectId;
|
|
761
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
762
761
|
populate?: any;
|
|
762
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
763
763
|
withAttributeHiddenItems?: boolean | undefined;
|
|
764
764
|
withAddonsHiddenItems?: boolean | undefined;
|
|
765
765
|
}>;
|
|
@@ -773,15 +773,15 @@ export declare const GetOrderByIdInputSchema: z.ZodObject<{
|
|
|
773
773
|
userOrderCompletionScope: z.ZodOptional<z.ZodNativeEnum<typeof UserOrderCompletionScope>>;
|
|
774
774
|
}, "strip", z.ZodTypeAny, {
|
|
775
775
|
_id: import("mongoose").Types.ObjectId;
|
|
776
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
777
776
|
populate?: any;
|
|
777
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
778
778
|
groupByCategories?: boolean | undefined;
|
|
779
779
|
getParentCategory?: boolean | undefined;
|
|
780
780
|
userOrderCompletionScope?: UserOrderCompletionScope | undefined;
|
|
781
781
|
}, {
|
|
782
782
|
_id: string | import("mongoose").Types.ObjectId;
|
|
783
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
784
783
|
populate?: any;
|
|
784
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
785
785
|
groupByCategories?: boolean | undefined;
|
|
786
786
|
getParentCategory?: boolean | undefined;
|
|
787
787
|
userOrderCompletionScope?: UserOrderCompletionScope | undefined;
|
|
@@ -791,11 +791,11 @@ export declare const GetByTokenInputSchema: z.ZodOptional<z.ZodObject<{
|
|
|
791
791
|
select: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>>>;
|
|
792
792
|
populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
|
|
793
793
|
}, "strip", z.ZodTypeAny, {
|
|
794
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
795
794
|
populate?: any;
|
|
796
|
-
}, {
|
|
797
795
|
select?: Record<string, 0 | 1> | undefined;
|
|
796
|
+
}, {
|
|
798
797
|
populate?: any;
|
|
798
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
799
799
|
}>>;
|
|
800
800
|
export type GetByTokenInputDTO = DTO<typeof GetByTokenInputSchema>;
|
|
801
801
|
export declare const GetOneQuerySchema: z.ZodObject<{
|
|
@@ -803,12 +803,12 @@ export declare const GetOneQuerySchema: z.ZodObject<{
|
|
|
803
803
|
select: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>>>;
|
|
804
804
|
populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
|
|
805
805
|
}, "strip", z.ZodTypeAny, {
|
|
806
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
807
806
|
populate?: any;
|
|
807
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
808
808
|
query?: Record<string, any> | undefined;
|
|
809
809
|
}, {
|
|
810
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
811
810
|
populate?: any;
|
|
811
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
812
812
|
query?: Record<string, any> | undefined;
|
|
813
813
|
}>;
|
|
814
814
|
export type GetOneQueryDTO = DTO<typeof GetOneQuerySchema>;
|