@unchainedshop/core-events 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/db/EventsCollection.d.ts +2 -2
- package/lib/db/EventsSchema.d.ts +2 -2
- package/lib/db/EventsSchema.js.map +1 -1
- package/lib/events-index.d.ts +1 -1
- package/lib/events-index.js +1 -1
- package/lib/events-index.js.map +1 -1
- package/lib/module/configureEventHistoryAdapter.d.ts +2 -2
- package/lib/module/configureEventsModule.d.ts +2 -2
- package/lib/module/configureEventsModule.js +4 -4
- package/lib/module/configureEventsModule.js.map +1 -1
- package/package.json +6 -6
- package/src/db/EventsCollection.ts +2 -2
- package/src/db/{EventsSchema.js → EventsSchema.ts} +0 -0
- package/src/events-index.ts +1 -1
- package/{tests/events-index.test.ts → src/module/buildFindSelector.test.ts} +1 -1
- package/src/module/configureEventHistoryAdapter.ts +2 -2
- package/src/module/configureEventsModule.ts +7 -7
- package/tsconfig.json +4 -22
package/jest.config.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Db } from '@unchainedshop/types/common';
|
|
2
|
-
import { Event } from '@unchainedshop/types/events';
|
|
1
|
+
import { Db } from '@unchainedshop/types/common.js';
|
|
2
|
+
import { Event } from '@unchainedshop/types/events.js';
|
|
3
3
|
export declare const EventsCollection: (db: Db) => Promise<import("mongodb").Collection<Event>>;
|
package/lib/db/EventsSchema.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import SimpleSchema from 'simpl-schema';
|
|
2
|
+
export declare const EventsSchema: SimpleSchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventsSchema.js","sourceRoot":"","sources":["../../src/db/EventsSchema.
|
|
1
|
+
{"version":3,"file":"EventsSchema.js","sourceRoot":"","sources":["../../src/db/EventsSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,YAAY,MAAM,cAAc,CAAC;AAExC,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,YAAY,CAC1C;IACE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;IACtC,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;IACzC,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;IACzC,GAAG,OAAO,CAAC,eAAe;CAC3B,EACD,EAAE,iBAAiB,EAAE,KAAK,EAAE,CAC7B,CAAC"}
|
package/lib/events-index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { configureEventsModule } from './module/configureEventsModule';
|
|
1
|
+
export { configureEventsModule } from './module/configureEventsModule.js';
|
package/lib/events-index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { configureEventsModule } from './module/configureEventsModule';
|
|
1
|
+
export { configureEventsModule } from './module/configureEventsModule.js';
|
|
2
2
|
//# sourceMappingURL=events-index.js.map
|
package/lib/events-index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events-index.js","sourceRoot":"","sources":["../src/events-index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"events-index.js","sourceRoot":"","sources":["../src/events-index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ModuleMutations } from '@unchainedshop/types/core';
|
|
2
|
-
import { Event } from '@unchainedshop/types/events';
|
|
1
|
+
import { ModuleMutations } from '@unchainedshop/types/core.js';
|
|
2
|
+
import { Event } from '@unchainedshop/types/events.js';
|
|
3
3
|
export declare const configureEventHistoryAdapter: (mutations: ModuleMutations<Event>) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EventQuery, EventsModule } from '@unchainedshop/types/events';
|
|
2
|
-
import { ModuleInput } from '@unchainedshop/types/core';
|
|
1
|
+
import { EventQuery, EventsModule } from '@unchainedshop/types/events.js';
|
|
2
|
+
import { ModuleInput } from '@unchainedshop/types/core.js';
|
|
3
3
|
export declare const buildFindSelector: ({ types, queryString, created }: EventQuery) => {
|
|
4
4
|
type?: any;
|
|
5
5
|
$text?: any;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { generateDbFilterById, generateDbMutations, buildSortOptions } from '@unchainedshop/utils';
|
|
2
2
|
import { getRegisteredEvents } from '@unchainedshop/events';
|
|
3
|
-
import { SortDirection } from '@unchainedshop/types/api';
|
|
4
|
-
import { EventsCollection } from '../db/EventsCollection';
|
|
5
|
-
import { EventsSchema } from '../db/EventsSchema';
|
|
6
|
-
import { configureEventHistoryAdapter } from './configureEventHistoryAdapter';
|
|
3
|
+
import { SortDirection } from '@unchainedshop/types/api.js';
|
|
4
|
+
import { EventsCollection } from '../db/EventsCollection.js';
|
|
5
|
+
import { EventsSchema } from '../db/EventsSchema.js';
|
|
6
|
+
import { configureEventHistoryAdapter } from './configureEventHistoryAdapter.js';
|
|
7
7
|
export const buildFindSelector = ({ types, queryString, created }) => {
|
|
8
8
|
const selector = {};
|
|
9
9
|
if (types && Array.isArray(types))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configureEventsModule.js","sourceRoot":"","sources":["../../src/module/configureEventsModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGnG,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAc,MAAM,
|
|
1
|
+
{"version":3,"file":"configureEventsModule.js","sourceRoot":"","sources":["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
"exports": {
|
|
6
6
|
".": "./lib/events-index.js",
|
|
@@ -31,16 +31,16 @@
|
|
|
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.
|
|
40
|
+
"@unchainedshop/types": "^2.0.0",
|
|
41
|
+
"jest": "^29.4.1",
|
|
42
42
|
"mongodb": "^4.13.0",
|
|
43
|
-
"ts-jest": "^29.0.
|
|
43
|
+
"ts-jest": "^29.0.5",
|
|
44
44
|
"typescript": "^4.9.4"
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Db } from '@unchainedshop/types/common';
|
|
2
|
-
import { Event } from '@unchainedshop/types/events';
|
|
1
|
+
import { Db } from '@unchainedshop/types/common.js';
|
|
2
|
+
import { Event } from '@unchainedshop/types/events.js';
|
|
3
3
|
import { buildDbIndexes } from '@unchainedshop/utils';
|
|
4
4
|
|
|
5
5
|
const TWO_DAYS_SEC = 172800;
|
|
File without changes
|
package/src/events-index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { configureEventsModule } from './module/configureEventsModule';
|
|
1
|
+
export { configureEventsModule } from './module/configureEventsModule.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ModuleMutations } from '@unchainedshop/types/core';
|
|
2
|
-
import { Event, EmitAdapter } from '@unchainedshop/types/events';
|
|
1
|
+
import { ModuleMutations } from '@unchainedshop/types/core.js';
|
|
2
|
+
import { Event, EmitAdapter } from '@unchainedshop/types/events.js';
|
|
3
3
|
import { getEmitHistoryAdapter, setEmitHistoryAdapter } from '@unchainedshop/events';
|
|
4
4
|
|
|
5
5
|
export const configureEventHistoryAdapter = (mutations: ModuleMutations<Event>) => {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { generateDbFilterById, generateDbMutations, buildSortOptions } from '@unchainedshop/utils';
|
|
2
|
-
import { Filter } from '@unchainedshop/types/common';
|
|
3
|
-
import { Event, EventQuery, EventsModule } from '@unchainedshop/types/events';
|
|
2
|
+
import { Filter } from '@unchainedshop/types/common.js';
|
|
3
|
+
import { Event, EventQuery, EventsModule } from '@unchainedshop/types/events.js';
|
|
4
4
|
import { getRegisteredEvents } from '@unchainedshop/events';
|
|
5
|
-
import { SortDirection, SortOption } from '@unchainedshop/types/api';
|
|
6
|
-
import { ModuleInput, ModuleMutations } from '@unchainedshop/types/core';
|
|
7
|
-
import { EventsCollection } from '../db/EventsCollection';
|
|
8
|
-
import { EventsSchema } from '../db/EventsSchema';
|
|
9
|
-
import { configureEventHistoryAdapter } from './configureEventHistoryAdapter';
|
|
5
|
+
import { SortDirection, SortOption } from '@unchainedshop/types/api.js';
|
|
6
|
+
import { ModuleInput, ModuleMutations } from '@unchainedshop/types/core.js';
|
|
7
|
+
import { EventsCollection } from '../db/EventsCollection.js';
|
|
8
|
+
import { EventsSchema } from '../db/EventsSchema.js';
|
|
9
|
+
import { configureEventHistoryAdapter } from './configureEventHistoryAdapter.js';
|
|
10
10
|
|
|
11
11
|
export const buildFindSelector = ({ types, queryString, created }: EventQuery) => {
|
|
12
12
|
const selector: { type?: any; $text?: any; created?: any } = {};
|
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
|
}
|