@procedures/client 0.2.0 → 0.2.1
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/CHANGELOG.md +6 -0
- package/README.md +4 -4
- package/dist/.tsbuildinfo +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js.map +1 -1
- package/dist/procedures/invoke.d.ts +6 -1
- package/dist/procedures/invoke.d.ts.map +1 -1
- package/dist/procedures/invoke.js +2 -2
- package/dist/procedures/invoke.js.map +1 -1
- package/dist/server/host-policy.d.ts +3 -3
- package/dist/server/host-policy.d.ts.map +1 -1
- package/dist/server/procedure-server.d.ts +2 -2
- package/dist/server/procedure-server.d.ts.map +1 -1
- package/dist/server/procedure-server.js.map +1 -1
- package/package.json +1 -1
- package/src/browser.ts +1 -0
- package/src/procedures/invoke.ts +10 -4
- package/src/server/host-policy.ts +3 -3
- package/src/server/procedure-server.ts +2 -2
- package/dist/client/middleware/batching.d.ts +0 -102
- package/dist/client/middleware/batching.d.ts.map +0 -1
- package/dist/client/middleware/batching.js +0 -245
- package/dist/client/middleware/batching.js.map +0 -1
- package/dist/collections/async/async-queue.d.ts +0 -144
- package/dist/collections/async/async-queue.d.ts.map +0 -1
- package/dist/collections/async/async-queue.js +0 -347
- package/dist/collections/async/async-queue.js.map +0 -1
- package/dist/collections/async/channels.d.ts +0 -188
- package/dist/collections/async/channels.d.ts.map +0 -1
- package/dist/collections/async/channels.js +0 -312
- package/dist/collections/async/channels.js.map +0 -1
- package/dist/collections/behaviors/bounded.d.ts +0 -79
- package/dist/collections/behaviors/bounded.d.ts.map +0 -1
- package/dist/collections/behaviors/bounded.js +0 -384
- package/dist/collections/behaviors/bounded.js.map +0 -1
- package/dist/collections/behaviors/evented.d.ts +0 -154
- package/dist/collections/behaviors/evented.d.ts.map +0 -1
- package/dist/collections/behaviors/evented.js +0 -299
- package/dist/collections/behaviors/evented.js.map +0 -1
- package/dist/collections/behaviors/lru.d.ts +0 -84
- package/dist/collections/behaviors/lru.d.ts.map +0 -1
- package/dist/collections/behaviors/lru.js +0 -330
- package/dist/collections/behaviors/lru.js.map +0 -1
- package/dist/collections/behaviors/readonly.d.ts +0 -73
- package/dist/collections/behaviors/readonly.d.ts.map +0 -1
- package/dist/collections/behaviors/readonly.js +0 -158
- package/dist/collections/behaviors/readonly.js.map +0 -1
- package/dist/collections/behaviors/safe.d.ts +0 -163
- package/dist/collections/behaviors/safe.d.ts.map +0 -1
- package/dist/collections/behaviors/safe.js +0 -172
- package/dist/collections/behaviors/safe.js.map +0 -1
- package/dist/collections/behaviors/synchronized.d.ts +0 -88
- package/dist/collections/behaviors/synchronized.d.ts.map +0 -1
- package/dist/collections/behaviors/synchronized.js +0 -294
- package/dist/collections/behaviors/synchronized.js.map +0 -1
- package/dist/collections/behaviors/ttl.d.ts +0 -118
- package/dist/collections/behaviors/ttl.d.ts.map +0 -1
- package/dist/collections/behaviors/ttl.js +0 -338
- package/dist/collections/behaviors/ttl.js.map +0 -1
- package/dist/collections/core/effects.d.ts +0 -176
- package/dist/collections/core/effects.d.ts.map +0 -1
- package/dist/collections/core/effects.js +0 -180
- package/dist/collections/core/effects.js.map +0 -1
- package/dist/collections/core/events.d.ts +0 -192
- package/dist/collections/core/events.d.ts.map +0 -1
- package/dist/collections/core/events.js +0 -291
- package/dist/collections/core/events.js.map +0 -1
- package/dist/collections/core/middleware.d.ts +0 -231
- package/dist/collections/core/middleware.d.ts.map +0 -1
- package/dist/collections/core/middleware.js +0 -161
- package/dist/collections/core/middleware.js.map +0 -1
- package/dist/collections/core/policies.d.ts +0 -220
- package/dist/collections/core/policies.d.ts.map +0 -1
- package/dist/collections/core/policies.js +0 -48
- package/dist/collections/core/policies.js.map +0 -1
- package/dist/collections/core/traits.d.ts +0 -142
- package/dist/collections/core/traits.d.ts.map +0 -1
- package/dist/collections/core/traits.js +0 -8
- package/dist/collections/core/traits.js.map +0 -1
- package/dist/collections/examples.d.ts +0 -13
- package/dist/collections/examples.d.ts.map +0 -1
- package/dist/collections/examples.js +0 -302
- package/dist/collections/examples.js.map +0 -1
- package/dist/collections/fx/collectors.d.ts +0 -190
- package/dist/collections/fx/collectors.d.ts.map +0 -1
- package/dist/collections/fx/collectors.js +0 -369
- package/dist/collections/fx/collectors.js.map +0 -1
- package/dist/collections/fx/iter.d.ts +0 -166
- package/dist/collections/fx/iter.d.ts.map +0 -1
- package/dist/collections/fx/iter.js +0 -421
- package/dist/collections/fx/iter.js.map +0 -1
- package/dist/collections/impl/array-deque.d.ts +0 -107
- package/dist/collections/impl/array-deque.d.ts.map +0 -1
- package/dist/collections/impl/array-deque.js +0 -381
- package/dist/collections/impl/array-deque.js.map +0 -1
- package/dist/collections/impl/array-list.d.ts +0 -101
- package/dist/collections/impl/array-list.d.ts.map +0 -1
- package/dist/collections/impl/array-list.js +0 -387
- package/dist/collections/impl/array-list.js.map +0 -1
- package/dist/collections/impl/hash-map.d.ts +0 -141
- package/dist/collections/impl/hash-map.d.ts.map +0 -1
- package/dist/collections/impl/hash-map.js +0 -450
- package/dist/collections/impl/hash-map.js.map +0 -1
- package/dist/collections/impl/hash-set.d.ts +0 -125
- package/dist/collections/impl/hash-set.d.ts.map +0 -1
- package/dist/collections/impl/hash-set.js +0 -264
- package/dist/collections/impl/hash-set.js.map +0 -1
- package/dist/collections/impl/linked-hash-map.d.ts +0 -141
- package/dist/collections/impl/linked-hash-map.d.ts.map +0 -1
- package/dist/collections/impl/linked-hash-map.js +0 -472
- package/dist/collections/impl/linked-hash-map.js.map +0 -1
- package/dist/collections/impl/linked-list.d.ts +0 -109
- package/dist/collections/impl/linked-list.d.ts.map +0 -1
- package/dist/collections/impl/linked-list.js +0 -491
- package/dist/collections/impl/linked-list.js.map +0 -1
- package/dist/collections/impl/priority-queue.d.ts +0 -134
- package/dist/collections/impl/priority-queue.d.ts.map +0 -1
- package/dist/collections/impl/priority-queue.js +0 -336
- package/dist/collections/impl/priority-queue.js.map +0 -1
- package/dist/collections/impl/tree-map.d.ts +0 -146
- package/dist/collections/impl/tree-map.d.ts.map +0 -1
- package/dist/collections/impl/tree-map.js +0 -781
- package/dist/collections/impl/tree-map.js.map +0 -1
- package/dist/collections/impl/tree-set.d.ts +0 -112
- package/dist/collections/impl/tree-set.d.ts.map +0 -1
- package/dist/collections/impl/tree-set.js +0 -374
- package/dist/collections/impl/tree-set.js.map +0 -1
- package/dist/collections/index.d.ts +0 -105
- package/dist/collections/index.d.ts.map +0 -1
- package/dist/collections/index.js +0 -135
- package/dist/collections/index.js.map +0 -1
- package/dist/collections/interfaces/collection.d.ts +0 -119
- package/dist/collections/interfaces/collection.d.ts.map +0 -1
- package/dist/collections/interfaces/collection.js +0 -8
- package/dist/collections/interfaces/collection.js.map +0 -1
- package/dist/collections/interfaces/list.d.ts +0 -247
- package/dist/collections/interfaces/list.d.ts.map +0 -1
- package/dist/collections/interfaces/list.js +0 -8
- package/dist/collections/interfaces/list.js.map +0 -1
- package/dist/collections/interfaces/map.d.ts +0 -344
- package/dist/collections/interfaces/map.d.ts.map +0 -1
- package/dist/collections/interfaces/map.js +0 -8
- package/dist/collections/interfaces/map.js.map +0 -1
- package/dist/collections/interfaces/queue.d.ts +0 -304
- package/dist/collections/interfaces/queue.d.ts.map +0 -1
- package/dist/collections/interfaces/queue.js +0 -8
- package/dist/collections/interfaces/queue.js.map +0 -1
- package/dist/collections/interfaces/set.d.ts +0 -137
- package/dist/collections/interfaces/set.d.ts.map +0 -1
- package/dist/collections/interfaces/set.js +0 -8
- package/dist/collections/interfaces/set.js.map +0 -1
- package/dist/collections/storage/api.d.ts +0 -109
- package/dist/collections/storage/api.d.ts.map +0 -1
- package/dist/collections/storage/api.js +0 -182
- package/dist/collections/storage/api.js.map +0 -1
- package/dist/collections/storage/hybrid.d.ts +0 -164
- package/dist/collections/storage/hybrid.d.ts.map +0 -1
- package/dist/collections/storage/hybrid.js +0 -416
- package/dist/collections/storage/hybrid.js.map +0 -1
- package/dist/collections/storage/index.d.ts +0 -16
- package/dist/collections/storage/index.d.ts.map +0 -1
- package/dist/collections/storage/index.js +0 -13
- package/dist/collections/storage/index.js.map +0 -1
- package/dist/collections/storage/interface.d.ts +0 -141
- package/dist/collections/storage/interface.d.ts.map +0 -1
- package/dist/collections/storage/interface.js +0 -23
- package/dist/collections/storage/interface.js.map +0 -1
- package/dist/collections/storage/memory.d.ts +0 -68
- package/dist/collections/storage/memory.d.ts.map +0 -1
- package/dist/collections/storage/memory.js +0 -154
- package/dist/collections/storage/memory.js.map +0 -1
- package/dist/collections/utils/defaults.d.ts +0 -135
- package/dist/collections/utils/defaults.d.ts.map +0 -1
- package/dist/collections/utils/defaults.js +0 -322
- package/dist/collections/utils/defaults.js.map +0 -1
- package/dist/collections/utils/factories.d.ts +0 -144
- package/dist/collections/utils/factories.d.ts.map +0 -1
- package/dist/collections/utils/factories.js +0 -293
- package/dist/collections/utils/factories.js.map +0 -1
- package/dist/collections/utils/helpers.d.ts +0 -137
- package/dist/collections/utils/helpers.d.ts.map +0 -1
- package/dist/collections/utils/helpers.js +0 -221
- package/dist/collections/utils/helpers.js.map +0 -1
- package/dist/collections.d.ts +0 -12
- package/dist/collections.d.ts.map +0 -1
- package/dist/collections.js +0 -10
- package/dist/collections.js.map +0 -1
- package/dist/components/define.d.ts +0 -134
- package/dist/components/define.d.ts.map +0 -1
- package/dist/components/define.js +0 -486
- package/dist/components/define.js.map +0 -1
- package/dist/components/index.d.ts +0 -39
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/index.js +0 -38
- package/dist/components/index.js.map +0 -1
- package/dist/components/types.d.ts +0 -264
- package/dist/components/types.d.ts.map +0 -1
- package/dist/components/types.js +0 -46
- package/dist/components/types.js.map +0 -1
- package/dist/procedures/storage/adapter.d.ts +0 -148
- package/dist/procedures/storage/adapter.d.ts.map +0 -1
- package/dist/procedures/storage/adapter.js +0 -214
- package/dist/procedures/storage/adapter.js.map +0 -1
- package/dist/procedures/storage/api.d.ts +0 -125
- package/dist/procedures/storage/api.d.ts.map +0 -1
- package/dist/procedures/storage/api.js +0 -220
- package/dist/procedures/storage/api.js.map +0 -1
- package/dist/procedures/storage/factory.d.ts +0 -134
- package/dist/procedures/storage/factory.d.ts.map +0 -1
- package/dist/procedures/storage/factory.js +0 -166
- package/dist/procedures/storage/factory.js.map +0 -1
- package/dist/procedures/storage/hybrid.d.ts +0 -193
- package/dist/procedures/storage/hybrid.d.ts.map +0 -1
- package/dist/procedures/storage/hybrid.js +0 -519
- package/dist/procedures/storage/hybrid.js.map +0 -1
- package/dist/procedures/storage/index.d.ts +0 -17
- package/dist/procedures/storage/index.d.ts.map +0 -1
- package/dist/procedures/storage/index.js +0 -17
- package/dist/procedures/storage/index.js.map +0 -1
- package/dist/procedures/storage/procedures.d.ts +0 -39
- package/dist/procedures/storage/procedures.d.ts.map +0 -1
- package/dist/procedures/storage/procedures.js +0 -261
- package/dist/procedures/storage/procedures.js.map +0 -1
- package/dist/procedures/storage/serialization.d.ts +0 -123
- package/dist/procedures/storage/serialization.d.ts.map +0 -1
- package/dist/procedures/storage/serialization.js +0 -216
- package/dist/procedures/storage/serialization.js.map +0 -1
- package/dist/procedures/storage/synced-registry.d.ts +0 -246
- package/dist/procedures/storage/synced-registry.d.ts.map +0 -1
- package/dist/procedures/storage/synced-registry.js +0 -575
- package/dist/procedures/storage/synced-registry.js.map +0 -1
- package/dist/procedures/storage/types.d.ts +0 -130
- package/dist/procedures/storage/types.d.ts.map +0 -1
- package/dist/procedures/storage/types.js +0 -8
- package/dist/procedures/storage/types.js.map +0 -1
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Synced Procedure Registry
|
|
3
|
-
*
|
|
4
|
-
* Wraps ProcedureRegistry with storage synchronization capabilities.
|
|
5
|
-
* Enables procedure persistence and sync across backends.
|
|
6
|
-
*/
|
|
7
|
-
import type { CollectionStorage } from "@mark1russell7/client-collections";
|
|
8
|
-
import { ProcedureRegistry } from "../registry.js";
|
|
9
|
-
import type { AnyProcedure, ProcedurePath, RegistrationOptions } from "../types.js";
|
|
10
|
-
import type { SerializedProcedure, SyncedRegistryOptions, SyncResult, SyncStatus, SyncDirection, HandlerLoader, HandlerReference } from "./types.js";
|
|
11
|
-
import { ProcedureStorageAdapter } from "./adapter.js";
|
|
12
|
-
/**
|
|
13
|
-
* Extended registration options with persistence flag.
|
|
14
|
-
*/
|
|
15
|
-
export interface SyncedRegistrationOptions extends RegistrationOptions {
|
|
16
|
-
/** Whether to persist this procedure to storage (default: true) */
|
|
17
|
-
persist?: boolean | undefined;
|
|
18
|
-
/**
|
|
19
|
-
* The module and export of the handler. The stored record keeps it, so another process can
|
|
20
|
-
* load the handler (with an allowlisted handler loader) when it pulls the record.
|
|
21
|
-
*/
|
|
22
|
-
handlerRef?: HandlerReference | undefined;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* The synced registry that wraps a registry, if one does. The `procedure.store`, `load`,
|
|
26
|
-
* `sync` and `remote` procedures use it.
|
|
27
|
-
*
|
|
28
|
-
* @param registry - A procedure registry
|
|
29
|
-
* @returns The synced registry of the newest wrapper that is not closed, or undefined
|
|
30
|
-
*/
|
|
31
|
-
export declare function getProcedureStore(registry: ProcedureRegistry): SyncedProcedureRegistry | undefined;
|
|
32
|
-
/**
|
|
33
|
-
* Procedure registry with storage synchronization.
|
|
34
|
-
*
|
|
35
|
-
* Wraps an existing ProcedureRegistry and adds:
|
|
36
|
-
* - Automatic persistence on register (write-through/write-back)
|
|
37
|
-
* - Sync from storage on demand
|
|
38
|
-
* - Conflict resolution
|
|
39
|
-
* - Connection management for remote storage
|
|
40
|
-
*
|
|
41
|
-
* A pull compares the `storedAt` of each record with the one of the last sync, and a local
|
|
42
|
-
* change counter for each path. A change on one side only is not a conflict: the changed side
|
|
43
|
-
* wins. A change on both sides (or a path with no sync yet) is a conflict, and the
|
|
44
|
-
* `conflictResolution` option decides. A record with no handler never replaces a procedure
|
|
45
|
-
* that has one: the procedure keeps its handler and takes the record's metadata.
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* ```typescript
|
|
49
|
-
* const registry = new SyncedProcedureRegistry(
|
|
50
|
-
* PROCEDURE_REGISTRY,
|
|
51
|
-
* storageAdapter,
|
|
52
|
-
* {
|
|
53
|
-
* writeStrategy: 'write-through',
|
|
54
|
-
* conflictResolution: 'remote',
|
|
55
|
-
* }
|
|
56
|
-
* );
|
|
57
|
-
*
|
|
58
|
-
* // Sync from storage on startup
|
|
59
|
-
* await registry.syncFromStorage();
|
|
60
|
-
*
|
|
61
|
-
* // Register with auto-persistence
|
|
62
|
-
* registry.register(myProcedure, { persist: true });
|
|
63
|
-
*
|
|
64
|
-
* // Manual sync
|
|
65
|
-
* const result = await registry.sync('both');
|
|
66
|
-
* ```
|
|
67
|
-
*/
|
|
68
|
-
export declare class SyncedProcedureRegistry {
|
|
69
|
-
private readonly baseRegistry;
|
|
70
|
-
private readonly adapter;
|
|
71
|
-
private readonly options;
|
|
72
|
-
/** Pending changes for write-back strategy */
|
|
73
|
-
private pendingChanges;
|
|
74
|
-
/** Pending deletes for write-back strategy (deep dive DATA-8: they were never deleted) */
|
|
75
|
-
private pendingDeletes;
|
|
76
|
-
/** The handler reference of each path, for the stored records */
|
|
77
|
-
private readonly handlerRefs;
|
|
78
|
-
/** The `storedAt` of the record of each path at its last push or pull */
|
|
79
|
-
private readonly syncedAt;
|
|
80
|
-
/** A counter of local changes for each path, and its value at the last push or pull */
|
|
81
|
-
private readonly localVersion;
|
|
82
|
-
private readonly syncedVersion;
|
|
83
|
-
/** Write-through stores that have not finished */
|
|
84
|
-
private readonly inFlight;
|
|
85
|
-
/** Whether currently connected to remote storage */
|
|
86
|
-
private connected;
|
|
87
|
-
/** Remote endpoint (if connected) */
|
|
88
|
-
private endpoint;
|
|
89
|
-
/** Last sync timestamp */
|
|
90
|
-
private lastSyncTime;
|
|
91
|
-
/** Whether currently syncing */
|
|
92
|
-
private syncing;
|
|
93
|
-
/** Auto-sync interval handle */
|
|
94
|
-
private syncIntervalHandle;
|
|
95
|
-
constructor(baseRegistry: ProcedureRegistry, storage: CollectionStorage<SerializedProcedure>, options?: Partial<SyncedRegistryOptions>);
|
|
96
|
-
/**
|
|
97
|
-
* Register a procedure with optional persistence.
|
|
98
|
-
*
|
|
99
|
-
* The record has the path where the procedure is registered: with a `pathPrefix`, the
|
|
100
|
-
* prefixed path. (Before, the record had the path without the prefix: deep dive CORE-8.)
|
|
101
|
-
*
|
|
102
|
-
* @param procedure - Procedure to register
|
|
103
|
-
* @param options - Registration options including persist flag
|
|
104
|
-
*/
|
|
105
|
-
register(procedure: AnyProcedure, options?: SyncedRegistrationOptions): void;
|
|
106
|
-
/**
|
|
107
|
-
* Unregister a procedure. Its record is deleted from storage: now (write-through), or at the
|
|
108
|
-
* next flush (write-back).
|
|
109
|
-
*
|
|
110
|
-
* @param path - Procedure path
|
|
111
|
-
* @returns True if procedure was removed
|
|
112
|
-
*/
|
|
113
|
-
unregister(path: ProcedurePath): boolean;
|
|
114
|
-
/**
|
|
115
|
-
* Get a procedure by path.
|
|
116
|
-
*/
|
|
117
|
-
get(path: ProcedurePath): AnyProcedure | undefined;
|
|
118
|
-
/**
|
|
119
|
-
* Check if a procedure exists.
|
|
120
|
-
*/
|
|
121
|
-
has(path: ProcedurePath): boolean;
|
|
122
|
-
/**
|
|
123
|
-
* Get all registered procedures.
|
|
124
|
-
*/
|
|
125
|
-
getAll(): AnyProcedure[];
|
|
126
|
-
/**
|
|
127
|
-
* Get procedures by prefix.
|
|
128
|
-
*/
|
|
129
|
-
getByPrefix(prefix: ProcedurePath): AnyProcedure[];
|
|
130
|
-
/**
|
|
131
|
-
* Get count of registered procedures.
|
|
132
|
-
*/
|
|
133
|
-
get size(): number;
|
|
134
|
-
/**
|
|
135
|
-
* Sync from storage to registry.
|
|
136
|
-
* Loads procedures from storage and merges with registry.
|
|
137
|
-
*
|
|
138
|
-
* @param filter - Pull only the records for which this function gives true (default: all)
|
|
139
|
-
* @returns Sync result with counts and conflicts
|
|
140
|
-
*/
|
|
141
|
-
syncFromStorage(filter?: (record: SerializedProcedure) => boolean): Promise<SyncResult>;
|
|
142
|
-
/**
|
|
143
|
-
* Sync from registry to storage.
|
|
144
|
-
* Persists all registered procedures to storage, each with its handler reference.
|
|
145
|
-
*
|
|
146
|
-
* @returns Sync result
|
|
147
|
-
*/
|
|
148
|
-
syncToStorage(): Promise<SyncResult>;
|
|
149
|
-
/**
|
|
150
|
-
* Full bidirectional sync.
|
|
151
|
-
*
|
|
152
|
-
* @param direction - Sync direction (push/pull/both)
|
|
153
|
-
* @returns Sync result
|
|
154
|
-
*/
|
|
155
|
-
sync(direction?: SyncDirection): Promise<SyncResult>;
|
|
156
|
-
/**
|
|
157
|
-
* Flush pending changes to storage: the queued writes and deletes of the write-back strategy.
|
|
158
|
-
*
|
|
159
|
-
* @returns The number of records written or deleted
|
|
160
|
-
*/
|
|
161
|
-
flushPending(): Promise<number>;
|
|
162
|
-
/**
|
|
163
|
-
* Store the registered procedure at a path now, whatever the write strategy.
|
|
164
|
-
*
|
|
165
|
-
* @param path - Procedure path
|
|
166
|
-
* @param options - A handler reference for the record
|
|
167
|
-
* @returns The stored record, or undefined when no procedure is registered at the path
|
|
168
|
-
*/
|
|
169
|
-
storeProcedure(path: ProcedurePath, options?: {
|
|
170
|
-
handlerRef?: HandlerReference | undefined;
|
|
171
|
-
}): Promise<SerializedProcedure | undefined>;
|
|
172
|
-
/**
|
|
173
|
-
* Wait for the write-through writes that have started.
|
|
174
|
-
*/
|
|
175
|
-
flushWrites(): Promise<void>;
|
|
176
|
-
/**
|
|
177
|
-
* Record a remote endpoint, and optionally pull from storage. This method does not change the
|
|
178
|
-
* storage: give the registry an `ApiStorage` for the endpoint when you make it.
|
|
179
|
-
*
|
|
180
|
-
* @param endpoint - Remote endpoint URL
|
|
181
|
-
* @param options - Connection options
|
|
182
|
-
*/
|
|
183
|
-
connect(endpoint: string, options?: {
|
|
184
|
-
syncOnConnect?: boolean;
|
|
185
|
-
}): Promise<void>;
|
|
186
|
-
/**
|
|
187
|
-
* Disconnect from remote storage.
|
|
188
|
-
*/
|
|
189
|
-
disconnect(): void;
|
|
190
|
-
/**
|
|
191
|
-
* Get current sync status.
|
|
192
|
-
*/
|
|
193
|
-
getStatus(): SyncStatus;
|
|
194
|
-
/**
|
|
195
|
-
* Start auto-sync at specified interval.
|
|
196
|
-
*
|
|
197
|
-
* @param intervalMs - Sync interval in milliseconds
|
|
198
|
-
*/
|
|
199
|
-
startAutoSync(intervalMs: number): void;
|
|
200
|
-
/**
|
|
201
|
-
* Stop auto-sync.
|
|
202
|
-
*/
|
|
203
|
-
stopAutoSync(): void;
|
|
204
|
-
/**
|
|
205
|
-
* Resolve a conflict between local and remote procedures.
|
|
206
|
-
*
|
|
207
|
-
* @param path - Procedure path
|
|
208
|
-
* @param local - Local procedure
|
|
209
|
-
* @param remote - Remote procedure
|
|
210
|
-
* @returns Conflict info if not automatically resolved
|
|
211
|
-
*/
|
|
212
|
-
private resolveConflict;
|
|
213
|
-
/**
|
|
214
|
-
* The remote version of a procedure. When the remote record gives no handler (a stub), the
|
|
215
|
-
* local handler and schemas stay, and the remote metadata applies.
|
|
216
|
-
*/
|
|
217
|
-
private keepHandler;
|
|
218
|
-
/** Record a local change of a path. */
|
|
219
|
-
private touch;
|
|
220
|
-
/** True when the path changed locally since its last push or pull. */
|
|
221
|
-
private isDirty;
|
|
222
|
-
/** Record that storage and the registry agree on a path. */
|
|
223
|
-
private markSynced;
|
|
224
|
-
/** Store records for procedures, each with its handler reference, and mark them synced. */
|
|
225
|
-
private storeRecords;
|
|
226
|
-
/** Delete records, and forget their sync state. */
|
|
227
|
-
private removeRecords;
|
|
228
|
-
private track;
|
|
229
|
-
/**
|
|
230
|
-
* Get the base registry.
|
|
231
|
-
*/
|
|
232
|
-
getBaseRegistry(): ProcedureRegistry;
|
|
233
|
-
/**
|
|
234
|
-
* Get the storage adapter.
|
|
235
|
-
*/
|
|
236
|
-
getAdapter(): ProcedureStorageAdapter;
|
|
237
|
-
/**
|
|
238
|
-
* Get the handler loader.
|
|
239
|
-
*/
|
|
240
|
-
getHandlerLoader(): HandlerLoader | undefined;
|
|
241
|
-
/**
|
|
242
|
-
* Close the synced registry and cleanup resources.
|
|
243
|
-
*/
|
|
244
|
-
close(): Promise<void>;
|
|
245
|
-
}
|
|
246
|
-
//# sourceMappingURL=synced-registry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"synced-registry.d.ts","sourceRoot":"","sources":["../../../src/procedures/storage/synced-registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEpF,OAAO,KAAK,EACV,mBAAmB,EACnB,qBAAqB,EACrB,UAAU,EACV,UAAU,EACV,aAAa,EAEb,aAAa,EACb,gBAAgB,EACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAOvD;;GAEG;AACH,MAAM,WAAW,yBAA0B,SAAQ,mBAAmB;IACpE,mEAAmE;IACnE,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAE9B;;;OAGG;IACH,UAAU,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;CAC3C;AAQD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,uBAAuB,GAAG,SAAS,CAElG;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,qBAAa,uBAAuB;IAClC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAoB;IACjD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA0B;IAClD,OAAO,CAA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