@unchainedshop/core-currencies 4.8.10 → 4.8.12
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.
|
@@ -1,27 +1,22 @@
|
|
|
1
|
-
import { mongodb, buildDbIndexes
|
|
1
|
+
import { mongodb, buildDbIndexes } from '@unchainedshop/mongodb';
|
|
2
2
|
export const CurrenciesCollection = async (db) => {
|
|
3
3
|
const Currencies = db.collection('currencies');
|
|
4
|
-
if (!isDocumentDBCompatModeEnabled()) {
|
|
5
|
-
await buildDbIndexes(Currencies, [
|
|
6
|
-
{
|
|
7
|
-
index: { isoCode: 'text', _id: 'text' },
|
|
8
|
-
options: {
|
|
9
|
-
weights: {
|
|
10
|
-
_id: 8,
|
|
11
|
-
isoCode: 6,
|
|
12
|
-
},
|
|
13
|
-
name: 'currencies_fulltext_search',
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
]);
|
|
17
|
-
}
|
|
18
4
|
await buildDbIndexes(Currencies, [
|
|
19
|
-
{ index: { isoCode: 1 }, options: { unique: true } },
|
|
20
5
|
{
|
|
21
|
-
index: {
|
|
22
|
-
|
|
6
|
+
index: { isoCode: 'text', _id: 'text' },
|
|
7
|
+
options: {
|
|
8
|
+
weights: {
|
|
9
|
+
_id: 8,
|
|
10
|
+
isoCode: 6,
|
|
11
|
+
},
|
|
12
|
+
name: 'currencies_fulltext_search',
|
|
23
13
|
},
|
|
24
14
|
},
|
|
25
15
|
]);
|
|
16
|
+
await buildDbIndexes(Currencies, [
|
|
17
|
+
{ index: { isoCode: 1 }, options: { unique: true } },
|
|
18
|
+
{ index: { deleted: 1 } },
|
|
19
|
+
{ index: { contractAddress: 1 }, options: { sparse: true } },
|
|
20
|
+
]);
|
|
26
21
|
return Currencies;
|
|
27
22
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { emit, registerEvents } from '@unchainedshop/events';
|
|
2
|
-
import { generateDbFilterById, buildSortOptions, generateDbObjectId,
|
|
2
|
+
import { generateDbFilterById, buildSortOptions, generateDbObjectId, mongodb, } from '@unchainedshop/mongodb';
|
|
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'];
|
|
@@ -15,7 +15,6 @@ export const buildFindSelector = ({ includeInactive = false, contractAddress, qu
|
|
|
15
15
|
selector.isoCode = { $in: isoCodes };
|
|
16
16
|
}
|
|
17
17
|
if (queryString) {
|
|
18
|
-
assertDocumentDBCompatMode();
|
|
19
18
|
selector.$text = { $search: queryString };
|
|
20
19
|
}
|
|
21
20
|
return selector;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unchainedshop/core-currencies",
|
|
3
3
|
"description": "Currency management module for the Unchained Engine",
|
|
4
|
-
"version": "4.8.
|
|
4
|
+
"version": "4.8.12",
|
|
5
5
|
"main": "lib/currencies-index.js",
|
|
6
6
|
"types": "lib/currencies-index.d.ts",
|
|
7
7
|
"type": "module",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
},
|
|
36
36
|
"homepage": "https://github.com/unchainedshop/unchained#readme",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@unchainedshop/events": "^4.
|
|
39
|
-
"@unchainedshop/utils": "^4.
|
|
38
|
+
"@unchainedshop/events": "^4.8.12",
|
|
39
|
+
"@unchainedshop/utils": "^4.8.12"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/node": "^25.0.0",
|