@unchainedshop/core-currencies 2.0.0-rc.3 → 2.0.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.
- package/jest.config.js +3 -0
- package/lib/currencies-index.d.ts +1 -1
- package/lib/currencies-index.js +1 -1
- package/lib/currencies-index.js.map +1 -1
- package/lib/db/CurrenciesCollection.d.ts +2 -2
- package/lib/db/CurrenciesSchema.d.ts +2 -2
- package/lib/db/CurrenciesSchema.js.map +1 -1
- package/lib/module/configureCurrenciesModule.d.ts +2 -2
- package/lib/module/configureCurrenciesModule.js +3 -3
- package/lib/module/configureCurrenciesModule.js.map +1 -1
- package/package.json +6 -6
- package/src/currencies-index.ts +1 -1
- package/src/db/CurrenciesCollection.ts +2 -2
- package/src/db/{CurrenciesSchema.js → CurrenciesSchema.ts} +0 -0
- package/{tests/currencies-index.test.ts → src/module/buildFindSelector.test.ts} +3 -3
- package/src/module/configureCurrenciesModule.ts +5 -5
- package/tsconfig.json +4 -22
package/jest.config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { configureCurrenciesModule } from './module/configureCurrenciesModule';
|
|
1
|
+
export { configureCurrenciesModule } from './module/configureCurrenciesModule.js';
|
package/lib/currencies-index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { configureCurrenciesModule } from './module/configureCurrenciesModule';
|
|
1
|
+
export { configureCurrenciesModule } from './module/configureCurrenciesModule.js';
|
|
2
2
|
//# sourceMappingURL=currencies-index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"currencies-index.js","sourceRoot":"","sources":["../src/currencies-index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"currencies-index.js","sourceRoot":"","sources":["../src/currencies-index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Db } from '@unchainedshop/types/common';
|
|
2
|
-
import { Currency } from '@unchainedshop/types/currencies';
|
|
1
|
+
import { Db } from '@unchainedshop/types/common.js';
|
|
2
|
+
import { Currency } from '@unchainedshop/types/currencies.js';
|
|
3
3
|
export declare const CurrenciesCollection: (db: Db) => Promise<import("mongodb").Collection<Currency>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import SimpleSchema from 'simpl-schema';
|
|
2
|
+
export declare const CurrenciesSchema: SimpleSchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurrenciesSchema.js","sourceRoot":"","sources":["../../src/db/CurrenciesSchema.
|
|
1
|
+
{"version":3,"file":"CurrenciesSchema.js","sourceRoot":"","sources":["../../src/db/CurrenciesSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,YAAY,MAAM,cAAc,CAAC;AAExC,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,YAAY,CAC9C;IACE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;IACzC,QAAQ,EAAE,OAAO;IACjB,eAAe,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE;IAClD,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE;IAC3C,GAAG,OAAO,CAAC,eAAe;CAC3B,EACD,EAAE,iBAAiB,EAAE,KAAK,EAAE,CAC7B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ModuleInput } from '@unchainedshop/types/core';
|
|
2
|
-
import { CurrenciesModule, CurrencyQuery } from '@unchainedshop/types/currencies';
|
|
1
|
+
import { ModuleInput } from '@unchainedshop/types/core.js';
|
|
2
|
+
import { CurrenciesModule, CurrencyQuery } from '@unchainedshop/types/currencies.js';
|
|
3
3
|
export declare const buildFindSelector: ({ includeInactive, contractAddress, queryString, }: CurrencyQuery) => {
|
|
4
4
|
isActive?: true;
|
|
5
5
|
deleted: null;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { emit, registerEvents } from '@unchainedshop/events';
|
|
2
2
|
import { generateDbMutations, generateDbFilterById, buildSortOptions } from '@unchainedshop/utils';
|
|
3
|
-
import { SortDirection } from '@unchainedshop/types/api';
|
|
4
|
-
import { CurrenciesCollection } from '../db/CurrenciesCollection';
|
|
5
|
-
import { CurrenciesSchema } from '../db/CurrenciesSchema';
|
|
3
|
+
import { SortDirection } from '@unchainedshop/types/api.js';
|
|
4
|
+
import { CurrenciesCollection } from '../db/CurrenciesCollection.js';
|
|
5
|
+
import { CurrenciesSchema } from '../db/CurrenciesSchema.js';
|
|
6
6
|
const CURRENCY_EVENTS = ['CURRENCY_CREATE', 'CURRENCY_UPDATE', 'CURRENCY_REMOVE'];
|
|
7
7
|
export const buildFindSelector = ({ includeInactive = false, contractAddress, queryString, }) => {
|
|
8
8
|
const selector = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configureCurrenciesModule.js","sourceRoot":"","sources":["../../src/module/configureCurrenciesModule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACnG,OAAO,EAAE,aAAa,EAAc,MAAM,
|
|
1
|
+
{"version":3,"file":"configureCurrenciesModule.js","sourceRoot":"","sources":["../../src/module/configureCurrenciesModule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACnG,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,EAAE,UAAU,EAAE,CAAC,CAAC;YAC9C,OAAO,UAAU,CAAC;QACpB,CAAC;QAED,MAAM,EAAE,KAAK,EAAE,GAAW,EAAE,GAAsB,EAAE,EAAE;YACpD,MAAM,UAAU,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC,GAAG,EAAE;gBAC7C,GAAG,GAAG;gBACN,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE;aACnC,CAAC,CAAC;YACH,MAAM,IAAI,CAAC,iBAAiB,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;YAC9C,OAAO,UAAU,CAAC;QACpB,CAAC;QAED,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE;YAC3B,MAAM,YAAY,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;YACxD,MAAM,IAAI,CAAC,iBAAiB,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;YAC9C,OAAO,YAAY,CAAC;QACtB,CAAC;QAED,iBAAiB,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;YAC/B,OAAO,SAAS,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;QAC1C,CAAC;KACF,CAAC;AACJ,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unchainedshop/core-currencies",
|
|
3
|
-
"version": "2.0.0
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"main": "lib/currencies-index.js",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./lib/currencies-index.js",
|
|
@@ -31,15 +31,15 @@
|
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://github.com/unchainedshop/unchained#readme",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@unchainedshop/events": "^2.0.0
|
|
35
|
-
"@unchainedshop/utils": "^2.0.0
|
|
34
|
+
"@unchainedshop/events": "^2.0.0",
|
|
35
|
+
"@unchainedshop/utils": "^2.0.0",
|
|
36
36
|
"simpl-schema": "=3.2.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/node": "^18.11.18",
|
|
40
|
-
"@unchainedshop/types": "^2.0.0
|
|
41
|
-
"jest": "^29.
|
|
42
|
-
"ts-jest": "^29.0.
|
|
40
|
+
"@unchainedshop/types": "^2.0.0",
|
|
41
|
+
"jest": "^29.4.1",
|
|
42
|
+
"ts-jest": "^29.0.5",
|
|
43
43
|
"typescript": "^4.9.4"
|
|
44
44
|
}
|
|
45
45
|
}
|
package/src/currencies-index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { configureCurrenciesModule } from './module/configureCurrenciesModule';
|
|
1
|
+
export { configureCurrenciesModule } from './module/configureCurrenciesModule.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Db } from '@unchainedshop/types/common';
|
|
2
|
-
import { Currency } from '@unchainedshop/types/currencies';
|
|
1
|
+
import { Db } from '@unchainedshop/types/common.js';
|
|
2
|
+
import { Currency } from '@unchainedshop/types/currencies.js';
|
|
3
3
|
import { buildDbIndexes } from '@unchainedshop/utils';
|
|
4
4
|
|
|
5
5
|
export const CurrenciesCollection = async (db: Db) => {
|
|
File without changes
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {buildFindSelector} from
|
|
1
|
+
import { buildFindSelector } from "./configureCurrenciesModule.js";
|
|
2
2
|
|
|
3
|
-
describe('
|
|
3
|
+
describe('buildFindSelector', () => {
|
|
4
4
|
|
|
5
|
-
it('
|
|
5
|
+
it('should return correct filter object', async () => {
|
|
6
6
|
|
|
7
7
|
expect(buildFindSelector({contractAddress: '0xf12EC0F79a8855d093DeCe22b24c0603f5b8E34A', includeInactive: true, queryString: 'hello world'})).toEqual({
|
|
8
8
|
deleted: null,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ModuleInput, ModuleMutations } from '@unchainedshop/types/core';
|
|
2
|
-
import { CurrenciesModule, Currency, CurrencyQuery } from '@unchainedshop/types/currencies';
|
|
1
|
+
import { ModuleInput, ModuleMutations } from '@unchainedshop/types/core.js';
|
|
2
|
+
import { CurrenciesModule, Currency, CurrencyQuery } from '@unchainedshop/types/currencies.js';
|
|
3
3
|
import { emit, registerEvents } from '@unchainedshop/events';
|
|
4
4
|
import { generateDbMutations, generateDbFilterById, buildSortOptions } from '@unchainedshop/utils';
|
|
5
|
-
import { SortDirection, SortOption } from '@unchainedshop/types/api';
|
|
6
|
-
import { CurrenciesCollection } from '../db/CurrenciesCollection';
|
|
7
|
-
import { CurrenciesSchema } from '../db/CurrenciesSchema';
|
|
5
|
+
import { SortDirection, SortOption } from '@unchainedshop/types/api.js';
|
|
6
|
+
import { CurrenciesCollection } from '../db/CurrenciesCollection.js';
|
|
7
|
+
import { CurrenciesSchema } from '../db/CurrenciesSchema.js';
|
|
8
8
|
|
|
9
9
|
const CURRENCY_EVENTS: string[] = ['CURRENCY_CREATE', 'CURRENCY_UPDATE', 'CURRENCY_REMOVE'];
|
|
10
10
|
|
package/tsconfig.json
CHANGED
|
@@ -1,29 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
+
"extends": "../shared/base.tsconfig.json",
|
|
2
3
|
"compilerOptions": {
|
|
3
|
-
"
|
|
4
|
-
"allowSyntheticDefaultImports": true,
|
|
5
|
-
"declaration": true,
|
|
6
|
-
"esModuleInterop": true,
|
|
7
|
-
"experimentalDecorators": true,
|
|
8
|
-
"forceConsistentCasingInFileNames": true,
|
|
9
|
-
"lib": [
|
|
10
|
-
"esnext"
|
|
11
|
-
],
|
|
12
|
-
"module": "esnext",
|
|
13
|
-
"moduleResolution": "node",
|
|
14
|
-
"noImplicitReturns": true,
|
|
15
|
-
"noUnusedLocals": false,
|
|
4
|
+
"rootDir": "src",
|
|
16
5
|
"outDir": "lib",
|
|
17
|
-
"preserveWatchOutput": true,
|
|
18
|
-
"skipLibCheck": true,
|
|
19
|
-
"sourceMap": true,
|
|
20
|
-
"target": "esnext",
|
|
21
|
-
"types": [
|
|
22
|
-
"node",
|
|
23
|
-
"jest"
|
|
24
|
-
]
|
|
25
6
|
},
|
|
7
|
+
"exclude": ["**/*.test.ts", "**/*.test.js", "tests"],
|
|
26
8
|
"include": [
|
|
27
|
-
"src"
|
|
9
|
+
"./src"
|
|
28
10
|
]
|
|
29
11
|
}
|