mindoodb-app-sdk 0.0.41 → 0.0.42

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.
@@ -1,4 +1,4 @@
1
- import { a8 as MindooDBAppCreateViewNavigatorInput, bJ as MindooDBAppViewNavigator, aH as MindooDBAppLaunchContext, a9 as MindooDBAppDatabaseInfo, ac as MindooDBAppDocumentApi, bL as MindooDBAppViewNavigatorOpenOptions, i as MindooDBAppAttachmentApi, av as MindooDBAppIdentityApi, bz as MindooDBAppTimestampApi, aa as MindooDBAppDirectoryApi, c as MindooDBAppDocument, ar as MindooDBAppFulltextSetup, aq as MindooDBAppExtractionSetup, a as MindooDBAppBridge, bp as MindooDBAppSession, C as MindooDBAppBridgeRpcRequest, au as MindooDBAppHostTheme, bR as MindooDBAppViewport, bD as MindooDBAppUiPreferences, aX as MindooDBAppQueryResult, bQ as MindooDBAppViewUpdateStats, y as MindooDBAppBridgePortMessage } from '../types-B0zYIrv3.js';
1
+ import { ab as MindooDBAppCreateViewNavigatorInput, bN as MindooDBAppViewNavigator, aK as MindooDBAppLaunchContext, ac as MindooDBAppDatabaseInfo, af as MindooDBAppDocumentApi, bP as MindooDBAppViewNavigatorOpenOptions, j as MindooDBAppAttachmentApi, ay as MindooDBAppIdentityApi, bD as MindooDBAppTimestampApi, ad as MindooDBAppDirectoryApi, d as MindooDBAppDocument, au as MindooDBAppFulltextSetup, at as MindooDBAppExtractionSetup, a as MindooDBAppBridge, bs as MindooDBAppSession, F as MindooDBAppBridgeRpcRequest, ax as MindooDBAppHostTheme, bV as MindooDBAppViewport, bH as MindooDBAppUiPreferences, a_ as MindooDBAppQueryResult, bU as MindooDBAppViewUpdateStats, B as MindooDBAppBridgePortMessage } from '../types-DxnCg5IW.js';
2
2
  import * as mindoodb from 'mindoodb';
3
3
  import 'mindoodb-view-language';
4
4
 
@@ -98,6 +98,8 @@ interface CreateMockMindooDBAppSessionOptions {
98
98
  databases?: MockMindooDBAppDatabaseDefinition[];
99
99
  onDisconnect?: () => MaybePromise<void>;
100
100
  sealedChannel?: MockSealedChannelOptions;
101
+ /** Initial contents of `session.storage`. */
102
+ storage?: Record<string, string>;
101
103
  }
102
104
  interface MockMindooDBAppSessionController {
103
105
  bridge: MindooDBAppBridge;
@@ -111,6 +113,8 @@ interface MockMindooDBAppSessionController {
111
113
  emitViewportChange(viewport: MindooDBAppViewport): void;
112
114
  emitUiPreferencesChange(uiPreferences: MindooDBAppUiPreferences): void;
113
115
  emitLocaleChange(locale: string): void;
116
+ /** Runs the app's `onBeforeClose` listeners, as the host does before a teardown. */
117
+ emitBeforeClose(): Promise<void>;
114
118
  }
115
119
 
116
120
  declare function createMockMindooDBAppSession(options?: CreateMockMindooDBAppSessionOptions): MockMindooDBAppSessionController;
@@ -144,6 +148,11 @@ interface FakeBridgeHostController {
144
148
  emitQueryResult(subscriptionId: string, result: MindooDBAppQueryResult): void;
145
149
  /** Push a navigator view-changed event to connected apps. */
146
150
  emitViewChanged(navigatorId: string, stats: MindooDBAppViewUpdateStats): void;
151
+ /**
152
+ * Ask connected apps to flush before teardown, as the Haven host does. Resolves `true`
153
+ * when every port acknowledged and `false` when the grace period ran out.
154
+ */
155
+ requestBeforeClose(timeoutMs?: number): Promise<boolean>;
147
156
  postPortMessage(message: MindooDBAppBridgePortMessage, transfer?: Transferable[]): void;
148
157
  setRequestHandler(method: string, handler: FakeBridgeRequestHandler): void;
149
158
  clearRequestHandler(method: string): void;
@@ -1,3 +1,7 @@
1
+ import {
2
+ releaseMindooDBAppBridgeSessions
3
+ } from "../chunk-6433L6TE.js";
4
+
1
5
  // src/testing/index.ts
2
6
  import * as Automerge from "@automerge/automerge";
3
7
  import {
@@ -762,6 +766,7 @@ function createDefaultLaunchContext(patch) {
762
766
  appVersion: "1.0.0",
763
767
  launchId: "test-launch",
764
768
  runtime: "iframe",
769
+ hosting: "external",
765
770
  theme: {
766
771
  mode: "dark",
767
772
  preset: "mindoo"
@@ -1846,6 +1851,7 @@ function createMockSessionState(options = {}) {
1846
1851
  const viewportListeners = /* @__PURE__ */ new Set();
1847
1852
  const uiPreferencesListeners = /* @__PURE__ */ new Set();
1848
1853
  const localeListeners = /* @__PURE__ */ new Set();
1854
+ const beforeCloseListeners = /* @__PURE__ */ new Set();
1849
1855
  const databaseHandles = /* @__PURE__ */ new Map();
1850
1856
  const databaseViewDocumentLists = /* @__PURE__ */ new Map();
1851
1857
  const databaseViewApis = /* @__PURE__ */ new Map();
@@ -1853,6 +1859,7 @@ function createMockSessionState(options = {}) {
1853
1859
  let activeMenuResolve = null;
1854
1860
  let databaseInfos = [];
1855
1861
  const openSealedChannels = /* @__PURE__ */ new Map();
1862
+ const appStorage = new Map(Object.entries(options.storage ?? {}));
1856
1863
  const requireCapability = (databaseId, capability) => {
1857
1864
  const info = databaseInfos.find((entry) => entry.id === databaseId);
1858
1865
  if (!info) {
@@ -2016,6 +2023,39 @@ function createMockSessionState(options = {}) {
2016
2023
  return view;
2017
2024
  },
2018
2025
  menus,
2026
+ storage: {
2027
+ async snapshot(snapshotOptions) {
2028
+ const prefixes = snapshotOptions?.prefixes;
2029
+ const result = {};
2030
+ appStorage.forEach((value, key) => {
2031
+ if (!prefixes?.length || prefixes.some((prefix) => key.startsWith(prefix))) {
2032
+ result[key] = value;
2033
+ }
2034
+ });
2035
+ return result;
2036
+ },
2037
+ async get(key) {
2038
+ return appStorage.get(key) ?? null;
2039
+ },
2040
+ async set(key, value) {
2041
+ appStorage.set(key, value);
2042
+ },
2043
+ async remove(key) {
2044
+ appStorage.delete(key);
2045
+ },
2046
+ async keys(keysOptions) {
2047
+ const prefix = keysOptions?.prefix;
2048
+ return [...appStorage.keys()].filter((key) => !prefix || key.startsWith(prefix)).sort();
2049
+ },
2050
+ async clear(clearOptions) {
2051
+ const prefix = clearOptions?.prefix;
2052
+ if (!prefix) {
2053
+ appStorage.clear();
2054
+ return;
2055
+ }
2056
+ [...appStorage.keys()].filter((key) => key.startsWith(prefix)).forEach((key) => appStorage.delete(key));
2057
+ }
2058
+ },
2019
2059
  onThemeChange(listener) {
2020
2060
  themeListeners.add(listener);
2021
2061
  return () => {
@@ -2040,6 +2080,12 @@ function createMockSessionState(options = {}) {
2040
2080
  localeListeners.delete(listener);
2041
2081
  };
2042
2082
  },
2083
+ onBeforeClose(listener) {
2084
+ beforeCloseListeners.add(listener);
2085
+ return () => {
2086
+ beforeCloseListeners.delete(listener);
2087
+ };
2088
+ },
2043
2089
  async disconnect() {
2044
2090
  await options.onDisconnect?.();
2045
2091
  }
@@ -2097,6 +2143,9 @@ function createMockSessionState(options = {}) {
2097
2143
  emitLocaleChange(locale) {
2098
2144
  launchContext = mergeLaunchContext(launchContext, { locale });
2099
2145
  localeListeners.forEach((listener) => listener(launchContext.locale));
2146
+ },
2147
+ async emitBeforeClose() {
2148
+ await Promise.all([...beforeCloseListeners].map(async (listener) => listener()));
2100
2149
  }
2101
2150
  };
2102
2151
  }
@@ -2113,7 +2162,8 @@ function createMockMindooDBAppSession(options = {}) {
2113
2162
  emitThemeChange: state.emitThemeChange,
2114
2163
  emitViewportChange: state.emitViewportChange,
2115
2164
  emitUiPreferencesChange: state.emitUiPreferencesChange,
2116
- emitLocaleChange: state.emitLocaleChange
2165
+ emitLocaleChange: state.emitLocaleChange,
2166
+ emitBeforeClose: state.emitBeforeClose
2117
2167
  };
2118
2168
  }
2119
2169
  function createMockMindooDBAppBridge(options = {}) {
@@ -2126,6 +2176,8 @@ function createFakeBridgeHost(options = {}) {
2126
2176
  );
2127
2177
  const requests = [];
2128
2178
  const connectedPorts = /* @__PURE__ */ new Set();
2179
+ const beforeCloseWaiters = /* @__PURE__ */ new Map();
2180
+ let beforeCloseCounter = 0;
2129
2181
  const viewSessions = /* @__PURE__ */ new Map();
2130
2182
  const readStreams = /* @__PURE__ */ new Map();
2131
2183
  const writeStreams = /* @__PURE__ */ new Map();
@@ -2177,6 +2229,7 @@ function createFakeBridgeHost(options = {}) {
2177
2229
  port.close();
2178
2230
  });
2179
2231
  connectedPorts.clear();
2232
+ releaseMindooDBAppBridgeSessions(state.getLaunchContext().launchId);
2180
2233
  if (previousWindowDescriptor) {
2181
2234
  Object.defineProperty(globalThis, "window", previousWindowDescriptor);
2182
2235
  } else if (previousWindowValue !== void 0) {
@@ -2194,6 +2247,7 @@ function createFakeBridgeHost(options = {}) {
2194
2247
  if (installed) {
2195
2248
  return;
2196
2249
  }
2250
+ releaseMindooDBAppBridgeSessions(state.getLaunchContext().launchId);
2197
2251
  previousWindowDescriptor = Object.getOwnPropertyDescriptor(
2198
2252
  globalThis,
2199
2253
  "window"
@@ -2755,6 +2809,10 @@ function createFakeBridgeHost(options = {}) {
2755
2809
  if (!message || message.protocol !== PROTOCOL) {
2756
2810
  return;
2757
2811
  }
2812
+ if (message.kind === "before-close-ack") {
2813
+ beforeCloseWaiters.get(message.closeId)?.();
2814
+ return;
2815
+ }
2758
2816
  if (message.kind === "request") {
2759
2817
  requests.push(message);
2760
2818
  try {
@@ -2880,6 +2938,32 @@ function createFakeBridgeHost(options = {}) {
2880
2938
  };
2881
2939
  connectedPorts.forEach((port) => port.postMessage(payload));
2882
2940
  },
2941
+ async requestBeforeClose(timeoutMs = 500) {
2942
+ if (!connectedPorts.size) {
2943
+ return true;
2944
+ }
2945
+ beforeCloseCounter += 1;
2946
+ const closeId = `close-${beforeCloseCounter}`;
2947
+ let pending = connectedPorts.size;
2948
+ const acknowledged = await new Promise((resolve) => {
2949
+ const timer = setTimeout(() => resolve(false), timeoutMs);
2950
+ beforeCloseWaiters.set(closeId, () => {
2951
+ pending -= 1;
2952
+ if (pending <= 0) {
2953
+ clearTimeout(timer);
2954
+ resolve(true);
2955
+ }
2956
+ });
2957
+ const payload = {
2958
+ protocol: PROTOCOL,
2959
+ kind: "before-close",
2960
+ closeId
2961
+ };
2962
+ connectedPorts.forEach((port) => port.postMessage(payload));
2963
+ });
2964
+ beforeCloseWaiters.delete(closeId);
2965
+ return acknowledged;
2966
+ },
2883
2967
  postPortMessage(message, transfer = []) {
2884
2968
  connectedPorts.forEach((port) => port.postMessage(message, transfer));
2885
2969
  },
@@ -2,6 +2,16 @@ import { MindooDBAppBooleanExpression, MindooDBAppExpression, MindooDBAppViewSor
2
2
 
3
3
  /** Launch target used by the Haven when opening an app. */
4
4
  type MindooDBAppRuntime = "iframe" | "window";
5
+ /**
6
+ * How the host delivers the app's assets.
7
+ *
8
+ * - `"external"` — loaded from the app's own origin. Normal web platform behaviour.
9
+ * - `"hosted"` — the host serves the app's build from its own cache into a sandboxed
10
+ * iframe without `allow-same-origin`. The document then lives in an opaque origin,
11
+ * where `localStorage`, `sessionStorage`, IndexedDB and service worker registration
12
+ * are unavailable and throw on access.
13
+ */
14
+ type MindooDBAppHostingMode = "external" | "hosted";
5
15
  /** Theme mode currently active in the Haven host UI. */
6
16
  type MindooDBAppThemeMode = "light" | "dark";
7
17
  /** Host theme snapshot exposed to running apps. */
@@ -110,6 +120,15 @@ interface MindooDBAppLaunchContext {
110
120
  appVersion?: string;
111
121
  launchId: string;
112
122
  runtime: MindooDBAppRuntime;
123
+ /**
124
+ * How the host delivers this app. `"hosted"` means the host serves the app's own
125
+ * build from its cache under an opaque origin: `localStorage`/`sessionStorage` throw
126
+ * on access and the app must not register a service worker of its own. `"external"`
127
+ * means the app was loaded from its own origin with the usual web platform storage.
128
+ *
129
+ * Available synchronously before the bridge connects via {@link isHostedBundleRuntime}.
130
+ */
131
+ hosting: MindooDBAppHostingMode;
113
132
  theme: MindooDBAppHostTheme;
114
133
  viewport: MindooDBAppViewport | null;
115
134
  uiPreferences: MindooDBAppUiPreferences;
@@ -908,8 +927,30 @@ interface MindooDBAppBridgeViewChangedMessage {
908
927
  navigatorId: string;
909
928
  stats: MindooDBAppViewUpdateStats;
910
929
  }
930
+ /**
931
+ * Host-pushed event announcing that this launch is about to be torn down.
932
+ *
933
+ * Removing an iframe from the DOM discards messages its port has not delivered yet, and
934
+ * `pagehide` does not reliably fire for frames — so an app with queued asynchronous writes
935
+ * would lose them. The host therefore asks first and waits, briefly, for
936
+ * {@link MindooDBAppBridgeBeforeCloseAck}.
937
+ *
938
+ * The host proceeds after a short timeout regardless, so an app that does not answer is
939
+ * not able to block the close.
940
+ */
941
+ interface MindooDBAppBridgeBeforeCloseMessage {
942
+ protocol: "mindoodb-app-bridge";
943
+ kind: "before-close";
944
+ closeId: string;
945
+ }
946
+ /** App acknowledgement that it has finished flushing and is ready to be torn down. */
947
+ interface MindooDBAppBridgeBeforeCloseAck {
948
+ protocol: "mindoodb-app-bridge";
949
+ kind: "before-close-ack";
950
+ closeId: string;
951
+ }
911
952
  /** Any message that can travel across the dedicated bridge MessagePort. */
912
- type MindooDBAppBridgePortMessage = MindooDBAppBridgeRpcMessage | MindooDBAppBridgeStreamMessage | MindooDBAppBridgeThemeChangedMessage | MindooDBAppBridgeViewportChangedMessage | MindooDBAppBridgeUiPreferencesChangedMessage | MindooDBAppBridgeLocaleChangedMessage | MindooDBAppBridgeQueryResultMessage | MindooDBAppBridgeViewChangedMessage;
953
+ type MindooDBAppBridgePortMessage = MindooDBAppBridgeRpcMessage | MindooDBAppBridgeStreamMessage | MindooDBAppBridgeThemeChangedMessage | MindooDBAppBridgeViewportChangedMessage | MindooDBAppBridgeUiPreferencesChangedMessage | MindooDBAppBridgeLocaleChangedMessage | MindooDBAppBridgeQueryResultMessage | MindooDBAppBridgeViewChangedMessage | MindooDBAppBridgeBeforeCloseMessage | MindooDBAppBridgeBeforeCloseAck;
913
954
  /** Placement hint for a host-rendered overlay menu. */
914
955
  type MindooDBAppMenuPlacement = "auto" | "bottom-start" | "bottom-end" | "top-start" | "top-end" | "right-start" | "left-start";
915
956
  /** Semantic hint allowing Haven to tune menu behavior or styling. */
@@ -2016,6 +2057,40 @@ interface MindooDBAppSealedChannelRequestInput {
2016
2057
  /** JSON-serialisable body. Sealed by the host before it leaves the device. */
2017
2058
  payload: unknown;
2018
2059
  }
2060
+ /**
2061
+ * Small key/value store the host keeps on the app's behalf.
2062
+ *
2063
+ * Scoped to the app *registration*, so two registrations of the same app do not see each
2064
+ * other's keys, and the data survives a bundle update. Values are strings; the host
2065
+ * enforces a per-value and a total byte budget and rejects writes beyond it with a
2066
+ * `quota-exceeded` bridge error.
2067
+ *
2068
+ * This exists because a hosted app runs in an opaque origin where `localStorage` is not
2069
+ * available. It is meant for preferences and similar small state — documents belong in a
2070
+ * database, not here.
2071
+ */
2072
+ interface MindooDBAppStorageApi {
2073
+ /**
2074
+ * Read many keys in one round trip. Without `prefixes` it returns everything the app
2075
+ * has stored.
2076
+ *
2077
+ * Apps that replace synchronous `localStorage` access need the whole working set up
2078
+ * front, and doing that as one call instead of N keeps it to a single boot round trip.
2079
+ */
2080
+ snapshot(options?: {
2081
+ prefixes?: string[];
2082
+ }): Promise<Record<string, string>>;
2083
+ get(key: string): Promise<string | null>;
2084
+ set(key: string, value: string): Promise<void>;
2085
+ remove(key: string): Promise<void>;
2086
+ keys(options?: {
2087
+ prefix?: string;
2088
+ }): Promise<string[]>;
2089
+ /** Remove every key, or only those starting with `prefix`. */
2090
+ clear(options?: {
2091
+ prefix?: string;
2092
+ }): Promise<void>;
2093
+ }
2019
2094
  /** Connected session between the running app and the Haven host. */
2020
2095
  interface MindooDBAppSession {
2021
2096
  /**
@@ -2087,6 +2162,11 @@ interface MindooDBAppSession {
2087
2162
  */
2088
2163
  openViewNavigator(viewId: string, options?: MindooDBAppViewNavigatorOpenOptions): Promise<MindooDBAppViewNavigator>;
2089
2164
  menus: MindooDBAppMenuApi;
2165
+ /**
2166
+ * Host-backed key/value storage for this app registration. Usable in both hosting
2167
+ * modes; required in `"hosted"` mode, where `localStorage` throws.
2168
+ */
2169
+ storage: MindooDBAppStorageApi;
2090
2170
  /**
2091
2171
  * Subscribe to host-pushed theme changes (light/dark mode and preset).
2092
2172
  * The initial theme is in `launchContext.theme`. Returns an unsubscribe
@@ -2110,6 +2190,17 @@ interface MindooDBAppSession {
2110
2190
  * new BCP-47 language tag (e.g. `"de"`). Returns an unsubscribe function.
2111
2191
  */
2112
2192
  onLocaleChange(listener: (locale: string) => void): () => void;
2193
+ /**
2194
+ * Run work before the host tears this launch down, e.g. flushing buffered writes.
2195
+ *
2196
+ * The host waits for all registered listeners to settle, but only for a short grace
2197
+ * period — return quickly and do not start new work here. A rejected listener is logged
2198
+ * and does not stop the teardown. Returns an unsubscribe function.
2199
+ *
2200
+ * This does not fire when the browser tab itself goes away; a crash or a killed tab can
2201
+ * still lose whatever was buffered.
2202
+ */
2203
+ onBeforeClose(listener: () => void | Promise<void>): () => void;
2113
2204
  /**
2114
2205
  * Tear down the session: close the bridge port and release all host-side
2115
2206
  * resources of this launch (navigators, live queries, streams). The
@@ -2128,4 +2219,4 @@ interface MindooDBAppBridge {
2128
2219
  connect(options?: MindooDBAppBridgeConnectOptions): Promise<MindooDBAppSession>;
2129
2220
  }
2130
2221
 
2131
- 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 MindooDBAppTimestampInput as bA, type MindooDBAppTimestampProvider as bB, type MindooDBAppTimestampResult as bC, type MindooDBAppUiPreferences as bD, type MindooDBAppUpdateDocumentInput as bE, type MindooDBAppViewCursorDocumentListResult as bF, type MindooDBAppViewCursorResult as bG, type MindooDBAppViewEntry as bH, type MindooDBAppViewEntryKind as bI, type MindooDBAppViewNavigator as bJ, type MindooDBAppViewNavigatorExpansionState as bK, type MindooDBAppViewNavigatorOpenOptions as bL, type MindooDBAppViewNavigatorPageOptions as bM, type MindooDBAppViewNavigatorPageResult as bN, type MindooDBAppViewNavigatorRangeQuery as bO, type MindooDBAppViewNavigatorSelectionState as bP, type MindooDBAppViewUpdateStats as bQ, type MindooDBAppViewport as bR, type MindooDBAppWritableAttachmentStream as bS, 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 MindooDBAppSealedChannelOpenInput as bm, type MindooDBAppSealedChannelOpenResult as bn, type MindooDBAppSealedChannelRequestInput as bo, type MindooDBAppSession as bp, type MindooDBAppShowMenuInput as bq, type MindooDBAppShowMenuResult as br, type MindooDBAppSignPreview as bs, type MindooDBAppSignPreviewScope as bt, type MindooDBAppSignStatementInput as bu, type MindooDBAppSignStatementResult as bv, type MindooDBAppTextEdit as bw, type MindooDBAppTextPatch as bx, type MindooDBAppThemeMode as by, type MindooDBAppTimestampApi 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 };
2222
+ export { type MindooDBAppConfiguredViewFilterMode as $, type MindooDBAppBridgeLocaleChangedMessage as A, type MindooDBAppBridgePortMessage as B, type MindooDBAppBridgeQueryResultMessage as C, type MindooDBAppBridgeRpcError as D, type MindooDBAppBridgeRpcMessage as E, type MindooDBAppBridgeRpcRequest as F, type MindooDBAppBridgeRpcSuccess as G, type MindooDBAppBridgeStreamAbortRequest as H, type MindooDBAppBridgeStreamAck as I, type MindooDBAppBridgeStreamCloseRequest as J, type MindooDBAppBridgeStreamError as K, type MindooDBAppBridgeStreamMessage as L, type MindooDBAppAttachmentPreviewMode as M, type MindooDBAppBridgeStreamOpenResult as N, type MindooDBAppBridgeStreamReadRequest as O, type MindooDBAppBridgeStreamWriteRequest as P, type MindooDBAppBridgeThemeChangedMessage as Q, type MindooDBAppBridgeUiPreferencesChangedMessage as R, type MindooDBAppBridgeViewChangedMessage as S, type MindooDBAppBridgeViewportChangedMessage as T, type MindooDBAppCapability as U, type MindooDBAppConfiguredViewCategorizationStyle as V, type MindooDBAppConfiguredViewColumn as W, type MindooDBAppConfiguredViewColumnRole as X, type MindooDBAppConfiguredViewExpressionMode as Y, type MindooDBAppConfiguredViewFieldExpression as Z, type MindooDBAppConfiguredViewFilterDefinition as _, type MindooDBAppBridge as a, type MindooDBAppQueryRow as a$, type MindooDBAppConfiguredViewFilterRule as a0, type MindooDBAppConfiguredViewFormulaExpression as a1, type MindooDBAppConfiguredViewFormulaFilterDefinition as a2, type MindooDBAppConfiguredViewPreviewMode as a3, type MindooDBAppConfiguredViewRuleFilterDefinition as a4, type MindooDBAppConfiguredViewRuleMatchMode as a5, type MindooDBAppConfiguredViewRuleOperator as a6, type MindooDBAppConfiguredViewValueExpression as a7, type MindooDBAppCreateDocumentInput as a8, type MindooDBAppCreateKeyInfo as a9, type MindooDBAppInaccessibleDocumentListQuery as aA, type MindooDBAppInaccessibleDocumentListResult as aB, type MindooDBAppJsonListDeletePatch as aC, type MindooDBAppJsonListInsertPatch as aD, type MindooDBAppJsonPatch as aE, type MindooDBAppJsonSetPatch as aF, type MindooDBAppJsonTextMarkPatch as aG, type MindooDBAppJsonTextSplicePatch as aH, type MindooDBAppJsonTextUnmarkPatch as aI, type MindooDBAppJsonUnsetPatch as aJ, type MindooDBAppLaunchContext as aK, type MindooDBAppLiveQuerySubscription as aL, type MindooDBAppMenuAnchor as aM, type MindooDBAppMenuApi as aN, type MindooDBAppMenuCommandItem as aO, type MindooDBAppMenuDismissReason as aP, type MindooDBAppMenuDismissedResult as aQ, type MindooDBAppMenuItem as aR, type MindooDBAppMenuKind as aS, type MindooDBAppMenuPlacement as aT, type MindooDBAppMenuPointAnchor as aU, type MindooDBAppMenuRect as aV, type MindooDBAppMenuRectAnchor as aW, type MindooDBAppMenuSelectionResult as aX, type MindooDBAppMenuSeparatorItem as aY, type MindooDBAppQueryCoverage as aZ, type MindooDBAppQueryResult as a_, type MindooDBAppCreateViewInput as aa, type MindooDBAppCreateViewNavigatorInput as ab, type MindooDBAppDatabaseInfo as ac, type MindooDBAppDirectoryApi as ad, type MindooDBAppDirectoryEntry as ae, type MindooDBAppDocumentApi as af, type MindooDBAppDocumentHeadCursorResult as ag, type MindooDBAppDocumentHistoryEntry as ah, type MindooDBAppDocumentListQuery as ai, type MindooDBAppDocumentListResult as aj, type MindooDBAppDocumentQuery as ak, type MindooDBAppDocumentRevisionId as al, type MindooDBAppDocumentScanPreset as am, type MindooDBAppDocumentSummary as an, type MindooDBAppEntryAttachmentRef as ao, type MindooDBAppEntryProvenance as ap, type MindooDBAppExtractDocumentTextInput as aq, type MindooDBAppExtractDocumentTextResult as ar, type MindooDBAppExtractTextFormat as as, type MindooDBAppExtractionSetup as at, type MindooDBAppFulltextSetup as au, type MindooDBAppHistoricalDocument as av, type MindooDBAppHistoryQuery as aw, type MindooDBAppHostTheme as ax, type MindooDBAppIdentityApi as ay, type MindooDBAppInaccessibleDocument as az, type MindooDBAppHostingMode as b, type MindooDBAppQuerySortKey as b0, type MindooDBAppQueryTextClause as b1, type MindooDBAppReadableAttachmentStream as b2, type MindooDBAppRecipientOptions as b3, type MindooDBAppResolvedViewDefinition as b4, type MindooDBAppResolvedViewSource as b5, type MindooDBAppRevisionPhase as b6, type MindooDBAppRevisionVerification as b7, type MindooDBAppRichTextBlockSpan as b8, type MindooDBAppRichTextGetOptions as b9, type MindooDBAppTextEdit as bA, type MindooDBAppTextPatch as bB, type MindooDBAppThemeMode as bC, type MindooDBAppTimestampApi as bD, type MindooDBAppTimestampInput as bE, type MindooDBAppTimestampProvider as bF, type MindooDBAppTimestampResult as bG, type MindooDBAppUiPreferences as bH, type MindooDBAppUpdateDocumentInput as bI, type MindooDBAppViewCursorDocumentListResult as bJ, type MindooDBAppViewCursorResult as bK, type MindooDBAppViewEntry as bL, type MindooDBAppViewEntryKind as bM, type MindooDBAppViewNavigator as bN, type MindooDBAppViewNavigatorExpansionState as bO, type MindooDBAppViewNavigatorOpenOptions as bP, type MindooDBAppViewNavigatorPageOptions as bQ, type MindooDBAppViewNavigatorPageResult as bR, type MindooDBAppViewNavigatorRangeQuery as bS, type MindooDBAppViewNavigatorSelectionState as bT, type MindooDBAppViewUpdateStats as bU, type MindooDBAppViewport as bV, type MindooDBAppWritableAttachmentStream as bW, type MindooDBAppRichTextImmutableString as ba, type MindooDBAppRichTextMarkRange as bb, type MindooDBAppRichTextMaterializeValue as bc, type MindooDBAppRichTextPatch as bd, type MindooDBAppRichTextScalar as be, type MindooDBAppRichTextSpliceStep as bf, type MindooDBAppRichTextStep as bg, type MindooDBAppRichTextStepPatch as bh, type MindooDBAppRichTextTextSpan as bi, type MindooDBAppRuntime as bj, type MindooDBAppScanAttachmentOptions as bk, type MindooDBAppScanAttachmentResult as bl, type MindooDBAppScopedDocId as bm, type MindooDBAppScopedDocumentSummary as bn, type MindooDBAppSealIntent as bo, type MindooDBAppSealedChannelOpenInput as bp, type MindooDBAppSealedChannelOpenResult as bq, type MindooDBAppSealedChannelRequestInput as br, type MindooDBAppSession as bs, type MindooDBAppShowMenuInput as bt, type MindooDBAppShowMenuResult as bu, type MindooDBAppSignPreview as bv, type MindooDBAppSignPreviewScope as bw, type MindooDBAppSignStatementInput as bx, type MindooDBAppSignStatementResult as by, type MindooDBAppStorageApi as bz, type MindooDBAppDatabase as c, type MindooDBAppDocument as d, type MindooDBAppRichTextSpan as e, type MindooDBAppRichTextSnapshot as f, MINDOODB_APP_SEAL_SIGNING_DOMAIN as g, type MindooDBAppAccessDecision as h, type MindooDBAppAccessTier as i, type MindooDBAppAttachmentApi as j, type MindooDBAppAttachmentChunk as k, type MindooDBAppAttachmentInfo as l, type MindooDBAppAttachmentPreviewOptions as m, type MindooDBAppAttachmentPreviewSession as n, type MindooDBAppAutomergeChangesPatch as o, type MindooDBAppAutomergeChangesSince as p, type MindooDBAppAutomergeGetOptions as q, type MindooDBAppAutomergePatchResult as r, type MindooDBAppAutomergeSnapshot as s, type MindooDBAppBridgeBeforeCloseAck as t, type MindooDBAppBridgeBeforeCloseMessage as u, type MindooDBAppBridgeConnectMessage as v, type MindooDBAppBridgeConnectOptions as w, type MindooDBAppBridgeConnectedMessage as x, type MindooDBAppBridgeErrorPayload as y, type MindooDBAppBridgeHandshakeErrorMessage as z };
@@ -0,0 +1,46 @@
1
+ export { g as MindooDBAppBundleManifest } from '../appBundleManifest-B0xfpaXG.js';
2
+
3
+ interface HavenBundleOptions {
4
+ /**
5
+ * Stable application identifier written to the manifest. Defaults to the `name` field
6
+ * of the project's package.json.
7
+ */
8
+ appId?: string;
9
+ /**
10
+ * Human-readable version. Defaults to the `version` field of the project's
11
+ * package.json. Informational only — the host keys updates off the content hash.
12
+ */
13
+ version?: string;
14
+ /**
15
+ * Entry HTML file relative to the build output directory. Auto-detected when omitted:
16
+ * root `index.html`, else a nested `index.html`, else the first HTML file.
17
+ */
18
+ entry?: string;
19
+ /**
20
+ * Additional exclusion predicate, evaluated with the bundle-relative POSIX path. Return
21
+ * `true` to keep the file out of the bundle.
22
+ */
23
+ exclude?: (relativePath: string) => boolean;
24
+ /** Skip `.map` files. Defaults to `true` — source maps only bloat the download. */
25
+ excludeSourcemaps?: boolean;
26
+ }
27
+ interface ResolvedViteConfig {
28
+ root: string;
29
+ build: {
30
+ outDir: string;
31
+ };
32
+ }
33
+ /** Structural subset of Vite's `Plugin`, so the SDK does not need to depend on Vite. */
34
+ interface HavenBundleVitePlugin {
35
+ name: string;
36
+ apply: "build";
37
+ configResolved: (config: ResolvedViteConfig) => void;
38
+ closeBundle: () => Promise<void>;
39
+ }
40
+ /**
41
+ * Emits `haven-bundle.json` and `haven-bundle.zip` next to the build output so a MindooDB
42
+ * host can install and update the app from a URL.
43
+ */
44
+ declare function havenBundle(options?: HavenBundleOptions): HavenBundleVitePlugin;
45
+
46
+ export { type HavenBundleOptions, type HavenBundleVitePlugin, havenBundle };