@xnetjs/data 0.0.3 → 0.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.
- package/dist/account-MWNCH4GJ.js +12 -0
- package/dist/account-ledger-R2GAFJL6.js +38 -0
- package/dist/auth/index.d.ts +11 -4
- package/dist/auth/index.js +1 -1
- package/dist/budget-NN7P35XP.js +12 -0
- package/dist/canvas-6WYBNH53.js +10 -0
- package/dist/channel-AT3LQF4A.js +12 -0
- package/dist/chat-message-DSVO72B3.js +10 -0
- package/dist/{chunk-J6EDPPH4.js → chunk-2ZNJWIQG.js} +2 -2
- package/dist/{chunk-5FHJE7RC.js → chunk-3J3HILXO.js} +2 -2
- package/dist/{chunk-EZA5UT4Y.js → chunk-3RUDVTMH.js} +6 -6
- package/dist/{chunk-YEQ6LLUY.js → chunk-4EYKGTSQ.js} +2 -2
- package/dist/{chunk-L66WXPTW.js → chunk-53F4PRNC.js} +2 -2
- package/dist/{chunk-LGD72FVD.js → chunk-5EXHNXPL.js} +2 -2
- package/dist/{chunk-4U4KBCDN.js → chunk-5HC5NO57.js} +2 -2
- package/dist/{chunk-YWN27MLD.js → chunk-6KLGA6IR.js} +2 -2
- package/dist/{chunk-37267RSF.js → chunk-6OMG4I7M.js} +2 -2
- package/dist/{chunk-DOZJXPQ6.js → chunk-BQLQSWKZ.js} +2 -2
- package/dist/{chunk-V6HZ3LF3.js → chunk-BY5O6LNC.js} +1 -1
- package/dist/{chunk-64AM6JPM.js → chunk-DCTRX6II.js} +1 -1
- package/dist/{chunk-SPFKSTPT.js → chunk-DWEXKD6E.js} +2 -2
- package/dist/{chunk-O64EK5FK.js → chunk-EBNMV2VO.js} +11 -2
- package/dist/{chunk-QVZXXJSP.js → chunk-EI5CY2FZ.js} +524 -82
- package/dist/{chunk-J4IVJA5M.js → chunk-FVEACSKE.js} +2 -2
- package/dist/{chunk-XWA3CJQ6.js → chunk-GU6THOAB.js} +2 -2
- package/dist/{chunk-XTUGZSYQ.js → chunk-H4GA4BBK.js} +2 -2
- package/dist/{chunk-GR3NDMBY.js → chunk-IJ44LR7N.js} +2 -2
- package/dist/{chunk-E6S557NC.js → chunk-J4ANIXIV.js} +2 -2
- package/dist/{chunk-EIQX7INF.js → chunk-JDFNMFOZ.js} +2 -2
- package/dist/{chunk-PSUJEKVV.js → chunk-K7DOZWWT.js} +244 -155
- package/dist/{chunk-UDUPQKRB.js → chunk-KQAT4XBL.js} +2 -2
- package/dist/chunk-KQUALW4O.js +183 -0
- package/dist/{chunk-KPVBKKZS.js → chunk-LYSWLCOI.js} +2 -2
- package/dist/{chunk-YXZGYLKV.js → chunk-MBTUO3ZL.js} +2 -2
- package/dist/{chunk-7GMJOAPF.js → chunk-NI4FHG2K.js} +2 -2
- package/dist/{chunk-6OPZJ7MG.js → chunk-OCMSAKWV.js} +2 -2
- package/dist/{chunk-IP4BEVVD.js → chunk-OGJCRNGE.js} +2 -2
- package/dist/{chunk-6CN53PON.js → chunk-OPPHF3TF.js} +3 -3
- package/dist/{chunk-77UDLVQY.js → chunk-OSAWNZVM.js} +1 -1
- package/dist/{chunk-GWYVY2K4.js → chunk-PNESGUH5.js} +2 -2
- package/dist/{chunk-RSSZXCLL.js → chunk-Q3IEGH4B.js} +2 -2
- package/dist/{chunk-2DSDH2ZH.js → chunk-QJW5LDP4.js} +2 -2
- package/dist/{chunk-JESSJ5CZ.js → chunk-RL64OJJ5.js} +13 -3
- package/dist/{chunk-S4B5OPZU.js → chunk-S5RP5RKY.js} +1 -0
- package/dist/{chunk-4UQTURCD.js → chunk-S6U6TCMN.js} +2 -2
- package/dist/{chunk-C5IRSEEZ.js → chunk-SVNGSZZA.js} +2 -2
- package/dist/{chunk-ZICIXDEE.js → chunk-T5AZAOG5.js} +1 -1
- package/dist/{chunk-IJ675GJR.js → chunk-TCTZW4A6.js} +2 -2
- package/dist/{chunk-54Y7QRZN.js → chunk-U64CW73O.js} +2 -2
- package/dist/{chunk-3RB2FMMO.js → chunk-UQM3G5A2.js} +2 -2
- package/dist/{chunk-ENTHVNOC.js → chunk-VQ7JHB67.js} +2 -2
- package/dist/{chunk-JO6Y4E5V.js → chunk-W7EBL7ZU.js} +2 -2
- package/dist/{chunk-WUR3WWQM.js → chunk-WEPK7SZF.js} +2 -2
- package/dist/{chunk-3JKW6TDE.js → chunk-XMSKJ5PV.js} +2 -2
- package/dist/{chunk-WMSCEBFH.js → chunk-XROI44ZP.js} +2 -2
- package/dist/{chunk-CHZUSBSB.js → chunk-Y3S5SRVM.js} +2 -2
- package/dist/{chunk-KTJLFJEQ.js → chunk-YEFKQYKA.js} +2 -2
- package/dist/{chunk-DTPSTMUD.js → chunk-YSUIXD2Y.js} +2 -2
- package/dist/{chunk-ZMCO3O2Z.js → chunk-ZCOFZY5M.js} +2 -2
- package/dist/{chunk-U6CBYDVZ.js → chunk-ZLU4Y3O2.js} +2 -2
- package/dist/{chunk-337E3ZOB.js → chunk-ZPZ7XDA6.js} +2 -2
- package/dist/{chunk-6GB7PBCR.js → chunk-ZZ6TWKGS.js} +2 -2
- package/dist/{clone-DpbVKLUu.d.ts → clone-C0Jhk2UN.d.ts} +2 -2
- package/dist/comment-QSWYAQVS.js +10 -0
- package/dist/{crm-AAJXYIJY.js → crm-L5RYAAF3.js} +5 -5
- package/dist/dashboard-JMKTTRA7.js +10 -0
- package/dist/database/index.d.ts +3 -3
- package/dist/database/index.js +11 -11
- package/dist/database-GIXSPZJW.js +10 -0
- package/dist/database-field-3EPAMZUR.js +10 -0
- package/dist/database-row-6Q6TRVE4.js +10 -0
- package/dist/database-select-option-BBBJFLLH.js +10 -0
- package/dist/database-view-5PLSOBI2.js +10 -0
- package/dist/experiment-DOVOZ34Y.js +10 -0
- package/dist/{external-item-D654PKLI.js → external-item-P2E5X7BZ.js} +5 -5
- package/dist/external-reference-7BSFF6SA.js +8 -0
- package/dist/feed-2IXHHP6O.js +12 -0
- package/dist/feed-item-DPE6LN7I.js +12 -0
- package/dist/{folder-ONKSWHUT.js → folder-6KM3KYD5.js} +3 -3
- package/dist/{game-BF7DP5JU.js → game-5AK5XWBR.js} +5 -5
- package/dist/grant-WTQSNT5A.js +8 -0
- package/dist/{grant-expiration-cleaner-DBiNTWbD.d.ts → grant-expiration-cleaner-CY6BcmlR.d.ts} +2 -2
- package/dist/import-batch-IXBJLQPJ.js +12 -0
- package/dist/{inbox-state-AN6FPCIY.js → inbox-state-E5NSVOGP.js} +3 -3
- package/dist/index.d.ts +7 -7
- package/dist/index.js +101 -55
- package/dist/map-RG5Y3CPC.js +10 -0
- package/dist/media-asset-QTCGLIZA.js +8 -0
- package/dist/{memory-NV6EVJBE.js → memory-PNRTMBZO.js} +3 -3
- package/dist/metric-65SVOX5C.js +10 -0
- package/dist/milestone-XEO6ZGDG.js +12 -0
- package/dist/{moderation-QSUVBCNS.js → moderation-FFHETMRB.js} +3 -3
- package/dist/observation-2Y3QKUXM.js +10 -0
- package/dist/page-2V27JGKJ.js +10 -0
- package/dist/posting-GBOSZCMZ.js +12 -0
- package/dist/profile-BLLDWIDK.js +8 -0
- package/dist/project-CQL5LN26.js +10 -0
- package/dist/{query-ast-CWo6_30h.d.ts → query-ast-C3m6kZYv.d.ts} +1 -1
- package/dist/reaction-T2DTJBBV.js +10 -0
- package/dist/{registry-CQoN_p8U.d.ts → registry-DunPv__d.d.ts} +1 -1
- package/dist/saved-view-4R2DBCL3.js +10 -0
- package/dist/schema/index.d.ts +320 -13
- package/dist/schema/index.js +98 -52
- package/dist/{schema-extension-5BUXRDPB.js → schema-extension-LNRF2YRD.js} +5 -5
- package/dist/{space-PZ737CIS.js → space-IJU24PBH.js} +6 -6
- package/dist/{space-membership-N35NRX6F.js → space-membership-DEUMM7NV.js} +3 -3
- package/dist/store/index.d.ts +153 -7
- package/dist/store/index.js +5 -5
- package/dist/{store-CvgiydME.d.ts → store-DtIDjk7c.d.ts} +18 -1
- package/dist/{system-Q5I6STDC.js → system-ILHCZOVO.js} +3 -3
- package/dist/{tag-C677GKQW.js → tag-SKCHM3U5.js} +3 -3
- package/dist/{task-WQLMPN5U.js → task-7AOBP7WC.js} +5 -5
- package/dist/task-view-NUGKELJP.js +10 -0
- package/dist/transaction-ZDSEGDIR.js +12 -0
- package/dist/transcription-PSCLDAGX.js +12 -0
- package/dist/{types-Def-5Nka.d.ts → types-S-BJAKyK.d.ts} +53 -2
- package/dist/user-widget-RLY2N46A.js +8 -0
- package/package.json +7 -7
- package/dist/account-BZHETMC4.js +0 -12
- package/dist/budget-WR2Q4YH3.js +0 -12
- package/dist/canvas-HFMMVQLD.js +0 -10
- package/dist/channel-DXDYJ3ZH.js +0 -12
- package/dist/chat-message-QUUQGXEW.js +0 -10
- package/dist/comment-Y2Y3QYYI.js +0 -10
- package/dist/dashboard-3DC6B4BJ.js +0 -10
- package/dist/database-DRGL5UYS.js +0 -10
- package/dist/database-field-F47FY3XX.js +0 -10
- package/dist/database-row-77OXW2NF.js +0 -10
- package/dist/database-select-option-6S3TTA7A.js +0 -10
- package/dist/database-view-YW7DQG5X.js +0 -10
- package/dist/experiment-TJOAL3OH.js +0 -10
- package/dist/external-reference-K5SUJIQN.js +0 -8
- package/dist/feed-L23XTNDI.js +0 -12
- package/dist/feed-item-GSO242J6.js +0 -12
- package/dist/grant-NNKMWXPX.js +0 -8
- package/dist/import-batch-JMESZ4VI.js +0 -12
- package/dist/map-AUV65YS3.js +0 -10
- package/dist/media-asset-4I5YPR4R.js +0 -8
- package/dist/metric-X7W55DLC.js +0 -10
- package/dist/milestone-JJGOGK4R.js +0 -12
- package/dist/observation-UZSXXGBC.js +0 -10
- package/dist/page-NI7XODS6.js +0 -10
- package/dist/posting-FZOYVGH2.js +0 -12
- package/dist/profile-42A43GES.js +0 -8
- package/dist/project-G2CTLDXY.js +0 -10
- package/dist/reaction-VAQBVDUD.js +0 -10
- package/dist/saved-view-AOQHGHNM.js +0 -10
- package/dist/task-view-T5S32V4L.js +0 -10
- package/dist/transaction-U3ITRGJP.js +0 -12
- package/dist/transcription-F3T23LLO.js +0 -12
- package/dist/user-widget-4SJJFPG5.js +0 -8
package/dist/store/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { g as NodeStorageAdapter, r as NodeChange, i as NodeId, h as NodeState, aa as NodeBatchPreflightResult, a3 as ImportNodesOptions, a5 as ApplyNodeBatchInput, a6 as ApplyNodeBatchResult, L as ListNodesOptions, ae as CountNodesOptions, a2 as SetNodeOptions, j as NodeQueryDescriptor, k as NodeQueryResult, S as SchemaIRI, a4 as RebuildNodeIndexesOptions } from '../types-
|
|
2
|
-
export { av as ConflictResult, ay as ContentKeyCache, C as CreateNodeOptions, ab as DeterministicNodeBatchWriteInput, m as DeterministicNodeImportDraft, G as GetWithMigrationOptions, n as ImportDeterministicNodesOptions, o as ImportDeterministicNodesResult, s as MergeConflict, M as MigratedNodeState, az as MigrationInfo, aw as NodeBatchChangeEvent, u as NodeBatchChangeListener, a7 as NodeBatchIndexMode, a8 as NodeBatchNotificationMode, a9 as NodeBatchSyncMode, p as NodeBatchWriteInput, ac as NodeBatchWritePolicy, q as NodeBatchWriteResult, ad as NodeBatchWriteTimings, v as NodeChangeEvent, t as NodeChangeListener, ax as NodeContentCipher, a0 as NodePayload, ar as NodeQueryCursor, aq as NodeQueryCursorOrderEntry, ao as NodeQueryMaterializedViewOptions, as as NodeQueryOptions, N as NodeQueryPageCountMode, ap as NodeQueryPageOptions, au as NodeQueryParityCheckMetadata, at as NodeQueryPlanMetadata, am as NodeQuerySearchField, an as NodeQuerySearchFilter, al as NodeQuerySpatialFilter, af as NodeQuerySpatialPoint, ah as NodeQuerySpatialPointFields, ak as NodeQuerySpatialRadius, ag as NodeQuerySpatialRect, ai as NodeQuerySpatialRectFields, aj as NodeQuerySpatialWindow, f as NodeStoreOptions,
|
|
3
|
-
export { G as QUERY_AST_VERSION, r as QueryAST, n as QueryASTAggregate, A as QueryASTAggregateExecution, m as QueryASTAggregateFunction, y as QueryASTAggregateGroup, x as QueryASTAggregatePlan, z as QueryASTAggregateResult, d as QueryASTComparisonPredicate, e as QueryASTCompoundPredicate, a as QueryASTField, l as QueryASTIncludes, p as QueryASTNodeQuery, s as QueryASTNodeQueryOptions, f as QueryASTNotPredicate, c as QueryASTOperator, h as QueryASTOrderBy, i as QueryASTPage, B as QueryASTPlannerGate, g as QueryASTPredicate, q as QueryASTQuerySet, o as QueryASTQuerySetAggregate, j as QueryASTRelationDirection, k as QueryASTRelationInclude, t as QueryASTRelationIncludeOptions, w as QueryASTRelationIndexRequirement, b as QueryASTSchemaInput, u as QueryASTValidationError, v as QueryASTValidationResult, Q as QueryASTVersion, S as SavedViewDescriptor, F as SavedViewFeedDensity, E as SavedViewFeedLayout, C as SavedViewPresentationHint, D as SavedViewPresentationHintMode, V as and, a3 as avg, N as between, P as contains, a0 as count, a1 as countDistinct, a9 as dashboardQuerySet, Z as defineNodeQueryAST, a8 as defineQuerySetAST, ab as defineSavedViewDescriptor, H as eq, aj as evaluateQueryASTPlannerGate, af as executeQueryASTLoadedAggregates, ag as filterQueryASTLoadedRows, _ as follow, $ as from, ah as getQueryASTRelationIndexRequirements, a6 as groupBy, J as gt, K as gte, a7 as having, O as includesAny, U as isNotNull, T as isNull, L as lt, M as lte, ai as matchesQueryASTLoadedRow, a5 as max, a4 as min, I as neq, X as not, W as or, ae as planQueryASTAggregates, Y as queryOperators, aa as querySetCount, R as startsWith, a2 as sum, ac as validateQueryAST, ad as validateSavedViewDescriptor } from '../query-ast-
|
|
4
|
-
export { N as NodeStore } from '../store-
|
|
1
|
+
import { g as NodeStorageAdapter, r as NodeChange, i as NodeId, h as NodeState, aa as NodeBatchPreflightResult, a3 as ImportNodesOptions, a5 as ApplyNodeBatchInput, a6 as ApplyNodeBatchResult, L as ListNodesOptions, ae as CountNodesOptions, a2 as SetNodeOptions, j as NodeQueryDescriptor, k as NodeQueryResult, S as SchemaIRI, a4 as RebuildNodeIndexesOptions, bi as NodeReadAuthorizer, bj as AuthorizationStateVersion } from '../types-S-BJAKyK.js';
|
|
2
|
+
export { av as ConflictResult, ay as ContentKeyCache, C as CreateNodeOptions, ab as DeterministicNodeBatchWriteInput, m as DeterministicNodeImportDraft, G as GetWithMigrationOptions, n as ImportDeterministicNodesOptions, o as ImportDeterministicNodesResult, s as MergeConflict, M as MigratedNodeState, az as MigrationInfo, aw as NodeBatchChangeEvent, u as NodeBatchChangeListener, a7 as NodeBatchIndexMode, a8 as NodeBatchNotificationMode, a9 as NodeBatchSyncMode, p as NodeBatchWriteInput, ac as NodeBatchWritePolicy, q as NodeBatchWriteResult, ad as NodeBatchWriteTimings, v as NodeChangeEvent, t as NodeChangeListener, ax as NodeContentCipher, a0 as NodePayload, ar as NodeQueryCursor, aq as NodeQueryCursorOrderEntry, ao as NodeQueryMaterializedViewOptions, as as NodeQueryOptions, N as NodeQueryPageCountMode, ap as NodeQueryPageOptions, au as NodeQueryParityCheckMetadata, at as NodeQueryPlanMetadata, am as NodeQuerySearchField, an as NodeQuerySearchFilter, al as NodeQuerySpatialFilter, af as NodeQuerySpatialPoint, ah as NodeQuerySpatialPointFields, ak as NodeQuerySpatialRadius, ag as NodeQuerySpatialRect, ai as NodeQuerySpatialRectFields, aj as NodeQuerySpatialWindow, f as NodeStoreOptions, bk as OperationNodeBatchWriteInput, $ as PropertyKey, bl as PropertyLookup, a1 as PropertyTimestamp, aR as SchemaLookup, c as SortDirection, d as SystemOrderField, aO as TEMP_ID_PREFIX, aS as TempIdResolution, T as TransactionOperation, l as TransactionResult, U as UpdateNodeOptions, aI as applyNodeQueryDescriptor, aA as createNodeQueryDescriptor, bm as createPropertyLookup, aQ as createSchemaLookup, aC as decodeNodeQueryCursor, aB as encodeNodeQueryCursor, aG as filterNodeQueryResults, aJ as getNodeQuerySearchTokens, aN as isTempId, aF as matchesNodeQueryDescriptor, aK as nodeQueryDescriptorNeedsBoundedReload, aD as nodeQueryDescriptorToOptions, aP as resolveTempIds, aE as serializeNodeQueryDescriptor, aH as sortNodeQueryResults, aM as withoutNodeQueryMaterializedView, aL as withoutNodeQueryPagination } from '../types-S-BJAKyK.js';
|
|
3
|
+
export { G as QUERY_AST_VERSION, r as QueryAST, n as QueryASTAggregate, A as QueryASTAggregateExecution, m as QueryASTAggregateFunction, y as QueryASTAggregateGroup, x as QueryASTAggregatePlan, z as QueryASTAggregateResult, d as QueryASTComparisonPredicate, e as QueryASTCompoundPredicate, a as QueryASTField, l as QueryASTIncludes, p as QueryASTNodeQuery, s as QueryASTNodeQueryOptions, f as QueryASTNotPredicate, c as QueryASTOperator, h as QueryASTOrderBy, i as QueryASTPage, B as QueryASTPlannerGate, g as QueryASTPredicate, q as QueryASTQuerySet, o as QueryASTQuerySetAggregate, j as QueryASTRelationDirection, k as QueryASTRelationInclude, t as QueryASTRelationIncludeOptions, w as QueryASTRelationIndexRequirement, b as QueryASTSchemaInput, u as QueryASTValidationError, v as QueryASTValidationResult, Q as QueryASTVersion, S as SavedViewDescriptor, F as SavedViewFeedDensity, E as SavedViewFeedLayout, C as SavedViewPresentationHint, D as SavedViewPresentationHintMode, V as and, a3 as avg, N as between, P as contains, a0 as count, a1 as countDistinct, a9 as dashboardQuerySet, Z as defineNodeQueryAST, a8 as defineQuerySetAST, ab as defineSavedViewDescriptor, H as eq, aj as evaluateQueryASTPlannerGate, af as executeQueryASTLoadedAggregates, ag as filterQueryASTLoadedRows, _ as follow, $ as from, ah as getQueryASTRelationIndexRequirements, a6 as groupBy, J as gt, K as gte, a7 as having, O as includesAny, U as isNotNull, T as isNull, L as lt, M as lte, ai as matchesQueryASTLoadedRow, a5 as max, a4 as min, I as neq, X as not, W as or, ae as planQueryASTAggregates, Y as queryOperators, aa as querySetCount, R as startsWith, a2 as sum, ac as validateQueryAST, ad as validateSavedViewDescriptor } from '../query-ast-C3m6kZYv.js';
|
|
4
|
+
export { N as NodeStore } from '../store-DtIDjk7c.js';
|
|
5
5
|
import { AuthAction, DID, AuthDenyReason, AuthDecision, ContentId } from '@xnetjs/core';
|
|
6
6
|
import { SQLiteAdapter, SQLiteOperationStats } from '@xnetjs/sqlite';
|
|
7
7
|
import '@xnetjs/crypto';
|
|
@@ -120,11 +120,30 @@ interface SQLiteNodeStorageAdapterOptions {
|
|
|
120
120
|
adaptiveIndexing?: SQLiteAdaptiveIndexingOptions;
|
|
121
121
|
queryVerification?: SQLiteQueryVerificationOptions;
|
|
122
122
|
/**
|
|
123
|
-
* Collect EXPLAIN QUERY PLAN + index inventory
|
|
124
|
-
* round trips
|
|
125
|
-
* `xnet:query:debug` localStorage flag is set.
|
|
123
|
+
* Collect EXPLAIN QUERY PLAN + index inventory for queries. Costs extra
|
|
124
|
+
* round trips, so it is off unless explicitly enabled or the
|
|
125
|
+
* `xnet:query:debug` localStorage flag is set. Diagnostics are collected
|
|
126
|
+
* once per unique compiled SQL shape per session (invalidated when the
|
|
127
|
+
* adapter itself runs DDL) — per-execution collection convoyed the serial
|
|
128
|
+
* worker and delayed the very queries being measured by 18-20s at boot
|
|
129
|
+
* (2026-07-05 capture).
|
|
126
130
|
*/
|
|
127
131
|
queryDiagnostics?: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Hydrate via SQL-side `json_group_object` aggregation — ONE row per node
|
|
134
|
+
* instead of one row per (node × property) — collapsing the boundary
|
|
135
|
+
* payload before it leaves SQLite (exploration 0264, Wave 2). Off by
|
|
136
|
+
* default while the mode is benchmarked; correctness is verified equal by
|
|
137
|
+
* the hydration test suite in both modes.
|
|
138
|
+
*/
|
|
139
|
+
aggregatedHydration?: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Defer maintenance work (adaptive index creation) to an idle scheduler
|
|
142
|
+
* instead of running it inline on the query path. The web app passes a
|
|
143
|
+
* bootSettled-gated scheduler — no background work is free on the single
|
|
144
|
+
* serial SQLite worker (exploration 0260/0264). Default: run inline.
|
|
145
|
+
*/
|
|
146
|
+
scheduleMaintenance?: (task: () => Promise<void> | void) => void;
|
|
128
147
|
}
|
|
129
148
|
/**
|
|
130
149
|
* SQLite-backed storage adapter for NodeStore.
|
|
@@ -152,13 +171,34 @@ declare class SQLiteNodeStorageAdapter implements NodeStorageAdapter {
|
|
|
152
171
|
private adaptiveIndexing;
|
|
153
172
|
private queryVerification;
|
|
154
173
|
private queryDiagnostics;
|
|
174
|
+
/** Hydrate one row per node via json_group_object (0264 Wave 2 flag). */
|
|
175
|
+
private aggregatedHydration;
|
|
176
|
+
/** Idle scheduler for maintenance work (adaptive index creation, 0264). */
|
|
177
|
+
private scheduleMaintenance?;
|
|
155
178
|
private pendingQueryTelemetry;
|
|
156
179
|
private pendingQueryTelemetryHits;
|
|
157
180
|
private adaptiveIndexBudgetColumnsReady;
|
|
158
181
|
private storageCapabilitiesPromise?;
|
|
182
|
+
/**
|
|
183
|
+
* Plan diagnostics memoized per compiled SQL shape (the string EXPLAINed),
|
|
184
|
+
* shared across executions AND concurrent callers. Cleared when this adapter
|
|
185
|
+
* creates/drops an adaptive index, since that changes plans. Debug mode must
|
|
186
|
+
* not distort what it measures: per-execution EXPLAIN + index-inventory
|
|
187
|
+
* round-trips convoyed the single serial worker at boot.
|
|
188
|
+
*/
|
|
189
|
+
private compiledQueryDiagnosticsMemo;
|
|
159
190
|
private spatialTablesState;
|
|
160
191
|
private fullTextSearchTablesState;
|
|
161
192
|
private writeQueue;
|
|
193
|
+
/**
|
|
194
|
+
* Read-authorization filter applied before persisting a materialized view's
|
|
195
|
+
* id list (exploration 0226). Wired by `NodeStore` when an auth evaluator is
|
|
196
|
+
* present; `undefined` means materialized views are computed unauthorized
|
|
197
|
+
* (the trusted single-user case).
|
|
198
|
+
*/
|
|
199
|
+
private nodeReadAuthorizer?;
|
|
200
|
+
/** One-time guard: ensure the `auth_fingerprint` column exists on upgraded DBs. */
|
|
201
|
+
private materializationColumnsReady;
|
|
162
202
|
constructor(db: SQLiteAdapter, options?: SQLiteNodeStorageAdapterOptions);
|
|
163
203
|
getSQLiteAdapter(): SQLiteAdapter;
|
|
164
204
|
open(): Promise<void>;
|
|
@@ -178,6 +218,37 @@ declare class SQLiteNodeStorageAdapter implements NodeStorageAdapter {
|
|
|
178
218
|
getChanges(nodeId: NodeId): Promise<NodeChange[]>;
|
|
179
219
|
getAllChanges(): Promise<NodeChange[]>;
|
|
180
220
|
getChangesSince(sinceLamport: number): Promise<NodeChange[]>;
|
|
221
|
+
/**
|
|
222
|
+
* Compact the local change log (exploration 0254 / F3): delete only
|
|
223
|
+
* *superseded* history so the OPFS file shrinks (fast cold open) and the
|
|
224
|
+
* outbound-resync slice shrinks (cheap first sync), without affecting reads,
|
|
225
|
+
* outbound sync, hash-chain chaining, or convergence with peers that never
|
|
226
|
+
* compacted.
|
|
227
|
+
*
|
|
228
|
+
* A row is deleted iff ALL of:
|
|
229
|
+
* - `lamport_time < wsafe` — below the confirmed-durable floor, so the hub
|
|
230
|
+
* holds it and it is not part of the unconfirmed outbound tail (K1);
|
|
231
|
+
* - it is NOT a node's hash-chain tip — we keep every row at a node's
|
|
232
|
+
* `MAX(lamport_time)` (the whole tie group), so `getLastChange()` still
|
|
233
|
+
* returns a real tip and the next write's `parentHash`/hash/signature are
|
|
234
|
+
* byte-identical to an uncompacted peer's (K2);
|
|
235
|
+
* - it backs NO currently-winning LWW value — its `(node_id, lamport_time,
|
|
236
|
+
* author)` is not the provenance of any live `node_properties` row (K3).
|
|
237
|
+
*
|
|
238
|
+
* K3 is the load-bearing safety net: because every live projection value keeps
|
|
239
|
+
* its backing row, the retained log still materialises to — and can re-push —
|
|
240
|
+
* the exact current state, so a stranded/rolled-back peer never loses live
|
|
241
|
+
* data. Reads are unaffected (they read the materialized `nodes`/
|
|
242
|
+
* `node_properties`, never the log). Only rows are deleted, never rewritten
|
|
243
|
+
* (the hash + signature are immutable and unforgeable). Runs chunked inside
|
|
244
|
+
* the write lane, yields between chunks, and never throws.
|
|
245
|
+
*/
|
|
246
|
+
pruneSupersededChanges(wsafe: number, options?: {
|
|
247
|
+
chunk?: number;
|
|
248
|
+
maxRows?: number;
|
|
249
|
+
}): Promise<{
|
|
250
|
+
deleted: number;
|
|
251
|
+
}>;
|
|
181
252
|
getChangeByHash(hash: ContentId): Promise<NodeChange | null>;
|
|
182
253
|
getLastChange(nodeId: NodeId): Promise<NodeChange | null>;
|
|
183
254
|
getLastChangesByNodeId(nodeIds: readonly NodeId[]): Promise<Map<NodeId, NodeChange>>;
|
|
@@ -206,7 +277,19 @@ declare class SQLiteNodeStorageAdapter implements NodeStorageAdapter {
|
|
|
206
277
|
private setLastLamportTimeInternal;
|
|
207
278
|
private syncCursorKey;
|
|
208
279
|
getSyncCursor(room: string): Promise<number>;
|
|
280
|
+
/**
|
|
281
|
+
* The lowest confirmed-durable sync cursor across every node-change room
|
|
282
|
+
* (`MIN` over the persisted `nodeSync:hwm:*` marks), or `null` when no room has
|
|
283
|
+
* ever confirmed. This is the safe compaction floor (exploration 0254): the
|
|
284
|
+
* hub durably holds every change at or below it. Returns `null` — never 0 — so
|
|
285
|
+
* a workspace that has never synced is left untouched.
|
|
286
|
+
*/
|
|
287
|
+
getMinConfirmedSyncCursor(): Promise<number | null>;
|
|
209
288
|
setSyncCursor(room: string, lamport: number): Promise<void>;
|
|
289
|
+
/** Namespace app-state keys so they can't collide with sync cursors. */
|
|
290
|
+
private appStateKey;
|
|
291
|
+
getAppState(key: string): Promise<string | null>;
|
|
292
|
+
setAppState(key: string, value: string): Promise<void>;
|
|
210
293
|
getDocumentContent(nodeId: NodeId): Promise<Uint8Array | null>;
|
|
211
294
|
setDocumentContent(nodeId: NodeId, content: Uint8Array): Promise<void>;
|
|
212
295
|
private setDocumentContentInternal;
|
|
@@ -296,9 +379,49 @@ declare class SQLiteNodeStorageAdapter implements NodeStorageAdapter {
|
|
|
296
379
|
*/
|
|
297
380
|
clear(): Promise<void>;
|
|
298
381
|
private hydrateJoinedRows;
|
|
382
|
+
private buildHydrateChunkQuery;
|
|
299
383
|
private hydrateNodesByIds;
|
|
384
|
+
/**
|
|
385
|
+
* Aggregated hydrate (exploration 0264, Wave 2): collapse the EAV rows to
|
|
386
|
+
* ONE row per node inside SQL via `json_group_object`, so the boundary
|
|
387
|
+
* ships N rows instead of N × properties. `value` is stored as JSON text
|
|
388
|
+
* in a BLOB — `json(CAST(… AS TEXT))` re-emits it as real JSON inside the
|
|
389
|
+
* aggregate (without the cast/wrap it would double-encode as a string).
|
|
390
|
+
*/
|
|
391
|
+
private buildAggregatedHydrateChunkQuery;
|
|
392
|
+
/** Parse one-row-per-node aggregated hydrate results into NodeStates. */
|
|
393
|
+
private hydrateAggregatedRows;
|
|
394
|
+
/**
|
|
395
|
+
* Read (or refresh) a materialized view.
|
|
396
|
+
*
|
|
397
|
+
* A materialized view is a purely LOCAL, DERIVED cache: an ordered list of
|
|
398
|
+
* node ids (membership + order) plus bookkeeping. It is NEVER part of the
|
|
399
|
+
* change log and is NEVER synced — peers each derive their own. It therefore
|
|
400
|
+
* carries no authority and can be rebuilt or dropped at any time (a wiped
|
|
401
|
+
* cache only costs a recompute, never data). Content is re-hydrated from the
|
|
402
|
+
* live `nodes`/`node_properties` tables on every read, so the cache exposes
|
|
403
|
+
* nothing the underlying tables don't already, and a write to the schema
|
|
404
|
+
* (`invalidated_at`) or a grant change (`auth_fingerprint`) forces a
|
|
405
|
+
* re-materialization. See exploration 0226.
|
|
406
|
+
*/
|
|
300
407
|
private queryMaterializedView;
|
|
301
408
|
private getMaterializedView;
|
|
409
|
+
/**
|
|
410
|
+
* Ensure the `auth_fingerprint` column exists. Fresh databases get it from
|
|
411
|
+
* the DDL; databases upgraded in place (the runtime applies the full DDL with
|
|
412
|
+
* `CREATE TABLE IF NOT EXISTS`, which cannot add a column) need this guard.
|
|
413
|
+
* Idempotent and memoized (exploration 0226).
|
|
414
|
+
*/
|
|
415
|
+
private ensureMaterializationColumns;
|
|
416
|
+
setNodeReadAuthorizer(authorizer: NodeReadAuthorizer | undefined): void;
|
|
417
|
+
/**
|
|
418
|
+
* Reload-stable version of the authorization-relevant control-plane state:
|
|
419
|
+
* grants (`Grant` schema) and per-subject `/sys/authz/` resources. Ordinary
|
|
420
|
+
* data writes do not touch these, so a database's materialized views survive
|
|
421
|
+
* reloads and edits, but any grant change shifts `count`/`maxUpdatedAt` and
|
|
422
|
+
* forces an `'authz-changed'` refresh (exploration 0226).
|
|
423
|
+
*/
|
|
424
|
+
getAuthorizationStateVersion(): Promise<AuthorizationStateVersion>;
|
|
302
425
|
private refreshMaterializedView;
|
|
303
426
|
private readMaterializedViewPage;
|
|
304
427
|
private invalidateMaterializedViewsForSchema;
|
|
@@ -338,7 +461,14 @@ declare class SQLiteNodeStorageAdapter implements NodeStorageAdapter {
|
|
|
338
461
|
flushQueryTelemetry(): Promise<void>;
|
|
339
462
|
private writeQueryTelemetryRow;
|
|
340
463
|
private isQueryDiagnosticsEnabled;
|
|
464
|
+
/**
|
|
465
|
+
* Throttled: one collection per unique compiled SQL shape per session.
|
|
466
|
+
* EXPLAIN plans depend on the statement, not the bound values, so keyset
|
|
467
|
+
* pages of the same query share one entry. Concurrent callers share the
|
|
468
|
+
* in-flight promise; failed collections are not memoized.
|
|
469
|
+
*/
|
|
341
470
|
private collectCompiledQueryDiagnostics;
|
|
471
|
+
private computeCompiledQueryDiagnostics;
|
|
342
472
|
private getStorageCapabilities;
|
|
343
473
|
private debugQueryPlan;
|
|
344
474
|
private isQueryDebugEnabled;
|
|
@@ -362,9 +492,25 @@ declare class SQLiteNodeStorageAdapter implements NodeStorageAdapter {
|
|
|
362
492
|
private getAdaptiveIndexColumns;
|
|
363
493
|
private countCompiledNodeQuery;
|
|
364
494
|
private compileNodeQuery;
|
|
495
|
+
/**
|
|
496
|
+
* A custom-property sort can push down when it is the descriptor's ONLY
|
|
497
|
+
* order key and no cursor/spatial/search accelerator is in play. Gated on
|
|
498
|
+
* the adaptive-indexing flag: the typed partial indexes on
|
|
499
|
+
* `node_property_scalars` make the join+order cheap, and the flag keeps
|
|
500
|
+
* the behavioural change opt-in while it soaks (exploration 0264).
|
|
501
|
+
*/
|
|
502
|
+
private resolvePropertySortPushdown;
|
|
365
503
|
private compileSqlQuery;
|
|
366
504
|
private getCompiledPostFilterReason;
|
|
367
505
|
private appendScalarPredicate;
|
|
506
|
+
/**
|
|
507
|
+
* ORDER BY for a pushed-down custom-property sort (0264). Mirrors the JS
|
|
508
|
+
* comparator in `applyNodeQueryDescriptor`: missing properties sort last
|
|
509
|
+
* ascending / first descending; typed value columns carry the order (for a
|
|
510
|
+
* homogeneous property exactly one is non-NULL). `n.id` breaks ties so the
|
|
511
|
+
* page boundary is a total order.
|
|
512
|
+
*/
|
|
513
|
+
private buildPropertySortOrderBy;
|
|
368
514
|
private buildSqlOrderBy;
|
|
369
515
|
private hasOnlySystemOrdering;
|
|
370
516
|
private serializePayload;
|
package/dist/store/index.js
CHANGED
|
@@ -49,7 +49,7 @@ import {
|
|
|
49
49
|
sum,
|
|
50
50
|
validateQueryAST,
|
|
51
51
|
validateSavedViewDescriptor
|
|
52
|
-
} from "../chunk-
|
|
52
|
+
} from "../chunk-EI5CY2FZ.js";
|
|
53
53
|
import {
|
|
54
54
|
applyNodeQueryDescriptor,
|
|
55
55
|
createNodeQueryDescriptor,
|
|
@@ -64,10 +64,10 @@ import {
|
|
|
64
64
|
sortNodeQueryResults,
|
|
65
65
|
withoutNodeQueryMaterializedView,
|
|
66
66
|
withoutNodeQueryPagination
|
|
67
|
-
} from "../chunk-
|
|
68
|
-
import "../chunk-
|
|
69
|
-
import "../chunk-
|
|
70
|
-
import "../chunk-
|
|
67
|
+
} from "../chunk-S5RP5RKY.js";
|
|
68
|
+
import "../chunk-BY5O6LNC.js";
|
|
69
|
+
import "../chunk-EBNMV2VO.js";
|
|
70
|
+
import "../chunk-RL64OJJ5.js";
|
|
71
71
|
export {
|
|
72
72
|
MemoryNodeStorageAdapter,
|
|
73
73
|
NodeStore,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { e as StoreAuthAPI, f as NodeStoreOptions, g as NodeStorageAdapter, C as CreateNodeOptions, h as NodeState, i as NodeId, G as GetWithMigrationOptions, M as MigratedNodeState, U as UpdateNodeOptions, L as ListNodesOptions, j as NodeQueryDescriptor, k as NodeQueryResult, T as TransactionOperation, l as TransactionResult, m as DeterministicNodeImportDraft, n as ImportDeterministicNodesOptions, o as ImportDeterministicNodesResult, p as NodeBatchWriteInput, q as NodeBatchWriteResult, S as SchemaIRI, r as NodeChange, s as MergeConflict, t as NodeChangeListener, u as NodeBatchChangeListener } from './types-
|
|
1
|
+
import { e as StoreAuthAPI, f as NodeStoreOptions, g as NodeStorageAdapter, C as CreateNodeOptions, h as NodeState, i as NodeId, G as GetWithMigrationOptions, M as MigratedNodeState, U as UpdateNodeOptions, L as ListNodesOptions, j as NodeQueryDescriptor, k as NodeQueryResult, T as TransactionOperation, l as TransactionResult, m as DeterministicNodeImportDraft, n as ImportDeterministicNodesOptions, o as ImportDeterministicNodesResult, p as NodeBatchWriteInput, q as NodeBatchWriteResult, S as SchemaIRI, r as NodeChange, s as MergeConflict, t as NodeChangeListener, u as NodeBatchChangeListener } from './types-S-BJAKyK.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* NodeStore - Event-sourced storage for Nodes
|
|
@@ -323,6 +323,23 @@ declare class NodeStore {
|
|
|
323
323
|
private assertAuthorized;
|
|
324
324
|
private canReadNode;
|
|
325
325
|
private filterReadableNodes;
|
|
326
|
+
/**
|
|
327
|
+
* Whether storage can safely materialize a view under read authorization
|
|
328
|
+
* (exploration 0226): it must both accept the read authorizer (to authorize
|
|
329
|
+
* the id list at refresh) and expose a reload-stable authorization-state
|
|
330
|
+
* version (to fingerprint cache validity). When either is missing the store
|
|
331
|
+
* falls back to the authorize-then-paginate path, which never caches.
|
|
332
|
+
*/
|
|
333
|
+
private materializedAuthSupported;
|
|
334
|
+
/**
|
|
335
|
+
* A reload-stable fingerprint of the viewer's authorization context, folded
|
|
336
|
+
* from the subject DID and the control-plane (grant) state version. Stamped
|
|
337
|
+
* onto a materialized view so any grant change forces an `'authz-changed'`
|
|
338
|
+
* refresh — the cache can never serve rows a revoked viewer may no longer
|
|
339
|
+
* read. Returns `undefined` when authorization is off (materialized views run
|
|
340
|
+
* untouched, as in the trusted single-user case).
|
|
341
|
+
*/
|
|
342
|
+
private authFingerprint;
|
|
326
343
|
private applyListPagination;
|
|
327
344
|
private getQueryFallbackReason;
|
|
328
345
|
private assertAuthorizedBatch;
|
|
@@ -15,9 +15,9 @@ import {
|
|
|
15
15
|
parseSystemNamespaceResource,
|
|
16
16
|
resolveSchemaAuthority,
|
|
17
17
|
validateSchemaDefinitionNode
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-BY5O6LNC.js";
|
|
19
|
+
import "./chunk-EBNMV2VO.js";
|
|
20
|
+
import "./chunk-RL64OJJ5.js";
|
|
21
21
|
export {
|
|
22
22
|
PresenceSummarySchema,
|
|
23
23
|
SYSTEM_NAMESPACE_KINDS,
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
TagSchema,
|
|
5
5
|
isValidTagName,
|
|
6
6
|
normalizeTagName
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-6KLGA6IR.js";
|
|
8
|
+
import "./chunk-EBNMV2VO.js";
|
|
9
|
+
import "./chunk-RL64OJJ5.js";
|
|
10
10
|
export {
|
|
11
11
|
MAX_TAG_NAME_LENGTH,
|
|
12
12
|
TAG_SCHEMA_IRI,
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
TaskSchema,
|
|
4
4
|
getTaskStatusCategory,
|
|
5
5
|
isCompletedTaskStatus
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-UQM3G5A2.js";
|
|
7
|
+
import "./chunk-OCMSAKWV.js";
|
|
8
|
+
import "./chunk-T5AZAOG5.js";
|
|
9
|
+
import "./chunk-EBNMV2VO.js";
|
|
10
|
+
import "./chunk-RL64OJJ5.js";
|
|
11
11
|
export {
|
|
12
12
|
TASK_STATUS_CATEGORIES,
|
|
13
13
|
TaskSchema,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TRANSACTION_SCHEMA_IRI,
|
|
3
|
+
TransactionSchema
|
|
4
|
+
} from "./chunk-MBTUO3ZL.js";
|
|
5
|
+
import "./chunk-OCMSAKWV.js";
|
|
6
|
+
import "./chunk-T5AZAOG5.js";
|
|
7
|
+
import "./chunk-EBNMV2VO.js";
|
|
8
|
+
import "./chunk-RL64OJJ5.js";
|
|
9
|
+
export {
|
|
10
|
+
TRANSACTION_SCHEMA_IRI,
|
|
11
|
+
TransactionSchema
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TRANSCRIPTION_SCHEMA_IRI,
|
|
3
|
+
TranscriptionSchema
|
|
4
|
+
} from "./chunk-2ZNJWIQG.js";
|
|
5
|
+
import "./chunk-OCMSAKWV.js";
|
|
6
|
+
import "./chunk-T5AZAOG5.js";
|
|
7
|
+
import "./chunk-EBNMV2VO.js";
|
|
8
|
+
import "./chunk-RL64OJJ5.js";
|
|
9
|
+
export {
|
|
10
|
+
TRANSCRIPTION_SCHEMA_IRI,
|
|
11
|
+
TranscriptionSchema
|
|
12
|
+
};
|
|
@@ -220,6 +220,15 @@ interface NodeQueryDescriptor {
|
|
|
220
220
|
spatial?: NodeQuerySpatialFilter;
|
|
221
221
|
search?: NodeQuerySearchFilter;
|
|
222
222
|
materializedView?: NodeQueryMaterializedViewOptions;
|
|
223
|
+
/**
|
|
224
|
+
* Authorization fingerprint stamped by `NodeStore` when a materialized view
|
|
225
|
+
* is read under an active read-authorization evaluator (exploration 0226).
|
|
226
|
+
* It is NOT part of the descriptor hash (it is stripped by
|
|
227
|
+
* `withoutNodeQueryMaterializedView`) — a change is reported as a distinct
|
|
228
|
+
* `'authz-changed'` refresh reason rather than `'descriptor-changed'`. Set
|
|
229
|
+
* internally by the store, never by callers.
|
|
230
|
+
*/
|
|
231
|
+
authFingerprint?: string;
|
|
223
232
|
}
|
|
224
233
|
interface NodeQueryPlanMetadata {
|
|
225
234
|
strategy: 'storage-query' | 'list-fallback' | 'auth-pushdown-candidates';
|
|
@@ -245,7 +254,7 @@ interface NodeQueryPlanMetadata {
|
|
|
245
254
|
fullTextSearchQuery?: string;
|
|
246
255
|
materializedViewId?: string;
|
|
247
256
|
materializedCacheHit?: boolean;
|
|
248
|
-
materializedRefreshReason?: 'missing' | 'descriptor-changed' | 'invalidated' | 'expired' | 'force-refresh';
|
|
257
|
+
materializedRefreshReason?: 'missing' | 'descriptor-changed' | 'authz-changed' | 'invalidated' | 'expired' | 'force-refresh';
|
|
249
258
|
materializedGeneratedAt?: number;
|
|
250
259
|
materializedInvalidatedAt?: number;
|
|
251
260
|
materializedRowCount?: number;
|
|
@@ -817,6 +826,21 @@ interface NodeState {
|
|
|
817
826
|
* Implementations can use SQLite or memory.
|
|
818
827
|
* The adapter stores Changes and materialized NodeState.
|
|
819
828
|
*/
|
|
829
|
+
/**
|
|
830
|
+
* Filters a candidate node set down to the rows the current viewer may read.
|
|
831
|
+
* Only ever removes rows. Used by adapters to authorize a materialized view's
|
|
832
|
+
* id list once, at refresh time (exploration 0226).
|
|
833
|
+
*/
|
|
834
|
+
type NodeReadAuthorizer = (nodes: NodeState[]) => Promise<NodeState[]>;
|
|
835
|
+
/**
|
|
836
|
+
* A reload-stable version of the authorization-relevant control-plane state.
|
|
837
|
+
* `count` and `maxUpdatedAt` over grants and `/sys/authz/` resources change
|
|
838
|
+
* whenever any grant is added, modified, or removed.
|
|
839
|
+
*/
|
|
840
|
+
interface AuthorizationStateVersion {
|
|
841
|
+
count: number;
|
|
842
|
+
maxUpdatedAt: number;
|
|
843
|
+
}
|
|
820
844
|
interface NodeStorageAdapter {
|
|
821
845
|
/** Open/initialize the storage connection */
|
|
822
846
|
open?(): Promise<void>;
|
|
@@ -869,6 +893,23 @@ interface NodeStorageAdapter {
|
|
|
869
893
|
listNodes(options?: ListNodesOptions): Promise<NodeState[]>;
|
|
870
894
|
countNodes(options?: CountNodesOptions): Promise<number>;
|
|
871
895
|
queryNodes?(descriptor: NodeQueryDescriptor): Promise<NodeQueryResult>;
|
|
896
|
+
/**
|
|
897
|
+
* Inject the read-authorization filter the adapter applies before persisting
|
|
898
|
+
* a materialized view's id list (exploration 0226). `NodeStore` wires this to
|
|
899
|
+
* its `filterReadableNodes` so a materialization is authorized exactly once,
|
|
900
|
+
* at refresh time, and cache hits can be served without per-row re-checks.
|
|
901
|
+
* Pass `undefined` to clear it. Optional: adapters that don't implement it
|
|
902
|
+
* simply never materialize under authorization (the store falls back to the
|
|
903
|
+
* authorize-then-paginate path).
|
|
904
|
+
*/
|
|
905
|
+
setNodeReadAuthorizer?(authorizer: NodeReadAuthorizer | undefined): void;
|
|
906
|
+
/**
|
|
907
|
+
* A cheap, reload-stable version stamp of the authorization-relevant state
|
|
908
|
+
* (grants + `/sys/authz/` resources). Folded into the materialized view's
|
|
909
|
+
* auth fingerprint so any grant change invalidates cached views across
|
|
910
|
+
* reloads. Optional; when absent the store will not materialize under authz.
|
|
911
|
+
*/
|
|
912
|
+
getAuthorizationStateVersion?(): Promise<AuthorizationStateVersion>;
|
|
872
913
|
/** Optional runtime operation counters for import diagnostics. */
|
|
873
914
|
getOperationStats?(): Promise<SQLiteOperationStats | null> | SQLiteOperationStats | null;
|
|
874
915
|
/** Reset optional runtime operation counters before a focused measurement. */
|
|
@@ -883,6 +924,16 @@ interface NodeStorageAdapter {
|
|
|
883
924
|
*/
|
|
884
925
|
getSyncCursor?(room: string): Promise<number>;
|
|
885
926
|
setSyncCursor?(room: string, lamport: number): Promise<void>;
|
|
927
|
+
/**
|
|
928
|
+
* Generic app-state key/value, stored in an FK-free table. Used for blobs
|
|
929
|
+
* that are *not* node documents (e.g. the sync registry's tracked-node set):
|
|
930
|
+
* writing those through {@link setDocumentContent} hits `yjs_state`'s
|
|
931
|
+
* `node_id → nodes(id)` foreign key and fails with SQLITE_CONSTRAINT_FOREIGNKEY
|
|
932
|
+
* (exploration 0227). Optional: callers fall back to document content when an
|
|
933
|
+
* adapter doesn't implement it.
|
|
934
|
+
*/
|
|
935
|
+
getAppState?(key: string): Promise<string | null>;
|
|
936
|
+
setAppState?(key: string, value: string): Promise<void>;
|
|
886
937
|
getDocumentContent(nodeId: NodeId): Promise<Uint8Array | null>;
|
|
887
938
|
setDocumentContent(nodeId: NodeId, content: Uint8Array): Promise<void>;
|
|
888
939
|
}
|
|
@@ -1522,4 +1573,4 @@ type InferNode<P extends Record<string, PropertyBuilder>> = {
|
|
|
1522
1573
|
createdBy: DID;
|
|
1523
1574
|
} & InferProperties<P>;
|
|
1524
1575
|
|
|
1525
|
-
export { type PropertyKey as $, createNodeId as A, type PropertyType as B, type CreateNodeOptions$1 as C, type DefinedSchema as D, type PropertyDefinition as E, type ValidationError as F, type GetWithMigrationOptions as G, type CreateNodeOptions as H, type InferCreateProps as I, type InferPropertyType as J, type InferProperties as K, type ListNodesOptions as L, type MigratedNodeState as M, type NodeQueryPageCountMode as N, type OfflineAuthPolicy as O, type PropertyBuilder as P, type InferNode as Q, type SchemaLens as R, type SchemaIRI as S, type TransactionOperation as T, type UpdateNodeOptions as U, type ValidationResult as V, type LensOperation as W, type MigrationResult as X, MigrationError as Y, LensRegistry as Z, lensRegistry as _, type Schema as a, type StoreAuthKeyManager as a$, type NodePayload as a0, type PropertyTimestamp as a1, type SetNodeOptions as a2, type ImportNodesOptions as a3, type RebuildNodeIndexesOptions as a4, type ApplyNodeBatchInput as a5, type ApplyNodeBatchResult as a6, type NodeBatchIndexMode as a7, type NodeBatchNotificationMode as a8, type NodeBatchSyncMode as a9, createNodeQueryDescriptor as aA, encodeNodeQueryCursor as aB, decodeNodeQueryCursor as aC, nodeQueryDescriptorToOptions as aD, serializeNodeQueryDescriptor as aE, matchesNodeQueryDescriptor as aF, filterNodeQueryResults as aG, sortNodeQueryResults as aH, applyNodeQueryDescriptor as aI, getNodeQuerySearchTokens as aJ, nodeQueryDescriptorNeedsBoundedReload as aK, withoutNodeQueryPagination as aL, withoutNodeQueryMaterializedView as aM, isTempId as aN, TEMP_ID_PREFIX as aO, resolveTempIds as aP, createSchemaLookup as aQ, type SchemaLookup as aR, type TempIdResolution as aS, StoreAuth as aT, GrantRateLimiter as aU, GRANT_SCHEMA_IRI as aV, isGrantActive as aW, DEFAULT_OFFLINE_POLICY as aX, mergeOfflinePolicy as aY, type StoreAuthOptions as aZ, type StoreAuthStore as a_, type NodeBatchPreflightResult as aa, type DeterministicNodeBatchWriteInput as ab, type NodeBatchWritePolicy as ac, type NodeBatchWriteTimings as ad, type CountNodesOptions as ae, type NodeQuerySpatialPoint as af, type NodeQuerySpatialRect as ag, type NodeQuerySpatialPointFields as ah, type NodeQuerySpatialRectFields as ai, type NodeQuerySpatialWindow as aj, type NodeQuerySpatialRadius as ak, type NodeQuerySpatialFilter as al, type NodeQuerySearchField as am, type NodeQuerySearchFilter as an, type NodeQueryMaterializedViewOptions as ao, type NodeQueryPageOptions as ap, type NodeQueryCursorOrderEntry as aq, type NodeQueryCursor as ar, type NodeQueryOptions as as, type NodeQueryPlanMetadata as at, type NodeQueryParityCheckMetadata as au, type ConflictResult as av, type NodeBatchChangeEvent as aw, type NodeContentCipher as ax, type ContentKeyCache as ay, type MigrationInfo as az, type ParsedSchemaIRI as b, type GrantInput as b0, type Grant as b1, StoreAuthError as b2, type StoreAuthErrorCode as b3, type GrantNode as b4, type GrantIndexStore as b5, type GrantIndexOptions as b6, type RevocationConsistency as b7, type RevocationConfig as b8, type GrantRateLimiterOptions as b9, type DocumentType as ba, DEFAULT_SCHEMA_VERSION as bb, parseSchemaIRI as bc, buildSchemaIRI as bd, normalizeSchemaIRI as be, getBaseSchemaIRI as bf, isSameSchema as bg, getSchemaVersion as bh, type
|
|
1576
|
+
export { type PropertyKey as $, createNodeId as A, type PropertyType as B, type CreateNodeOptions$1 as C, type DefinedSchema as D, type PropertyDefinition as E, type ValidationError as F, type GetWithMigrationOptions as G, type CreateNodeOptions as H, type InferCreateProps as I, type InferPropertyType as J, type InferProperties as K, type ListNodesOptions as L, type MigratedNodeState as M, type NodeQueryPageCountMode as N, type OfflineAuthPolicy as O, type PropertyBuilder as P, type InferNode as Q, type SchemaLens as R, type SchemaIRI as S, type TransactionOperation as T, type UpdateNodeOptions as U, type ValidationResult as V, type LensOperation as W, type MigrationResult as X, MigrationError as Y, LensRegistry as Z, lensRegistry as _, type Schema as a, type StoreAuthKeyManager as a$, type NodePayload as a0, type PropertyTimestamp as a1, type SetNodeOptions as a2, type ImportNodesOptions as a3, type RebuildNodeIndexesOptions as a4, type ApplyNodeBatchInput as a5, type ApplyNodeBatchResult as a6, type NodeBatchIndexMode as a7, type NodeBatchNotificationMode as a8, type NodeBatchSyncMode as a9, createNodeQueryDescriptor as aA, encodeNodeQueryCursor as aB, decodeNodeQueryCursor as aC, nodeQueryDescriptorToOptions as aD, serializeNodeQueryDescriptor as aE, matchesNodeQueryDescriptor as aF, filterNodeQueryResults as aG, sortNodeQueryResults as aH, applyNodeQueryDescriptor as aI, getNodeQuerySearchTokens as aJ, nodeQueryDescriptorNeedsBoundedReload as aK, withoutNodeQueryPagination as aL, withoutNodeQueryMaterializedView as aM, isTempId as aN, TEMP_ID_PREFIX as aO, resolveTempIds as aP, createSchemaLookup as aQ, type SchemaLookup as aR, type TempIdResolution as aS, StoreAuth as aT, GrantRateLimiter as aU, GRANT_SCHEMA_IRI as aV, isGrantActive as aW, DEFAULT_OFFLINE_POLICY as aX, mergeOfflinePolicy as aY, type StoreAuthOptions as aZ, type StoreAuthStore as a_, type NodeBatchPreflightResult as aa, type DeterministicNodeBatchWriteInput as ab, type NodeBatchWritePolicy as ac, type NodeBatchWriteTimings as ad, type CountNodesOptions as ae, type NodeQuerySpatialPoint as af, type NodeQuerySpatialRect as ag, type NodeQuerySpatialPointFields as ah, type NodeQuerySpatialRectFields as ai, type NodeQuerySpatialWindow as aj, type NodeQuerySpatialRadius as ak, type NodeQuerySpatialFilter as al, type NodeQuerySearchField as am, type NodeQuerySearchFilter as an, type NodeQueryMaterializedViewOptions as ao, type NodeQueryPageOptions as ap, type NodeQueryCursorOrderEntry as aq, type NodeQueryCursor as ar, type NodeQueryOptions as as, type NodeQueryPlanMetadata as at, type NodeQueryParityCheckMetadata as au, type ConflictResult as av, type NodeBatchChangeEvent as aw, type NodeContentCipher as ax, type ContentKeyCache as ay, type MigrationInfo as az, type ParsedSchemaIRI as b, type GrantInput as b0, type Grant as b1, StoreAuthError as b2, type StoreAuthErrorCode as b3, type GrantNode as b4, type GrantIndexStore as b5, type GrantIndexOptions as b6, type RevocationConsistency as b7, type RevocationConfig as b8, type GrantRateLimiterOptions as b9, type DocumentType as ba, DEFAULT_SCHEMA_VERSION as bb, parseSchemaIRI as bc, buildSchemaIRI as bd, normalizeSchemaIRI as be, getBaseSchemaIRI as bf, isSameSchema as bg, getSchemaVersion as bh, type NodeReadAuthorizer as bi, type AuthorizationStateVersion as bj, type OperationNodeBatchWriteInput as bk, type PropertyLookup as bl, createPropertyLookup as bm, type SortDirection as c, type SystemOrderField as d, type StoreAuthAPI as e, type NodeStoreOptions as f, type NodeStorageAdapter as g, type NodeState as h, type NodeId as i, type NodeQueryDescriptor as j, type NodeQueryResult as k, type TransactionResult as l, type DeterministicNodeImportDraft as m, type ImportDeterministicNodesOptions as n, type ImportDeterministicNodesResult as o, type NodeBatchWriteInput as p, type NodeBatchWriteResult as q, type NodeChange as r, type MergeConflict as s, type NodeChangeListener as t, type NodeBatchChangeListener as u, type NodeChangeEvent as v, GrantIndex as w, type Node as x, type DID as y, isNode as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xnetjs/data",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -57,12 +57,12 @@
|
|
|
57
57
|
"nanoid": "^5.1.6",
|
|
58
58
|
"y-protocols": "^1.0.6",
|
|
59
59
|
"yjs": "^13.6.24",
|
|
60
|
-
"@xnetjs/core": "0.
|
|
61
|
-
"@xnetjs/crypto": "0.
|
|
62
|
-
"@xnetjs/identity": "0.
|
|
63
|
-
"@xnetjs/sqlite": "0.
|
|
64
|
-
"@xnetjs/storage": "0.
|
|
65
|
-
"@xnetjs/sync": "0.
|
|
60
|
+
"@xnetjs/core": "0.1.1",
|
|
61
|
+
"@xnetjs/crypto": "0.1.1",
|
|
62
|
+
"@xnetjs/identity": "0.1.1",
|
|
63
|
+
"@xnetjs/sqlite": "0.1.1",
|
|
64
|
+
"@xnetjs/storage": "0.1.1",
|
|
65
|
+
"@xnetjs/sync": "0.1.1"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"tsup": "^8.0.0",
|
package/dist/account-BZHETMC4.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ACCOUNT_SCHEMA_IRI,
|
|
3
|
-
AccountSchema
|
|
4
|
-
} from "./chunk-3JKW6TDE.js";
|
|
5
|
-
import "./chunk-6OPZJ7MG.js";
|
|
6
|
-
import "./chunk-ZICIXDEE.js";
|
|
7
|
-
import "./chunk-O64EK5FK.js";
|
|
8
|
-
import "./chunk-JESSJ5CZ.js";
|
|
9
|
-
export {
|
|
10
|
-
ACCOUNT_SCHEMA_IRI,
|
|
11
|
-
AccountSchema
|
|
12
|
-
};
|
package/dist/budget-WR2Q4YH3.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BUDGET_SCHEMA_IRI,
|
|
3
|
-
BudgetSchema
|
|
4
|
-
} from "./chunk-337E3ZOB.js";
|
|
5
|
-
import "./chunk-6OPZJ7MG.js";
|
|
6
|
-
import "./chunk-ZICIXDEE.js";
|
|
7
|
-
import "./chunk-O64EK5FK.js";
|
|
8
|
-
import "./chunk-JESSJ5CZ.js";
|
|
9
|
-
export {
|
|
10
|
-
BUDGET_SCHEMA_IRI,
|
|
11
|
-
BudgetSchema
|
|
12
|
-
};
|
package/dist/canvas-HFMMVQLD.js
DELETED
package/dist/channel-DXDYJ3ZH.js
DELETED
package/dist/comment-Y2Y3QYYI.js
DELETED