@noy-db/hub 0.4.0-pre.3 → 0.4.0-pre.4
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/cargo/index.js +2 -2
- package/dist/{chunk-GU5AYA2Q.js → chunk-4X6DJZHY.js} +2 -2
- package/dist/{chunk-N4A3DCBT.js → chunk-5KI3REO3.js} +2 -2
- package/dist/{chunk-OWLPX2GI.js → chunk-BLB7P7LS.js} +2 -2
- package/dist/{chunk-J6U4BOKP.js → chunk-JW3XCZA2.js} +9 -9
- package/dist/{chunk-UBF7HTOR.js → chunk-QUIG6BZT.js} +15 -15
- package/dist/{chunk-UBF7HTOR.js.map → chunk-QUIG6BZT.js.map} +1 -1
- package/dist/{chunk-SN75YVM5.js → chunk-U73LHVPF.js} +15 -15
- package/dist/{chunk-SN75YVM5.js.map → chunk-U73LHVPF.js.map} +1 -1
- package/dist/{chunk-LUH2MPEF.js → chunk-W7TCXZWU.js} +423 -467
- package/dist/chunk-W7TCXZWU.js.map +1 -0
- package/dist/{collection-facade-ENLTJZBT.js → collection-facade-CMZGQ6IS.js} +2 -2
- package/dist/index.js +7 -7
- package/dist/kernel/collection-config.d.ts +11 -69
- package/dist/kernel/collection.d.ts +10 -21
- package/dist/kernel/noydb.d.ts +11 -12
- package/dist/kernel/vault.d.ts +21 -68
- package/dist/{noydb-KUX2TJMX.js → noydb-N5IW6OFZ.js} +7 -7
- package/dist/port/with/archive-strategy.d.ts +31 -0
- package/dist/port/with/strategies.d.ts +134 -0
- package/dist/query/index.js +1 -1
- package/dist/team/index.js +1 -1
- package/dist/tiers/index.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-LUH2MPEF.js.map +0 -1
- /package/dist/{chunk-GU5AYA2Q.js.map → chunk-4X6DJZHY.js.map} +0 -0
- /package/dist/{chunk-N4A3DCBT.js.map → chunk-5KI3REO3.js.map} +0 -0
- /package/dist/{chunk-OWLPX2GI.js.map → chunk-BLB7P7LS.js.map} +0 -0
- /package/dist/{chunk-J6U4BOKP.js.map → chunk-JW3XCZA2.js.map} +0 -0
- /package/dist/{collection-facade-ENLTJZBT.js.map → collection-facade-CMZGQ6IS.js.map} +0 -0
- /package/dist/{noydb-KUX2TJMX.js.map → noydb-N5IW6OFZ.js.map} +0 -0
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
similarTo,
|
|
11
11
|
syncTierSearch,
|
|
12
12
|
warmIndex
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-JW3XCZA2.js";
|
|
14
14
|
import "./chunk-AURFOK3D.js";
|
|
15
15
|
import "./chunk-25G7U6RD.js";
|
|
16
16
|
import "./chunk-BZEPJJOK.js";
|
|
@@ -41,4 +41,4 @@ export {
|
|
|
41
41
|
syncTierSearch,
|
|
42
42
|
warmIndex
|
|
43
43
|
};
|
|
44
|
-
//# sourceMappingURL=collection-facade-
|
|
44
|
+
//# sourceMappingURL=collection-facade-CMZGQ6IS.js.map
|
package/dist/index.js
CHANGED
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
refArray,
|
|
21
21
|
via,
|
|
22
22
|
withArchive
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-W7TCXZWU.js";
|
|
24
24
|
import {
|
|
25
25
|
DELEGATIONS_COLLECTION,
|
|
26
26
|
issueDelegation,
|
|
@@ -73,7 +73,7 @@ import {
|
|
|
73
73
|
NO_SEARCH,
|
|
74
74
|
tokenize,
|
|
75
75
|
withSearch
|
|
76
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-JW3XCZA2.js";
|
|
77
77
|
import {
|
|
78
78
|
derivePersistedSchema,
|
|
79
79
|
isZodSchema
|
|
@@ -93,13 +93,13 @@ import {
|
|
|
93
93
|
import {
|
|
94
94
|
decryptExtractedPartition,
|
|
95
95
|
withCargo
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-BLB7P7LS.js";
|
|
97
97
|
import {
|
|
98
98
|
CustodyApi,
|
|
99
99
|
NO_CARGO,
|
|
100
100
|
NO_CUSTODY,
|
|
101
101
|
withCustody
|
|
102
|
-
} from "./chunk-
|
|
102
|
+
} from "./chunk-U73LHVPF.js";
|
|
103
103
|
import "./chunk-OVFCAS7U.js";
|
|
104
104
|
import {
|
|
105
105
|
DEED_RECORD_ID,
|
|
@@ -153,7 +153,7 @@ import {
|
|
|
153
153
|
isClassifiedGroup,
|
|
154
154
|
resolveClassifiedFields
|
|
155
155
|
} from "./chunk-IZX3WZBF.js";
|
|
156
|
-
import "./chunk-
|
|
156
|
+
import "./chunk-5KI3REO3.js";
|
|
157
157
|
import "./chunk-GYB2QK5H.js";
|
|
158
158
|
import "./chunk-GS3Q2KOZ.js";
|
|
159
159
|
import "./chunk-KR5EGWI4.js";
|
|
@@ -203,7 +203,7 @@ import {
|
|
|
203
203
|
ScanBuilder,
|
|
204
204
|
buildLiveQuery,
|
|
205
205
|
executePlan
|
|
206
|
-
} from "./chunk-
|
|
206
|
+
} from "./chunk-4X6DJZHY.js";
|
|
207
207
|
import {
|
|
208
208
|
DEFAULT_JOIN_MAX_ROWS,
|
|
209
209
|
applyJoins,
|
|
@@ -357,7 +357,7 @@ import {
|
|
|
357
357
|
rotatePassphrase,
|
|
358
358
|
unwrapMagicLinkGrant,
|
|
359
359
|
writeMagicLinkGrant
|
|
360
|
-
} from "./chunk-
|
|
360
|
+
} from "./chunk-QUIG6BZT.js";
|
|
361
361
|
import {
|
|
362
362
|
SYNC_CREDENTIALS_COLLECTION,
|
|
363
363
|
WeakPassphraseError,
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
* signature can't be exposed via a method without breaking `Collection<T>`
|
|
18
18
|
* assignability to `Collection<unknown>`).
|
|
19
19
|
*/
|
|
20
|
+
import type { StrategyBag } from '../port/with/strategies.js';
|
|
20
21
|
import type { NoydbStore, ConflictPolicy, CollectionConflictResolver, HistoryConfig, TierMode, CrossTierAccessEvent, VdigFieldPolicy } from './types.js';
|
|
21
22
|
import type { EnclaveKey } from './enclave/index.js';
|
|
22
23
|
import type { UnlockedKeyring } from '../with-party/team/keyring.js';
|
|
@@ -29,24 +30,15 @@ import type { SchemaFenceController } from '../with-shape/schema-update/fence-co
|
|
|
29
30
|
import type { StandardSchemaV1 } from './schema.js';
|
|
30
31
|
import type { LedgerStore } from '../with-commit/history/ledger/index.js';
|
|
31
32
|
import type { CrdtMode } from '../with-commit/crdt/crdt.js';
|
|
32
|
-
import type { CrdtStrategy } from './types.js';
|
|
33
|
-
import { type HistoryStrategy } from '../with-commit/history/strategy.js';
|
|
34
|
-
import { type I18nStrategy } from '../port/with/i18n-strategy.js';
|
|
35
|
-
import { type SyncStrategy } from '../with-party/team/sync-strategy.js';
|
|
36
|
-
import { type BlobStrategy } from '../port/with/blob-strategy.js';
|
|
37
|
-
import { type AggregateStrategy } from '../with-lookup/aggregate/strategy.js';
|
|
38
|
-
import { type TiersStrategy } from '../with-audit/tiers/strategy.js';
|
|
39
|
-
import { type SearchStrategy } from '../with-lookup/search/strategy.js';
|
|
40
33
|
import type { ObjectProjection } from '../with-shape/blobs/object-projection.js';
|
|
41
34
|
import type { BlobFieldsConfig } from '../with-shape/blobs/blob-compaction.js';
|
|
42
|
-
import type { IndexStrategy } from '../with-lookup/indexing/strategy.js';
|
|
43
35
|
import type { IndexDef } from '../with-lookup/indexing/eager-indexes.js';
|
|
44
36
|
import type { I18nTextDescriptor, DictKeyDescriptor, StaticDictDescriptor, DictionaryHandle } from '../port/with/i18n-strategy.js';
|
|
45
37
|
import type { LookupDescriptor, MaterializedBacking } from '../port/with/lookup-strategy.js';
|
|
46
38
|
import type { ComputedFields, ComputedFn, ComputedFieldEntry } from '../with-formula/computed/index.js';
|
|
47
39
|
import type { RollupDeleteIntent } from './via/dispatch.js';
|
|
48
40
|
import '../port/with/computed-strategy.js';
|
|
49
|
-
import { type ClassifiedEntry, type ResolvedClassified, type ClassifiedGuardCtx, type
|
|
41
|
+
import { type ClassifiedEntry, type ResolvedClassified, type ClassifiedGuardCtx, type ClassifiedViaConfig } from '../port/with/classified-strategy.js';
|
|
50
42
|
import type { FieldRef, Grain } from './via/graph.js';
|
|
51
43
|
import type { FieldMeta } from '../with-shape/introspection/field-meta.js';
|
|
52
44
|
import type { CollectionMeta } from '../with-shape/introspection/meta.js';
|
|
@@ -60,7 +52,6 @@ import type { TxContext } from '../with-commit/tx/transaction.js';
|
|
|
60
52
|
import type { MaterializedViewRegistry } from '../with-formula/materialized-views/registry.js';
|
|
61
53
|
import type { MVQueryContext } from '../with-formula/materialized-views/types.js';
|
|
62
54
|
import type { Collection, OnDirtyCallback, CacheOptions } from './collection.js';
|
|
63
|
-
import type { LazyStrategy } from '../port/with/lazy-strategy.js';
|
|
64
55
|
import { ViaPipeline } from './via/pipeline.js';
|
|
65
56
|
import { type ViaBinding, type ViaDescriptor } from './via/index.js';
|
|
66
57
|
import { type ViaFieldSpec } from './via/compose.js';
|
|
@@ -74,6 +65,14 @@ export interface CollectionOpts<T> {
|
|
|
74
65
|
name: string;
|
|
75
66
|
keyring: UnlockedKeyring;
|
|
76
67
|
encrypted: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Every opt-in service, resolved once by `createNoydb` (#838). Replaces the
|
|
70
|
+
* eleven optional `*Strategy` fields this interface used to declare, each of
|
|
71
|
+
* which re-applied a `?? NO_*` default that had already been applied
|
|
72
|
+
* upstream. Each entry is a tree-shake seam: an un-opted-in service holds
|
|
73
|
+
* its `NO_*` stub, so the real machinery never reaches the bundle.
|
|
74
|
+
*/
|
|
75
|
+
strategies: StrategyBag;
|
|
77
76
|
/**
|
|
78
77
|
* Opt-in: keep the working set encrypted in RAM, decrypting on read (future phase).
|
|
79
78
|
* Default false — the working set is plaintext.
|
|
@@ -113,13 +112,6 @@ export interface CollectionOpts<T> {
|
|
|
113
112
|
* back to an unconditional store read on re-create.
|
|
114
113
|
*/
|
|
115
114
|
tabCoordinated?: (() => boolean) | undefined;
|
|
116
|
-
/**
|
|
117
|
-
* tree-shake seam. When omitted, `collection.blob(id)` throws
|
|
118
|
-
* with a pointer at the `@noy-db/hub/blobs` subpath. When set (via
|
|
119
|
-
* `createNoydb({ blobStrategy: blobs() })`), blob storage is live.
|
|
120
|
-
* `@internal` by virtue of `BlobStrategy` being `@internal`.
|
|
121
|
-
*/
|
|
122
|
-
blobStrategy?: BlobStrategy | undefined;
|
|
123
115
|
objectStore?: ObjectProjection | undefined;
|
|
124
116
|
blobFields?: BlobFieldsConfig | undefined;
|
|
125
117
|
/**
|
|
@@ -132,26 +124,6 @@ export interface CollectionOpts<T> {
|
|
|
132
124
|
* decryptable at rest under the flat `_blob` DEK (documented residue).
|
|
133
125
|
*/
|
|
134
126
|
blobTierPolicy?: 'isolate' | 'dedup' | undefined;
|
|
135
|
-
aggregateStrategy?: AggregateStrategy | undefined;
|
|
136
|
-
crdtStrategy?: CrdtStrategy | undefined;
|
|
137
|
-
/**
|
|
138
|
-
* tree-shake seam — strategy for optional history/ledger/
|
|
139
|
-
* time-machine. When omitted, history snapshots and ledger appends
|
|
140
|
-
* become silent no-ops (data still writes); the read APIs
|
|
141
|
-
* (`history`, `getVersion`, `revert`, `diff`, `clearHistory`,
|
|
142
|
-
* `pruneRecordHistory`) throw with a pointer at `@noy-db/hub/history`.
|
|
143
|
-
*/
|
|
144
|
-
historyStrategy?: HistoryStrategy | undefined;
|
|
145
|
-
i18nStrategy?: I18nStrategy | undefined;
|
|
146
|
-
syncStrategy?: SyncStrategy | undefined;
|
|
147
|
-
/**
|
|
148
|
-
* tree-shake seam. When omitted, indexing is off for this
|
|
149
|
-
* collection — every `.lazyQuery()` call throws, `.rebuildIndexes()`
|
|
150
|
-
* is a no-op, and `indexes: [...]` declarations are ignored. Enable
|
|
151
|
-
* by passing `withIndexing()` from `@noy-db/hub/indexing` at
|
|
152
|
-
* `createNoydb` time.
|
|
153
|
-
*/
|
|
154
|
-
indexStrategy?: IndexStrategy | undefined;
|
|
155
127
|
indexes?: IndexDef[] | undefined;
|
|
156
128
|
/**
|
|
157
129
|
* Auto-reconcile behavior for persisted-index drift on lazy-mode
|
|
@@ -183,12 +155,6 @@ export interface CollectionOpts<T> {
|
|
|
183
155
|
* unbounded lazy cache defeats the purpose.
|
|
184
156
|
*/
|
|
185
157
|
cache?: CacheOptions | undefined;
|
|
186
|
-
/**
|
|
187
|
-
* Lazy service seam (#267) — supplies the bounded-LRU working-set cache
|
|
188
|
-
* when `prefetch: false`. Omitted → the deprecated IMPLICIT_LAZY
|
|
189
|
-
* back-compat default (identical behavior + one-time warn).
|
|
190
|
-
*/
|
|
191
|
-
lazyStrategy?: LazyStrategy | undefined;
|
|
192
158
|
/**
|
|
193
159
|
* Optional Standard Schema v1 validator (Zod, Valibot, ArkType,
|
|
194
160
|
* Effect Schema, etc.). When set, every `put()` is validated before
|
|
@@ -274,8 +240,6 @@ export interface CollectionOpts<T> {
|
|
|
274
240
|
* `undefined` when no forget strategy declares this collection (no-op).
|
|
275
241
|
*/
|
|
276
242
|
addSubjectRef?: ((id: string, record: unknown) => Promise<void>) | undefined;
|
|
277
|
-
/** — tree-shake seam for `collection.reveal()`. Defaults to `NO_CLASSIFIED`. */
|
|
278
|
-
classifiedStrategy?: ClassifiedStrategy | undefined;
|
|
279
243
|
/**
|
|
280
244
|
* async callback that resolves a dict key to its label
|
|
281
245
|
* for a given locale. Provided by the Vault.
|
|
@@ -433,20 +397,6 @@ export interface CollectionOpts<T> {
|
|
|
433
397
|
* throw). Tier 0 is implicit and always available.
|
|
434
398
|
*/
|
|
435
399
|
tiers?: readonly number[] | undefined;
|
|
436
|
-
/**
|
|
437
|
-
* tree-shake seam — strategy for the collection-level tier operations
|
|
438
|
-
* (`putAtTier`/`getAtTier`/`listAtTier`/`elevate`/`demote`). When omitted,
|
|
439
|
-
* every tier operation throws `TiersNotEnabledError`. Enable by passing
|
|
440
|
-
* `withTiers()` from `@noy-db/hub/tiers` at `createNoydb` time.
|
|
441
|
-
*/
|
|
442
|
-
tiersStrategy?: TiersStrategy | undefined;
|
|
443
|
-
/**
|
|
444
|
-
* Search / retrieval capability strategy. When omitted, a collection's
|
|
445
|
-
* `search`/`retrieve`/`similarTo`/`warmIndex`/`flushIndex` methods and the
|
|
446
|
-
* embedding write-hook throw `SearchNotEnabledError`. Enable by passing
|
|
447
|
-
* `withSearch()` from `@noy-db/hub` at `createNoydb` time.
|
|
448
|
-
*/
|
|
449
|
-
searchStrategy?: SearchStrategy | undefined;
|
|
450
400
|
/**
|
|
451
401
|
* what a lower-tier caller sees for above-tier
|
|
452
402
|
* records. Default `'invisibility'`.
|
|
@@ -702,14 +652,9 @@ export declare function resolveCollectionConfig<T>(opts: CollectionOpts<T>): {
|
|
|
702
652
|
writeHooks: WriteHookRegistry | undefined;
|
|
703
653
|
subsystemBus: ServiceBus | undefined;
|
|
704
654
|
activeTxId: (() => string | null) | undefined;
|
|
705
|
-
|
|
655
|
+
strategies: StrategyBag;
|
|
706
656
|
objectStore: ObjectProjection | undefined;
|
|
707
657
|
blobFields: BlobFieldsConfig | undefined;
|
|
708
|
-
aggregateStrategy: AggregateStrategy;
|
|
709
|
-
crdtStrategy: CrdtStrategy;
|
|
710
|
-
historyStrategy: HistoryStrategy;
|
|
711
|
-
i18nStrategy: I18nStrategy;
|
|
712
|
-
syncStrategy: SyncStrategy;
|
|
713
658
|
reconcileOnOpen: "auto" | "off" | "dry-run";
|
|
714
659
|
getDEK: (collectionName: string) => Promise<EnclaveKey>;
|
|
715
660
|
onDirty: OnDirtyCallback | undefined;
|
|
@@ -742,7 +687,6 @@ export declare function resolveCollectionConfig<T>(opts: CollectionOpts<T>): {
|
|
|
742
687
|
moneyFields: Record<string, ViaDescriptor> | undefined;
|
|
743
688
|
classified: ResolvedClassified | undefined;
|
|
744
689
|
classifiedGuardCtx: ClassifiedGuardCtx;
|
|
745
|
-
classifiedStrategy: ClassifiedStrategy;
|
|
746
690
|
computed: ComputedFields | undefined;
|
|
747
691
|
computedEdges: readonly GraphEdge[];
|
|
748
692
|
viaDepsEdges: readonly GraphEdge[];
|
|
@@ -794,8 +738,6 @@ export declare function resolveCollectionConfig<T>(opts: CollectionOpts<T>): {
|
|
|
794
738
|
collectDelete(collection: string, id: string, intents: readonly RollupDeleteIntent[]): void;
|
|
795
739
|
} | undefined;
|
|
796
740
|
tiers: Set<number> | null;
|
|
797
|
-
tiersStrategy: TiersStrategy;
|
|
798
|
-
searchStrategy: SearchStrategy;
|
|
799
741
|
tierMode: TierMode;
|
|
800
742
|
blobTierPolicy: "isolate" | "dedup";
|
|
801
743
|
onCrossTierAccess: ((event: CrossTierAccessEvent) => void) | undefined;
|
|
@@ -96,24 +96,19 @@ export declare class Collection<T, S extends keyof T = never, Q extends keyof T
|
|
|
96
96
|
/** True when the caller explicitly provided a `historyConfig` option (vs. inheriting the vault default). */
|
|
97
97
|
private readonly historyConfigExplicit;
|
|
98
98
|
/**
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
* reaches the bundle
|
|
106
|
-
|
|
107
|
-
|
|
99
|
+
* Every opt-in service, resolved once by `createNoydb` (#838) and shared by
|
|
100
|
+
* reference with the owning `Vault` and `Noydb`.
|
|
101
|
+
*
|
|
102
|
+
* Each entry is a tree-shake seam. An un-opted-in service resolves to its
|
|
103
|
+
* `NO_*` stub — a tiny module that throws with an actionable message —
|
|
104
|
+
* so, for example, none of the BlobSet / chunk / MIME-magic machinery
|
|
105
|
+
* reaches the bundle unless the consumer imports `@noy-db/hub/blobs` and
|
|
106
|
+
* passes `blobStrategy: blobs()` to `createNoydb`.
|
|
107
|
+
*/
|
|
108
|
+
private readonly strategies;
|
|
108
109
|
private readonly objectStore;
|
|
109
110
|
private readonly blobFields;
|
|
110
111
|
private readonly blobTierPolicy;
|
|
111
|
-
private readonly aggregateStrategy;
|
|
112
|
-
private readonly crdtStrategy;
|
|
113
|
-
private readonly tiersStrategy;
|
|
114
|
-
private readonly searchStrategy;
|
|
115
|
-
private readonly historyStrategy;
|
|
116
|
-
private readonly syncStrategy;
|
|
117
112
|
private readonly cache;
|
|
118
113
|
private hydrated;
|
|
119
114
|
/**
|
|
@@ -275,12 +270,6 @@ export declare class Collection<T, S extends keyof T = never, Q extends keyof T
|
|
|
275
270
|
/** C-A/R10 memoization: marker declared-set lookup (undefined=unresolved) + classified-handle persist-once flag. */
|
|
276
271
|
private _markerDigestOnlyCache;
|
|
277
272
|
private _markerPersisted;
|
|
278
|
-
/**
|
|
279
|
-
* Tree-shake seam for `reveal()` — defaults to `NO_CLASSIFIED`, which
|
|
280
|
-
* throws `ClassifiedNotEnabledError`. Set via the `classifiedStrategy`
|
|
281
|
-
* `createNoydb()` option (opt in with `withClassified()`).
|
|
282
|
-
*/
|
|
283
|
-
private readonly classifiedStrategy;
|
|
284
273
|
/** Async callback provided by the Vault to open a dynamic dictionary handle (for label-map pre-computation in the search index). Only used in `resolveDictLabelMaps()`; static dicts bypass this entirely. Mutable, assign-once — see {@link _reconcileReadState} (#671 item 1). */
|
|
285
274
|
private getDictionary;
|
|
286
275
|
/**
|
package/dist/kernel/noydb.d.ts
CHANGED
|
@@ -84,21 +84,20 @@ export declare class Noydb {
|
|
|
84
84
|
private writeRelay;
|
|
85
85
|
/** Per-vault policy enforcers. */
|
|
86
86
|
private readonly policyEnforcers;
|
|
87
|
-
private readonly txStrategy;
|
|
88
|
-
private readonly forgetStrategy;
|
|
89
87
|
/**
|
|
90
|
-
*
|
|
91
|
-
* `
|
|
92
|
-
*
|
|
88
|
+
* Every opt-in service, resolved once (#838). Shared by reference with each
|
|
89
|
+
* `Vault` this instance opens and, through them, every `Collection` — so
|
|
90
|
+
* there is exactly one resolution and no construction path can disagree
|
|
91
|
+
* about which services are enabled (the #834 bug class).
|
|
93
92
|
*/
|
|
94
|
-
readonly
|
|
93
|
+
private readonly strategies;
|
|
95
94
|
/**
|
|
96
|
-
* Opt-in
|
|
97
|
-
* `
|
|
98
|
-
*
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
95
|
+
* Opt-in sovereign-custody (FR-6) strategy — `NO_CUSTODY` (throwing) unless
|
|
96
|
+
* `withCustody()` was passed. Kept as a public accessor because `Vault`
|
|
97
|
+
* routes `vault.custody.liberate` through `this.noydb.custodyStrategy`.
|
|
98
|
+
* @internal
|
|
99
|
+
*/
|
|
100
|
+
get custodyStrategy(): CustodyStrategy;
|
|
102
101
|
private readonly snapshots;
|
|
103
102
|
private readonly policyManager;
|
|
104
103
|
/** Pre-resolved policy-gate engine function (mirrors `coordinationProvider`/`userApiFactory` above). */
|
package/dist/kernel/vault.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { StrategyBag } from '../port/with/strategies.js';
|
|
1
2
|
import type { NoydbStore, EncryptedEnvelope, HistoryConfig, ExportStreamOptions, ExportChunk, CollectionConflictResolver, CrossTierAccessEvent, TierMode, Role, VaultUserApi } from './types.js';
|
|
2
3
|
import type { Noydb } from './noydb.js';
|
|
3
4
|
import type { IssueDelegationOptions, DelegationToken } from '../with-party/team/delegation.js';
|
|
@@ -6,7 +7,6 @@ import type { CacheOptions } from './collection.js';
|
|
|
6
7
|
import type { JoinableSource } from './query/index.js';
|
|
7
8
|
import type { OnDirtyCallback } from './collection.js';
|
|
8
9
|
import type { UnlockedKeyring, BundleRecipient } from '../with-party/team/keyring.js';
|
|
9
|
-
import { type PortabilityStrategy } from '../with-audit/portability/strategy.js';
|
|
10
10
|
import type { MaterializedViewRegistry } from '../with-formula/materialized-views/registry.js';
|
|
11
11
|
import type { MaterializedViewStrategyHandle } from '../with-formula/materialized-views/types.js';
|
|
12
12
|
import type { OverlayedViewRegistry } from '../with-formula/overlay-views/registry.js';
|
|
@@ -16,32 +16,20 @@ import type { ExportFormat, KeyringFile, SensitiveOpt, IndexFieldName, IndexDefF
|
|
|
16
16
|
import { ElevatedHandle } from '../with-commit/tx/elevated-handle.js';
|
|
17
17
|
import type { NoydbEventEmitter } from './events.js';
|
|
18
18
|
import type { StandardSchemaV1 } from './schema.js';
|
|
19
|
-
import type { BlobStrategy } from '../port/with/blob-strategy.js';
|
|
20
19
|
import type { ObjectProjection } from '../with-shape/blobs/object-projection.js';
|
|
21
|
-
import type { ArchiveStrategy } from '../with-fork/archive/index.js';
|
|
22
20
|
import type { ArchivePolicy, ArchiveResult, ArchiveRunOptions } from '../with-fork/archive/index.js';
|
|
23
21
|
import { type SequenceHandle, type FormattedSequenceHandle, type SequenceOptions } from '../with-commit/sequence/index.js';
|
|
24
|
-
import { type SequenceStrategy } from '../with-commit/sequence/strategy.js';
|
|
25
22
|
import { type Assignment } from '../with-commit/numbering/index.js';
|
|
26
23
|
import type { DeferredNumberingConfig } from '../with-commit/numbering/descriptor.js';
|
|
27
|
-
import type {
|
|
28
|
-
import type { LazyStrategy } from '../port/with/lazy-strategy.js';
|
|
29
|
-
import type { AggregateStrategy } from '../with-lookup/aggregate/strategy.js';
|
|
30
|
-
import type { CrdtStrategy } from './types.js';
|
|
31
|
-
import type { TiersStrategy, TierMoveResult } from '../with-audit/tiers/strategy.js';
|
|
32
|
-
import type { SearchStrategy } from '../with-lookup/search/strategy.js';
|
|
24
|
+
import type { TierMoveResult } from '../with-audit/tiers/strategy.js';
|
|
33
25
|
import { type CargoStrategy } from '../with-cargo/strategy.js';
|
|
34
|
-
import { type
|
|
26
|
+
import { type CredentialBrokerHandle } from '../port/with/broker-strategy.js';
|
|
35
27
|
import type { LedgerStore } from '../with-commit/history/ledger/store.js';
|
|
36
28
|
import type { VaultInstant } from '../with-commit/history/time-machine.js';
|
|
37
|
-
import { type
|
|
38
|
-
import { type ForgetStrategy, type ForgetResult } from '../with-audit/forget/strategy.js';
|
|
29
|
+
import { type ForgetResult } from '../with-audit/forget/strategy.js';
|
|
39
30
|
import { type SubjectRef } from '../with-audit/forget/subject-index.js';
|
|
40
31
|
import type { VaultFrame } from '../with-fork/shadow/vault-frame.js';
|
|
41
|
-
import { type ShadowStrategy } from '../with-fork/shadow/strategy.js';
|
|
42
32
|
import type { ConsentContext, ConsentAuditEntry, ConsentAuditFilter, ConsentOp } from '../with-audit/consent/consent.js';
|
|
43
|
-
import { type ConsentStrategy } from '../with-audit/consent/strategy.js';
|
|
44
|
-
import { type PeriodsStrategy } from '../with-audit/periods/strategy.js';
|
|
45
33
|
import { type RefDescriptor, type RefViolation } from './refs.js';
|
|
46
34
|
import type { DictionaryHandle, DictionaryOptions, DictKeyDescriptor, StaticDictDescriptor } from '../port/with/i18n-strategy.js';
|
|
47
35
|
import { // #653
|
|
@@ -49,11 +37,10 @@ type LookupDescriptor } from '../port/with/lookup-strategy.js';
|
|
|
49
37
|
import { type LinkSpec, type LinkSetHandle } from '../with-shape/links/names.js';
|
|
50
38
|
import type { EmbeddingDescriptor } from '../with-lookup/embeddings/index.js';
|
|
51
39
|
import type { ComputedFields } from '../with-formula/computed/index.js';
|
|
52
|
-
import { type
|
|
40
|
+
import { type I18nTextDescriptor } from '../port/with/i18n-strategy.js';
|
|
53
41
|
import { type ViaFieldSpec } from './via/compose.js';
|
|
54
42
|
import { ViaGraph } from './via/graph.js';
|
|
55
43
|
import { type RollupDeleteIntent } from './via/dispatch.js';
|
|
56
|
-
import { type SyncStrategy } from '../with-party/team/sync-strategy.js';
|
|
57
44
|
import type { GuardRegistry } from '../with-audit/guards/registry.js';
|
|
58
45
|
import type { GuardStrategyHandleAny } from '../with-audit/guards/types.js';
|
|
59
46
|
import type { ReadOnlyVaultFacade } from '../with-audit/guards/read-only-facade.js';
|
|
@@ -73,13 +60,11 @@ import { SchemaFenceController } from '../with-shape/schema-update/fence-control
|
|
|
73
60
|
import { type FenceDoc } from '../with-shape/schema-update/fence.js';
|
|
74
61
|
import type { SchemaUpdateStrategy } from '../with-shape/schema-update/types.js';
|
|
75
62
|
import type { AttestationFieldSchema, RevocationList } from '@noy-db/attestation';
|
|
76
|
-
import { type AttestationStrategy } from '../with-audit/attestation/vault-facade.js';
|
|
77
|
-
import { type SealedRecordStrategy } from '../with-audit/sealed-record/strategy.js';
|
|
78
63
|
import type { DumpSchemaOptions, VaultSchemaSnapshot, SchemaIntrospection } from '../with-shape/introspection/types.js';
|
|
79
64
|
import type { VaultIntrospectState } from '../with-shape/introspection/walk.js';
|
|
80
65
|
import type { FieldMeta } from '../with-shape/introspection/field-meta.js';
|
|
81
66
|
import type { CollectionMeta, VaultMeta } from '../with-shape/introspection/meta.js';
|
|
82
|
-
import { type ClassifiedEntry
|
|
67
|
+
import { type ClassifiedEntry } from '../port/with/classified-strategy.js';
|
|
83
68
|
/** A vault (tenant namespace) containing collections. */
|
|
84
69
|
export declare class Vault {
|
|
85
70
|
#private;
|
|
@@ -99,36 +84,20 @@ export declare class Vault {
|
|
|
99
84
|
private readonly syncAdapter;
|
|
100
85
|
private readonly getPurgeableTargets;
|
|
101
86
|
private readonly historyConfig;
|
|
102
|
-
/**
|
|
103
|
-
*
|
|
104
|
-
|
|
87
|
+
/**
|
|
88
|
+
* Every opt-in service, resolved once by `createNoydb` (#838). Shared by
|
|
89
|
+
* reference with the owning `Noydb` and with every `Collection` this vault
|
|
90
|
+
* opens, so all three always agree about which services are enabled.
|
|
91
|
+
*/
|
|
92
|
+
private readonly strategies;
|
|
105
93
|
private readonly objectStore;
|
|
106
|
-
/** Cold-storage archival strategy (the archive target store). */
|
|
107
|
-
private readonly archiveStrategy;
|
|
108
94
|
/** Per-collection record archival policies. Indexed by collection name. */
|
|
109
95
|
private readonly archiveRegistry;
|
|
110
|
-
private readonly indexStrategy;
|
|
111
|
-
private readonly lazyStrategy;
|
|
112
|
-
private readonly aggregateStrategy;
|
|
113
|
-
private readonly crdtStrategy;
|
|
114
|
-
private readonly tiersStrategy;
|
|
115
|
-
private readonly searchStrategy;
|
|
116
|
-
/** Cargo (partition extraction) strategy — `NO_CARGO` (throwing) unless `withCargo()` was passed.
|
|
117
|
-
* Public so the `extractPartition` free function (which takes a `Vault`) routes through it. */
|
|
118
|
-
readonly cargoStrategy: CargoStrategy;
|
|
119
|
-
private readonly brokerStrategy;
|
|
120
|
-
private readonly sealedRecordStrategy;
|
|
121
|
-
private readonly portabilityStrategy;
|
|
122
|
-
private readonly sequenceStrategy;
|
|
123
|
-
private readonly consentStrategy;
|
|
124
96
|
private readonly periods;
|
|
125
97
|
private readonly linksEnforcer;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
private readonly i18nStrategy;
|
|
130
|
-
private readonly syncStrategy;
|
|
131
|
-
private readonly classifiedStrategy;
|
|
98
|
+
/** Cargo (partition extraction) strategy — `NO_CARGO` (throwing) unless `withCargo()` was passed.
|
|
99
|
+
* Public so the `extractPartition` free function (which takes a `Vault`) routes through it. */
|
|
100
|
+
get cargoStrategy(): CargoStrategy;
|
|
132
101
|
/** Per-vault guard registry; `null` until `_initGuards()` runs (or for vaults that never register
|
|
133
102
|
* one) — the runtime class is dynamic-imported on demand to keep it out of the floor bundle. */
|
|
134
103
|
private guardRegistry;
|
|
@@ -317,31 +286,15 @@ export declare class Vault {
|
|
|
317
286
|
* `undefined` => every `collection.blob(id)` throws with a pointer
|
|
318
287
|
* at `@noy-db/hub/blobs`.
|
|
319
288
|
*/
|
|
320
|
-
|
|
289
|
+
/**
|
|
290
|
+
* Every opt-in service, already resolved by `createNoydb` (#838). Not
|
|
291
|
+
* optional: a Vault cannot be built without it, which is what makes the
|
|
292
|
+
* partially-populated construction path of #834 unrepresentable.
|
|
293
|
+
*/
|
|
294
|
+
strategies: StrategyBag;
|
|
321
295
|
objectStore?: ObjectProjection | undefined;
|
|
322
|
-
archiveStrategy?: ArchiveStrategy | undefined;
|
|
323
|
-
indexStrategy?: IndexStrategy | undefined;
|
|
324
|
-
lazyStrategy?: LazyStrategy | undefined;
|
|
325
|
-
aggregateStrategy?: AggregateStrategy | undefined;
|
|
326
|
-
crdtStrategy?: CrdtStrategy | undefined;
|
|
327
|
-
tiersStrategy?: TiersStrategy | undefined;
|
|
328
|
-
searchStrategy?: SearchStrategy | undefined;
|
|
329
|
-
cargoStrategy?: CargoStrategy | undefined;
|
|
330
|
-
brokerStrategy?: BrokerStrategy | undefined;
|
|
331
|
-
consentStrategy?: ConsentStrategy | undefined;
|
|
332
|
-
periodsStrategy?: PeriodsStrategy | undefined;
|
|
333
|
-
shadowStrategy?: ShadowStrategy | undefined;
|
|
334
|
-
historyStrategy?: HistoryStrategy | undefined;
|
|
335
|
-
i18nStrategy?: I18nStrategy | undefined;
|
|
336
|
-
syncStrategy?: SyncStrategy | undefined;
|
|
337
296
|
guardStrategies?: ReadonlyArray<GuardStrategyHandleAny> | undefined;
|
|
338
297
|
numberingConfigs?: ReadonlyArray<DeferredNumberingConfig> | undefined;
|
|
339
|
-
forgetStrategy?: ForgetStrategy | undefined;
|
|
340
|
-
attestationStrategy?: AttestationStrategy | undefined;
|
|
341
|
-
classifiedStrategy?: ClassifiedStrategy | undefined;
|
|
342
|
-
sealedRecordStrategy?: SealedRecordStrategy | undefined;
|
|
343
|
-
portabilityStrategy?: PortabilityStrategy | undefined;
|
|
344
|
-
sequenceStrategy?: SequenceStrategy | undefined;
|
|
345
298
|
/** Vault-level descriptive metadata — set once at construction (first-wins). */
|
|
346
299
|
meta?: VaultMeta | undefined;
|
|
347
300
|
});
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Noydb,
|
|
3
3
|
createNoydb
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-W7TCXZWU.js";
|
|
5
5
|
import "./chunk-VYYM3MEN.js";
|
|
6
6
|
import "./chunk-NOT7XA7Q.js";
|
|
7
7
|
import "./chunk-QDNVHA2F.js";
|
|
8
8
|
import "./chunk-IUIVDVXM.js";
|
|
9
9
|
import "./chunk-L4OA7G5T.js";
|
|
10
10
|
import "./chunk-JA5B3SLH.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-JW3XCZA2.js";
|
|
12
12
|
import "./chunk-EDC6MLXV.js";
|
|
13
13
|
import "./chunk-GYGLAVCX.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-U73LHVPF.js";
|
|
15
15
|
import "./chunk-BCOKZC4B.js";
|
|
16
16
|
import "./chunk-AURFOK3D.js";
|
|
17
17
|
import "./chunk-WEC3JGBA.js";
|
|
18
18
|
import "./chunk-KMONEHDJ.js";
|
|
19
19
|
import "./chunk-XW7NWO4A.js";
|
|
20
20
|
import "./chunk-IZX3WZBF.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-5KI3REO3.js";
|
|
22
22
|
import "./chunk-GYB2QK5H.js";
|
|
23
23
|
import "./chunk-KR5EGWI4.js";
|
|
24
24
|
import "./chunk-GHVIKOHT.js";
|
|
@@ -26,7 +26,7 @@ import "./chunk-FLHOTGOO.js";
|
|
|
26
26
|
import "./chunk-E2R5NRZD.js";
|
|
27
27
|
import "./chunk-HGVFJL63.js";
|
|
28
28
|
import "./chunk-2ITLQZV5.js";
|
|
29
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-4X6DJZHY.js";
|
|
30
30
|
import "./chunk-OGFPMCSP.js";
|
|
31
31
|
import "./chunk-2KL6NDD4.js";
|
|
32
32
|
import "./chunk-CGPO3ZYB.js";
|
|
@@ -38,7 +38,7 @@ import "./chunk-25G7U6RD.js";
|
|
|
38
38
|
import "./chunk-BZEPJJOK.js";
|
|
39
39
|
import "./chunk-XGVDLQJE.js";
|
|
40
40
|
import "./chunk-STR7WBOB.js";
|
|
41
|
-
import "./chunk-
|
|
41
|
+
import "./chunk-QUIG6BZT.js";
|
|
42
42
|
import "./chunk-WJDYZP3U.js";
|
|
43
43
|
import "./chunk-7B4GPCX7.js";
|
|
44
44
|
import "./chunk-3O62PVDW.js";
|
|
@@ -67,4 +67,4 @@ export {
|
|
|
67
67
|
Noydb,
|
|
68
68
|
createNoydb
|
|
69
69
|
};
|
|
70
|
-
//# sourceMappingURL=noydb-
|
|
70
|
+
//# sourceMappingURL=noydb-N5IW6OFZ.js.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strategy seam between the kernel spine and the optional archive service
|
|
3
|
+
* (#838 — precedent: `port/with/blob-strategy.ts`). Lives on the `/with`
|
|
4
|
+
* port so `Vault` can hold the `NO_ARCHIVE` default without a
|
|
5
|
+
* spine→service static import.
|
|
6
|
+
*
|
|
7
|
+
* `archiveStrategy` was the one service with no NO-op stub: the spine held
|
|
8
|
+
* it as `ArchiveStrategy | undefined` and hand-rolled a null gate before
|
|
9
|
+
* every use. That made it the sole exception to the strategy-bag's "every
|
|
10
|
+
* key always resolves" rule (#838), so the stub exists to remove the
|
|
11
|
+
* exception rather than to add a capability.
|
|
12
|
+
*
|
|
13
|
+
* `ArchiveStrategy`'s only member is a live cold `NoydbStore`, and there is
|
|
14
|
+
* no meaningful no-op store — so the stub throws on access instead of
|
|
15
|
+
* standing in. That reproduces the previous gate exactly: `_archiveContext()`
|
|
16
|
+
* read `strategy.store` immediately after its null check, so the throw lands
|
|
17
|
+
* in the same call with the same message.
|
|
18
|
+
*
|
|
19
|
+
* The `ArchiveStrategy` import is TYPE-ONLY and therefore erased — importing
|
|
20
|
+
* it does not pull `with-fork/archive/index.js`'s runtime re-exports of the
|
|
21
|
+
* relocation engine.
|
|
22
|
+
*
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
import type { ArchiveStrategy } from '../../with-fork/archive/index.js';
|
|
26
|
+
/**
|
|
27
|
+
* The un-opted-in archive strategy. Reading `.store` throws with a pointer
|
|
28
|
+
* at the `withArchive()` factory — the archive service has no degraded mode
|
|
29
|
+
* to fall back to.
|
|
30
|
+
*/
|
|
31
|
+
export declare const NO_ARCHIVE: ArchiveStrategy;
|