querysub 0.2.0

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.
Files changed (169) hide show
  1. package/.dependency-cruiser.js +304 -0
  2. package/.eslintrc.js +51 -0
  3. package/.github/copilot-instructions.md +1 -0
  4. package/.vscode/settings.json +25 -0
  5. package/bin/deploy.js +4 -0
  6. package/bin/function.js +4 -0
  7. package/bin/server.js +4 -0
  8. package/costsBenefits.txt +112 -0
  9. package/deploy.ts +3 -0
  10. package/inject.ts +1 -0
  11. package/package.json +60 -0
  12. package/prompts.txt +54 -0
  13. package/spec.txt +820 -0
  14. package/src/-a-archives/archiveCache.ts +913 -0
  15. package/src/-a-archives/archives.ts +148 -0
  16. package/src/-a-archives/archivesBackBlaze.ts +792 -0
  17. package/src/-a-archives/archivesDisk.ts +418 -0
  18. package/src/-a-archives/copyLocalToBackblaze.ts +24 -0
  19. package/src/-a-auth/certs.ts +517 -0
  20. package/src/-a-auth/der.ts +122 -0
  21. package/src/-a-auth/ed25519.ts +1015 -0
  22. package/src/-a-auth/node-forge-ed25519.d.ts +17 -0
  23. package/src/-b-authorities/dnsAuthority.ts +203 -0
  24. package/src/-b-authorities/emailAuthority.ts +57 -0
  25. package/src/-c-identity/IdentityController.ts +200 -0
  26. package/src/-d-trust/NetworkTrust2.ts +150 -0
  27. package/src/-e-certs/EdgeCertController.ts +288 -0
  28. package/src/-e-certs/certAuthority.ts +192 -0
  29. package/src/-f-node-discovery/NodeDiscovery.ts +543 -0
  30. package/src/-g-core-values/NodeCapabilities.ts +134 -0
  31. package/src/-g-core-values/oneTimeForward.ts +91 -0
  32. package/src/-h-path-value-serialize/PathValueSerializer.ts +769 -0
  33. package/src/-h-path-value-serialize/stringSerializer.ts +176 -0
  34. package/src/0-path-value-core/LoggingClient.tsx +24 -0
  35. package/src/0-path-value-core/NodePathAuthorities.ts +978 -0
  36. package/src/0-path-value-core/PathController.ts +1 -0
  37. package/src/0-path-value-core/PathValueCommitter.ts +565 -0
  38. package/src/0-path-value-core/PathValueController.ts +231 -0
  39. package/src/0-path-value-core/archiveLocks/ArchiveLocks.ts +154 -0
  40. package/src/0-path-value-core/archiveLocks/ArchiveLocks2.ts +820 -0
  41. package/src/0-path-value-core/archiveLocks/archiveSnapshots.ts +180 -0
  42. package/src/0-path-value-core/debugLogs.ts +90 -0
  43. package/src/0-path-value-core/pathValueArchives.ts +483 -0
  44. package/src/0-path-value-core/pathValueCore.ts +2217 -0
  45. package/src/1-path-client/RemoteWatcher.ts +558 -0
  46. package/src/1-path-client/pathValueClientWatcher.ts +702 -0
  47. package/src/2-proxy/PathValueProxyWatcher.ts +1857 -0
  48. package/src/2-proxy/archiveMoveHarness.ts +376 -0
  49. package/src/2-proxy/garbageCollection.ts +753 -0
  50. package/src/2-proxy/pathDatabaseProxyBase.ts +37 -0
  51. package/src/2-proxy/pathValueProxy.ts +139 -0
  52. package/src/2-proxy/schema2.ts +518 -0
  53. package/src/3-path-functions/PathFunctionHelpers.ts +129 -0
  54. package/src/3-path-functions/PathFunctionRunner.ts +619 -0
  55. package/src/3-path-functions/PathFunctionRunnerMain.ts +67 -0
  56. package/src/3-path-functions/deployBlock.ts +10 -0
  57. package/src/3-path-functions/deployCheck.ts +7 -0
  58. package/src/3-path-functions/deployMain.ts +160 -0
  59. package/src/3-path-functions/pathFunctionLoader.ts +282 -0
  60. package/src/3-path-functions/syncSchema.ts +475 -0
  61. package/src/3-path-functions/tests/functionsTest.ts +135 -0
  62. package/src/3-path-functions/tests/rejectTest.ts +77 -0
  63. package/src/4-dom/css.tsx +29 -0
  64. package/src/4-dom/cssTypes.d.ts +212 -0
  65. package/src/4-dom/qreact.tsx +2322 -0
  66. package/src/4-dom/qreactTest.tsx +417 -0
  67. package/src/4-querysub/Querysub.ts +877 -0
  68. package/src/4-querysub/QuerysubController.ts +620 -0
  69. package/src/4-querysub/copyEvent.ts +0 -0
  70. package/src/4-querysub/permissions.ts +289 -0
  71. package/src/4-querysub/permissionsShared.ts +1 -0
  72. package/src/4-querysub/querysubPrediction.ts +525 -0
  73. package/src/5-diagnostics/FullscreenModal.tsx +67 -0
  74. package/src/5-diagnostics/GenericFormat.tsx +165 -0
  75. package/src/5-diagnostics/Modal.tsx +79 -0
  76. package/src/5-diagnostics/Table.tsx +183 -0
  77. package/src/5-diagnostics/TimeGrouper.tsx +114 -0
  78. package/src/5-diagnostics/diskValueAudit.ts +216 -0
  79. package/src/5-diagnostics/memoryValueAudit.ts +442 -0
  80. package/src/5-diagnostics/nodeMetadata.ts +135 -0
  81. package/src/5-diagnostics/qreactDebug.tsx +309 -0
  82. package/src/5-diagnostics/shared.ts +26 -0
  83. package/src/5-diagnostics/synchronousLagTracking.ts +47 -0
  84. package/src/TestController.ts +35 -0
  85. package/src/allowclient.flag +0 -0
  86. package/src/bits.ts +86 -0
  87. package/src/buffers.ts +69 -0
  88. package/src/config.ts +53 -0
  89. package/src/config2.ts +48 -0
  90. package/src/diagnostics/ActionsHistory.ts +56 -0
  91. package/src/diagnostics/NodeViewer.tsx +503 -0
  92. package/src/diagnostics/SizeLimiter.ts +62 -0
  93. package/src/diagnostics/TimeDebug.tsx +18 -0
  94. package/src/diagnostics/benchmark.ts +139 -0
  95. package/src/diagnostics/errorLogs/ErrorLogController.ts +515 -0
  96. package/src/diagnostics/errorLogs/ErrorLogCore.ts +274 -0
  97. package/src/diagnostics/errorLogs/LogClassifiers.tsx +302 -0
  98. package/src/diagnostics/errorLogs/LogFilterUI.tsx +84 -0
  99. package/src/diagnostics/errorLogs/LogNotify.tsx +101 -0
  100. package/src/diagnostics/errorLogs/LogTimeSelector.tsx +724 -0
  101. package/src/diagnostics/errorLogs/LogViewer.tsx +757 -0
  102. package/src/diagnostics/errorLogs/hookErrors.ts +60 -0
  103. package/src/diagnostics/errorLogs/logFiltering.tsx +149 -0
  104. package/src/diagnostics/heapTag.ts +13 -0
  105. package/src/diagnostics/listenOnDebugger.ts +77 -0
  106. package/src/diagnostics/logs/DiskLoggerPage.tsx +572 -0
  107. package/src/diagnostics/logs/ObjectDisplay.tsx +165 -0
  108. package/src/diagnostics/logs/ansiFormat.ts +108 -0
  109. package/src/diagnostics/logs/diskLogGlobalContext.ts +38 -0
  110. package/src/diagnostics/logs/diskLogger.ts +305 -0
  111. package/src/diagnostics/logs/diskShimConsoleLogs.ts +32 -0
  112. package/src/diagnostics/logs/injectFileLocationToConsole.ts +50 -0
  113. package/src/diagnostics/logs/logGitHashes.ts +30 -0
  114. package/src/diagnostics/managementPages.tsx +289 -0
  115. package/src/diagnostics/periodic.ts +89 -0
  116. package/src/diagnostics/runSaturationTest.ts +416 -0
  117. package/src/diagnostics/satSchema.ts +64 -0
  118. package/src/diagnostics/trackResources.ts +82 -0
  119. package/src/diagnostics/watchdog.ts +55 -0
  120. package/src/errors.ts +132 -0
  121. package/src/forceProduction.ts +3 -0
  122. package/src/fs.ts +72 -0
  123. package/src/heapDumps.ts +666 -0
  124. package/src/https.ts +2 -0
  125. package/src/inject.ts +1 -0
  126. package/src/library-components/ATag.tsx +84 -0
  127. package/src/library-components/Button.tsx +344 -0
  128. package/src/library-components/ButtonSelector.tsx +64 -0
  129. package/src/library-components/DropdownCustom.tsx +151 -0
  130. package/src/library-components/DropdownSelector.tsx +32 -0
  131. package/src/library-components/Input.tsx +334 -0
  132. package/src/library-components/InputLabel.tsx +198 -0
  133. package/src/library-components/InputPicker.tsx +125 -0
  134. package/src/library-components/LazyComponent.tsx +62 -0
  135. package/src/library-components/MeasureHeightCSS.tsx +48 -0
  136. package/src/library-components/MeasuredDiv.tsx +47 -0
  137. package/src/library-components/ShowMore.tsx +51 -0
  138. package/src/library-components/SyncedController.ts +171 -0
  139. package/src/library-components/TimeRangeSelector.tsx +407 -0
  140. package/src/library-components/URLParam.ts +263 -0
  141. package/src/library-components/colors.tsx +14 -0
  142. package/src/library-components/drag.ts +114 -0
  143. package/src/library-components/icons.tsx +692 -0
  144. package/src/library-components/niceStringify.ts +50 -0
  145. package/src/library-components/renderToString.ts +52 -0
  146. package/src/misc/PromiseRace.ts +101 -0
  147. package/src/misc/color.ts +30 -0
  148. package/src/misc/getParentProcessId.cs +53 -0
  149. package/src/misc/getParentProcessId.ts +53 -0
  150. package/src/misc/hash.ts +83 -0
  151. package/src/misc/ipPong.js +13 -0
  152. package/src/misc/networking.ts +2 -0
  153. package/src/misc/random.ts +45 -0
  154. package/src/misc.ts +19 -0
  155. package/src/noserverhotreload.flag +0 -0
  156. package/src/path.ts +226 -0
  157. package/src/persistentLocalStore.ts +37 -0
  158. package/src/promise.ts +15 -0
  159. package/src/server.ts +73 -0
  160. package/src/src.d.ts +1 -0
  161. package/src/test/heapProcess.ts +36 -0
  162. package/src/test/mongoSatTest.tsx +55 -0
  163. package/src/test/satTest.ts +193 -0
  164. package/src/test/test.tsx +552 -0
  165. package/src/zip.ts +92 -0
  166. package/src/zipThreaded.ts +106 -0
  167. package/src/zipThreadedWorker.js +19 -0
  168. package/tsconfig.json +27 -0
  169. package/yarnSpec.txt +56 -0
@@ -0,0 +1,62 @@
1
+ import debugbreak from "debugbreak";
2
+ import { cache, lazy } from "socket-function/src/caching";
3
+ import { isNode, sort } from "socket-function/src/misc";
4
+ import { Querysub } from "../4-querysub/QuerysubController";
5
+ import { qreact } from "../4-dom/qreact";
6
+
7
+ let nextSeqNum = 0;
8
+ let schema = Querysub.createLocalSchema<{
9
+ loaded: { [seqNum: number]: true };
10
+ }>("LazyComponent");
11
+
12
+ /** const NodeViewer = createLazyComponent(() => import("./NodeViewer"))("NodeViewer"); */
13
+ export function createLazyComponent<Module>(
14
+ getImport: () => Promise<Module>
15
+ ): {
16
+ <ExportName extends keyof Module>(exportName: ExportName): Module[ExportName];
17
+ } {
18
+ return (exportName) => {
19
+ if (isNode()) {
20
+ // Import it, asynchronously, so it isn't preloaded, but it is available for clientside imports.
21
+ void Promise.resolve().then(() => getImport());
22
+ // TOOD: We will need to support this serverside eventually.
23
+ return class extends qreact.Component {
24
+ render(): preact.ComponentChild {
25
+ throw new Error(`createLazyComponent is not supported serverside presently.`);
26
+ }
27
+ };
28
+ }
29
+
30
+ let seqNum = nextSeqNum++;
31
+
32
+ const loadModuleExports = lazy(() => {
33
+ let loadedModuleExports: any | undefined;
34
+ getImport().then((exports) => {
35
+ loadedModuleExports = exports;
36
+ Querysub.commit(() => {
37
+ schema().loaded[seqNum] = true;
38
+ });
39
+ }, err => {
40
+ console.error(`Error loading module`, getImport, err);
41
+ });
42
+ return () => {
43
+ return loadedModuleExports;
44
+ };
45
+ });
46
+
47
+ return class extends qreact.Component {
48
+ render() {
49
+ let loadedModuleExports = loadModuleExports()();
50
+ if (!loadedModuleExports) {
51
+ schema().loaded[seqNum];
52
+ return undefined;
53
+ }
54
+ let Component = loadedModuleExports[exportName];
55
+ if (!Component) {
56
+ return <div>Component not found in module {getImport.toString()}, component {exportName}</div>;
57
+ }
58
+ return <Component {...this.props} />;
59
+ }
60
+ } as any;
61
+ };
62
+ }
@@ -0,0 +1,48 @@
1
+ import { css } from "typesafecss";
2
+ import { qreact } from "../4-dom/qreact";
3
+
4
+ export class MeasureHeightCSS extends qreact.Component<{
5
+ threshold?: number;
6
+ }> {
7
+ render() {
8
+ let threshold = this.props.threshold ?? 100;
9
+ const renderCutoff = (pixels: number) => {
10
+ return <div
11
+ className={
12
+ css.absolute.right0
13
+ .hsl(0, 0, 30)
14
+ .color("white")
15
+ .top(`calc(min(0px, (100% - ${pixels}px) * 1000))`)
16
+ .offsety("-2px")
17
+ .minHeight(8)
18
+ .width((pixels - threshold) * 0.25)
19
+ + " MeasureHeightCSS"
20
+ }
21
+ >
22
+ {/* {pixels}px */}
23
+ </div>;
24
+ };
25
+ let keyPoints: number[] = [];
26
+ for (let point = threshold * 1.5; point < 500; point *= 1.5) {
27
+ keyPoints.push(point);
28
+ }
29
+ for (let point = 500; point < 10000; point *= 2) {
30
+ keyPoints.push(point);
31
+ }
32
+ return (
33
+ <>
34
+ {keyPoints.map(point => renderCutoff(point))}
35
+ {/* NOTE: We want to hide easily, and we can't trigger on OUR OWN hover, because
36
+ then we would stop being hovered (and if we just used opacity we would invisible
37
+ block clicks which is terrible. So... this works alright. */}
38
+ <style>
39
+ {`
40
+ *:hover > .MeasureHeightCSS {
41
+ display: none;
42
+ }
43
+ `}
44
+ </style>
45
+ </>
46
+ );
47
+ }
48
+ }
@@ -0,0 +1,47 @@
1
+ import preact from "preact"; import { qreact } from "../../src/4-dom/qreact";
2
+ import { Querysub } from "../../src/4-querysub/Querysub";
3
+ import { throttleFunction } from "socket-function/src/misc";
4
+
5
+
6
+ export class MeasuredDiv extends qreact.Component<preact.JSX.HTMLAttributes<HTMLDivElement> & {
7
+ onNewSize: (width: number, height: number, elem: HTMLElement) => void;
8
+ overrideType?: string;
9
+ }> {
10
+ holder: HTMLElement | null = null;
11
+ observer = new ResizeObserver(
12
+ throttleFunction(200,
13
+ (val) => {
14
+ for (let t of val) {
15
+ if (t.target === this.holder) {
16
+ Querysub.localCommit(() => {
17
+ this.props.onNewSize(t.contentRect.width, t.contentRect.height, t.target as HTMLElement);
18
+ });
19
+ }
20
+ }
21
+ }
22
+ )
23
+ );
24
+ componentWillUnmount() {
25
+ this.observer.disconnect();
26
+ }
27
+ render() {
28
+ let baseRef = this.props.ref as any;
29
+ return qreact.createElement(this.props.overrideType ?? "div", {
30
+ key: "MeasuredDiv",
31
+ ...this.props,
32
+ ref: (e: HTMLElement) => {
33
+ baseRef?.(e);
34
+ if (this.holder === e) {
35
+ return;
36
+ }
37
+ if (this.holder) {
38
+ this.observer.unobserve(this.holder);
39
+ }
40
+ this.holder = e;
41
+ if (e) {
42
+ this.observer.observe(e);
43
+ }
44
+ }
45
+ } as any);
46
+ }
47
+ }
@@ -0,0 +1,51 @@
1
+ import { css } from "typesafecss";
2
+ import { qreact } from "../4-dom/qreact";
3
+ import { list, nextId } from "socket-function/src/misc";
4
+ import { Button } from "./Button";
5
+
6
+ module.hotreload = true;
7
+ module.hotreload = true;
8
+
9
+ export class ShowMore extends qreact.Component<{
10
+ className?: string;
11
+ maxHeight: number;
12
+ /** When expanding, makes the click area the full size. */
13
+ fullClickArea?: boolean;
14
+ onExpand?: (expanded: boolean) => void;
15
+ }> {
16
+ state = {
17
+ showMore: false,
18
+ };
19
+ render() {
20
+ const { maxHeight } = this.props;
21
+ let showMore = this.state.showMore;
22
+ return (
23
+ <div className={
24
+ css.relative
25
+ + (!showMore && css.maxHeight(maxHeight).overflowHidden)
26
+ + this.props.className
27
+ }>
28
+ {this.props.children}
29
+ <div
30
+ className={
31
+ css.fillWidth.pointer.hbox0
32
+ .alignItems("end").justifyContent("end")
33
+ .left(0)
34
+ .bottom(`calc((100% - ${maxHeight}px) * 10000)`)
35
+ + (!showMore && css.absolute)
36
+ + (this.props.fullClickArea && css.fillHeight)
37
+ + " trigger-hover "
38
+ }
39
+ onClick={() => {
40
+ this.state.showMore = !showMore;
41
+ this.props.onExpand?.(this.state.showMore);
42
+ }}
43
+ >
44
+ <Button className={css.hsl(270, 50, 50).background("hsl(270, 50%, 70%)", "hover").zIndex(1)}>
45
+ {showMore ? "Show Less" : "Show More"}
46
+ </Button>
47
+ </div>
48
+ </div>
49
+ );
50
+ }
51
+ }
@@ -0,0 +1,171 @@
1
+ import { atomic, atomicObjectWrite, atomicObjectWriteNoFreeze, doAtomicWrites, proxyWatcher } from "../../src/2-proxy/PathValueProxyWatcher";
2
+ import { Querysub } from "../../src/4-querysub/Querysub";
3
+ import { SocketFunction } from "socket-function/SocketFunction";
4
+ import { SocketRegistered } from "socket-function/SocketFunctionTypes";
5
+ import { onHotReload } from "socket-function/hot/HotReloadController";
6
+ import { cache } from "socket-function/src/caching";
7
+ import { nextId } from "socket-function/src/misc";
8
+ import { MaybePromise } from "socket-function/src/types";
9
+
10
+ // IMPORTANT! See cacheAsyncSynced if you just want to run promise functions
11
+
12
+ let controllerIds = new Set<string>();
13
+
14
+ module.hotreload = false;
15
+ onHotReload(() => {
16
+ Querysub.commitLocal(() => {
17
+ let root = syncedData();
18
+ for (let id of controllerIds) {
19
+ for (let nodeId in root[id]) {
20
+ for (let fnc in root[id][nodeId]) {
21
+ for (let argsHash in root[id][nodeId][fnc]) {
22
+ delete root[id][nodeId][fnc][argsHash].promise;
23
+ delete root[id][nodeId][fnc][argsHash].result;
24
+ }
25
+ delete root[id][nodeId][fnc];
26
+ }
27
+ delete root[id][nodeId];
28
+ }
29
+ }
30
+ });
31
+ });
32
+
33
+ let syncedData = Querysub.createLocalSchema<{
34
+ [controllerId: string]: {
35
+ [nodeId: string]: {
36
+ [fnc: string]: {
37
+ [argsHash: string]: {
38
+ promise: Promise<unknown> | undefined;
39
+ result?: { result: unknown } | { error: Error };
40
+ }
41
+ }
42
+ }
43
+ }
44
+ }>("SyncedController");
45
+
46
+ type RemapFunction<T> = T extends (...args: infer Args) => Promise<infer Return>
47
+ ? {
48
+ (...args: Args): Return | undefined;
49
+ reset(...args: Args): void;
50
+ resetAll(): void;
51
+ }
52
+ : T;
53
+ export function getSyncedController<T extends SocketRegistered>(controller: T): {
54
+ (nodeId: string): {
55
+ [fnc in keyof T["nodes"][""]]: RemapFunction<T["nodes"][""][fnc]>;
56
+ } & {
57
+ resetAll(): void;
58
+ };
59
+ resetAll(): void;
60
+ } {
61
+ let id = nextId();
62
+ controllerIds.add(id);
63
+ let result = cache((nodeId: string) => {
64
+ SocketFunction.onNextDisconnect(nodeId, () => {
65
+ Querysub.commitLocal(() => {
66
+ let nodeObj = syncedData()[id][nodeId];
67
+ for (let fnc in nodeObj) {
68
+ for (let argsHash in nodeObj[fnc]) {
69
+ delete nodeObj[fnc][argsHash].promise;
70
+ delete nodeObj[fnc][argsHash].result;
71
+ }
72
+ delete nodeObj[fnc];
73
+ }
74
+ delete syncedData()[id][nodeId];
75
+ });
76
+ });
77
+ return new Proxy({}, {
78
+ get: (target, fncNameUntyped) => {
79
+ if (typeof fncNameUntyped !== "string") return undefined;
80
+ if (fncNameUntyped === "resetAll") {
81
+ return () => {
82
+ return Querysub.commitLocal(() => {
83
+ for (let fnc in syncedData()[id][nodeId]) {
84
+ for (let argsHash in syncedData()[id][nodeId][fnc]) {
85
+ delete syncedData()[id][nodeId][fnc][argsHash].promise;
86
+ delete syncedData()[id][nodeId][fnc][argsHash].result;
87
+ }
88
+ delete syncedData()[id][nodeId][fnc];
89
+ }
90
+ delete syncedData()[id][nodeId];
91
+ });
92
+ };
93
+ }
94
+ let fncName = fncNameUntyped;
95
+ function call(...args: any[]) {
96
+ return Querysub.commitLocal(() => {
97
+ let argsHash = JSON.stringify(args);
98
+ let obj = syncedData()[id][nodeId][fncName][argsHash];
99
+
100
+ let promise = atomic(obj.promise);
101
+ if (!promise) {
102
+ //console.log("calling", fncName, args);
103
+ promise = controller.nodes[nodeId][fncName](...args) as Promise<unknown>;
104
+ doAtomicWrites(() => {
105
+ obj.promise = promise;
106
+ });
107
+ promise.then(
108
+ result => {
109
+ //console.log("result", result);
110
+ Querysub.commitLocal(() => {
111
+ obj.result = atomicObjectWriteNoFreeze({ result });
112
+ });
113
+ },
114
+ error => {
115
+ //console.log("error", error);
116
+ Querysub.commitLocal(() => {
117
+ obj.result = atomicObjectWriteNoFreeze({ error });
118
+ });
119
+ }
120
+ );
121
+ }
122
+
123
+ let result = atomic(obj.result);
124
+ if (result) {
125
+ if ("error" in result) {
126
+ throw result.error;
127
+ } else {
128
+ return result.result;
129
+ }
130
+ }
131
+ return undefined;
132
+ });
133
+ }
134
+ call.reset = (...args: any[]) => {
135
+ return Querysub.commitLocal(() => {
136
+ let argsHash = JSON.stringify(args);
137
+ let obj = syncedData()[id][nodeId][fncName][argsHash];
138
+ delete obj.promise;
139
+ delete obj.result;
140
+ });
141
+ };
142
+ call.resetAll = () => {
143
+ return Querysub.commitLocal(() => {
144
+ for (let argsHash in syncedData()[id][nodeId][fncName]) {
145
+ delete syncedData()[id][nodeId][fncName][argsHash].promise;
146
+ delete syncedData()[id][nodeId][fncName][argsHash].result;
147
+ }
148
+ delete syncedData()[id][nodeId][fncName];
149
+ });
150
+ };
151
+
152
+ return call;
153
+ },
154
+ });
155
+ }) as any;
156
+ result.resetAll = () => {
157
+ return Querysub.commitLocal(() => {
158
+ for (let nodeId in syncedData()[id]) {
159
+ for (let fnc in syncedData()[id][nodeId]) {
160
+ for (let argsHash in syncedData()[id][nodeId][fnc]) {
161
+ delete syncedData()[id][nodeId][fnc][argsHash].promise;
162
+ delete syncedData()[id][nodeId][fnc][argsHash].result;
163
+ }
164
+ delete syncedData()[id][nodeId][fnc];
165
+ }
166
+ delete syncedData()[id][nodeId];
167
+ }
168
+ });
169
+ };
170
+ return result;
171
+ }