@lyxa.ai/core 1.1.66 → 1.1.67
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/embedded/best-seller-category.model.d.ts +12 -0
- package/dist/libraries/mongo/models/embedded/best-seller-category.model.js +47 -0
- package/dist/libraries/mongo/models/embedded/best-seller-category.model.js.map +1 -0
- package/dist/libraries/mongo/models/message.model.d.ts +2 -3
- package/dist/libraries/mongo/models/message.model.js +5 -17
- package/dist/libraries/mongo/models/message.model.js.map +1 -1
- package/dist/libraries/mongo/models/shop.model.d.ts +4 -5
- package/dist/libraries/mongo/models/shop.model.js +16 -25
- package/dist/libraries/mongo/models/shop.model.js.map +1 -1
- package/dist/libraries/mongo/models/user.model.d.ts +1 -1
- package/dist/libraries/mongo/models/vendor.model.d.ts +1 -4
- package/dist/libraries/mongo/models/vendor.model.js +0 -15
- package/dist/libraries/mongo/models/vendor.model.js.map +1 -1
- package/dist/libraries/socket/core/socket-event-registry.map.d.ts +3 -54
- package/dist/libraries/socket/events/chatlist-message-send.socket.event.d.ts +0 -37
- package/dist/libraries/socket/events/chatlist-message-send.socket.event.js +0 -4
- package/dist/libraries/socket/events/chatlist-message-send.socket.event.js.map +1 -1
- package/dist/libraries/socket/events/chatroom-message-send.socket.event.d.ts +7 -73
- package/dist/libraries/socket/events/chatroom-message-send.socket.event.js +1 -8
- package/dist/libraries/socket/events/chatroom-message-send.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 +2 -78
- package/dist/types/utilities/validation/global-validation.d.ts +14 -38
- package/dist/utilities/validation/common-validation.d.ts +2 -78
- package/dist/utilities/validation/global-validation.d.ts +14 -38
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Ref } from '@typegoose/typegoose';
|
|
2
|
+
import { Status } from '../../../../utilities/enum';
|
|
3
|
+
import { Product } from '../product.model';
|
|
4
|
+
export declare class BestSellerCategory {
|
|
5
|
+
title?: string;
|
|
6
|
+
status?: Status;
|
|
7
|
+
}
|
|
8
|
+
export declare class FavouritesCategory {
|
|
9
|
+
title?: string;
|
|
10
|
+
status?: Status;
|
|
11
|
+
products?: Ref<Product>[];
|
|
12
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.FavouritesCategory = exports.BestSellerCategory = void 0;
|
|
13
|
+
const typegoose_1 = require("@typegoose/typegoose");
|
|
14
|
+
const enum_1 = require("../../../../utilities/enum");
|
|
15
|
+
const product_model_1 = require("../product.model");
|
|
16
|
+
class BestSellerCategory {
|
|
17
|
+
title;
|
|
18
|
+
status;
|
|
19
|
+
}
|
|
20
|
+
exports.BestSellerCategory = BestSellerCategory;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, typegoose_1.prop)({ type: String, default: 'Best Seller' }),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], BestSellerCategory.prototype, "title", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typegoose_1.prop)({ type: String, enum: enum_1.Status, default: enum_1.Status.INACTIVE }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], BestSellerCategory.prototype, "status", void 0);
|
|
29
|
+
class FavouritesCategory {
|
|
30
|
+
title;
|
|
31
|
+
status;
|
|
32
|
+
products;
|
|
33
|
+
}
|
|
34
|
+
exports.FavouritesCategory = FavouritesCategory;
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typegoose_1.prop)({ type: String, default: 'Favourites' }),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], FavouritesCategory.prototype, "title", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typegoose_1.prop)({ type: String, enum: enum_1.Status, default: enum_1.Status.INACTIVE }),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], FavouritesCategory.prototype, "status", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typegoose_1.prop)({ ref: () => product_model_1.Product, default: [] }),
|
|
45
|
+
__metadata("design:type", Array)
|
|
46
|
+
], FavouritesCategory.prototype, "products", void 0);
|
|
47
|
+
//# sourceMappingURL=best-seller-category.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"best-seller-category.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/best-seller-category.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,qDAAoD;AACpD,oDAA2C;AAE3C,MAAa,kBAAkB;IAEvB,KAAK,CAAU;IAGf,MAAM,CAAU;CACvB;AAND,gDAMC;AAJO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;;iDACzB;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAM,EAAE,OAAO,EAAE,aAAM,CAAC,QAAQ,EAAE,CAAC;;kDACxC;AAGxB,MAAa,kBAAkB;IAEvB,KAAK,CAAU;IAGf,MAAM,CAAU;IAGhB,QAAQ,CAAkB;CACjC;AATD,gDASC;AAPO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;;iDACxB;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAM,EAAE,OAAO,EAAE,aAAM,CAAC,QAAQ,EAAE,CAAC;;kDACxC;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,uBAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;oDACT","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\nimport { Status } from '../../../../utilities/enum';\nimport { Product } from '../product.model';\n\nexport class BestSellerCategory {\n\t@prop({ type: String, default: 'Best Seller' })\n\tpublic title?: string;\n\n\t@prop({ type: String, enum: Status, default: Status.INACTIVE })\n\tpublic status?: Status;\n}\n\nexport class FavouritesCategory {\n\t@prop({ type: String, default: 'Favourites' })\n\tpublic title?: string;\n\n\t@prop({ type: String, enum: Status, default: Status.INACTIVE })\n\tpublic status?: Status;\n\n\t@prop({ ref: () => Product, default: [] })\n\tpublic products?: Ref<Product>[];\n}\n"]}
|
|
@@ -6,10 +6,9 @@ import { Shop } from './shop.model';
|
|
|
6
6
|
import { MediaType, UserRef } from '../../../utilities/enum';
|
|
7
7
|
import { Rider } from './rider.model';
|
|
8
8
|
import { Chatroom } from './chat-room.model';
|
|
9
|
-
export declare class Media {
|
|
10
|
-
|
|
9
|
+
export declare class Media extends TimeStamps {
|
|
10
|
+
url: string;
|
|
11
11
|
mediaType: MediaType;
|
|
12
|
-
mimeType: string;
|
|
13
12
|
thumbnailUrl?: string;
|
|
14
13
|
name?: string;
|
|
15
14
|
}
|
|
@@ -14,10 +14,9 @@ const typegoose_1 = require("@typegoose/typegoose");
|
|
|
14
14
|
const defaultClasses_1 = require("@typegoose/typegoose/lib/defaultClasses");
|
|
15
15
|
const enum_1 = require("../../../utilities/enum");
|
|
16
16
|
const chat_room_model_1 = require("./chat-room.model");
|
|
17
|
-
class Media {
|
|
18
|
-
|
|
17
|
+
class Media extends defaultClasses_1.TimeStamps {
|
|
18
|
+
url;
|
|
19
19
|
mediaType;
|
|
20
|
-
mimeType;
|
|
21
20
|
thumbnailUrl;
|
|
22
21
|
name;
|
|
23
22
|
}
|
|
@@ -25,15 +24,11 @@ exports.Media = Media;
|
|
|
25
24
|
__decorate([
|
|
26
25
|
(0, typegoose_1.prop)({ required: true }),
|
|
27
26
|
__metadata("design:type", String)
|
|
28
|
-
], Media.prototype, "
|
|
27
|
+
], Media.prototype, "url", void 0);
|
|
29
28
|
__decorate([
|
|
30
29
|
(0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.MediaType }),
|
|
31
30
|
__metadata("design:type", String)
|
|
32
31
|
], Media.prototype, "mediaType", void 0);
|
|
33
|
-
__decorate([
|
|
34
|
-
(0, typegoose_1.prop)({ required: true }),
|
|
35
|
-
__metadata("design:type", String)
|
|
36
|
-
], Media.prototype, "mimeType", void 0);
|
|
37
32
|
__decorate([
|
|
38
33
|
(0, typegoose_1.prop)(),
|
|
39
34
|
__metadata("design:type", String)
|
|
@@ -57,7 +52,7 @@ __decorate([
|
|
|
57
52
|
__metadata("design:type", Object)
|
|
58
53
|
], Message.prototype, "chatroom", void 0);
|
|
59
54
|
__decorate([
|
|
60
|
-
(0, typegoose_1.prop)({ type: String }),
|
|
55
|
+
(0, typegoose_1.prop)({ required: true, type: String }),
|
|
61
56
|
__metadata("design:type", String)
|
|
62
57
|
], Message.prototype, "content", void 0);
|
|
63
58
|
__decorate([
|
|
@@ -65,14 +60,7 @@ __decorate([
|
|
|
65
60
|
__metadata("design:type", String)
|
|
66
61
|
], Message.prototype, "senderType", void 0);
|
|
67
62
|
__decorate([
|
|
68
|
-
(0, typegoose_1.prop)({
|
|
69
|
-
type: () => [Media],
|
|
70
|
-
default: [],
|
|
71
|
-
validate: {
|
|
72
|
-
validator: (v) => v.length <= 4,
|
|
73
|
-
message: 'Maximum 4 media items per message',
|
|
74
|
-
},
|
|
75
|
-
}),
|
|
63
|
+
(0, typegoose_1.prop)({ type: () => [Media], default: [] }),
|
|
76
64
|
__metadata("design:type", Array)
|
|
77
65
|
], Message.prototype, "media", void 0);
|
|
78
66
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.model.js","sourceRoot":"/","sources":["libraries/mongo/models/message.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsE;AACtE,4EAAqE;AAIrE,kDAA6D;AAE7D,uDAA6C;AAE7C,MAAa,
|
|
1
|
+
{"version":3,"file":"message.model.js","sourceRoot":"/","sources":["libraries/mongo/models/message.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsE;AACtE,4EAAqE;AAIrE,kDAA6D;AAE7D,uDAA6C;AAE7C,MAAa,KAAM,SAAQ,2BAAU;IAE7B,GAAG,CAAU;IAGb,SAAS,CAAY;IAGrB,YAAY,CAAU;IAGtB,IAAI,CAAU;CACrB;AAZD,sBAYC;AAVO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kCACL;AAGb;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAS,EAAE,CAAC;;wCAC5B;AAGrB;IADN,IAAA,gBAAI,GAAE;;2CACsB;AAGtB;IADN,IAAA,gBAAI,GAAE;;mCACc;AAWf,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,2BAAU;IAE/B,QAAQ,CAAiB;IAGzB,OAAO,CAAU;IAGjB,UAAU,CAAW;IAGrB,KAAK,CAAW;IAGhB,MAAM,CAAoC;IAG1C,WAAW,CAAW;IAGtB,WAAW,CAAQ;CAC1B,CAAA;AArBY,0BAAO;AAEZ;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,0BAAQ,EAAE,CAAC;;yCACd;AAGzB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;wCACf;AAGjB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,cAAO,EAAE,CAAC;;2CAC1B;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;sCACpB;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;;uCACiB;AAG1C;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;4CACX;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACA,IAAI;4CAAC;kBApBd,OAAO;IARnB,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE;YACd,UAAU,EAAE,UAAU;SACtB;KACD,CAAC;IACD,IAAA,iBAAK,EAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC;IACrC,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC;IACnC,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;GACrB,OAAO,CAqBnB","sourcesContent":["import { index, modelOptions, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { User } from './user.model';\nimport { Admin } from './admin.model';\nimport { Shop } from './shop.model';\nimport { MediaType, UserRef } from '../../../utilities/enum';\nimport { Rider } from './rider.model';\nimport { Chatroom } from './chat-room.model';\n\nexport class Media extends TimeStamps {\n\t@prop({ required: true })\n\tpublic url!: string;\n\n\t@prop({ required: true, type: String, enum: MediaType })\n\tpublic mediaType: MediaType;\n\n\t@prop()\n\tpublic thumbnailUrl?: string;\n\n\t@prop()\n\tpublic name?: string;\n}\n\n@modelOptions({\n\tschemaOptions: {\n\t\tcollection: 'messages',\n\t},\n})\n@index({ chatroom: 1, createdAt: -1 })\n@index({ sender: 1, senderType: 1 })\n@index({ isRead: 1, chatroom: 1 })\nexport class Message extends TimeStamps {\n\t@prop({ required: true, ref: () => Chatroom })\n\tpublic chatroom!: Ref<Chatroom>;\n\n\t@prop({ required: true, type: String })\n\tpublic content?: string;\n\n\t@prop({ required: true, type: String, enum: UserRef })\n\tpublic senderType!: UserRef;\n\n\t@prop({ type: () => [Media], default: [] })\n\tpublic media!: Media[];\n\n\t@prop({ refPath: 'senderType' })\n\tpublic sender!: Ref<User | Admin | Shop | Rider>;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isDelivered?: boolean;\n\n\t@prop({ type: Date })\n\tpublic deliveredAt?: Date;\n}\n"]}
|
|
@@ -9,6 +9,7 @@ import { StartEndTime, WorkHourSetting } from './shared/work-hour.model';
|
|
|
9
9
|
import { Tag } from './tag.model';
|
|
10
10
|
import { DeliveryInfo } from './embedded/delivery-info.model';
|
|
11
11
|
import { ShopSearchFields } from './embedded/shop-search-fields.model';
|
|
12
|
+
import { BestSellerCategory, FavouritesCategory } from './embedded/best-seller-category.model';
|
|
12
13
|
export declare class Shop extends TimeStamps {
|
|
13
14
|
shopId: string;
|
|
14
15
|
name: string;
|
|
@@ -37,6 +38,7 @@ export declare class Shop extends TimeStamps {
|
|
|
37
38
|
isShopDelivery?: boolean;
|
|
38
39
|
deliveryFee?: number;
|
|
39
40
|
minimumOrderAmount?: number;
|
|
41
|
+
orderCapacityEnabled?: boolean;
|
|
40
42
|
orderCapacity?: number;
|
|
41
43
|
shopActiveTimingsOfCurrentDate?: StartEndTime[];
|
|
42
44
|
deliveryInfo?: DeliveryInfo;
|
|
@@ -46,11 +48,8 @@ export declare class Shop extends TimeStamps {
|
|
|
46
48
|
riderNote?: string;
|
|
47
49
|
defaultPreparationTime?: number;
|
|
48
50
|
exchangeRate?: number;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
isBestSellerCategoryVisible?: boolean;
|
|
52
|
-
bestSellerCategoryTitle?: string;
|
|
53
|
-
orderCapacityEnabled: boolean;
|
|
51
|
+
bestSellerCategory?: BestSellerCategory;
|
|
52
|
+
favouritesCategory?: FavouritesCategory;
|
|
54
53
|
avgRating?: number;
|
|
55
54
|
ordersCount?: number;
|
|
56
55
|
customersCount?: number;
|
|
@@ -24,6 +24,7 @@ const shop_hooks_1 = require("../utilities/shop.hooks");
|
|
|
24
24
|
const shop_search_fields_model_1 = require("./embedded/shop-search-fields.model");
|
|
25
25
|
const id_generator_1 = require("../../../utilities/id-generator");
|
|
26
26
|
const _1 = require(".");
|
|
27
|
+
const best_seller_category_model_1 = require("./embedded/best-seller-category.model");
|
|
27
28
|
let Shop = class Shop extends defaultClasses_1.TimeStamps {
|
|
28
29
|
shopId;
|
|
29
30
|
name;
|
|
@@ -52,6 +53,7 @@ let Shop = class Shop extends defaultClasses_1.TimeStamps {
|
|
|
52
53
|
isShopDelivery;
|
|
53
54
|
deliveryFee;
|
|
54
55
|
minimumOrderAmount;
|
|
56
|
+
orderCapacityEnabled;
|
|
55
57
|
orderCapacity;
|
|
56
58
|
shopActiveTimingsOfCurrentDate;
|
|
57
59
|
deliveryInfo;
|
|
@@ -61,11 +63,8 @@ let Shop = class Shop extends defaultClasses_1.TimeStamps {
|
|
|
61
63
|
riderNote;
|
|
62
64
|
defaultPreparationTime;
|
|
63
65
|
exchangeRate;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
isBestSellerCategoryVisible;
|
|
67
|
-
bestSellerCategoryTitle;
|
|
68
|
-
orderCapacityEnabled;
|
|
66
|
+
bestSellerCategory;
|
|
67
|
+
favouritesCategory;
|
|
69
68
|
avgRating;
|
|
70
69
|
ordersCount;
|
|
71
70
|
customersCount;
|
|
@@ -187,7 +186,11 @@ __decorate([
|
|
|
187
186
|
__metadata("design:type", Number)
|
|
188
187
|
], Shop.prototype, "minimumOrderAmount", void 0);
|
|
189
188
|
__decorate([
|
|
190
|
-
(0, typegoose_1.prop)({ type:
|
|
189
|
+
(0, typegoose_1.prop)({ type: Boolean, default: false }),
|
|
190
|
+
__metadata("design:type", Boolean)
|
|
191
|
+
], Shop.prototype, "orderCapacityEnabled", void 0);
|
|
192
|
+
__decorate([
|
|
193
|
+
(0, typegoose_1.prop)({ type: Number }),
|
|
191
194
|
__metadata("design:type", Number)
|
|
192
195
|
], Shop.prototype, "orderCapacity", void 0);
|
|
193
196
|
__decorate([
|
|
@@ -219,29 +222,17 @@ __decorate([
|
|
|
219
222
|
__metadata("design:type", Number)
|
|
220
223
|
], Shop.prototype, "defaultPreparationTime", void 0);
|
|
221
224
|
__decorate([
|
|
222
|
-
(0, typegoose_1.prop)({ type: Number, default:
|
|
225
|
+
(0, typegoose_1.prop)({ type: Number, default: 0 }),
|
|
223
226
|
__metadata("design:type", Number)
|
|
224
227
|
], Shop.prototype, "exchangeRate", void 0);
|
|
225
228
|
__decorate([
|
|
226
|
-
(0, typegoose_1.prop)({
|
|
227
|
-
__metadata("design:type",
|
|
228
|
-
], Shop.prototype, "
|
|
229
|
+
(0, typegoose_1.prop)({ type: best_seller_category_model_1.BestSellerCategory, default: new best_seller_category_model_1.BestSellerCategory() }),
|
|
230
|
+
__metadata("design:type", best_seller_category_model_1.BestSellerCategory)
|
|
231
|
+
], Shop.prototype, "bestSellerCategory", void 0);
|
|
229
232
|
__decorate([
|
|
230
|
-
(0, typegoose_1.prop)({
|
|
231
|
-
__metadata("design:type",
|
|
232
|
-
], Shop.prototype, "
|
|
233
|
-
__decorate([
|
|
234
|
-
(0, typegoose_1.prop)({ required: false, type: () => Boolean }),
|
|
235
|
-
__metadata("design:type", Boolean)
|
|
236
|
-
], Shop.prototype, "isBestSellerCategoryVisible", void 0);
|
|
237
|
-
__decorate([
|
|
238
|
-
(0, typegoose_1.prop)({ required: false, type: () => String }),
|
|
239
|
-
__metadata("design:type", String)
|
|
240
|
-
], Shop.prototype, "bestSellerCategoryTitle", void 0);
|
|
241
|
-
__decorate([
|
|
242
|
-
(0, typegoose_1.prop)({ required: true, type: () => Boolean }),
|
|
243
|
-
__metadata("design:type", Boolean)
|
|
244
|
-
], Shop.prototype, "orderCapacityEnabled", void 0);
|
|
233
|
+
(0, typegoose_1.prop)({ type: best_seller_category_model_1.FavouritesCategory, default: new best_seller_category_model_1.FavouritesCategory() }),
|
|
234
|
+
__metadata("design:type", best_seller_category_model_1.FavouritesCategory)
|
|
235
|
+
], Shop.prototype, "favouritesCategory", void 0);
|
|
245
236
|
__decorate([
|
|
246
237
|
(0, typegoose_1.prop)({ default: 0, type: () => Number }),
|
|
247
238
|
__metadata("design:type", Number)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shop.model.js","sourceRoot":"/","sources":["libraries/mongo/models/shop.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAqF;AACrF,4EAAqE;AACrE,kDAA0F;AAC1F,+CAAsC;AACtC,wEAA8D;AAC9D,iDAAwC;AACxC,0DAAiD;AACjD,8DAAyE;AACzE,2CAAkC;AAClC,wEAA8D;AAC9D,wDAA4D;AAC5D,kFAAuE;AACvE,kEAA6D;AAC7D,wBAAiC;AAoB1B,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,2BAAU;IAE5B,MAAM,CAAS;IAGf,IAAI,CAAU;IAGd,SAAS,CAAU;IAGnB,KAAK,CAAU;IAGf,MAAM,CAAc;IAGpB,QAAQ,CAAY;IAGpB,MAAM,CAAU;IAGhB,KAAK,CAAa;IAGlB,UAAU,CAAU;IAGpB,WAAW,CAAU;IAGrB,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AE,CAAC;IAC/F,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE,EAAE,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IACrG,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IACrF,IAAA,eAAG,EAAO,MAAM,EAAE,KAAK,WAAW,IAAI;QACtC,MAAM,8BAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEnC,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;IAED,IAAA,eAAG,EAAO,MAAM,EAAE,KAAK;QACvB,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,GAAG,MAAM,IAAA,yBAAU,EAAC,eAAY,EAAE,kBAAW,CAAC,IAAI,CAAC,CAAC;QAChE,CAAC;IACF,CAAC,CAAC;GACW,IAAI,CAkJhB","sourcesContent":["import { modelOptions, prop, Ref, Severity, index, pre } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { CounterType, ItemType, ShopOnlineStatus, Status } from '../../../utilities/enum';\nimport { Brand } from './brand.model';\nimport { ShopDocument } from './embedded/shop-document.model';\nimport { Parent } from './parent.model';\nimport { Address } from './shared/address.model';\nimport { StartEndTime, WorkHourSetting } from './shared/work-hour.model';\nimport { Tag } from './tag.model';\nimport { DeliveryInfo } from './embedded/delivery-info.model';\nimport { handleShopPreSave } from '../utilities/shop.hooks';\nimport { ShopSearchFields } from './embedded/shop-search-fields.model';\nimport { generateId } from '../../../utilities/id-generator';\nimport { CounterModel } from '.';\n\n@modelOptions({\n\tschemaOptions: { collection: 'shops' },\n\toptions: { allowMixed: Severity.ALLOW },\n})\n@index({ name: 1, itemType: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@index({ parent: 1, status: 1, isVisibleToUser: 1 }, { partialFilterExpression: { deletedAt: null } })\n@index({ status: 1, createdAt: -1 }, { partialFilterExpression: { deletedAt: null } })\n@pre<Shop>('save', async function (next) {\n\tawait handleShopPreSave.call(this);\n\n\tnext();\n})\n\n@pre<Shop>('save', async function () {\n\tif (this.isNew) {\n\t\tthis.shopId = await generateId(CounterModel, CounterType.SHOP);\n\t}\n})\nexport class Shop extends TimeStamps {\n\t@prop({ type: String, unique: true, index: true })\n\tpublic shopId: string;\n\n\t@prop({ required: true, type: String })\n\tpublic name!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic ownerName!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic email!: string;\n\n\t@prop({ required: true, ref: () => Parent })\n\tpublic parent: Ref<Parent>;\n\n\t@prop({ required: true, type: String, enum: ItemType })\n\tpublic itemType!: ItemType;\n\n\t@prop({ required: true, type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status!: Status;\n\n\t@prop({ required: true, ref: () => Brand })\n\tpublic brand: Ref<Brand>;\n\n\t@prop({ type: Number, default: 1, min: 1, max: 4 })\n\tpublic priceRange?: number;\n\n\t@prop({ required: true, type: String })\n\tpublic phoneNumber!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic userPhoneNumber!: string;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic additionalPhoneNumbers?: string[];\n\n\t@prop({ type: String, maxlength: 100 })\n\tpublic bobContactName?: string;\n\n\t@prop({ type: String, maxlength: 15 })\n\tpublic bobContactPhoneNumber?: string;\n\n\t@prop({ required: true, type: Address })\n\tpublic address!: Address;\n\n\t@prop({ type: String })\n\tpublic logo?: string;\n\n\t@prop({ type: String })\n\tpublic banner?: string;\n\n\t@prop({ type: ShopDocument })\n\tpublic document?: ShopDocument;\n\n\t@prop({\n\t\ttype: String,\n\t\tenum: ShopOnlineStatus,\n\t\tdefault: ShopOnlineStatus.OFFLINE,\n\t})\n\tpublic onlineStatus?: ShopOnlineStatus;\n\n\t@prop({ type: WorkHourSetting })\n\tpublic workHourSetting?: WorkHourSetting;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic dietaries?: string[];\n\n\t@prop({ ref: () => Tag, default: [] })\n\tpublic tags?: Ref<Tag>[];\n\n\t@prop({ required: true, type: Boolean })\n\tpublic isBeirutAuthentic!: boolean;\n\n\t@prop({ required: true, type: Boolean })\n\tpublic isVisibleToUser!: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isShopDelivery?: boolean;\n\n\t@prop({ type: Number })\n\tpublic deliveryFee?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic minimumOrderAmount?: number;\n\n\t@prop({ type: Number, default: Infinity })\n\tpublic orderCapacity?: number;\n\n\t@prop({ type: () => [StartEndTime], default: [] })\n\tpublic shopActiveTimingsOfCurrentDate?: StartEndTime[];\n\n\t@prop({ type: DeliveryInfo })\n\tpublic deliveryInfo?: DeliveryInfo;\n\n\t@prop({ type: Number })\n\tpublic sortingOrder?: number;\n\n\t// Setting\n\t@prop({ type: Boolean, default: false })\n\tpublic allowSpecialInstructions?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isRiderNoteVisible?: boolean;\n\n\t@prop({ type: String })\n\tpublic riderNote?: string;\n\n\t@prop({ type: Number, default: 10 })\n\tpublic defaultPreparationTime?: number;\n\n\t@prop({ type: Number, default: null })\n\texchangeRate?: number;\n\n\t@prop({ required: false, type: () => Boolean })\n\tpublic isFavouriteCategoryVisible?: boolean;\n\n\t@prop({ required: false, type: () => String })\n\tpublic favouriteCategoryTitle?: string;\n\n\t@prop({ required: false, type: () => Boolean })\n\tpublic isBestSellerCategoryVisible?: boolean;\n\n\t@prop({ required: false, type: () => String })\n\tpublic bestSellerCategoryTitle?: string;\n\n\t@prop({ required: true, type: () => Boolean })\n\tpublic orderCapacityEnabled!: boolean;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic avgRating?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic ordersCount?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic customersCount?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic vat_reg_number?: number;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic fcmTokens?: string[];\n\n\t@prop({ type: ShopSearchFields })\n\tpublic searchFields?: ShopSearchFields\n}\n"]}
|
|
1
|
+
{"version":3,"file":"shop.model.js","sourceRoot":"/","sources":["libraries/mongo/models/shop.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAqF;AACrF,4EAAqE;AACrE,kDAA0F;AAC1F,+CAAsC;AACtC,wEAA8D;AAC9D,iDAAwC;AACxC,0DAAiD;AACjD,8DAAyE;AACzE,2CAAkC;AAClC,wEAA8D;AAC9D,wDAA4D;AAC5D,kFAAuE;AACvE,kEAA6D;AAC7D,wBAAiC;AACjC,sFAA+F;AAmBxF,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,2BAAU;IAE5B,MAAM,CAAS;IAGf,IAAI,CAAU;IAGd,SAAS,CAAU;IAGnB,KAAK,CAAU;IAGf,MAAM,CAAc;IAGpB,QAAQ,CAAY;IAGpB,MAAM,CAAU;IAGhB,KAAK,CAAa;IAGlB,UAAU,CAAU;IAGpB,WAAW,CAAU;IAGrB,eAAe,CAAU;IAGzB,sBAAsB,CAAY;IAGlC,cAAc,CAAU;IAGxB,qBAAqB,CAAU;IAG/B,OAAO,CAAW;IAGlB,IAAI,CAAU;IAGd,MAAM,CAAU;IAGhB,QAAQ,CAAgB;IAOxB,YAAY,CAAoB;IAGhC,eAAe,CAAmB;IAGlC,SAAS,CAAY;IAGrB,IAAI,CAAc;IAGlB,iBAAiB,CAAW;IAG5B,eAAe,CAAW;IAG1B,cAAc,CAAW;IAGzB,WAAW,CAAU;IAGrB,kBAAkB,CAAU;IAG5B,oBAAoB,CAAW;IAG/B,aAAa,CAAU;IAGvB,8BAA8B,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F,CAAC,CAAC;GACW,IAAI,CA8IhB","sourcesContent":["import { modelOptions, prop, Ref, Severity, index, pre } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { CounterType, ItemType, ShopOnlineStatus, Status } from '../../../utilities/enum';\nimport { Brand } from './brand.model';\nimport { ShopDocument } from './embedded/shop-document.model';\nimport { Parent } from './parent.model';\nimport { Address } from './shared/address.model';\nimport { StartEndTime, WorkHourSetting } from './shared/work-hour.model';\nimport { Tag } from './tag.model';\nimport { DeliveryInfo } from './embedded/delivery-info.model';\nimport { handleShopPreSave } from '../utilities/shop.hooks';\nimport { ShopSearchFields } from './embedded/shop-search-fields.model';\nimport { generateId } from '../../../utilities/id-generator';\nimport { CounterModel } from '.';\nimport { BestSellerCategory, FavouritesCategory } from './embedded/best-seller-category.model';\n\n@modelOptions({\n\tschemaOptions: { collection: 'shops' },\n\toptions: { allowMixed: Severity.ALLOW },\n})\n@index({ name: 1, itemType: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@index({ parent: 1, status: 1, isVisibleToUser: 1 }, { partialFilterExpression: { deletedAt: null } })\n@index({ status: 1, createdAt: -1 }, { partialFilterExpression: { deletedAt: null } })\n@pre<Shop>('save', async function (next) {\n\tawait handleShopPreSave.call(this);\n\n\tnext();\n})\n@pre<Shop>('save', async function () {\n\tif (this.isNew) {\n\t\tthis.shopId = await generateId(CounterModel, CounterType.SHOP);\n\t}\n})\nexport class Shop extends TimeStamps {\n\t@prop({ type: String, unique: true, index: true })\n\tpublic shopId: string;\n\n\t@prop({ required: true, type: String })\n\tpublic name!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic ownerName!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic email!: string;\n\n\t@prop({ required: true, ref: () => Parent })\n\tpublic parent: Ref<Parent>;\n\n\t@prop({ required: true, type: String, enum: ItemType })\n\tpublic itemType!: ItemType;\n\n\t@prop({ required: true, type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status!: Status;\n\n\t@prop({ required: true, ref: () => Brand })\n\tpublic brand: Ref<Brand>;\n\n\t@prop({ type: Number, default: 1, min: 1, max: 4 })\n\tpublic priceRange?: number;\n\n\t@prop({ required: true, type: String })\n\tpublic phoneNumber!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic userPhoneNumber!: string;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic additionalPhoneNumbers?: string[];\n\n\t@prop({ type: String, maxlength: 100 })\n\tpublic bobContactName?: string;\n\n\t@prop({ type: String, maxlength: 15 })\n\tpublic bobContactPhoneNumber?: string;\n\n\t@prop({ required: true, type: Address })\n\tpublic address!: Address;\n\n\t@prop({ type: String })\n\tpublic logo?: string;\n\n\t@prop({ type: String })\n\tpublic banner?: string;\n\n\t@prop({ type: ShopDocument })\n\tpublic document?: ShopDocument;\n\n\t@prop({\n\t\ttype: String,\n\t\tenum: ShopOnlineStatus,\n\t\tdefault: ShopOnlineStatus.OFFLINE,\n\t})\n\tpublic onlineStatus?: ShopOnlineStatus;\n\n\t@prop({ type: WorkHourSetting })\n\tpublic workHourSetting?: WorkHourSetting;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic dietaries?: string[];\n\n\t@prop({ ref: () => Tag, default: [] })\n\tpublic tags?: Ref<Tag>[];\n\n\t@prop({ required: true, type: Boolean })\n\tpublic isBeirutAuthentic!: boolean;\n\n\t@prop({ required: true, type: Boolean })\n\tpublic isVisibleToUser!: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isShopDelivery?: boolean;\n\n\t@prop({ type: Number })\n\tpublic deliveryFee?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic minimumOrderAmount?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic orderCapacityEnabled?: boolean;\n\n\t@prop({ type: Number })\n\tpublic orderCapacity?: number;\n\n\t@prop({ type: () => [StartEndTime], default: [] })\n\tpublic shopActiveTimingsOfCurrentDate?: StartEndTime[];\n\n\t@prop({ type: DeliveryInfo })\n\tpublic deliveryInfo?: DeliveryInfo;\n\n\t@prop({ type: Number })\n\tpublic sortingOrder?: number;\n\n\t// Setting\n\t@prop({ type: Boolean, default: false })\n\tpublic allowSpecialInstructions?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isRiderNoteVisible?: boolean;\n\n\t@prop({ type: String })\n\tpublic riderNote?: string;\n\n\t@prop({ type: Number, default: 10 })\n\tpublic defaultPreparationTime?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic exchangeRate?: number;\n\n\t// Best seller category\n\t@prop({ type: BestSellerCategory, default: new BestSellerCategory() })\n\tpublic bestSellerCategory?: BestSellerCategory;\n\n\t// Favourites category\n\t@prop({ type: FavouritesCategory, default: new FavouritesCategory() })\n\tpublic favouritesCategory?: FavouritesCategory;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic avgRating?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic ordersCount?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic customersCount?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic vat_reg_number?: number;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic fcmTokens?: string[];\n\n\t@prop({ type: ShopSearchFields })\n\tpublic searchFields?: ShopSearchFields;\n}\n"]}
|
|
@@ -32,7 +32,7 @@ export declare class User extends TimeStamps {
|
|
|
32
32
|
isPhoneVerified?: boolean;
|
|
33
33
|
onlineStatus?: OnlineStatus;
|
|
34
34
|
fcmTokens?: string[];
|
|
35
|
-
static updateWallet(this: ReturnModelType<typeof User>, userId: string, amount: number): Promise<(import("mongoose").Document<unknown, import("@typegoose/typegoose/lib/types").BeAnObject, User, import("@typegoose/typegoose/lib/types").BeAnyObject> & Omit<User & {
|
|
35
|
+
static updateWallet(this: ReturnModelType<typeof User>, userId: string, amount: number): Promise<(import("mongoose").Document<unknown, import("@typegoose/typegoose/lib/types").BeAnObject, User, import("@typegoose/typegoose/lib/types").BeAnyObject, {}> & Omit<User & {
|
|
36
36
|
_id: import("mongoose").Types.ObjectId;
|
|
37
37
|
} & {
|
|
38
38
|
__v: number;
|
|
@@ -7,7 +7,7 @@ import { StartEndTime, WorkHourSetting } from './shared/work-hour.model';
|
|
|
7
7
|
import { Tag } from './tag.model';
|
|
8
8
|
import { Zone } from './zone.model';
|
|
9
9
|
import { VendorParent } from '.';
|
|
10
|
-
import { Service } from
|
|
10
|
+
import { Service } from './service.model';
|
|
11
11
|
import { ServiceOrderSettings } from './embedded/service-order-settings.model';
|
|
12
12
|
import { CleaningServiceSettings } from './embedded/cleaning-service-settings.model';
|
|
13
13
|
export declare class Vendor extends TimeStamps {
|
|
@@ -30,9 +30,6 @@ export declare class Vendor extends TimeStamps {
|
|
|
30
30
|
tags?: Ref<Tag>[];
|
|
31
31
|
isVisibleToUser: boolean;
|
|
32
32
|
sortingOrder?: number;
|
|
33
|
-
isFavouriteCategoryVisible?: boolean;
|
|
34
|
-
favouriteCategoryTitle?: string;
|
|
35
|
-
isBestSellerCategoryVisible?: boolean;
|
|
36
33
|
avgRating?: number;
|
|
37
34
|
ordersCount?: number;
|
|
38
35
|
customersCount?: number;
|
|
@@ -46,9 +46,6 @@ let Vendor = class Vendor extends defaultClasses_1.TimeStamps {
|
|
|
46
46
|
tags;
|
|
47
47
|
isVisibleToUser;
|
|
48
48
|
sortingOrder;
|
|
49
|
-
isFavouriteCategoryVisible;
|
|
50
|
-
favouriteCategoryTitle;
|
|
51
|
-
isBestSellerCategoryVisible;
|
|
52
49
|
avgRating;
|
|
53
50
|
ordersCount;
|
|
54
51
|
customersCount;
|
|
@@ -133,18 +130,6 @@ __decorate([
|
|
|
133
130
|
(0, typegoose_1.prop)({ type: Number }),
|
|
134
131
|
__metadata("design:type", Number)
|
|
135
132
|
], Vendor.prototype, "sortingOrder", void 0);
|
|
136
|
-
__decorate([
|
|
137
|
-
(0, typegoose_1.prop)({ required: false, type: () => Boolean }),
|
|
138
|
-
__metadata("design:type", Boolean)
|
|
139
|
-
], Vendor.prototype, "isFavouriteCategoryVisible", void 0);
|
|
140
|
-
__decorate([
|
|
141
|
-
(0, typegoose_1.prop)({ required: false, type: () => String }),
|
|
142
|
-
__metadata("design:type", String)
|
|
143
|
-
], Vendor.prototype, "favouriteCategoryTitle", void 0);
|
|
144
|
-
__decorate([
|
|
145
|
-
(0, typegoose_1.prop)({ required: false, type: () => Boolean }),
|
|
146
|
-
__metadata("design:type", Boolean)
|
|
147
|
-
], Vendor.prototype, "isBestSellerCategoryVisible", void 0);
|
|
148
133
|
__decorate([
|
|
149
134
|
(0, typegoose_1.prop)({ default: 0, type: () => Number }),
|
|
150
135
|
__metadata("design:type", Number)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vendor.model.js","sourceRoot":"/","sources":["libraries/mongo/models/vendor.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAAqF;AACrF,4EAAqE;AACrE,kDAAiD;AACjD,wEAA8D;AAC9D,0DAAiD;AACjD,8DAAyE;AACzE,2CAAkC;AAClC,6CAAoC;AACpC,wBAA8C;AAC9C,sDAA8B;AAC9B,mDAA0C;AAC1C,0FAA+E;AAC/E,gGAAqF;AA6C9E,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,2BAAU;IAE9B,IAAI,CAAU;IAGd,SAAS,CAAU;IAGnB,KAAK,CAAU;IAGf,IAAI,CAAU;IAGd,MAAM,CAAoB;IAG1B,OAAO,
|
|
1
|
+
{"version":3,"file":"vendor.model.js","sourceRoot":"/","sources":["libraries/mongo/models/vendor.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAAqF;AACrF,4EAAqE;AACrE,kDAAiD;AACjD,wEAA8D;AAC9D,0DAAiD;AACjD,8DAAyE;AACzE,2CAAkC;AAClC,6CAAoC;AACpC,wBAA8C;AAC9C,sDAA8B;AAC9B,mDAA0C;AAC1C,0FAA+E;AAC/E,gGAAqF;AA6C9E,IAAM,MAAM,GAAZ,MAAM,MAAO,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tB,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;GACW,MAAM,CA2ElB","sourcesContent":["import { modelOptions, prop, Ref, Severity, Index, pre } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { Status } from '../../../utilities/enum';\nimport { ShopDocument } from './embedded/shop-document.model';\nimport { Address } from './shared/address.model';\nimport { StartEndTime, WorkHourSetting } from './shared/work-hour.model';\nimport { Tag } from './tag.model';\nimport { Zone } from './zone.model';\nimport { VendorParent, VendorModel } from '.';\nimport slugify from 'slugify';\nimport { Service } from './service.model';\nimport { ServiceOrderSettings } from './embedded/service-order-settings.model';\nimport { CleaningServiceSettings } from './embedded/cleaning-service-settings.model';\n\n@modelOptions({\n\tschemaOptions: { collection: 'vendors' },\n\toptions: { allowMixed: Severity.ALLOW },\n})\n@Index({ name: 1, itemType: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@Index({ parent: 1, status: 1, isVisibleToUser: 1, deletedAt: 1 })\n@pre<Vendor>('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 VendorModel.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\ttry {\n\t\tif (this.isNew) {\n\t\t\tconst baseSlug = slugify(this.name, { lower: true, strict: true });\n\t\t\tlet slug = baseSlug;\n\t\t\tlet count = 0;\n\t\t\twhile (await VendorModel.exists({ slug })) {\n\t\t\t\tcount++;\n\t\t\t\tslug = `${baseSlug}-${count}`;\n\t\t\t}\n\t\t\tthis.slug = slug;\n\t\t}\n\t\tnext();\n\t} catch (error) {\n\t\tnext(error as Error);\n\t}\n\tnext();\n})\nexport class Vendor extends TimeStamps {\n\t@prop({ required: true, type: String })\n\tpublic name!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic ownerName!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic email!: string;\n\n\t@prop({ unique: true, type: String })\n\tpublic slug?: string;\n\n\t@prop({ required: true, ref: () => VendorParent })\n\tpublic parent: Ref<VendorParent>;\n\n\t@prop({ required: true, ref: () => Service })\n\tpublic service: Ref<Service>;\n\n\t@prop({ required: true, type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status!: Status;\n\n\t@prop({ required: true, type: String })\n\tpublic phoneNumber!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic userPhoneNumber!: string;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic additionalPhoneNumbers?: string[];\n\n\t@prop({ required: true, type: Address })\n\tpublic address!: Address;\n\n\t@prop({ required: true, ref: () => Zone, type: () => [String] })\n\tpublic zone!: Ref<Zone>[];\n\n\t@prop({ type: String })\n\tpublic logo?: string;\n\n\t@prop({ type: String })\n\tpublic banner?: string;\n\n\t@prop({ type: ShopDocument })\n\tpublic document?: ShopDocument;\n\n\t@prop({ type: () => [StartEndTime], default: [] })\n\tpublic vendorActiveTimingsOfCurrentDate?: StartEndTime[];\n\n\t@prop({ ref: () => Tag, default: [] })\n\tpublic tags?: Ref<Tag>[];\n\n\t@prop({ required: true, type: Boolean })\n\tpublic isVisibleToUser!: boolean;\n\n\t@prop({ type: Number })\n\tpublic sortingOrder?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic avgRating?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic ordersCount?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic customersCount?: number;\n\n\t@prop({ type: () => ServiceOrderSettings })\n\tpublic orderSettings?: ServiceOrderSettings;\n\n\t@prop({ type: () => CleaningServiceSettings })\n\tpublic cleaningServiceSettings?: CleaningServiceSettings;\n\n\t@prop({ type: WorkHourSetting })\n\tpublic workHourSetting?: WorkHourSetting;\n}\n"]}
|
|
@@ -28,36 +28,11 @@ export declare const REGISTRY: {
|
|
|
28
28
|
type: import("../../../utilities/enum").UserRef;
|
|
29
29
|
id: import("mongoose").Types.ObjectId;
|
|
30
30
|
}>;
|
|
31
|
-
content: import("zod").
|
|
32
|
-
media: import("zod").ZodArray<import("zod").ZodObject<{
|
|
33
|
-
mimeType: import("zod").ZodString | import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>;
|
|
34
|
-
mediaType: import("zod").ZodNativeEnum<typeof import("../../../utilities/enum").MediaType>;
|
|
35
|
-
mediaUrl: import("zod").ZodString | import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>;
|
|
36
|
-
thumbnailUrl: import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodOptional<import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>>;
|
|
37
|
-
name: import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodOptional<import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>>;
|
|
38
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
39
|
-
mediaType: import("../../../utilities/enum").MediaType;
|
|
40
|
-
mediaUrl: string;
|
|
41
|
-
mimeType: string;
|
|
42
|
-
name?: string | undefined;
|
|
43
|
-
thumbnailUrl?: string | undefined;
|
|
44
|
-
}, {
|
|
45
|
-
mediaType: import("../../../utilities/enum").MediaType;
|
|
46
|
-
mediaUrl: string;
|
|
47
|
-
mimeType: string;
|
|
48
|
-
name?: string | undefined;
|
|
49
|
-
thumbnailUrl?: string | undefined;
|
|
50
|
-
}>, "many">;
|
|
31
|
+
content: import("zod").ZodString | import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>;
|
|
51
32
|
chatroomId: import("zod").ZodOptional<import("zod").ZodEffects<import("zod").ZodType<import("mongoose").Types.ObjectId, import("zod").ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>>;
|
|
52
33
|
createdAt: import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodDate, Date, Date>, Date, Date>;
|
|
53
34
|
}, "strip", import("zod").ZodTypeAny, {
|
|
54
|
-
|
|
55
|
-
mediaType: import("../../../utilities/enum").MediaType;
|
|
56
|
-
mediaUrl: string;
|
|
57
|
-
mimeType: string;
|
|
58
|
-
name?: string | undefined;
|
|
59
|
-
thumbnailUrl?: string | undefined;
|
|
60
|
-
}[];
|
|
35
|
+
content: string;
|
|
61
36
|
_id: import("mongoose").Types.ObjectId;
|
|
62
37
|
createdAt: Date;
|
|
63
38
|
sender: {
|
|
@@ -66,16 +41,9 @@ export declare const REGISTRY: {
|
|
|
66
41
|
};
|
|
67
42
|
senderType: import("../../../utilities/enum").UserRef;
|
|
68
43
|
senderId: import("mongoose").Types.ObjectId;
|
|
69
|
-
content?: string | undefined;
|
|
70
44
|
chatroomId?: import("mongoose").Types.ObjectId | undefined;
|
|
71
45
|
}, {
|
|
72
|
-
|
|
73
|
-
mediaType: import("../../../utilities/enum").MediaType;
|
|
74
|
-
mediaUrl: string;
|
|
75
|
-
mimeType: string;
|
|
76
|
-
name?: string | undefined;
|
|
77
|
-
thumbnailUrl?: string | undefined;
|
|
78
|
-
}[];
|
|
46
|
+
content: string;
|
|
79
47
|
_id: import("mongoose").Types.ObjectId;
|
|
80
48
|
createdAt: Date;
|
|
81
49
|
sender: {
|
|
@@ -84,7 +52,6 @@ export declare const REGISTRY: {
|
|
|
84
52
|
};
|
|
85
53
|
senderType: import("../../../utilities/enum").UserRef;
|
|
86
54
|
senderId: import("mongoose").Types.ObjectId;
|
|
87
|
-
content?: string | undefined;
|
|
88
55
|
chatroomId?: import("mongoose").Types.ObjectId | undefined;
|
|
89
56
|
}>;
|
|
90
57
|
};
|
|
@@ -106,22 +73,8 @@ export declare const REGISTRY: {
|
|
|
106
73
|
content: string;
|
|
107
74
|
createdAt: Date;
|
|
108
75
|
}>;
|
|
109
|
-
media: import("zod").ZodArray<import("zod").ZodObject<{
|
|
110
|
-
mimeType: import("zod").ZodString | import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>;
|
|
111
|
-
mediaType: import("zod").ZodNativeEnum<typeof import("../../../utilities/enum").MediaType>;
|
|
112
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
113
|
-
mediaType: import("../../../utilities/enum").MediaType;
|
|
114
|
-
mimeType: string;
|
|
115
|
-
}, {
|
|
116
|
-
mediaType: import("../../../utilities/enum").MediaType;
|
|
117
|
-
mimeType: string;
|
|
118
|
-
}>, "many">;
|
|
119
76
|
unreadCount: import("zod").ZodNumber;
|
|
120
77
|
}, "strip", import("zod").ZodTypeAny, {
|
|
121
|
-
media: {
|
|
122
|
-
mediaType: import("../../../utilities/enum").MediaType;
|
|
123
|
-
mimeType: string;
|
|
124
|
-
}[];
|
|
125
78
|
lastMessage: {
|
|
126
79
|
content: string;
|
|
127
80
|
createdAt: Date;
|
|
@@ -129,10 +82,6 @@ export declare const REGISTRY: {
|
|
|
129
82
|
unreadCount: number;
|
|
130
83
|
chatroomId: import("mongoose").Types.ObjectId;
|
|
131
84
|
}, {
|
|
132
|
-
media: {
|
|
133
|
-
mediaType: import("../../../utilities/enum").MediaType;
|
|
134
|
-
mimeType: string;
|
|
135
|
-
}[];
|
|
136
85
|
lastMessage: {
|
|
137
86
|
content: string;
|
|
138
87
|
createdAt: Date;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
|
-
import { MediaType } from '../../../utilities/enum';
|
|
3
2
|
import { DTO } from '../../../utilities/validation';
|
|
4
3
|
import { BaseSocketEvent } from '../BaseSocketEvent';
|
|
5
4
|
export declare const ChatlistMessageSendSocketInputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
@@ -15,22 +14,8 @@ export declare const ChatlistMessageSendSocketOutputSchema: z.ZodObject<{
|
|
|
15
14
|
content: string;
|
|
16
15
|
createdAt: Date;
|
|
17
16
|
}>;
|
|
18
|
-
media: z.ZodArray<z.ZodObject<{
|
|
19
|
-
mimeType: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
20
|
-
mediaType: z.ZodNativeEnum<typeof MediaType>;
|
|
21
|
-
}, "strip", z.ZodTypeAny, {
|
|
22
|
-
mediaType: MediaType;
|
|
23
|
-
mimeType: string;
|
|
24
|
-
}, {
|
|
25
|
-
mediaType: MediaType;
|
|
26
|
-
mimeType: string;
|
|
27
|
-
}>, "many">;
|
|
28
17
|
unreadCount: z.ZodNumber;
|
|
29
18
|
}, "strip", z.ZodTypeAny, {
|
|
30
|
-
media: {
|
|
31
|
-
mediaType: MediaType;
|
|
32
|
-
mimeType: string;
|
|
33
|
-
}[];
|
|
34
19
|
lastMessage: {
|
|
35
20
|
content: string;
|
|
36
21
|
createdAt: Date;
|
|
@@ -38,10 +23,6 @@ export declare const ChatlistMessageSendSocketOutputSchema: z.ZodObject<{
|
|
|
38
23
|
unreadCount: number;
|
|
39
24
|
chatroomId: import("mongoose").Types.ObjectId;
|
|
40
25
|
}, {
|
|
41
|
-
media: {
|
|
42
|
-
mediaType: MediaType;
|
|
43
|
-
mimeType: string;
|
|
44
|
-
}[];
|
|
45
26
|
lastMessage: {
|
|
46
27
|
content: string;
|
|
47
28
|
createdAt: Date;
|
|
@@ -65,22 +46,8 @@ export declare class ChatlistMessageSendSocketEvent extends BaseSocketEvent<type
|
|
|
65
46
|
content: string;
|
|
66
47
|
createdAt: Date;
|
|
67
48
|
}>;
|
|
68
|
-
media: z.ZodArray<z.ZodObject<{
|
|
69
|
-
mimeType: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
70
|
-
mediaType: z.ZodNativeEnum<typeof MediaType>;
|
|
71
|
-
}, "strip", z.ZodTypeAny, {
|
|
72
|
-
mediaType: MediaType;
|
|
73
|
-
mimeType: string;
|
|
74
|
-
}, {
|
|
75
|
-
mediaType: MediaType;
|
|
76
|
-
mimeType: string;
|
|
77
|
-
}>, "many">;
|
|
78
49
|
unreadCount: z.ZodNumber;
|
|
79
50
|
}, "strip", z.ZodTypeAny, {
|
|
80
|
-
media: {
|
|
81
|
-
mediaType: MediaType;
|
|
82
|
-
mimeType: string;
|
|
83
|
-
}[];
|
|
84
51
|
lastMessage: {
|
|
85
52
|
content: string;
|
|
86
53
|
createdAt: Date;
|
|
@@ -88,10 +55,6 @@ export declare class ChatlistMessageSendSocketEvent extends BaseSocketEvent<type
|
|
|
88
55
|
unreadCount: number;
|
|
89
56
|
chatroomId: import("mongoose").Types.ObjectId;
|
|
90
57
|
}, {
|
|
91
|
-
media: {
|
|
92
|
-
mediaType: MediaType;
|
|
93
|
-
mimeType: string;
|
|
94
|
-
}[];
|
|
95
58
|
lastMessage: {
|
|
96
59
|
content: string;
|
|
97
60
|
createdAt: Date;
|
|
@@ -15,10 +15,6 @@ exports.ChatlistMessageSendSocketOutputSchema = zod_1.default.object({
|
|
|
15
15
|
content: validation_1.ZodValidation.string(),
|
|
16
16
|
createdAt: validation_1.ZodValidation.coerce.date(),
|
|
17
17
|
}),
|
|
18
|
-
media: zod_1.default.array(zod_1.default.object({
|
|
19
|
-
mimeType: validation_1.ZodValidation.string('mimeType'),
|
|
20
|
-
mediaType: validation_1.ZodValidation.enumType(enum_1.MediaType, 'mediaType'),
|
|
21
|
-
})),
|
|
22
18
|
unreadCount: validation_1.ZodValidation.number(),
|
|
23
19
|
});
|
|
24
20
|
class ChatlistMessageSendSocketEvent extends BaseSocketEvent_1.BaseSocketEvent {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatlist-message-send.socket.event.js","sourceRoot":"/","sources":["libraries/socket/events/chatlist-message-send.socket.event.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAoB;AACpB,
|
|
1
|
+
{"version":3,"file":"chatlist-message-send.socket.event.js","sourceRoot":"/","sources":["libraries/socket/events/chatlist-message-send.socket.event.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAoB;AACpB,kDAAqF;AACrF,8DAAmE;AACnE,wDAAqD;AAExC,QAAA,oCAAoC,GAAG,aAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AACpD,QAAA,qCAAqC,GAAG,aAAC,CAAC,MAAM,CAAC;IAC7D,UAAU,EAAE,0BAAa,CAAC,MAAM,CAAC,QAAQ,EAAE;IAC3C,WAAW,EAAE,aAAC,CAAC,MAAM,CAAC;QACrB,OAAO,EAAE,0BAAa,CAAC,MAAM,EAAE;QAC/B,SAAS,EAAE,0BAAa,CAAC,MAAM,CAAC,IAAI,EAAE;KACtC,CAAC;IACF,WAAW,EAAE,0BAAa,CAAC,MAAM,EAAE;CACnC,CAAC,CAAC;AAIH,MAAa,8BAA+B,SAAQ,iCAGnD;IACA,MAAM,CAAU,OAAO,GAAG;QACzB,KAAK,EAAE,4CAAoC;QAC3C,MAAM,EAAE,6CAAqC;KAC7C,CAAC;IAEF,YAAY,OAA2C;QACtD,KAAK,CAAC,sBAAe,CAAC,yBAAyB,EAAE,8BAA8B,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACnG,CAAC;;AAXF,wEAYC","sourcesContent":["import z from 'zod';\nimport { PushNotificationEventType, SocketEventType } from '../../../utilities/enum';\nimport { DTO, ZodValidation } from '../../../utilities/validation';\nimport { BaseSocketEvent } from '../BaseSocketEvent';\n\nexport const ChatlistMessageSendSocketInputSchema = z.object({});\nexport const ChatlistMessageSendSocketOutputSchema = z.object({\n\tchatroomId: ZodValidation.coerce.objectId(),\n\tlastMessage: z.object({\n\t\tcontent: ZodValidation.string(),\n\t\tcreatedAt: ZodValidation.coerce.date(),\n\t}),\n\tunreadCount: ZodValidation.number(),\n});\n\nexport type ChatlistMessageSendSocketOutputDTO = DTO<typeof ChatlistMessageSendSocketOutputSchema>;\n\nexport class ChatlistMessageSendSocketEvent extends BaseSocketEvent<\n\ttypeof ChatlistMessageSendSocketInputSchema,\n\ttypeof ChatlistMessageSendSocketOutputSchema\n> {\n\tstatic readonly schemas = {\n\t\tinput: ChatlistMessageSendSocketInputSchema,\n\t\toutput: ChatlistMessageSendSocketOutputSchema,\n\t};\n\n\tconstructor(payload: ChatlistMessageSendSocketOutputDTO) {\n\t\tsuper(SocketEventType.CHATLIST_MESSAGE_RECEIVED, ChatlistMessageSendSocketEvent.schemas, payload);\n\t}\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { UserRef } from '../../../utilities/enum';
|
|
3
3
|
import { DTO } from '../../../utilities/validation';
|
|
4
4
|
import { BaseSocketEvent } from '../BaseSocketEvent';
|
|
5
5
|
import { NotificationSocketEvent } from './notification.socket.event';
|
|
@@ -24,36 +24,11 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
|
|
|
24
24
|
type: UserRef;
|
|
25
25
|
id: import("mongoose").Types.ObjectId;
|
|
26
26
|
}>;
|
|
27
|
-
content: z.
|
|
28
|
-
media: z.ZodArray<z.ZodObject<{
|
|
29
|
-
mimeType: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
30
|
-
mediaType: z.ZodNativeEnum<typeof MediaType>;
|
|
31
|
-
mediaUrl: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
32
|
-
thumbnailUrl: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
33
|
-
name: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
34
|
-
}, "strip", z.ZodTypeAny, {
|
|
35
|
-
mediaType: MediaType;
|
|
36
|
-
mediaUrl: string;
|
|
37
|
-
mimeType: string;
|
|
38
|
-
name?: string | undefined;
|
|
39
|
-
thumbnailUrl?: string | undefined;
|
|
40
|
-
}, {
|
|
41
|
-
mediaType: MediaType;
|
|
42
|
-
mediaUrl: string;
|
|
43
|
-
mimeType: string;
|
|
44
|
-
name?: string | undefined;
|
|
45
|
-
thumbnailUrl?: string | undefined;
|
|
46
|
-
}>, "many">;
|
|
27
|
+
content: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
47
28
|
chatroomId: z.ZodOptional<z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>>;
|
|
48
29
|
createdAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
|
|
49
30
|
}, "strip", z.ZodTypeAny, {
|
|
50
|
-
|
|
51
|
-
mediaType: MediaType;
|
|
52
|
-
mediaUrl: string;
|
|
53
|
-
mimeType: string;
|
|
54
|
-
name?: string | undefined;
|
|
55
|
-
thumbnailUrl?: string | undefined;
|
|
56
|
-
}[];
|
|
31
|
+
content: string;
|
|
57
32
|
_id: import("mongoose").Types.ObjectId;
|
|
58
33
|
createdAt: Date;
|
|
59
34
|
sender: {
|
|
@@ -62,16 +37,9 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
|
|
|
62
37
|
};
|
|
63
38
|
senderType: UserRef;
|
|
64
39
|
senderId: import("mongoose").Types.ObjectId;
|
|
65
|
-
content?: string | undefined;
|
|
66
40
|
chatroomId?: import("mongoose").Types.ObjectId | undefined;
|
|
67
41
|
}, {
|
|
68
|
-
|
|
69
|
-
mediaType: MediaType;
|
|
70
|
-
mediaUrl: string;
|
|
71
|
-
mimeType: string;
|
|
72
|
-
name?: string | undefined;
|
|
73
|
-
thumbnailUrl?: string | undefined;
|
|
74
|
-
}[];
|
|
42
|
+
content: string;
|
|
75
43
|
_id: import("mongoose").Types.ObjectId;
|
|
76
44
|
createdAt: Date;
|
|
77
45
|
sender: {
|
|
@@ -80,7 +48,6 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
|
|
|
80
48
|
};
|
|
81
49
|
senderType: UserRef;
|
|
82
50
|
senderId: import("mongoose").Types.ObjectId;
|
|
83
|
-
content?: string | undefined;
|
|
84
51
|
chatroomId?: import("mongoose").Types.ObjectId | undefined;
|
|
85
52
|
}>;
|
|
86
53
|
export type ChatroomMessageSendSocketOutputDTO = DTO<typeof ChatroomMessageSendOutputSchema>;
|
|
@@ -108,36 +75,11 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
|
|
|
108
75
|
type: UserRef;
|
|
109
76
|
id: import("mongoose").Types.ObjectId;
|
|
110
77
|
}>;
|
|
111
|
-
content: z.
|
|
112
|
-
media: z.ZodArray<z.ZodObject<{
|
|
113
|
-
mimeType: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
114
|
-
mediaType: z.ZodNativeEnum<typeof MediaType>;
|
|
115
|
-
mediaUrl: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
116
|
-
thumbnailUrl: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
117
|
-
name: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
118
|
-
}, "strip", z.ZodTypeAny, {
|
|
119
|
-
mediaType: MediaType;
|
|
120
|
-
mediaUrl: string;
|
|
121
|
-
mimeType: string;
|
|
122
|
-
name?: string | undefined;
|
|
123
|
-
thumbnailUrl?: string | undefined;
|
|
124
|
-
}, {
|
|
125
|
-
mediaType: MediaType;
|
|
126
|
-
mediaUrl: string;
|
|
127
|
-
mimeType: string;
|
|
128
|
-
name?: string | undefined;
|
|
129
|
-
thumbnailUrl?: string | undefined;
|
|
130
|
-
}>, "many">;
|
|
78
|
+
content: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
131
79
|
chatroomId: z.ZodOptional<z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>>;
|
|
132
80
|
createdAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
|
|
133
81
|
}, "strip", z.ZodTypeAny, {
|
|
134
|
-
|
|
135
|
-
mediaType: MediaType;
|
|
136
|
-
mediaUrl: string;
|
|
137
|
-
mimeType: string;
|
|
138
|
-
name?: string | undefined;
|
|
139
|
-
thumbnailUrl?: string | undefined;
|
|
140
|
-
}[];
|
|
82
|
+
content: string;
|
|
141
83
|
_id: import("mongoose").Types.ObjectId;
|
|
142
84
|
createdAt: Date;
|
|
143
85
|
sender: {
|
|
@@ -146,16 +88,9 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
|
|
|
146
88
|
};
|
|
147
89
|
senderType: UserRef;
|
|
148
90
|
senderId: import("mongoose").Types.ObjectId;
|
|
149
|
-
content?: string | undefined;
|
|
150
91
|
chatroomId?: import("mongoose").Types.ObjectId | undefined;
|
|
151
92
|
}, {
|
|
152
|
-
|
|
153
|
-
mediaType: MediaType;
|
|
154
|
-
mediaUrl: string;
|
|
155
|
-
mimeType: string;
|
|
156
|
-
name?: string | undefined;
|
|
157
|
-
thumbnailUrl?: string | undefined;
|
|
158
|
-
}[];
|
|
93
|
+
content: string;
|
|
159
94
|
_id: import("mongoose").Types.ObjectId;
|
|
160
95
|
createdAt: Date;
|
|
161
96
|
sender: {
|
|
@@ -164,7 +99,6 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
|
|
|
164
99
|
};
|
|
165
100
|
senderType: UserRef;
|
|
166
101
|
senderId: import("mongoose").Types.ObjectId;
|
|
167
|
-
content?: string | undefined;
|
|
168
102
|
chatroomId?: import("mongoose").Types.ObjectId | undefined;
|
|
169
103
|
}>;
|
|
170
104
|
};
|
|
@@ -20,14 +20,7 @@ exports.ChatroomMessageSendOutputSchema = zod_1.default.object({
|
|
|
20
20
|
id: validation_1.ZodValidation.coerce.objectId('sender.id'),
|
|
21
21
|
type: validation_1.ZodValidation.enumType(enum_1.UserRef, 'sender.type'),
|
|
22
22
|
}),
|
|
23
|
-
content: validation_1.ZodValidation.string('content', { minLength: 1, maxLength: 1000 })
|
|
24
|
-
media: zod_1.default.array(zod_1.default.object({
|
|
25
|
-
mimeType: validation_1.ZodValidation.string('mimeType'),
|
|
26
|
-
mediaType: validation_1.ZodValidation.enumType(enum_1.MediaType, 'mediaType'),
|
|
27
|
-
mediaUrl: validation_1.ZodValidation.string('url'),
|
|
28
|
-
thumbnailUrl: validation_1.ZodValidation.string('thumbnailUrl').optional(),
|
|
29
|
-
name: validation_1.ZodValidation.string('name').optional(),
|
|
30
|
-
})),
|
|
23
|
+
content: validation_1.ZodValidation.string('content', { minLength: 1, maxLength: 1000 }),
|
|
31
24
|
chatroomId: validation_1.ZodValidation.coerce.objectId('chatroomId').optional(),
|
|
32
25
|
createdAt: validation_1.ZodValidation.coerce.date(),
|
|
33
26
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatroom-message-send.socket.event.js","sourceRoot":"/","sources":["libraries/socket/events/chatroom-message-send.socket.event.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAoB;AACpB,
|
|
1
|
+
{"version":3,"file":"chatroom-message-send.socket.event.js","sourceRoot":"/","sources":["libraries/socket/events/chatroom-message-send.socket.event.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAoB;AACpB,kDAAmE;AACnE,8DAA6E;AAC7E,wDAAqD;AACrD,2EAA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,MAAM,CAAC,UAAU,CAAC,KAA2D;QAC5E,OAAO,KAAK,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;IACpC,CAAC;;AAvBF,wEAwBC","sourcesContent":["import z from 'zod';\nimport { SocketEventType, UserRef } from '../../../utilities/enum';\nimport { DTO, IdSchema, ZodValidation } from '../../../utilities/validation';\nimport { BaseSocketEvent } from '../BaseSocketEvent';\nimport { NotificationSocketEvent } from './notification.socket.event';\n\nexport const ChatroomMessageSendSocketInputSchema = z.object({\n\tchatroomId: IdSchema,\n});\n\nexport const ChatroomMessageSendOutputSchema = z.object({\n\t_id: ZodValidation.coerce.objectId('_id'),\n\tsenderId: ZodValidation.coerce.objectId('senderId'), // DEPRECATED\n\tsenderType: ZodValidation.enumType(UserRef, 'senderType'), // DEPRECATED\n\tsender: z.object({\n\t\tid: ZodValidation.coerce.objectId('sender.id'),\n\t\ttype: ZodValidation.enumType(UserRef, 'sender.type'),\n\t}),\n\tcontent: ZodValidation.string('content', { minLength: 1, maxLength: 1000 }),\n\tchatroomId: ZodValidation.coerce.objectId('chatroomId').optional(),\n\tcreatedAt: ZodValidation.coerce.date(),\n});\n\nexport type ChatroomMessageSendSocketOutputDTO = DTO<typeof ChatroomMessageSendOutputSchema>;\nexport type ChatroomMessageSendSocketInputDTO = DTO<typeof ChatroomMessageSendSocketInputSchema>;\n\nexport class ChatroomMessageSendSocketEvent extends BaseSocketEvent<\n\ttypeof ChatroomMessageSendSocketInputSchema,\n\ttypeof ChatroomMessageSendOutputSchema\n> {\n\tstatic readonly schemas = {\n\t\tinput: ChatroomMessageSendSocketInputSchema,\n\t\toutput: ChatroomMessageSendOutputSchema,\n\t};\n\n\tpublic notification(): NotificationSocketEvent | null {\n\t\treturn new NotificationSocketEvent({ message: `New message` });\n\t}\n\n\tpublic pushNotification(): NotificationSocketEvent | null {\n\t\treturn null;\n\t}\n\n\tconstructor(payload: ChatroomMessageSendSocketOutputDTO) {\n\t\tsuper(SocketEventType.CHATROOM_MESSAGE_SEND, ChatroomMessageSendSocketEvent.schemas, payload);\n\t}\n\n\tstatic identifier(input: z.infer<typeof ChatroomMessageSendSocketInputSchema>): string {\n\t\treturn input.chatroomId.toString();\n\t}\n}\n"]}
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED
|
@@ -646,7 +646,7 @@ export declare const createResponseSchema: <T>(schema: z.ZodSchema<T>) => z.ZodO
|
|
|
646
646
|
totalPages: number;
|
|
647
647
|
} | undefined;
|
|
648
648
|
}>, z.ZodType<T, z.ZodTypeDef, T>]>>;
|
|
649
|
-
}>, any> extends infer T_1 ? { [k in keyof T_1]: z.
|
|
649
|
+
}>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<{
|
|
650
650
|
success: z.ZodBoolean;
|
|
651
651
|
message: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
652
652
|
data: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
@@ -684,83 +684,7 @@ export declare const createResponseSchema: <T>(schema: z.ZodSchema<T>) => z.ZodO
|
|
|
684
684
|
totalPages: number;
|
|
685
685
|
} | undefined;
|
|
686
686
|
}>, z.ZodType<T, z.ZodTypeDef, T>]>>;
|
|
687
|
-
}
|
|
688
|
-
success: z.ZodBoolean;
|
|
689
|
-
message: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
690
|
-
data: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
691
|
-
metadata: z.ZodOptional<z.ZodObject<{
|
|
692
|
-
page: z.ZodNumber;
|
|
693
|
-
size: z.ZodNumber;
|
|
694
|
-
totalElements: z.ZodNumber;
|
|
695
|
-
totalPages: z.ZodNumber;
|
|
696
|
-
}, "strip", z.ZodTypeAny, {
|
|
697
|
-
size: number;
|
|
698
|
-
page: number;
|
|
699
|
-
totalElements: number;
|
|
700
|
-
totalPages: number;
|
|
701
|
-
}, {
|
|
702
|
-
size: number;
|
|
703
|
-
page: number;
|
|
704
|
-
totalElements: number;
|
|
705
|
-
totalPages: number;
|
|
706
|
-
}>>;
|
|
707
|
-
documents: z.ZodArray<z.ZodType<T, z.ZodTypeDef, T>, "many">;
|
|
708
|
-
}, "strip", z.ZodTypeAny, {
|
|
709
|
-
documents: T[];
|
|
710
|
-
metadata?: {
|
|
711
|
-
size: number;
|
|
712
|
-
page: number;
|
|
713
|
-
totalElements: number;
|
|
714
|
-
totalPages: number;
|
|
715
|
-
} | undefined;
|
|
716
|
-
}, {
|
|
717
|
-
documents: T[];
|
|
718
|
-
metadata?: {
|
|
719
|
-
size: number;
|
|
720
|
-
page: number;
|
|
721
|
-
totalElements: number;
|
|
722
|
-
totalPages: number;
|
|
723
|
-
} | undefined;
|
|
724
|
-
}>, z.ZodType<T, z.ZodTypeDef, T>]>>;
|
|
725
|
-
}> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<{
|
|
726
|
-
success: z.ZodBoolean;
|
|
727
|
-
message: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
728
|
-
data: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
729
|
-
metadata: z.ZodOptional<z.ZodObject<{
|
|
730
|
-
page: z.ZodNumber;
|
|
731
|
-
size: z.ZodNumber;
|
|
732
|
-
totalElements: z.ZodNumber;
|
|
733
|
-
totalPages: z.ZodNumber;
|
|
734
|
-
}, "strip", z.ZodTypeAny, {
|
|
735
|
-
size: number;
|
|
736
|
-
page: number;
|
|
737
|
-
totalElements: number;
|
|
738
|
-
totalPages: number;
|
|
739
|
-
}, {
|
|
740
|
-
size: number;
|
|
741
|
-
page: number;
|
|
742
|
-
totalElements: number;
|
|
743
|
-
totalPages: number;
|
|
744
|
-
}>>;
|
|
745
|
-
documents: z.ZodArray<z.ZodType<T, z.ZodTypeDef, T>, "many">;
|
|
746
|
-
}, "strip", z.ZodTypeAny, {
|
|
747
|
-
documents: T[];
|
|
748
|
-
metadata?: {
|
|
749
|
-
size: number;
|
|
750
|
-
page: number;
|
|
751
|
-
totalElements: number;
|
|
752
|
-
totalPages: number;
|
|
753
|
-
} | undefined;
|
|
754
|
-
}, {
|
|
755
|
-
documents: T[];
|
|
756
|
-
metadata?: {
|
|
757
|
-
size: number;
|
|
758
|
-
page: number;
|
|
759
|
-
totalElements: number;
|
|
760
|
-
totalPages: number;
|
|
761
|
-
} | undefined;
|
|
762
|
-
}>, z.ZodType<T, z.ZodTypeDef, T>]>>;
|
|
763
|
-
}>[k_1]; } : never>;
|
|
687
|
+
}> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
|
|
764
688
|
export type PaginatedDTO<T> = {
|
|
765
689
|
metadata: DTO<typeof metadataSchema>;
|
|
766
690
|
documents: T[];
|
|
@@ -76,34 +76,22 @@ export declare class SchemaBuilder<T extends z.ZodRawShape> {
|
|
|
76
76
|
private baseSchema;
|
|
77
77
|
constructor(baseFields: T, includeTimestamps?: boolean, includeTracking?: boolean);
|
|
78
78
|
private createBaseSchema;
|
|
79
|
-
getBaseSchema(): z.ZodObject<T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]:
|
|
79
|
+
getBaseSchema(): z.ZodObject<T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<T> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
|
|
80
80
|
getEntitySchema(): z.ZodObject<z.objectUtil.extendShape<T, {
|
|
81
81
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
82
|
-
}> extends infer T_1 extends z.ZodRawShape ? { [k in keyof T_1]: z.ZodOptional<z.objectUtil.extendShape<T, {
|
|
82
|
+
}> extends infer T_1 extends z.ZodRawShape ? { [k in keyof T_1]: z.ZodOptional<T_1[k]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
|
|
83
83
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
84
|
-
}>[k]>; } : never,
|
|
84
|
+
}> extends infer T_2 extends z.ZodRawShape ? { [k in keyof T_2]: z.ZodOptional<T_2[k]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
|
|
85
85
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
86
|
-
}> extends infer
|
|
87
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
88
|
-
}>[k]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
|
|
89
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
90
|
-
}> extends infer T_3 extends z.ZodRawShape ? { [k in keyof T_3]: z.ZodOptional<z.objectUtil.extendShape<T, {
|
|
91
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
92
|
-
}>[k]>; } : never, z.ZodTypeAny, "passthrough">>;
|
|
86
|
+
}> extends infer T_3 extends z.ZodRawShape ? { [k in keyof T_3]: z.ZodOptional<T_3[k]>; } : never, z.ZodTypeAny, "passthrough">>;
|
|
93
87
|
getIdSchema(): z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
94
88
|
getUpdateSchema(excludeFields?: ExcludeFromUpdate): z.ZodObject<z.objectUtil.extendShape<T, {
|
|
95
89
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
96
|
-
}> extends infer T_1 extends z.ZodRawShape ? { [k in keyof T_1]: z.ZodOptional<z.objectUtil.extendShape<T, {
|
|
97
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
98
|
-
}>[k]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
|
|
99
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
100
|
-
}> extends infer T_2 extends z.ZodRawShape ? { [k in keyof T_2]: z.ZodOptional<z.objectUtil.extendShape<T, {
|
|
101
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
102
|
-
}>[k]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
|
|
90
|
+
}> extends infer T_1 extends z.ZodRawShape ? { [k in keyof T_1]: z.ZodOptional<T_1[k]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
|
|
103
91
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
104
|
-
}> extends infer
|
|
92
|
+
}> extends infer T_2 extends z.ZodRawShape ? { [k in keyof T_2]: z.ZodOptional<T_2[k]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
|
|
105
93
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
106
|
-
}>[k]>; } : never, z.ZodTypeAny, "passthrough">> | z.ZodObject<{
|
|
94
|
+
}> extends infer T_3 extends z.ZodRawShape ? { [k in keyof T_3]: z.ZodOptional<T_3[k]>; } : never, z.ZodTypeAny, "passthrough">> | z.ZodObject<{
|
|
107
95
|
[x: string]: z.ZodOptional<z.ZodTypeAny>;
|
|
108
96
|
}, "strict", z.ZodTypeAny, {
|
|
109
97
|
[x: string]: any;
|
|
@@ -126,34 +114,22 @@ export declare class SchemaBuilder<T extends z.ZodRawShape> {
|
|
|
126
114
|
[x: string]: any;
|
|
127
115
|
}>;
|
|
128
116
|
getAllSchemas(excludeFromUpdate?: ExcludeFromUpdate): {
|
|
129
|
-
BaseSchema: z.ZodObject<T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]:
|
|
117
|
+
BaseSchema: z.ZodObject<T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<T> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
|
|
130
118
|
EntitySchema: z.ZodObject<z.objectUtil.extendShape<T, {
|
|
131
119
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
132
|
-
}> extends infer T_3 extends z.ZodRawShape ? { [k_2 in keyof T_3]: z.ZodOptional<z.objectUtil.extendShape<T, {
|
|
120
|
+
}> extends infer T_3 extends z.ZodRawShape ? { [k_2 in keyof T_3]: z.ZodOptional<T_3[k_2]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
|
|
133
121
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
134
|
-
}>[k_2]>; } : never,
|
|
122
|
+
}> extends infer T_4 extends z.ZodRawShape ? { [k_2 in keyof T_4]: z.ZodOptional<T_4[k_2]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
|
|
135
123
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
136
|
-
}> extends infer
|
|
137
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
138
|
-
}>[k_2]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
|
|
139
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
140
|
-
}> extends infer T_5 extends z.ZodRawShape ? { [k_2 in keyof T_5]: z.ZodOptional<z.objectUtil.extendShape<T, {
|
|
141
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
142
|
-
}>[k_2]>; } : never, z.ZodTypeAny, "passthrough">>;
|
|
124
|
+
}> extends infer T_5 extends z.ZodRawShape ? { [k_2 in keyof T_5]: z.ZodOptional<T_5[k_2]>; } : never, z.ZodTypeAny, "passthrough">>;
|
|
143
125
|
IdSchema: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
144
126
|
UpdateSchema: z.ZodObject<z.objectUtil.extendShape<T, {
|
|
145
127
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
146
|
-
}> extends infer T_6 extends z.ZodRawShape ? { [k_2 in keyof T_6]: z.ZodOptional<z.objectUtil.extendShape<T, {
|
|
147
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
148
|
-
}>[k_2]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
|
|
149
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
150
|
-
}> extends infer T_7 extends z.ZodRawShape ? { [k_2 in keyof T_7]: z.ZodOptional<z.objectUtil.extendShape<T, {
|
|
151
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
152
|
-
}>[k_2]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
|
|
128
|
+
}> extends infer T_6 extends z.ZodRawShape ? { [k_2 in keyof T_6]: z.ZodOptional<T_6[k_2]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
|
|
153
129
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
154
|
-
}> extends infer
|
|
130
|
+
}> extends infer T_7 extends z.ZodRawShape ? { [k_2 in keyof T_7]: z.ZodOptional<T_7[k_2]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
|
|
155
131
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
156
|
-
}>[k_2]>; } : never, z.ZodTypeAny, "passthrough">> | z.ZodObject<{
|
|
132
|
+
}> extends infer T_8 extends z.ZodRawShape ? { [k_2 in keyof T_8]: z.ZodOptional<T_8[k_2]>; } : never, z.ZodTypeAny, "passthrough">> | z.ZodObject<{
|
|
157
133
|
[x: string]: z.ZodOptional<z.ZodTypeAny>;
|
|
158
134
|
}, "strict", z.ZodTypeAny, {
|
|
159
135
|
[x: string]: any;
|
|
@@ -646,7 +646,7 @@ export declare const createResponseSchema: <T>(schema: z.ZodSchema<T>) => z.ZodO
|
|
|
646
646
|
totalPages: number;
|
|
647
647
|
} | undefined;
|
|
648
648
|
}>, z.ZodType<T, z.ZodTypeDef, T>]>>;
|
|
649
|
-
}>, any> extends infer T_1 ? { [k in keyof T_1]: z.
|
|
649
|
+
}>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<{
|
|
650
650
|
success: z.ZodBoolean;
|
|
651
651
|
message: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
652
652
|
data: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
@@ -684,83 +684,7 @@ export declare const createResponseSchema: <T>(schema: z.ZodSchema<T>) => z.ZodO
|
|
|
684
684
|
totalPages: number;
|
|
685
685
|
} | undefined;
|
|
686
686
|
}>, z.ZodType<T, z.ZodTypeDef, T>]>>;
|
|
687
|
-
}
|
|
688
|
-
success: z.ZodBoolean;
|
|
689
|
-
message: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
690
|
-
data: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
691
|
-
metadata: z.ZodOptional<z.ZodObject<{
|
|
692
|
-
page: z.ZodNumber;
|
|
693
|
-
size: z.ZodNumber;
|
|
694
|
-
totalElements: z.ZodNumber;
|
|
695
|
-
totalPages: z.ZodNumber;
|
|
696
|
-
}, "strip", z.ZodTypeAny, {
|
|
697
|
-
page: number;
|
|
698
|
-
size: number;
|
|
699
|
-
totalElements: number;
|
|
700
|
-
totalPages: number;
|
|
701
|
-
}, {
|
|
702
|
-
page: number;
|
|
703
|
-
size: number;
|
|
704
|
-
totalElements: number;
|
|
705
|
-
totalPages: number;
|
|
706
|
-
}>>;
|
|
707
|
-
documents: z.ZodArray<z.ZodType<T, z.ZodTypeDef, T>, "many">;
|
|
708
|
-
}, "strip", z.ZodTypeAny, {
|
|
709
|
-
documents: T[];
|
|
710
|
-
metadata?: {
|
|
711
|
-
page: number;
|
|
712
|
-
size: number;
|
|
713
|
-
totalElements: number;
|
|
714
|
-
totalPages: number;
|
|
715
|
-
} | undefined;
|
|
716
|
-
}, {
|
|
717
|
-
documents: T[];
|
|
718
|
-
metadata?: {
|
|
719
|
-
page: number;
|
|
720
|
-
size: number;
|
|
721
|
-
totalElements: number;
|
|
722
|
-
totalPages: number;
|
|
723
|
-
} | undefined;
|
|
724
|
-
}>, z.ZodType<T, z.ZodTypeDef, T>]>>;
|
|
725
|
-
}> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<{
|
|
726
|
-
success: z.ZodBoolean;
|
|
727
|
-
message: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
728
|
-
data: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
729
|
-
metadata: z.ZodOptional<z.ZodObject<{
|
|
730
|
-
page: z.ZodNumber;
|
|
731
|
-
size: z.ZodNumber;
|
|
732
|
-
totalElements: z.ZodNumber;
|
|
733
|
-
totalPages: z.ZodNumber;
|
|
734
|
-
}, "strip", z.ZodTypeAny, {
|
|
735
|
-
page: number;
|
|
736
|
-
size: number;
|
|
737
|
-
totalElements: number;
|
|
738
|
-
totalPages: number;
|
|
739
|
-
}, {
|
|
740
|
-
page: number;
|
|
741
|
-
size: number;
|
|
742
|
-
totalElements: number;
|
|
743
|
-
totalPages: number;
|
|
744
|
-
}>>;
|
|
745
|
-
documents: z.ZodArray<z.ZodType<T, z.ZodTypeDef, T>, "many">;
|
|
746
|
-
}, "strip", z.ZodTypeAny, {
|
|
747
|
-
documents: T[];
|
|
748
|
-
metadata?: {
|
|
749
|
-
page: number;
|
|
750
|
-
size: number;
|
|
751
|
-
totalElements: number;
|
|
752
|
-
totalPages: number;
|
|
753
|
-
} | undefined;
|
|
754
|
-
}, {
|
|
755
|
-
documents: T[];
|
|
756
|
-
metadata?: {
|
|
757
|
-
page: number;
|
|
758
|
-
size: number;
|
|
759
|
-
totalElements: number;
|
|
760
|
-
totalPages: number;
|
|
761
|
-
} | undefined;
|
|
762
|
-
}>, z.ZodType<T, z.ZodTypeDef, T>]>>;
|
|
763
|
-
}>[k_1]; } : never>;
|
|
687
|
+
}> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
|
|
764
688
|
export type PaginatedDTO<T> = {
|
|
765
689
|
metadata: DTO<typeof metadataSchema>;
|
|
766
690
|
documents: T[];
|
|
@@ -76,34 +76,22 @@ export declare class SchemaBuilder<T extends z.ZodRawShape> {
|
|
|
76
76
|
private baseSchema;
|
|
77
77
|
constructor(baseFields: T, includeTimestamps?: boolean, includeTracking?: boolean);
|
|
78
78
|
private createBaseSchema;
|
|
79
|
-
getBaseSchema(): z.ZodObject<T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]:
|
|
79
|
+
getBaseSchema(): z.ZodObject<T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<T> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
|
|
80
80
|
getEntitySchema(): z.ZodObject<z.objectUtil.extendShape<T, {
|
|
81
81
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
82
|
-
}> extends infer T_1 extends z.ZodRawShape ? { [k in keyof T_1]: z.ZodOptional<z.objectUtil.extendShape<T, {
|
|
82
|
+
}> extends infer T_1 extends z.ZodRawShape ? { [k in keyof T_1]: z.ZodOptional<T_1[k]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
|
|
83
83
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
84
|
-
}>[k]>; } : never,
|
|
84
|
+
}> extends infer T_2 extends z.ZodRawShape ? { [k in keyof T_2]: z.ZodOptional<T_2[k]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
|
|
85
85
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
86
|
-
}> extends infer
|
|
87
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
88
|
-
}>[k]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
|
|
89
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
90
|
-
}> extends infer T_3 extends z.ZodRawShape ? { [k in keyof T_3]: z.ZodOptional<z.objectUtil.extendShape<T, {
|
|
91
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
92
|
-
}>[k]>; } : never, z.ZodTypeAny, "passthrough">>;
|
|
86
|
+
}> extends infer T_3 extends z.ZodRawShape ? { [k in keyof T_3]: z.ZodOptional<T_3[k]>; } : never, z.ZodTypeAny, "passthrough">>;
|
|
93
87
|
getIdSchema(): z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
94
88
|
getUpdateSchema(excludeFields?: ExcludeFromUpdate): z.ZodObject<z.objectUtil.extendShape<T, {
|
|
95
89
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
96
|
-
}> extends infer T_1 extends z.ZodRawShape ? { [k in keyof T_1]: z.ZodOptional<z.objectUtil.extendShape<T, {
|
|
97
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
98
|
-
}>[k]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
|
|
99
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
100
|
-
}> extends infer T_2 extends z.ZodRawShape ? { [k in keyof T_2]: z.ZodOptional<z.objectUtil.extendShape<T, {
|
|
101
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
102
|
-
}>[k]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
|
|
90
|
+
}> extends infer T_1 extends z.ZodRawShape ? { [k in keyof T_1]: z.ZodOptional<T_1[k]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
|
|
103
91
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
104
|
-
}> extends infer
|
|
92
|
+
}> extends infer T_2 extends z.ZodRawShape ? { [k in keyof T_2]: z.ZodOptional<T_2[k]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
|
|
105
93
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
106
|
-
}>[k]>; } : never, z.ZodTypeAny, "passthrough">> | z.ZodObject<{
|
|
94
|
+
}> extends infer T_3 extends z.ZodRawShape ? { [k in keyof T_3]: z.ZodOptional<T_3[k]>; } : never, z.ZodTypeAny, "passthrough">> | z.ZodObject<{
|
|
107
95
|
[x: string]: z.ZodOptional<z.ZodTypeAny>;
|
|
108
96
|
}, "strict", z.ZodTypeAny, {
|
|
109
97
|
[x: string]: any;
|
|
@@ -126,34 +114,22 @@ export declare class SchemaBuilder<T extends z.ZodRawShape> {
|
|
|
126
114
|
[x: string]: any;
|
|
127
115
|
}>;
|
|
128
116
|
getAllSchemas(excludeFromUpdate?: ExcludeFromUpdate): {
|
|
129
|
-
BaseSchema: z.ZodObject<T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]:
|
|
117
|
+
BaseSchema: z.ZodObject<T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<T> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
|
|
130
118
|
EntitySchema: z.ZodObject<z.objectUtil.extendShape<T, {
|
|
131
119
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
132
|
-
}> extends infer T_3 extends z.ZodRawShape ? { [k_2 in keyof T_3]: z.ZodOptional<z.objectUtil.extendShape<T, {
|
|
120
|
+
}> extends infer T_3 extends z.ZodRawShape ? { [k_2 in keyof T_3]: z.ZodOptional<T_3[k_2]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
|
|
133
121
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
134
|
-
}>[k_2]>; } : never,
|
|
122
|
+
}> extends infer T_4 extends z.ZodRawShape ? { [k_2 in keyof T_4]: z.ZodOptional<T_4[k_2]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
|
|
135
123
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
136
|
-
}> extends infer
|
|
137
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
138
|
-
}>[k_2]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
|
|
139
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
140
|
-
}> extends infer T_5 extends z.ZodRawShape ? { [k_2 in keyof T_5]: z.ZodOptional<z.objectUtil.extendShape<T, {
|
|
141
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
142
|
-
}>[k_2]>; } : never, z.ZodTypeAny, "passthrough">>;
|
|
124
|
+
}> extends infer T_5 extends z.ZodRawShape ? { [k_2 in keyof T_5]: z.ZodOptional<T_5[k_2]>; } : never, z.ZodTypeAny, "passthrough">>;
|
|
143
125
|
IdSchema: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
144
126
|
UpdateSchema: z.ZodObject<z.objectUtil.extendShape<T, {
|
|
145
127
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
146
|
-
}> extends infer T_6 extends z.ZodRawShape ? { [k_2 in keyof T_6]: z.ZodOptional<z.objectUtil.extendShape<T, {
|
|
147
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
148
|
-
}>[k_2]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
|
|
149
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
150
|
-
}> extends infer T_7 extends z.ZodRawShape ? { [k_2 in keyof T_7]: z.ZodOptional<z.objectUtil.extendShape<T, {
|
|
151
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
152
|
-
}>[k_2]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
|
|
128
|
+
}> extends infer T_6 extends z.ZodRawShape ? { [k_2 in keyof T_6]: z.ZodOptional<T_6[k_2]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
|
|
153
129
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
154
|
-
}> extends infer
|
|
130
|
+
}> extends infer T_7 extends z.ZodRawShape ? { [k_2 in keyof T_7]: z.ZodOptional<T_7[k_2]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
|
|
155
131
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
156
|
-
}>[k_2]>; } : never, z.ZodTypeAny, "passthrough">> | z.ZodObject<{
|
|
132
|
+
}> extends infer T_8 extends z.ZodRawShape ? { [k_2 in keyof T_8]: z.ZodOptional<T_8[k_2]>; } : never, z.ZodTypeAny, "passthrough">> | z.ZodObject<{
|
|
157
133
|
[x: string]: z.ZodOptional<z.ZodTypeAny>;
|
|
158
134
|
}, "strict", z.ZodTypeAny, {
|
|
159
135
|
[x: string]: any;
|