@sprucelabs/mercury-event-emitter 41.0.0 → 41.0.2
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,4 +1,4 @@
|
|
|
1
|
-
import { EmitCallback, EventSignature, MercuryAggregateResponse, MercuryEventEmitter, EventContract, EventNames } from '@sprucelabs/mercury-types';
|
|
1
|
+
import { EmitCallback, EventSignature, MercuryAggregateResponse, MercuryEventEmitter, EventContract, EventNames, ListenerCallback } from '@sprucelabs/mercury-types';
|
|
2
2
|
import { Schema, SchemaValues } from '@sprucelabs/schema';
|
|
3
3
|
export default class AbstractEventEmitter<Contract extends EventContract> implements MercuryEventEmitter<Contract> {
|
|
4
4
|
private shouldEmitSequentally;
|
|
@@ -15,6 +15,6 @@ export default class AbstractEventEmitter<Contract extends EventContract> implem
|
|
|
15
15
|
protected validateEmitPayload(schema: Schema | undefined | null, actualPayload: any, eventName: string): void;
|
|
16
16
|
protected validateResponsePayload(schema: Schema | undefined | null, actualPayload: any, eventName: string): void;
|
|
17
17
|
private normalizePayloadAndCallback;
|
|
18
|
-
on<EventName extends EventNames<Contract>, IEventSignature extends EventSignature = Contract['eventSignatures'][EventName]
|
|
18
|
+
on<EventName extends EventNames<Contract>, IEventSignature extends EventSignature = Contract['eventSignatures'][EventName]>(eventName: EventName, cb: ListenerCallback<IEventSignature>): Promise<void>;
|
|
19
19
|
off(eventName: EventNames<Contract>, cb?: any): Promise<number>;
|
|
20
20
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EmitCallback, EventSignature, MercuryAggregateResponse, MercuryEventEmitter, EventContract, EventNames } from '@sprucelabs/mercury-types';
|
|
1
|
+
import { EmitCallback, EventSignature, MercuryAggregateResponse, MercuryEventEmitter, EventContract, EventNames, ListenerCallback } from '@sprucelabs/mercury-types';
|
|
2
2
|
import { Schema, SchemaValues } from '@sprucelabs/schema';
|
|
3
3
|
export default class AbstractEventEmitter<Contract extends EventContract> implements MercuryEventEmitter<Contract> {
|
|
4
4
|
private shouldEmitSequentally;
|
|
@@ -15,6 +15,6 @@ export default class AbstractEventEmitter<Contract extends EventContract> implem
|
|
|
15
15
|
protected validateEmitPayload(schema: Schema | undefined | null, actualPayload: any, eventName: string): void;
|
|
16
16
|
protected validateResponsePayload(schema: Schema | undefined | null, actualPayload: any, eventName: string): void;
|
|
17
17
|
private normalizePayloadAndCallback;
|
|
18
|
-
on<EventName extends EventNames<Contract>, IEventSignature extends EventSignature = Contract['eventSignatures'][EventName]
|
|
18
|
+
on<EventName extends EventNames<Contract>, IEventSignature extends EventSignature = Contract['eventSignatures'][EventName]>(eventName: EventName, cb: ListenerCallback<IEventSignature>): Promise<void>;
|
|
19
19
|
off(eventName: EventNames<Contract>, cb?: any): Promise<number>;
|
|
20
20
|
}
|
package/package.json
CHANGED
|
@@ -1,109 +1,109 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
2
|
+
"name": "@sprucelabs/mercury-event-emitter",
|
|
3
|
+
"publishConfig": {
|
|
4
|
+
"access": "public"
|
|
5
|
+
},
|
|
6
|
+
"version": "41.0.2",
|
|
7
|
+
"files": [
|
|
8
|
+
"build"
|
|
9
|
+
],
|
|
10
|
+
"skill": {
|
|
11
|
+
"namespace": "mercuryEventEmitter",
|
|
12
|
+
"upgradeIgnoreList": [
|
|
13
|
+
"@sprucelabs/spruce-test-fixtures",
|
|
14
|
+
"@sprucelabs/spruce-core-schemas",
|
|
15
|
+
"@sprucelabs/spruce-skill-utils"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"main": "./build/index.js",
|
|
19
|
+
"types": "./build/index.d.ts",
|
|
20
|
+
"module": "./build/esm/index.js",
|
|
21
|
+
"sideEffects": false,
|
|
22
|
+
"description": "Types for Mercury!",
|
|
23
|
+
"keywords": [
|
|
24
|
+
"node",
|
|
25
|
+
"components",
|
|
26
|
+
"sprucebot",
|
|
27
|
+
"sprucelabs"
|
|
28
|
+
],
|
|
29
|
+
"homepage": "https://github.com/sprucelabsai/mercury-workspace",
|
|
30
|
+
"bugs": {
|
|
31
|
+
"url": "https://github.com/sprucelabsai/mercury-workspace/issues"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build.ci": "yarn build.tsc && yarn build.resolve-paths && yarn lint",
|
|
35
|
+
"build.dev": "yarn build.tsc --sourceMap ; yarn resolve-paths.lint",
|
|
36
|
+
"build.copy-files": "mkdir -p build && rsync -avzq --exclude='*.ts' ./src/ ./build/",
|
|
37
|
+
"build.dist": "tsc --project tsconfig.dist.json && yarn build.resolve-paths && mv build esm && yarn build.esm-postbuild && yarn build.tsc && yarn build.resolve-paths && mv esm build/ && yarn clean.dist",
|
|
38
|
+
"build.esm-postbuild": "esm-postbuild --target esm --patterns '**/*.js'",
|
|
39
|
+
"build.resolve-paths": "resolve-path-aliases --target build --patterns '**/*.js,**/*.d.ts'",
|
|
40
|
+
"build.tsc": "yarn build.copy-files && tsc",
|
|
41
|
+
"build.types": "tsc --emitDeclarationOnly && echo PASS",
|
|
42
|
+
"clean": "yarn clean.build",
|
|
43
|
+
"clean.all": "yarn clean.dependencies && yarn clean.build",
|
|
44
|
+
"clean.build": "rm -rf build/",
|
|
45
|
+
"clean.dependencies": "rm -rf node_modules/ package-lock.json yarn.lock",
|
|
46
|
+
"clean.dist": "rm -rf build/__tests__ build/esm/__tests__",
|
|
47
|
+
"fix.lint": "eslint --fix --cache '**/*.ts'",
|
|
48
|
+
"lint": "eslint --cache '**/*.ts'",
|
|
49
|
+
"rebuild": "cd ../ && yarn rebuild",
|
|
50
|
+
"release": "semantic-release",
|
|
51
|
+
"test": "jest",
|
|
52
|
+
"update.dependencies": "cd ../ && yarn rebuild.dependencies",
|
|
53
|
+
"watch.lint": "concurrently 'yarn lint' \"chokidar 'src/**/*' -c 'yarn lint.tsc'\"",
|
|
54
|
+
"watch.tsc": "tsc -w",
|
|
55
|
+
"post.watch.build": "yarn build.copy-files && yarn build.resolve-paths",
|
|
56
|
+
"watch.build.dev": "tsc-watch --sourceMap --onCompilationComplete 'yarn post.watch.build'",
|
|
57
|
+
"lint.tsc": "tsc -p . --noEmit",
|
|
58
|
+
"resolve-paths.lint": "yarn build.resolve-paths ; yarn lint",
|
|
59
|
+
"upgrade.packages": "yarn-upgrade-all && rm -f yarn.lock ; yarn ; yarn fix.lint ; true",
|
|
60
|
+
"upgrade.packages.all": "yarn install && yarn upgrade.packages",
|
|
61
|
+
"upgrade.packages.test": "yarn upgrade.packages.all && yarn lint && yarn build.dev && yarn test",
|
|
62
|
+
"watch.rebuild": "yarn clean.all && yarn && yarn watch.build.dev"
|
|
63
|
+
},
|
|
64
|
+
"dependencies": {
|
|
65
|
+
"@sprucelabs/error": "^5.1.14",
|
|
66
|
+
"@sprucelabs/mercury-types": "^46.0.1",
|
|
67
|
+
"@sprucelabs/schema": "^29.0.6",
|
|
68
|
+
"@sprucelabs/spruce-event-utils": "^38.0.1"
|
|
69
|
+
},
|
|
70
|
+
"devDependencies": {
|
|
71
|
+
"@sprucelabs/esm-postbuild": "^5.0.31",
|
|
72
|
+
"@sprucelabs/jest-json-reporter": "^7.0.61",
|
|
73
|
+
"@sprucelabs/resolve-path-aliases": "^1.1.229",
|
|
74
|
+
"@sprucelabs/semantic-release": "^4.0.8",
|
|
75
|
+
"@sprucelabs/test": "^8.0.0",
|
|
76
|
+
"@sprucelabs/test-utils": "^4.0.3",
|
|
77
|
+
"@types/node": "^20.4.1",
|
|
78
|
+
"chokidar-cli": "^3.0.0",
|
|
79
|
+
"concurrently": "^8.2.0",
|
|
80
|
+
"eslint": "^8.44.0",
|
|
81
|
+
"eslint-config-spruce": "^10.12.0",
|
|
82
|
+
"jest": "^29.6.1",
|
|
83
|
+
"jest-circus": "^29.6.1",
|
|
84
|
+
"prettier": "2.8.8",
|
|
85
|
+
"ts-node": "^10.9.1",
|
|
86
|
+
"tsc-watch": "^6.0.4",
|
|
87
|
+
"tsconfig-paths": "^4.2.0",
|
|
88
|
+
"typescript": "^5.1.6"
|
|
89
|
+
},
|
|
90
|
+
"jest": {
|
|
91
|
+
"maxWorkers": 4,
|
|
92
|
+
"testTimeout": 5000,
|
|
93
|
+
"testEnvironment": "node",
|
|
94
|
+
"testPathIgnorePatterns": [
|
|
95
|
+
"<rootDir>/tmp/",
|
|
96
|
+
"<rootDir>/src/",
|
|
97
|
+
"<rootDir>/node_modules/",
|
|
98
|
+
"<rootDir>/build/__tests__/testDirsAndFiles/",
|
|
99
|
+
"<rootDir>/build/esm/"
|
|
100
|
+
],
|
|
101
|
+
"testMatch": [
|
|
102
|
+
"**/__tests__/**/*.test.js?(x)"
|
|
103
|
+
],
|
|
104
|
+
"moduleNameMapper": {
|
|
105
|
+
"^#spruce/(.*)$": "<rootDir>/build/.spruce/$1"
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"gitHead": "854b2a88fe5e48e5368191c3855f78a54c1192ab"
|
|
109
109
|
}
|