@lyxa.ai/core 1.3.105 → 1.3.107

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.
@@ -29,7 +29,7 @@ __decorate([
29
29
  __metadata("design:type", Object)
30
30
  ], Attribute.prototype, "shop", void 0);
31
31
  __decorate([
32
- (0, typegoose_1.prop)({ required: true, type: String, trim: true, maxlength: 20 }),
32
+ (0, typegoose_1.prop)({ required: true, type: String, trim: true, maxlength: 60 }),
33
33
  __metadata("design:type", String)
34
34
  ], Attribute.prototype, "name", void 0);
35
35
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"attribute.model.js","sourceRoot":"/","sources":["libraries/mongo/models/attribute.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsE;AACtE,4EAAqE;AACrE,0EAAgE;AAChE,6CAAoC;AAI7B,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,2BAAU;IAEjC,IAAI,CAAa;IAGjB,IAAI,CAAU;IAGd,aAAa,CAAW;IAGxB,kBAAkB,CAAU;IAG5B,UAAU,CAAW;IAGrB,gBAAgB,CAAU;IAG1B,KAAK,CAAmB;CAC/B,CAAA;AArBY,8BAAS;AAEd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,iBAAI,EAAE,CAAC;;uCAClB;AAGjB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;;uCAC7C;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;gDACT;AAGxB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;qDACxB;AAG5B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;6CACZ;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;mDAC1B;AAG1B;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,oCAAa,CAAC,EAAE,CAAC;;wCACjB;oBApBnB,SAAS;IAFrB,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,YAAY,EAAE,EAAE,CAAC;IAC7D,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;GAC/E,SAAS,CAqBrB","sourcesContent":["import { Index, modelOptions, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { AttributeItem } from './embedded/attribute-item.model';\nimport { Shop } from './shop.model';\n\n@modelOptions({ schemaOptions: { collection: 'attributes' } })\n@Index({ shop: 1, name: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\nexport class Attribute extends TimeStamps {\n\t@prop({ required: true, ref: () => Shop })\n\tpublic shop!: Ref<Shop>;\n\n\t@prop({ required: true, type: String, trim: true, maxlength: 20 })\n\tpublic name!: string;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isMultiSelect?: boolean;\n\n\t@prop({ type: Number, min: 0, max: 999999999, default: 0 }) // 0 means, it is disable\n\tpublic maxSelectableItems?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isRequired?: boolean;\n\n\t@prop({ type: Number, min: 0, max: 999999999, default: 0 }) // 0 means, it is disable\n\tpublic minRequiredItems?: number;\n\n\t@prop({ required: true, type: [AttributeItem] })\n\tpublic items!: AttributeItem[];\n}\n"]}
1
+ {"version":3,"file":"attribute.model.js","sourceRoot":"/","sources":["libraries/mongo/models/attribute.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsE;AACtE,4EAAqE;AACrE,0EAAgE;AAChE,6CAAoC;AAI7B,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,2BAAU;IAEjC,IAAI,CAAa;IAGjB,IAAI,CAAU;IAGd,aAAa,CAAW;IAGxB,kBAAkB,CAAU;IAG5B,UAAU,CAAW;IAGrB,gBAAgB,CAAU;IAG1B,KAAK,CAAmB;CAC/B,CAAA;AArBY,8BAAS;AAEd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,iBAAI,EAAE,CAAC;;uCAClB;AAGjB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;;uCAC7C;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;gDACT;AAGxB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;qDACxB;AAG5B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;6CACZ;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;mDAC1B;AAG1B;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,oCAAa,CAAC,EAAE,CAAC;;wCACjB;oBApBnB,SAAS;IAFrB,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,YAAY,EAAE,EAAE,CAAC;IAC7D,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;GAC/E,SAAS,CAqBrB","sourcesContent":["import { Index, modelOptions, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { AttributeItem } from './embedded/attribute-item.model';\nimport { Shop } from './shop.model';\n\n@modelOptions({ schemaOptions: { collection: 'attributes' } })\n@Index({ shop: 1, name: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\nexport class Attribute extends TimeStamps {\n\t@prop({ required: true, ref: () => Shop })\n\tpublic shop!: Ref<Shop>;\n\n\t@prop({ required: true, type: String, trim: true, maxlength: 60 })\n\tpublic name!: string;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isMultiSelect?: boolean;\n\n\t@prop({ type: Number, min: 0, max: 999999999, default: 0 }) // 0 means, it is disable\n\tpublic maxSelectableItems?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isRequired?: boolean;\n\n\t@prop({ type: Number, min: 0, max: 999999999, default: 0 }) // 0 means, it is disable\n\tpublic minRequiredItems?: number;\n\n\t@prop({ required: true, type: [AttributeItem] })\n\tpublic items!: AttributeItem[];\n}\n"]}
@@ -49,4 +49,5 @@ export declare class RegularOrder extends Order {
49
49
  lineItems?: Ref<LineItem>[];
50
50
  cartParticipants?: Ref<CartParticipant>[];
51
51
  marketings?: Ref<Marketing>[];
52
+ bringChangeAmount?: number;
52
53
  }
@@ -61,6 +61,7 @@ class RegularOrder extends order_model_1.Order {
61
61
  lineItems;
62
62
  cartParticipants;
63
63
  marketings;
64
+ bringChangeAmount;
64
65
  }
65
66
  exports.RegularOrder = RegularOrder;
66
67
  __decorate([
@@ -191,4 +192,8 @@ __decorate([
191
192
  (0, typegoose_1.prop)({ ref: () => marketing_model_1.Marketing, default: [] }),
192
193
  __metadata("design:type", Array)
193
194
  ], RegularOrder.prototype, "marketings", void 0);
195
+ __decorate([
196
+ (0, typegoose_1.prop)({ type: Number }),
197
+ __metadata("design:type", Number)
198
+ ], RegularOrder.prototype, "bringChangeAmount", void 0);
194
199
  //# sourceMappingURL=regular-order.model.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"regular-order.model.js","sourceRoot":"/","sources":["libraries/mongo/models/providers/regular-order.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,gDAAuC;AACvC,qDAAuG;AACvG,kDAAyC;AACzC,8CAAqC;AACrC,8CAAqC;AACrC,2DAAuE;AACvE,6EAA+E;AAC/E,uEAA6D;AAC7D,yFAA8E;AAC9E,uEAA6D;AAC7D,iFAAuE;AACvE,wDAA8C;AAC9C,8CAAqC;AACrC,gDAAuC;AACvC,sEAA4D;AAC5D,2FAAoG;AACpG,2FAA4F;AAC5F,wDAA+C;AAE/C,MAAa,YAAa,SAAQ,mBAAK;IAC/B,SAAS,GAAG,gBAAS,CAAC,OAAgB,CAAC;IAGvC,IAAI,CAAa;IAGjB,aAAa,CAAgB;IAG7B,MAAM,CAAsB;IAG5B,cAAc,CAAgC;IAG9C,QAAQ,CAAU;IAGlB,aAAa,CAAW;IAGxB,eAAe,CAAuB;IAGtC,oBAAoB,CAAsC;IAG1D,MAAM,CAAe;IAGrB,IAAI,CAAa;IAGjB,IAAI,CAAa;IAGjB,cAAc,CAAW;IAGzB,sBAAsB,CAAU;IAGhC,kBAAkB,CAAW;IAG7B,2BAA2B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,EAAE,GAAG,EAAE,CAAC,wCAAe;QAC1B,YAAY,EAAE,MAAM;QACpB,UAAU,EAAE,MAAM;KAClB,CAAC;;sDAC+C;AAG1C;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,2BAAS,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;gDACP","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\nimport { Order } from '../order.model';\nimport { AdjustmentStatus, ItemType, OrderType, RegularOrderStatus } from '../../../../utilities/enum';\nimport { Parent } from '../parent.model';\nimport { Shop } from '../shop.model';\nimport { Cart } from '../cart.model';\nimport { Address, RegularOrderAddress } from '../shared/address.model';\nimport { RegularOrderStatusTimeline } from '../embedded/status-timeline.model';\nimport { OrderRefund } from '../embedded/order-refund.model';\nimport { RegularOrderFinance } from '../embedded/regular-order-finance.model';\nimport { EndorseLoss } from '../embedded/order-cancel.model';\nimport { ReplacementOrder } from '../embedded/replacement-order.model';\nimport { LineItem } from '../line-item.model';\nimport { User } from '../user.model';\nimport { Rider } from '../rider.model';\nimport { CartParticipant } from '../cart-participant.model';\nimport { AdjustmentHistory, AdjustmentInformation } from '../embedded/adjustment-information.model';\nimport { RegularOrderAddressChangeHistory } from '../embedded/address-change-history.model';\nimport { Marketing } from '../marketing.model';\n\nexport class RegularOrder extends Order {\n\tpublic orderType = OrderType.REGULAR as const;\n\n\t@prop({ required: true, ref: () => User })\n\tpublic user!: Ref<User>;\n\n\t@prop({ ref: () => Rider })\n\tpublic supportRiders?: Ref<Rider>[];\n\n\t@prop({ type: String, enum: RegularOrderStatus, default: RegularOrderStatus.PLACED })\n\tpublic status?: RegularOrderStatus;\n\n\t@prop({ type: () => [RegularOrderStatusTimeline], default: [] })\n\tpublic statusTimeline?: RegularOrderStatusTimeline[];\n\n\t@prop({ type: String, enum: ItemType, default: ItemType.FOOD })\n\tpublic itemType?: string;\n\n\t@prop({ required: true, type: Address })\n\tpublic pickupAddress!: Address;\n\n\t@prop({ required: true, type: RegularOrderAddress })\n\tpublic deliveryAddress!: RegularOrderAddress;\n\n\t@prop({ type: [RegularOrderAddressChangeHistory], default: [] })\n\tpublic addressChangeHistory?: RegularOrderAddressChangeHistory[];\n\n\t@prop({ required: true, ref: () => Parent })\n\tpublic parent!: Ref<Parent>;\n\n\t@prop({ required: true, ref: () => Shop })\n\tpublic shop!: Ref<Shop>;\n\n\t@prop({ required: true, ref: () => Cart, unique: true })\n\tpublic cart!: Ref<Cart>;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isShopDelivery?: boolean;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic preparingTimeInMinutes?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isReplacementOrder?: boolean;\n\n\t@prop({ type: () => ReplacementOrder, _id: false })\n\tpublic replacementOrderInformation?: ReplacementOrder;\n\n\t@prop({ ref: () => Order })\n\tpublic replacementOrder?: Ref<Order>;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isRefunded?: boolean;\n\n\t@prop({ type: OrderRefund })\n\tpublic refundInformation?: OrderRefund;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isEndorseLossApplied?: boolean;\n\n\t@prop({ type: () => EndorseLoss, _id: false })\n\tpublic endorseLossInformation?: EndorseLoss;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isAdjusted?: boolean;\n\n\t@prop({ type: String, enum: AdjustmentStatus, default: AdjustmentStatus.NONE })\n\tpublic adjustmentStatus?: AdjustmentStatus;\n\n\t@prop({ type: () => AdjustmentInformation, _id: false })\n\tpublic adjustmentInformation?: AdjustmentInformation;\n\n\t@prop({ type: () => [AdjustmentHistory], default: [] })\n\tpublic adjustmentHistory?: AdjustmentHistory[];\n\n\t@prop({ required: true, type: RegularOrderFinance, _id: false })\n\tpublic finance!: RegularOrderFinance;\n\n\t@prop({ type: RegularOrderFinance, _id: false })\n\tpublic adjustedFinance?: RegularOrderFinance;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isGroupOrder?: boolean;\n\n\t@prop({\n\t\tref: () => LineItem,\n\t\tforeignField: 'cart',\n\t\tlocalField: 'cart',\n\t})\n\tpublic lineItems?: Ref<LineItem>[];\n\n\t@prop({\n\t\tref: () => CartParticipant,\n\t\tforeignField: 'cart',\n\t\tlocalField: 'cart',\n\t})\n\tpublic cartParticipants?: Ref<CartParticipant>[];\n\n\t@prop({ ref: () => Marketing, default: [] })\n\tpublic marketings?: Ref<Marketing>[];\n}\n"]}
1
+ {"version":3,"file":"regular-order.model.js","sourceRoot":"/","sources":["libraries/mongo/models/providers/regular-order.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,gDAAuC;AACvC,qDAAuG;AACvG,kDAAyC;AACzC,8CAAqC;AACrC,8CAAqC;AACrC,2DAAuE;AACvE,6EAA+E;AAC/E,uEAA6D;AAC7D,yFAA8E;AAC9E,uEAA6D;AAC7D,iFAAuE;AACvE,wDAA8C;AAC9C,8CAAqC;AACrC,gDAAuC;AACvC,sEAA4D;AAC5D,2FAAoG;AACpG,2FAA4F;AAC5F,wDAA+C;AAE/C,MAAa,YAAa,SAAQ,mBAAK;IAC/B,SAAS,GAAG,gBAAS,CAAC,OAAgB,CAAC;IAGvC,IAAI,CAAa;IAGjB,aAAa,CAAgB;IAG7B,MAAM,CAAsB;IAG5B,cAAc,CAAgC;IAG9C,QAAQ,CAAU;IAGlB,aAAa,CAAW;IAGxB,eAAe,CAAuB;IAGtC,oBAAoB,CAAsC;IAG1D,MAAM,CAAe;IAGrB,IAAI,CAAa;IAGjB,IAAI,CAAa;IAGjB,cAAc,CAAW;IAGzB,sBAAsB,CAAU;IAGhC,kBAAkB,CAAW;IAG7B,2BAA2B,CAAoB;IAG/C,gBAAgB,CAAc;IAG9B,UAAU,CAAW;IAGrB,iBAAiB,CAAe;IAGhC,oBAAoB,CAAW;IAG/B,sBAAsB,CAAe;IAGrC,UAAU,CAAW;IAGrB,gBAAgB,CAAoB;IAGpC,qBAAqB,CAA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GAAG,EAAE,CAAC,2BAAS,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;gDACP;AAG9B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAC,CAAC;;uDACY","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\nimport { Order } from '../order.model';\nimport { AdjustmentStatus, ItemType, OrderType, RegularOrderStatus } from '../../../../utilities/enum';\nimport { Parent } from '../parent.model';\nimport { Shop } from '../shop.model';\nimport { Cart } from '../cart.model';\nimport { Address, RegularOrderAddress } from '../shared/address.model';\nimport { RegularOrderStatusTimeline } from '../embedded/status-timeline.model';\nimport { OrderRefund } from '../embedded/order-refund.model';\nimport { RegularOrderFinance } from '../embedded/regular-order-finance.model';\nimport { EndorseLoss } from '../embedded/order-cancel.model';\nimport { ReplacementOrder } from '../embedded/replacement-order.model';\nimport { LineItem } from '../line-item.model';\nimport { User } from '../user.model';\nimport { Rider } from '../rider.model';\nimport { CartParticipant } from '../cart-participant.model';\nimport { AdjustmentHistory, AdjustmentInformation } from '../embedded/adjustment-information.model';\nimport { RegularOrderAddressChangeHistory } from '../embedded/address-change-history.model';\nimport { Marketing } from '../marketing.model';\n\nexport class RegularOrder extends Order {\n\tpublic orderType = OrderType.REGULAR as const;\n\n\t@prop({ required: true, ref: () => User })\n\tpublic user!: Ref<User>;\n\n\t@prop({ ref: () => Rider })\n\tpublic supportRiders?: Ref<Rider>[];\n\n\t@prop({ type: String, enum: RegularOrderStatus, default: RegularOrderStatus.PLACED })\n\tpublic status?: RegularOrderStatus;\n\n\t@prop({ type: () => [RegularOrderStatusTimeline], default: [] })\n\tpublic statusTimeline?: RegularOrderStatusTimeline[];\n\n\t@prop({ type: String, enum: ItemType, default: ItemType.FOOD })\n\tpublic itemType?: string;\n\n\t@prop({ required: true, type: Address })\n\tpublic pickupAddress!: Address;\n\n\t@prop({ required: true, type: RegularOrderAddress })\n\tpublic deliveryAddress!: RegularOrderAddress;\n\n\t@prop({ type: [RegularOrderAddressChangeHistory], default: [] })\n\tpublic addressChangeHistory?: RegularOrderAddressChangeHistory[];\n\n\t@prop({ required: true, ref: () => Parent })\n\tpublic parent!: Ref<Parent>;\n\n\t@prop({ required: true, ref: () => Shop })\n\tpublic shop!: Ref<Shop>;\n\n\t@prop({ required: true, ref: () => Cart, unique: true })\n\tpublic cart!: Ref<Cart>;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isShopDelivery?: boolean;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic preparingTimeInMinutes?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isReplacementOrder?: boolean;\n\n\t@prop({ type: () => ReplacementOrder, _id: false })\n\tpublic replacementOrderInformation?: ReplacementOrder;\n\n\t@prop({ ref: () => Order })\n\tpublic replacementOrder?: Ref<Order>;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isRefunded?: boolean;\n\n\t@prop({ type: OrderRefund })\n\tpublic refundInformation?: OrderRefund;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isEndorseLossApplied?: boolean;\n\n\t@prop({ type: () => EndorseLoss, _id: false })\n\tpublic endorseLossInformation?: EndorseLoss;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isAdjusted?: boolean;\n\n\t@prop({ type: String, enum: AdjustmentStatus, default: AdjustmentStatus.NONE })\n\tpublic adjustmentStatus?: AdjustmentStatus;\n\n\t@prop({ type: () => AdjustmentInformation, _id: false })\n\tpublic adjustmentInformation?: AdjustmentInformation;\n\n\t@prop({ type: () => [AdjustmentHistory], default: [] })\n\tpublic adjustmentHistory?: AdjustmentHistory[];\n\n\t@prop({ required: true, type: RegularOrderFinance, _id: false })\n\tpublic finance!: RegularOrderFinance;\n\n\t@prop({ type: RegularOrderFinance, _id: false })\n\tpublic adjustedFinance?: RegularOrderFinance;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isGroupOrder?: boolean;\n\n\t@prop({\n\t\tref: () => LineItem,\n\t\tforeignField: 'cart',\n\t\tlocalField: 'cart',\n\t})\n\tpublic lineItems?: Ref<LineItem>[];\n\n\t@prop({\n\t\tref: () => CartParticipant,\n\t\tforeignField: 'cart',\n\t\tlocalField: 'cart',\n\t})\n\tpublic cartParticipants?: Ref<CartParticipant>[];\n\n\t@prop({ ref: () => Marketing, default: [] })\n\tpublic marketings?: Ref<Marketing>[];\n\n\t@prop({ type: Number})\n\tpublic bringChangeAmount?: number;\n}\n"]}
@@ -22,7 +22,7 @@ Perfect for sharing types between frontend and backend applications.
22
22
 
23
23
  ## Version
24
24
 
25
- Version: 1.3.105
25
+ Version: 1.3.107
26
26
 
27
27
  ## Dependencies
28
28
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/types",
3
- "version": "1.3.105",
3
+ "version": "1.3.107",
4
4
  "description": "Lyxa type definitions and validation schemas for both frontend and backend",
5
5
  "author": "elie <42282499+Internalizable@users.noreply.github.com>",
6
6
  "license": "MIT",
@@ -26,8 +26,8 @@ export declare const FilterSchema: z.ZodOptional<z.ZodObject<{
26
26
  searchFields?: string[] | undefined;
27
27
  } | undefined;
28
28
  sort?: Record<string, 1 | -1> | undefined;
29
- populate?: any;
30
29
  select?: Record<string, 0 | 1> | undefined;
30
+ populate?: any;
31
31
  query?: Record<string, any> | undefined;
32
32
  }, {
33
33
  search?: {
@@ -36,8 +36,8 @@ export declare const FilterSchema: z.ZodOptional<z.ZodObject<{
36
36
  } | undefined;
37
37
  sort?: Record<string, 1 | -1> | undefined;
38
38
  size?: number | undefined;
39
- populate?: any;
40
39
  select?: Record<string, 0 | 1> | undefined;
40
+ populate?: any;
41
41
  query?: Record<string, any> | undefined;
42
42
  page?: number | undefined;
43
43
  }>>;
@@ -733,12 +733,12 @@ export declare const GetByIdInputSchema: z.ZodObject<{
733
733
  populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
734
734
  }, "strip", z.ZodTypeAny, {
735
735
  _id: import("mongoose").Types.ObjectId;
736
- populate?: any;
737
736
  select?: Record<string, 0 | 1> | undefined;
737
+ populate?: any;
738
738
  }, {
739
739
  _id: string | import("mongoose").Types.ObjectId;
740
- populate?: any;
741
740
  select?: Record<string, 0 | 1> | undefined;
741
+ populate?: any;
742
742
  }>;
743
743
  export type GetByIdInputDTO = DTO<typeof GetByIdInputSchema>;
744
744
  export declare const GetProductByIdInputSchema: z.ZodObject<{
@@ -751,12 +751,12 @@ export declare const GetProductByIdInputSchema: z.ZodObject<{
751
751
  _id: import("mongoose").Types.ObjectId;
752
752
  withAttributeHiddenItems: boolean;
753
753
  withAddonsHiddenItems: boolean;
754
- populate?: any;
755
754
  select?: Record<string, 0 | 1> | undefined;
755
+ populate?: any;
756
756
  }, {
757
757
  _id: string | import("mongoose").Types.ObjectId;
758
- populate?: any;
759
758
  select?: Record<string, 0 | 1> | undefined;
759
+ populate?: any;
760
760
  withAttributeHiddenItems?: boolean | undefined;
761
761
  withAddonsHiddenItems?: boolean | undefined;
762
762
  }>;
@@ -768,13 +768,13 @@ export declare const GetOrderByIdInputSchema: z.ZodObject<{
768
768
  userOrderCompletionScope: z.ZodOptional<z.ZodNativeEnum<typeof UserOrderCompletionScope>>;
769
769
  }, "strip", z.ZodTypeAny, {
770
770
  _id: import("mongoose").Types.ObjectId;
771
- populate?: any;
772
771
  select?: Record<string, 0 | 1> | undefined;
772
+ populate?: any;
773
773
  userOrderCompletionScope?: UserOrderCompletionScope | undefined;
774
774
  }, {
775
775
  _id: string | import("mongoose").Types.ObjectId;
776
- populate?: any;
777
776
  select?: Record<string, 0 | 1> | undefined;
777
+ populate?: any;
778
778
  userOrderCompletionScope?: UserOrderCompletionScope | undefined;
779
779
  }>;
780
780
  export type GetOrderByIdInputDTO = DTO<typeof GetOrderByIdInputSchema>;
@@ -782,11 +782,11 @@ export declare const GetByTokenInputSchema: z.ZodOptional<z.ZodObject<{
782
782
  select: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>>>;
783
783
  populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
784
784
  }, "strip", z.ZodTypeAny, {
785
- populate?: any;
786
785
  select?: Record<string, 0 | 1> | undefined;
787
- }, {
788
786
  populate?: any;
787
+ }, {
789
788
  select?: Record<string, 0 | 1> | undefined;
789
+ populate?: any;
790
790
  }>>;
791
791
  export type GetByTokenInputDTO = DTO<typeof GetByTokenInputSchema>;
792
792
  export declare const GetOneQuerySchema: z.ZodObject<{
@@ -794,12 +794,12 @@ export declare const GetOneQuerySchema: z.ZodObject<{
794
794
  select: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>>>;
795
795
  populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
796
796
  }, "strip", z.ZodTypeAny, {
797
- populate?: any;
798
797
  select?: Record<string, 0 | 1> | undefined;
798
+ populate?: any;
799
799
  query?: Record<string, any> | undefined;
800
800
  }, {
801
- populate?: any;
802
801
  select?: Record<string, 0 | 1> | undefined;
802
+ populate?: any;
803
803
  query?: Record<string, any> | undefined;
804
804
  }>;
805
805
  export type GetOneQueryDTO = DTO<typeof GetOneQuerySchema>;
@@ -40,8 +40,8 @@ function normalizeUserPopulate(populate) {
40
40
  const normalizeName = (text) => text
41
41
  .trim()
42
42
  .normalize('NFD')
43
- .replace(/[\u0300-\u036f]/g, '')
44
- .replace(/[^a-zA-Z0-9\s]/g, '')
43
+ .replace(/\p{Diacritic}/gu, '')
44
+ .replace(/[^\p{Letter}\p{Number}\s]/gu, '')
45
45
  .toLowerCase();
46
46
  exports.normalizeName = normalizeName;
47
47
  //# sourceMappingURL=normalize.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"normalize.js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AAsB;IAC3D,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC9B,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACvC,CAAC;IAED,MAAM,gBAAgB,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,QAAa,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC;IAEpF,IAAI,gBAAgB,EAAE,CAAC;QACtB,gBAAgB,CAAC,MAAM,GAAG,IAAA,0BAAa,EAAC,gBAAgB,CAAC,MAAM,EAAE,2BAAc,CAAC,IAAI,CAAC,CAAC;QACtF,gBAAgB,CAAC,QAAQ,GAAG;YAC3B,IAAI,EAAE,UAAU;YAChB,MAAM,EAAE,8BAA8B;YACtC,KAAK,EAAE,IAAA,yBAAgB,GAAE;SACzB,CAAC;IACH,CAAC;AACF,CAAC;AAaM,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,EAAE,CAC7C,IAAI;KACF,IAAI,EAAE;KACN,SAAS,CAAC,KAAK,CAAC;KAChB,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;KAC/B,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC;KAC9B,WAAW,EAAE,CAAC;AANJ,QAAA,aAAa,iBAMT","sourcesContent":["import { mongoose } from '@typegoose/typegoose';\nimport { excludeFields, ProjectionType } from './projection';\nimport { getCoreUserModel } from '../libraries/mongo/models';\n\n/**\n * Converts specific fields in query to ObjectIds safely.\n */\nexport function normalizeObjectIds(query: Record<string, any>, objectIdFields: string[]): void {\n\tfor (const field of objectIdFields) {\n\t\tif (query?.[field]) {\n\t\t\tif (query?.[field]['$in'] || query?.[field]['$nin']) {\n\t\t\t\tif (query?.[field]['$in']) {\n\t\t\t\t\tquery[field]['$in'] = query?.[field]['$in'].map((id: string) => new mongoose.Types.ObjectId(id));\n\t\t\t\t}\n\t\t\t\tif (query?.[field]['$nin']) {\n\t\t\t\t\tquery[field]['$nin'] = query?.[field]['$nin'].map((id: string) => new mongoose.Types.ObjectId(id));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tquery[field] = new mongoose.Types.ObjectId(query[field]);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Adjusts user population rules:\n * - Excludes sensitive user fields\n * - Populates nested `coreUser`\n */\nexport function normalizeUserPopulate(populate?: any[] | any): void {\n\tif (!Array.isArray(populate)) {\n\t\tpopulate = populate ? [populate] : [];\n\t}\n\n\tconst findUserPopulate = populate.find((populate: any) => populate.path === 'user');\n\n\tif (findUserPopulate) {\n\t\tfindUserPopulate.select = excludeFields(findUserPopulate.select, ProjectionType.USER);\n\t\tfindUserPopulate.populate = {\n\t\t\tpath: 'coreUser',\n\t\t\tselect: '-_id name email profilePhoto',\n\t\t\tmodel: getCoreUserModel(),\n\t\t};\n\t}\n}\n\n/**\n * Normalizes a string by removing diacritics (accents) and punctuation/special chars and converting it to lowercase.\n *\n * @param text - The input string to normalize.\n * @returns The normalized string without accents and punctuation/special chars and in lowercase.\n *\n * @example\n * normalizeName(\"Crème Brûlée\"); // \"creme brulee\"\n * normalizeName(\"São Paulo\"); // \"sao paulo\"\n * normalizeName(\"Ka'ak\"); // \"kaak\"\n */\nexport const normalizeName = (text: string) =>\n\ttext\n\t\t.trim()\n\t\t.normalize('NFD')\n\t\t.replace(/[\\u0300-\\u036f]/g, '') // remove accents\n\t\t.replace(/[^a-zA-Z0-9\\s]/g, '') // remove punctuation/special chars\n\t\t.toLowerCase();\n"]}
1
+ {"version":3,"file":"normalize.js","sourceRoot":"/","sources":["utilities/normalize.ts"],"names":[],"mappings":";;;AAOA,gDAeC;AAOD,sDAeC;AA5CD,oDAAgD;AAChD,6CAA6D;AAC7D,sDAA6D;AAK7D,SAAgB,kBAAkB,CAAC,KAA0B,EAAE,cAAwB;IACtF,KAAK,MAAM,KAAK,IAAI,cAAc,EAAE,CAAC;QAC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IAAI,CAAC,CAAC,QAAa,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC;IAEpF,IAAI,gBAAgB,EAAE,CAAC;QACtB,gBAAgB,CAAC,MAAM,GAAG,IAAA,0BAAa,EAAC,gBAAgB,CAAC,MAAM,EAAE,2BAAc,CAAC,IAAI,CAAC,CAAC;QACtF,gBAAgB,CAAC,QAAQ,GAAG;YAC3B,IAAI,EAAE,UAAU;YAChB,MAAM,EAAE,8BAA8B;YACtC,KAAK,EAAE,IAAA,yBAAgB,GAAE;SACzB,CAAC;IACH,CAAC;AACF,CAAC;AAqBM,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,EAAE,CAC7C,IAAI;KACF,IAAI,EAAE;KACN,SAAS,CAAC,KAAK,CAAC;KAChB,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC;KAC9B,OAAO,CAAC,6BAA6B,EAAE,EAAE,CAAC;KAC1C,WAAW,EAAE,CAAC;AANJ,QAAA,aAAa,iBAMT","sourcesContent":["import { mongoose } from '@typegoose/typegoose';\nimport { excludeFields, ProjectionType } from './projection';\nimport { getCoreUserModel } from '../libraries/mongo/models';\n\n/**\n * Converts specific fields in query to ObjectIds safely.\n */\nexport function normalizeObjectIds(query: Record<string, any>, objectIdFields: string[]): void {\n\tfor (const field of objectIdFields) {\n\t\tif (query?.[field]) {\n\t\t\tif (query?.[field]['$in'] || query?.[field]['$nin']) {\n\t\t\t\tif (query?.[field]['$in']) {\n\t\t\t\t\tquery[field]['$in'] = query?.[field]['$in'].map((id: string) => new mongoose.Types.ObjectId(id));\n\t\t\t\t}\n\t\t\t\tif (query?.[field]['$nin']) {\n\t\t\t\t\tquery[field]['$nin'] = query?.[field]['$nin'].map((id: string) => new mongoose.Types.ObjectId(id));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tquery[field] = new mongoose.Types.ObjectId(query[field]);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Adjusts user population rules:\n * - Excludes sensitive user fields\n * - Populates nested `coreUser`\n */\nexport function normalizeUserPopulate(populate?: any[] | any): void {\n\tif (!Array.isArray(populate)) {\n\t\tpopulate = populate ? [populate] : [];\n\t}\n\n\tconst findUserPopulate = populate.find((populate: any) => populate.path === 'user');\n\n\tif (findUserPopulate) {\n\t\tfindUserPopulate.select = excludeFields(findUserPopulate.select, ProjectionType.USER);\n\t\tfindUserPopulate.populate = {\n\t\t\tpath: 'coreUser',\n\t\t\tselect: '-_id name email profilePhoto',\n\t\t\tmodel: getCoreUserModel(),\n\t\t};\n\t}\n}\n\n/**\n * Normalizes a string by removing diacritics (accents) and punctuation/special chars and converting it to lowercase.\n *\n * @param text - The input string to normalize.\n * @returns The normalized string without accents and punctuation/special chars and in lowercase.\n *\n * @example\n * normalizeName(\"Crème Brûlée\"); // \"creme brulee\"\n * normalizeName(\"São Paulo\"); // \"sao paulo\"\n * normalizeName(\"Ka'ak\"); // \"kaak\"\n */\n// export const normalizeName = (text: string) =>\n// \ttext\n// \t\t.trim()\n// \t\t.normalize('NFD')\n// \t\t.replace(/[\\u0300-\\u036f]/g, '') // remove accents\n// \t\t.replace(/[^a-zA-Z0-9\\s]/g, '') // remove punctuation/special chars\n// \t\t.toLowerCase();\n\nexport const normalizeName = (text: string) =>\n\ttext\n\t\t.trim()\n\t\t.normalize('NFD')\n\t\t.replace(/\\p{Diacritic}/gu, '') // remove accents (Unicode-safe)\n\t\t.replace(/[^\\p{Letter}\\p{Number}\\s]/gu, '') // keep all languages\n\t\t.toLowerCase();\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/core",
3
- "version": "1.3.105",
3
+ "version": "1.3.107",
4
4
  "description": "The Core system of the Lyxa services.",
5
5
  "author": "elie <42282499+Internalizable@users.noreply.github.com>",
6
6
  "license": "MIT",