@happyvertical/smrt-web 0.43.1 → 0.43.3
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/AGENTS.md +1 -0
- package/README.md +7 -0
- package/dist/chunks/{src-CDdW9uYx.js → src-D9RvoJSQ.js} +421 -2
- package/dist/chunks/src-D9RvoJSQ.js.map +1 -0
- package/dist/index.d.ts +66 -0
- package/dist/index.js +2 -2
- package/dist/webmcp.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/src-CDdW9uYx.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -131,6 +131,14 @@ export declare function createSmrtWebClient(): SmrtWebClient;
|
|
|
131
131
|
*/
|
|
132
132
|
export declare function createSmrtWebEventSubscriber(config: SmrtWebEventSubscriberConfig): SmrtWebEventSubscriber;
|
|
133
133
|
|
|
134
|
+
/**
|
|
135
|
+
* Create a query controller over one SMRT collection. Query rows stay in a
|
|
136
|
+
* separate keyed cache; the collection's full list is never loaded.
|
|
137
|
+
*/
|
|
138
|
+
export declare function createSmrtWebQuery<TData extends object>(_collection: SmrtWebCollection<TData>, transport: SmrtWebQueryTransport, options?: {
|
|
139
|
+
staleTimeMs?: number;
|
|
140
|
+
}): SmrtWebQuery<TData>;
|
|
141
|
+
|
|
134
142
|
/**
|
|
135
143
|
* Create the framework-free `updateAvailable` primitive. Kicks off async
|
|
136
144
|
* contract detection immediately (compare running vs. persisted manifest hash);
|
|
@@ -1040,6 +1048,64 @@ export declare interface SmrtWebMutationEnvelope {
|
|
|
1040
1048
|
readonly baseUpdatedAt?: string;
|
|
1041
1049
|
}
|
|
1042
1050
|
|
|
1051
|
+
export declare interface SmrtWebQuery<TData extends object = object> {
|
|
1052
|
+
readonly state: SmrtWebQueryState<TData>;
|
|
1053
|
+
readonly request: SmrtWebDataQueryRequest | undefined;
|
|
1054
|
+
execute(request: SmrtWebDataQueryRequest, options?: SmrtWebQueryRunOptions): Promise<SmrtWebDataQueryResult>;
|
|
1055
|
+
refresh(options?: Omit<SmrtWebQueryRunOptions, 'mode' | 'force'>): Promise<SmrtWebDataQueryResult | undefined>;
|
|
1056
|
+
retry(): Promise<SmrtWebDataQueryResult | undefined>;
|
|
1057
|
+
subscribe(listener: (state: SmrtWebQueryState<TData>) => void): () => void;
|
|
1058
|
+
subscribeLive(): SmrtWebQueryLiveSubscription | undefined;
|
|
1059
|
+
invalidate(): void;
|
|
1060
|
+
dispose(): void;
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
export declare interface SmrtWebQueryLiveSubscription {
|
|
1064
|
+
unsubscribe(): void;
|
|
1065
|
+
reconnect(): void;
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
/** How a query run is allowed to affect the visible query state. */
|
|
1069
|
+
export declare type SmrtWebQueryMode = 'visible' | 'background' | 'prefetch' | 'silent';
|
|
1070
|
+
|
|
1071
|
+
export declare interface SmrtWebQueryPage {
|
|
1072
|
+
kind: 'offset' | 'cursor';
|
|
1073
|
+
limit: number;
|
|
1074
|
+
offset?: number;
|
|
1075
|
+
nextCursor?: string;
|
|
1076
|
+
hasMore: boolean;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
export declare interface SmrtWebQueryRunOptions {
|
|
1080
|
+
mode?: SmrtWebQueryMode;
|
|
1081
|
+
signal?: AbortSignal;
|
|
1082
|
+
/** Cancel this run after the given number of milliseconds. */
|
|
1083
|
+
deadlineMs?: number;
|
|
1084
|
+
/** Bypass the keyed cache and execute a fresh request (used by refresh). */
|
|
1085
|
+
force?: boolean;
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
export declare interface SmrtWebQueryState<TData extends object = object> {
|
|
1089
|
+
readonly rows: ReadonlyArray<TData>;
|
|
1090
|
+
readonly page: SmrtWebQueryPage | undefined;
|
|
1091
|
+
readonly total: SmrtWebDataQueryResult['total'] | undefined;
|
|
1092
|
+
readonly loading: boolean;
|
|
1093
|
+
readonly refreshing: boolean;
|
|
1094
|
+
readonly stale: boolean;
|
|
1095
|
+
readonly error: unknown;
|
|
1096
|
+
readonly lastUpdated: number | undefined;
|
|
1097
|
+
readonly result: SmrtWebDataQueryResult | undefined;
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
export declare interface SmrtWebQueryTransport extends SmrtWebDataQueryTransport {
|
|
1101
|
+
/** Subscribe to changes for this exact query, not the entire collection. */
|
|
1102
|
+
subscribe?(request: SmrtWebDataQueryRequest, onResult: (result: unknown) => void, options?: {
|
|
1103
|
+
signal?: AbortSignal;
|
|
1104
|
+
}): SmrtWebQueryLiveSubscription | {
|
|
1105
|
+
unsubscribe(): void;
|
|
1106
|
+
};
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1043
1109
|
/**
|
|
1044
1110
|
* A manifest-derived edge from this collection to a sibling REST collection,
|
|
1045
1111
|
* emitted by the `@happyvertical/smrt-virt-web` virtual module. When a mutation
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { DEFAULT_PERSIST_DEBOUNCE_MS, MAX_SMRT_WEB_DATA_QUERY_CONTAINER_ITEMS, MAX_SMRT_WEB_DATA_QUERY_FACETS, MAX_SMRT_WEB_DATA_QUERY_FACET_VALUES, MAX_SMRT_WEB_DATA_QUERY_OFFSET, MAX_SMRT_WEB_DATA_QUERY_PAGE_LIMIT, MAX_SMRT_WEB_DATA_QUERY_RESULT_BYTES, MAX_SMRT_WEB_DATA_QUERY_ROWS, MAX_SMRT_WEB_DATA_QUERY_STRING_LENGTH, MAX_SMRT_WEB_DATA_QUERY_WARNINGS, SmrtWebRequestError, buildListQuery, createDefinitionFetchers, createSmrtCollection, createSmrtWebClient, createSmrtWebEventSubscriber, createUpdateState, durableStoreNamespace, executeSmrtWebDataQuery, getEngineCollection, getOutboxHandle, liveInvalidation, newLocalId, normalizeSmrtWebDataQueryResult, offlineOutbox, persistCollection, registerDurableResource, registerWebMcpTools, runWrapMutation, unwrapItemResult, unwrapListResult, wipeDurableStore };
|
|
1
|
+
import { A as MAX_SMRT_WEB_DATA_QUERY_WARNINGS, C as MAX_SMRT_WEB_DATA_QUERY_FACETS, D as MAX_SMRT_WEB_DATA_QUERY_RESULT_BYTES, E as MAX_SMRT_WEB_DATA_QUERY_PAGE_LIMIT, M as normalizeSmrtWebDataQueryResult, N as runWrapMutation, O as MAX_SMRT_WEB_DATA_QUERY_ROWS, S as MAX_SMRT_WEB_DATA_QUERY_CONTAINER_ITEMS, T as MAX_SMRT_WEB_DATA_QUERY_OFFSET, _ as getOutboxHandle, a as createSmrtWebClient, b as registerDurableResource, c as unwrapItemResult, d as createUpdateState, f as createSmrtWebEventSubscriber, g as persistCollection, h as DEFAULT_PERSIST_DEBOUNCE_MS, i as createSmrtCollection, j as executeSmrtWebDataQuery, k as MAX_SMRT_WEB_DATA_QUERY_STRING_LENGTH, l as unwrapListResult, m as createSmrtWebQuery, n as buildListQuery, o as getEngineCollection, p as liveInvalidation, r as createDefinitionFetchers, s as newLocalId, t as SmrtWebRequestError, u as registerWebMcpTools, v as offlineOutbox, w as MAX_SMRT_WEB_DATA_QUERY_FACET_VALUES, x as wipeDurableStore, y as durableStoreNamespace } from "./chunks/src-D9RvoJSQ.js";
|
|
2
|
+
export { DEFAULT_PERSIST_DEBOUNCE_MS, MAX_SMRT_WEB_DATA_QUERY_CONTAINER_ITEMS, MAX_SMRT_WEB_DATA_QUERY_FACETS, MAX_SMRT_WEB_DATA_QUERY_FACET_VALUES, MAX_SMRT_WEB_DATA_QUERY_OFFSET, MAX_SMRT_WEB_DATA_QUERY_PAGE_LIMIT, MAX_SMRT_WEB_DATA_QUERY_RESULT_BYTES, MAX_SMRT_WEB_DATA_QUERY_ROWS, MAX_SMRT_WEB_DATA_QUERY_STRING_LENGTH, MAX_SMRT_WEB_DATA_QUERY_WARNINGS, SmrtWebRequestError, buildListQuery, createDefinitionFetchers, createSmrtCollection, createSmrtWebClient, createSmrtWebEventSubscriber, createSmrtWebQuery, createUpdateState, durableStoreNamespace, executeSmrtWebDataQuery, getEngineCollection, getOutboxHandle, liveInvalidation, newLocalId, normalizeSmrtWebDataQueryResult, offlineOutbox, persistCollection, registerDurableResource, registerWebMcpTools, runWrapMutation, unwrapItemResult, unwrapListResult, wipeDurableStore };
|
package/dist/webmcp.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { u as registerWebMcpTools } from "./chunks/src-
|
|
1
|
+
import { u as registerWebMcpTools } from "./chunks/src-D9RvoJSQ.js";
|
|
2
2
|
export { registerWebMcpTools };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-web",
|
|
3
|
-
"version": "0.43.
|
|
3
|
+
"version": "0.43.3",
|
|
4
4
|
"description": "SMRT browser client data runtime: typed collection factory wrapping the client-data engine over generated REST clients",
|
|
5
5
|
"author": "HappyVertical",
|
|
6
6
|
"type": "module",
|