@lyxa.ai/core 1.2.40 → 1.2.42

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.
@@ -5,4 +5,5 @@ export declare class CashSettlement {
5
5
  secondaryReceivedAmount?: number;
6
6
  returnedAmount?: number;
7
7
  secondaryReturnedAmount?: number;
8
+ orderReceiptImage?: string;
8
9
  }
@@ -18,6 +18,7 @@ class CashSettlement {
18
18
  secondaryReceivedAmount;
19
19
  returnedAmount;
20
20
  secondaryReturnedAmount;
21
+ orderReceiptImage;
21
22
  }
22
23
  exports.CashSettlement = CashSettlement;
23
24
  __decorate([
@@ -44,4 +45,8 @@ __decorate([
44
45
  (0, typegoose_1.prop)({ type: Number, default: 0 }),
45
46
  __metadata("design:type", Number)
46
47
  ], CashSettlement.prototype, "secondaryReturnedAmount", void 0);
48
+ __decorate([
49
+ (0, typegoose_1.prop)({ type: String }),
50
+ __metadata("design:type", String)
51
+ ], CashSettlement.prototype, "orderReceiptImage", void 0);
47
52
  //# sourceMappingURL=cash-settlement.model.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cash-settlement.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/cash-settlement.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA4C;AAE5C,MAAa,cAAc;IAE1B,gBAAgB,CAAU;IAG1B,yBAAyB,CAAU;IAGnC,cAAc,CAAU;IAGxB,uBAAuB,CAAU;IAGjC,cAAc,CAAU;IAGxB,uBAAuB,CAAU;CACjC;AAlBD,wCAkBC;AAhBA;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;wDACT;AAG1B;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;iEACA;AAGnC;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;sDACX;AAGxB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;+DACF;AAGjC;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;sDACX;AAGxB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;+DACF","sourcesContent":["import { prop } from '@typegoose/typegoose';\n\nexport class CashSettlement {\n\t@prop({ type: Number, default: 0 })\n\tsettlementAmount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tsecondarySettlementAmount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\treceivedAmount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tsecondaryReceivedAmount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\treturnedAmount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tsecondaryReturnedAmount?: number;\n}\n"]}
1
+ {"version":3,"file":"cash-settlement.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/cash-settlement.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA4C;AAE5C,MAAa,cAAc;IAE1B,gBAAgB,CAAU;IAG1B,yBAAyB,CAAU;IAGnC,cAAc,CAAU;IAGxB,uBAAuB,CAAU;IAGjC,cAAc,CAAU;IAGxB,uBAAuB,CAAU;IAGjC,iBAAiB,CAAU;CAE3B;AAtBD,wCAsBC;AApBA;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;wDACT;AAG1B;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;iEACA;AAGnC;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;sDACX;AAGxB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;+DACF;AAGjC;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;sDACX;AAGxB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;+DACF;AAGjC;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yDACI","sourcesContent":["import { prop } from '@typegoose/typegoose';\n\nexport class CashSettlement {\n\t@prop({ type: Number, default: 0 })\n\tsettlementAmount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tsecondarySettlementAmount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\treceivedAmount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tsecondaryReceivedAmount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\treturnedAmount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tsecondaryReturnedAmount?: number;\n\n\t@prop({ type: String })\n\torderReceiptImage?: string;\n\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.2.40
25
+ Version: 1.2.42
26
26
 
27
27
  ## Dependencies
28
28
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/types",
3
- "version": "1.2.40",
3
+ "version": "1.2.42",
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",
@@ -9,8 +9,13 @@ const models_1 = require("../libraries/mongo/models");
9
9
  function normalizeObjectIds(query, objectIdFields) {
10
10
  for (const field of objectIdFields) {
11
11
  if (query?.[field]) {
12
- if (query?.[field]['$in']) {
13
- query[field]['$in'] = query?.[field]['$in'].map((id) => new typegoose_1.mongoose.Types.ObjectId(id));
12
+ if (query?.[field]['$in'] || query?.[field]['$nin']) {
13
+ if (query?.[field]['$in']) {
14
+ query[field]['$in'] = query?.[field]['$in'].map((id) => new typegoose_1.mongoose.Types.ObjectId(id));
15
+ }
16
+ if (query?.[field]['$nin']) {
17
+ query[field]['$nin'] = query?.[field]['$nin'].map((id) => new typegoose_1.mongoose.Types.ObjectId(id));
18
+ }
14
19
  }
15
20
  else {
16
21
  query[field] = new typegoose_1.mongoose.Types.ObjectId(query[field]);
@@ -1 +1 @@
1
- {"version":3,"file":"normalize.js","sourceRoot":"/","sources":["utilities/normalize.ts"],"names":[],"mappings":";;;AAOA,gDAUC;AAOD,sDAeC;AAvCD,oDAAgD;AAChD,6CAA6D;AAC7D,sDAA6D;AAK7D,SAAgB,kBAAkB,CAAC,KAA0B,EAAE,cAAwB;IACtF,KAAK,MAAM,KAAK,IAAI,cAAc,EAAE,CAAC;QACpC,IAAI,KAAK,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;YACpB,IAAI,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC3B,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,oBAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;YAClG,CAAC;iBAAM,CAAC;gBACP,KAAK,CAAC,KAAK,CAAC,GAAG,IAAI,oBAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;YAC1D,CAAC;QACF,CAAC;IACF,CAAC;AACF,CAAC;AAOD,SAAgB,qBAAqB,CAAC,QAAsB;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']) {\n\t\t\t\tquery[field]['$in'] = query?.[field]['$in'].map((id: string) => new mongoose.Types.ObjectId(id));\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;QACpC,IAAI,KAAK,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;YACpB,IAAI,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;gBACrD,IAAI,KAAK,EAAE,CAAC,KAAK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I,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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/core",
3
- "version": "1.2.40",
3
+ "version": "1.2.42",
4
4
  "description": "The Core system of the Lyxa services.",
5
5
  "author": "elie <42282499+Internalizable@users.noreply.github.com>",
6
6
  "license": "MIT",