socket-function 1.1.11 → 1.1.12
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/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/nodeCache.d.ts +1 -0
- package/src/nodeCache.ts +11 -0
package/index.d.ts
CHANGED
|
@@ -1068,6 +1068,7 @@ declare module "socket-function/src/nodeCache" {
|
|
|
1068
1068
|
export declare function registerNodeClient(callFactory: CallFactory): void;
|
|
1069
1069
|
export declare function getCreateCallFactory(nodeId: string): MaybePromise<CallFactory>;
|
|
1070
1070
|
export declare function getCallFactory(nodeId: string): MaybePromise<CallFactory | undefined>;
|
|
1071
|
+
export declare function debugGetAllCallFactories(): CallFactory[];
|
|
1071
1072
|
export declare function resetAllNodeCallFactories(): void;
|
|
1072
1073
|
export declare function countOpenConnections(): number;
|
|
1073
1074
|
|
package/package.json
CHANGED
package/src/nodeCache.d.ts
CHANGED
|
@@ -20,5 +20,6 @@ export declare function getNodeIdDomainMaybeUndefined(nodeId: string): string |
|
|
|
20
20
|
export declare function registerNodeClient(callFactory: CallFactory): void;
|
|
21
21
|
export declare function getCreateCallFactory(nodeId: string): MaybePromise<CallFactory>;
|
|
22
22
|
export declare function getCallFactory(nodeId: string): MaybePromise<CallFactory | undefined>;
|
|
23
|
+
export declare function debugGetAllCallFactories(): CallFactory[];
|
|
23
24
|
export declare function resetAllNodeCallFactories(): void;
|
|
24
25
|
export declare function countOpenConnections(): number;
|
package/src/nodeCache.ts
CHANGED
|
@@ -89,6 +89,17 @@ export function getCallFactory(nodeId: string): MaybePromise<CallFactory | undef
|
|
|
89
89
|
return nodeCache.get(nodeId);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
export function debugGetAllCallFactories(): CallFactory[] {
|
|
93
|
+
let result: CallFactory[] = [];
|
|
94
|
+
for (let [key, value] of nodeCache.entries()) {
|
|
95
|
+
if (value instanceof Promise) {
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
result.push(value);
|
|
99
|
+
}
|
|
100
|
+
return result;
|
|
101
|
+
}
|
|
102
|
+
|
|
92
103
|
export function resetAllNodeCallFactories() {
|
|
93
104
|
// Needs to be done if you want to reset authentication. Outstanding calls still work,
|
|
94
105
|
// but new calls use new factories (and connections).
|