mindoodb-app-sdk 0.0.37 → 0.0.38

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/README.md CHANGED
@@ -1488,6 +1488,7 @@ Connect options: `launchId?`, `targetOrigin?`, `connectTimeoutMs?`.
1488
1488
  | `query(query?)` | `Promise<MindooDBAppQueryResult>` |
1489
1489
  | `liveQuery(query, onResult)` | `Promise<MindooDBAppLiveQuerySubscription>` |
1490
1490
  | `list(query?)` | `Promise<MindooDBAppDocumentListResult>` |
1491
+ | `listInaccessible(query?)` | `Promise<MindooDBAppInaccessibleDocumentListResult>` |
1491
1492
  | `get(docId)` | `Promise<MindooDBAppDocument \| null>` |
1492
1493
  | `getRichText(docId, path, opts?)` | `Promise<MindooDBAppRichTextSnapshot>` |
1493
1494
  | `getAutomergeSnapshot(docId, opts?)` | `Promise<MindooDBAppAutomergeSnapshot>` |
@@ -1510,6 +1511,8 @@ Connect options: `launchId?`, `targetOrigin?`, `connectTimeoutMs?`.
1510
1511
 
1511
1512
  `list(query?)` accepts the changefeed query options documented above. The `cursor` value is an opaque checkpoint string managed by Haven and should be stored and passed back unchanged.
1512
1513
 
1514
+ `listInaccessible(query?)` returns documents that exist locally but the current user cannot decrypt (not a recipient, or missing the document key). Those ids never appear in `list` / `get`. Each row is unsigned store metadata only (`id`, `createdAt`, `decryptionKeyId`, optional `authorLabel`) — the app does not get CAS access. Use it to distinguish an empty database from one sealed to someone else.
1515
+
1513
1516
  For `create(input)`, use `MindooDBAppCreateDocumentInput` with shape `{ set: Record<string, unknown>; decryptionKeyId?: string; recipients?: string[]; recipientOptions?: { includeSelf?: boolean }; id?: string }`. Omit both `decryptionKeyId` and `recipients` to use the database default shared key (`getDefaultCreateKeyId()` / `listCreateKeys()`). Pass `recipients` to encrypt the document for specific directory users (the launching user is included unless `recipientOptions.includeSelf` is `false`). Use `includeSelf: false` to write initial `set` values and hand the document to someone else — empty `recipients` with `includeSelf: false` is rejected. Changing that list later is `addRecipients` / `removeRecipients` / `setRecipients` — do not write `_encryptFor` via `update`. The optional `id` lets the app pick the document id instead of letting MindooDB generate an ObjectId; when provided it must match `/^[a-z][a-z0-9_]*$/` (lowercase only, since ids become on-disk filenames) and existing live documents with that id are returned as-is (idempotent create-if-missing). If an existing custom-id document is deleted, `create({ id })` undeletes it and preserves the previous document body. Documents created with the same custom id on different replicas converge correctly when synced.
1514
1517
 
1515
1518
  `delete(docId)` writes a lifecycle tombstone; it does not erase the document body from the append-only history. Use `undelete(docId)` to make the latest document state live again. If you want to record a deletion reason, first call `update(docId, { set: { intendedDeletionReason: "..." } })`, then call `delete(docId)`.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { M as MindooDBAppAttachmentPreviewMode, a as MindooDBAppBridge, b as MindooDBAppDatabase, c as MindooDBAppDocument, d as MindooDBAppRichTextSpan, e as MindooDBAppRichTextSnapshot } from './types-Plb92iSn.js';
2
- export { f as MINDOODB_APP_SEAL_SIGNING_DOMAIN, g as MindooDBAppAccessDecision, h as MindooDBAppAccessTier, i as MindooDBAppAttachmentApi, j as MindooDBAppAttachmentChunk, k as MindooDBAppAttachmentInfo, l as MindooDBAppAttachmentPreviewOptions, m as MindooDBAppAttachmentPreviewSession, n as MindooDBAppAutomergeChangesPatch, o as MindooDBAppAutomergeChangesSince, p as MindooDBAppAutomergeGetOptions, q as MindooDBAppAutomergePatchResult, r as MindooDBAppAutomergeSnapshot, s as MindooDBAppBridgeConnectMessage, t as MindooDBAppBridgeConnectOptions, u as MindooDBAppBridgeConnectedMessage, v as MindooDBAppBridgeErrorPayload, w as MindooDBAppBridgeHandshakeErrorMessage, x as MindooDBAppBridgeLocaleChangedMessage, y as MindooDBAppBridgePortMessage, z as MindooDBAppBridgeQueryResultMessage, A as MindooDBAppBridgeRpcError, B as MindooDBAppBridgeRpcMessage, C as MindooDBAppBridgeRpcRequest, D as MindooDBAppBridgeRpcSuccess, E as MindooDBAppBridgeStreamAbortRequest, F as MindooDBAppBridgeStreamAck, G as MindooDBAppBridgeStreamCloseRequest, H as MindooDBAppBridgeStreamError, I as MindooDBAppBridgeStreamMessage, J as MindooDBAppBridgeStreamOpenResult, K as MindooDBAppBridgeStreamReadRequest, L as MindooDBAppBridgeStreamWriteRequest, N as MindooDBAppBridgeThemeChangedMessage, O as MindooDBAppBridgeUiPreferencesChangedMessage, P as MindooDBAppBridgeViewChangedMessage, Q as MindooDBAppBridgeViewportChangedMessage, R as MindooDBAppCapability, S as MindooDBAppConfiguredViewCategorizationStyle, T as MindooDBAppConfiguredViewColumn, U as MindooDBAppConfiguredViewColumnRole, V as MindooDBAppConfiguredViewExpressionMode, W as MindooDBAppConfiguredViewFieldExpression, X as MindooDBAppConfiguredViewFilterDefinition, Y as MindooDBAppConfiguredViewFilterMode, Z as MindooDBAppConfiguredViewFilterRule, _ as MindooDBAppConfiguredViewFormulaExpression, $ as MindooDBAppConfiguredViewFormulaFilterDefinition, a0 as MindooDBAppConfiguredViewPreviewMode, a1 as MindooDBAppConfiguredViewRuleFilterDefinition, a2 as MindooDBAppConfiguredViewRuleMatchMode, a3 as MindooDBAppConfiguredViewRuleOperator, a4 as MindooDBAppConfiguredViewValueExpression, a5 as MindooDBAppCreateDocumentInput, a6 as MindooDBAppCreateKeyInfo, a7 as MindooDBAppCreateViewInput, a8 as MindooDBAppCreateViewNavigatorInput, a9 as MindooDBAppDatabaseInfo, aa as MindooDBAppDirectoryApi, ab as MindooDBAppDirectoryEntry, ac as MindooDBAppDocumentApi, ad as MindooDBAppDocumentHeadCursorResult, ae as MindooDBAppDocumentHistoryEntry, af as MindooDBAppDocumentListQuery, ag as MindooDBAppDocumentListResult, ah as MindooDBAppDocumentQuery, ai as MindooDBAppDocumentRevisionId, aj as MindooDBAppDocumentScanPreset, ak as MindooDBAppDocumentSummary, al as MindooDBAppEntryAttachmentRef, am as MindooDBAppEntryProvenance, an as MindooDBAppExtractDocumentTextInput, ao as MindooDBAppExtractDocumentTextResult, ap as MindooDBAppExtractTextFormat, aq as MindooDBAppExtractionSetup, ar as MindooDBAppFulltextSetup, as as MindooDBAppHistoricalDocument, at as MindooDBAppHistoryQuery, au as MindooDBAppHostTheme, av as MindooDBAppIdentityApi, aw as MindooDBAppJsonListDeletePatch, ax as MindooDBAppJsonListInsertPatch, ay as MindooDBAppJsonPatch, az as MindooDBAppJsonSetPatch, aA as MindooDBAppJsonTextMarkPatch, aB as MindooDBAppJsonTextSplicePatch, aC as MindooDBAppJsonTextUnmarkPatch, aD as MindooDBAppJsonUnsetPatch, aE as MindooDBAppLaunchContext, aF as MindooDBAppLiveQuerySubscription, aG as MindooDBAppMenuAnchor, aH as MindooDBAppMenuApi, aI as MindooDBAppMenuCommandItem, aJ as MindooDBAppMenuDismissReason, aK as MindooDBAppMenuDismissedResult, aL as MindooDBAppMenuItem, aM as MindooDBAppMenuKind, aN as MindooDBAppMenuPlacement, aO as MindooDBAppMenuPointAnchor, aP as MindooDBAppMenuRect, aQ as MindooDBAppMenuRectAnchor, aR as MindooDBAppMenuSelectionResult, aS as MindooDBAppMenuSeparatorItem, aT as MindooDBAppQueryCoverage, aU as MindooDBAppQueryResult, aV as MindooDBAppQueryRow, aW as MindooDBAppQuerySortKey, aX as MindooDBAppQueryTextClause, aY as MindooDBAppReadableAttachmentStream, aZ as MindooDBAppRecipientOptions, a_ as MindooDBAppResolvedViewDefinition, a$ as MindooDBAppResolvedViewSource, b0 as MindooDBAppRevisionPhase, b1 as MindooDBAppRevisionVerification, b2 as MindooDBAppRichTextBlockSpan, b3 as MindooDBAppRichTextGetOptions, b4 as MindooDBAppRichTextImmutableString, b5 as MindooDBAppRichTextMarkRange, b6 as MindooDBAppRichTextMaterializeValue, b7 as MindooDBAppRichTextPatch, b8 as MindooDBAppRichTextScalar, b9 as MindooDBAppRichTextSpliceStep, ba as MindooDBAppRichTextStep, bb as MindooDBAppRichTextStepPatch, bc as MindooDBAppRichTextTextSpan, bd as MindooDBAppRuntime, be as MindooDBAppScanAttachmentOptions, bf as MindooDBAppScanAttachmentResult, bg as MindooDBAppScopedDocId, bh as MindooDBAppScopedDocumentSummary, bi as MindooDBAppSealIntent, bj as MindooDBAppSession, bk as MindooDBAppShowMenuInput, bl as MindooDBAppShowMenuResult, bm as MindooDBAppSignPreview, bn as MindooDBAppSignPreviewScope, bo as MindooDBAppSignStatementInput, bp as MindooDBAppSignStatementResult, bq as MindooDBAppTextEdit, br as MindooDBAppTextPatch, bs as MindooDBAppThemeMode, bt as MindooDBAppTimestampApi, bu as MindooDBAppTimestampInput, bv as MindooDBAppTimestampProvider, bw as MindooDBAppTimestampResult, bx as MindooDBAppUiPreferences, by as MindooDBAppUpdateDocumentInput, bz as MindooDBAppViewCursorDocumentListResult, bA as MindooDBAppViewCursorResult, bB as MindooDBAppViewEntry, bC as MindooDBAppViewEntryKind, bD as MindooDBAppViewNavigator, bE as MindooDBAppViewNavigatorExpansionState, bF as MindooDBAppViewNavigatorOpenOptions, bG as MindooDBAppViewNavigatorPageOptions, bH as MindooDBAppViewNavigatorPageResult, bI as MindooDBAppViewNavigatorRangeQuery, bJ as MindooDBAppViewNavigatorSelectionState, bK as MindooDBAppViewUpdateStats, bL as MindooDBAppViewport, bM as MindooDBAppWritableAttachmentStream } from './types-Plb92iSn.js';
1
+ import { M as MindooDBAppAttachmentPreviewMode, a as MindooDBAppBridge, b as MindooDBAppDatabase, c as MindooDBAppDocument, d as MindooDBAppRichTextSpan, e as MindooDBAppRichTextSnapshot } from './types-SPuW5xnS.js';
2
+ export { f as MINDOODB_APP_SEAL_SIGNING_DOMAIN, g as MindooDBAppAccessDecision, h as MindooDBAppAccessTier, i as MindooDBAppAttachmentApi, j as MindooDBAppAttachmentChunk, k as MindooDBAppAttachmentInfo, l as MindooDBAppAttachmentPreviewOptions, m as MindooDBAppAttachmentPreviewSession, n as MindooDBAppAutomergeChangesPatch, o as MindooDBAppAutomergeChangesSince, p as MindooDBAppAutomergeGetOptions, q as MindooDBAppAutomergePatchResult, r as MindooDBAppAutomergeSnapshot, s as MindooDBAppBridgeConnectMessage, t as MindooDBAppBridgeConnectOptions, u as MindooDBAppBridgeConnectedMessage, v as MindooDBAppBridgeErrorPayload, w as MindooDBAppBridgeHandshakeErrorMessage, x as MindooDBAppBridgeLocaleChangedMessage, y as MindooDBAppBridgePortMessage, z as MindooDBAppBridgeQueryResultMessage, A as MindooDBAppBridgeRpcError, B as MindooDBAppBridgeRpcMessage, C as MindooDBAppBridgeRpcRequest, D as MindooDBAppBridgeRpcSuccess, E as MindooDBAppBridgeStreamAbortRequest, F as MindooDBAppBridgeStreamAck, G as MindooDBAppBridgeStreamCloseRequest, H as MindooDBAppBridgeStreamError, I as MindooDBAppBridgeStreamMessage, J as MindooDBAppBridgeStreamOpenResult, K as MindooDBAppBridgeStreamReadRequest, L as MindooDBAppBridgeStreamWriteRequest, N as MindooDBAppBridgeThemeChangedMessage, O as MindooDBAppBridgeUiPreferencesChangedMessage, P as MindooDBAppBridgeViewChangedMessage, Q as MindooDBAppBridgeViewportChangedMessage, R as MindooDBAppCapability, S as MindooDBAppConfiguredViewCategorizationStyle, T as MindooDBAppConfiguredViewColumn, U as MindooDBAppConfiguredViewColumnRole, V as MindooDBAppConfiguredViewExpressionMode, W as MindooDBAppConfiguredViewFieldExpression, X as MindooDBAppConfiguredViewFilterDefinition, Y as MindooDBAppConfiguredViewFilterMode, Z as MindooDBAppConfiguredViewFilterRule, _ as MindooDBAppConfiguredViewFormulaExpression, $ as MindooDBAppConfiguredViewFormulaFilterDefinition, a0 as MindooDBAppConfiguredViewPreviewMode, a1 as MindooDBAppConfiguredViewRuleFilterDefinition, a2 as MindooDBAppConfiguredViewRuleMatchMode, a3 as MindooDBAppConfiguredViewRuleOperator, a4 as MindooDBAppConfiguredViewValueExpression, a5 as MindooDBAppCreateDocumentInput, a6 as MindooDBAppCreateKeyInfo, a7 as MindooDBAppCreateViewInput, a8 as MindooDBAppCreateViewNavigatorInput, a9 as MindooDBAppDatabaseInfo, aa as MindooDBAppDirectoryApi, ab as MindooDBAppDirectoryEntry, ac as MindooDBAppDocumentApi, ad as MindooDBAppDocumentHeadCursorResult, ae as MindooDBAppDocumentHistoryEntry, af as MindooDBAppDocumentListQuery, ag as MindooDBAppDocumentListResult, ah as MindooDBAppDocumentQuery, ai as MindooDBAppDocumentRevisionId, aj as MindooDBAppDocumentScanPreset, ak as MindooDBAppDocumentSummary, al as MindooDBAppEntryAttachmentRef, am as MindooDBAppEntryProvenance, an as MindooDBAppExtractDocumentTextInput, ao as MindooDBAppExtractDocumentTextResult, ap as MindooDBAppExtractTextFormat, aq as MindooDBAppExtractionSetup, ar as MindooDBAppFulltextSetup, as as MindooDBAppHistoricalDocument, at as MindooDBAppHistoryQuery, au as MindooDBAppHostTheme, av as MindooDBAppIdentityApi, aw as MindooDBAppInaccessibleDocument, ax as MindooDBAppInaccessibleDocumentListQuery, ay as MindooDBAppInaccessibleDocumentListResult, az as MindooDBAppJsonListDeletePatch, aA as MindooDBAppJsonListInsertPatch, aB as MindooDBAppJsonPatch, aC as MindooDBAppJsonSetPatch, aD as MindooDBAppJsonTextMarkPatch, aE as MindooDBAppJsonTextSplicePatch, aF as MindooDBAppJsonTextUnmarkPatch, aG as MindooDBAppJsonUnsetPatch, aH as MindooDBAppLaunchContext, aI as MindooDBAppLiveQuerySubscription, aJ as MindooDBAppMenuAnchor, aK as MindooDBAppMenuApi, aL as MindooDBAppMenuCommandItem, aM as MindooDBAppMenuDismissReason, aN as MindooDBAppMenuDismissedResult, aO as MindooDBAppMenuItem, aP as MindooDBAppMenuKind, aQ as MindooDBAppMenuPlacement, aR as MindooDBAppMenuPointAnchor, aS as MindooDBAppMenuRect, aT as MindooDBAppMenuRectAnchor, aU as MindooDBAppMenuSelectionResult, aV as MindooDBAppMenuSeparatorItem, aW as MindooDBAppQueryCoverage, aX as MindooDBAppQueryResult, aY as MindooDBAppQueryRow, aZ as MindooDBAppQuerySortKey, a_ as MindooDBAppQueryTextClause, a$ as MindooDBAppReadableAttachmentStream, b0 as MindooDBAppRecipientOptions, b1 as MindooDBAppResolvedViewDefinition, b2 as MindooDBAppResolvedViewSource, b3 as MindooDBAppRevisionPhase, b4 as MindooDBAppRevisionVerification, b5 as MindooDBAppRichTextBlockSpan, b6 as MindooDBAppRichTextGetOptions, b7 as MindooDBAppRichTextImmutableString, b8 as MindooDBAppRichTextMarkRange, b9 as MindooDBAppRichTextMaterializeValue, ba as MindooDBAppRichTextPatch, bb as MindooDBAppRichTextScalar, bc as MindooDBAppRichTextSpliceStep, bd as MindooDBAppRichTextStep, be as MindooDBAppRichTextStepPatch, bf as MindooDBAppRichTextTextSpan, bg as MindooDBAppRuntime, bh as MindooDBAppScanAttachmentOptions, bi as MindooDBAppScanAttachmentResult, bj as MindooDBAppScopedDocId, bk as MindooDBAppScopedDocumentSummary, bl as MindooDBAppSealIntent, bm as MindooDBAppSession, bn as MindooDBAppShowMenuInput, bo as MindooDBAppShowMenuResult, bp as MindooDBAppSignPreview, bq as MindooDBAppSignPreviewScope, br as MindooDBAppSignStatementInput, bs as MindooDBAppSignStatementResult, bt as MindooDBAppTextEdit, bu as MindooDBAppTextPatch, bv as MindooDBAppThemeMode, bw as MindooDBAppTimestampApi, bx as MindooDBAppTimestampInput, by as MindooDBAppTimestampProvider, bz as MindooDBAppTimestampResult, bA as MindooDBAppUiPreferences, bB as MindooDBAppUpdateDocumentInput, bC as MindooDBAppViewCursorDocumentListResult, bD as MindooDBAppViewCursorResult, bE as MindooDBAppViewEntry, bF as MindooDBAppViewEntryKind, bG as MindooDBAppViewNavigator, bH as MindooDBAppViewNavigatorExpansionState, bI as MindooDBAppViewNavigatorOpenOptions, bJ as MindooDBAppViewNavigatorPageOptions, bK as MindooDBAppViewNavigatorPageResult, bL as MindooDBAppViewNavigatorRangeQuery, bM as MindooDBAppViewNavigatorSelectionState, bN as MindooDBAppViewUpdateStats, bO as MindooDBAppViewport, bP as MindooDBAppWritableAttachmentStream } from './types-SPuW5xnS.js';
3
3
  import { MindooDBAppBooleanExpression } from 'mindoodb-view-language';
4
4
  export { MindooDBAppBooleanExpression, MindooDBAppExpression, MindooDBAppFilterDefinition, MindooDBAppViewCategoryChildrenPageRequest, MindooDBAppViewColumn, MindooDBAppViewColumnRole, MindooDBAppViewDefinition, MindooDBAppViewExpansionState, MindooDBAppViewExpressionBase, MindooDBAppViewExpressionDatePart, MindooDBAppViewExpressionOperation, MindooDBAppViewFieldExpression, MindooDBAppViewIfExpression, MindooDBAppViewLetExpression, MindooDBAppViewLiteralExpression, MindooDBAppViewLookupByPath, MindooDBAppViewOperationExpression, MindooDBAppViewOriginExpression, MindooDBAppViewPageRequest, MindooDBAppViewPageResult, MindooDBAppViewRow, MindooDBAppViewSortDirection, MindooDBAppViewTotalMode, MindooDBAppViewValueExpressionRef, MindooDBAppViewVariableExpression, createViewLanguage } from 'mindoodb-view-language';
5
5
  import { MindooDB, MindooQuerySortKey, MindooQueryOptions, MindooQueryResult } from 'mindoodb';
package/dist/index.js CHANGED
@@ -758,6 +758,10 @@ var MindooDBAppDatabaseImpl = class {
758
758
  databaseId: this.databaseId,
759
759
  query: query ?? {}
760
760
  }),
761
+ listInaccessible: async (query) => await this.rpc.call("documents.listInaccessible", {
762
+ databaseId: this.databaseId,
763
+ query: query ?? {}
764
+ }),
761
765
  query: async (query) => await this.rpc.call("documents.query", {
762
766
  databaseId: this.databaseId,
763
767
  query: normalizeDocumentQuery(query)
@@ -1,4 +1,4 @@
1
- import { a8 as MindooDBAppCreateViewNavigatorInput, bD as MindooDBAppViewNavigator, aE as MindooDBAppLaunchContext, a9 as MindooDBAppDatabaseInfo, ac as MindooDBAppDocumentApi, bF as MindooDBAppViewNavigatorOpenOptions, i as MindooDBAppAttachmentApi, av as MindooDBAppIdentityApi, bt as MindooDBAppTimestampApi, aa as MindooDBAppDirectoryApi, c as MindooDBAppDocument, ar as MindooDBAppFulltextSetup, aq as MindooDBAppExtractionSetup, a as MindooDBAppBridge, bj as MindooDBAppSession, C as MindooDBAppBridgeRpcRequest, au as MindooDBAppHostTheme, bL as MindooDBAppViewport, bx as MindooDBAppUiPreferences, aU as MindooDBAppQueryResult, bK as MindooDBAppViewUpdateStats, y as MindooDBAppBridgePortMessage } from '../types-Plb92iSn.js';
1
+ import { a8 as MindooDBAppCreateViewNavigatorInput, bG as MindooDBAppViewNavigator, aH as MindooDBAppLaunchContext, a9 as MindooDBAppDatabaseInfo, ac as MindooDBAppDocumentApi, bI as MindooDBAppViewNavigatorOpenOptions, i as MindooDBAppAttachmentApi, av as MindooDBAppIdentityApi, bw as MindooDBAppTimestampApi, aa as MindooDBAppDirectoryApi, c as MindooDBAppDocument, ar as MindooDBAppFulltextSetup, aq as MindooDBAppExtractionSetup, a as MindooDBAppBridge, bm as MindooDBAppSession, C as MindooDBAppBridgeRpcRequest, au as MindooDBAppHostTheme, bO as MindooDBAppViewport, bA as MindooDBAppUiPreferences, aX as MindooDBAppQueryResult, bN as MindooDBAppViewUpdateStats, y as MindooDBAppBridgePortMessage } from '../types-SPuW5xnS.js';
2
2
  import * as mindoodb from 'mindoodb';
3
3
  import 'mindoodb-view-language';
4
4
 
@@ -38,7 +38,12 @@ interface MockSeedDocument {
38
38
  id: string;
39
39
  data: Record<string, unknown>;
40
40
  updatedAt?: string;
41
+ createdAt?: string;
41
42
  isDeleted?: boolean;
43
+ /** When true the doc is hidden from `list`/`get` and returned by `listInaccessible`. */
44
+ inaccessible?: boolean;
45
+ decryptionKeyId?: string;
46
+ authorLabel?: string;
42
47
  heads?: string[];
43
48
  attachments?: MindooDBAppDocument["attachments"];
44
49
  }
@@ -942,7 +942,7 @@ function runMockDocumentQuery(storedDocuments, databaseId, query) {
942
942
  const sortBy = query?.sortBy && query.sortBy.length > 0 ? query.sortBy : query?.text ? [{ special: "textScore", direction: "descending" }] : [];
943
943
  const matches = [];
944
944
  for (const document of storedDocuments.values()) {
945
- if (document.isDeleted) {
945
+ if (document.isDeleted || document.inaccessible) {
946
946
  continue;
947
947
  }
948
948
  let textScore;
@@ -1228,7 +1228,11 @@ function createDatabaseHandle(definition) {
1228
1228
  heads: seed.heads ? [...seed.heads] : void 0,
1229
1229
  attachments: seed.attachments ? structuredClone(seed.attachments) : [],
1230
1230
  updatedAt: seed.updatedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
1231
- isDeleted: seed.isDeleted ?? false
1231
+ isDeleted: seed.isDeleted ?? false,
1232
+ inaccessible: seed.inaccessible ?? false,
1233
+ decryptionKeyId: seed.decryptionKeyId,
1234
+ authorLabel: seed.authorLabel,
1235
+ createdAt: seed.createdAt
1232
1236
  });
1233
1237
  }
1234
1238
  const liveQuerySubscriptions = /* @__PURE__ */ new Set();
@@ -1325,7 +1329,7 @@ function createDatabaseHandle(definition) {
1325
1329
  const offset = decodeMockListCursor(query?.cursor) + skip;
1326
1330
  const metadataOnly = query?.metadataOnly ?? false;
1327
1331
  const idPrefix = query?.idPrefix;
1328
- const items = Array.from(storedDocuments.values()).filter(
1332
+ const items = Array.from(storedDocuments.values()).filter((document) => !document.inaccessible).filter(
1329
1333
  (document) => status === "all" ? true : status === "deleted" ? document.isDeleted : !document.isDeleted
1330
1334
  ).filter((document) => matchesMockIdPrefix(document.id, idPrefix)).filter(
1331
1335
  (document) => metadataOnly ? true : matchesDocumentFilter(document, query?.filter)
@@ -1362,9 +1366,19 @@ function createDatabaseHandle(definition) {
1362
1366
  cursor: String(storedDocuments.size)
1363
1367
  };
1364
1368
  },
1369
+ async listInaccessible(query) {
1370
+ const idPrefix = query?.idPrefix;
1371
+ const items = Array.from(storedDocuments.values()).filter((document) => document.inaccessible).filter((document) => matchesMockIdPrefix(document.id, idPrefix)).sort((left, right) => left.id.localeCompare(right.id)).map((document) => ({
1372
+ id: document.id,
1373
+ createdAt: document.createdAt ?? document.updatedAt ?? (/* @__PURE__ */ new Date(0)).toISOString(),
1374
+ decryptionKeyId: document.decryptionKeyId ?? "sealed",
1375
+ authorLabel: document.authorLabel
1376
+ }));
1377
+ return { items };
1378
+ },
1365
1379
  async get(_docId) {
1366
1380
  const document = storedDocuments.get(_docId);
1367
- if (!document || document.isDeleted) {
1381
+ if (!document || document.isDeleted || document.inaccessible) {
1368
1382
  return null;
1369
1383
  }
1370
1384
  return {
@@ -1803,7 +1817,7 @@ function createDatabaseHandle(definition) {
1803
1817
  };
1804
1818
  return {
1805
1819
  handle: databaseHandle,
1806
- listViewDocuments: () => Array.from(storedDocuments.values()).filter((document) => !document.isDeleted).map((document) => ({
1820
+ listViewDocuments: () => Array.from(storedDocuments.values()).filter((document) => !document.isDeleted && !document.inaccessible).map((document) => ({
1807
1821
  origin: definition.info.id,
1808
1822
  docId: document.id,
1809
1823
  data: structuredClone(document.data),
@@ -2247,6 +2261,10 @@ function createFakeBridgeHost(options = {}) {
2247
2261
  return await state.getDatabase(String(params.databaseId)).documents.list(
2248
2262
  params.query
2249
2263
  );
2264
+ case "documents.listInaccessible":
2265
+ return await state.getDatabase(String(params.databaseId)).documents.listInaccessible(
2266
+ params.query
2267
+ );
2250
2268
  case "documents.getHeadCursor":
2251
2269
  return await state.getDatabase(String(params.databaseId)).documents.getHeadCursor();
2252
2270
  case "database.getFulltextSetup":
@@ -359,6 +359,30 @@ interface MindooDBAppDocumentListQuery {
359
359
  */
360
360
  idPrefix?: string;
361
361
  }
362
+ /** Query options for {@link MindooDBAppDocumentApi.listInaccessible}. */
363
+ interface MindooDBAppInaccessibleDocumentListQuery {
364
+ /**
365
+ * Restrict the listing to documents whose id matches this prefix. Matching is
366
+ * the same boundary-aware rule as {@link MindooDBAppDocumentListQuery.idPrefix}.
367
+ */
368
+ idPrefix?: string;
369
+ }
370
+ /**
371
+ * A document that exists in the local store but the current user cannot open.
372
+ * Built from unsigned `doc_create` (or `doc_snapshot`) metadata — no payload
373
+ * and no CAS access for the app.
374
+ */
375
+ interface MindooDBAppInaccessibleDocument {
376
+ id: string;
377
+ createdAt: string;
378
+ decryptionKeyId: string;
379
+ /** Directory display name of the origin author, when the host can resolve it. */
380
+ authorLabel?: string;
381
+ }
382
+ /** Result of {@link MindooDBAppDocumentApi.listInaccessible}. */
383
+ interface MindooDBAppInaccessibleDocumentListResult {
384
+ items: MindooDBAppInaccessibleDocument[];
385
+ }
362
386
  /** Paged result returned by `documents.list()`. */
363
387
  interface MindooDBAppDocumentListResult {
364
388
  items: MindooDBAppDocumentSummary[];
@@ -1177,6 +1201,14 @@ interface MindooDBAppDocumentApi {
1177
1201
  * {@link query}. Requires the `read` capability.
1178
1202
  */
1179
1203
  list(query?: MindooDBAppDocumentListQuery): Promise<MindooDBAppDocumentListResult>;
1204
+ /**
1205
+ * Documents present in this database that the current user cannot decrypt
1206
+ * (not a recipient, or missing `decryptionKeyId`). They do not appear in
1207
+ * {@link list} or {@link get}. Each row is store-metadata only: id,
1208
+ * origin timestamp, key id, and the author's directory label when known.
1209
+ * Requires the `read` capability.
1210
+ */
1211
+ listInaccessible(query?: MindooDBAppInaccessibleDocumentListQuery): Promise<MindooDBAppInaccessibleDocumentListResult>;
1180
1212
  /**
1181
1213
  * The database's latest changefeed cursor without loading any documents.
1182
1214
  * Useful as a baseline checkpoint before starting an incremental
@@ -2026,4 +2058,4 @@ interface MindooDBAppBridge {
2026
2058
  connect(options?: MindooDBAppBridgeConnectOptions): Promise<MindooDBAppSession>;
2027
2059
  }
2028
2060
 
2029
- export { type MindooDBAppConfiguredViewFormulaFilterDefinition as $, type MindooDBAppBridgeRpcError as A, type MindooDBAppBridgeRpcMessage as B, type MindooDBAppBridgeRpcRequest as C, type MindooDBAppBridgeRpcSuccess as D, type MindooDBAppBridgeStreamAbortRequest as E, type MindooDBAppBridgeStreamAck as F, type MindooDBAppBridgeStreamCloseRequest as G, type MindooDBAppBridgeStreamError as H, type MindooDBAppBridgeStreamMessage as I, type MindooDBAppBridgeStreamOpenResult as J, type MindooDBAppBridgeStreamReadRequest as K, type MindooDBAppBridgeStreamWriteRequest as L, type MindooDBAppAttachmentPreviewMode as M, type MindooDBAppBridgeThemeChangedMessage as N, type MindooDBAppBridgeUiPreferencesChangedMessage as O, type MindooDBAppBridgeViewChangedMessage as P, type MindooDBAppBridgeViewportChangedMessage as Q, type MindooDBAppCapability as R, type MindooDBAppConfiguredViewCategorizationStyle as S, type MindooDBAppConfiguredViewColumn as T, type MindooDBAppConfiguredViewColumnRole as U, type MindooDBAppConfiguredViewExpressionMode as V, type MindooDBAppConfiguredViewFieldExpression as W, type MindooDBAppConfiguredViewFilterDefinition as X, type MindooDBAppConfiguredViewFilterMode as Y, type MindooDBAppConfiguredViewFilterRule as Z, type MindooDBAppConfiguredViewFormulaExpression as _, type MindooDBAppBridge as a, type MindooDBAppResolvedViewSource as a$, type MindooDBAppConfiguredViewPreviewMode as a0, type MindooDBAppConfiguredViewRuleFilterDefinition as a1, type MindooDBAppConfiguredViewRuleMatchMode as a2, type MindooDBAppConfiguredViewRuleOperator as a3, type MindooDBAppConfiguredViewValueExpression as a4, type MindooDBAppCreateDocumentInput as a5, type MindooDBAppCreateKeyInfo as a6, type MindooDBAppCreateViewInput as a7, type MindooDBAppCreateViewNavigatorInput as a8, type MindooDBAppDatabaseInfo as a9, type MindooDBAppJsonTextMarkPatch as aA, type MindooDBAppJsonTextSplicePatch as aB, type MindooDBAppJsonTextUnmarkPatch as aC, type MindooDBAppJsonUnsetPatch as aD, type MindooDBAppLaunchContext as aE, type MindooDBAppLiveQuerySubscription as aF, type MindooDBAppMenuAnchor as aG, type MindooDBAppMenuApi as aH, type MindooDBAppMenuCommandItem as aI, type MindooDBAppMenuDismissReason as aJ, type MindooDBAppMenuDismissedResult as aK, type MindooDBAppMenuItem as aL, type MindooDBAppMenuKind as aM, type MindooDBAppMenuPlacement as aN, type MindooDBAppMenuPointAnchor as aO, type MindooDBAppMenuRect as aP, type MindooDBAppMenuRectAnchor as aQ, type MindooDBAppMenuSelectionResult as aR, type MindooDBAppMenuSeparatorItem as aS, type MindooDBAppQueryCoverage as aT, type MindooDBAppQueryResult as aU, type MindooDBAppQueryRow as aV, type MindooDBAppQuerySortKey as aW, type MindooDBAppQueryTextClause as aX, type MindooDBAppReadableAttachmentStream as aY, type MindooDBAppRecipientOptions as aZ, type MindooDBAppResolvedViewDefinition as a_, type MindooDBAppDirectoryApi as aa, type MindooDBAppDirectoryEntry as ab, type MindooDBAppDocumentApi as ac, type MindooDBAppDocumentHeadCursorResult as ad, type MindooDBAppDocumentHistoryEntry as ae, type MindooDBAppDocumentListQuery as af, type MindooDBAppDocumentListResult as ag, type MindooDBAppDocumentQuery as ah, type MindooDBAppDocumentRevisionId as ai, type MindooDBAppDocumentScanPreset as aj, type MindooDBAppDocumentSummary as ak, type MindooDBAppEntryAttachmentRef as al, type MindooDBAppEntryProvenance as am, type MindooDBAppExtractDocumentTextInput as an, type MindooDBAppExtractDocumentTextResult as ao, type MindooDBAppExtractTextFormat as ap, type MindooDBAppExtractionSetup as aq, type MindooDBAppFulltextSetup as ar, type MindooDBAppHistoricalDocument as as, type MindooDBAppHistoryQuery as at, type MindooDBAppHostTheme as au, type MindooDBAppIdentityApi as av, type MindooDBAppJsonListDeletePatch as aw, type MindooDBAppJsonListInsertPatch as ax, type MindooDBAppJsonPatch as ay, type MindooDBAppJsonSetPatch as az, type MindooDBAppDatabase as b, type MindooDBAppRevisionPhase as b0, type MindooDBAppRevisionVerification as b1, type MindooDBAppRichTextBlockSpan as b2, type MindooDBAppRichTextGetOptions as b3, type MindooDBAppRichTextImmutableString as b4, type MindooDBAppRichTextMarkRange as b5, type MindooDBAppRichTextMaterializeValue as b6, type MindooDBAppRichTextPatch as b7, type MindooDBAppRichTextScalar as b8, type MindooDBAppRichTextSpliceStep as b9, type MindooDBAppViewCursorResult as bA, type MindooDBAppViewEntry as bB, type MindooDBAppViewEntryKind as bC, type MindooDBAppViewNavigator as bD, type MindooDBAppViewNavigatorExpansionState as bE, type MindooDBAppViewNavigatorOpenOptions as bF, type MindooDBAppViewNavigatorPageOptions as bG, type MindooDBAppViewNavigatorPageResult as bH, type MindooDBAppViewNavigatorRangeQuery as bI, type MindooDBAppViewNavigatorSelectionState as bJ, type MindooDBAppViewUpdateStats as bK, type MindooDBAppViewport as bL, type MindooDBAppWritableAttachmentStream as bM, type MindooDBAppRichTextStep as ba, type MindooDBAppRichTextStepPatch as bb, type MindooDBAppRichTextTextSpan as bc, type MindooDBAppRuntime as bd, type MindooDBAppScanAttachmentOptions as be, type MindooDBAppScanAttachmentResult as bf, type MindooDBAppScopedDocId as bg, type MindooDBAppScopedDocumentSummary as bh, type MindooDBAppSealIntent as bi, type MindooDBAppSession as bj, type MindooDBAppShowMenuInput as bk, type MindooDBAppShowMenuResult as bl, type MindooDBAppSignPreview as bm, type MindooDBAppSignPreviewScope as bn, type MindooDBAppSignStatementInput as bo, type MindooDBAppSignStatementResult as bp, type MindooDBAppTextEdit as bq, type MindooDBAppTextPatch as br, type MindooDBAppThemeMode as bs, type MindooDBAppTimestampApi as bt, type MindooDBAppTimestampInput as bu, type MindooDBAppTimestampProvider as bv, type MindooDBAppTimestampResult as bw, type MindooDBAppUiPreferences as bx, type MindooDBAppUpdateDocumentInput as by, type MindooDBAppViewCursorDocumentListResult as bz, type MindooDBAppDocument as c, type MindooDBAppRichTextSpan as d, type MindooDBAppRichTextSnapshot as e, MINDOODB_APP_SEAL_SIGNING_DOMAIN as f, type MindooDBAppAccessDecision as g, type MindooDBAppAccessTier as h, type MindooDBAppAttachmentApi as i, type MindooDBAppAttachmentChunk as j, type MindooDBAppAttachmentInfo as k, type MindooDBAppAttachmentPreviewOptions as l, type MindooDBAppAttachmentPreviewSession as m, type MindooDBAppAutomergeChangesPatch as n, type MindooDBAppAutomergeChangesSince as o, type MindooDBAppAutomergeGetOptions as p, type MindooDBAppAutomergePatchResult as q, type MindooDBAppAutomergeSnapshot as r, type MindooDBAppBridgeConnectMessage as s, type MindooDBAppBridgeConnectOptions as t, type MindooDBAppBridgeConnectedMessage as u, type MindooDBAppBridgeErrorPayload as v, type MindooDBAppBridgeHandshakeErrorMessage as w, type MindooDBAppBridgeLocaleChangedMessage as x, type MindooDBAppBridgePortMessage as y, type MindooDBAppBridgeQueryResultMessage as z };
2061
+ export { type MindooDBAppConfiguredViewFormulaFilterDefinition as $, type MindooDBAppBridgeRpcError as A, type MindooDBAppBridgeRpcMessage as B, type MindooDBAppBridgeRpcRequest as C, type MindooDBAppBridgeRpcSuccess as D, type MindooDBAppBridgeStreamAbortRequest as E, type MindooDBAppBridgeStreamAck as F, type MindooDBAppBridgeStreamCloseRequest as G, type MindooDBAppBridgeStreamError as H, type MindooDBAppBridgeStreamMessage as I, type MindooDBAppBridgeStreamOpenResult as J, type MindooDBAppBridgeStreamReadRequest as K, type MindooDBAppBridgeStreamWriteRequest as L, type MindooDBAppAttachmentPreviewMode as M, type MindooDBAppBridgeThemeChangedMessage as N, type MindooDBAppBridgeUiPreferencesChangedMessage as O, type MindooDBAppBridgeViewChangedMessage as P, type MindooDBAppBridgeViewportChangedMessage as Q, type MindooDBAppCapability as R, type MindooDBAppConfiguredViewCategorizationStyle as S, type MindooDBAppConfiguredViewColumn as T, type MindooDBAppConfiguredViewColumnRole as U, type MindooDBAppConfiguredViewExpressionMode as V, type MindooDBAppConfiguredViewFieldExpression as W, type MindooDBAppConfiguredViewFilterDefinition as X, type MindooDBAppConfiguredViewFilterMode as Y, type MindooDBAppConfiguredViewFilterRule as Z, type MindooDBAppConfiguredViewFormulaExpression as _, type MindooDBAppBridge as a, type MindooDBAppReadableAttachmentStream as a$, type MindooDBAppConfiguredViewPreviewMode as a0, type MindooDBAppConfiguredViewRuleFilterDefinition as a1, type MindooDBAppConfiguredViewRuleMatchMode as a2, type MindooDBAppConfiguredViewRuleOperator as a3, type MindooDBAppConfiguredViewValueExpression as a4, type MindooDBAppCreateDocumentInput as a5, type MindooDBAppCreateKeyInfo as a6, type MindooDBAppCreateViewInput as a7, type MindooDBAppCreateViewNavigatorInput as a8, type MindooDBAppDatabaseInfo as a9, type MindooDBAppJsonListInsertPatch as aA, type MindooDBAppJsonPatch as aB, type MindooDBAppJsonSetPatch as aC, type MindooDBAppJsonTextMarkPatch as aD, type MindooDBAppJsonTextSplicePatch as aE, type MindooDBAppJsonTextUnmarkPatch as aF, type MindooDBAppJsonUnsetPatch as aG, type MindooDBAppLaunchContext as aH, type MindooDBAppLiveQuerySubscription as aI, type MindooDBAppMenuAnchor as aJ, type MindooDBAppMenuApi as aK, type MindooDBAppMenuCommandItem as aL, type MindooDBAppMenuDismissReason as aM, type MindooDBAppMenuDismissedResult as aN, type MindooDBAppMenuItem as aO, type MindooDBAppMenuKind as aP, type MindooDBAppMenuPlacement as aQ, type MindooDBAppMenuPointAnchor as aR, type MindooDBAppMenuRect as aS, type MindooDBAppMenuRectAnchor as aT, type MindooDBAppMenuSelectionResult as aU, type MindooDBAppMenuSeparatorItem as aV, type MindooDBAppQueryCoverage as aW, type MindooDBAppQueryResult as aX, type MindooDBAppQueryRow as aY, type MindooDBAppQuerySortKey as aZ, type MindooDBAppQueryTextClause as a_, type MindooDBAppDirectoryApi as aa, type MindooDBAppDirectoryEntry as ab, type MindooDBAppDocumentApi as ac, type MindooDBAppDocumentHeadCursorResult as ad, type MindooDBAppDocumentHistoryEntry as ae, type MindooDBAppDocumentListQuery as af, type MindooDBAppDocumentListResult as ag, type MindooDBAppDocumentQuery as ah, type MindooDBAppDocumentRevisionId as ai, type MindooDBAppDocumentScanPreset as aj, type MindooDBAppDocumentSummary as ak, type MindooDBAppEntryAttachmentRef as al, type MindooDBAppEntryProvenance as am, type MindooDBAppExtractDocumentTextInput as an, type MindooDBAppExtractDocumentTextResult as ao, type MindooDBAppExtractTextFormat as ap, type MindooDBAppExtractionSetup as aq, type MindooDBAppFulltextSetup as ar, type MindooDBAppHistoricalDocument as as, type MindooDBAppHistoryQuery as at, type MindooDBAppHostTheme as au, type MindooDBAppIdentityApi as av, type MindooDBAppInaccessibleDocument as aw, type MindooDBAppInaccessibleDocumentListQuery as ax, type MindooDBAppInaccessibleDocumentListResult as ay, type MindooDBAppJsonListDeletePatch as az, type MindooDBAppDatabase as b, type MindooDBAppRecipientOptions as b0, type MindooDBAppResolvedViewDefinition as b1, type MindooDBAppResolvedViewSource as b2, type MindooDBAppRevisionPhase as b3, type MindooDBAppRevisionVerification as b4, type MindooDBAppRichTextBlockSpan as b5, type MindooDBAppRichTextGetOptions as b6, type MindooDBAppRichTextImmutableString as b7, type MindooDBAppRichTextMarkRange as b8, type MindooDBAppRichTextMaterializeValue as b9, type MindooDBAppUiPreferences as bA, type MindooDBAppUpdateDocumentInput as bB, type MindooDBAppViewCursorDocumentListResult as bC, type MindooDBAppViewCursorResult as bD, type MindooDBAppViewEntry as bE, type MindooDBAppViewEntryKind as bF, type MindooDBAppViewNavigator as bG, type MindooDBAppViewNavigatorExpansionState as bH, type MindooDBAppViewNavigatorOpenOptions as bI, type MindooDBAppViewNavigatorPageOptions as bJ, type MindooDBAppViewNavigatorPageResult as bK, type MindooDBAppViewNavigatorRangeQuery as bL, type MindooDBAppViewNavigatorSelectionState as bM, type MindooDBAppViewUpdateStats as bN, type MindooDBAppViewport as bO, type MindooDBAppWritableAttachmentStream as bP, type MindooDBAppRichTextPatch as ba, type MindooDBAppRichTextScalar as bb, type MindooDBAppRichTextSpliceStep as bc, type MindooDBAppRichTextStep as bd, type MindooDBAppRichTextStepPatch as be, type MindooDBAppRichTextTextSpan as bf, type MindooDBAppRuntime as bg, type MindooDBAppScanAttachmentOptions as bh, type MindooDBAppScanAttachmentResult as bi, type MindooDBAppScopedDocId as bj, type MindooDBAppScopedDocumentSummary as bk, type MindooDBAppSealIntent as bl, type MindooDBAppSession as bm, type MindooDBAppShowMenuInput as bn, type MindooDBAppShowMenuResult as bo, type MindooDBAppSignPreview as bp, type MindooDBAppSignPreviewScope as bq, type MindooDBAppSignStatementInput as br, type MindooDBAppSignStatementResult as bs, type MindooDBAppTextEdit as bt, type MindooDBAppTextPatch as bu, type MindooDBAppThemeMode as bv, type MindooDBAppTimestampApi as bw, type MindooDBAppTimestampInput as bx, type MindooDBAppTimestampProvider as by, type MindooDBAppTimestampResult as bz, type MindooDBAppDocument as c, type MindooDBAppRichTextSpan as d, type MindooDBAppRichTextSnapshot as e, MINDOODB_APP_SEAL_SIGNING_DOMAIN as f, type MindooDBAppAccessDecision as g, type MindooDBAppAccessTier as h, type MindooDBAppAttachmentApi as i, type MindooDBAppAttachmentChunk as j, type MindooDBAppAttachmentInfo as k, type MindooDBAppAttachmentPreviewOptions as l, type MindooDBAppAttachmentPreviewSession as m, type MindooDBAppAutomergeChangesPatch as n, type MindooDBAppAutomergeChangesSince as o, type MindooDBAppAutomergeGetOptions as p, type MindooDBAppAutomergePatchResult as q, type MindooDBAppAutomergeSnapshot as r, type MindooDBAppBridgeConnectMessage as s, type MindooDBAppBridgeConnectOptions as t, type MindooDBAppBridgeConnectedMessage as u, type MindooDBAppBridgeErrorPayload as v, type MindooDBAppBridgeHandshakeErrorMessage as w, type MindooDBAppBridgeLocaleChangedMessage as x, type MindooDBAppBridgePortMessage as y, type MindooDBAppBridgeQueryResultMessage as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mindoodb-app-sdk",
3
- "version": "0.0.37",
3
+ "version": "0.0.38",
4
4
  "engines": {
5
5
  "node": ">=22.13.0"
6
6
  },
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "peerDependencies": {
42
42
  "@automerge/automerge": "^3.3.2",
43
- "mindoodb": ">=0.0.53"
43
+ "mindoodb": ">=0.0.55"
44
44
  },
45
45
  "peerDependenciesMeta": {
46
46
  "@automerge/automerge": {
@@ -52,7 +52,7 @@
52
52
  },
53
53
  "devDependencies": {
54
54
  "@automerge/automerge": "^3.3.2",
55
- "mindoodb": "^0.0.53",
55
+ "mindoodb": "^0.0.55",
56
56
  "@types/node": "25.5.0",
57
57
  "tsup": "^8.5.1",
58
58
  "typescript": "^6.0.2",