@procedures/client 0.1.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.
Files changed (334) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +5 -5
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/adapters/http/server/transport.d.ts.map +1 -1
  5. package/dist/adapters/http/server/transport.js +1 -0
  6. package/dist/adapters/http/server/transport.js.map +1 -1
  7. package/dist/browser.d.ts +6 -3
  8. package/dist/browser.d.ts.map +1 -1
  9. package/dist/browser.js +4 -1
  10. package/dist/browser.js.map +1 -1
  11. package/dist/client/client.d.ts +9 -1
  12. package/dist/client/client.d.ts.map +1 -1
  13. package/dist/client/client.js +27 -6
  14. package/dist/client/client.js.map +1 -1
  15. package/dist/client/types.d.ts +9 -0
  16. package/dist/client/types.d.ts.map +1 -1
  17. package/dist/client/types.js.map +1 -1
  18. package/dist/procedures/capability.d.ts +111 -0
  19. package/dist/procedures/capability.d.ts.map +1 -0
  20. package/dist/procedures/capability.js +269 -0
  21. package/dist/procedures/capability.js.map +1 -0
  22. package/dist/procedures/cli/discover.d.ts +3 -3
  23. package/dist/procedures/cli/discover.js +3 -3
  24. package/dist/procedures/cli/index.js +5 -3
  25. package/dist/procedures/cli/index.js.map +1 -1
  26. package/dist/procedures/cli/init.js +1 -1
  27. package/dist/procedures/collection/procedures.d.ts.map +1 -1
  28. package/dist/procedures/collection/procedures.js +12 -0
  29. package/dist/procedures/collection/procedures.js.map +1 -1
  30. package/dist/procedures/core/array.d.ts.map +1 -1
  31. package/dist/procedures/core/array.js +3 -1
  32. package/dist/procedures/core/array.js.map +1 -1
  33. package/dist/procedures/core/comparison.d.ts.map +1 -1
  34. package/dist/procedures/core/comparison.js +3 -1
  35. package/dist/procedures/core/comparison.js.map +1 -1
  36. package/dist/procedures/core/index.d.ts.map +1 -1
  37. package/dist/procedures/core/index.js +5 -2
  38. package/dist/procedures/core/index.js.map +1 -1
  39. package/dist/procedures/core/math.d.ts.map +1 -1
  40. package/dist/procedures/core/math.js +3 -1
  41. package/dist/procedures/core/math.js.map +1 -1
  42. package/dist/procedures/core/meta.d.ts.map +1 -1
  43. package/dist/procedures/core/meta.js +11 -6
  44. package/dist/procedures/core/meta.js.map +1 -1
  45. package/dist/procedures/core/object.d.ts.map +1 -1
  46. package/dist/procedures/core/object.js +3 -1
  47. package/dist/procedures/core/object.js.map +1 -1
  48. package/dist/procedures/core/string.d.ts.map +1 -1
  49. package/dist/procedures/core/string.js +3 -1
  50. package/dist/procedures/core/string.js.map +1 -1
  51. package/dist/procedures/core/type.d.ts.map +1 -1
  52. package/dist/procedures/core/type.js +3 -1
  53. package/dist/procedures/core/type.js.map +1 -1
  54. package/dist/procedures/define-procedure.d.ts.map +1 -1
  55. package/dist/procedures/define-procedure.js +5 -4
  56. package/dist/procedures/define-procedure.js.map +1 -1
  57. package/dist/procedures/effects.d.ts +15 -0
  58. package/dist/procedures/effects.d.ts.map +1 -0
  59. package/dist/procedures/effects.js +18 -0
  60. package/dist/procedures/effects.js.map +1 -0
  61. package/dist/procedures/index.d.ts +5 -2
  62. package/dist/procedures/index.d.ts.map +1 -1
  63. package/dist/procedures/index.js +8 -23
  64. package/dist/procedures/index.js.map +1 -1
  65. package/dist/procedures/interceptors.d.ts.map +1 -1
  66. package/dist/procedures/interceptors.js +2 -1
  67. package/dist/procedures/interceptors.js.map +1 -1
  68. package/dist/procedures/invoke.d.ts +36 -3
  69. package/dist/procedures/invoke.d.ts.map +1 -1
  70. package/dist/procedures/invoke.js +78 -12
  71. package/dist/procedures/invoke.js.map +1 -1
  72. package/dist/procedures/module.d.ts +13 -8
  73. package/dist/procedures/module.d.ts.map +1 -1
  74. package/dist/procedures/module.js +19 -9
  75. package/dist/procedures/module.js.map +1 -1
  76. package/dist/procedures/types.d.ts +100 -2
  77. package/dist/procedures/types.d.ts.map +1 -1
  78. package/dist/procedures/types.js.map +1 -1
  79. package/dist/register.d.ts +8 -0
  80. package/dist/register.d.ts.map +1 -0
  81. package/dist/register.js +9 -0
  82. package/dist/register.js.map +1 -0
  83. package/dist/server/host-policy.d.ts +24 -2
  84. package/dist/server/host-policy.d.ts.map +1 -1
  85. package/dist/server/host-policy.js +22 -0
  86. package/dist/server/host-policy.js.map +1 -1
  87. package/dist/server/procedure-server.d.ts +16 -2
  88. package/dist/server/procedure-server.d.ts.map +1 -1
  89. package/dist/server/procedure-server.js +26 -1
  90. package/dist/server/procedure-server.js.map +1 -1
  91. package/package.json +6 -4
  92. package/src/adapters/http/server/transport.ts +1 -0
  93. package/src/browser.ts +29 -0
  94. package/src/client/client.ts +33 -6
  95. package/src/client/types.ts +11 -0
  96. package/src/procedures/capability.ts +333 -0
  97. package/src/procedures/cli/discover.ts +3 -3
  98. package/src/procedures/cli/index.ts +5 -3
  99. package/src/procedures/cli/init.ts +1 -1
  100. package/src/procedures/collection/procedures.ts +12 -0
  101. package/src/procedures/core/array.ts +3 -1
  102. package/src/procedures/core/comparison.ts +3 -1
  103. package/src/procedures/core/index.ts +5 -2
  104. package/src/procedures/core/math.ts +3 -1
  105. package/src/procedures/core/meta.ts +11 -6
  106. package/src/procedures/core/object.ts +3 -1
  107. package/src/procedures/core/string.ts +3 -1
  108. package/src/procedures/core/type.ts +3 -1
  109. package/src/procedures/define-procedure.ts +5 -4
  110. package/src/procedures/effects.ts +24 -0
  111. package/src/procedures/index.ts +33 -22
  112. package/src/procedures/interceptors.ts +2 -1
  113. package/src/procedures/invoke.ts +112 -13
  114. package/src/procedures/module.ts +19 -9
  115. package/src/procedures/types.ts +113 -2
  116. package/src/register.ts +10 -0
  117. package/src/server/host-policy.ts +44 -2
  118. package/src/server/procedure-server.ts +44 -2
  119. package/dist/client/middleware/batching.d.ts +0 -102
  120. package/dist/client/middleware/batching.d.ts.map +0 -1
  121. package/dist/client/middleware/batching.js +0 -245
  122. package/dist/client/middleware/batching.js.map +0 -1
  123. package/dist/collections/async/async-queue.d.ts +0 -144
  124. package/dist/collections/async/async-queue.d.ts.map +0 -1
  125. package/dist/collections/async/async-queue.js +0 -347
  126. package/dist/collections/async/async-queue.js.map +0 -1
  127. package/dist/collections/async/channels.d.ts +0 -188
  128. package/dist/collections/async/channels.d.ts.map +0 -1
  129. package/dist/collections/async/channels.js +0 -312
  130. package/dist/collections/async/channels.js.map +0 -1
  131. package/dist/collections/behaviors/bounded.d.ts +0 -79
  132. package/dist/collections/behaviors/bounded.d.ts.map +0 -1
  133. package/dist/collections/behaviors/bounded.js +0 -384
  134. package/dist/collections/behaviors/bounded.js.map +0 -1
  135. package/dist/collections/behaviors/evented.d.ts +0 -154
  136. package/dist/collections/behaviors/evented.d.ts.map +0 -1
  137. package/dist/collections/behaviors/evented.js +0 -299
  138. package/dist/collections/behaviors/evented.js.map +0 -1
  139. package/dist/collections/behaviors/lru.d.ts +0 -84
  140. package/dist/collections/behaviors/lru.d.ts.map +0 -1
  141. package/dist/collections/behaviors/lru.js +0 -330
  142. package/dist/collections/behaviors/lru.js.map +0 -1
  143. package/dist/collections/behaviors/readonly.d.ts +0 -73
  144. package/dist/collections/behaviors/readonly.d.ts.map +0 -1
  145. package/dist/collections/behaviors/readonly.js +0 -158
  146. package/dist/collections/behaviors/readonly.js.map +0 -1
  147. package/dist/collections/behaviors/safe.d.ts +0 -163
  148. package/dist/collections/behaviors/safe.d.ts.map +0 -1
  149. package/dist/collections/behaviors/safe.js +0 -172
  150. package/dist/collections/behaviors/safe.js.map +0 -1
  151. package/dist/collections/behaviors/synchronized.d.ts +0 -88
  152. package/dist/collections/behaviors/synchronized.d.ts.map +0 -1
  153. package/dist/collections/behaviors/synchronized.js +0 -294
  154. package/dist/collections/behaviors/synchronized.js.map +0 -1
  155. package/dist/collections/behaviors/ttl.d.ts +0 -118
  156. package/dist/collections/behaviors/ttl.d.ts.map +0 -1
  157. package/dist/collections/behaviors/ttl.js +0 -338
  158. package/dist/collections/behaviors/ttl.js.map +0 -1
  159. package/dist/collections/core/effects.d.ts +0 -176
  160. package/dist/collections/core/effects.d.ts.map +0 -1
  161. package/dist/collections/core/effects.js +0 -180
  162. package/dist/collections/core/effects.js.map +0 -1
  163. package/dist/collections/core/events.d.ts +0 -192
  164. package/dist/collections/core/events.d.ts.map +0 -1
  165. package/dist/collections/core/events.js +0 -291
  166. package/dist/collections/core/events.js.map +0 -1
  167. package/dist/collections/core/middleware.d.ts +0 -231
  168. package/dist/collections/core/middleware.d.ts.map +0 -1
  169. package/dist/collections/core/middleware.js +0 -161
  170. package/dist/collections/core/middleware.js.map +0 -1
  171. package/dist/collections/core/policies.d.ts +0 -220
  172. package/dist/collections/core/policies.d.ts.map +0 -1
  173. package/dist/collections/core/policies.js +0 -48
  174. package/dist/collections/core/policies.js.map +0 -1
  175. package/dist/collections/core/traits.d.ts +0 -142
  176. package/dist/collections/core/traits.d.ts.map +0 -1
  177. package/dist/collections/core/traits.js +0 -8
  178. package/dist/collections/core/traits.js.map +0 -1
  179. package/dist/collections/examples.d.ts +0 -13
  180. package/dist/collections/examples.d.ts.map +0 -1
  181. package/dist/collections/examples.js +0 -302
  182. package/dist/collections/examples.js.map +0 -1
  183. package/dist/collections/fx/collectors.d.ts +0 -190
  184. package/dist/collections/fx/collectors.d.ts.map +0 -1
  185. package/dist/collections/fx/collectors.js +0 -369
  186. package/dist/collections/fx/collectors.js.map +0 -1
  187. package/dist/collections/fx/iter.d.ts +0 -166
  188. package/dist/collections/fx/iter.d.ts.map +0 -1
  189. package/dist/collections/fx/iter.js +0 -421
  190. package/dist/collections/fx/iter.js.map +0 -1
  191. package/dist/collections/impl/array-deque.d.ts +0 -107
  192. package/dist/collections/impl/array-deque.d.ts.map +0 -1
  193. package/dist/collections/impl/array-deque.js +0 -381
  194. package/dist/collections/impl/array-deque.js.map +0 -1
  195. package/dist/collections/impl/array-list.d.ts +0 -101
  196. package/dist/collections/impl/array-list.d.ts.map +0 -1
  197. package/dist/collections/impl/array-list.js +0 -387
  198. package/dist/collections/impl/array-list.js.map +0 -1
  199. package/dist/collections/impl/hash-map.d.ts +0 -141
  200. package/dist/collections/impl/hash-map.d.ts.map +0 -1
  201. package/dist/collections/impl/hash-map.js +0 -450
  202. package/dist/collections/impl/hash-map.js.map +0 -1
  203. package/dist/collections/impl/hash-set.d.ts +0 -125
  204. package/dist/collections/impl/hash-set.d.ts.map +0 -1
  205. package/dist/collections/impl/hash-set.js +0 -264
  206. package/dist/collections/impl/hash-set.js.map +0 -1
  207. package/dist/collections/impl/linked-hash-map.d.ts +0 -141
  208. package/dist/collections/impl/linked-hash-map.d.ts.map +0 -1
  209. package/dist/collections/impl/linked-hash-map.js +0 -472
  210. package/dist/collections/impl/linked-hash-map.js.map +0 -1
  211. package/dist/collections/impl/linked-list.d.ts +0 -109
  212. package/dist/collections/impl/linked-list.d.ts.map +0 -1
  213. package/dist/collections/impl/linked-list.js +0 -491
  214. package/dist/collections/impl/linked-list.js.map +0 -1
  215. package/dist/collections/impl/priority-queue.d.ts +0 -134
  216. package/dist/collections/impl/priority-queue.d.ts.map +0 -1
  217. package/dist/collections/impl/priority-queue.js +0 -336
  218. package/dist/collections/impl/priority-queue.js.map +0 -1
  219. package/dist/collections/impl/tree-map.d.ts +0 -146
  220. package/dist/collections/impl/tree-map.d.ts.map +0 -1
  221. package/dist/collections/impl/tree-map.js +0 -781
  222. package/dist/collections/impl/tree-map.js.map +0 -1
  223. package/dist/collections/impl/tree-set.d.ts +0 -112
  224. package/dist/collections/impl/tree-set.d.ts.map +0 -1
  225. package/dist/collections/impl/tree-set.js +0 -374
  226. package/dist/collections/impl/tree-set.js.map +0 -1
  227. package/dist/collections/index.d.ts +0 -105
  228. package/dist/collections/index.d.ts.map +0 -1
  229. package/dist/collections/index.js +0 -135
  230. package/dist/collections/index.js.map +0 -1
  231. package/dist/collections/interfaces/collection.d.ts +0 -119
  232. package/dist/collections/interfaces/collection.d.ts.map +0 -1
  233. package/dist/collections/interfaces/collection.js +0 -8
  234. package/dist/collections/interfaces/collection.js.map +0 -1
  235. package/dist/collections/interfaces/list.d.ts +0 -247
  236. package/dist/collections/interfaces/list.d.ts.map +0 -1
  237. package/dist/collections/interfaces/list.js +0 -8
  238. package/dist/collections/interfaces/list.js.map +0 -1
  239. package/dist/collections/interfaces/map.d.ts +0 -344
  240. package/dist/collections/interfaces/map.d.ts.map +0 -1
  241. package/dist/collections/interfaces/map.js +0 -8
  242. package/dist/collections/interfaces/map.js.map +0 -1
  243. package/dist/collections/interfaces/queue.d.ts +0 -304
  244. package/dist/collections/interfaces/queue.d.ts.map +0 -1
  245. package/dist/collections/interfaces/queue.js +0 -8
  246. package/dist/collections/interfaces/queue.js.map +0 -1
  247. package/dist/collections/interfaces/set.d.ts +0 -137
  248. package/dist/collections/interfaces/set.d.ts.map +0 -1
  249. package/dist/collections/interfaces/set.js +0 -8
  250. package/dist/collections/interfaces/set.js.map +0 -1
  251. package/dist/collections/storage/api.d.ts +0 -109
  252. package/dist/collections/storage/api.d.ts.map +0 -1
  253. package/dist/collections/storage/api.js +0 -182
  254. package/dist/collections/storage/api.js.map +0 -1
  255. package/dist/collections/storage/hybrid.d.ts +0 -164
  256. package/dist/collections/storage/hybrid.d.ts.map +0 -1
  257. package/dist/collections/storage/hybrid.js +0 -416
  258. package/dist/collections/storage/hybrid.js.map +0 -1
  259. package/dist/collections/storage/index.d.ts +0 -16
  260. package/dist/collections/storage/index.d.ts.map +0 -1
  261. package/dist/collections/storage/index.js +0 -13
  262. package/dist/collections/storage/index.js.map +0 -1
  263. package/dist/collections/storage/interface.d.ts +0 -141
  264. package/dist/collections/storage/interface.d.ts.map +0 -1
  265. package/dist/collections/storage/interface.js +0 -23
  266. package/dist/collections/storage/interface.js.map +0 -1
  267. package/dist/collections/storage/memory.d.ts +0 -68
  268. package/dist/collections/storage/memory.d.ts.map +0 -1
  269. package/dist/collections/storage/memory.js +0 -154
  270. package/dist/collections/storage/memory.js.map +0 -1
  271. package/dist/collections/utils/defaults.d.ts +0 -135
  272. package/dist/collections/utils/defaults.d.ts.map +0 -1
  273. package/dist/collections/utils/defaults.js +0 -322
  274. package/dist/collections/utils/defaults.js.map +0 -1
  275. package/dist/collections/utils/factories.d.ts +0 -144
  276. package/dist/collections/utils/factories.d.ts.map +0 -1
  277. package/dist/collections/utils/factories.js +0 -293
  278. package/dist/collections/utils/factories.js.map +0 -1
  279. package/dist/collections/utils/helpers.d.ts +0 -137
  280. package/dist/collections/utils/helpers.d.ts.map +0 -1
  281. package/dist/collections/utils/helpers.js +0 -221
  282. package/dist/collections/utils/helpers.js.map +0 -1
  283. package/dist/collections.d.ts +0 -12
  284. package/dist/collections.d.ts.map +0 -1
  285. package/dist/collections.js +0 -10
  286. package/dist/collections.js.map +0 -1
  287. package/dist/components/define.d.ts +0 -134
  288. package/dist/components/define.d.ts.map +0 -1
  289. package/dist/components/define.js +0 -486
  290. package/dist/components/define.js.map +0 -1
  291. package/dist/components/index.d.ts +0 -39
  292. package/dist/components/index.d.ts.map +0 -1
  293. package/dist/components/index.js +0 -38
  294. package/dist/components/index.js.map +0 -1
  295. package/dist/components/types.d.ts +0 -264
  296. package/dist/components/types.d.ts.map +0 -1
  297. package/dist/components/types.js +0 -46
  298. package/dist/components/types.js.map +0 -1
  299. package/dist/procedures/storage/adapter.d.ts +0 -148
  300. package/dist/procedures/storage/adapter.d.ts.map +0 -1
  301. package/dist/procedures/storage/adapter.js +0 -214
  302. package/dist/procedures/storage/adapter.js.map +0 -1
  303. package/dist/procedures/storage/api.d.ts +0 -125
  304. package/dist/procedures/storage/api.d.ts.map +0 -1
  305. package/dist/procedures/storage/api.js +0 -220
  306. package/dist/procedures/storage/api.js.map +0 -1
  307. package/dist/procedures/storage/factory.d.ts +0 -134
  308. package/dist/procedures/storage/factory.d.ts.map +0 -1
  309. package/dist/procedures/storage/factory.js +0 -166
  310. package/dist/procedures/storage/factory.js.map +0 -1
  311. package/dist/procedures/storage/hybrid.d.ts +0 -193
  312. package/dist/procedures/storage/hybrid.d.ts.map +0 -1
  313. package/dist/procedures/storage/hybrid.js +0 -519
  314. package/dist/procedures/storage/hybrid.js.map +0 -1
  315. package/dist/procedures/storage/index.d.ts +0 -17
  316. package/dist/procedures/storage/index.d.ts.map +0 -1
  317. package/dist/procedures/storage/index.js +0 -17
  318. package/dist/procedures/storage/index.js.map +0 -1
  319. package/dist/procedures/storage/procedures.d.ts +0 -39
  320. package/dist/procedures/storage/procedures.d.ts.map +0 -1
  321. package/dist/procedures/storage/procedures.js +0 -261
  322. package/dist/procedures/storage/procedures.js.map +0 -1
  323. package/dist/procedures/storage/serialization.d.ts +0 -123
  324. package/dist/procedures/storage/serialization.d.ts.map +0 -1
  325. package/dist/procedures/storage/serialization.js +0 -216
  326. package/dist/procedures/storage/serialization.js.map +0 -1
  327. package/dist/procedures/storage/synced-registry.d.ts +0 -246
  328. package/dist/procedures/storage/synced-registry.d.ts.map +0 -1
  329. package/dist/procedures/storage/synced-registry.js +0 -575
  330. package/dist/procedures/storage/synced-registry.js.map +0 -1
  331. package/dist/procedures/storage/types.d.ts +0 -130
  332. package/dist/procedures/storage/types.d.ts.map +0 -1
  333. package/dist/procedures/storage/types.js +0 -8
  334. package/dist/procedures/storage/types.js.map +0 -1
@@ -1,519 +0,0 @@
1
- /**
2
- * Hybrid Storage Implementation
3
- *
4
- * Combines local cache (InMemoryStorage) with remote persistence (ApiStorage).
5
- * Provides fast local reads with remote backup and sync.
6
- *
7
- * Features:
8
- * - Local cache for fast reads, with a remote read on a miss
9
- * - Write-through or write-back strategies
10
- * - Automatic sync on initialization
11
- * - Conflict resolution
12
- * - Offline operation queue
13
- */
14
- import { InMemoryStorage } from "@mark1russell7/client-collections";
15
- /** The ids that an operation changes ("*" for clear). */
16
- function idsOf(op) {
17
- const data = op.data;
18
- switch (op.type) {
19
- case "set":
20
- case "delete":
21
- return data.id === undefined ? [] : [data.id];
22
- case "setBatch":
23
- return (data.items ?? []).map(([id]) => id);
24
- case "deleteBatch":
25
- return data.ids ?? [];
26
- case "clear":
27
- return ["*"];
28
- }
29
- }
30
- const defaultKeyOf = (item) => {
31
- const id = item?.id;
32
- return typeof id === "string" && id.length > 0 ? id : undefined;
33
- };
34
- /**
35
- * Hybrid storage combining local cache with remote persistence.
36
- *
37
- * @example
38
- * ```typescript
39
- * const client = new Client({
40
- * transport: new HttpTransport({ baseUrl: "https://api.example.com" })
41
- * });
42
- *
43
- * const remote = new ApiStorage(client, { collection: "users" });
44
- * const hybrid = new HybridStorage(remote, {
45
- * writeStrategy: "write-through",
46
- * conflictResolution: "remote",
47
- * syncInterval: 5000
48
- * });
49
- *
50
- * // Fast local reads
51
- * const user = await hybrid.get("123"); // From cache, or from the remote on a miss
52
- *
53
- * // Writes go to both local and remote
54
- * await hybrid.set("123", { name: "John" });
55
- * ```
56
- */
57
- export class HybridStorage {
58
- local;
59
- remote;
60
- options;
61
- offlineOps = [];
62
- syncTimer = null;
63
- isOnline = true;
64
- /** A counter of local writes for each id, so a sync does not restore an older remote value */
65
- writeVersions = new Map();
66
- clearVersion = 0;
67
- /** The running sync: syncs run one at a time */
68
- syncChain = Promise.resolve();
69
- stats = {
70
- cacheHits: 0,
71
- cacheMisses: 0,
72
- syncCount: 0,
73
- conflicts: 0,
74
- };
75
- constructor(remote, options = {}) {
76
- this.local = new InMemoryStorage();
77
- this.remote = remote;
78
- this.options = {
79
- writeStrategy: options.writeStrategy ?? "write-through",
80
- conflictResolution: options.conflictResolution ?? "remote",
81
- ...(options.mergeFn !== undefined && { mergeFn: options.mergeFn }),
82
- keyOf: options.keyOf ?? defaultKeyOf,
83
- syncInterval: options.syncInterval ?? 5000,
84
- syncOnInit: options.syncOnInit ?? true,
85
- maxOfflineOps: options.maxOfflineOps ?? 1000,
86
- offlineQueue: options.offlineQueue ?? true,
87
- };
88
- // Initialize with remote data
89
- if (this.options.syncOnInit) {
90
- this.syncFromRemote().catch((err) => {
91
- console.error("Failed to sync on init:", err);
92
- });
93
- }
94
- // Start periodic sync for write-back mode
95
- if (this.options.writeStrategy === "write-back" &&
96
- this.options.syncInterval > 0) {
97
- this.startPeriodicSync();
98
- }
99
- }
100
- //
101
- // ═══ Read Operations ═══
102
- //
103
- /**
104
- * The local item, or else the remote item (which the cache then keeps). When the remote
105
- * cannot answer, the storage is offline and the result is undefined.
106
- */
107
- async get(id) {
108
- // Try local cache first
109
- const cached = await this.local.get(id);
110
- if (cached !== undefined) {
111
- this.stats.cacheHits++;
112
- return cached;
113
- }
114
- this.stats.cacheMisses++;
115
- // A pending local delete means "no item": do not read it back from the remote
116
- if (this.hasPendingOp(id)) {
117
- return undefined;
118
- }
119
- const version = this.versionOf(id);
120
- try {
121
- const remote = await this.remote.get(id);
122
- this.isOnline = true;
123
- if (remote !== undefined && this.versionOf(id) === version) {
124
- await this.local.set(id, remote);
125
- }
126
- return remote;
127
- }
128
- catch {
129
- this.isOnline = false;
130
- return undefined;
131
- }
132
- }
133
- async getAll() {
134
- // Return local cache
135
- return this.local.getAll();
136
- }
137
- async find(predicate) {
138
- // Search local cache
139
- return this.local.find(predicate);
140
- }
141
- async has(id) {
142
- return this.local.has(id);
143
- }
144
- async size() {
145
- return this.local.size();
146
- }
147
- //
148
- // ═══ Write Operations ═══
149
- //
150
- async set(id, value) {
151
- this.bump(id);
152
- // Always write to local immediately
153
- await this.local.set(id, value);
154
- if (this.options.writeStrategy === "write-through") {
155
- // Write-through: sync to remote immediately
156
- try {
157
- await this.remote.set(id, value);
158
- }
159
- catch (error) {
160
- this.handleRemoteFailure("set", { id, value });
161
- throw error;
162
- }
163
- }
164
- else {
165
- // Write-back: queue for later sync
166
- this.queueOperation({
167
- type: "set",
168
- data: { id, value },
169
- timestamp: Date.now(),
170
- });
171
- }
172
- }
173
- async delete(id) {
174
- this.bump(id);
175
- const existed = await this.local.delete(id);
176
- if (this.options.writeStrategy === "write-through") {
177
- try {
178
- await this.remote.delete(id);
179
- }
180
- catch (error) {
181
- this.handleRemoteFailure("delete", { id });
182
- throw error;
183
- }
184
- }
185
- else {
186
- this.queueOperation({
187
- type: "delete",
188
- data: { id },
189
- timestamp: Date.now(),
190
- });
191
- }
192
- return existed;
193
- }
194
- async clear() {
195
- this.clearVersion++;
196
- await this.local.clear();
197
- if (this.options.writeStrategy === "write-through") {
198
- try {
199
- await this.remote.clear();
200
- }
201
- catch (error) {
202
- this.handleRemoteFailure("clear", {});
203
- throw error;
204
- }
205
- }
206
- else {
207
- this.queueOperation({
208
- type: "clear",
209
- data: {},
210
- timestamp: Date.now(),
211
- });
212
- }
213
- }
214
- //
215
- // ═══ Bulk Operations ═══
216
- //
217
- async setBatch(items) {
218
- for (const [id] of items)
219
- this.bump(id);
220
- await this.local.setBatch(items);
221
- if (this.options.writeStrategy === "write-through") {
222
- try {
223
- await this.remote.setBatch(items);
224
- }
225
- catch (error) {
226
- this.handleRemoteFailure("setBatch", { items });
227
- throw error;
228
- }
229
- }
230
- else {
231
- this.queueOperation({
232
- type: "setBatch",
233
- data: { items },
234
- timestamp: Date.now(),
235
- });
236
- }
237
- }
238
- async deleteBatch(ids) {
239
- for (const id of ids)
240
- this.bump(id);
241
- const deleted = await this.local.deleteBatch(ids);
242
- if (this.options.writeStrategy === "write-through") {
243
- try {
244
- await this.remote.deleteBatch(ids);
245
- }
246
- catch (error) {
247
- this.handleRemoteFailure("deleteBatch", { ids });
248
- throw error;
249
- }
250
- }
251
- else {
252
- this.queueOperation({
253
- type: "deleteBatch",
254
- data: { ids },
255
- timestamp: Date.now(),
256
- });
257
- }
258
- return deleted;
259
- }
260
- getBatch(ids) {
261
- return this.local.getBatch(ids);
262
- }
263
- //
264
- // ═══ Sync Operations ═══
265
- //
266
- /**
267
- * Sync all data from remote to local.
268
- * Handles conflicts according to conflict resolution strategy.
269
- *
270
- * - Each remote item goes into the cache under `keyOf(item)`.
271
- * - A local item that the remote does not have is removed, unless a queued local operation
272
- * changes it (the remote deleted it).
273
- * - An id that a local write changed during the sync keeps the local value: the remote value
274
- * is older.
275
- * - Syncs run one at a time.
276
- */
277
- syncFromRemote() {
278
- return this.serialize(() => this.pullRemote());
279
- }
280
- /**
281
- * Sync all pending offline operations to remote.
282
- * Processes queued operations in order. When one fails, it and the later operations stay in
283
- * the queue: the operations that reached the remote are not sent again.
284
- */
285
- syncToRemote() {
286
- return this.serialize(() => this.pushQueue());
287
- }
288
- /**
289
- * Force a full sync (both directions).
290
- */
291
- async sync() {
292
- await this.syncToRemote();
293
- await this.syncFromRemote();
294
- }
295
- //
296
- // ═══ Lifecycle & Metadata ═══
297
- //
298
- async close() {
299
- // Stop periodic sync
300
- if (this.syncTimer) {
301
- clearInterval(this.syncTimer);
302
- this.syncTimer = null;
303
- }
304
- // Sync pending operations before closing
305
- if (this.offlineOps.length > 0) {
306
- try {
307
- await this.syncToRemote();
308
- }
309
- catch (error) {
310
- console.error("Failed to sync before close:", error);
311
- }
312
- }
313
- // Close remote storage (an ApiStorage leaves the caller's client open)
314
- await this.remote.close();
315
- }
316
- async getMetadata() {
317
- const totalOps = this.stats.cacheHits + this.stats.cacheMisses;
318
- const hitRate = totalOps > 0 ? (this.stats.cacheHits / totalOps) * 100 : 0;
319
- const currentSize = await this.local.size();
320
- return {
321
- type: "hybrid",
322
- size: currentSize,
323
- stats: {
324
- hitRate: Math.round(hitRate * 100) / 100,
325
- cacheHits: this.stats.cacheHits,
326
- cacheMisses: this.stats.cacheMisses,
327
- syncCount: this.stats.syncCount,
328
- conflicts: this.stats.conflicts,
329
- pendingOps: this.offlineOps.length,
330
- isOnline: this.isOnline,
331
- writeStrategy: this.options.writeStrategy,
332
- conflictResolution: this.options.conflictResolution,
333
- },
334
- };
335
- }
336
- //
337
- // ═══ Internal Helpers ═══
338
- //
339
- async pullRemote() {
340
- const versions = new Map(this.writeVersions);
341
- const clearVersion = this.clearVersion;
342
- // True when a local write changed the id after the sync started
343
- const changedLocally = (id) => this.clearVersion !== clearVersion || (this.writeVersions.get(id) ?? 0) !== (versions.get(id) ?? 0);
344
- let remoteData;
345
- try {
346
- remoteData = await this.remote.getAll();
347
- }
348
- catch (error) {
349
- this.isOnline = false;
350
- throw error;
351
- }
352
- const remoteIds = new Set();
353
- for (const item of remoteData) {
354
- const id = this.options.keyOf(item);
355
- if (!id) {
356
- console.warn("Item has no key, skipping:", item);
357
- continue;
358
- }
359
- remoteIds.add(id);
360
- if (changedLocally(id) || this.hasPendingOp(id)) {
361
- continue;
362
- }
363
- const localItem = await this.local.get(id);
364
- if (localItem === undefined) {
365
- // No local version - just store remote
366
- await this.local.set(id, item);
367
- }
368
- else if (JSON.stringify(localItem) !== JSON.stringify(item)) {
369
- // Conflict - resolve according to strategy
370
- const resolved = this.resolveConflict(localItem, item);
371
- await this.local.set(id, resolved);
372
- this.stats.conflicts++;
373
- }
374
- }
375
- // The remote deleted these items
376
- for (const id of await this.localIds()) {
377
- if (!remoteIds.has(id) && !changedLocally(id) && !this.hasPendingOp(id)) {
378
- await this.local.delete(id);
379
- }
380
- }
381
- this.stats.syncCount++;
382
- this.isOnline = true;
383
- }
384
- async pushQueue() {
385
- while (this.offlineOps.length > 0) {
386
- const op = this.offlineOps[0];
387
- try {
388
- await this.executeOperation(op);
389
- }
390
- catch (error) {
391
- // This operation and the later ones stay queued
392
- this.isOnline = false;
393
- throw error;
394
- }
395
- // Remove the operation only after it reached the remote
396
- if (this.offlineOps[0] === op) {
397
- this.offlineOps.shift();
398
- }
399
- }
400
- this.isOnline = true;
401
- }
402
- /** Run syncs one at a time. */
403
- serialize(run) {
404
- const next = this.syncChain.then(run, run);
405
- this.syncChain = next.catch(() => undefined);
406
- return next;
407
- }
408
- async localIds() {
409
- return [...this.local.keys()];
410
- }
411
- bump(id) {
412
- this.writeVersions.set(id, (this.writeVersions.get(id) ?? 0) + 1);
413
- }
414
- versionOf(id) {
415
- return `${this.clearVersion}:${this.writeVersions.get(id) ?? 0}`;
416
- }
417
- hasPendingOp(id) {
418
- return this.offlineOps.some((op) => {
419
- const ids = idsOf(op);
420
- return ids.includes(id) || ids.includes("*");
421
- });
422
- }
423
- /**
424
- * Resolve conflict between local and remote versions.
425
- */
426
- resolveConflict(local, remote) {
427
- switch (this.options.conflictResolution) {
428
- case "local":
429
- return local;
430
- case "remote":
431
- return remote;
432
- case "merge":
433
- if (!this.options.mergeFn) {
434
- throw new Error("Merge function required for conflict resolution strategy 'merge'");
435
- }
436
- return this.options.mergeFn(local, remote);
437
- case "error":
438
- throw new Error(`Conflict detected between local and remote versions`);
439
- default:
440
- return remote;
441
- }
442
- }
443
- /**
444
- * Queue operation for later sync.
445
- */
446
- queueOperation(op) {
447
- if (!this.options.offlineQueue) {
448
- return;
449
- }
450
- this.offlineOps.push(op);
451
- // Enforce max queue size
452
- if (this.offlineOps.length > this.options.maxOfflineOps) {
453
- this.offlineOps.shift(); // Remove oldest
454
- }
455
- }
456
- /**
457
- * Execute a queued operation against remote storage.
458
- */
459
- async executeOperation(op) {
460
- const data = op.data;
461
- switch (op.type) {
462
- case "set":
463
- await this.remote.set(data.id, data.value);
464
- break;
465
- case "delete":
466
- await this.remote.delete(data.id);
467
- break;
468
- case "setBatch":
469
- await this.remote.setBatch(data.items);
470
- break;
471
- case "deleteBatch":
472
- await this.remote.deleteBatch(data.ids);
473
- break;
474
- case "clear":
475
- await this.remote.clear();
476
- break;
477
- }
478
- }
479
- /**
480
- * Handle remote operation failure.
481
- */
482
- handleRemoteFailure(operation, data) {
483
- console.error(`Remote ${operation} failed, marking offline`);
484
- this.isOnline = false;
485
- // Queue operation if offline queue enabled
486
- if (this.options.offlineQueue) {
487
- this.queueOperation({
488
- type: operation,
489
- data,
490
- timestamp: Date.now(),
491
- });
492
- }
493
- }
494
- /**
495
- * Start periodic background sync.
496
- */
497
- startPeriodicSync() {
498
- this.syncTimer = setInterval(() => {
499
- this.syncToRemote().catch((err) => {
500
- console.error("Periodic sync failed:", err);
501
- });
502
- }, this.options.syncInterval);
503
- // The timer must not keep the process alive (deep dive DATA-9)
504
- this.syncTimer.unref?.();
505
- }
506
- /**
507
- * Get current online status.
508
- */
509
- isRemoteOnline() {
510
- return this.isOnline;
511
- }
512
- /**
513
- * Get pending offline operations count.
514
- */
515
- getPendingOpsCount() {
516
- return this.offlineOps.length;
517
- }
518
- }
519
- //# sourceMappingURL=hybrid.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hybrid.js","sourceRoot":"","sources":["../../../src/procedures/storage/hybrid.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAsFpE,yDAAyD;AACzD,SAAS,KAAK,CAAC,EAAoB;IACjC,MAAM,IAAI,GAAG,EAAE,CAAC,IAAyE,CAAC;IAC1F,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC;QAChB,KAAK,KAAK,CAAC;QACX,KAAK,QAAQ;YACX,OAAO,IAAI,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAChD,KAAK,UAAU;YACb,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;QAC9C,KAAK,aAAa;YAChB,OAAO,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC;QACxB,KAAK,OAAO;YACV,OAAO,CAAC,GAAG,CAAC,CAAC;IACjB,CAAC;AACH,CAAC;AAED,MAAM,YAAY,GAAG,CAAC,IAAa,EAAsB,EAAE;IACzD,MAAM,EAAE,GAAI,IAAgC,EAAE,EAAE,CAAC;IACjD,OAAO,OAAO,EAAE,KAAK,QAAQ,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AAClE,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,OAAO,aAAa;IAChB,KAAK,CAAqB;IAC1B,MAAM,CAAuB;IAC7B,OAAO,CASb;IACM,UAAU,GAAuB,EAAE,CAAC;IACpC,SAAS,GAA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,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACxC,MAAM;YAER,KAAK,OAAO;gBACV,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;gBAC1B,MAAM;QACV,CAAC;IACH,CAAC;IAED;;OAEG;IACK,mBAAmB,CAAC,SAAmC,EAAE,IAAa;QAC5E,OAAO,CAAC,KAAK,CAAC,UAAU,SAAS,0BAA0B,CAAC,CAAC;QAC7D,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QAEtB,2CAA2C;QAC3C,IAAI,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;YAC9B,IAAI,CAAC,cAAc,CAAC;gBAClB,IAAI,EAAE,SAAS;gBACf,IAAI;gBACJ,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;aACtB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED;;OAEG;IACK,iBAAiB;QACvB,IAAI,CAAC,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE;YAChC,IAAI,CAAC,YAAY,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;gBAChC,OAAO,CAAC,KAAK,CAAC,uBAAuB,EAAE,GAAG,CAAC,CAAC;YAC9C,CAAC,CAAC,CAAC;QACL,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QAC9B,+DAA+D;QAC9D,IAAI,CAAC,SAAoC,CAAC,KAAK,EAAE,EAAE,CAAC;IACvD,CAAC;IAED;;OAEG;IACH,cAAc;QACZ,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,kBAAkB;QAChB,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;IAChC,CAAC;CACF"}
@@ -1,17 +0,0 @@
1
- /**
2
- * Procedure Storage Module
3
- *
4
- * Enables procedure registry to be backed by CollectionStorage.
5
- * Provides persistence, sync, and remote registry capabilities.
6
- */
7
- export type { SerializedProcedure, HandlerReference, HandlerLoader, SyncDirection, ConflictResolution, WriteStrategy, SyncConflict, SyncResult, SyncStatus, SyncedRegistryOptions, ProcedureStorageConfig, } from "./types.js";
8
- export { serializeProcedure, deserializeProcedure, deserializeProcedureSync, getProcedureKey, getSerializedKey, serializeProcedures, deserializeProcedures, createDynamicHandlerLoader, } from "./serialization.js";
9
- export type { SerializeOptions, DeserializeOptions } from "./serialization.js";
10
- export { ProcedureStorageAdapter } from "./adapter.js";
11
- export type { ProcedureStorageAdapterOptions } from "./adapter.js";
12
- export { SyncedProcedureRegistry, getProcedureStore } from "./synced-registry.js";
13
- export type { SyncedRegistrationOptions } from "./synced-registry.js";
14
- export { createSyncedRegistry, createMemorySyncedRegistry, createApiSyncedRegistry, createHybridSyncedRegistry, createCustomSyncedRegistry, } from "./factory.js";
15
- export type { CreateSyncedRegistryConfig } from "./factory.js";
16
- export { procedureRegisterProcedure, procedureStoreProcedure, procedureLoadProcedure, procedureSyncProcedure, procedureRemoteProcedure, procedureStorageModule, procedureStorageProcedures, ProcedureStoreError, } from "./procedures.js";
17
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/procedures/storage/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,YAAY,EACV,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,UAAU,EACV,UAAU,EACV,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAG/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,YAAY,EAAE,8BAA8B,EAAE,MAAM,cAAc,CAAC;AAGnE,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAClF,YAAY,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAGtE,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,uBAAuB,EACvB,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAG/D,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,0BAA0B,EAC1B,mBAAmB,GACpB,MAAM,iBAAiB,CAAC"}
@@ -1,17 +0,0 @@
1
- /**
2
- * Procedure Storage Module
3
- *
4
- * Enables procedure registry to be backed by CollectionStorage.
5
- * Provides persistence, sync, and remote registry capabilities.
6
- */
7
- // Serialization
8
- export { serializeProcedure, deserializeProcedure, deserializeProcedureSync, getProcedureKey, getSerializedKey, serializeProcedures, deserializeProcedures, createDynamicHandlerLoader, } from "./serialization.js";
9
- // Adapter
10
- export { ProcedureStorageAdapter } from "./adapter.js";
11
- // Synced Registry
12
- export { SyncedProcedureRegistry, getProcedureStore } from "./synced-registry.js";
13
- // Factory
14
- export { createSyncedRegistry, createMemorySyncedRegistry, createApiSyncedRegistry, createHybridSyncedRegistry, createCustomSyncedRegistry, } from "./factory.js";
15
- // Procedures
16
- export { procedureRegisterProcedure, procedureStoreProcedure, procedureLoadProcedure, procedureSyncProcedure, procedureRemoteProcedure, procedureStorageModule, procedureStorageProcedures, ProcedureStoreError, } from "./procedures.js";
17
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/procedures/storage/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAiBH,gBAAgB;AAChB,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,oBAAoB,CAAC;AAG5B,UAAU;AACV,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAGvD,kBAAkB;AAClB,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGlF,UAAU;AACV,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,uBAAuB,EACvB,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,cAAc,CAAC;AAGtB,aAAa;AACb,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,0BAA0B,EAC1B,mBAAmB,GACpB,MAAM,iBAAiB,CAAC"}
@@ -1,39 +0,0 @@
1
- /**
2
- * Procedure Storage Procedures
3
- *
4
- * CLI procedures for managing the procedure registry storage:
5
- * - procedure.register - Register a procedure at runtime
6
- * - procedure.store - Persist a procedure to storage
7
- * - procedure.load - Load procedures from storage
8
- * - procedure.sync - Sync registry with storage
9
- * - procedure.remote - Configure remote connection
10
- *
11
- * The procedures work on the store of the caller's registry: the `SyncedProcedureRegistry`
12
- * that wraps it (`createSyncedRegistry()`). When the registry has no store, they fail with
13
- * the code `NOT_CONFIGURED`. (Before, they reported success and did nothing: deep dive
14
- * CORE-16, DATA-10.)
15
- */
16
- import type { AnyProcedure } from "../types.js";
17
- /** An error of a storage procedure that cannot do its work. */
18
- export declare class ProcedureStoreError extends Error {
19
- readonly name = "ProcedureStoreError";
20
- readonly code: "NOT_CONFIGURED" | "NOT_IMPLEMENTED" | "NO_HANDLER";
21
- constructor(code: "NOT_CONFIGURED" | "NOT_IMPLEMENTED" | "NO_HANDLER", message: string);
22
- }
23
- export declare const procedureRegisterProcedure: AnyProcedure;
24
- export declare const procedureStoreProcedure: AnyProcedure;
25
- export declare const procedureLoadProcedure: AnyProcedure;
26
- export declare const procedureSyncProcedure: AnyProcedure;
27
- export declare const procedureRemoteProcedure: AnyProcedure;
28
- /**
29
- * All procedure storage procedures as a module.
30
- */
31
- export declare const procedureStorageModule: {
32
- name: string;
33
- procedures: AnyProcedure[];
34
- };
35
- /**
36
- * Array of all procedure storage procedures.
37
- */
38
- export declare const procedureStorageProcedures: AnyProcedure[];
39
- //# sourceMappingURL=procedures.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"procedures.d.ts","sourceRoot":"","sources":["../../../src/procedures/storage/procedures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAmC,MAAM,aAAa,CAAC;AAyBjF,+DAA+D;AAC/D,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,SAAkB,IAAI,yBAAyB;IAC/C,QAAQ,CAAC,IAAI,EAAE,gBAAgB,GAAG,iBAAiB,GAAG,YAAY,CAAC;IAEnE,YAAY,IAAI,EAAE,gBAAgB,GAAG,iBAAiB,GAAG,YAAY,EAAE,OAAO,EAAE,MAAM,EAGrF;CACF;AAiDD,eAAO,MAAM,0BAA0B,EAAE,YA6DvC,CAAC;AAqBH,eAAO,MAAM,uBAAuB,EAAE,YAwBpC,CAAC;AAwBH,eAAO,MAAM,sBAAsB,EAAE,YAuCnC,CAAC;AAqBH,eAAO,MAAM,sBAAsB,EAAE,YAmBnC,CAAC;AA0BH,eAAO,MAAM,wBAAwB,EAAE,YA4CrC,CAAC;AAMH;;GAEG;AACH,eAAO,MAAM,sBAAsB;IACjC,IAAI;IACJ,UAAU,EAML,YAAY,EAAE;CACpB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,YAAY,EAAsC,CAAC"}