@unchainedshop/core-events 1.2.11 → 1.2.21
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/lib/module/configureEventHistoryAdapter.d.ts +1 -1
- package/lib/module/configureEventsModule.d.ts +1 -1
- package/lib/module/configureEventsModule.js +2 -1
- package/lib/module/configureEventsModule.js.map +1 -1
- package/package.json +10 -10
- package/src/module/configureEventHistoryAdapter.ts +1 -1
- package/src/module/configureEventsModule.ts +4 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ModuleMutations } from '@unchainedshop/types/
|
|
1
|
+
import { ModuleMutations } from '@unchainedshop/types/core';
|
|
2
2
|
import { Event } from '@unchainedshop/types/events';
|
|
3
3
|
export declare const configureEventHistoryAdapter: (mutations: ModuleMutations<Event>) => void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ModuleInput } from '@unchainedshop/types/common';
|
|
2
1
|
import { EventsModule } from '@unchainedshop/types/events';
|
|
2
|
+
import { ModuleInput } from '@unchainedshop/types/core';
|
|
3
3
|
export declare const configureEventsModule: ({ db, }: ModuleInput<Record<string, never>>) => Promise<EventsModule>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { generateDbFilterById, generateDbMutations, buildSortOptions } from '@unchainedshop/utils';
|
|
2
2
|
import { getRegisteredEvents } from '@unchainedshop/events';
|
|
3
|
+
import { SortDirection } from '@unchainedshop/types/api';
|
|
3
4
|
import { EventsCollection } from '../db/EventsCollection';
|
|
4
5
|
import { EventsSchema } from '../db/EventsSchema';
|
|
5
6
|
import { configureEventHistoryAdapter } from './configureEventHistoryAdapter';
|
|
@@ -29,7 +30,7 @@ export const configureEventsModule = async ({ db, }) => {
|
|
|
29
30
|
return Events.find(buildFindSelector(query), {
|
|
30
31
|
skip: offset,
|
|
31
32
|
limit,
|
|
32
|
-
sort: buildSortOptions(sort || [{ key: 'created', value:
|
|
33
|
+
sort: buildSortOptions(sort || [{ key: 'created', value: SortDirection.DESC }]),
|
|
33
34
|
}).toArray();
|
|
34
35
|
},
|
|
35
36
|
type: (event) => {
|
|
@@ -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,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAE9E,MAAM,iBAAiB,GAAG,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAc,EAAE,EAAE;IACxE,MAAM,QAAQ,GAA+C,EAAE,CAAC;IAEhE,IAAI,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,QAAQ,CAAC,IAAI,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;IAClE,IAAI,WAAW;QAAE,QAAQ,CAAC,KAAK,GAAG,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;IAC3D,IAAI,OAAO;QAAE,QAAQ,CAAC,OAAO,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IAClD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,EAAE,EAC1C,EAAE,GACiC,EAAyB,EAAE;IAC9D,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,EAAE,CAAC,CAAC;IAE1C,MAAM,SAAS,GAAG,mBAAmB,CAAQ,MAAM,EAAE,YAAY,EAAE;QACjE,aAAa,EAAE,IAAI;KACpB,CAA2B,CAAC;IAE7B,4BAA4B,CAAC,SAA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AC9F,CAAC,CAAC,OAAO,EAAE,CAAC;QACf,CAAC;QAED,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE;YACd,IAAI,mBAAmB,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;gBAC9C,OAAO,KAAK,CAAC,IAAI,CAAC;aACnB;YACD,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YACrB,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;YACpE,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC;AACJ,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unchainedshop/core-events",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.21",
|
|
4
4
|
"main": "lib/events-index.js",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./lib/events-index.js",
|
|
@@ -30,17 +30,17 @@
|
|
|
30
30
|
},
|
|
31
31
|
"homepage": "https://github.com/unchainedshop/unchained#readme",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@unchainedshop/events": "1.
|
|
34
|
-
"@unchainedshop/utils": "1.
|
|
35
|
-
"simpl-schema": "^1.12.
|
|
33
|
+
"@unchainedshop/events": "^1.2.21",
|
|
34
|
+
"@unchainedshop/utils": "^1.2.21",
|
|
35
|
+
"simpl-schema": "^1.12.3"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@types/node": "^16.11.
|
|
39
|
-
"@unchainedshop/types": "1.
|
|
38
|
+
"@types/node": "^16.11.57",
|
|
39
|
+
"@unchainedshop/types": "^1.2.21",
|
|
40
|
+
"jest": "^29.0.2",
|
|
41
|
+
"mongodb": "^4.9.1",
|
|
40
42
|
"node-fetch": "^3.2.10",
|
|
41
|
-
"jest": "^28.
|
|
42
|
-
"
|
|
43
|
-
"ts-jest": "^28.0.5",
|
|
44
|
-
"typescript": "^4.7.4"
|
|
43
|
+
"ts-jest": "^28.0.8",
|
|
44
|
+
"typescript": "^4.8.2"
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ModuleMutations } from '@unchainedshop/types/
|
|
1
|
+
import { ModuleMutations } from '@unchainedshop/types/core';
|
|
2
2
|
import { Event, EmitAdapter } from '@unchainedshop/types/events';
|
|
3
3
|
import { getEmitHistoryAdapter, setEmitHistoryAdapter } from '@unchainedshop/events';
|
|
4
4
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { generateDbFilterById, generateDbMutations, buildSortOptions } from '@unchainedshop/utils';
|
|
2
|
-
import {
|
|
2
|
+
import { Filter } from '@unchainedshop/types/common';
|
|
3
3
|
import { Event, EventQuery, EventsModule } from '@unchainedshop/types/events';
|
|
4
4
|
import { getRegisteredEvents } from '@unchainedshop/events';
|
|
5
|
+
import { SortDirection, SortOption } from '@unchainedshop/types/api';
|
|
6
|
+
import { ModuleInput, ModuleMutations } from '@unchainedshop/types/core';
|
|
5
7
|
import { EventsCollection } from '../db/EventsCollection';
|
|
6
8
|
import { EventsSchema } from '../db/EventsSchema';
|
|
7
9
|
import { configureEventHistoryAdapter } from './configureEventHistoryAdapter';
|
|
@@ -37,7 +39,7 @@ export const configureEventsModule = async ({
|
|
|
37
39
|
return Events.find(buildFindSelector(query), {
|
|
38
40
|
skip: offset,
|
|
39
41
|
limit,
|
|
40
|
-
sort: buildSortOptions(sort || [{ key: 'created', value:
|
|
42
|
+
sort: buildSortOptions(sort || [{ key: 'created', value: SortDirection.DESC } as SortOption]),
|
|
41
43
|
}).toArray();
|
|
42
44
|
},
|
|
43
45
|
|