@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.
- package/dist/attestation/index.d.cts +1 -1
- package/dist/attestation/index.d.ts +1 -1
- package/dist/blobs/index.d.cts +2 -2
- package/dist/blobs/index.d.ts +2 -2
- package/dist/bundle/index.cjs +53 -6
- package/dist/bundle/index.cjs.map +1 -1
- package/dist/bundle/index.d.cts +3 -3
- package/dist/bundle/index.d.ts +3 -3
- package/dist/bundle/index.js +1 -1
- package/dist/{chunk-YZ6JETII.js → chunk-JICBEFBT.js} +176 -1
- package/dist/chunk-JICBEFBT.js.map +1 -0
- package/dist/{chunk-BT7544RM.js → chunk-W277AG6N.js} +14 -9
- package/dist/chunk-W277AG6N.js.map +1 -0
- package/dist/consent/index.d.cts +2 -2
- package/dist/consent/index.d.ts +2 -2
- package/dist/derivations/index.d.cts +3 -3
- package/dist/derivations/index.d.ts +3 -3
- package/dist/{dev-unlock--ahUTrhc.d.ts → dev-unlock-Cvo-xCQC.d.ts} +1 -1
- package/dist/{dev-unlock-BIwt2V3p.d.cts → dev-unlock-Dy1qVpkL.d.cts} +1 -1
- package/dist/guards/index.d.cts +3 -3
- package/dist/guards/index.d.ts +3 -3
- package/dist/{hash-CJEFQxSD.d.ts → hash-BAlWR4WD.d.ts} +1 -1
- package/dist/{hash-BQVrGV-t.d.cts → hash-BgEQklQc.d.cts} +1 -1
- package/dist/history/index.d.cts +3 -3
- package/dist/history/index.d.ts +3 -3
- package/dist/i18n/index.cjs +75 -10
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/i18n/index.d.cts +2 -2
- package/dist/i18n/index.d.ts +2 -2
- package/dist/i18n/index.js +11 -9
- package/dist/index.cjs +176 -114
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -9
- package/dist/index.d.ts +9 -9
- package/dist/index.js +8 -10
- package/dist/index.js.map +1 -1
- package/dist/materialized-views/index.d.cts +3 -3
- package/dist/materialized-views/index.d.ts +3 -3
- package/dist/{noydb-6TADQIYH.js → noydb-FY2666NY.js} +3 -3
- package/dist/overlay-views/index.d.cts +3 -3
- package/dist/overlay-views/index.d.ts +3 -3
- package/dist/periods/index.d.cts +2 -2
- package/dist/periods/index.d.ts +2 -2
- package/dist/session/index.d.cts +3 -3
- package/dist/session/index.d.ts +3 -3
- package/dist/shadow/index.d.cts +2 -2
- package/dist/shadow/index.d.ts +2 -2
- package/dist/store/index.d.cts +2 -2
- package/dist/store/index.d.ts +2 -2
- package/dist/sync/index.d.cts +1 -1
- package/dist/sync/index.d.ts +1 -1
- package/dist/team/index.d.cts +2 -2
- package/dist/team/index.d.ts +2 -2
- package/dist/tx/index.d.cts +2 -2
- package/dist/tx/index.d.ts +2 -2
- package/dist/{types-BeKi0hCx.d.cts → types-DVlvNn2c.d.cts} +22 -5
- package/dist/{types-BV4AZKmx.d.ts → types-DlnZh1_i.d.ts} +22 -5
- package/dist/{ulid-CQc0eBxE.d.ts → ulid-CzPONlhG.d.ts} +1 -1
- package/dist/{ulid-Cvljl7ZZ.d.cts → ulid-r98nkjVd.d.cts} +1 -1
- package/dist/{with-derivation-BWcwmevt.d.ts → with-derivation-B98shCV8.d.ts} +1 -1
- package/dist/{with-derivation-BkOBDhsu.d.cts → with-derivation-BMQ9pIHe.d.cts} +1 -1
- package/dist/{with-guard-BD4Hyu8s.d.cts → with-guard-DUnC3JDN.d.cts} +1 -1
- package/dist/{with-guard-Du54s3Ti.d.ts → with-guard-DmT50nVG.d.ts} +1 -1
- package/dist/{with-materialized-view-B5W4wFAC.d.ts → with-materialized-view-Bp_M3sNG.d.ts} +1 -1
- package/dist/{with-materialized-view-BCPPZdjC.d.cts → with-materialized-view-eMTZ65_J.d.cts} +1 -1
- package/dist/{with-overlayed-view-B8RrlLsG.d.cts → with-overlayed-view-BoY6PB3n.d.cts} +1 -1
- package/dist/{with-overlayed-view-Cw-h9p9N.d.ts → with-overlayed-view-zzSnRQmS.d.ts} +1 -1
- package/package.json +3 -3
- package/dist/chunk-BT7544RM.js.map +0 -1
- package/dist/chunk-NONMIU6C.js +0 -118
- package/dist/chunk-NONMIU6C.js.map +0 -1
- package/dist/chunk-YZ6JETII.js.map +0 -1
- /package/dist/{noydb-6TADQIYH.js.map → noydb-FY2666NY.js.map} +0 -0
package/dist/consent/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
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';
|
package/dist/consent/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
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-
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
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-
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
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';
|
package/dist/guards/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { w as withGuard } from '../with-guard-
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
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';
|
package/dist/guards/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { w as withGuard } from '../with-guard-
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
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';
|
package/dist/history/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
export { L as LEDGER_COLLECTION, a as LEDGER_DELTAS_COLLECTION, e as envelopePayloadHash } from '../hash-
|
|
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';
|
package/dist/history/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
export { L as LEDGER_COLLECTION, a as LEDGER_DELTAS_COLLECTION, e as envelopePayloadHash } from '../hash-
|
|
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';
|
package/dist/i18n/index.cjs
CHANGED
|
@@ -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
|
-
|
|
330
|
+
let result = record;
|
|
260
331
|
for (const field of fieldNames) {
|
|
261
|
-
|
|
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
|
});
|