@unchainedshop/core-events 3.1.1 → 3.1.5

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 +1 @@
1
- {"version":3,"file":"EventsCollection.d.ts","sourceRoot":"","sources":["../../src/db/EventsCollection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAIzD,MAAM,MAAM,KAAK,GAAG;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC,GAAG,eAAe,CAAC;AAEpB,eAAO,MAAM,gBAAgB,OAAc,OAAO,CAAC,EAAE,uCAsBpD,CAAC"}
1
+ {"version":3,"file":"EventsCollection.d.ts","sourceRoot":"","sources":["../../src/db/EventsCollection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAIzD,MAAM,MAAM,KAAK,GAAG;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC,GAAG,eAAe,CAAC;AAEpB,eAAO,MAAM,gBAAgB,GAAU,IAAI,OAAO,CAAC,EAAE,uCAsBpD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"configureEventHistoryAdapter.d.ts","sourceRoot":"","sources":["../../src/module/configureEventHistoryAdapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,eAAO,MAAM,4BAA4B,aAC7B,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,cAAc,CAAC,GAAG,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,KAAK,OAAO,CAAC,OAAO,CAAC,SAiBnG,CAAC"}
1
+ {"version":3,"file":"configureEventHistoryAdapter.d.ts","sourceRoot":"","sources":["../../src/module/configureEventHistoryAdapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,eAAO,MAAM,4BAA4B,GACvC,UAAU,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,cAAc,CAAC,GAAG,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,KAAK,OAAO,CAAC,OAAO,CAAC,SAiBnG,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"configureEventsModule.d.ts","sourceRoot":"","sources":["../../src/module/configureEventsModule.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAIP,WAAW,EACZ,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAiB,UAAU,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAClF,OAAO,EAAoB,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAGpE,MAAM,MAAM,WAAW,GAAG;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,iBAAiB,oCAAqC,UAAU;WAClD,GAAG;YAAU,GAAG;c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AI,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,iCAAiC,UAAU;WAClD,GAAG;YAAU,GAAG;cAAY,GAAG;CAMzD,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAU,QAAQ,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;kBAGzD,KAAK;sCAeN,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,YACvD,OAAO,CAAC,WAAW,KAC5B,OAAO,CAAC,KAAK,CAAC;oDAUd,UAAU,GAAG;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;KAC1B,KAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;kBASX,KAAK;mBAOE,UAAU;uCAMP;QAAE,SAAS,CAAC,EAAE,eAAe,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,KAItE,OAAO,CAAC,WAAW,EAAE,CAAC;EAyD5B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unchainedshop/core-events",
3
- "version": "3.1.1",
3
+ "version": "3.1.5",
4
4
  "main": "lib/events-index.js",
5
5
  "types": "lib/events-index.d.ts",
6
6
  "type": "module",
@@ -9,8 +9,8 @@
9
9
  "build": "tsc -b",
10
10
  "prepublishOnly": "npm run clean && npm run build",
11
11
  "watch": "tsc -w",
12
- "test": "NODE_OPTIONS=--experimental-vm-modules jest --detectOpenHandles --forceExit",
13
- "test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch --detectOpenHandles --forceExit"
12
+ "test": "tsx --test",
13
+ "test:watch": "tsx --test --watch"
14
14
  },
15
15
  "repository": {
16
16
  "type": "git",
@@ -36,8 +36,7 @@
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/node": "^22.13.4",
39
- "jest": "^29.7.0",
40
- "ts-jest": "^29.2.5",
39
+ "tsx": "^4.19.2",
41
40
  "typescript": "^5.7.3"
42
41
  }
43
42
  }
@@ -1,36 +1,40 @@
1
+ import { describe, it } from 'node:test';
2
+ import assert from 'node:assert';
1
3
  import { buildFindSelector } from './configureEventsModule.js';
2
4
 
3
5
  describe('buildFindSelector', () => {
4
6
  it('Return correct filter object when passed create, queryString, types', () => {
5
- expect(
7
+ assert.deepStrictEqual(
6
8
  buildFindSelector({
7
9
  created: new Date('2022-12-03T18:23:38.278Z'),
8
10
  queryString: 'Hello world',
9
11
  types: ['PRODUCT_CREATED'],
10
12
  }),
11
- ).toEqual({
12
- type: { $in: ['PRODUCT_CREATED'] },
13
- $text: { $search: 'Hello world' },
14
- created: { $gte: new Date('2022-12-03T18:23:38.278Z') },
15
- });
13
+ {
14
+ type: { $in: ['PRODUCT_CREATED'] },
15
+ $text: { $search: 'Hello world' },
16
+ created: { $gte: new Date('2022-12-03T18:23:38.278Z') },
17
+ },
18
+ );
16
19
  });
17
20
 
18
21
  it('Return correct filter object when passed create, queryString', () => {
19
- expect(
22
+ assert.deepStrictEqual(
20
23
  buildFindSelector({ created: new Date('2022-12-03T18:23:38.278Z'), queryString: 'Hello world' }),
21
- ).toEqual({
22
- $text: { $search: 'Hello world' },
23
- created: { $gte: new Date('2022-12-03T18:23:38.278Z') },
24
- });
24
+ {
25
+ $text: { $search: 'Hello world' },
26
+ created: { $gte: new Date('2022-12-03T18:23:38.278Z') },
27
+ },
28
+ );
25
29
  });
26
30
 
27
31
  it('Return correct filter object when passed create', () => {
28
- expect(buildFindSelector({ created: new Date('2022-12-03T18:23:38.278Z') })).toEqual({
32
+ assert.deepStrictEqual(buildFindSelector({ created: new Date('2022-12-03T18:23:38.278Z') }), {
29
33
  created: { $gte: new Date('2022-12-03T18:23:38.278Z') },
30
34
  });
31
35
  });
32
36
 
33
37
  it('Return correct filter object when passed no argument', () => {
34
- expect(buildFindSelector({})).toEqual({});
38
+ assert.deepStrictEqual(buildFindSelector({}), {});
35
39
  });
36
40
  });
package/jest.config.js DELETED
@@ -1,17 +0,0 @@
1
- /** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
2
- export default {
3
- preset: 'ts-jest/presets/default-esm', // or other ESM presets
4
- testEnvironment: 'node',
5
- extensionsToTreatAsEsm: ['.ts'],
6
- transform: {
7
- '^.+\\.tsx?$': [
8
- 'ts-jest',
9
- {
10
- useESM: true,
11
- },
12
- ],
13
- },
14
- moduleNameMapper: {
15
- '^(\\.{1,2}/.*)\\.js$': '$1',
16
- },
17
- };
@@ -1,3 +0,0 @@
1
- import SimpleSchema from 'simpl-schema';
2
- export declare const EventsSchema: SimpleSchema;
3
- //# sourceMappingURL=EventsSchema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EventsSchema.d.ts","sourceRoot":"","sources":["../../src/db/EventsSchema.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,cAAc,CAAC;AAExC,eAAO,MAAM,YAAY,cAQxB,CAAC"}
@@ -1,9 +0,0 @@
1
- import { Schemas } from '@unchainedshop/utils';
2
- import SimpleSchema from 'simpl-schema';
3
- export const EventsSchema = new SimpleSchema({
4
- type: { type: String, required: true },
5
- payload: { type: Object, blackbox: true },
6
- context: { type: Object, blackbox: true },
7
- ...Schemas.timestampFields,
8
- }, { requiredByDefault: false });
9
- //# sourceMappingURL=EventsSchema.js.map
@@ -1 +0,0 @@
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"}