@noy-db/hub 0.2.0-pre.5 → 0.2.0-pre.6

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 (73) hide show
  1. package/dist/attestation/index.d.cts +1 -1
  2. package/dist/attestation/index.d.ts +1 -1
  3. package/dist/blobs/index.d.cts +2 -2
  4. package/dist/blobs/index.d.ts +2 -2
  5. package/dist/bundle/index.cjs +53 -6
  6. package/dist/bundle/index.cjs.map +1 -1
  7. package/dist/bundle/index.d.cts +3 -3
  8. package/dist/bundle/index.d.ts +3 -3
  9. package/dist/bundle/index.js +1 -1
  10. package/dist/{chunk-YZ6JETII.js → chunk-JICBEFBT.js} +176 -1
  11. package/dist/chunk-JICBEFBT.js.map +1 -0
  12. package/dist/{chunk-BT7544RM.js → chunk-W277AG6N.js} +14 -9
  13. package/dist/chunk-W277AG6N.js.map +1 -0
  14. package/dist/consent/index.d.cts +2 -2
  15. package/dist/consent/index.d.ts +2 -2
  16. package/dist/derivations/index.d.cts +3 -3
  17. package/dist/derivations/index.d.ts +3 -3
  18. package/dist/{dev-unlock--ahUTrhc.d.ts → dev-unlock-Cvo-xCQC.d.ts} +1 -1
  19. package/dist/{dev-unlock-BIwt2V3p.d.cts → dev-unlock-Dy1qVpkL.d.cts} +1 -1
  20. package/dist/guards/index.d.cts +3 -3
  21. package/dist/guards/index.d.ts +3 -3
  22. package/dist/{hash-CJEFQxSD.d.ts → hash-BAlWR4WD.d.ts} +1 -1
  23. package/dist/{hash-BQVrGV-t.d.cts → hash-BgEQklQc.d.cts} +1 -1
  24. package/dist/history/index.d.cts +3 -3
  25. package/dist/history/index.d.ts +3 -3
  26. package/dist/i18n/index.cjs +75 -10
  27. package/dist/i18n/index.cjs.map +1 -1
  28. package/dist/i18n/index.d.cts +2 -2
  29. package/dist/i18n/index.d.ts +2 -2
  30. package/dist/i18n/index.js +11 -9
  31. package/dist/index.cjs +176 -114
  32. package/dist/index.cjs.map +1 -1
  33. package/dist/index.d.cts +9 -9
  34. package/dist/index.d.ts +9 -9
  35. package/dist/index.js +8 -10
  36. package/dist/index.js.map +1 -1
  37. package/dist/materialized-views/index.d.cts +3 -3
  38. package/dist/materialized-views/index.d.ts +3 -3
  39. package/dist/{noydb-6TADQIYH.js → noydb-FY2666NY.js} +3 -3
  40. package/dist/overlay-views/index.d.cts +3 -3
  41. package/dist/overlay-views/index.d.ts +3 -3
  42. package/dist/periods/index.d.cts +2 -2
  43. package/dist/periods/index.d.ts +2 -2
  44. package/dist/session/index.d.cts +3 -3
  45. package/dist/session/index.d.ts +3 -3
  46. package/dist/shadow/index.d.cts +2 -2
  47. package/dist/shadow/index.d.ts +2 -2
  48. package/dist/store/index.d.cts +2 -2
  49. package/dist/store/index.d.ts +2 -2
  50. package/dist/sync/index.d.cts +1 -1
  51. package/dist/sync/index.d.ts +1 -1
  52. package/dist/team/index.d.cts +2 -2
  53. package/dist/team/index.d.ts +2 -2
  54. package/dist/tx/index.d.cts +2 -2
  55. package/dist/tx/index.d.ts +2 -2
  56. package/dist/{types-BeKi0hCx.d.cts → types-DVlvNn2c.d.cts} +22 -5
  57. package/dist/{types-BV4AZKmx.d.ts → types-DlnZh1_i.d.ts} +22 -5
  58. package/dist/{ulid-CQc0eBxE.d.ts → ulid-CzPONlhG.d.ts} +1 -1
  59. package/dist/{ulid-Cvljl7ZZ.d.cts → ulid-r98nkjVd.d.cts} +1 -1
  60. package/dist/{with-derivation-BWcwmevt.d.ts → with-derivation-B98shCV8.d.ts} +1 -1
  61. package/dist/{with-derivation-BkOBDhsu.d.cts → with-derivation-BMQ9pIHe.d.cts} +1 -1
  62. package/dist/{with-guard-BD4Hyu8s.d.cts → with-guard-DUnC3JDN.d.cts} +1 -1
  63. package/dist/{with-guard-Du54s3Ti.d.ts → with-guard-DmT50nVG.d.ts} +1 -1
  64. package/dist/{with-materialized-view-B5W4wFAC.d.ts → with-materialized-view-Bp_M3sNG.d.ts} +1 -1
  65. package/dist/{with-materialized-view-BCPPZdjC.d.cts → with-materialized-view-eMTZ65_J.d.cts} +1 -1
  66. package/dist/{with-overlayed-view-B8RrlLsG.d.cts → with-overlayed-view-BoY6PB3n.d.cts} +1 -1
  67. package/dist/{with-overlayed-view-Cw-h9p9N.d.ts → with-overlayed-view-zzSnRQmS.d.ts} +1 -1
  68. package/package.json +3 -3
  69. package/dist/chunk-BT7544RM.js.map +0 -1
  70. package/dist/chunk-NONMIU6C.js +0 -118
  71. package/dist/chunk-NONMIU6C.js.map +0 -1
  72. package/dist/chunk-YZ6JETII.js.map +0 -1
  73. /package/dist/{noydb-6TADQIYH.js.map → noydb-FY2666NY.js.map} +0 -0
@@ -1,5 +1,5 @@
1
- import { Z as ConsentStrategy } from '../types-BeKi0hCx.cjs';
2
- export { _ as CONSENT_AUDIT_COLLECTION, $ as ConsentAuditEntry, a0 as ConsentAuditFilter, a1 as ConsentContext, a2 as ConsentOp, a3 as loadConsentEntries, a4 as writeConsentEntry } from '../types-BeKi0hCx.cjs';
1
+ import { $ as ConsentStrategy } from '../types-DVlvNn2c.cjs';
2
+ export { a0 as CONSENT_AUDIT_COLLECTION, a1 as ConsentAuditEntry, a2 as ConsentAuditFilter, a3 as ConsentContext, a4 as ConsentOp, a5 as loadConsentEntries, a6 as writeConsentEntry } from '../types-DVlvNn2c.cjs';
3
3
  import '../lazy-builder-DXlSCNCJ.cjs';
4
4
  import '../predicate-B0IKeBXx.cjs';
5
5
  import '../strategy-DSTrsZ8t.cjs';
@@ -1,5 +1,5 @@
1
- import { Z as ConsentStrategy } from '../types-BV4AZKmx.js';
2
- export { _ as CONSENT_AUDIT_COLLECTION, $ as ConsentAuditEntry, a0 as ConsentAuditFilter, a1 as ConsentContext, a2 as ConsentOp, a3 as loadConsentEntries, a4 as writeConsentEntry } from '../types-BV4AZKmx.js';
1
+ import { $ as ConsentStrategy } from '../types-DlnZh1_i.js';
2
+ export { a0 as CONSENT_AUDIT_COLLECTION, a1 as ConsentAuditEntry, a2 as ConsentAuditFilter, a3 as ConsentContext, a4 as ConsentOp, a5 as loadConsentEntries, a6 as writeConsentEntry } from '../types-DlnZh1_i.js';
3
3
  import '../lazy-builder-D1MyR1qH.js';
4
4
  import '../predicate-B0IKeBXx.js';
5
5
  import '../strategy-DSTrsZ8t.js';
@@ -1,6 +1,6 @@
1
- export { w as withDerivation } from '../with-derivation-BkOBDhsu.cjs';
2
- import { aw as DerivationStrategy, ax as DerivationContext } from '../types-BeKi0hCx.cjs';
3
- export { ay as ArrayOutputSpec, az as DerivationRegistry, aA as DerivationStrategyHandle, aB as DerivedFromMeta, aC as OutputSpec, aD as RecordOutputSpec } from '../types-BeKi0hCx.cjs';
1
+ export { w as withDerivation } from '../with-derivation-BMQ9pIHe.cjs';
2
+ import { ay as DerivationStrategy, az as DerivationContext } from '../types-DVlvNn2c.cjs';
3
+ export { aA as ArrayOutputSpec, aB as DerivationRegistry, aC as DerivationStrategyHandle, aD as DerivedFromMeta, aE as OutputSpec, aF as RecordOutputSpec } from '../types-DVlvNn2c.cjs';
4
4
  export { e as DerivationCapExceededError, f as DerivationCycleError, g as DerivationDepthError, h as DerivationOutputShapeError, i as DerivationOutputUnknownError } from '../index-5I0MZ0jQ.cjs';
5
5
  import '../lazy-builder-DXlSCNCJ.cjs';
6
6
  import '../predicate-B0IKeBXx.cjs';
@@ -1,6 +1,6 @@
1
- export { w as withDerivation } from '../with-derivation-BWcwmevt.js';
2
- import { aw as DerivationStrategy, ax as DerivationContext } from '../types-BV4AZKmx.js';
3
- export { ay as ArrayOutputSpec, az as DerivationRegistry, aA as DerivationStrategyHandle, aB as DerivedFromMeta, aC as OutputSpec, aD as RecordOutputSpec } from '../types-BV4AZKmx.js';
1
+ export { w as withDerivation } from '../with-derivation-B98shCV8.js';
2
+ import { ay as DerivationStrategy, az as DerivationContext } from '../types-DlnZh1_i.js';
3
+ export { aA as ArrayOutputSpec, aB as DerivationRegistry, aC as DerivationStrategyHandle, aD as DerivedFromMeta, aE as OutputSpec, aF as RecordOutputSpec } from '../types-DlnZh1_i.js';
4
4
  export { e as DerivationCapExceededError, f as DerivationCycleError, g as DerivationDepthError, h as DerivationOutputShapeError, i as DerivationOutputUnknownError } from '../index-fIPPh5dg.js';
5
5
  import '../lazy-builder-D1MyR1qH.js';
6
6
  import '../predicate-B0IKeBXx.js';
@@ -1,4 +1,4 @@
1
- import { aL as Role, aM as UnlockedKeyring } from './types-BV4AZKmx.js';
1
+ import { aN as Role, aO as UnlockedKeyring } from './types-DlnZh1_i.js';
2
2
 
3
3
  /**
4
4
  * Session tokens —
@@ -1,4 +1,4 @@
1
- import { aL as Role, aM as UnlockedKeyring } from './types-BeKi0hCx.cjs';
1
+ import { aN as Role, aO as UnlockedKeyring } from './types-DVlvNn2c.cjs';
2
2
 
3
3
  /**
4
4
  * Session tokens —
@@ -1,6 +1,6 @@
1
- export { w as withGuard } from '../with-guard-BD4Hyu8s.cjs';
2
- import { ah as GuardStrategy, ai as GuardChange, aj as GuardContext } from '../types-BeKi0hCx.cjs';
3
- export { ak as GuardRegistry, al as GuardStrategyHandle, am as ReadOnlyVaultFacade } from '../types-BeKi0hCx.cjs';
1
+ export { w as withGuard } from '../with-guard-DUnC3JDN.cjs';
2
+ import { aj as GuardStrategy, ak as GuardChange, al as GuardContext } from '../types-DVlvNn2c.cjs';
3
+ export { am as GuardRegistry, an as GuardStrategyHandle, ao as ReadOnlyVaultFacade } from '../types-DVlvNn2c.cjs';
4
4
  export { A as AmendmentForbiddenError, F as FieldFrozenError, I as InvariantError, d as RecordLockedError } from '../index-5I0MZ0jQ.cjs';
5
5
  import '../lazy-builder-DXlSCNCJ.cjs';
6
6
  import '../predicate-B0IKeBXx.cjs';
@@ -1,6 +1,6 @@
1
- export { w as withGuard } from '../with-guard-Du54s3Ti.js';
2
- import { ah as GuardStrategy, ai as GuardChange, aj as GuardContext } from '../types-BV4AZKmx.js';
3
- export { ak as GuardRegistry, al as GuardStrategyHandle, am as ReadOnlyVaultFacade } from '../types-BV4AZKmx.js';
1
+ export { w as withGuard } from '../with-guard-DmT50nVG.js';
2
+ import { aj as GuardStrategy, ak as GuardChange, al as GuardContext } from '../types-DlnZh1_i.js';
3
+ export { am as GuardRegistry, an as GuardStrategyHandle, ao as ReadOnlyVaultFacade } from '../types-DlnZh1_i.js';
4
4
  export { A as AmendmentForbiddenError, F as FieldFrozenError, I as InvariantError, d as RecordLockedError } from '../index-fIPPh5dg.js';
5
5
  import '../lazy-builder-D1MyR1qH.js';
6
6
  import '../predicate-B0IKeBXx.js';
@@ -1,4 +1,4 @@
1
- import { aQ as EncryptedEnvelope } from './types-BV4AZKmx.js';
1
+ import { aS as EncryptedEnvelope } from './types-DlnZh1_i.js';
2
2
 
3
3
  /**
4
4
  * Ledger storage constants — pinned in their own leaf module so
@@ -1,4 +1,4 @@
1
- import { aQ as EncryptedEnvelope } from './types-BeKi0hCx.cjs';
1
+ import { aS as EncryptedEnvelope } from './types-DVlvNn2c.cjs';
2
2
 
3
3
  /**
4
4
  * Ledger storage constants — pinned in their own leaf module so
@@ -1,6 +1,6 @@
1
- import { aN as HistoryStrategy, aO as NoydbStore, aP as HistoryOptions, aQ as EncryptedEnvelope, aR as PruneOptions } from '../types-BeKi0hCx.cjs';
2
- export { aS as AppendInput, aT as ChangeType, aU as CollectionInstant, aV as DiffEntry, aW as JsonPatch, aX as JsonPatchOp, aY as LedgerEntry, aZ as LedgerStore, a_ as VaultEngine, a$ as VaultInstant, b0 as VerifyResult, b1 as applyPatch, b2 as canonicalJson, b3 as computePatch, b4 as diff, b5 as formatDiff, b6 as hashEntry, b7 as paddedIndex, b8 as parseIndex, b9 as sha256Hex } from '../types-BeKi0hCx.cjs';
3
- export { L as LEDGER_COLLECTION, a as LEDGER_DELTAS_COLLECTION, e as envelopePayloadHash } from '../hash-BQVrGV-t.cjs';
1
+ import { aP as HistoryStrategy, aQ as NoydbStore, aR as HistoryOptions, aS as EncryptedEnvelope, aT as PruneOptions } from '../types-DVlvNn2c.cjs';
2
+ export { aU as AppendInput, aV as ChangeType, aW as CollectionInstant, aX as DiffEntry, aY as JsonPatch, aZ as JsonPatchOp, a_ as LedgerEntry, a$ as LedgerStore, b0 as VaultEngine, b1 as VaultInstant, b2 as VerifyResult, b3 as applyPatch, b4 as canonicalJson, b5 as computePatch, b6 as diff, b7 as formatDiff, b8 as hashEntry, b9 as paddedIndex, ba as parseIndex, bb as sha256Hex } from '../types-DVlvNn2c.cjs';
3
+ export { L as LEDGER_COLLECTION, a as LEDGER_DELTAS_COLLECTION, e as envelopePayloadHash } from '../hash-BgEQklQc.cjs';
4
4
  import '../lazy-builder-DXlSCNCJ.cjs';
5
5
  import '../predicate-B0IKeBXx.cjs';
6
6
  import '../strategy-DSTrsZ8t.cjs';
@@ -1,6 +1,6 @@
1
- import { aN as HistoryStrategy, aO as NoydbStore, aP as HistoryOptions, aQ as EncryptedEnvelope, aR as PruneOptions } from '../types-BV4AZKmx.js';
2
- export { aS as AppendInput, aT as ChangeType, aU as CollectionInstant, aV as DiffEntry, aW as JsonPatch, aX as JsonPatchOp, aY as LedgerEntry, aZ as LedgerStore, a_ as VaultEngine, a$ as VaultInstant, b0 as VerifyResult, b1 as applyPatch, b2 as canonicalJson, b3 as computePatch, b4 as diff, b5 as formatDiff, b6 as hashEntry, b7 as paddedIndex, b8 as parseIndex, b9 as sha256Hex } from '../types-BV4AZKmx.js';
3
- export { L as LEDGER_COLLECTION, a as LEDGER_DELTAS_COLLECTION, e as envelopePayloadHash } from '../hash-CJEFQxSD.js';
1
+ import { aP as HistoryStrategy, aQ as NoydbStore, aR as HistoryOptions, aS as EncryptedEnvelope, aT as PruneOptions } from '../types-DlnZh1_i.js';
2
+ export { aU as AppendInput, aV as ChangeType, aW as CollectionInstant, aX as DiffEntry, aY as JsonPatch, aZ as JsonPatchOp, a_ as LedgerEntry, a$ as LedgerStore, b0 as VaultEngine, b1 as VaultInstant, b2 as VerifyResult, b3 as applyPatch, b4 as canonicalJson, b5 as computePatch, b6 as diff, b7 as formatDiff, b8 as hashEntry, b9 as paddedIndex, ba as parseIndex, bb as sha256Hex } from '../types-DlnZh1_i.js';
3
+ export { L as LEDGER_COLLECTION, a as LEDGER_DELTAS_COLLECTION, e as envelopePayloadHash } from '../hash-BAlWR4WD.js';
4
4
  import '../lazy-builder-D1MyR1qH.js';
5
5
  import '../predicate-B0IKeBXx.js';
6
6
  import '../strategy-DSTrsZ8t.js';
@@ -31,11 +31,13 @@ __export(i18n_exports, {
31
31
  applyI18nLocale: () => applyI18nLocale,
32
32
  dictCollectionName: () => dictCollectionName,
33
33
  dictKey: () => dictKey,
34
+ getAtPath: () => getAtPath,
34
35
  i18nText: () => i18nText,
35
36
  isDictCollectionName: () => isDictCollectionName,
36
37
  isDictKeyDescriptor: () => isDictKeyDescriptor,
37
38
  isI18nTextDescriptor: () => isI18nTextDescriptor,
38
39
  resolveI18nText: () => resolveI18nText,
40
+ setAtPathInPlace: () => setAtPathInPlace,
39
41
  validateI18nTextValue: () => validateI18nTextValue,
40
42
  withI18n: () => withI18n
41
43
  });
@@ -253,20 +255,81 @@ function resolveI18nText(value, locale, fallback, field) {
253
255
  `No translation available for locale "${locale}"` + (chain.length > 0 ? ` or fallback chain [${chain.join(", ")}]` : "") + "."
254
256
  );
255
257
  }
258
+ function getAtPath(obj, path) {
259
+ const arrayIdx = path.indexOf("[].");
260
+ if (arrayIdx !== -1) {
261
+ const arrayKey = path.slice(0, arrayIdx);
262
+ const restPath = path.slice(arrayIdx + 3);
263
+ const arr = obj[arrayKey];
264
+ if (!Array.isArray(arr)) return [];
265
+ return arr.flatMap((item) => {
266
+ if (!item || typeof item !== "object" || Array.isArray(item)) return [];
267
+ return getAtPath(item, restPath);
268
+ });
269
+ }
270
+ const dotIdx = path.indexOf(".");
271
+ if (dotIdx !== -1) {
272
+ const head = path.slice(0, dotIdx);
273
+ const rest = path.slice(dotIdx + 1);
274
+ const nested = obj[head];
275
+ if (!nested || typeof nested !== "object" || Array.isArray(nested)) return [];
276
+ return getAtPath(nested, rest);
277
+ }
278
+ const val = obj[path];
279
+ return val !== void 0 ? [val] : [];
280
+ }
281
+ function setAtPathInPlace(obj, path, value) {
282
+ const dotIdx = path.indexOf(".");
283
+ if (dotIdx !== -1) {
284
+ const head = path.slice(0, dotIdx);
285
+ const rest = path.slice(dotIdx + 1);
286
+ const nested = obj[head];
287
+ if (!nested || typeof nested !== "object" || Array.isArray(nested)) return;
288
+ setAtPathInPlace(nested, rest, value);
289
+ return;
290
+ }
291
+ obj[path] = value;
292
+ }
293
+ function applyAtPath(obj, path, locale, fallback) {
294
+ const arrayIdx = path.indexOf("[].");
295
+ if (arrayIdx !== -1) {
296
+ const arrayKey = path.slice(0, arrayIdx);
297
+ const restPath = path.slice(arrayIdx + 3);
298
+ const arr = obj[arrayKey];
299
+ if (!Array.isArray(arr)) return obj;
300
+ return {
301
+ ...obj,
302
+ [arrayKey]: arr.map((item) => {
303
+ if (!item || typeof item !== "object" || Array.isArray(item)) return item;
304
+ return applyAtPath(item, restPath, locale, fallback);
305
+ })
306
+ };
307
+ }
308
+ const dotIdx = path.indexOf(".");
309
+ if (dotIdx !== -1) {
310
+ const head = path.slice(0, dotIdx);
311
+ const rest = path.slice(dotIdx + 1);
312
+ const nested = obj[head];
313
+ if (!nested || typeof nested !== "object" || Array.isArray(nested)) return obj;
314
+ return {
315
+ ...obj,
316
+ [head]: applyAtPath(nested, rest, locale, fallback)
317
+ };
318
+ }
319
+ const raw = obj[path];
320
+ if (raw === void 0 || raw === null) return obj;
321
+ if (typeof raw !== "object" || Array.isArray(raw)) return obj;
322
+ return {
323
+ ...obj,
324
+ [path]: resolveI18nText(raw, locale, fallback, path)
325
+ };
326
+ }
256
327
  function applyI18nLocale(record, i18nFields, locale, fallback) {
257
328
  const fieldNames = Object.keys(i18nFields);
258
329
  if (fieldNames.length === 0) return record;
259
- const result = { ...record };
330
+ let result = record;
260
331
  for (const field of fieldNames) {
261
- const raw = result[field];
262
- if (raw === void 0 || raw === null) continue;
263
- if (typeof raw !== "object" || Array.isArray(raw)) continue;
264
- result[field] = resolveI18nText(
265
- raw,
266
- locale,
267
- fallback,
268
- field
269
- );
332
+ result = applyAtPath(result, field, locale, fallback);
270
333
  }
271
334
  return result;
272
335
  }
@@ -829,11 +892,13 @@ function withI18n() {
829
892
  applyI18nLocale,
830
893
  dictCollectionName,
831
894
  dictKey,
895
+ getAtPath,
832
896
  i18nText,
833
897
  isDictCollectionName,
834
898
  isDictKeyDescriptor,
835
899
  isI18nTextDescriptor,
836
900
  resolveI18nText,
901
+ setAtPathInPlace,
837
902
  validateI18nTextValue,
838
903
  withI18n
839
904
  });