@unchainedshop/core-currencies 4.4.0 → 4.5.0
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.
|
@@ -6,9 +6,10 @@ export type Currency = {
|
|
|
6
6
|
contractAddress?: string;
|
|
7
7
|
decimals?: number;
|
|
8
8
|
} & TimestampFields;
|
|
9
|
-
export
|
|
9
|
+
export interface CurrencyQuery {
|
|
10
10
|
includeInactive?: boolean;
|
|
11
11
|
contractAddress?: string;
|
|
12
12
|
queryString?: string;
|
|
13
|
-
|
|
13
|
+
isoCodes?: string[];
|
|
14
|
+
}
|
|
14
15
|
export declare const CurrenciesCollection: (db: mongodb.Db) => Promise<mongodb.Collection<Currency>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ModuleInput, mongodb } from '@unchainedshop/mongodb';
|
|
2
2
|
import { type SortOption } from '@unchainedshop/utils';
|
|
3
3
|
import { type Currency, type CurrencyQuery } from '../db/CurrenciesCollection.ts';
|
|
4
|
-
export declare const buildFindSelector: ({ includeInactive, contractAddress, queryString,
|
|
4
|
+
export declare const buildFindSelector: ({ includeInactive, contractAddress, queryString, isoCodes, }: CurrencyQuery) => mongodb.Filter<Currency>;
|
|
5
5
|
export declare const configureCurrenciesModule: ({ db }: ModuleInput<Record<string, never>>) => Promise<{
|
|
6
6
|
findCurrency: (params: {
|
|
7
7
|
isoCode: string;
|
|
@@ -3,15 +3,17 @@ import { generateDbFilterById, buildSortOptions, generateDbObjectId, assertDocum
|
|
|
3
3
|
import { SortDirection } from '@unchainedshop/utils';
|
|
4
4
|
import { CurrenciesCollection } from "../db/CurrenciesCollection.js";
|
|
5
5
|
const CURRENCY_EVENTS = ['CURRENCY_CREATE', 'CURRENCY_UPDATE', 'CURRENCY_REMOVE'];
|
|
6
|
-
export const buildFindSelector = ({ includeInactive = false, contractAddress, queryString,
|
|
6
|
+
export const buildFindSelector = ({ includeInactive = false, contractAddress, queryString, isoCodes, }) => {
|
|
7
7
|
const selector = {
|
|
8
|
-
...rest,
|
|
9
8
|
deleted: null,
|
|
10
9
|
};
|
|
11
10
|
if (!includeInactive)
|
|
12
11
|
selector.isActive = true;
|
|
13
12
|
if (contractAddress)
|
|
14
13
|
selector.contractAddress = contractAddress;
|
|
14
|
+
if (isoCodes) {
|
|
15
|
+
selector.isoCode = { $in: isoCodes };
|
|
16
|
+
}
|
|
15
17
|
if (queryString) {
|
|
16
18
|
assertDocumentDBCompatMode();
|
|
17
19
|
selector.$text = { $search: queryString };
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unchainedshop/core-currencies",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.0",
|
|
4
4
|
"main": "lib/currencies-index.js",
|
|
5
5
|
"types": "lib/currencies-index.d.ts",
|
|
6
6
|
"type": "module",
|
|
7
|
+
"sideEffects": false,
|
|
7
8
|
"scripts": {
|
|
8
9
|
"clean": "tsc -b --clean",
|
|
9
10
|
"build": "tsc -b",
|
|
@@ -33,8 +34,8 @@
|
|
|
33
34
|
},
|
|
34
35
|
"homepage": "https://github.com/unchainedshop/unchained#readme",
|
|
35
36
|
"dependencies": {
|
|
36
|
-
"@unchainedshop/events": "^4.
|
|
37
|
-
"@unchainedshop/utils": "^4.
|
|
37
|
+
"@unchainedshop/events": "^4.5.0",
|
|
38
|
+
"@unchainedshop/utils": "^4.5.0"
|
|
38
39
|
},
|
|
39
40
|
"devDependencies": {
|
|
40
41
|
"@types/node": "^25.0.0",
|