@powerhousedao/reactor-browser 6.2.3-dev.5 → 6.2.3-dev.50
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/{attachment-service-D3EhiAJ7.d.ts → attachment-service-B-nLR114.d.ts} +299 -60
- package/dist/attachment-service-B-nLR114.d.ts.map +1 -0
- package/dist/{client-BIHN_UyR.d.ts → client-C-tRLfRN.d.ts} +3 -3
- package/dist/client-C-tRLfRN.d.ts.map +1 -0
- package/dist/{client-D66jVnot.js → client-CZyHv02L.js} +197 -32
- package/dist/client-CZyHv02L.js.map +1 -0
- package/dist/{client-DjK30EQ-.js → client-Cq5avLW5.js} +35 -22
- package/dist/client-Cq5avLW5.js.map +1 -0
- package/dist/{document-by-id-B4FIzG1w.js → dispatch-C1VVTn5S.js} +393 -54
- package/dist/dispatch-C1VVTn5S.js.map +1 -0
- package/dist/document-by-id-BRDkvmpn.js +16 -0
- package/dist/document-by-id-BRDkvmpn.js.map +1 -0
- package/dist/{document-model-modules-bTP87nyr.js → document-model-modules-Gsh1Xr7j.js} +60 -68
- package/dist/document-model-modules-Gsh1Xr7j.js.map +1 -0
- package/dist/{document-operations-WeE6wIDt.js → document-operations-CpzMebZ3.js} +595 -126
- package/dist/document-operations-CpzMebZ3.js.map +1 -0
- package/dist/{global-OuINvEGT.d.ts → global-BvawOKrQ.d.ts} +57 -13
- package/dist/global-BvawOKrQ.d.ts.map +1 -0
- package/dist/{index-B33TKEqp.d.ts → index-Cjf5TGen.d.ts} +19 -98
- package/dist/index-Cjf5TGen.d.ts.map +1 -0
- package/dist/{index-BIVDXw3K.d.ts → index-rtDmzViP.d.ts} +3 -3
- package/dist/index-rtDmzViP.d.ts.map +1 -0
- package/dist/index.d.ts +395 -371
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +114 -39
- package/dist/index.js.map +1 -1
- package/dist/inspector-proxy-DKOjxSGE.d.ts +32 -0
- package/dist/inspector-proxy-DKOjxSGE.d.ts.map +1 -0
- package/dist/{make-ph-event-functions-DBq3iWYn.js → make-ph-event-functions-CdsvEl5t.js} +4 -2
- package/dist/{make-ph-event-functions-DBq3iWYn.js.map → make-ph-event-functions-CdsvEl5t.js.map} +1 -1
- package/dist/{pglite-CntadC_p-9NDG14dS.d.ts → pglite-CntadC_p-DTkdF8sr.d.ts} +11 -33
- package/dist/pglite-CntadC_p-DTkdF8sr.d.ts.map +1 -0
- package/dist/{relational-D1RB45sA.js → relational-DxHuX41f.js} +66 -5
- package/dist/relational-DxHuX41f.js.map +1 -0
- package/dist/{renown-rqK8sokh.js → renown-CPAeJt5L.js} +7 -8
- package/dist/{renown-rqK8sokh.js.map → renown-CPAeJt5L.js.map} +1 -1
- package/dist/{renown-BHxwP7xU.js → renown-D05wkobG.js} +2 -2
- package/dist/{renown-BHxwP7xU.js.map → renown-D05wkobG.js.map} +1 -1
- package/dist/src/ai/index.d.ts +51 -62
- package/dist/src/ai/index.d.ts.map +1 -1
- package/dist/src/ai/index.js +5 -8
- package/dist/src/ai/index.js.map +1 -1
- package/dist/src/analytics/index.d.ts +36 -44
- package/dist/src/analytics/index.d.ts.map +1 -1
- package/dist/src/analytics/index.js +2 -2
- package/dist/src/analytics/index.js.map +1 -1
- package/dist/src/document-model.d.ts +3 -4
- package/dist/src/document-model.d.ts.map +1 -1
- package/dist/src/document-model.js.map +1 -1
- package/dist/src/graphql/client.d.ts +4 -3
- package/dist/src/graphql/client.js +1 -1
- package/dist/src/graphql-client/entry.d.ts +5 -4
- package/dist/src/graphql-client/entry.js +4 -4
- package/dist/src/relational/index.d.ts +15 -9
- package/dist/src/relational/index.d.ts.map +1 -1
- package/dist/src/relational/index.js +1 -1
- package/dist/src/renown/index.d.ts +3 -2
- package/dist/src/renown/index.js +2 -2
- package/dist/src/rpc/index.d.ts +94 -110
- package/dist/src/rpc/index.d.ts.map +1 -1
- package/dist/src/rpc/index.js +264 -607
- package/dist/src/rpc/index.js.map +1 -1
- package/dist/{store-BJYcr_FL.js → store-DInXcjal.js} +1 -1
- package/dist/{store-BJYcr_FL.js.map → store-DInXcjal.js.map} +1 -1
- package/dist/{switchboard-CaXQ4-5Q.js → switchboard-3vHbIV5W.js} +58 -6
- package/dist/switchboard-3vHbIV5W.js.map +1 -0
- package/dist/{types-6vDzbRRS.d.ts → types-520nWrB3.d.ts} +2 -2
- package/dist/types-520nWrB3.d.ts.map +1 -0
- package/dist/{types-Dcv1ZLoW.d.ts → types-D0ugg0E1.d.ts} +224 -17
- package/dist/types-D0ugg0E1.d.ts.map +1 -0
- package/package.json +19 -20
- package/dist/attachment-service-D3EhiAJ7.d.ts.map +0 -1
- package/dist/client-BIHN_UyR.d.ts.map +0 -1
- package/dist/client-D66jVnot.js.map +0 -1
- package/dist/client-DjK30EQ-.js.map +0 -1
- package/dist/document-by-id-B4FIzG1w.js.map +0 -1
- package/dist/document-model-modules-bTP87nyr.js.map +0 -1
- package/dist/document-operations-WeE6wIDt.js.map +0 -1
- package/dist/global-OuINvEGT.d.ts.map +0 -1
- package/dist/index-B33TKEqp.d.ts.map +0 -1
- package/dist/index-BIVDXw3K.d.ts.map +0 -1
- package/dist/inspector-proxy-6h5VKAwt.d.ts +0 -257
- package/dist/inspector-proxy-6h5VKAwt.d.ts.map +0 -1
- package/dist/pglite-CntadC_p-9NDG14dS.d.ts.map +0 -1
- package/dist/relational-D1RB45sA.js.map +0 -1
- package/dist/switchboard-CaXQ4-5Q.js.map +0 -1
- package/dist/types-6vDzbRRS.d.ts.map +0 -1
- package/dist/types-Dcv1ZLoW.d.ts.map +0 -1
|
@@ -1,34 +1,41 @@
|
|
|
1
|
-
import { a as PHGlobal$1, b as IPackagesListener, ct as
|
|
2
|
-
import { t as PGlite } from "./pglite-CntadC_p-
|
|
3
|
-
import { A as ViewFilterInput, C as GetDocumentQuery, D as PropagationMode$1, E as PhDocumentFieldsFragment, O as Scalars, S as GetDocumentOperationsQuery, b as DocumentChangesSubscription, c as ReactorGraphQLClient, g as ActionInput, k as SdkFunctionWrapper } from "./types-
|
|
1
|
+
import { a as PHGlobal$1, at as DocumentRefetchState, b as IPackagesListener, ct as IOperationCache, d as UsePHGlobalValue$1, dt as PromiseWithState, lt as OperationsCacheEntry, rt as IReactorBrowserClient$1, st as IDocumentCache, u as SetPHGlobalValue$1, ut as PromiseState, v as IPackageListerUnsubscribe, x as PackageManagerInstallResult, y as IPackageManager } from "./global-BvawOKrQ.js";
|
|
2
|
+
import { t as PGlite } from "./pglite-CntadC_p-DTkdF8sr.js";
|
|
3
|
+
import { A as ViewFilterInput, C as GetDocumentQuery, D as PropagationMode$1, E as PhDocumentFieldsFragment, O as Scalars, S as GetDocumentOperationsQuery, b as DocumentChangesSubscription, c as ReactorGraphQLClient, g as ActionInput, k as SdkFunctionWrapper } from "./types-D0ugg0E1.js";
|
|
4
4
|
import { Action, DocumentModelLib, DocumentModelModule, Operation, PHDocument } from "document-model";
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import { Database, DocumentChangeEvent, DocumentModelSource, IDocumentModelRegistry, ISyncManager, OperationFilter, PagedResults, PagingOptions, PropagationMode, SearchFilter, ViewFilter } from "@powerhousedao/reactor";
|
|
5
|
+
import { BatchExecutionRequest, BatchExecutionResult, Database, DocumentChangeEvent, DocumentModelSource, DocumentRelationship, IDocumentModelRegistry, ISyncManager, JobInfo, OperationFilter, PagedResults, PagingOptions, PropagationMode, SearchFilter, ViewFilter } from "@powerhousedao/reactor";
|
|
6
|
+
import { Action as Action$1, ActionSigningTarget, DocumentModelModule as DocumentModelModule$1, DocumentOperations, ISigner, Operation as Operation$1, PHBaseState, PHDocument as PHDocument$1, PHDocumentHeader, ProtocolVersions, SignaturePolicy } from "@powerhousedao/shared/document-model";
|
|
8
7
|
import { ReactNode } from "react";
|
|
9
8
|
import { GraphQLClient, Variables } from "graphql-request";
|
|
10
|
-
import * as graphql from "graphql";
|
|
11
9
|
import { DocumentNode } from "graphql";
|
|
12
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
13
10
|
import { IAttachmentService } from "@powerhousedao/reactor-attachments/client";
|
|
14
11
|
import { Kysely } from "kysely";
|
|
15
12
|
import { AddPHGlobalEventHandler, BrowserReactorClientModule, IReactorBrowserClient, SetPHGlobalValue, UsePHGlobalValue, WorkerReactorClientModule } from "@powerhousedao/reactor-browser";
|
|
16
13
|
import { RegistryPackageSource } from "@powerhousedao/shared";
|
|
17
|
-
|
|
14
|
+
//#region src/document-refetcher.d.ts
|
|
15
|
+
/** The refetch snapshot of a document with nothing in flight and no kept failure. */
|
|
16
|
+
declare const IDLE_REFETCH_STATE: DocumentRefetchState;
|
|
17
|
+
//#endregion
|
|
18
18
|
//#region src/document-cache.d.ts
|
|
19
19
|
declare function addPromiseState<T>(promise: Promise<T>): PromiseWithState<T>;
|
|
20
20
|
declare function readPromiseState<T>(promise: Promise<T> | PromiseWithState<T>): PromiseState<T>;
|
|
21
|
+
/** The snapshot every uncached document scope reads as. One frozen object, so `useSyncExternalStore` sees a stable value. */
|
|
22
|
+
declare const IDLE_OPERATIONS_ENTRY: OperationsCacheEntry;
|
|
23
|
+
/** Whether a document cache also serves operation history. `GraphQLClientDocumentCache` does not. */
|
|
24
|
+
declare function isOperationCache(cache: unknown): cache is IOperationCache;
|
|
21
25
|
/**
|
|
22
26
|
* Document cache implementation that uses the new ReactorClient API.
|
|
23
27
|
*
|
|
24
28
|
* This cache subscribes to document change events via IReactorBrowserClient.subscribe()
|
|
25
29
|
* and automatically updates the cache when documents are created, updated, or deleted.
|
|
30
|
+
* It also holds paginated operation history per document scope (see `IOperationCache`),
|
|
31
|
+
* which is dropped for a document whenever a change event for it arrives.
|
|
26
32
|
*/
|
|
27
|
-
declare class DocumentCache implements IDocumentCache {
|
|
33
|
+
declare class DocumentCache implements IDocumentCache, IOperationCache {
|
|
28
34
|
private client;
|
|
29
35
|
private documents;
|
|
30
36
|
private batchPromises;
|
|
31
37
|
private listeners;
|
|
38
|
+
private refetcher;
|
|
32
39
|
/**
|
|
33
40
|
* Cache keys that fetched a document under a name other than its id --
|
|
34
41
|
* slugs, which `client.get` resolves. Change events dispatch by `header.id`,
|
|
@@ -37,19 +44,55 @@ declare class DocumentCache implements IDocumentCache {
|
|
|
37
44
|
* the same document is cached under.
|
|
38
45
|
*/
|
|
39
46
|
private aliasKeys;
|
|
47
|
+
/** Operations by document id, then scope. Entries are replaced, never mutated. */
|
|
48
|
+
private operationEntries;
|
|
49
|
+
/** In-flight controllers and the next page's cursor/limit, by document id then scope. */
|
|
50
|
+
private operationRequests;
|
|
51
|
+
private operationListeners;
|
|
40
52
|
private unsubscribe;
|
|
41
53
|
constructor(client: IReactorBrowserClient$1);
|
|
42
54
|
private handleDocumentChange;
|
|
43
55
|
private handleDocumentDeleted;
|
|
44
56
|
private handleDocumentUpdated;
|
|
57
|
+
private notifyListeners;
|
|
45
58
|
/** The id an event dispatches by, plus every alias the document is cached under. */
|
|
46
59
|
private cacheKeysFor;
|
|
47
60
|
/** Records that `key` cached the document change events know as `header.id`. */
|
|
48
61
|
private recordAlias;
|
|
49
62
|
private invalidateBatchesContaining;
|
|
50
63
|
get(id: string, refetch?: boolean): Promise<PHDocument$1>;
|
|
64
|
+
getRefetchState(id: string): DocumentRefetchState;
|
|
51
65
|
getBatch(ids: string[]): Promise<PHDocument$1[]>;
|
|
52
66
|
subscribe(id: string | string[], callback: () => void): () => void;
|
|
67
|
+
getOperationsState(documentId: string, scope: string): OperationsCacheEntry;
|
|
68
|
+
loadOperations(documentId: string, scope: string, limit: number): void;
|
|
69
|
+
loadMoreOperations(documentId: string, scope: string): void;
|
|
70
|
+
/**
|
|
71
|
+
* Bring a document's cached scopes up to date after it changed, without
|
|
72
|
+
* throwing away what is already loaded.
|
|
73
|
+
*
|
|
74
|
+
* The operation stream is append-only: an update adds operations at higher
|
|
75
|
+
* revisions and never rewrites the ones below, so history already paged in
|
|
76
|
+
* is still correct. Dropping it meant a panel showing a fully loaded
|
|
77
|
+
* document re-walked every page on each edit -- the cost of which grows
|
|
78
|
+
* with the document, exactly where it hurts most. Each scope instead asks
|
|
79
|
+
* only for what comes after the newest revision it holds, using the
|
|
80
|
+
* `sinceRevision` filter, and appends the answer.
|
|
81
|
+
*
|
|
82
|
+
* A scope that has not finished paging is dropped as before: it has no
|
|
83
|
+
* meaningful "newest revision" to resume from, since asking for everything
|
|
84
|
+
* past the newest row it happens to hold would skip the pages between that
|
|
85
|
+
* row and the end of the stream.
|
|
86
|
+
*/
|
|
87
|
+
private refreshOperations;
|
|
88
|
+
/** Drops one scope of a document, aborting its request if one is in flight. */
|
|
89
|
+
private invalidateOperationsScope;
|
|
90
|
+
invalidateOperations(documentId: string): void;
|
|
91
|
+
subscribeOperations(documentId: string, callback: () => void): () => void;
|
|
92
|
+
private settleOperationsPage;
|
|
93
|
+
private setOperationsEntry;
|
|
94
|
+
private setOperationsRequest;
|
|
95
|
+
private notifyOperationListeners;
|
|
53
96
|
/**
|
|
54
97
|
* Disposes of the cache and unsubscribes from document change events.
|
|
55
98
|
*/
|
|
@@ -65,14 +108,22 @@ type RemoteOperationResultPage = GetDocumentOperationsQuery["documentOperations"
|
|
|
65
108
|
* Options for creating a RemoteDocumentController.
|
|
66
109
|
*/
|
|
67
110
|
type RemoteControllerOptions = {
|
|
68
|
-
client: RemoteControllerGraphQLClient;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
111
|
+
client: RemoteControllerGraphQLClient;
|
|
112
|
+
/** Remote document id. Omit for new documents. */
|
|
113
|
+
documentId?: string;
|
|
114
|
+
/** "batch" requires explicit push(), "streaming" auto-pushes after actions. Defaults to "batch" */
|
|
115
|
+
mode?: "batch" | "streaming";
|
|
116
|
+
/** Optional signer for action signing. */
|
|
117
|
+
signer?: ISigner;
|
|
118
|
+
/** Branch name, defaults to "main". */
|
|
119
|
+
branch?: string;
|
|
120
|
+
/** Parent document identifier for creating new documents. */
|
|
121
|
+
parentIdentifier?: string;
|
|
122
|
+
/** Conflict resolution strategy when remote has new operations. Default: no check (current behavior). */
|
|
123
|
+
onConflict?: ConflictStrategy;
|
|
124
|
+
/** Called when a streaming-mode push fails. If not provided, errors are silently swallowed. */
|
|
125
|
+
onPushError?: (error: unknown) => void;
|
|
126
|
+
/** Number of operations to fetch per page. Defaults to 100. */
|
|
76
127
|
operationsPageSize?: number;
|
|
77
128
|
};
|
|
78
129
|
/**
|
|
@@ -80,7 +131,8 @@ type RemoteControllerOptions = {
|
|
|
80
131
|
*/
|
|
81
132
|
type PushResult = {
|
|
82
133
|
remoteDocument: RemoteDocumentData;
|
|
83
|
-
actionCount: number;
|
|
134
|
+
actionCount: number;
|
|
135
|
+
/** The actions that were sent to the server (after signing, if applicable). */
|
|
84
136
|
operations: ReadonlyArray<Action$1>;
|
|
85
137
|
};
|
|
86
138
|
/**
|
|
@@ -102,9 +154,13 @@ type TrackedAction = {
|
|
|
102
154
|
};
|
|
103
155
|
/** Information about a detected conflict. */
|
|
104
156
|
type ConflictInfo = {
|
|
105
|
-
/** Remote operations added since the last pull, grouped by scope. */
|
|
106
|
-
|
|
107
|
-
|
|
157
|
+
/** Remote operations added since the last pull, grouped by scope. */
|
|
158
|
+
remoteOperations: Record<string, RemoteOperation[]>;
|
|
159
|
+
/** Local actions pending push. */
|
|
160
|
+
localActions: TrackedAction[];
|
|
161
|
+
/** Remote revision at last pull. */
|
|
162
|
+
knownRevision: Record<string, number>;
|
|
163
|
+
/** Current remote revision. */
|
|
108
164
|
currentRevision: Record<string, number>;
|
|
109
165
|
};
|
|
110
166
|
/** Custom merge handler receives conflict info and returns actions to push (or throws to abort). */
|
|
@@ -188,6 +244,8 @@ declare function phDocumentFromGetDocument<TDocument extends PHDocument = PHDocu
|
|
|
188
244
|
declare function phDocumentFromMutation<TDocument extends PHDocument = PHDocument>(document: GetDocumentQueryFields, operations: readonly RemoteOperation[], branch?: string): TDocument;
|
|
189
245
|
/** Turns a `revisionsList` selection into the header's per-scope revision map. */
|
|
190
246
|
declare function revisionMapFromRevisionsList(revisionsList: RevisionsListSelection): Record<string, number>;
|
|
247
|
+
/** The `DateTime` scalar deserializes as either an ISO string or a `Date`. */
|
|
248
|
+
declare function isoStringFromDateTime(value: string | Date): string;
|
|
191
249
|
//#endregion
|
|
192
250
|
//#region src/graphql-client/auth.d.ts
|
|
193
251
|
/**
|
|
@@ -217,6 +275,27 @@ declare function ambientRenownTokenProvider(): Promise<string | undefined>;
|
|
|
217
275
|
*/
|
|
218
276
|
declare function makeAuthMiddleware(tokenProvider: BearerTokenProvider): SdkFunctionWrapper;
|
|
219
277
|
//#endregion
|
|
278
|
+
//#region src/graphql-client/errors.d.ts
|
|
279
|
+
/** A call the Switchboard GraphQL surface cannot express. */
|
|
280
|
+
declare class GraphQLOperationNotSupportedError extends Error {
|
|
281
|
+
readonly name = "GraphQLOperationNotSupportedError";
|
|
282
|
+
readonly operation: string;
|
|
283
|
+
constructor(operation: string, reason: string);
|
|
284
|
+
static isError(error: unknown): error is GraphQLOperationNotSupportedError;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* The reactor's `BatchJobFailedError`, rebuilt from a batch result; this entry
|
|
288
|
+
* imports the reactor for types only. The shared name lets either `isError`
|
|
289
|
+
* recognise it.
|
|
290
|
+
*/
|
|
291
|
+
declare class BatchJobFailedError extends Error {
|
|
292
|
+
readonly name = "BatchJobFailedError";
|
|
293
|
+
readonly key: string;
|
|
294
|
+
readonly jobs: Readonly<Record<string, JobInfo>>;
|
|
295
|
+
constructor(key: string, jobs: Record<string, JobInfo>);
|
|
296
|
+
static isError(error: unknown): error is BatchJobFailedError;
|
|
297
|
+
}
|
|
298
|
+
//#endregion
|
|
220
299
|
//#region src/graphql-client/subgraph.d.ts
|
|
221
300
|
/**
|
|
222
301
|
* The factory a GraphQL code generator produces for a schema.
|
|
@@ -304,7 +383,8 @@ declare class SubgraphSdkRegistry {
|
|
|
304
383
|
//#endregion
|
|
305
384
|
//#region src/graphql-client/graphql-reactor-client.d.ts
|
|
306
385
|
type GraphQLReactorClientOptions = {
|
|
307
|
-
/** The Switchboard GraphQL endpoint, e.g. `http://localhost:4001/graphql`. */
|
|
386
|
+
/** The Switchboard GraphQL endpoint, e.g. `http://localhost:4001/graphql`. */
|
|
387
|
+
url: string;
|
|
308
388
|
/**
|
|
309
389
|
* A pre-built SDK to use instead of the transport derived from `url`.
|
|
310
390
|
* Mainly a test seam.
|
|
@@ -397,6 +477,23 @@ declare class GraphQLReactorClient implements IReactorBrowserClient$1 {
|
|
|
397
477
|
constructor(options: GraphQLReactorClientOptions);
|
|
398
478
|
get<TDocument extends PHDocument>(identifier: string, view?: ViewFilter, signal?: AbortSignal): Promise<TDocument>;
|
|
399
479
|
getOperations(documentIdentifier: string, view?: ViewFilter, filter?: OperationFilter, paging?: PagingOptions, signal?: AbortSignal): Promise<PagedResults<Operation>>;
|
|
480
|
+
/**
|
|
481
|
+
* Filters documents by criteria over the Switchboard's `findDocuments` query.
|
|
482
|
+
*
|
|
483
|
+
* The query filters by `type` and `parentId` only, at head. A search naming
|
|
484
|
+
* `ids` or `slugs` (present, whatever its length) and a point-in-time view are
|
|
485
|
+
* each by-contract limitations the query cannot express -- running it anyway
|
|
486
|
+
* would return every document instead of the named ones, or head instead of
|
|
487
|
+
* the asked-for revision, a silently wrong answer. {@link findIsServableOverGraphQL}
|
|
488
|
+
* is the single predicate that decides this, and an unservable `find` throws
|
|
489
|
+
* {@link GraphQLOperationNotSupportedError}. Drive enumeration itself filters
|
|
490
|
+
* by `type` at head, which is served.
|
|
491
|
+
*/
|
|
492
|
+
find<TDocument extends PHDocument = PHDocument>(search: SearchFilter, view?: ViewFilter, paging?: PagingOptions, signal?: AbortSignal): Promise<PagedResults<TDocument>>;
|
|
493
|
+
getOutgoingRelationships(sourceIdentifier: string, relationshipType: string, view?: ViewFilter, paging?: PagingOptions, signal?: AbortSignal): Promise<PagedResults<PHDocument>>;
|
|
494
|
+
getIncomingRelationships(targetIdentifier: string, relationshipType: string, view?: ViewFilter, paging?: PagingOptions, signal?: AbortSignal): Promise<PagedResults<PHDocument>>;
|
|
495
|
+
getOutgoingRelationshipEdges(sourceIdentifier: string, relationshipType?: string, view?: ViewFilter, paging?: PagingOptions, signal?: AbortSignal): Promise<PagedResults<DocumentRelationship>>;
|
|
496
|
+
getIncomingRelationshipEdges(targetIdentifier: string, relationshipType?: string, view?: ViewFilter, paging?: PagingOptions, signal?: AbortSignal): Promise<PagedResults<DocumentRelationship>>;
|
|
400
497
|
create<TDocument extends PHDocument = PHDocument>(document: PHDocument, parentIdentifier?: string, signal?: AbortSignal): Promise<TDocument>;
|
|
401
498
|
/**
|
|
402
499
|
* Pushes actions to the Switchboard and returns the updated document.
|
|
@@ -416,6 +513,73 @@ declare class GraphQLReactorClient implements IReactorBrowserClient$1 {
|
|
|
416
513
|
* request. Declaring it would suggest a per-call choice that does not exist.
|
|
417
514
|
*/
|
|
418
515
|
execute<TDocument extends PHDocument>(documentIdentifier: string, branch: string, actions: Action[], signal?: AbortSignal): Promise<TDocument>;
|
|
516
|
+
/**
|
|
517
|
+
* Runs multiple mutation jobs in dependency order over the Switchboard's
|
|
518
|
+
* `executeBatch` mutation and waits for all to settle, returning the result
|
|
519
|
+
* shaped like `IReactor.executeBatch`'s so the reference `DriveClient`
|
|
520
|
+
* consumes it unchanged.
|
|
521
|
+
*
|
|
522
|
+
* Not atomic: each job commits on its own and a failed job still releases
|
|
523
|
+
* its dependents. A FAILED job throws {@link BatchJobFailedError}, naming the
|
|
524
|
+
* first failed plan key and carrying every job's final state.
|
|
525
|
+
*
|
|
526
|
+
* Each job's actions are signed independently for the job's own
|
|
527
|
+
* `(documentId, branch)` target -- the per-action signing the reactor's own
|
|
528
|
+
* `signActions` does, not the batch state-prediction `execute` uses for a
|
|
529
|
+
* multi-action push. A drive job such as `addFile`'s is `CREATE_DOCUMENT` +
|
|
530
|
+
* `UPGRADE_DOCUMENT` + `ADD_RELATIONSHIP`, which the prediction path rejects
|
|
531
|
+
* outright and which has no fetchable baseline to stamp against. The reactor
|
|
532
|
+
* records but does not verify the stamped previous-state head, so signing
|
|
533
|
+
* each action bare is exactly what the in-process `DriveClient` relies on.
|
|
534
|
+
*
|
|
535
|
+
* The mutation is synchronous server-side: a job it returns is already
|
|
536
|
+
* settled, so {@link waitForJob} resolves from it without polling.
|
|
537
|
+
*/
|
|
538
|
+
executeBatch(request: BatchExecutionRequest, signal?: AbortSignal): Promise<BatchExecutionResult>;
|
|
539
|
+
/** Polls `jobStatus` until the job is READ_READY or FAILED. */
|
|
540
|
+
waitForJob(jobOrId: string | JobInfo, signal?: AbortSignal): Promise<JobInfo>;
|
|
541
|
+
/**
|
|
542
|
+
* Not served: the Switchboard has no query for the policy it gives new
|
|
543
|
+
* documents, and a guessed default would under-sign on a stricter host.
|
|
544
|
+
*/
|
|
545
|
+
getCreateSignaturePolicy(): Promise<SignaturePolicy>;
|
|
546
|
+
/**
|
|
547
|
+
* Not served: the versions a new document takes come from the host's peer
|
|
548
|
+
* agreement, which the Switchboard does not expose. A parent's own versions
|
|
549
|
+
* are not that answer.
|
|
550
|
+
*/
|
|
551
|
+
getCreateProtocolVersions(_parentIdentifier?: string, _signal?: AbortSignal): Promise<ProtocolVersions>;
|
|
552
|
+
/**
|
|
553
|
+
* Sets or, with `null`, clears the preferred editor as a client-signed
|
|
554
|
+
* action, as the in-process client does.
|
|
555
|
+
*/
|
|
556
|
+
setPreferredEditor(documentIdentifier: string, preferredEditor: string | null, branch?: string, signal?: AbortSignal): Promise<PHDocument>;
|
|
557
|
+
/**
|
|
558
|
+
* Emits the changes the batch's settled jobs made, as `create` and `execute`
|
|
559
|
+
* do, so a cache is invalidated without a realtime socket. The documents a
|
|
560
|
+
* job wrote to are its own and those its consistency token names.
|
|
561
|
+
*/
|
|
562
|
+
private announceBatch;
|
|
563
|
+
/**
|
|
564
|
+
* The id a job's actions are signed for: a signature covers the document id,
|
|
565
|
+
* and the server resolves a slug before verifying. A document created by this
|
|
566
|
+
* job or an earlier one is named by its id. When the server has no such
|
|
567
|
+
* document the identifier is used as given, and the server decides; any
|
|
568
|
+
* other failure to read it throws, so nothing is signed for a slug.
|
|
569
|
+
*/
|
|
570
|
+
private batchWriteTarget;
|
|
571
|
+
/**
|
|
572
|
+
* Signs one batch job's actions for the job's own log.
|
|
573
|
+
*
|
|
574
|
+
* Each action is signed on its own for `(documentId, branch)`, the same
|
|
575
|
+
* per-action signing the reactor's `signActions` does: no state prediction
|
|
576
|
+
* across the job, so a job carrying a `CREATE_DOCUMENT` the push-prediction
|
|
577
|
+
* path rejects still signs. An action already signed under a key is left
|
|
578
|
+
* as it is: the reference `DriveClient` signs its jobs before handing them
|
|
579
|
+
* here. With no signer the actions pass through unsigned, matching
|
|
580
|
+
* {@link execute}.
|
|
581
|
+
*/
|
|
582
|
+
private signBatchJobActions;
|
|
419
583
|
/**
|
|
420
584
|
* Deletes a document and announces it as a `Deleted` event.
|
|
421
585
|
*
|
|
@@ -490,6 +654,19 @@ declare class GraphQLReactorClient implements IReactorBrowserClient$1 {
|
|
|
490
654
|
* `gql` document or a string and name the result type at the call site.
|
|
491
655
|
*/
|
|
492
656
|
request<TResult = unknown, TVariables extends Variables = Variables>(document: TypedGraphQLDocument<TResult, TVariables> | string, variables?: TVariables, options?: GraphQLRequestOptions): Promise<TResult>;
|
|
657
|
+
/**
|
|
658
|
+
* Shapes a document result page into the reactor's {@link PagedResults}.
|
|
659
|
+
*
|
|
660
|
+
* The items carry the same `PHDocumentFields` fragment as `get`, so the same
|
|
661
|
+
* adapter rebuilds each one. `hasNextPage` gates the cursor exactly as
|
|
662
|
+
* `getOperations` does: no cursor means no `next`.
|
|
663
|
+
*/
|
|
664
|
+
private toDocumentResults;
|
|
665
|
+
/**
|
|
666
|
+
* Shapes a relationship-edge result page into the reactor's
|
|
667
|
+
* {@link PagedResults}, restoring each edge's `Date` fields.
|
|
668
|
+
*/
|
|
669
|
+
private toRelationshipResults;
|
|
493
670
|
/**
|
|
494
671
|
* Opens the realtime socket on the first subscriber.
|
|
495
672
|
*
|
|
@@ -571,6 +748,15 @@ declare function isGraphQLReactorClient(client: unknown): client is GraphQLReact
|
|
|
571
748
|
* argument, so silently returning the head state would be wrong.
|
|
572
749
|
*/
|
|
573
750
|
declare function viewFilterInputFromViewFilter(view?: ViewFilter): ViewFilterInput | undefined;
|
|
751
|
+
/**
|
|
752
|
+
* The single source of truth for whether the Switchboard `findDocuments` query
|
|
753
|
+
* can serve a `find`. It is servable iff the search names neither `ids` nor
|
|
754
|
+
* `slugs` (present, regardless of length) AND the view is not point-in-time:
|
|
755
|
+
* each is a by-contract limitation of a surface that filters only by
|
|
756
|
+
* `type`/`parentId` at head. Exported so a caller can route around an
|
|
757
|
+
* unservable search instead of catching the error `find` throws for it.
|
|
758
|
+
*/
|
|
759
|
+
declare function findIsServableOverGraphQL(search: SearchFilter, view?: ViewFilter): boolean;
|
|
574
760
|
//#endregion
|
|
575
761
|
//#region src/graphql-client/graphql-reactor-provider.d.ts
|
|
576
762
|
declare global {
|
|
@@ -589,7 +775,8 @@ declare global {
|
|
|
589
775
|
*/
|
|
590
776
|
declare function ensurePHEventHandlers(): void;
|
|
591
777
|
type GraphQLReactorProviderProps = {
|
|
592
|
-
/** The Switchboard GraphQL endpoint, e.g. `http://localhost:4001/graphql`. */
|
|
778
|
+
/** The Switchboard GraphQL endpoint, e.g. `http://localhost:4001/graphql`. */
|
|
779
|
+
url: string;
|
|
593
780
|
/**
|
|
594
781
|
* Resolves the bearer token sent with every request, per request. Defaults to
|
|
595
782
|
* the token of the logged-in Renown user, or none when nobody is logged in.
|
|
@@ -675,15 +862,7 @@ type GraphQLReactorProviderProps = {
|
|
|
675
862
|
* effect rebuilds both if it runs again on the same client - which is what a
|
|
676
863
|
* `StrictMode` mount does.
|
|
677
864
|
*/
|
|
678
|
-
declare function GraphQLReactorProvider({
|
|
679
|
-
url,
|
|
680
|
-
tokenProvider,
|
|
681
|
-
subscriptionsUrl,
|
|
682
|
-
realtime,
|
|
683
|
-
attachmentService,
|
|
684
|
-
documentModels,
|
|
685
|
-
children
|
|
686
|
-
}: GraphQLReactorProviderProps): react_jsx_runtime0.JSX.Element;
|
|
865
|
+
declare function GraphQLReactorProvider({ url, tokenProvider, subscriptionsUrl, realtime, attachmentService, documentModels, children }: GraphQLReactorProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
687
866
|
/**
|
|
688
867
|
* Returns the {@link GraphQLReactorClient} mounted by
|
|
689
868
|
* {@link GraphQLReactorProvider}, or `undefined` when the slot holds something
|
|
@@ -705,7 +884,7 @@ declare function useSwitchboardClient(): GraphQLReactorClient | undefined;
|
|
|
705
884
|
* The operation selection of `GetDocumentOperations`, lifted into a fragment so
|
|
706
885
|
* the write path can reuse `remoteOperationToLocal` on the items it selects.
|
|
707
886
|
*/
|
|
708
|
-
declare const ReactorOperationFieldsFragmentDoc: graphql.DocumentNode;
|
|
887
|
+
declare const ReactorOperationFieldsFragmentDoc: import("graphql").DocumentNode;
|
|
709
888
|
/**
|
|
710
889
|
* `mutateDocument` plus the operations the mutation produced.
|
|
711
890
|
*
|
|
@@ -727,7 +906,7 @@ declare const ReactorOperationFieldsFragmentDoc: graphql.DocumentNode;
|
|
|
727
906
|
* by hand or the operations came from `main` while the actions were applied
|
|
728
907
|
* elsewhere. One variable cannot disagree with itself.
|
|
729
908
|
*/
|
|
730
|
-
declare const MutateDocumentWithOperationsDocument: graphql.DocumentNode;
|
|
909
|
+
declare const MutateDocumentWithOperationsDocument: import("graphql").DocumentNode;
|
|
731
910
|
type MutateDocumentWithOperationsVariables = {
|
|
732
911
|
documentIdentifier: Scalars["String"]["input"];
|
|
733
912
|
actions: ReadonlyArray<ActionInput>;
|
|
@@ -761,12 +940,12 @@ type MutateDocumentWithOperationsResult = {
|
|
|
761
940
|
*/
|
|
762
941
|
declare function stampAction(action: Action$1, document: PHDocument$1, revision?: number): Action$1;
|
|
763
942
|
/**
|
|
764
|
-
* Signs a stamped action
|
|
765
|
-
*
|
|
766
|
-
*
|
|
767
|
-
*
|
|
943
|
+
* Signs a stamped action for `target`, keeping any signatures it already
|
|
944
|
+
* carries. The signer reads `context.prevOpHash`, so this runs after
|
|
945
|
+
* {@link stampAction}. A v2 tuple covers the signer's identity, so the context
|
|
946
|
+
* takes the signer's user and app even when the action named others.
|
|
768
947
|
*/
|
|
769
|
-
declare function signStampedAction(action: Action$1, signer: ISigner, signal?: AbortSignal): Promise<Action$1>;
|
|
948
|
+
declare function signStampedAction(action: Action$1, signer: ISigner, target: ActionSigningTarget, signal?: AbortSignal): Promise<Action$1>;
|
|
770
949
|
/**
|
|
771
950
|
* Stamps and signs a batch of actions against one document snapshot, so every
|
|
772
951
|
* action carries the head its predecessor will leave behind.
|
|
@@ -856,13 +1035,15 @@ type DocumentChangesEventPayload = DocumentChangesSubscription["documentChanges"
|
|
|
856
1035
|
/** The connection payload sent with the `ConnectionInit` message. */
|
|
857
1036
|
type ConnectionParams = Record<string, string>;
|
|
858
1037
|
type DocumentChangesSubscriptionOptions = {
|
|
859
|
-
/** The websocket endpoint, e.g. `ws://localhost:4001/graphql/subscriptions`. */
|
|
1038
|
+
/** The websocket endpoint, e.g. `ws://localhost:4001/graphql/subscriptions`. */
|
|
1039
|
+
wsUrl: string;
|
|
860
1040
|
/**
|
|
861
1041
|
* Resolves the `ConnectionInit` payload. Called again on every reconnect, so
|
|
862
1042
|
* a token that expired while the socket was down is refreshed on the way back
|
|
863
1043
|
* up.
|
|
864
1044
|
*/
|
|
865
|
-
connectionParams?: () => Promise<ConnectionParams>;
|
|
1045
|
+
connectionParams?: () => Promise<ConnectionParams>;
|
|
1046
|
+
/** Called once per server event. */
|
|
866
1047
|
onEvent: (event: DocumentChangesEventPayload) => void;
|
|
867
1048
|
/**
|
|
868
1049
|
* Called when the socket gives up: the retries built into `graphql-ws` are
|
|
@@ -938,6 +1119,8 @@ declare function useDocument(id: string | null | undefined): PHDocument$1 | unde
|
|
|
938
1119
|
* - isPending: Whether the document is currently loading
|
|
939
1120
|
* - error: Any error that occurred during loading (e.g., document not found)
|
|
940
1121
|
* - reload: Function to force a refetch, or undefined when no id is supplied
|
|
1122
|
+
* - isRefetching: A loaded document is being refetched; `data` is the loaded one
|
|
1123
|
+
* - refetchError: The last refetch failure that kept the loaded document
|
|
941
1124
|
*/
|
|
942
1125
|
declare function useDocumentSafe(id: string | null | undefined): {
|
|
943
1126
|
readonly status: "initial";
|
|
@@ -945,24 +1128,32 @@ declare function useDocumentSafe(id: string | null | undefined): {
|
|
|
945
1128
|
readonly error: undefined;
|
|
946
1129
|
readonly data: undefined;
|
|
947
1130
|
readonly reload: undefined;
|
|
1131
|
+
readonly isRefetching: false;
|
|
1132
|
+
readonly refetchError: undefined;
|
|
948
1133
|
} | {
|
|
949
|
-
readonly reload: () => Promise<PHDocument$1>;
|
|
950
1134
|
readonly status: "pending";
|
|
951
1135
|
readonly isPending: true;
|
|
952
1136
|
readonly error: undefined;
|
|
953
1137
|
readonly data: undefined;
|
|
954
|
-
} | {
|
|
955
1138
|
readonly reload: () => Promise<PHDocument$1>;
|
|
1139
|
+
readonly isRefetching: boolean;
|
|
1140
|
+
readonly refetchError: unknown;
|
|
1141
|
+
} | {
|
|
956
1142
|
readonly status: "success";
|
|
957
1143
|
readonly isPending: false;
|
|
958
1144
|
readonly error: undefined;
|
|
959
1145
|
readonly data: PHDocument$1;
|
|
960
|
-
} | {
|
|
961
1146
|
readonly reload: () => Promise<PHDocument$1>;
|
|
1147
|
+
readonly isRefetching: boolean;
|
|
1148
|
+
readonly refetchError: unknown;
|
|
1149
|
+
} | {
|
|
962
1150
|
readonly status: "error";
|
|
963
1151
|
readonly isPending: false;
|
|
964
1152
|
readonly error: unknown;
|
|
965
1153
|
readonly data: undefined;
|
|
1154
|
+
readonly reload: () => Promise<PHDocument$1>;
|
|
1155
|
+
readonly isRefetching: boolean;
|
|
1156
|
+
readonly refetchError: unknown;
|
|
966
1157
|
};
|
|
967
1158
|
/**
|
|
968
1159
|
* Retrieves multiple documents from the reactor using React Suspense.
|
|
@@ -997,6 +1188,8 @@ declare function useGetDocuments(): (ids: string[]) => Promise<PHDocument$1[]>;
|
|
|
997
1188
|
* - isPending: Boolean indicating if the document is currently loading
|
|
998
1189
|
* - error: Any error that occurred during loading
|
|
999
1190
|
* - reload: Function to force reload the document from cache
|
|
1191
|
+
* - isRefetching: A loaded document is being refetched; `data` is the loaded one
|
|
1192
|
+
* - refetchError: The last refetch failure that kept the loaded document
|
|
1000
1193
|
*/
|
|
1001
1194
|
declare function useGetDocumentAsync(id: string | null | undefined): {
|
|
1002
1195
|
readonly status: "initial";
|
|
@@ -1004,24 +1197,32 @@ declare function useGetDocumentAsync(id: string | null | undefined): {
|
|
|
1004
1197
|
readonly isPending: false;
|
|
1005
1198
|
readonly error: undefined;
|
|
1006
1199
|
readonly reload: undefined;
|
|
1200
|
+
readonly isRefetching: false;
|
|
1201
|
+
readonly refetchError: undefined;
|
|
1007
1202
|
} | {
|
|
1008
|
-
readonly reload: () => Promise<PHDocument$1>;
|
|
1009
1203
|
readonly status: "pending";
|
|
1010
1204
|
readonly isPending: true;
|
|
1011
1205
|
readonly error: undefined;
|
|
1012
1206
|
readonly data: undefined;
|
|
1013
|
-
} | {
|
|
1014
1207
|
readonly reload: () => Promise<PHDocument$1>;
|
|
1208
|
+
readonly isRefetching: boolean;
|
|
1209
|
+
readonly refetchError: unknown;
|
|
1210
|
+
} | {
|
|
1015
1211
|
readonly status: "success";
|
|
1016
1212
|
readonly isPending: false;
|
|
1017
1213
|
readonly error: undefined;
|
|
1018
1214
|
readonly data: PHDocument$1;
|
|
1019
|
-
} | {
|
|
1020
1215
|
readonly reload: () => Promise<PHDocument$1>;
|
|
1216
|
+
readonly isRefetching: boolean;
|
|
1217
|
+
readonly refetchError: unknown;
|
|
1218
|
+
} | {
|
|
1021
1219
|
readonly status: "error";
|
|
1022
1220
|
readonly isPending: false;
|
|
1023
1221
|
readonly error: unknown;
|
|
1024
1222
|
readonly data: undefined;
|
|
1223
|
+
readonly reload: () => Promise<PHDocument$1>;
|
|
1224
|
+
readonly isRefetching: boolean;
|
|
1225
|
+
readonly refetchError: unknown;
|
|
1025
1226
|
};
|
|
1026
1227
|
//#endregion
|
|
1027
1228
|
//#region src/hooks/reactor.d.ts
|
|
@@ -1038,7 +1239,7 @@ declare const setReactorClient: SetPHGlobalValue<IReactorBrowserClient>;
|
|
|
1038
1239
|
/** Adds an event handler for the reactor client */
|
|
1039
1240
|
declare const addReactorClientEventHandler: AddPHGlobalEventHandler;
|
|
1040
1241
|
declare const useSync: () => ISyncManager | undefined;
|
|
1041
|
-
declare const useSyncList: () =>
|
|
1242
|
+
declare const useSyncList: () => import("@powerhousedao/reactor").Remote[];
|
|
1042
1243
|
declare const useModelRegistry: () => IDocumentModelRegistry | undefined;
|
|
1043
1244
|
declare const useDatabase: () => Kysely<Database> | undefined;
|
|
1044
1245
|
declare const usePGlite: () => PGlite | undefined;
|
|
@@ -1067,24 +1268,61 @@ declare function useDocumentModelModules(): DocumentModelModule[] | undefined;
|
|
|
1067
1268
|
declare function useDocumentModelModuleById(id: string | null | undefined, version?: number): DocumentModelModule | undefined;
|
|
1068
1269
|
//#endregion
|
|
1069
1270
|
//#region src/hooks/document-operations.d.ts
|
|
1070
|
-
type
|
|
1271
|
+
type UseDocumentOperationsOptions = {
|
|
1272
|
+
/**
|
|
1273
|
+
* Operations per page. Default 100. Applies to the next first-page load;
|
|
1274
|
+
* changing it while pages are already loaded has no effect until the next
|
|
1275
|
+
* invalidation or `refetch`.
|
|
1276
|
+
*/
|
|
1277
|
+
limit?: number;
|
|
1278
|
+
/** Whether to fetch at all. Default true. Pass false until the operations are needed. */
|
|
1279
|
+
enabled?: boolean;
|
|
1280
|
+
};
|
|
1281
|
+
/** What `useDocumentOperations` returns; exported so consumers can name it. */
|
|
1282
|
+
type DocumentOperationsResult = {
|
|
1283
|
+
/** Every operation of the scope loaded so far, oldest first. */
|
|
1284
|
+
operations: readonly Operation$1[];
|
|
1285
|
+
/** A page is in flight. */
|
|
1286
|
+
isLoading: boolean;
|
|
1287
|
+
/** The last page failed. Operations loaded before it stay available. */
|
|
1288
|
+
error: Error | undefined;
|
|
1289
|
+
/** The last page reported a further page. */
|
|
1290
|
+
hasNextPage: boolean;
|
|
1291
|
+
/** Loads the next page and appends it. No-op while loading or when there is none. */
|
|
1292
|
+
fetchNextPage: () => void;
|
|
1293
|
+
/** Drops the document's cached operations and reloads from the first page. */
|
|
1294
|
+
refetch: () => void;
|
|
1295
|
+
};
|
|
1296
|
+
/**
|
|
1297
|
+
* Legacy result of `useDocumentOperations(documentId)`.
|
|
1298
|
+
* @deprecated Call `useDocumentOperations(documentId, scope, options)` and read `operations`. Removed in the next major.
|
|
1299
|
+
*/
|
|
1300
|
+
type DocumentOperationsState = {
|
|
1071
1301
|
globalOperations: Operation$1[];
|
|
1072
1302
|
localOperations: Operation$1[];
|
|
1073
1303
|
isLoading: boolean;
|
|
1074
1304
|
error: Error | undefined;
|
|
1075
|
-
};
|
|
1076
|
-
/** What `useDocumentOperations` returns; exported so consumers can name it. */
|
|
1077
|
-
type DocumentOperationsState = InternalState & {
|
|
1078
1305
|
refetch: () => void;
|
|
1079
1306
|
};
|
|
1307
|
+
/** @deprecated Pass a scope: `useDocumentOperations(documentId, "global")`. The legacy form fetches the whole global and local history eagerly. Removed in the next major. */
|
|
1308
|
+
declare function useDocumentOperations(documentId: string | null | undefined): DocumentOperationsState;
|
|
1080
1309
|
/**
|
|
1081
|
-
*
|
|
1082
|
-
*
|
|
1310
|
+
* Operation history of a document, read from the document cache and kept in
|
|
1311
|
+
* step with it: a change event for the document drops the cached pages and
|
|
1312
|
+
* the hook loads the first page again.
|
|
1313
|
+
*
|
|
1314
|
+
* Pages arrive oldest first. A view that wants the whole history calls
|
|
1315
|
+
* `fetchNextPage` while `hasNextPage` is true.
|
|
1083
1316
|
*
|
|
1084
|
-
*
|
|
1085
|
-
*
|
|
1317
|
+
* An empty first page is a final result; there is no retry. When the active
|
|
1318
|
+
* document cache does not serve operations, the result is empty and not
|
|
1319
|
+
* loading.
|
|
1320
|
+
*
|
|
1321
|
+
* @param documentId - The document id, or null/undefined to skip fetching
|
|
1322
|
+
* @param scope - The operation scope, for example "global" or "local"
|
|
1323
|
+
* @param options - Page size and whether fetching is enabled
|
|
1086
1324
|
*/
|
|
1087
|
-
declare function useDocumentOperations(documentId: string | null | undefined):
|
|
1325
|
+
declare function useDocumentOperations(documentId: string | null | undefined, scope: string, options?: UseDocumentOperationsOptions): DocumentOperationsResult;
|
|
1088
1326
|
//#endregion
|
|
1089
1327
|
//#region src/hooks/attachment-service.d.ts
|
|
1090
1328
|
/** Returns the attachment service from window.ph */
|
|
@@ -1094,5 +1332,6 @@ declare const setAttachmentService: SetPHGlobalValue<IAttachmentService>;
|
|
|
1094
1332
|
/** Registers the attachmentService window event handler */
|
|
1095
1333
|
declare const addAttachmentServiceEventHandler: AddPHGlobalEventHandler;
|
|
1096
1334
|
//#endregion
|
|
1097
|
-
export {
|
|
1098
|
-
|
|
1335
|
+
export { useSwitchboardClient as $, useGetDocument as A, IRemoteController as At, StaticPackageManager as B, TrackedAction as Bt, useSyncList as C, ConflictInfo as Ct, useDocumentCache as D, GetDocumentWithOperationsResult as Dt, useDocument as E, GetDocumentResult as Et, DocumentChangesSubscriptionOptions as F, RemoteDocumentChangeEvent as Ft, stampAction as G, readPromiseState as Gt, resolveDocumentModelModule as H, IDLE_OPERATIONS_ENTRY as Ht, isAuthRefusalClose as I, RemoteDocumentData as It, MutateDocumentWithOperationsVariables as J, MutateDocumentWithOperationsDocument as K, IDLE_REFETCH_STATE as Kt, makeAuthConnectionParams as L, RemoteOperation as Lt, useGetDocuments as M, PushResult as Mt, ConnectionParams as N, RemoteControllerGraphQLClient as Nt, useDocumentSafe as O, GetOperationsResult as Ot, DocumentChangesEventPayload as P, RemoteControllerOptions as Pt, ensurePHEventHandlers as Q, startDocumentChangesSubscription as R, RemoteOperationResultPage as Rt, useSync as S, revisionMapFromRevisionsList as St, setDocumentCache as T, DocumentChangeListener as Tt, prepareSignedActions as U, addPromiseState as Ut, packageFromDocumentModels as V, DocumentCache as Vt, signStampedAction as W, isOperationCache as Wt, GraphQLReactorProvider as X, ReactorOperationFieldsFragmentDoc as Y, GraphQLReactorProviderProps as Z, useDatabase as _, GetDocumentQueryResult as _t, DocumentOperationsState as a, GraphQLRequestOptions as at, useReactorClient as b, phDocumentFromGetDocument as bt, useDocumentModelModuleById as c, TypedGraphQLDocument as ct, UseDispatchResult as d, BatchJobFailedError as dt, GraphQLReactorClient as et, useDispatch as f, GraphQLOperationNotSupportedError as ft, setReactorClientModule as g, GetDocumentQueryFields as gt, setReactorClient as h, makeAuthMiddleware as ht, DocumentOperationsResult as i, viewFilterInputFromViewFilter as it, useGetDocumentAsync as j, MergeHandler as jt, useDocuments as k, IRemoteClient as kt, useDocumentModelModules as l, describeGraphQLDocument as lt, addReactorClientModuleEventHandler as m, ambientRenownTokenProvider as mt, setAttachmentService as n, findIsServableOverGraphQL as nt, UseDocumentOperationsOptions as o, SubgraphSdkFactory as ot, addReactorClientEventHandler as p, BearerTokenProvider as pt, MutateDocumentWithOperationsResult as q, useAttachmentService as r, isGraphQLReactorClient as rt, useDocumentOperations as s, SubgraphSdkRegistry as st, addAttachmentServiceEventHandler as t, GraphQLReactorClientOptions as tt, DispatchFn as u, subgraphUrlFromGraphqlUrl as ut, useModelRegistry as v, RevisionsListSelection as vt, addDocumentCacheEventHandler as w, ConflictStrategy as wt, useReactorClientModule as x, phDocumentFromMutation as xt, usePGlite as y, isoStringFromDateTime as yt, subscriptionsUrlFromGraphqlUrl as z, SyncStatus$1 as zt };
|
|
1336
|
+
export {};
|
|
1337
|
+
//# sourceMappingURL=attachment-service-B-nLR114.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment-service-B-nLR114.d.ts","names":[],"sources":["../src/document-refetcher.ts","../src/document-cache.ts","../src/remote-controller/types.ts","../src/graphql-client/adapter.ts","../src/graphql-client/auth.ts","../src/graphql-client/errors.ts","../src/graphql-client/subgraph.ts","../src/graphql-client/graphql-reactor-client.ts","../src/graphql-client/graphql-reactor-provider.tsx","../src/graphql-client/operations.ts","../src/graphql-client/signing.ts","../src/graphql-client/static-package-manager.ts","../src/graphql-client/subscriptions.ts","../src/hooks/document-cache.ts","../src/hooks/reactor.ts","../src/hooks/dispatch.ts","../src/hooks/document-model-modules.ts","../src/hooks/document-operations.ts","../src/hooks/attachment-service.ts"],"mappings":";;;;;;;;;;;;;;;cASa,oBAAoB;;;iBCUjB,gBAAgB,GAAG,SAAS,QAAQ,KAAK,iBAAiB;iBAwB1D,iBAAiB,GAC/B,SAAS,QAAQ,KAAK,iBAAiB,KACtC,aAAa;;cA4BH,uBAAuB;;iBAQpB,iBAAiB,iBAAiB,SAAS;;;;;;;;;cAiD9C,yBAAyB,gBAAgB;UAuChC;UAtCZ;UACA;UAIA;UAEA;;;;;;;;UAkBA;;UAGA;;UAKA;UACA;UAEA;EAER,YAAoB,QAAQ;UAMpB;UAuBA;UAeM;UAON;;UAOA;;UAKA;UAMA;EAQR,IAAI,YAAY,oBAAoB,QAAQ;EA0B5C,gBAAgB,aAAa;EAI7B,SAAS,gBAAgB,QAAQ;EA8DjC,UAAU,uBAAuB;EAiBjC,mBAAmB,oBAAoB,gBAAgB;EAMvD,eAAe,oBAAoB,eAAe;EA8BlD,mBAAmB,oBAAoB;;;;;;;;;;;;;;;;;;UAuD/B;;UA8CA;EAmBR,qBAAqB;EAarB,oBAAoB,oBAAoB;UAYhC;UAmCA;UAaA;UAYA;;;;EASR;;;;KC5kBU,gCAAgC,KAC1C;KAYU,qBAAqB;KAErB,kBACV;KAEU,4BACV;;;;KAKU;EACV,QAAQ;;EAER;;EAEA;;EAEA,SAAS;;EAET;;EAEA;;EAEA,aAAa;;EAEb,eAAe;;EAEf;;;;;KAMU;EACV,gBAAgB;EAChB;;EAEA,YAAY,cAAc;;;;;KAMhB;EACV;EACA;EACA;EACA,gBAAgB;;;;;KAMN;EACV,QAAQ;EACR;EACA;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IvC,kCAAkC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { c as ReactorGraphQLClient, k as SdkFunctionWrapper } from "./types-
|
|
1
|
+
import { c as ReactorGraphQLClient, k as SdkFunctionWrapper } from "./types-D0ugg0E1.js";
|
|
2
2
|
import { GraphQLClient } from "graphql-request";
|
|
3
|
-
|
|
4
3
|
//#region src/graphql/client.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Creates a GraphQL client for the Reactor Subgraph API.
|
|
@@ -11,4 +10,5 @@ import { GraphQLClient } from "graphql-request";
|
|
|
11
10
|
declare function createClient(urlOrGQLClient: string | GraphQLClient, middleware?: SdkFunctionWrapper): ReactorGraphQLClient;
|
|
12
11
|
//#endregion
|
|
13
12
|
export { createClient as t };
|
|
14
|
-
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=client-C-tRLfRN.d.ts.map
|