@econ-v1/rpc 7.6.24 → 7.6.25
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/dist/client.d.ts
CHANGED
|
@@ -49,12 +49,12 @@ export type PreparedStage = {
|
|
|
49
49
|
readonly version: string;
|
|
50
50
|
};
|
|
51
51
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* human-readable `message` crosses the port, matching what `live-query.failed` puts on the wire.
|
|
52
|
+
* A live-query failure: run failures carry a human-readable `message`, and rejected
|
|
53
|
+
* subscribe requests also preserve the error code when one is provided.
|
|
55
54
|
*/
|
|
56
55
|
export type LiveQueryFailure = {
|
|
57
56
|
readonly message: string;
|
|
57
|
+
readonly code?: string;
|
|
58
58
|
};
|
|
59
59
|
export type KernelRpcClient = {
|
|
60
60
|
command<T>(name: string, payload: unknown): Promise<T>;
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.js"],"names":[],"mappings":"0BAEc,OAAO,iBAAiB,EAAE,WAAW;8BACrC,OAAO,iBAAiB,EAAE,eAAe;wBACzC,OAAO,iBAAiB,EAAE,SAAS;0BACnC,MAAM,IAAI;;;;;;gCAKX,OAAO,gBAAgB,EAAE,yBAAyB;;;;oCAIlD;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAA;CAAE;;;;;;;gCAOzD,WAAW,GAAG;IAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,iBAAiB,CAAA;CAAE;;;;;;;;;;;;;;;;;;4BAkBjG;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAA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,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,iBAAiB,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,GAAG,WAAW,CAAC;IAC3K,OAAO,CAAC,CAAC,SAAS,eAAe,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,iBAAiB,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrH,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACvD,SAAS,CAAC,CAAC,SAAS,eAAe,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,iBAAiB,EAAE,iBAAiB,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,iBAAiB,CAAA;CAC7K"}
|
|
@@ -37,11 +37,12 @@ export class MessagePortKernelRpcClient implements KernelRpcClient {
|
|
|
37
37
|
* @param {QueryName} name
|
|
38
38
|
* @param {unknown} params
|
|
39
39
|
* @param {(diff: import("@econ-v1/domain").QueryDiff<T>) => void} listener
|
|
40
|
-
* @param {(error: { readonly message: string }) => void} [onError]
|
|
40
|
+
* @param {(error: { readonly message: string, readonly code?: string }) => void} [onError]
|
|
41
41
|
* @returns {Unsubscribe}
|
|
42
42
|
*/
|
|
43
43
|
liveQuery<T>(name: QueryName, params: unknown, listener: (diff: import("@econ-v1/domain").QueryDiff<T>) => void, onError?: (error: {
|
|
44
44
|
readonly message: string;
|
|
45
|
+
readonly code?: string;
|
|
45
46
|
}) => void): Unsubscribe;
|
|
46
47
|
/**
|
|
47
48
|
* @param {string} appName
|
|
@@ -97,11 +98,12 @@ export class MessagePortKernelRpcClient implements KernelRpcClient {
|
|
|
97
98
|
* @param {QueryName} name
|
|
98
99
|
* @param {unknown} params
|
|
99
100
|
* @param {(diff: import("@econ-v1/domain").QueryDiff<T>) => void} listener
|
|
100
|
-
* @param {(error: { readonly message: string }) => void} [onError]
|
|
101
|
+
* @param {(error: { readonly message: string, readonly code?: string }) => void} [onError]
|
|
101
102
|
* @returns {Unsubscribe}
|
|
102
103
|
*/
|
|
103
104
|
liveQueryStage<T>(sessionId: string, name: QueryName, params: unknown, listener: (diff: import("@econ-v1/domain").QueryDiff<T>) => void, onError?: (error: {
|
|
104
105
|
readonly message: string;
|
|
106
|
+
readonly code?: string;
|
|
105
107
|
}) => void): Unsubscribe;
|
|
106
108
|
/**
|
|
107
109
|
* @template {KernelEventType} T
|
|
@@ -169,6 +171,7 @@ export type EventGroup = {
|
|
|
169
171
|
export type LiveQueryGroup = {
|
|
170
172
|
readonly errorListeners: Set<(error: {
|
|
171
173
|
readonly message: string;
|
|
174
|
+
readonly code?: string;
|
|
172
175
|
}) => void>;
|
|
173
176
|
readonly listeners: Set<(diff: import("@econ-v1/domain").QueryDiff<JsonValue>) => void>;
|
|
174
177
|
readonly name: QueryName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-port-client.d.ts","sourceRoot":"","sources":["../src/message-port-client.js"],"names":[],"mappings":"AAgEA;;;GAGG;AACH;IAQE;;;;OAIG;IACH,yBAJW,MAAM,iBACN,MAAM,aACN,MAAM,EAQhB;IAlBD,+BAA+B;IAC/B,sBADqB,MAAM,CACf;IACZ,+BAA+B;IAC/B,wBADqB,MAAM,CACb;IACd,+BAA+B;IAC/B,oBADqB,MAAM,CACjB;CAcX;AAqBD,+CAAmE;AAoDnE,oCAAoC;AACpC,mDADiB,eAAe;IAgC9B;;;OAGG;IACH,uBAHW,YAAY,YACZ,iCAAiC,EAU3C;IAED,cAIC;IAED;;;;;OAKG;IACH,QALa,CAAC,QACH,MAAM,WACN,OAAO,GACL,OAAO,CAAC,CAAC,CAAC,CAItB;IAED;;;;;;;OAOG;IACH,UAPa,CAAC,QACH,SAAS,UACT,OAAO,YACP,CAAC,IAAI,EAAE,OAAO,iBAAiB,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,IAAI,YACtD,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,
|
|
1
|
+
{"version":3,"file":"message-port-client.d.ts","sourceRoot":"","sources":["../src/message-port-client.js"],"names":[],"mappings":"AAgEA;;;GAGG;AACH;IAQE;;;;OAIG;IACH,yBAJW,MAAM,iBACN,MAAM,aACN,MAAM,EAQhB;IAlBD,+BAA+B;IAC/B,sBADqB,MAAM,CACf;IACZ,+BAA+B;IAC/B,wBADqB,MAAM,CACb;IACd,+BAA+B;IAC/B,oBADqB,MAAM,CACjB;CAcX;AAqBD,+CAAmE;AAoDnE,oCAAoC;AACpC,mDADiB,eAAe;IAgC9B;;;OAGG;IACH,uBAHW,YAAY,YACZ,iCAAiC,EAU3C;IAED,cAIC;IAED;;;;;OAKG;IACH,QALa,CAAC,QACH,MAAM,WACN,OAAO,GACL,OAAO,CAAC,CAAC,CAAC,CAItB;IAED;;;;;;;OAOG;IACH,UAPa,CAAC,QACH,SAAS,UACT,OAAO,YACP,CAAC,IAAI,EAAE,OAAO,iBAAiB,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,IAAI,YACtD,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,GACnE,WAAW,CAIvB;IAED;;;;;OAKG;IACH,0BALW,MAAM,kBACN,MAAM,cACN,MAAM,GACJ,OAAO,CAAC,eAAe,CAAC,CAapC;IAED;;;OAGG;IACH,sBAHW,MAAM,GACJ,OAAO,CAAC,aAAa,CAAC,CA0BlC;IAED;;;;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AAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE;gDACjH;IAAE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,yBAAyB,CAAC;IAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAAE;sCA7BhI,yBAAyB;+BAJxD,iBAAiB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@econ-v1/rpc",
|
|
3
|
-
"version": "7.6.
|
|
3
|
+
"version": "7.6.25",
|
|
4
4
|
"description": "Typed runtime and contracts for Node client stage-to-kernel RPC",
|
|
5
5
|
"license": "MIT OR Apache-2.0",
|
|
6
6
|
"author": "Node contributors",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"access": "public"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@econ-v1/domain": "7.6.
|
|
60
|
-
"@econ-v1/ports": "7.6.
|
|
59
|
+
"@econ-v1/domain": "7.6.25",
|
|
60
|
+
"@econ-v1/ports": "7.6.25"
|
|
61
61
|
}
|
|
62
62
|
}
|
package/src/client.js
CHANGED
|
@@ -40,10 +40,9 @@
|
|
|
40
40
|
* @typedef {{ readonly appName: string, readonly assetRevision?: string, readonly entryUrl: string, readonly manifestSha256: string, readonly version: string }} PreparedStage
|
|
41
41
|
*/
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* @typedef {{ readonly message: string }} LiveQueryFailure
|
|
43
|
+
* A live-query failure: run failures carry a human-readable `message`, and rejected
|
|
44
|
+
* subscribe requests also preserve the error code when one is provided.
|
|
45
|
+
* @typedef {{ readonly message: string, readonly code?: string }} LiveQueryFailure
|
|
47
46
|
*/
|
|
48
47
|
/** @typedef {{
|
|
49
48
|
* command<T>(name: string, payload: unknown): Promise<T>,
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
* (a leader-tab failover replays this subscription onto it) starts its count again.
|
|
35
35
|
* @typedef {{ readonly cell: SubscriptionStateCell, readonly eventType: KernelEventType, readonly listeners: Set<(event: DomainEvent) => void>, readonly pendingReady: Set<(error: TransportError) => void>, refusal?: unknown, readonly sessionId: string | undefined, readonly subscriptionId: string }} EventGroup
|
|
36
36
|
*/
|
|
37
|
-
/** @typedef {{ readonly errorListeners: Set<(error: { readonly message: string }) => void>, readonly listeners: Set<(diff: import("@econ-v1/domain").QueryDiff<JsonValue>) => void>, readonly name: QueryName, readonly params: JsonValue, retryTimer: ReturnType<typeof globalThis.setTimeout> | undefined, readonly sessionId: string | undefined, subscriptionId: string }} LiveQueryGroup */
|
|
37
|
+
/** @typedef {{ readonly errorListeners: Set<(error: { readonly message: string, readonly code?: string }) => void>, readonly listeners: Set<(diff: import("@econ-v1/domain").QueryDiff<JsonValue>) => void>, readonly name: QueryName, readonly params: JsonValue, retryTimer: ReturnType<typeof globalThis.setTimeout> | undefined, readonly sessionId: string | undefined, subscriptionId: string }} LiveQueryGroup */
|
|
38
38
|
/** @typedef {{ markSlow(id: string): void, settle(id: string, elapsedMs: number, answered: boolean, timeoutMs: number): void }} RpcResponsivenessObserver */
|
|
39
39
|
/** @typedef {{ readonly monotonicNow?: () => number, readonly now?: () => string, readonly observer?: RpcResponsivenessObserver, readonly requestTimeoutMs?: number }} MessagePortKernelRpcClientOptions */
|
|
40
40
|
|
|
@@ -226,7 +226,7 @@ export class MessagePortKernelRpcClient {
|
|
|
226
226
|
* @param {QueryName} name
|
|
227
227
|
* @param {unknown} params
|
|
228
228
|
* @param {(diff: import("@econ-v1/domain").QueryDiff<T>) => void} listener
|
|
229
|
-
* @param {(error: { readonly message: string }) => void} [onError]
|
|
229
|
+
* @param {(error: { readonly message: string, readonly code?: string }) => void} [onError]
|
|
230
230
|
* @returns {Unsubscribe}
|
|
231
231
|
*/
|
|
232
232
|
liveQuery(name, params, listener, onError) {
|
|
@@ -384,7 +384,7 @@ export class MessagePortKernelRpcClient {
|
|
|
384
384
|
* @param {QueryName} name
|
|
385
385
|
* @param {unknown} params
|
|
386
386
|
* @param {(diff: import("@econ-v1/domain").QueryDiff<T>) => void} listener
|
|
387
|
-
* @param {(error: { readonly message: string }) => void} [onError]
|
|
387
|
+
* @param {(error: { readonly message: string, readonly code?: string }) => void} [onError]
|
|
388
388
|
* @returns {Unsubscribe}
|
|
389
389
|
*/
|
|
390
390
|
liveQueryStage(sessionId, name, params, listener, onError) {
|
|
@@ -737,7 +737,7 @@ export class MessagePortKernelRpcClient {
|
|
|
737
737
|
* @param {QueryName} name
|
|
738
738
|
* @param {JsonValue} params
|
|
739
739
|
* @param {(diff: import("@econ-v1/domain").QueryDiff<T>) => void} listener
|
|
740
|
-
* @param {(error: { readonly message: string }) => void} [onError]
|
|
740
|
+
* @param {(error: { readonly message: string, readonly code?: string }) => void} [onError]
|
|
741
741
|
* @returns {Unsubscribe}
|
|
742
742
|
*/
|
|
743
743
|
#subscribeLiveQuery(sessionId, name, params, listener, onError) {
|
|
@@ -804,7 +804,10 @@ export class MessagePortKernelRpcClient {
|
|
|
804
804
|
// Told on EVERY attempt, not only the last: a view must be able to draw an honest failure
|
|
805
805
|
// state while a retry is still pending, instead of sitting in its loading state forever.
|
|
806
806
|
const message = error instanceof Error ? error.message : String(error);
|
|
807
|
-
|
|
807
|
+
const failure = typeof error === "object" && error !== null && "code" in error && typeof error.code === "string"
|
|
808
|
+
? { message, code: error.code }
|
|
809
|
+
: { message };
|
|
810
|
+
for (const listener of [...group.errorListeners]) this.#notify(() => listener(failure));
|
|
808
811
|
// The abandoned id is released best-effort either way — fire-and-forget, so a server-side
|
|
809
812
|
// subscription the kernel established after our reply deadline passed cannot leak, whether
|
|
810
813
|
// this attempt is retried or this is the final give-up. Guard against duplicate releases
|
|
@@ -916,7 +919,7 @@ class BoundStageRpcSession {
|
|
|
916
919
|
* @param {QueryName} name
|
|
917
920
|
* @param {unknown} params
|
|
918
921
|
* @param {(diff: import("@econ-v1/domain").QueryDiff<T>) => void} listener
|
|
919
|
-
* @param {(error: { readonly message: string }) => void} [onError]
|
|
922
|
+
* @param {(error: { readonly message: string, readonly code?: string }) => void} [onError]
|
|
920
923
|
* @returns {Unsubscribe}
|
|
921
924
|
*/
|
|
922
925
|
liveQuery(name, params, listener, onError) {
|