@lyxa.ai/core 1.4.110 → 1.4.111

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.
@@ -22,7 +22,7 @@ Perfect for sharing types between frontend and backend applications.
22
22
 
23
23
  ## Version
24
24
 
25
- Version: 1.4.110
25
+ Version: 1.4.111
26
26
 
27
27
  ## Dependencies
28
28
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/types",
3
- "version": "1.4.110",
3
+ "version": "1.4.111",
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",
@@ -1,4 +1,4 @@
1
1
  export declare const getExchangeRate: () => Promise<number>;
2
2
  export declare const convertToBase: (amount: number) => Promise<number>;
3
3
  export declare const convertToSecondary: (amount: number) => Promise<number>;
4
- export declare const convertToSecondaryWithExchange: (amount: number, exchangeRate: number) => number;
4
+ export declare const convertToSecondaryWithExchangeRate: (amount: number, exchangeRate: number) => number;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.convertToSecondaryWithExchange = exports.convertToSecondary = exports.convertToBase = exports.getExchangeRate = void 0;
3
+ exports.convertToSecondaryWithExchangeRate = exports.convertToSecondary = exports.convertToBase = exports.getExchangeRate = void 0;
4
4
  const __1 = require("..");
5
5
  const shared_1 = require("./shared");
6
6
  const DEFAULT_EXCHANGE_RATE = 0;
@@ -26,11 +26,11 @@ const convertToSecondary = async (amount) => {
26
26
  return (0, shared_1.roundSecondaryCurrency)(amount * exchangeRate);
27
27
  };
28
28
  exports.convertToSecondary = convertToSecondary;
29
- const convertToSecondaryWithExchange = (amount, exchangeRate) => {
29
+ const convertToSecondaryWithExchangeRate = (amount, exchangeRate) => {
30
30
  if (typeof amount !== 'number' || isNaN(amount)) {
31
31
  return 0;
32
32
  }
33
33
  return (0, shared_1.roundSecondaryCurrency)(amount * exchangeRate);
34
34
  };
35
- exports.convertToSecondaryWithExchange = convertToSecondaryWithExchange;
35
+ exports.convertToSecondaryWithExchangeRate = convertToSecondaryWithExchangeRate;
36
36
  //# sourceMappingURL=currency.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"currency.js","sourceRoot":"/","sources":["utilities/currency.ts"],"names":[],"mappings":";;;AAAA,0BAAkC;AAElC,qCAAqE;AAErE,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAEzB,MAAM,eAAe,GAAG,KAAK,IAAqB,EAAE;IAC1D,MAAM,QAAQ,GAAG,CAAC,MAAM,IAAA,gBAAY,GAAE,CAAC,wBAAwB,EAAE,CAAC,WAAW,EAAE,CAAY,CAAC;IAC5F,MAAM,eAAe,GAAG,QAAQ,CAAC,eAAe,CAAC;IACjD,OAAO,eAAe,EAAE,YAAY,IAAI,qBAAqB,CAAC;AAC/D,CAAC,CAAC;AAJW,QAAA,eAAe,mBAI1B;AAEK,MAAM,aAAa,GAAG,KAAK,EAAE,MAAc,EAAmB,EAAE;IACtE,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;QACjD,OAAO,CAAC,CAAC;IACV,CAAC;IAED,MAAM,YAAY,GAAG,MAAM,IAAA,uBAAe,GAAE,CAAC;IAC7C,OAAO,IAAA,0BAAiB,EAAC,MAAM,GAAG,YAAY,CAAC,CAAC;AACjD,CAAC,CAAC;AAPW,QAAA,aAAa,iBAOxB;AAEK,MAAM,kBAAkB,GAAG,KAAK,EAAE,MAAc,EAAmB,EAAE;IAC3E,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;QACjD,OAAO,CAAC,CAAC;IACV,CAAC;IAED,MAAM,YAAY,GAAG,MAAM,IAAA,uBAAe,GAAE,CAAC;IAC7C,OAAO,IAAA,+BAAsB,EAAC,MAAM,GAAG,YAAY,CAAC,CAAC;AACtD,CAAC,CAAC;AAPW,QAAA,kBAAkB,sBAO7B;AAEK,MAAM,8BAA8B,GAAG,CAAC,MAAc,EAAE,YAAoB,EAAU,EAAE;IAC9F,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;QACjD,OAAO,CAAC,CAAC;IACV,CAAC;IAED,OAAO,IAAA,+BAAsB,EAAC,MAAM,GAAG,YAAY,CAAC,CAAC;AACtD,CAAC,CAAC;AANW,QAAA,8BAA8B,kCAMzC","sourcesContent":["import { getLibraries } from '..';\nimport { Setting } from '../libraries/mongo/models';\nimport { roundBaseCurrency, roundSecondaryCurrency } from './shared';\n\nconst DEFAULT_EXCHANGE_RATE = 0;\n\nexport const getExchangeRate = async (): Promise<number> => {\n\tconst settings = (await getLibraries().getCachedSettingsService().getSettings()) as Setting;\n\tconst currencySetting = settings.currencySetting;\n\treturn currencySetting?.exchangeRate || DEFAULT_EXCHANGE_RATE;\n};\n\nexport const convertToBase = async (amount: number): Promise<number> => {\n\tif (typeof amount !== 'number' || isNaN(amount)) {\n\t\treturn 0;\n\t}\n\n\tconst exchangeRate = await getExchangeRate();\n\treturn roundBaseCurrency(amount / exchangeRate);\n};\n\nexport const convertToSecondary = async (amount: number): Promise<number> => {\n\tif (typeof amount !== 'number' || isNaN(amount)) {\n\t\treturn 0;\n\t}\n\n\tconst exchangeRate = await getExchangeRate();\n\treturn roundSecondaryCurrency(amount * exchangeRate);\n};\n\nexport const convertToSecondaryWithExchange = (amount: number, exchangeRate: number): number => {\n\tif (typeof amount !== 'number' || isNaN(amount)) {\n\t\treturn 0;\n\t}\n\n\treturn roundSecondaryCurrency(amount * exchangeRate);\n};"]}
1
+ {"version":3,"file":"currency.js","sourceRoot":"/","sources":["utilities/currency.ts"],"names":[],"mappings":";;;AAAA,0BAAkC;AAElC,qCAAqE;AAErE,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAEzB,MAAM,eAAe,GAAG,KAAK,IAAqB,EAAE;IAC1D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port { Setting } from '../libraries/mongo/models';\nimport { roundBaseCurrency, roundSecondaryCurrency } from './shared';\n\nconst DEFAULT_EXCHANGE_RATE = 0;\n\nexport const getExchangeRate = async (): Promise<number> => {\n\tconst settings = (await getLibraries().getCachedSettingsService().getSettings()) as Setting;\n\tconst currencySetting = settings.currencySetting;\n\treturn currencySetting?.exchangeRate || DEFAULT_EXCHANGE_RATE;\n};\n\nexport const convertToBase = async (amount: number): Promise<number> => {\n\tif (typeof amount !== 'number' || isNaN(amount)) {\n\t\treturn 0;\n\t}\n\n\tconst exchangeRate = await getExchangeRate();\n\treturn roundBaseCurrency(amount / exchangeRate);\n};\n\nexport const convertToSecondary = async (amount: number): Promise<number> => {\n\tif (typeof amount !== 'number' || isNaN(amount)) {\n\t\treturn 0;\n\t}\n\n\tconst exchangeRate = await getExchangeRate();\n\treturn roundSecondaryCurrency(amount * exchangeRate);\n};\n\nexport const convertToSecondaryWithExchangeRate = (amount: number, exchangeRate: number): number => {\n\tif (typeof amount !== 'number' || isNaN(amount)) {\n\t\treturn 0;\n\t}\n\n\treturn roundSecondaryCurrency(amount * exchangeRate);\n};"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/core",
3
- "version": "1.4.110",
3
+ "version": "1.4.111",
4
4
  "description": "The Core system of the Lyxa services.",
5
5
  "author": "elie <42282499+Internalizable@users.noreply.github.com>",
6
6
  "license": "MIT",