@powerhousedao/reactor-browser 6.2.3 → 6.3.0-dev.10
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-But1Xljo.d.ts → attachment-service-B-AmTrs2.d.ts} +605 -56
- package/dist/attachment-service-B-AmTrs2.d.ts.map +1 -0
- package/dist/auth-DRbzRdeC.d.ts +32 -0
- package/dist/auth-DRbzRdeC.d.ts.map +1 -0
- package/dist/{client-BiJAJ9dW.js → client-BFnMV-EO.js} +39 -22
- package/dist/client-BFnMV-EO.js.map +1 -0
- package/dist/{client-CngU4mtn.d.ts → client-BP0hXjqq.d.ts} +3 -2
- package/dist/client-BP0hXjqq.d.ts.map +1 -0
- package/dist/client-wwavHFfs.js +135 -0
- package/dist/client-wwavHFfs.js.map +1 -0
- package/dist/{dispatch-qRXS70fh.js → dispatch-Cylwl2Dk.js} +363 -44
- package/dist/dispatch-Cylwl2Dk.js.map +1 -0
- package/dist/{document-by-id-B_8DA4yZ.js → document-by-id-DdvqanGR.js} +2 -2
- package/dist/{document-by-id-B_8DA4yZ.js.map → document-by-id-DdvqanGR.js.map} +1 -1
- package/dist/document-model-modules-BG-61uke.js +710 -0
- package/dist/document-model-modules-BG-61uke.js.map +1 -0
- package/dist/{document-operations-Bt-1-ThH.js → document-operations-DRMMwmGZ.js} +2160 -181
- package/dist/document-operations-DRMMwmGZ.js.map +1 -0
- package/dist/global-iARBhxNI.d.ts +612 -0
- package/dist/global-iARBhxNI.d.ts.map +1 -0
- package/dist/{index-BABMK8cO.d.ts → index-CNS_9THu.d.ts} +14 -4
- package/dist/index-CNS_9THu.d.ts.map +1 -0
- package/dist/index.d.ts +560 -79
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +790 -317
- package/dist/index.js.map +1 -1
- package/dist/inspector-proxy-DODqs15F.d.ts +25 -0
- package/dist/inspector-proxy-DODqs15F.d.ts.map +1 -0
- package/dist/make-ph-event-functions-B5GU5xcR.js +180 -0
- package/dist/make-ph-event-functions-B5GU5xcR.js.map +1 -0
- package/dist/{relational-ChC_AWAK.js → relational-DZuyKp2y.js} +65 -5
- package/dist/relational-DZuyKp2y.js.map +1 -0
- package/dist/{renown-C9pYZRqf.js → renown-B3MUaiq7.js} +56 -25
- package/dist/renown-B3MUaiq7.js.map +1 -0
- package/dist/renown-CBoTdGrg.js +394 -0
- package/dist/renown-CBoTdGrg.js.map +1 -0
- package/dist/{client-VV9M73s_.js → schema-B5lftDPf.js} +295 -195
- package/dist/schema-B5lftDPf.js.map +1 -0
- package/dist/{types-B7-_l_wE.d.ts → schema-C6ECceaN.d.ts} +272 -82
- package/dist/schema-C6ECceaN.d.ts.map +1 -0
- package/dist/src/ai/index.d.ts +269 -24
- package/dist/src/ai/index.d.ts.map +1 -1
- package/dist/src/ai/index.js +1028 -168
- package/dist/src/ai/index.js.map +1 -1
- package/dist/src/analytics/index.js +3 -3
- package/dist/src/graphql/client.d.ts +2 -2
- package/dist/src/graphql/client.js +1 -1
- package/dist/src/graphql-client/entry.d.ts +6 -4
- package/dist/src/graphql-client/entry.js +4 -4
- package/dist/src/relational/index.d.ts +8 -1
- 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 +2 -2
- package/dist/src/renown/index.js +3 -3
- package/dist/src/rpc/index.d.ts +201 -144
- package/dist/src/rpc/index.d.ts.map +1 -1
- package/dist/src/rpc/index.js +562 -634
- package/dist/src/rpc/index.js.map +1 -1
- package/dist/switchboard-directory-vH6qtkh-.js +435 -0
- package/dist/switchboard-directory-vH6qtkh-.js.map +1 -0
- package/dist/switchboards-D-_JBUbF.d.ts +75 -0
- package/dist/switchboards-D-_JBUbF.d.ts.map +1 -0
- package/dist/types-BWx6FPO4.d.ts +63 -0
- package/dist/types-BWx6FPO4.d.ts.map +1 -0
- package/package.json +19 -17
- package/dist/attachment-service-But1Xljo.d.ts.map +0 -1
- package/dist/client-BiJAJ9dW.js.map +0 -1
- package/dist/client-CngU4mtn.d.ts.map +0 -1
- package/dist/client-VV9M73s_.js.map +0 -1
- package/dist/dispatch-qRXS70fh.js.map +0 -1
- package/dist/document-model-modules-D6I-UUXq.js +0 -386
- package/dist/document-model-modules-D6I-UUXq.js.map +0 -1
- package/dist/document-operations-Bt-1-ThH.js.map +0 -1
- package/dist/global-fql2bmb0.d.ts +0 -438
- package/dist/global-fql2bmb0.d.ts.map +0 -1
- package/dist/index-BABMK8cO.d.ts.map +0 -1
- package/dist/inspector-proxy-DCowaeeH.d.ts +0 -264
- package/dist/inspector-proxy-DCowaeeH.d.ts.map +0 -1
- package/dist/make-ph-event-functions-FzpvQtj6.js +0 -53
- package/dist/make-ph-event-functions-FzpvQtj6.js.map +0 -1
- package/dist/relational-ChC_AWAK.js.map +0 -1
- package/dist/renown-C9pYZRqf.js.map +0 -1
- package/dist/renown-Def5iO8k.js +0 -97
- package/dist/renown-Def5iO8k.js.map +0 -1
- package/dist/switchboard-CFyD_5_e.js +0 -323
- package/dist/switchboard-CFyD_5_e.js.map +0 -1
- package/dist/types-B7-_l_wE.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import {
|
|
3
|
-
import { $r as
|
|
4
|
-
export { DocumentCache, GraphQLReactorClient, GraphQLReactorProvider, IDLE_OPERATIONS_ENTRY, MutateDocumentWithOperationsDocument, ReactorOperationFieldsFragmentDoc, StaticPackageManager, SubgraphSdkRegistry, addPromiseState, ambientRenownTokenProvider, describeGraphQLDocument, ensurePHEventHandlers, isAuthRefusalClose, isGraphQLReactorClient, isOperationCache, makeAuthConnectionParams, makeAuthMiddleware, packageFromDocumentModels, phDocumentFromGetDocument, phDocumentFromMutation, prepareSignedActions, readPromiseState, resolveDocumentModelModule, revisionMapFromRevisionsList, setDocumentCache, setReactorClient, signStampedAction, stampAction, startDocumentChangesSubscription, subgraphUrlFromGraphqlUrl, subscriptionsUrlFromGraphqlUrl, useAttachmentService, useDispatch, useDocument, useDocumentCache, useDocumentModelModuleById, useDocumentModelModules, useDocumentOperations, useDocumentSafe, useDocuments, useGetDocument, useGetDocumentAsync, useGetDocuments, useReactorClient, useSwitchboardClient, viewFilterInputFromViewFilter };
|
|
1
|
+
import { a as useDocument, c as useDocuments, d as useGetDocuments, f as DocumentCache, g as addPromiseState, h as IDLE_OPERATIONS_ENTRY, i as setDocumentCache, l as useGetDocument, n as useDispatch, o as useDocumentCache, s as useDocumentSafe, u as useGetDocumentAsync, v as isOperationCache, y as readPromiseState } from "../../dispatch-Cylwl2Dk.js";
|
|
2
|
+
import { K as setReactorClient, Z as useReactorClient, _t as ambientRenownTokenProvider, n as useDocumentModelModules, t as useDocumentModelModuleById, vt as makeAuthMiddleware } from "../../document-model-modules-BG-61uke.js";
|
|
3
|
+
import { $r as isGraphQLReactorClient, Ai as phDocumentFromGetDocument, Ci as switchboardFetch, Di as GraphQLDriveReadClient, Ei as GraphQLDriveNodeSource, Gi as GraphQLOperationNotSupportedError, Ji as queriesUnknownArgument, Ki as GraphQLWrongBackendError, Mi as revisionMapFromRevisionsList, Oi as toLegacyNode, Qr as findIsServableOverGraphQL, Si as isNodeFetch, Ti as withStreamedBodies, V as useAttachmentService, Wi as BatchJobFailedError, Xr as ambientRenownSigner, Yi as queriesUnknownField, Yr as GraphQLReactorClient, Zr as createGraphQLDriveNodeSource, _i as ReactorOperationFieldsFragmentDoc, a as SwitchboardUnreachableError, ai as subscriptionsUrlFromGraphqlUrl, bi as globalFetch, c as ensurePHEventHandlers, ci as subgraphUrlFromGraphqlUrl, di as resolveDocumentModelModule, ei as viewFilterInputFromViewFilter, fi as prepareSignedActions, gi as MutateDocumentWithOperationsDocument, hi as GetDocumentAtConsistencyDocument, i as DEFAULT_REQUEST_TIMEOUT_MS, ii as startDocumentChangesSubscription, ji as phDocumentFromMutation, ki as isoStringFromDateTime, l as useSwitchboardClient, li as StaticPackageManager, mi as stampAction, n as DEFAULT_BATCH_REQUEST_TIMEOUT_MS, ni as isAuthRefusalClose, o as createSwitchboardBackend, oi as SubgraphSdkRegistry, pi as signStampedAction, qi as JobFailedError, r as DEFAULT_BREAKER, ri as makeAuthConnectionParams, s as GraphQLReactorProvider, si as describeGraphQLDocument, t as useDocumentOperations, ti as createJobChangesSocket, ui as packageFromDocumentModels, wi as withRequestDeadline, xi as isDeadlineError } from "../../document-operations-DRMMwmGZ.js";
|
|
4
|
+
export { BatchJobFailedError, DEFAULT_BATCH_REQUEST_TIMEOUT_MS, DEFAULT_BREAKER, DEFAULT_REQUEST_TIMEOUT_MS, DocumentCache, GetDocumentAtConsistencyDocument, GraphQLDriveNodeSource, GraphQLDriveReadClient, GraphQLOperationNotSupportedError, GraphQLReactorClient, GraphQLReactorProvider, GraphQLWrongBackendError, IDLE_OPERATIONS_ENTRY, JobFailedError, MutateDocumentWithOperationsDocument, ReactorOperationFieldsFragmentDoc, StaticPackageManager, SubgraphSdkRegistry, SwitchboardUnreachableError, addPromiseState, ambientRenownSigner, ambientRenownTokenProvider, createGraphQLDriveNodeSource, createJobChangesSocket, createSwitchboardBackend, describeGraphQLDocument, ensurePHEventHandlers, findIsServableOverGraphQL, globalFetch, isAuthRefusalClose, isDeadlineError, isGraphQLReactorClient, isNodeFetch, isOperationCache, isoStringFromDateTime, makeAuthConnectionParams, makeAuthMiddleware, packageFromDocumentModels, phDocumentFromGetDocument, phDocumentFromMutation, prepareSignedActions, queriesUnknownArgument, queriesUnknownField, readPromiseState, resolveDocumentModelModule, revisionMapFromRevisionsList, setDocumentCache, setReactorClient, signStampedAction, stampAction, startDocumentChangesSubscription, subgraphUrlFromGraphqlUrl, subscriptionsUrlFromGraphqlUrl, switchboardFetch, toLegacyNode, useAttachmentService, useDispatch, useDocument, useDocumentCache, useDocumentModelModuleById, useDocumentModelModules, useDocumentOperations, useDocumentSafe, useDocuments, useGetDocument, useGetDocumentAsync, useGetDocuments, useReactorClient, useSwitchboardClient, viewFilterInputFromViewFilter, withRequestDeadline, withStreamedBodies };
|
|
@@ -11,7 +11,14 @@ interface IRelationalDbState<Schema> {
|
|
|
11
11
|
isLoading: boolean;
|
|
12
12
|
error: Error | null;
|
|
13
13
|
}
|
|
14
|
-
export
|
|
14
|
+
export type RelationalDbOptions = {
|
|
15
|
+
/**
|
|
16
|
+
* Called once if the shared PGlite session becomes unusable; every hook that
|
|
17
|
+
* passes one is told, and it unsubscribes on unmount. Recovery is the caller's.
|
|
18
|
+
*/
|
|
19
|
+
onPoisoned?: (cause: Error) => void;
|
|
20
|
+
};
|
|
21
|
+
export declare const useRelationalDb: <Schema>(options?: RelationalDbOptions) => IRelationalDbState<Schema>;
|
|
15
22
|
//#endregion
|
|
16
23
|
//#region src/relational/hooks/useRelationalQuery.d.ts
|
|
17
24
|
export type QueryCallbackReturnType = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/relational/hooks/useRelationalDb.ts","../../../src/relational/hooks/useRelationalQuery.ts","../../../src/relational/utils/createProcessorQuery.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/relational/hooks/useRelationalDb.ts","../../../src/relational/hooks/useRelationalQuery.ts","../../../src/relational/utils/createProcessorQuery.ts"],"mappings":";;;;;YAWY,qBAAqB,UAAU,cAAkB;EAC3D,MAAM;;UAGE,mBAAmB;EAC3B,IAAI,qBAAqB;EACzB;EACA,OAAO;;YAkBG;;;;;EAKV,cAAc,OAAO;;qBAGV,kBAAmB,QAAM,UAC3B,wBACR,mBAAmB;;;YCtCV;EACV;EACA;;YAGU;EAEV;;wBAwBc,mBAAmB,QAAQ,aAAa,qBACtD,gBAAgB,2BAA2B,SAC3C,iBACA,gBACE,IAAI,wBAAwB,SAC5B,aAAa,YACV,yBACL,aAAa,SACb,WAAW;;;;;;;wBCrBG,qBAAqB,SACnC,gBAAgB,2BAA2B;GAIzC,uBACE,IAAI,wBAAwB,aACzB,2BAAuB,iBAEb,eACA;IAEf;IACA,OAAO;IACP,QAAQ,iBACN,WAAW,uBAAuB,oBAAoB,KAAK;;GAM7D,SACA,uBACE,IAAI,wBAAwB,UAC5B,YAAY,YACT,2BAAuB,iBAEb,eACA,eAAa,YAChB,SAAO,UACT;IAEV;IACA,OAAO;IACP,QAAQ,iBACN,WAAW,uBAAuB,oBAAoB,KAAK"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as useRelationalQuery, r as useRelationalDb, t as createProcessorQuery } from "../../relational-
|
|
1
|
+
import { n as useRelationalQuery, r as useRelationalDb, t as createProcessorQuery } from "../../relational-DZuyKp2y.js";
|
|
2
2
|
export { createProcessorQuery, useRelationalDb, useRelationalQuery };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { CREDENTIAL_SCHEMA_EIP712_TYPE, CREDENTIAL_SUBJECT_TYPE, CREDENTIAL_TYPES, ChevronDownIcon, CopyIcon, DOMAIN_TYPE, DisconnectIcon, ISSUER_TYPE, RENOWN_CHAIN_ID, RENOWN_INITIAL_ANONYMOUS, RENOWN_INITIAL_UNKNOWN, RENOWN_NETWORK_ID, RENOWN_RETURN_URL_STRIPPED_PARAMS, RENOWN_URL, Renown, type RenownAuth, type RenownAuthAsync, RenownAuthButton, type RenownAuthButtonProps, type RenownAuthResolution, type RenownAuthStatus, type RenownInitOptions, type RenownInitialAuth, RenownInitialUserProvider, type RenownInitialUserProviderProps, RenownLoginButton, type RenownLoginButtonProps, type RenownLoginMethod, RenownLogo, type RenownProps, RenownProvider, type RenownProviderProps, type RenownSessionCookieOptions, type RenownSessionCookieState, RenownUserButton, type RenownUserButtonMenuItem, type RenownUserButtonProps, RenownWalletProvider, type RenownWalletProviderProps, SpinnerIcon, UserIcon, VERIFIABLE_CREDENTIAL_EIP712_TYPE, initConnectCrypto, initRenownCrypto, openRenown, useRenown, useRenownAuth, useRenownAuthAsync, useRenownInit, useRenownInitialAuth, useRenownInitialUser, useRenownLoginMethods, useRenownSessionCookie, useRenownSessionSynced, useRenownWalletAdapter };
|
|
1
|
+
import { A as DOMAIN_TYPE, B as CopyIcon, C as RenownInitialUserProvider, D as CREDENTIAL_SCHEMA_EIP712_TYPE, E as useRenownInitialUser, F as RENOWN_URL, G as RenownUserButton, H as RenownLogo, I as VERIFIABLE_CREDENTIAL_EIP712_TYPE, J as RenownLoginButton, K as RenownUserButtonMenuItem, L as initConnectCrypto, M as RENOWN_CHAIN_ID, N as RENOWN_NETWORK_ID, O as CREDENTIAL_SUBJECT_TYPE, P as RENOWN_RETURN_URL_STRIPPED_PARAMS, R as initRenownCrypto, S as RenownInitialAuth, T as useRenownInitialAuth, U as SpinnerIcon, V as DisconnectIcon, W as UserIcon, X as RenownAuthButton, Y as RenownLoginButtonProps, Z as RenownAuthButtonProps, _ as RenownSessionCookieState, a as useRenownWalletAdapter, at as desktopShell, b as RENOWN_INITIAL_ANONYMOUS, c as RenownWalletProvider, ct as openRenown, d as RenownProviderProps, dt as RenownAuthResolution, f as Renown, ft as RenownAuthStatus, g as RenownSessionCookieOptions, h as useRenownInit, i as decodeDelegation, it as DesktopShell, j as ISSUER_TYPE, k as CREDENTIAL_TYPES, l as RenownWalletProviderProps, lt as RenownAuth, m as RenownInitOptions, mt as useRenownAuthAsync, n as DelegationScope, nt as useRenown, o as RenownLoginMethod, p as RenownProps, pt as useRenownAuth, q as RenownUserButtonProps, r as createDelegation, s as useRenownLoginMethods, t as DelegationClaims, u as RenownProvider, ut as RenownAuthAsync, v as useRenownSessionCookie, w as RenownInitialUserProviderProps, x as RENOWN_INITIAL_UNKNOWN, y as useRenownSessionSynced, z as ChevronDownIcon } from "../../index-CNS_9THu.js";
|
|
2
|
+
export { CREDENTIAL_SCHEMA_EIP712_TYPE, CREDENTIAL_SUBJECT_TYPE, CREDENTIAL_TYPES, ChevronDownIcon, CopyIcon, DOMAIN_TYPE, type DelegationClaims, type DelegationScope, type DesktopShell, DisconnectIcon, ISSUER_TYPE, RENOWN_CHAIN_ID, RENOWN_INITIAL_ANONYMOUS, RENOWN_INITIAL_UNKNOWN, RENOWN_NETWORK_ID, RENOWN_RETURN_URL_STRIPPED_PARAMS, RENOWN_URL, Renown, type RenownAuth, type RenownAuthAsync, RenownAuthButton, type RenownAuthButtonProps, type RenownAuthResolution, type RenownAuthStatus, type RenownInitOptions, type RenownInitialAuth, RenownInitialUserProvider, type RenownInitialUserProviderProps, RenownLoginButton, type RenownLoginButtonProps, type RenownLoginMethod, RenownLogo, type RenownProps, RenownProvider, type RenownProviderProps, type RenownSessionCookieOptions, type RenownSessionCookieState, RenownUserButton, type RenownUserButtonMenuItem, type RenownUserButtonProps, RenownWalletProvider, type RenownWalletProviderProps, SpinnerIcon, UserIcon, VERIFIABLE_CREDENTIAL_EIP712_TYPE, createDelegation, decodeDelegation, desktopShell, initConnectCrypto, initRenownCrypto, openRenown, useRenown, useRenownAuth, useRenownAuthAsync, useRenownInit, useRenownInitialAuth, useRenownInitialUser, useRenownLoginMethods, useRenownSessionCookie, useRenownSessionSynced, useRenownWalletAdapter };
|
|
3
3
|
export {};
|
package/dist/src/renown/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as useRenown, c as RENOWN_INITIAL_UNKNOWN, d as useRenownInitialUser, l as RenownInitialUserProvider, s as RENOWN_INITIAL_ANONYMOUS, u as useRenownInitialAuth } from "../../renown-
|
|
2
|
-
import { A as
|
|
3
|
-
export { CREDENTIAL_SCHEMA_EIP712_TYPE, CREDENTIAL_SUBJECT_TYPE, CREDENTIAL_TYPES, ChevronDownIcon, CopyIcon, DOMAIN_TYPE, DisconnectIcon, ISSUER_TYPE, RENOWN_CHAIN_ID, RENOWN_INITIAL_ANONYMOUS, RENOWN_INITIAL_UNKNOWN, RENOWN_NETWORK_ID, RENOWN_RETURN_URL_STRIPPED_PARAMS, RENOWN_URL, Renown, RenownAuthButton, RenownInitialUserProvider, RenownLoginButton, RenownLogo, RenownProvider, RenownUserButton, RenownWalletProvider, SpinnerIcon, UserIcon, VERIFIABLE_CREDENTIAL_EIP712_TYPE, initConnectCrypto, initRenownCrypto, openRenown, useRenown, useRenownAuth, useRenownAuthAsync, useRenownInit, useRenownInitialAuth, useRenownInitialUser, useRenownLoginMethods, useRenownSessionCookie, useRenownSessionSynced, useRenownWalletAdapter };
|
|
1
|
+
import { a as useRenown, c as RENOWN_INITIAL_UNKNOWN, d as useRenownInitialUser, l as RenownInitialUserProvider, s as RENOWN_INITIAL_ANONYMOUS, u as useRenownInitialAuth } from "../../renown-CBoTdGrg.js";
|
|
2
|
+
import { A as CREDENTIAL_TYPES, C as useRenownAuthAsync, D as openRenown, F as RENOWN_RETURN_URL_STRIPPED_PARAMS, I as RENOWN_URL, L as VERIFIABLE_CREDENTIAL_EIP712_TYPE, M as ISSUER_TYPE, N as RENOWN_CHAIN_ID, O as CREDENTIAL_SCHEMA_EIP712_TYPE, P as RENOWN_NETWORK_ID, S as useRenownAuth, _ as CopyIcon, a as RenownProvider, b as SpinnerIcon, c as useRenownInit, d as initConnectCrypto, f as initRenownCrypto, g as ChevronDownIcon, h as RenownLoginButton, i as useRenownLoginMethods, j as DOMAIN_TYPE, k as CREDENTIAL_SUBJECT_TYPE, l as useRenownSessionCookie, m as RenownUserButton, n as decodeDelegation, o as RenownWalletProvider, p as RenownAuthButton, r as useRenownWalletAdapter, s as Renown, t as createDelegation, u as useRenownSessionSynced, v as DisconnectIcon, w as desktopShell, x as UserIcon, y as RenownLogo } from "../../renown-B3MUaiq7.js";
|
|
3
|
+
export { CREDENTIAL_SCHEMA_EIP712_TYPE, CREDENTIAL_SUBJECT_TYPE, CREDENTIAL_TYPES, ChevronDownIcon, CopyIcon, DOMAIN_TYPE, DisconnectIcon, ISSUER_TYPE, RENOWN_CHAIN_ID, RENOWN_INITIAL_ANONYMOUS, RENOWN_INITIAL_UNKNOWN, RENOWN_NETWORK_ID, RENOWN_RETURN_URL_STRIPPED_PARAMS, RENOWN_URL, Renown, RenownAuthButton, RenownInitialUserProvider, RenownLoginButton, RenownLogo, RenownProvider, RenownUserButton, RenownWalletProvider, SpinnerIcon, UserIcon, VERIFIABLE_CREDENTIAL_EIP712_TYPE, createDelegation, decodeDelegation, desktopShell, initConnectCrypto, initRenownCrypto, openRenown, useRenown, useRenownAuth, useRenownAuthAsync, useRenownInit, useRenownInitialAuth, useRenownInitialUser, useRenownLoginMethods, useRenownSessionCookie, useRenownSessionSynced, useRenownWalletAdapter };
|
package/dist/src/rpc/index.d.ts
CHANGED
|
@@ -1,138 +1,40 @@
|
|
|
1
1
|
import { r as PGliteWithLive } from "../../index-rtDmzViP.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { i as createWorkerAdminClient, n as createInspectorProxy, r as IWorkerAdminClient, t as IInspectorProxy } from "../../inspector-proxy-DODqs15F.js";
|
|
3
|
+
import { DocumentModelModule, PeerManifest, UpgradeManifest } from "@powerhousedao/shared/document-model";
|
|
4
|
+
import { ChannelConfig, DeadLetterPage, DriveCollectionId, IDocumentModelLoader, IDocumentModelRegistry, IEventBus, IInspector, IInspectorAdmin, IPeerAgreement, IReactorClient, IReactorDbQuery, ISyncAdmin, ISyncInspector, ISyncManager, InspectorAccess, LocalChannelPortRegistry, LocalPeerSyncManager, Remote, RemoteFilter, RemoteOptions, RemoteSyncInspection, ShutdownStatus, SyncHold, SyncStatus, SyncStatusChangeCallback, Unsubscribe } from "@powerhousedao/reactor";
|
|
5
|
+
import { ClientMessage, CorrelationId, ErrorInfo, ICorrelatedSubscriptions, IHostResponder, IRpcTransport, IRpcTransport as IRpcTransport$1, KeyedListeners, Listeners, MessageRouter, MessageRouter as MessageRouter$1, MethodCallMessage, OpKind, OpKind as OpKind$1, OwnerMessage, RPC_PROTOCOL_VERSION, ReactorHostServer, ReactorIdentity, ReactorIdentity as ReactorIdentity$1, RpcAdoptSyncPeer, RpcCorrelator, RpcDbOp, RpcLiveEvent, RpcLiveSubscribe, RpcLiveUnsub, RpcMessage, RpcPoster, RpcRemoveSyncPeer, RpcRequestOptions, SubscriptionStore, VersionFingerprint, VersionFingerprint as VersionFingerprint$1, WorkerInspectorInfo, WorkerMigrationState, WorkerMigrationState as WorkerMigrationState$1, WorkerPackageSource, WorkerPackageSource as WorkerPackageSource$1, createCorrelatedSubscriptions, createPortTransport, createReactorClientProxy, fromErrorInfo, hostResponder, toErrorInfo } from "@powerhousedao/reactor/rpc";
|
|
6
|
+
//#region src/rpc/adopt-sync-peer.d.ts
|
|
7
|
+
type AdoptSyncPeerParams = {
|
|
8
|
+
peerId: string;
|
|
9
|
+
channelName: string;
|
|
10
|
+
/** `DriveCollectionId.key`; the class does not survive structured clone. */
|
|
11
|
+
collectionIdKey: string;
|
|
12
|
+
remoteName: string;
|
|
13
|
+
filter: RemoteFilter;
|
|
10
14
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export declare function toVoid(promise: Promise<unknown>): Promise<void>;
|
|
16
|
-
interface IOpChannel {
|
|
17
|
-
call(method: string, args?: unknown[]): Promise<unknown>;
|
|
18
|
-
callVoid(method: string, args?: unknown[]): Promise<void>;
|
|
19
|
-
}
|
|
20
|
-
export declare function opChannel(router: MessageRouter, kind: OpKind, timeoutMs?: number): IOpChannel;
|
|
21
|
-
//#endregion
|
|
22
|
-
//#region src/rpc/host-reply.d.ts
|
|
23
|
-
interface IHostResponder {
|
|
24
|
-
ok(id: CorrelationId, value?: unknown): void;
|
|
25
|
-
err(id: CorrelationId, error: unknown): void;
|
|
26
|
-
errForKind(message: ClientMessage, error: unknown): void;
|
|
27
|
-
run(id: CorrelationId, body: () => Promise<unknown>, mapOk?: (value: unknown) => unknown): Promise<void>;
|
|
28
|
-
}
|
|
29
|
-
export declare function hostResponder(transport: IRpcTransport): IHostResponder;
|
|
30
|
-
//#endregion
|
|
31
|
-
//#region src/rpc/listeners.d.ts
|
|
32
|
-
export declare class KeyedListeners<K, A extends unknown[] = []> {
|
|
33
|
-
private readonly map;
|
|
34
|
-
add(key: K, fn: (...a: A) => void): () => void;
|
|
35
|
-
emit(key: K, ...a: A): void;
|
|
36
|
-
emitAll(...a: A): void;
|
|
37
|
-
}
|
|
38
|
-
export declare class Listeners<A extends unknown[] = []> {
|
|
39
|
-
private readonly keyed;
|
|
40
|
-
add(fn: (...a: A) => void): () => void;
|
|
41
|
-
emit(...a: A): void;
|
|
42
|
-
}
|
|
43
|
-
//#endregion
|
|
44
|
-
//#region src/rpc/subscription.d.ts
|
|
45
|
-
export declare class SubscriptionStore {
|
|
46
|
-
private readonly map;
|
|
47
|
-
set(id: CorrelationId, unsubscribe: () => void): void;
|
|
48
|
-
get(id: CorrelationId): (() => void) | undefined;
|
|
49
|
-
delete(id: CorrelationId): void;
|
|
50
|
-
end(id: CorrelationId): void;
|
|
51
|
-
drain(): void;
|
|
52
|
-
}
|
|
53
|
-
interface ICorrelatedSubscriptions<Sub> {
|
|
54
|
-
subscribe(sub: Sub, open: (id: CorrelationId) => ClientMessage): () => void;
|
|
55
|
-
}
|
|
56
|
-
interface CorrelatedConfig<Sub, EK extends OwnerMessage["k"], ErrK extends OwnerMessage["k"]> {
|
|
57
|
-
idPrefix: string;
|
|
58
|
-
eventKind: EK;
|
|
59
|
-
errKind: ErrK;
|
|
60
|
-
onEvent: (sub: Sub, message: Extract<OwnerMessage, {
|
|
61
|
-
k: EK;
|
|
62
|
-
}>) => void;
|
|
63
|
-
onError: (sub: Sub, message: Extract<OwnerMessage, {
|
|
64
|
-
k: ErrK;
|
|
65
|
-
}>) => void;
|
|
66
|
-
close: (id: CorrelationId) => ClientMessage;
|
|
67
|
-
}
|
|
68
|
-
export declare function createCorrelatedSubscriptions<Sub, EK extends OwnerMessage["k"], ErrK extends OwnerMessage["k"]>(router: MessageRouter, config: CorrelatedConfig<Sub, EK, ErrK>): ICorrelatedSubscriptions<Sub>;
|
|
69
|
-
//#endregion
|
|
70
|
-
//#region src/rpc/live-query-proxy.d.ts
|
|
71
|
-
type LiveQueryResultsCallback = (results: unknown) => void;
|
|
72
|
-
type LiveQueryErrorCallback = (error: unknown) => void;
|
|
73
|
-
interface ILiveQueryProxy {
|
|
74
|
-
query(sql: string, params: unknown[], onResults: LiveQueryResultsCallback, onError?: LiveQueryErrorCallback): () => void;
|
|
75
|
-
}
|
|
76
|
-
export declare function createLiveQueryProxy(router: MessageRouter): ILiveQueryProxy;
|
|
77
|
-
//#endregion
|
|
78
|
-
//#region src/rpc/relational-db-proxy.d.ts
|
|
79
|
-
export declare function createRelationalPgliteProxy(router: MessageRouter): PGliteWithLive;
|
|
80
|
-
//#endregion
|
|
81
|
-
//#region src/rpc/event-bus-proxy.d.ts
|
|
82
|
-
/** Tab-side IEventBus over bus-event; emit() is unsupported (the worker emits). */
|
|
83
|
-
export declare class ReactorEventBusProxy implements IEventBus {
|
|
84
|
-
private readonly forwardedTypes;
|
|
85
|
-
private readonly subscribers;
|
|
86
|
-
constructor(router: MessageRouter);
|
|
87
|
-
subscribe<K>(type: number, subscriber: (type: number, event: K) => void | Promise<void>): Unsubscribe;
|
|
88
|
-
emit(): Promise<void>;
|
|
89
|
-
}
|
|
90
|
-
export declare function createReactorEventBusProxy(router: MessageRouter): IEventBus;
|
|
91
|
-
//#endregion
|
|
92
|
-
//#region src/rpc/forwarded-events.d.ts
|
|
93
|
-
export declare const FORWARDED_EVENT_TYPES: (10008 | 20001 | 20002 | 20003 | 20004 | 20005)[];
|
|
94
|
-
export declare const FORWARDED_BUS_EVENT_TYPES: number[];
|
|
95
|
-
//#endregion
|
|
96
|
-
//#region src/rpc/connect-reactor.d.ts
|
|
97
|
-
type ReactorHello = {
|
|
98
|
-
version: VersionFingerprint;
|
|
99
|
-
construct?: unknown;
|
|
100
|
-
packages?: string[];
|
|
15
|
+
type RemoveSyncPeerParams = {
|
|
16
|
+
peerId: string;
|
|
17
|
+
channelName: string;
|
|
18
|
+
remoteName: string;
|
|
101
19
|
};
|
|
102
|
-
|
|
103
|
-
export declare function
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
export declare class ReactorHostServer {
|
|
107
|
-
private readonly client;
|
|
108
|
-
private readonly transport;
|
|
109
|
-
private readonly reply;
|
|
110
|
-
private readonly aborters;
|
|
111
|
-
private readonly subscriptions;
|
|
112
|
-
private readonly pages;
|
|
113
|
-
private pageCounter;
|
|
114
|
-
private detach;
|
|
115
|
-
constructor(client: IReactorClient, transport: IRpcTransport);
|
|
116
|
-
start(): void;
|
|
117
|
-
stop(): void;
|
|
118
|
-
handleMessage(message: ClientMessage): Promise<void>;
|
|
119
|
-
private handleRequest;
|
|
120
|
-
private handlePage;
|
|
121
|
-
private handleSubscribe;
|
|
122
|
-
private prepareResult;
|
|
123
|
-
private resolveMethod;
|
|
124
|
-
}
|
|
20
|
+
/** Moves `port` to the host, which adopts the peer as a local remote over it. */
|
|
21
|
+
export declare function sendAdoptSyncPeer(router: MessageRouter$1, params: AdoptSyncPeerParams, port: MessagePort): Promise<void>;
|
|
22
|
+
/** Removes the peer's remote and closes its port in the host's registry. */
|
|
23
|
+
export declare function sendRemoveSyncPeer(router: MessageRouter$1, params: RemoveSyncPeerParams): Promise<void>;
|
|
125
24
|
//#endregion
|
|
126
25
|
//#region src/rpc/reactor-host.d.ts
|
|
127
26
|
type ReactorHostOptions = {
|
|
128
27
|
client?: IReactorClient;
|
|
129
28
|
build?: (construct: unknown) => Promise<IReactorClient>;
|
|
130
|
-
registerPackages?: (specs: string[]) => Promise<void>;
|
|
29
|
+
registerPackages?: (specs: string[], sources?: WorkerPackageSource$1[]) => Promise<void>;
|
|
131
30
|
unregisterPackages?: (names: string[]) => Promise<void>;
|
|
132
|
-
onIdentity?: (user: ReactorIdentity | null) => void;
|
|
31
|
+
onIdentity?: (user: ReactorIdentity$1 | null) => void;
|
|
133
32
|
onSyncOp?: (method: string, args: unknown[]) => Promise<unknown>;
|
|
134
33
|
onDbOp?: (method: string, args: unknown[]) => Promise<unknown>;
|
|
135
34
|
onInspectorOp?: (method: string, args: unknown[]) => Promise<unknown>;
|
|
35
|
+
/** See `localSyncPeerHandlers`, which builds both over the reactor's registry. */
|
|
36
|
+
onAdoptSyncPeer?: (params: AdoptSyncPeerParams, port: MessagePort) => Promise<void>;
|
|
37
|
+
onRemoveSyncPeer?: (params: RemoveSyncPeerParams) => Promise<void>;
|
|
136
38
|
onLiveQuery?: (sql: string, params: unknown[], onResults: (results: unknown) => void) => Promise<() => void>;
|
|
137
39
|
namespace?: string;
|
|
138
40
|
appBuildId?: string;
|
|
@@ -141,7 +43,14 @@ type ReactorHostOptions = {
|
|
|
141
43
|
onAdminRestart?: () => void;
|
|
142
44
|
onAdminClearStorage?: () => Promise<void>;
|
|
143
45
|
onAdminMigrate?: () => Promise<void>;
|
|
46
|
+
/** Stops the reactor and releases its stores once the worker is retired. */
|
|
47
|
+
onRetire?: (reason: string) => Promise<void>;
|
|
48
|
+
/** Bounded; a deploy's reload waits on it while data is already refused. */
|
|
49
|
+
drainBeforeReload?: () => Promise<void>;
|
|
144
50
|
};
|
|
51
|
+
/** Whether a reload reason comes from a build fingerprint mismatch. */
|
|
52
|
+
export declare function isFingerprintMismatchReload(reason: string): boolean;
|
|
53
|
+
export declare const RETIRED_WORKER_RELOAD_REASON = "worker retired";
|
|
145
54
|
export declare class ReactorHost {
|
|
146
55
|
private readonly options;
|
|
147
56
|
private readonly disposers;
|
|
@@ -152,12 +61,19 @@ export declare class ReactorHost {
|
|
|
152
61
|
private readonly ownerId;
|
|
153
62
|
private readonly bootedAtMs;
|
|
154
63
|
private migrationState;
|
|
64
|
+
private retirement;
|
|
65
|
+
private reloadSent;
|
|
155
66
|
constructor(options: ReactorHostOptions);
|
|
156
|
-
connect(transport: IRpcTransport): () => void;
|
|
67
|
+
connect(transport: IRpcTransport$1): () => void;
|
|
157
68
|
connectPort(port: MessagePort): () => void;
|
|
158
69
|
broadcastBusEvent(eventType: number, event: unknown): void;
|
|
159
70
|
broadcastReload(reason: string, workerGen?: string): void;
|
|
160
|
-
|
|
71
|
+
retireAndReload(reason: string, workerGen: string): void;
|
|
72
|
+
private drainThenReload;
|
|
73
|
+
private sendReload;
|
|
74
|
+
private stopRetired;
|
|
75
|
+
setMigrationState(state: WorkerMigrationState$1): void;
|
|
76
|
+
get retired(): boolean;
|
|
161
77
|
get connectionCount(): number;
|
|
162
78
|
private handleAdmin;
|
|
163
79
|
private handleAdminAsync;
|
|
@@ -168,16 +84,89 @@ export declare class ReactorHost {
|
|
|
168
84
|
private handleRegister;
|
|
169
85
|
private handleUnregister;
|
|
170
86
|
private handleOp;
|
|
87
|
+
/** An `add` or `remove` changes the remotes every tab lists. */
|
|
88
|
+
private handleSyncOp;
|
|
89
|
+
/** Closes the moved port on every failure; the sender can no longer close it. */
|
|
90
|
+
private handleAdoptSyncPeer;
|
|
91
|
+
private handleRemoveSyncPeer;
|
|
92
|
+
private broadcastRemotes;
|
|
171
93
|
private handleLiveSubscribe;
|
|
172
94
|
}
|
|
173
95
|
//#endregion
|
|
174
|
-
//#region src/rpc/sync-
|
|
96
|
+
//#region src/rpc/local-sync-peer-handlers.d.ts
|
|
97
|
+
/** The host's adopt/remove handlers over the reactor's local peer registry. */
|
|
98
|
+
export declare function localSyncPeerHandlers(syncManager: LocalPeerSyncManager, registry: LocalChannelPortRegistry): Required<Pick<ReactorHostOptions, "onAdoptSyncPeer" | "onRemoveSyncPeer">>;
|
|
99
|
+
//#endregion
|
|
100
|
+
//#region src/rpc/inspector-ops.d.ts
|
|
101
|
+
type InspectorOpTargets = {
|
|
102
|
+
inspector: IInspector & Partial<IInspectorAdmin>;
|
|
103
|
+
dbQuery?: IReactorDbQuery;
|
|
104
|
+
};
|
|
105
|
+
/** Host side of `inspector-op`; refuses tiers `access` does not grant. */
|
|
106
|
+
export declare function dispatchInspectorOp(targets: InspectorOpTargets, access: InspectorAccess, method: string, args: unknown[]): Promise<unknown>;
|
|
107
|
+
type SyncInspectionOpTargets = {
|
|
108
|
+
inspector?: ISyncInspector;
|
|
109
|
+
admin?: ISyncAdmin;
|
|
110
|
+
};
|
|
111
|
+
/** Whether `method` is one of the `sync-op` rows `dispatchSyncInspectionOp` serves. */
|
|
112
|
+
export declare function isSyncInspectionOp(method: string): boolean;
|
|
113
|
+
/** Host side of the inspection and repair rows of `sync-op`. */
|
|
114
|
+
export declare function dispatchSyncInspectionOp(targets: SyncInspectionOpTargets, access: InspectorAccess, method: string, args: unknown[]): Promise<unknown>;
|
|
115
|
+
//#endregion
|
|
116
|
+
//#region src/rpc/op-channel.d.ts
|
|
117
|
+
export declare const RPC_DEFAULT_TIMEOUT_MS = 30000;
|
|
118
|
+
export declare function toVoid(promise: Promise<unknown>): Promise<void>;
|
|
119
|
+
interface IOpChannel {
|
|
120
|
+
call(method: string, args?: unknown[]): Promise<unknown>;
|
|
121
|
+
callVoid(method: string, args?: unknown[]): Promise<void>;
|
|
122
|
+
}
|
|
123
|
+
export declare function opChannel(router: MessageRouter$1, kind: OpKind$1, timeoutMs?: number): IOpChannel;
|
|
124
|
+
//#endregion
|
|
125
|
+
//#region src/rpc/live-query-proxy.d.ts
|
|
126
|
+
type LiveQueryResultsCallback = (results: unknown) => void;
|
|
127
|
+
type LiveQueryErrorCallback = (error: unknown) => void;
|
|
128
|
+
interface ILiveQueryProxy {
|
|
129
|
+
query(sql: string, params: unknown[], onResults: LiveQueryResultsCallback, onError?: LiveQueryErrorCallback): () => void;
|
|
130
|
+
}
|
|
131
|
+
export declare function createLiveQueryProxy(router: MessageRouter$1): ILiveQueryProxy;
|
|
132
|
+
//#endregion
|
|
133
|
+
//#region src/rpc/relational-db-proxy.d.ts
|
|
134
|
+
export declare function createRelationalPgliteProxy(router: MessageRouter$1): PGliteWithLive;
|
|
135
|
+
//#endregion
|
|
136
|
+
//#region src/rpc/event-bus-proxy.d.ts
|
|
137
|
+
/** Tab-side IEventBus over bus-event; emit() is unsupported (the worker emits). */
|
|
138
|
+
export declare class ReactorEventBusProxy implements IEventBus {
|
|
139
|
+
private readonly forwardedTypes;
|
|
140
|
+
private readonly subscribers;
|
|
141
|
+
constructor(router: MessageRouter$1);
|
|
142
|
+
subscribe<K>(type: number, subscriber: (type: number, event: K) => void | Promise<void>): Unsubscribe;
|
|
143
|
+
emit(): Promise<void>;
|
|
144
|
+
}
|
|
145
|
+
export declare function createReactorEventBusProxy(router: MessageRouter$1): IEventBus;
|
|
146
|
+
//#endregion
|
|
147
|
+
//#region src/rpc/forwarded-events.d.ts
|
|
148
|
+
export declare const FORWARDED_EVENT_TYPES: (10008 | 20001 | 20002 | 20003 | 20004 | 20005)[];
|
|
149
|
+
export declare const FORWARDED_BUS_EVENT_TYPES: number[];
|
|
150
|
+
//#endregion
|
|
151
|
+
//#region src/rpc/connect-reactor.d.ts
|
|
152
|
+
type ReactorHello = {
|
|
153
|
+
version: VersionFingerprint$1;
|
|
154
|
+
construct?: unknown;
|
|
155
|
+
packages?: string[];
|
|
156
|
+
};
|
|
157
|
+
export declare function connectReactorClient(router: MessageRouter$1, hello: ReactorHello, onReload?: (reason: string, workerGen?: string) => void, registry?: IDocumentModelRegistry): IReactorClient;
|
|
158
|
+
export declare function postReactorIdentity(router: MessageRouter$1, user: ReactorIdentity$1 | null): void;
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region src/rpc/bus-event-ids.d.ts
|
|
175
161
|
export declare const SYNC_STATUS_CHANGED_EVENT = 90001;
|
|
162
|
+
export declare const SYNC_REMOTES_CHANGED_EVENT = 90002;
|
|
163
|
+
//#endregion
|
|
164
|
+
//#region src/rpc/sync-manager-proxy.d.ts
|
|
176
165
|
type SyncStatusChangedBusEvent = {
|
|
177
166
|
documentId: string;
|
|
178
167
|
status: SyncStatus;
|
|
179
168
|
};
|
|
180
|
-
export declare class SyncManagerProxy implements ISyncManager {
|
|
169
|
+
export declare class SyncManagerProxy implements ISyncManager, ISyncInspector, ISyncAdmin {
|
|
181
170
|
private readonly ops;
|
|
182
171
|
private readonly connectionStates;
|
|
183
172
|
private readonly connectionListeners;
|
|
@@ -186,8 +175,11 @@ export declare class SyncManagerProxy implements ISyncManager {
|
|
|
186
175
|
private remotes;
|
|
187
176
|
private basis;
|
|
188
177
|
private seedPromise;
|
|
189
|
-
constructor(router: MessageRouter, busProxy: IEventBus);
|
|
190
|
-
|
|
178
|
+
constructor(router: MessageRouter$1, busProxy: IEventBus);
|
|
179
|
+
/** Attempts that fail while `isWaiting()` (the worker waits on a store lock) are not counted. */
|
|
180
|
+
startup({ isWaiting }?: {
|
|
181
|
+
isWaiting?: () => boolean;
|
|
182
|
+
}): Promise<void>;
|
|
191
183
|
shutdown(): ShutdownStatus;
|
|
192
184
|
getByName(name: string): Remote;
|
|
193
185
|
getById(id: string): Remote;
|
|
@@ -208,13 +200,53 @@ export declare class SyncManagerProxy implements ISyncManager {
|
|
|
208
200
|
waitForSync(): Promise<never>;
|
|
209
201
|
getSyncStatus(documentId: string): SyncStatus | undefined;
|
|
210
202
|
onSyncStatusChange(callback: SyncStatusChangeCallback): () => void;
|
|
203
|
+
inspectRemote(remoteName: string): Promise<RemoteSyncInspection>;
|
|
204
|
+
inspectRemotes(): Promise<RemoteSyncInspection[]>;
|
|
205
|
+
listDeadLetters(remoteName: string, cursor?: string, limit?: number): Promise<DeadLetterPage>;
|
|
206
|
+
resetChannel(remoteName: string): Promise<void>;
|
|
207
|
+
requeueDeadLetter(remoteName: string, id: string): Promise<void>;
|
|
208
|
+
clearDeadLetter(remoteName: string, id: string): Promise<void>;
|
|
209
|
+
private tableOp;
|
|
211
210
|
private callSyncOp;
|
|
212
211
|
private notifyConnection;
|
|
213
212
|
private makeChannel;
|
|
214
213
|
private refreshRemotes;
|
|
214
|
+
private applyRemotes;
|
|
215
215
|
private ensureSeeded;
|
|
216
216
|
}
|
|
217
|
-
export declare function createSyncManagerProxy(router: MessageRouter, busProxy: IEventBus): ISyncManager;
|
|
217
|
+
export declare function createSyncManagerProxy(router: MessageRouter$1, busProxy: IEventBus): ISyncManager;
|
|
218
|
+
//#endregion
|
|
219
|
+
//#region src/rpc/module-graph.d.ts
|
|
220
|
+
/** A bare specifier's URL in the shared table: an exact entry, else the longest trailing-slash prefix, as an import map does. */
|
|
221
|
+
export declare function resolveSharedSpecifier(specifier: string, imports: Record<string, string>): string | undefined;
|
|
222
|
+
type ModuleGraphOptions = {
|
|
223
|
+
sharedImports?: Record<string, string>;
|
|
224
|
+
/** Reads a module's source; defaults to fetch. */
|
|
225
|
+
fetchSource?: (url: string) => Promise<string>;
|
|
226
|
+
/** Makes a rewritten source importable; defaults to a blob URL. */
|
|
227
|
+
createModuleUrl?: (source: string) => string;
|
|
228
|
+
/** Told about dynamic imports with computed specifiers, which stay as they are. */
|
|
229
|
+
warn?: (message: string) => void;
|
|
230
|
+
};
|
|
231
|
+
export declare class ModuleGraph {
|
|
232
|
+
private readonly sharedImports;
|
|
233
|
+
private readonly fetchSource;
|
|
234
|
+
private readonly createModuleUrl;
|
|
235
|
+
private readonly warn;
|
|
236
|
+
private readonly parsed;
|
|
237
|
+
private readonly built;
|
|
238
|
+
constructor(options?: ModuleGraphOptions);
|
|
239
|
+
/** The URL to import in place of `entryUrl`; `entryUrl` itself when nothing needed a rewrite. */
|
|
240
|
+
resolve(entryUrl: string): Promise<string>;
|
|
241
|
+
private collect;
|
|
242
|
+
private parse;
|
|
243
|
+
private readModule;
|
|
244
|
+
private assertAcyclic;
|
|
245
|
+
private assertMapped;
|
|
246
|
+
private needsRewrite;
|
|
247
|
+
private build;
|
|
248
|
+
private rewrite;
|
|
249
|
+
}
|
|
218
250
|
//#endregion
|
|
219
251
|
//#region src/rpc/worker-package-loader.d.ts
|
|
220
252
|
type PackageImporter = (url: string) => Promise<Record<string, unknown>>;
|
|
@@ -222,42 +254,67 @@ type WorkerPackageLoaderOptions = {
|
|
|
222
254
|
cdnUrl: string;
|
|
223
255
|
importPackage: PackageImporter;
|
|
224
256
|
resolvePackages?: (documentType: string) => Promise<string[]>;
|
|
225
|
-
/** Absolute
|
|
226
|
-
* exist, so the source is rewritten to these URLs and blob-imported). */
|
|
257
|
+
/** Absolute URLs for the shared deps a registry package leaves bare; a worker has no import map. */
|
|
227
258
|
sharedImports?: Record<string, string>;
|
|
228
|
-
|
|
229
|
-
* rewrite happened; omit to disable shared-deps loading in a worker. */
|
|
230
|
-
importSource?: (source: string) => Promise<Record<string, unknown>>;
|
|
231
|
-
};
|
|
259
|
+
} & Pick<ModuleGraphOptions, "fetchSource" | "createModuleUrl" | "warn">;
|
|
232
260
|
type PackageLoadFailure = {
|
|
233
261
|
name: string;
|
|
234
262
|
url: string;
|
|
235
263
|
error: unknown;
|
|
236
264
|
};
|
|
265
|
+
/** One line for a failed load: the package, its URL and why. */
|
|
266
|
+
export declare function describeLoadFailure(failure: PackageLoadFailure): string;
|
|
267
|
+
type AnyUpgradeManifest = UpgradeManifest<readonly number[]>;
|
|
237
268
|
export declare class WorkerPackageLoader implements IDocumentModelLoader {
|
|
238
269
|
private readonly cdnUrl;
|
|
239
270
|
private readonly importPackage;
|
|
240
271
|
private readonly resolvePackages;
|
|
241
|
-
private readonly
|
|
242
|
-
private readonly importSource?;
|
|
272
|
+
private readonly moduleGraph;
|
|
243
273
|
private readonly modulesByKey;
|
|
244
|
-
private readonly
|
|
274
|
+
private readonly manifestsByType;
|
|
275
|
+
private readonly keysBySource;
|
|
276
|
+
private readonly manifestTypesBySource;
|
|
277
|
+
private readonly loadedUrls;
|
|
245
278
|
private readonly failures;
|
|
279
|
+
private readonly pendingLoads;
|
|
280
|
+
private readonly generationBySource;
|
|
281
|
+
private generation;
|
|
246
282
|
constructor(options: WorkerPackageLoaderOptions);
|
|
247
283
|
loadPackages(specs: string[]): Promise<DocumentModelModule[]>;
|
|
284
|
+
/** Loads registry packages added or updated after boot; returns the types whose modules changed, and the failures. */
|
|
285
|
+
updatePackages(specs: string[]): Promise<{
|
|
286
|
+
types: string[];
|
|
287
|
+
failures: PackageLoadFailure[];
|
|
288
|
+
}>;
|
|
289
|
+
/** Loads URL-addressed packages (local project packages). Idempotent. */
|
|
290
|
+
loadSources(sources: WorkerPackageSource$1[]): Promise<void>;
|
|
291
|
+
/**
|
|
292
|
+
* Replaces previously loaded sources with freshly imported ones (a vetra
|
|
293
|
+
* watch rebuild re-sends the same source under a cache-busted URL). Returns
|
|
294
|
+
* every document type touched - removed, re-added, or new - so the caller
|
|
295
|
+
* can replace the registry's version families. A source whose import fails
|
|
296
|
+
* keeps its previous modules and is reported in `failures`; one superseded
|
|
297
|
+
* by a newer reload of the same source contributes nothing.
|
|
298
|
+
*/
|
|
299
|
+
reloadSources(sources: WorkerPackageSource$1[]): Promise<{
|
|
300
|
+
types: string[];
|
|
301
|
+
failures: PackageLoadFailure[];
|
|
302
|
+
}>;
|
|
248
303
|
load(documentType: string): Promise<DocumentModelModule>;
|
|
249
304
|
get models(): DocumentModelModule[];
|
|
305
|
+
get upgradeManifests(): AnyUpgradeManifest[];
|
|
250
306
|
get loadFailures(): PackageLoadFailure[];
|
|
251
307
|
/** The highest registered version for a type, which is what a bare load resolves to. */
|
|
252
308
|
private latestForType;
|
|
253
309
|
private notLoadedError;
|
|
254
310
|
private loadPackage;
|
|
311
|
+
private loadFromUrl;
|
|
312
|
+
private replaceSource;
|
|
313
|
+
private importNamespace;
|
|
314
|
+
/** Registers a namespace as the key's whole contribution; returns its module types. */
|
|
315
|
+
private registerNamespace;
|
|
255
316
|
}
|
|
256
317
|
//#endregion
|
|
257
|
-
|
|
258
|
-
export declare function toErrorInfo(err: unknown, depth?: number): ErrorInfo;
|
|
259
|
-
export declare function fromErrorInfo(info: ErrorInfo): Error;
|
|
260
|
-
//#endregion
|
|
261
|
-
export { type ClientMessage, type CorrelationId, type ErrorInfo, type ICorrelatedSubscriptions, type IHostResponder, type IInspectorProxy, type ILiveQueryProxy, type IOpChannel, type IRpcTransport, type IWorkerAdminClient, MessageRouter, type MethodCallMessage, type OpKind, type OwnerMessage, type PackageImporter, RPC_PROTOCOL_VERSION, type ReactorHello, type ReactorIdentity, RpcCorrelator, type RpcDbOp, type RpcLiveEvent, type RpcLiveSubscribe, type RpcLiveUnsub, type RpcMessage, type RpcPoster, type RpcRequestOptions, type SyncStatusChangedBusEvent, type VersionFingerprint, type WorkerInspectorInfo, type WorkerMigrationState, type WorkerPackageLoaderOptions, createInspectorProxy, createPortTransport, createWorkerAdminClient };
|
|
318
|
+
export { type AdoptSyncPeerParams, type ClientMessage, type CorrelationId, type ErrorInfo, type ICorrelatedSubscriptions, type IHostResponder, type IInspectorProxy, type ILiveQueryProxy, type IOpChannel, type IRpcTransport, type IWorkerAdminClient, type InspectorOpTargets, KeyedListeners, Listeners, MessageRouter, type MethodCallMessage, type ModuleGraphOptions, type OpKind, type OwnerMessage, type PackageImporter, type PackageLoadFailure, RPC_PROTOCOL_VERSION, type ReactorHello, ReactorHostServer, type ReactorIdentity, type RemoveSyncPeerParams, type RpcAdoptSyncPeer, RpcCorrelator, type RpcDbOp, type RpcLiveEvent, type RpcLiveSubscribe, type RpcLiveUnsub, type RpcMessage, type RpcPoster, type RpcRemoveSyncPeer, type RpcRequestOptions, SubscriptionStore, type SyncInspectionOpTargets, type SyncStatusChangedBusEvent, type VersionFingerprint, type WorkerInspectorInfo, type WorkerMigrationState, type WorkerPackageLoaderOptions, type WorkerPackageSource, createCorrelatedSubscriptions, createInspectorProxy, createPortTransport, createReactorClientProxy, createWorkerAdminClient, fromErrorInfo, hostResponder, toErrorInfo };
|
|
262
319
|
export {};
|
|
263
320
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/rpc/
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/rpc/adopt-sync-peer.ts","../../../src/rpc/reactor-host.ts","../../../src/rpc/local-sync-peer-handlers.ts","../../../src/rpc/inspector-ops.ts","../../../src/rpc/op-channel.ts","../../../src/rpc/live-query-proxy.ts","../../../src/rpc/relational-db-proxy.ts","../../../src/rpc/event-bus-proxy.ts","../../../src/rpc/forwarded-events.ts","../../../src/rpc/connect-reactor.ts","../../../src/rpc/bus-event-ids.ts","../../../src/rpc/sync-manager-proxy.ts","../../../src/rpc/module-graph.ts","../../../src/rpc/worker-package-loader.ts"],"mappings":"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"}
|