@actualwave/deferred-data-access 2.0.0 → 2.1.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 (128) hide show
  1. package/README.md +400 -27
  2. package/SKILL.md +106 -0
  3. package/command/index.d.ts.map +1 -0
  4. package/command/index.es.js +98 -0
  5. package/command/index.es.js.map +1 -0
  6. package/command/index.js +102 -4
  7. package/command/index.js.map +1 -1
  8. package/command/package.json +4 -1
  9. package/command/src/command-chain.d.ts +8 -1
  10. package/command/src/command-chain.d.ts.map +1 -0
  11. package/command/src/command-chain.js +9 -0
  12. package/command/src/command-chain.js.map +1 -1
  13. package/command/src/command-handler.d.ts.map +1 -0
  14. package/command/src/command.d.ts +2 -2
  15. package/command/src/command.d.ts.map +1 -0
  16. package/command/src/command.js +5 -6
  17. package/command/src/command.js.map +1 -1
  18. package/core/core.d.ts.map +1 -0
  19. package/core/core.js +23 -25
  20. package/core/core.js.map +1 -1
  21. package/core/index.d.ts.map +1 -0
  22. package/deferred-data-access.umd.js +2 -0
  23. package/deferred-data-access.umd.js.map +1 -0
  24. package/index.d.ts.map +1 -0
  25. package/{dist/deferred-data-access.js → index.es.js} +199 -138
  26. package/index.es.js.map +1 -0
  27. package/index.js +627 -2
  28. package/index.js.map +1 -1
  29. package/interface/index.d.ts.map +1 -0
  30. package/interface/index.es.js +380 -0
  31. package/interface/index.es.js.map +1 -0
  32. package/interface/index.js +396 -7
  33. package/interface/index.js.map +1 -1
  34. package/interface/package.json +4 -1
  35. package/interface/src/handshake.d.ts.map +1 -0
  36. package/interface/src/handshake.js +6 -4
  37. package/interface/src/handshake.js.map +1 -1
  38. package/interface/src/helpers.d.ts.map +1 -0
  39. package/interface/src/intialize.d.ts +5 -2
  40. package/interface/src/intialize.d.ts.map +1 -0
  41. package/interface/src/intialize.js +37 -57
  42. package/interface/src/intialize.js.map +1 -1
  43. package/interface/src/request.d.ts +3 -2
  44. package/interface/src/request.d.ts.map +1 -0
  45. package/interface/src/request.js +39 -29
  46. package/interface/src/request.js.map +1 -1
  47. package/interface/src/types.d.ts.map +1 -0
  48. package/interface/src/utils.d.ts +2 -2
  49. package/interface/src/utils.d.ts.map +1 -0
  50. package/interface/src/utils.js +44 -29
  51. package/interface/src/utils.js.map +1 -1
  52. package/package.json +7 -6
  53. package/proxy/index.d.ts.map +1 -0
  54. package/proxy/index.es.js +144 -0
  55. package/proxy/index.es.js.map +1 -0
  56. package/proxy/index.js +155 -5
  57. package/proxy/index.js.map +1 -1
  58. package/proxy/package.json +4 -1
  59. package/proxy/src/command.d.ts.map +1 -0
  60. package/proxy/src/proxy.d.ts +2 -2
  61. package/proxy/src/proxy.d.ts.map +1 -0
  62. package/proxy/src/proxy.js +13 -3
  63. package/proxy/src/proxy.js.map +1 -1
  64. package/proxy/src/traps.d.ts +1 -1
  65. package/proxy/src/traps.d.ts.map +1 -0
  66. package/proxy/src/traps.js +4 -14
  67. package/proxy/src/traps.js.map +1 -1
  68. package/proxy/src/types.d.ts.map +1 -0
  69. package/proxy/src/utils.d.ts +6 -0
  70. package/proxy/src/utils.d.ts.map +1 -0
  71. package/proxy/src/utils.js +11 -5
  72. package/proxy/src/utils.js.map +1 -1
  73. package/record/index.d.ts.map +1 -0
  74. package/record/index.es.js +26 -0
  75. package/record/index.es.js.map +1 -0
  76. package/record/index.js +31 -2
  77. package/record/index.js.map +1 -1
  78. package/record/package.json +4 -1
  79. package/record/record.d.ts +2 -2
  80. package/record/record.d.ts.map +1 -0
  81. package/record/record.js +9 -3
  82. package/record/record.js.map +1 -1
  83. package/resource/index.d.ts +1 -0
  84. package/resource/index.d.ts.map +1 -0
  85. package/resource/index.es.js +191 -0
  86. package/resource/index.es.js.map +1 -0
  87. package/resource/index.js +206 -6
  88. package/resource/index.js.map +1 -1
  89. package/resource/package.json +4 -1
  90. package/resource/src/default-resource-pool.d.ts +1 -0
  91. package/resource/src/default-resource-pool.d.ts.map +1 -0
  92. package/resource/src/default-resource-pool.js +8 -5
  93. package/resource/src/default-resource-pool.js.map +1 -1
  94. package/resource/src/finalization-registry.d.ts +13 -0
  95. package/resource/src/finalization-registry.d.ts.map +1 -0
  96. package/resource/src/finalization-registry.js +18 -0
  97. package/resource/src/finalization-registry.js.map +1 -0
  98. package/resource/src/resource-pool-registry.d.ts +1 -0
  99. package/resource/src/resource-pool-registry.d.ts.map +1 -0
  100. package/resource/src/resource-pool-registry.js +10 -8
  101. package/resource/src/resource-pool-registry.js.map +1 -1
  102. package/resource/src/resource-pool.d.ts +8 -1
  103. package/resource/src/resource-pool.d.ts.map +1 -0
  104. package/resource/src/resource-pool.js +29 -17
  105. package/resource/src/resource-pool.js.map +1 -1
  106. package/resource/src/resource.d.ts +1 -1
  107. package/resource/src/resource.d.ts.map +1 -0
  108. package/resource/src/resource.js +3 -2
  109. package/resource/src/resource.js.map +1 -1
  110. package/resource/src/utils.d.ts +1 -1
  111. package/resource/src/utils.d.ts.map +1 -0
  112. package/resource/src/utils.js +9 -1
  113. package/resource/src/utils.js.map +1 -1
  114. package/utils/index.d.ts.map +1 -0
  115. package/utils/index.es.js +48 -0
  116. package/utils/index.es.js.map +1 -0
  117. package/utils/index.js +54 -3
  118. package/utils/index.js.map +1 -1
  119. package/utils/package.json +4 -1
  120. package/utils/src/types.d.ts +3 -3
  121. package/utils/src/types.d.ts.map +1 -0
  122. package/utils/src/utils.d.ts +18 -2
  123. package/utils/src/utils.d.ts.map +1 -0
  124. package/utils/src/utils.js +28 -4
  125. package/utils/src/utils.js.map +1 -1
  126. package/dist/deferred-data-access.js.map +0 -1
  127. package/dist/deferred-data-access.umd.js +0 -2
  128. package/dist/deferred-data-access.umd.js.map +0 -1
@@ -1,9 +1,4 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var hasOwn = require('@actualwave/has-own');
6
- var weakStorage = require('@actualwave/weak-storage');
1
+ import { WeakValueMap } from '@actualwave/weak-storage';
7
2
 
8
3
  class Command {
9
4
  constructor(type, name, value, context) {
@@ -11,6 +6,8 @@ class Command {
11
6
  this.name = name;
12
7
  this.value = value;
13
8
  this.context = context;
9
+ Object.defineProperty(this, 'type', { value: type, writable: false, configurable: false });
10
+ Object.defineProperty(this, 'name', { value: name, writable: false, configurable: false });
14
11
  }
15
12
  toObject(includeContext = false) {
16
13
  const { type, name, value, context } = this;
@@ -23,12 +20,9 @@ class Command {
23
20
  }
24
21
  toJSON(includeContext = false) {
25
22
  const { type, name, value, context } = this;
26
- return JSON.stringify([
27
- type,
28
- name,
29
- value,
30
- includeContext ? context : undefined,
31
- ]);
23
+ return includeContext
24
+ ? JSON.stringify([type, name, value, context])
25
+ : JSON.stringify([type, name, value]);
32
26
  }
33
27
  static fromJSON(jsonString) {
34
28
  const [type, name, value, context] = JSON.parse(jsonString);
@@ -76,6 +70,15 @@ class CommandChain extends Command {
76
70
  } while (node);
77
71
  return result;
78
72
  }
73
+ /**
74
+ * Returns a new CommandChain that is identical to this one but with the
75
+ * `prev` link severed, rather than mutating the existing instance in-place.
76
+ * Use this instead of `delete command.prev` to avoid corrupting shared chain
77
+ * references held by other code.
78
+ */
79
+ withoutPrev() {
80
+ return new CommandChain(undefined, this.type, this.name, this.value, this.context);
81
+ }
79
82
  static fromCommand({ type, name, value, context }, prev) {
80
83
  return new CommandChain(prev, type, name, value, context);
81
84
  }
@@ -93,17 +96,34 @@ const createCommandHandler = ({ handlers, defaultHandler, }) => (command, ...arg
93
96
  return Promise.resolve(undefined);
94
97
  };
95
98
 
99
+ // Subtract a small random offset so IDs generated in the same millisecond
100
+ // across separate module loads remain unique.
96
101
  const DATE_NOW = Date.now() - Math.floor(Math.random() * 1000);
97
102
  let index = 0;
98
- exports.ReservedPropertyNames = void 0;
103
+ var ReservedPropertyNames;
99
104
  (function (ReservedPropertyNames) {
100
105
  ReservedPropertyNames["THEN"] = "then";
101
106
  ReservedPropertyNames["CATCH"] = "catch";
102
- })(exports.ReservedPropertyNames || (exports.ReservedPropertyNames = {}));
103
- const isReservedPropertyName = (name) => name === exports.ReservedPropertyNames.THEN || name === exports.ReservedPropertyNames.CATCH;
104
- const reject = async (message) => {
105
- throw message;
106
- };
107
+ })(ReservedPropertyNames || (ReservedPropertyNames = {}));
108
+ /**
109
+ * Returns true only for string property names that match reserved Promise
110
+ * method names. Symbol names are never reserved — they always pass through
111
+ * to the proxy handler.
112
+ */
113
+ const isReservedPropertyName = (name) => typeof name === 'string' &&
114
+ (name === ReservedPropertyNames.THEN || name === ReservedPropertyNames.CATCH);
115
+ /**
116
+ * Returns a rejected Promise. Throws the message as a value (not an Error
117
+ * instance) to preserve the original behaviour expected by callers.
118
+ */
119
+ const reject = (message) => Promise.reject(message);
120
+ /**
121
+ * Returns a function that generates monotonically increasing unique IDs.
122
+ * All generators in this module share the same counter so IDs are globally
123
+ * unique within a single process.
124
+ *
125
+ * @param key - Optional namespace prefix included in every generated ID.
126
+ */
107
127
  const createUIDGenerator = (key = '') => {
108
128
  const prefix = `${key ? `${key}/` : ''}${DATE_NOW}/`;
109
129
  return () => `${prefix}${++index};`;
@@ -112,10 +132,17 @@ const generateId = createUIDGenerator();
112
132
  class IdOwner {
113
133
  constructor(id = generateId()) {
114
134
  this.id = id;
135
+ // Prevent external mutation while remaining compatible with subclasses
136
+ // that call super() without explicitly sealing.
137
+ Object.defineProperty(this, 'id', {
138
+ value: this.id,
139
+ writable: false,
140
+ configurable: false,
141
+ });
115
142
  }
116
143
  }
117
144
 
118
- exports.ProxyCommand = void 0;
145
+ var ProxyCommand;
119
146
  (function (ProxyCommand) {
120
147
  ProxyCommand["GET"] = "P:get";
121
148
  ProxyCommand["SET"] = "P:set";
@@ -123,10 +150,10 @@ exports.ProxyCommand = void 0;
123
150
  ProxyCommand["DELETE_PROPERTY"] = "P:del";
124
151
  // If proxy works in lazy mode and APPLY command has previous GET command, this will be generated.
125
152
  ProxyCommand["METHOD_CALL"] = "P:call";
126
- })(exports.ProxyCommand || (exports.ProxyCommand = {}));
153
+ })(ProxyCommand || (ProxyCommand = {}));
127
154
  const generateProxyCommand = (head, type, name, value, context, lazy) => {
128
- if (type === exports.ProxyCommand.APPLY && lazy && head?.type === exports.ProxyCommand.GET) {
129
- return new CommandChain(head.prev, exports.ProxyCommand.METHOD_CALL, head.name, value, head.context);
155
+ if (type === ProxyCommand.APPLY && lazy && head?.type === ProxyCommand.GET) {
156
+ return new CommandChain(head.prev, ProxyCommand.METHOD_CALL, head.name, value, head.context);
130
157
  }
131
158
  return new CommandChain(head, type, name, value, context);
132
159
  };
@@ -147,41 +174,58 @@ const API_PROP = Symbol('P:api');
147
174
  const wrapWithProxy = (
148
175
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
149
176
  target, traps, api = {}) => {
177
+ // Always use a function as the wrapper so the Proxy can intercept `apply`.
178
+ // For non-function targets the wrapper body is intentionally empty — it is
179
+ // never actually called; the apply trap intercepts all invocations first.
150
180
  const wrapper = Object.assign(typeof target === 'function'
151
181
  ? function $RequestFn(...args) {
152
182
  return target.apply(this, args);
153
183
  }
154
184
  : function $Request() {
155
- // because
185
+ /* intentionally empty — apply trap handles all calls */
156
186
  }, {
157
187
  target,
158
188
  [API_PROP]: { getTarget: () => target, ...api },
159
189
  });
160
190
  return new Proxy(wrapper, traps);
161
191
  };
162
- const isWrappedWithProxy = (obj) => !!(obj && obj[API_PROP]);
163
- const unwrapProxy = (obj) => obj && obj[API_PROP] && obj[API_PROP].getTarget() || obj;
192
+ const isWrappedWithProxy = (obj) => obj != null && typeof obj === 'object' || typeof obj === 'function'
193
+ ? !!(obj && obj[API_PROP])
194
+ : false;
195
+ const unwrapProxy = (obj) => {
196
+ if (obj != null && obj[API_PROP]) {
197
+ return obj[API_PROP].getTarget();
198
+ }
199
+ return obj;
200
+ };
164
201
 
165
- const isNameExcluded = (name) => name === API_PROP || hasOwn.hasOwn(EXCLUSIONS, name);
202
+ const isNameExcluded = (name) => name === API_PROP || Object.hasOwn(EXCLUSIONS, name);
166
203
  const isNameSymbol = (name) => typeof name === 'symbol';
204
+ /**
205
+ * Walks a CommandChain and resolves it against a live target.
206
+ * Only GET and APPLY commands are supported — all other command types
207
+ * (SET, DELETE_PROPERTY, METHOD_CALL) are write/side-effect operations
208
+ * that cannot be replayed safely and will throw.
209
+ */
167
210
  const followCommandChain = async (head,
168
211
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
169
212
  context) => {
170
213
  let target = context;
171
- if (!context) {
214
+ if (context === undefined) {
172
215
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
173
216
  target = head.prev
174
217
  ? await followCommandChain(head.prev)
175
- : head.context;
218
+ : await head.context;
176
219
  }
177
220
  const { type, name, value } = head;
178
221
  switch (type) {
179
- case exports.ProxyCommand.GET:
222
+ case ProxyCommand.GET:
180
223
  return target[name];
181
- case exports.ProxyCommand.APPLY:
224
+ case ProxyCommand.APPLY:
182
225
  return target.apply(getMethodCallContext(head), value);
226
+ default:
227
+ throw new Error(`Command "${type}" cannot be followed. Only ProxyCommand.GET and ProxyCommand.APPLY are supported by followCommandChain.`);
183
228
  }
184
- throw new Error(`Unknown command "${type}" cannot be followed, only ProxyCommand.GET and APPLY are allowed.`);
185
229
  };
186
230
 
187
231
  const createGetTrap = (handler) => (wrapper, name) => {
@@ -190,47 +234,36 @@ const createGetTrap = (handler) => (wrapper, name) => {
190
234
  return wrapper[name];
191
235
  }
192
236
  // We expect that user of the lib will wrap with Proxy explicitly whatever they want
193
- return handler(exports.ProxyCommand.GET, name, undefined, target);
237
+ return handler(ProxyCommand.GET, name, undefined, target);
194
238
  };
195
239
  const createApplyTrap = (handler) => ({ target }, thisValue, args) => {
196
240
  // thisValue is being ignored for now
197
241
  // target is a function that should be applied
198
- return handler(exports.ProxyCommand.APPLY, undefined, args, target);
242
+ return handler(ProxyCommand.APPLY, undefined, args, target);
199
243
  };
200
244
  const createSetTrap = (handler) => ({ target }, name, value) => {
201
245
  if (isNameExcluded(name)) {
202
246
  return false;
203
247
  }
204
- /* TODO why this might be needed?
205
- if (isNameSymbol(name)) {
206
- target.then((context: any) => {
207
- context[name] = value;
208
- });
209
-
210
- return false;
211
- }
212
- */
213
- handler(exports.ProxyCommand.SET, name, value, target);
248
+ handler(ProxyCommand.SET, name, value, target);
214
249
  return true;
215
250
  };
216
251
  const createDeletePropertyTrap = (handler) => (wrapper, name) => {
217
252
  if (isNameExcluded(name)) {
218
253
  return false;
219
254
  }
220
- handler(exports.ProxyCommand.DELETE_PROPERTY, name, undefined, wrapper.target);
255
+ handler(ProxyCommand.DELETE_PROPERTY, name, undefined, wrapper.target);
221
256
  return true;
222
257
  };
223
258
  const proxyHasTrap = (wrapper, name) => {
224
259
  if (isNameExcluded(name)) {
225
260
  return wrapper[name];
226
261
  }
227
- // because of this Promise does not call ProxyWrapper.then() and just returns it.
228
- // if change to true, it will subscribe to ProxyWrapper.then() and wait for it to resolve
262
+ // Because of this, Promise does not call ProxyWrapper.then() and just returns it.
263
+ // If changed to true, it will subscribe to ProxyWrapper.then() and wait for it to resolve.
229
264
  return false;
230
265
  };
231
266
  const proxyOwnKeysTrap = () => Object.getOwnPropertyNames(EXCLUSIONS);
232
- // INFO You cannot enumerate properties of request object, this may possibly require processing a lot of data
233
- const proxyEnumerateTrap = () => Object.getOwnPropertyNames(EXCLUSIONS)[Symbol.iterator]();
234
267
  const proxyGetOwnPropertyDescriptorTrap = (wrapper, name) => {
235
268
  if (isNameExcluded(name)) {
236
269
  return Object.getOwnPropertyDescriptor(wrapper, name);
@@ -244,60 +277,65 @@ const createProxyTrapsObject = (handler) => ({
244
277
  deleteProperty: createDeletePropertyTrap(handler),
245
278
  has: proxyHasTrap,
246
279
  ownKeys: proxyOwnKeysTrap,
247
- enumerate: proxyEnumerateTrap,
280
+ // NOTE: `enumerate` trap was removed from the ES Proxy spec and is a no-op
281
+ // in all modern runtimes — removed to avoid confusion.
248
282
  getOwnPropertyDescriptor: proxyGetOwnPropertyDescriptorTrap,
249
283
  });
250
284
 
251
285
  const EMPTY_PROMISE = Promise.resolve(undefined);
252
286
  const isPromiseActivity = (command) => {
253
287
  const { type } = command;
254
- if (type === exports.ProxyCommand.GET || type === exports.ProxyCommand.METHOD_CALL) {
288
+ if (type === ProxyCommand.GET || type === ProxyCommand.METHOD_CALL) {
255
289
  return isReservedPropertyName(command.name);
256
290
  }
257
- if (type === exports.ProxyCommand.APPLY) {
291
+ if (type === ProxyCommand.APPLY) {
258
292
  return isReservedPropertyName(command.prev?.name);
259
293
  }
260
294
  return false;
261
295
  };
262
296
  const executePromiseMethod = (context, name, args) => {
263
297
  switch (name) {
264
- case exports.ReservedPropertyNames.THEN:
298
+ case ReservedPropertyNames.THEN:
265
299
  return context.then(...args);
266
- case exports.ReservedPropertyNames.CATCH:
300
+ case ReservedPropertyNames.CATCH:
267
301
  return context.catch(...args);
268
302
  default:
269
303
  throw new Error(`Unexpected Error: Promise method "${String(name)}" could not be called.`);
270
304
  }
271
305
  };
272
- const applyPromiseActivity = (command, commandHandler, lazy, wrap) => {
306
+ const applyPromiseActivity = (command, commandHandler, lazy, wrap, rawContext) => {
273
307
  switch (command.type) {
274
- case exports.ProxyCommand.GET: {
308
+ case ProxyCommand.GET: {
275
309
  const { name, prev } = command;
276
310
  let { context } = command;
277
311
  if (lazy) {
278
- // then() / catch() on lazy means we should call handler and subscribe to promise
279
312
  if (!prev) {
280
- throw new Error(`Unexpected Error: Proxy command GET has unknown context.`);
313
+ // Root lazy access to a reserved name (then/catch) — no chain to resolve
314
+ // through, so use the raw context (the promise passed to wrap) directly.
315
+ context = rawContext;
316
+ }
317
+ else {
318
+ // When lazy, context is a dummy promise, so we call handler with the previous
319
+ // command and use the result as the context to subscribe to.
320
+ context = commandHandler(prev, prev.context, wrap);
281
321
  }
282
- // When lazy, context is a dummy promise, so we have to call handler with previous command and then use it as a context.
283
- context = commandHandler(prev, prev.context, wrap);
284
322
  }
323
+ // When not lazy, context is already the live promise result — subscribe directly.
285
324
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
286
325
  return (...args) => context[name](...args);
287
326
  }
288
- case exports.ProxyCommand.METHOD_CALL:
327
+ case ProxyCommand.METHOD_CALL:
289
328
  if (!command.context) {
290
329
  throw new Error(`Unexpected Error: Could not apply Promise method of unknown context.`);
291
330
  }
292
331
  return executePromiseMethod(command.context, command.name, command.value);
293
- case exports.ProxyCommand.APPLY:
294
- {
295
- const { prev } = command;
296
- if (!prev?.context || !prev?.name) {
297
- throw new Error(`Unexpected Error: Could not apply Promise method of unknown context.`);
298
- }
299
- return executePromiseMethod(prev.context, prev.name, command.value);
332
+ case ProxyCommand.APPLY: {
333
+ const { prev } = command;
334
+ if (!prev?.context || !prev?.name) {
335
+ throw new Error(`Unexpected Error: Could not apply Promise method of unknown context.`);
300
336
  }
337
+ return executePromiseMethod(prev.context, prev.name, command.value);
338
+ }
301
339
  default:
302
340
  throw new Error(`Command type "${command.type}" could not be executed as a Promise command.`);
303
341
  }
@@ -308,9 +346,9 @@ const handle = (commandHandler, lazy = true) => (context, command) => {
308
346
  const childCommand = generateProxyCommand(command, type, name, value, context, lazy);
309
347
  let result;
310
348
  if (isPromiseActivity(childCommand)) {
311
- return applyPromiseActivity(childCommand, commandHandler, lazy, wrap);
349
+ return applyPromiseActivity(childCommand, commandHandler, lazy, wrap, context);
312
350
  }
313
- else if ((type === exports.ProxyCommand.APPLY || type === exports.ProxyCommand.GET) &&
351
+ else if ((type === ProxyCommand.APPLY || type === ProxyCommand.GET) &&
314
352
  lazy) {
315
353
  result = EMPTY_PROMISE;
316
354
  }
@@ -324,9 +362,14 @@ const handle = (commandHandler, lazy = true) => (context, command) => {
324
362
  getCommand() {
325
363
  return command;
326
364
  },
365
+ /**
366
+ * Returns a new chain with the prev link severed rather than mutating
367
+ * the existing command in-place. Safe for callers holding references.
368
+ */
327
369
  dropCommandChain() {
328
370
  if (command) {
329
- delete command.prev;
371
+ // Replace the reference with a severed copy rather than mutating
372
+ command = command.withoutPrev?.() ?? command;
330
373
  }
331
374
  },
332
375
  });
@@ -334,11 +377,31 @@ const handle = (commandHandler, lazy = true) => (context, command) => {
334
377
  return wrap(Promise.resolve(context), command ? CommandChain.fromCommand(command) : undefined);
335
378
  };
336
379
 
380
+ let finalizationRegistryClass;
381
+ /**
382
+ * Returns class of a custom FinalizationRegistry if set with setCustomFinalizationRegistryClass()
383
+ * @returns {IFinalizationRegistryConstructor}
384
+ */
385
+ const getCustomFinalizationRegistryClass = () => {
386
+ return finalizationRegistryClass;
387
+ };
388
+ /**
389
+ * Allows to setup custom FinalizationRegistry in environments where
390
+ * it is not available natively. It is used to cleanup stored weak
391
+ * references in ResourcePools.
392
+ * @param definition FinalizationRegistry, its mock or polyfill, etc.
393
+ */
394
+ const setCustomFinalizationRegistryClass = (definition) => {
395
+ finalizationRegistryClass = definition;
396
+ };
397
+
337
398
  class Resource extends IdOwner {
338
399
  constructor(pool, type) {
339
400
  super();
340
401
  this.pool = pool;
341
402
  this.type = type;
403
+ Object.defineProperty(this, 'pool', { value: pool, writable: false, configurable: false });
404
+ Object.defineProperty(this, 'type', { value: type, writable: false, configurable: false });
342
405
  }
343
406
  toObject() {
344
407
  return { id: this.id, poolId: this.pool.id, type: this.type };
@@ -348,15 +411,22 @@ class Resource extends IdOwner {
348
411
  }
349
412
  }
350
413
  const createResource = (pool, target, type) => new Resource(pool, type || typeof target);
351
- const isResourceObject = (obj) => obj &&
352
- // type signature is not enough for non-ts env
414
+ const isResourceObject = (obj) => obj != null &&
353
415
  typeof obj === 'object' &&
354
416
  typeof obj.id === 'string' &&
355
417
  typeof obj.poolId === 'string';
356
418
 
419
+ // Valid target types are scoped per-module and intentionally not shared across
420
+ // ResourcePool instances. If you need per-pool validity rules, pass a custom
421
+ // isValidTarget predicate into ResourcePool directly.
357
422
  const validTargets = new Set();
358
423
  const getDefaultValidTargets = () => ['object', 'function'];
359
- const isValidTarget = (value) => validTargets.has(typeof value);
424
+ const isValidTarget = (value) => {
425
+ // typeof null === 'object' but null cannot be used as a WeakMap key
426
+ if (value === null)
427
+ return false;
428
+ return validTargets.has(typeof value);
429
+ };
360
430
  const setValidTargets = (list) => {
361
431
  validTargets.clear();
362
432
  list.forEach((item) => validTargets.add(item));
@@ -365,31 +435,40 @@ setValidTargets(getDefaultValidTargets());
365
435
 
366
436
  /* eslint-disable @typescript-eslint/ban-types */
367
437
  class ResourcePool extends IdOwner {
368
- constructor() {
369
- super(...arguments);
370
- // { [string]: weakref }
371
- this.refs = new weakStorage.WeakValueMap();
372
- // { [weakref]: Resource }
438
+ constructor(FinalizationRegistry = getCustomFinalizationRegistryClass()) {
439
+ super();
440
+ // target → Resource: allows lookup by target object
373
441
  this.resources = new WeakMap();
442
+ this.refs = new WeakValueMap(FinalizationRegistry);
374
443
  }
375
444
  get active() {
376
445
  return !!this.resources;
377
446
  }
378
447
  set(target, type) {
379
- let resource = null;
380
448
  if (!isValidTarget(target)) {
381
- return resource;
449
+ return null;
382
450
  }
383
- resource = this.resources.get(target);
384
- if (!resource) {
385
- resource = createResource(this, target, type);
386
- this.refs.set(resource.id, target);
387
- this.resources.set(target, resource);
451
+ const existing = this.resources.get(target);
452
+ if (existing) {
453
+ return existing;
388
454
  }
455
+ const resource = createResource(this, target, type);
456
+ this.refs.set(resource.id, target);
457
+ this.resources.set(target, resource);
389
458
  return resource;
390
459
  }
460
+ /**
461
+ * Returns true only when the target is registered AND its weakref is still
462
+ * alive. Checks both maps to avoid the asymmetry where WeakMap.has() returns
463
+ * true for a target whose WeakValueMap entry has already been collected.
464
+ */
391
465
  has(target) {
392
- return this.resources.has(target);
466
+ if (!this.resources.has(target)) {
467
+ return false;
468
+ }
469
+ const resource = this.resources.get(target);
470
+ // Confirm the forward ref is still alive too
471
+ return resource !== undefined && this.refs.get(resource.id) !== undefined;
393
472
  }
394
473
  get({ id }) {
395
474
  return this.getById(id);
@@ -409,21 +488,26 @@ class ResourcePool extends IdOwner {
409
488
  return false;
410
489
  }
411
490
  clear() {
412
- for (const key of this.refs.keys()) {
491
+ this.refs.forEach((_value, key) => {
413
492
  const target = this.refs.get(key);
414
- this.resources.delete(target);
415
- }
493
+ if (target !== undefined) {
494
+ this.resources.delete(target);
495
+ }
496
+ });
416
497
  this.refs.clear();
417
498
  }
418
499
  }
419
500
 
420
- const generateGetDefaultResourcePool = (pool) => () => {
421
- if (!pool) {
422
- pool = new ResourcePool();
501
+ let defaultResourcePool;
502
+ const getDefaultResourcePool = () => {
503
+ if (!defaultResourcePool) {
504
+ defaultResourcePool = new ResourcePool();
423
505
  }
424
- return pool;
506
+ return defaultResourcePool;
507
+ };
508
+ const setDefaultResourcePool = (pool) => {
509
+ defaultResourcePool = pool;
425
510
  };
426
- const getDefaultResourcePool = generateGetDefaultResourcePool();
427
511
 
428
512
  class ResourcePoolRegistry extends IdOwner {
429
513
  constructor() {
@@ -443,7 +527,7 @@ class ResourcePoolRegistry extends IdOwner {
443
527
  * Register ResourcePool instance.
444
528
  */
445
529
  register(pool) {
446
- if (hasOwn.hasOwn(this.pools, pool.id))
530
+ if (Object.hasOwn(this.pools, pool.id))
447
531
  return false;
448
532
  this.pools[pool.id] = pool;
449
533
  return true;
@@ -458,7 +542,7 @@ class ResourcePoolRegistry extends IdOwner {
458
542
  * Check if ResourcePool registered in this registry instance.
459
543
  */
460
544
  isRegistered(pool) {
461
- return hasOwn.hasOwn(this.pools, pool.id);
545
+ return Object.hasOwn(this.pools, pool.id);
462
546
  }
463
547
  /**
464
548
  * Remove ResourcePool from current registry instance.
@@ -468,61 +552,38 @@ class ResourcePoolRegistry extends IdOwner {
468
552
  return delete this.pools[poolId];
469
553
  }
470
554
  }
471
- const generateGetRegistry = (registry) => () => {
472
- if (!registry) {
473
- registry = new ResourcePoolRegistry();
555
+ let defaultRegistry;
556
+ const getRegistry = () => {
557
+ if (!defaultRegistry) {
558
+ defaultRegistry = new ResourcePoolRegistry();
474
559
  }
475
- return registry;
560
+ return defaultRegistry;
561
+ };
562
+ const setRegistry = (registry) => {
563
+ defaultRegistry = registry;
476
564
  };
477
- const getRegistry = generateGetRegistry();
478
565
 
479
566
  const calls = new Map();
480
567
  let latest = Promise.resolve();
481
- const noop = () => null;
568
+ // Silently swallow unhandled rejections from tracked calls so that cleanup
569
+ // always runs — callers are responsible for handling errors on the original promise.
570
+ const noop = () => undefined;
482
571
  const latestCall = () => latest;
483
572
  const latestCallFor = (context) => calls.get(unwrapProxy(context));
484
573
  const clearLatestCalls = () => calls.clear();
485
574
  const recordHandlerCalls = (handler) => (command, context, wrap) => {
486
575
  const promise = handler(command, context, wrap);
487
- if (context && !calls.has(context)) {
576
+ // Only track the *first* call per context subsequent calls for the same
577
+ // context update `latest` but do not overwrite the stored per-context entry.
578
+ // Use strict identity (not truthiness) so falsy-but-valid contexts aren't skipped.
579
+ if (context !== undefined && context !== null && !calls.has(context)) {
488
580
  calls.set(context, promise);
489
- promise.catch(noop).then(() => calls.delete(context));
581
+ // Clean up the entry once the call settles (regardless of outcome)
582
+ promise.then(() => calls.delete(context), noop);
490
583
  }
491
584
  latest = promise;
492
585
  return promise;
493
586
  };
494
587
 
495
- exports.Command = Command;
496
- exports.CommandChain = CommandChain;
497
- exports.IdOwner = IdOwner;
498
- exports.Resource = Resource;
499
- exports.ResourcePool = ResourcePool;
500
- exports.ResourcePoolRegistry = ResourcePoolRegistry;
501
- exports.clearLatestCalls = clearLatestCalls;
502
- exports.createCommandHandler = createCommandHandler;
503
- exports.createProxyTrapsObject = createProxyTrapsObject;
504
- exports.createResource = createResource;
505
- exports.createUIDGenerator = createUIDGenerator;
506
- exports.followCommandChain = followCommandChain;
507
- exports.generateId = generateId;
508
- exports.generateProxyCommand = generateProxyCommand;
509
- exports.getDefaultResourcePool = getDefaultResourcePool;
510
- exports.getDefaultValidTargets = getDefaultValidTargets;
511
- exports.getMethodCallContext = getMethodCallContext;
512
- exports.getMethodName = getMethodName;
513
- exports.getRegistry = getRegistry;
514
- exports.handle = handle;
515
- exports.isNameExcluded = isNameExcluded;
516
- exports.isNameSymbol = isNameSymbol;
517
- exports.isReservedPropertyName = isReservedPropertyName;
518
- exports.isResourceObject = isResourceObject;
519
- exports.isValidTarget = isValidTarget;
520
- exports.isWrappedWithProxy = isWrappedWithProxy;
521
- exports.latestCall = latestCall;
522
- exports.latestCallFor = latestCallFor;
523
- exports.recordHandlerCalls = recordHandlerCalls;
524
- exports.reject = reject;
525
- exports.setValidTargets = setValidTargets;
526
- exports.unwrapProxy = unwrapProxy;
527
- exports.wrapWithProxy = wrapWithProxy;
528
- //# sourceMappingURL=deferred-data-access.js.map
588
+ export { Command, CommandChain, IdOwner, ProxyCommand, ReservedPropertyNames, Resource, ResourcePool, ResourcePoolRegistry, clearLatestCalls, createCommandHandler, createProxyTrapsObject, createResource, createUIDGenerator, followCommandChain, generateId, generateProxyCommand, getCustomFinalizationRegistryClass, getDefaultResourcePool, getDefaultValidTargets, getMethodCallContext, getMethodName, getRegistry, handle, isNameExcluded, isNameSymbol, isReservedPropertyName, isResourceObject, isValidTarget, isWrappedWithProxy, latestCall, latestCallFor, recordHandlerCalls, reject, setCustomFinalizationRegistryClass, setDefaultResourcePool, setRegistry, setValidTargets, unwrapProxy, wrapWithProxy };
589
+ //# sourceMappingURL=index.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.es.js","sources":["../../../../packages/deferred-data-access/command/src/command.ts","../../../../packages/deferred-data-access/command/src/command-chain.ts","../../../../packages/deferred-data-access/command/src/command-handler.ts","../../../../packages/deferred-data-access/utils/src/utils.ts","../../../../packages/deferred-data-access/proxy/src/command.ts","../../../../packages/deferred-data-access/proxy/src/types.ts","../../../../packages/deferred-data-access/proxy/src/proxy.ts","../../../../packages/deferred-data-access/proxy/src/utils.ts","../../../../packages/deferred-data-access/proxy/src/traps.ts","../../../../packages/deferred-data-access/core/core.ts","../../../../packages/deferred-data-access/resource/src/finalization-registry.ts","../../../../packages/deferred-data-access/resource/src/resource.ts","../../../../packages/deferred-data-access/resource/src/utils.ts","../../../../packages/deferred-data-access/resource/src/resource-pool.ts","../../../../packages/deferred-data-access/resource/src/default-resource-pool.ts","../../../../packages/deferred-data-access/resource/src/resource-pool-registry.ts","../../../../packages/deferred-data-access/record/record.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":[],"mappings":";;MAMa,OAAO,CAAA;AAClB,IAAA,WAAA,CACkB,IAAY,EACZ,IAAmB,EACnB,KAAe,EACf,OAAwB,EAAA;QAHxB,IAAA,CAAA,IAAI,GAAJ,IAAI;QACJ,IAAA,CAAA,IAAI,GAAJ,IAAI;QACJ,IAAA,CAAA,KAAK,GAAL,KAAK;QACL,IAAA,CAAA,OAAO,GAAP,OAAO;QAEvB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;QAC1F,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;IAC5F;IAEA,QAAQ,CAAC,cAAc,GAAG,KAAK,EAAA;QAC7B,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,IAAI;QAC3C,OAAO;YACL,IAAI;YACJ,IAAI;YACJ,KAAK;YACL,OAAO,EAAE,cAAc,GAAG,OAAO,GAAG,SAAS;SAC9C;IACH;IAEA,MAAM,CAAC,cAAc,GAAG,KAAK,EAAA;QAC3B,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,IAAI;AAC3C,QAAA,OAAO;AACL,cAAE,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC;AAC7C,cAAE,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IACzC;IAEA,OAAO,QAAQ,CAAC,UAAkB,EAAA;AAChC,QAAA,MAAM,CA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