@powerhousedao/reactor-browser 6.1.0-dev.9 → 6.1.0
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/{document-by-id-DuujBqAQ.js → document-by-id-BrIy0iHX.js} +2 -2
- package/dist/{document-by-id-DuujBqAQ.js.map → document-by-id-BrIy0iHX.js.map} +1 -1
- package/dist/{index-DgwLcoI3.d.ts → index-Bz4MqX_j.d.ts} +3 -129
- package/dist/{index-DgwLcoI3.d.ts.map → index-Bz4MqX_j.d.ts.map} +1 -1
- package/dist/{index-Ce4S7Kk1.d.ts → index-ZltD7u5Z.d.ts} +2 -2
- package/dist/{index-Ce4S7Kk1.d.ts.map → index-ZltD7u5Z.d.ts.map} +1 -1
- package/dist/index.d.ts +46 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +149 -58
- package/dist/index.js.map +1 -1
- package/dist/{make-ph-event-functions-Cr4GqOTT.js → make-ph-event-functions-DwiD1zH9.js} +2 -6
- package/dist/{make-ph-event-functions-Cr4GqOTT.js.map → make-ph-event-functions-DwiD1zH9.js.map} +1 -1
- package/dist/{relational-jwreqDwz.js → relational-4_LVwp8p.js} +2 -2
- package/dist/relational-4_LVwp8p.js.map +1 -0
- package/dist/{renown-s0H1puU4.js → renown-Dzmo1gJD.js} +10 -98
- package/dist/renown-Dzmo1gJD.js.map +1 -0
- package/dist/src/analytics/index.d.ts +1 -1
- package/dist/src/analytics/index.js +2 -2
- package/dist/src/analytics/index.js.map +1 -1
- package/dist/src/relational/index.d.ts +1 -1
- package/dist/src/relational/index.js +1 -1
- package/dist/src/renown/index.d.ts +1 -1
- package/dist/src/renown/index.js +1 -1
- package/package.json +12 -9
- package/dist/relational-jwreqDwz.js.map +0 -1
- package/dist/renown-s0H1puU4.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as makePHEventFunctions } from "./make-ph-event-functions-
|
|
1
|
+
import { t as makePHEventFunctions } from "./make-ph-event-functions-DwiD1zH9.js";
|
|
2
2
|
import { logger } from "document-model";
|
|
3
3
|
import { buildSignedAction } from "@powerhousedao/shared/document-model";
|
|
4
4
|
import { DocumentChangeType } from "@powerhousedao/reactor";
|
|
@@ -484,4 +484,4 @@ function useDocumentsByIds(ids) {
|
|
|
484
484
|
//#endregion
|
|
485
485
|
export { queueOperations as C, queueActions as S, getAnalyticsStore as _, setDocumentCache as a, setGlobal as b, useDocumentSafe as c, useGetDocumentAsync as d, useGetDocuments as f, createAnalyticsStore as g, readPromiseState as h, addDocumentCacheEventHandler as i, useDocuments as l, addPromiseState as m, useDocumentsByIds as n, useDocument as o, DocumentCache as p, useDispatch as r, useDocumentCache as s, useDocumentById as t, useGetDocument as u, clearGlobal as v, uploadOperations as w, dispatchActions as x, getGlobal as y };
|
|
486
486
|
|
|
487
|
-
//# sourceMappingURL=document-by-id-
|
|
487
|
+
//# sourceMappingURL=document-by-id-BrIy0iHX.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-by-id-DuujBqAQ.js","names":[],"sources":["../src/actions/queue.ts","../src/actions/sign.ts","../src/actions/dispatch.ts","../src/global/core.ts","../src/analytics/store.ts","../src/document-cache.ts","../src/hooks/document-cache.ts","../src/hooks/dispatch.ts","../src/hooks/document-by-id.ts"],"sourcesContent":["import type { FileUploadProgressCallback } from \"@powerhousedao/reactor-browser\";\nimport type {\n Action,\n DocumentOperations,\n Operation,\n PHDocument,\n} from \"@powerhousedao/shared/document-model\";\nimport { logger } from \"document-model\";\n\nexport async function queueActions(\n document: PHDocument | undefined,\n actionOrActions: Action[] | Action | undefined,\n) {\n if (!document) {\n throw new Error(\"No document provided\");\n }\n if (!actionOrActions) {\n throw new Error(\"No actions provided\");\n }\n const actions = Array.isArray(actionOrActions)\n ? actionOrActions\n : [actionOrActions];\n\n if (actions.length === 0) {\n throw new Error(\"No actions provided\");\n }\n\n const reactorClient = window.ph?.reactorClient;\n if (!reactorClient) {\n throw new Error(\"ReactorClient not initialized\");\n }\n\n return await reactorClient.execute(document.header.id, \"main\", actions);\n}\n\nexport async function queueOperations(\n documentId: string,\n operationOrOperations: Operation[] | Operation | undefined,\n) {\n if (!documentId) {\n throw new Error(\"No documentId provided\");\n }\n if (!operationOrOperations) {\n throw new Error(\"No operations provided\");\n }\n const operations = Array.isArray(operationOrOperations)\n ? operationOrOperations\n : [operationOrOperations];\n\n if (operations.length === 0) {\n throw new Error(\"No operations provided\");\n }\n\n const reactorClient = window.ph?.reactorClient;\n if (!reactorClient) {\n throw new Error(\"ReactorClient not initialized\");\n }\n\n const actions = operations.map((op) => op.action);\n return await reactorClient.execute(documentId, \"main\", actions);\n}\n\nexport function deduplicateOperations(\n existingOperations: Record<string, Operation[]>,\n operationsToDeduplicate: Operation[],\n) {\n // make a set of all the operation indices for each scope to avoid duplicates\n const operationIndicesByScope = {} as Record<string, Set<number>>;\n for (const scope of Object.keys(existingOperations)) {\n operationIndicesByScope[scope] = new Set(\n existingOperations[scope].map((op) => op.index),\n );\n }\n\n const newOperations: Operation[] = [];\n\n for (const operation of operationsToDeduplicate) {\n const scope = operation.action.scope;\n const index = operation.index;\n if (operationIndicesByScope[scope].has(index)) {\n const duplicatedExistingOperation = existingOperations[scope].find(\n (op) => op.index === index,\n );\n const duplicatedNewOperation = newOperations.find(\n (op) => op.index === index,\n );\n console.warn(\"skipping duplicate operation\");\n if (duplicatedExistingOperation) {\n console.warn(\n \"duplicate existing operation\",\n duplicatedExistingOperation,\n );\n }\n if (duplicatedNewOperation) {\n console.warn(\"duplicate new operation\", duplicatedNewOperation);\n }\n continue;\n }\n newOperations.push(operation);\n operationIndicesByScope[scope].add(index);\n }\n\n const uniqueOperationIds = new Set<string>();\n const operationsDedupedById: Operation[] = [];\n\n for (const [scope, operations] of Object.entries(existingOperations)) {\n for (const operation of operations) {\n const id = operation.id;\n if (!id) {\n console.warn(\"skipping operation with no id\", operation);\n continue;\n }\n if (uniqueOperationIds.has(id)) {\n console.warn(\n \"skipping existing operation with duplicate id in scope\",\n scope,\n operation,\n );\n continue;\n }\n uniqueOperationIds.add(id);\n }\n }\n\n for (const operation of newOperations) {\n const id = operation.id;\n if (!id) {\n console.warn(\"skipping operation with no id\", operation);\n continue;\n }\n if (uniqueOperationIds.has(id)) {\n console.warn(\n \"skipping new operation with duplicate id in scope\",\n operation.action.scope,\n operation,\n );\n continue;\n }\n uniqueOperationIds.add(id);\n operationsDedupedById.push(operation);\n }\n return operationsDedupedById;\n}\n\nexport async function uploadOperations(\n documentId: string,\n allOperations: DocumentOperations,\n pushOperations: (\n documentId: string,\n operations: Operation[],\n ) => Promise<PHDocument | undefined>,\n options?: {\n operationsLimit?: number;\n onProgress?: FileUploadProgressCallback;\n },\n) {\n const operationsLimit = options?.operationsLimit || 50;\n const onProgress = options?.onProgress;\n\n logger.verbose(\n `uploadDocumentOperations(documentId:${documentId}, ops: ${Object.keys(allOperations).join(\",\")}, limit:${operationsLimit})`,\n );\n\n // Calculate total operations for progress tracking\n const allOperationsArray = Object.values(allOperations).filter(\n (ops): ops is Operation[] => ops !== undefined,\n );\n const totalOperations = allOperationsArray.reduce(\n (total, operations) => total + operations.length,\n 0,\n );\n let uploadedOperations = 0;\n\n for (const operations of allOperationsArray) {\n for (let i = 0; i < operations.length; i += operationsLimit) {\n logger.verbose(\n `uploadDocumentOperations:for(i:${i}, ops:${operations.length}, limit:${operationsLimit}): START`,\n );\n const chunk = operations.slice(i, i + operationsLimit);\n const operation = chunk.at(-1);\n if (!operation) {\n break;\n }\n const scope = operation.action.scope;\n\n await pushOperations(documentId, chunk);\n\n uploadedOperations += chunk.length;\n\n // Report progress\n if (onProgress) {\n const progress = Math.round(\n (uploadedOperations / totalOperations) * 100,\n );\n onProgress({\n stage: \"uploading\",\n progress,\n totalOperations,\n uploadedOperations,\n });\n }\n\n logger.verbose(\n `uploadDocumentOperations:for:waitForUpdate(${documentId}:${scope} rev ${operation.index}): NEXT`,\n );\n }\n }\n\n logger.verbose(\n `uploadDocumentOperations:for:waitForUpdate(${documentId}): END`,\n );\n}\n","import type { Action, PHDocument } from \"@powerhousedao/shared/document-model\";\nimport {\n buildSignedAction,\n type ActionSigner,\n} from \"@powerhousedao/shared/document-model\";\nimport { logger } from \"document-model\";\n\nexport async function signAction(action: Action, document: PHDocument) {\n const reactor = window.ph?.reactorClient;\n if (!reactor) return action;\n\n const documentModelModule = await reactor.getDocumentModelModule(\n document.header.documentType,\n );\n const reducer = documentModelModule.reducer;\n const renown = window.ph?.renown;\n if (!renown?.user) return action;\n if (!action.context?.signer) return action;\n\n const actionSigner = action.context.signer;\n const unsafeSignedAction = await buildSignedAction(\n action,\n reducer,\n document,\n actionSigner,\n renown.crypto.sign,\n );\n\n // TODO: this is super dangerous and is caused by the `buildSignedAction` function returning an `Operation` instead of an `Action`\n return unsafeSignedAction as unknown as Action;\n}\n\nexport function addActionContext(action: Action) {\n const renown = window.ph?.renown;\n if (!renown?.user) return action;\n\n const signer: ActionSigner = {\n app: {\n name: \"Connect\",\n key: renown.did,\n },\n user: {\n address: renown.user.address,\n networkId: renown.user.networkId,\n chainId: renown.user.chainId,\n },\n signatures: [],\n };\n\n return {\n context: { signer },\n ...action,\n };\n}\n\nasync function makeSignedActionWithContext(\n action: Action | undefined,\n document: PHDocument | undefined,\n) {\n if (!action) {\n logger.error(\"No action found\");\n return;\n }\n if (!document) {\n logger.error(\"No document found\");\n return;\n }\n const signedAction = await signAction(action, document);\n const signedActionWithContext = addActionContext(signedAction);\n return signedActionWithContext;\n}\n\nexport async function makeSignedActionsWithContext(\n actionOrActions: Action[] | Action | undefined,\n document: PHDocument | undefined,\n) {\n if (!actionOrActions) {\n logger.error(\"No actions found\");\n return;\n }\n const actions = Array.isArray(actionOrActions)\n ? actionOrActions\n : [actionOrActions];\n\n const signedActionsWithContext = await Promise.all(\n actions.map((action) => makeSignedActionWithContext(action, document)),\n );\n return signedActionsWithContext.filter((a) => a !== undefined);\n}\n","import type { Action, PHDocument } from \"@powerhousedao/shared/document-model\";\nimport { logger } from \"document-model\";\nimport { queueActions } from \"./queue.js\";\nimport { makeSignedActionsWithContext } from \"./sign.js\";\n\nasync function getDocument(\n documentId: string,\n): Promise<PHDocument | undefined> {\n try {\n return await window.ph?.reactorClient?.get(documentId);\n } catch (error) {\n logger.debug(`Failed to get document with id ${documentId}:`, error);\n return undefined;\n }\n}\n\nfunction getActionErrors(result: PHDocument, actions: Action[]) {\n return actions.reduce((errors, a) => {\n const scopeOperations = result.operations[a.scope];\n if (!scopeOperations) {\n return errors;\n }\n const op = scopeOperations.findLast((op) => op.action.id === a.id);\n\n if (op?.error) {\n errors.push(new Error(op.error));\n }\n return errors;\n }, new Array<Error>());\n}\n\n/**\n * Dispatches actions to a document.\n * @param actionOrActions - The action or actions to dispatch.\n * @param document - The document to dispatch actions to.\n * @param onErrors - Callback invoked with any errors that occurred during action execution.\n * @returns The updated document, or undefined if the dispatch failed.\n */\nexport async function dispatchActions<TDocument = PHDocument, TAction = Action>(\n actionOrActions: TAction[] | TAction | undefined,\n document: TDocument | undefined,\n onErrors?: (errors: Error[]) => void,\n onSuccess?: (result: PHDocument) => void,\n): Promise<PHDocument | undefined>;\n/**\n * Dispatches actions to a document.\n * @param actionOrActions - The action or actions to dispatch.\n * @param documentId - The ID of the document to dispatch actions to.\n * @param onErrors - Callback invoked with any errors that occurred during action execution.\n * @returns The updated document, or undefined if the dispatch failed.\n */\nexport async function dispatchActions(\n actionOrActions: Action[] | Action | undefined,\n documentId: string,\n onErrors?: (errors: Error[]) => void,\n onSuccess?: (result: PHDocument) => void,\n): Promise<PHDocument | undefined>;\nexport async function dispatchActions(\n actionOrActions: Action[] | Action | undefined,\n documentOrDocumentId: PHDocument | string | undefined,\n onErrors?: (errors: Error[]) => void,\n onSuccess?: (result: PHDocument) => void,\n): Promise<PHDocument | undefined> {\n const document =\n typeof documentOrDocumentId === \"string\"\n ? await getDocument(documentOrDocumentId)\n : documentOrDocumentId;\n\n if (!document) {\n logger.error(\n `Document with id ${JSON.stringify(documentOrDocumentId)} not found`,\n );\n return;\n }\n\n const signedActionsWithContext = await makeSignedActionsWithContext(\n actionOrActions,\n document,\n );\n if (!signedActionsWithContext) {\n logger.error(\"No signed actions with context found\");\n return;\n }\n const result = await queueActions(document, signedActionsWithContext);\n\n if (onErrors && result) {\n const errors = getActionErrors(result, signedActionsWithContext);\n if (errors.length) {\n onErrors(errors);\n }\n }\n\n if (onSuccess && result) {\n onSuccess(result);\n }\n\n return result;\n}\n","import type { PowerhouseGlobal } from \"./types.js\";\n\nexport function getGlobal<K extends keyof PowerhouseGlobal>(\n namespace: K,\n): PowerhouseGlobal[K] | undefined {\n if (typeof window === \"undefined\") return undefined;\n return window.powerhouse?.[namespace];\n}\n\nexport function setGlobal<K extends keyof PowerhouseGlobal>(\n namespace: K,\n value: PowerhouseGlobal[K],\n): void {\n if (typeof window === \"undefined\") return;\n window.powerhouse = window.powerhouse || {};\n window.powerhouse[namespace] = value;\n}\n\nexport function clearGlobal(namespace: keyof PowerhouseGlobal): void {\n if (typeof window === \"undefined\") return;\n\n if (window.powerhouse?.[namespace]) {\n delete window.powerhouse[namespace];\n if (Object.keys(window.powerhouse).length === 0) {\n delete window.powerhouse;\n }\n }\n}\n","import type { BrowserAnalyticsStoreOptions } from \"@powerhousedao/analytics-engine-browser\";\nimport { BrowserAnalyticsStore } from \"@powerhousedao/analytics-engine-browser\";\nimport type { IAnalyticsStore } from \"@powerhousedao/analytics-engine-core\";\nimport { AnalyticsQueryEngine } from \"@powerhousedao/analytics-engine-core\";\nimport { getGlobal } from \"../global/core.js\";\n\nexport type CreateStoreOptions = BrowserAnalyticsStoreOptions;\n\nexport async function createAnalyticsStore(options: CreateStoreOptions) {\n const store = new BrowserAnalyticsStore(options);\n await store.init();\n\n const engine = new AnalyticsQueryEngine(store);\n return {\n store,\n engine,\n options,\n };\n}\n\nexport async function getAnalyticsStore(): Promise<IAnalyticsStore | null> {\n const globalAnalytics = await getGlobal(\"analytics\");\n\n return globalAnalytics?.store ?? null;\n}\n","import {\n DocumentChangeType,\n type DocumentChangeEvent,\n type IReactorClient,\n} from \"@powerhousedao/reactor\";\nimport type { PHDocument } from \"@powerhousedao/shared/document-model\";\nimport type {\n FulfilledPromise,\n IDocumentCache,\n PromiseState,\n PromiseWithState,\n RejectedPromise,\n} from \"./types/documents.js\";\n\nexport function addPromiseState<T>(promise: Promise<T>): PromiseWithState<T> {\n if (\"status\" in promise) {\n return promise as PromiseWithState<T>;\n }\n\n const promiseWithState = promise as PromiseWithState<T>;\n promiseWithState.status = \"pending\";\n promiseWithState.then(\n (value) => {\n promiseWithState.status = \"fulfilled\";\n (promiseWithState as FulfilledPromise<T>).value = value;\n },\n (reason) => {\n promiseWithState.status = \"rejected\";\n (promiseWithState as RejectedPromise<T>).reason = reason;\n // Re-throw to preserve unhandled rejection behavior\n // This allows React's error boundaries to catch the error\n throw reason;\n },\n );\n\n return promiseWithState;\n}\n\nexport function readPromiseState<T>(\n promise: Promise<T> | PromiseWithState<T>,\n): PromiseState<T> {\n return \"status\" in promise ? promise : { status: \"pending\" };\n}\n\n/**\n * Resolves an array of document promises using `Promise.allSettled`,\n * returning only the fulfilled values. A single missing/rejected\n * document does not poison the whole batch. Rejected entries are\n * logged at warn level so developers can see dangling references.\n */\nfunction fulfilledOnly(promises: Promise<PHDocument>[]): Promise<PHDocument[]> {\n return Promise.allSettled(promises).then((results) => {\n const documents: PHDocument[] = [];\n for (const result of results) {\n if (result.status === \"fulfilled\") {\n documents.push(result.value);\n } else {\n console.warn(\n \"[DocumentCache] Skipped unavailable document:\",\n result.reason,\n );\n }\n }\n return documents;\n });\n}\n\n/**\n * Document cache implementation that uses the new ReactorClient API.\n *\n * This cache subscribes to document change events via IReactorClient.subscribe()\n * and automatically updates the cache when documents are created, updated, or deleted.\n */\nexport class DocumentCache implements IDocumentCache {\n private documents = new Map<string, PromiseWithState<PHDocument>>();\n private batchPromises = new Map<\n string,\n { promises: Promise<PHDocument>[]; promise: Promise<PHDocument[]> }\n >();\n private listeners = new Map<string, (() => void)[]>();\n private unsubscribe: (() => void) | null = null;\n\n constructor(private client: IReactorClient) {\n this.unsubscribe = client.subscribe({}, (event: DocumentChangeEvent) => {\n this.handleDocumentChange(event);\n });\n }\n\n private handleDocumentChange(event: DocumentChangeEvent): void {\n if (event.type === DocumentChangeType.Deleted) {\n const documentId = event.context?.childId;\n if (documentId) {\n this.handleDocumentDeleted(documentId);\n }\n } else if (event.type === DocumentChangeType.Updated) {\n for (const doc of event.documents) {\n this.handleDocumentUpdated(doc.header.id).catch(console.warn);\n }\n }\n }\n\n private handleDocumentDeleted(documentId: string): void {\n const listeners = this.listeners.get(documentId);\n this.documents.delete(documentId);\n this.invalidateBatchesContaining(documentId);\n if (listeners) {\n listeners.forEach((listener) => listener());\n }\n this.listeners.delete(documentId);\n }\n\n private async handleDocumentUpdated(documentId: string): Promise<void> {\n if (this.documents.has(documentId)) {\n await this.get(documentId, true);\n const listeners = this.listeners.get(documentId);\n if (listeners) {\n listeners.forEach((listener) => listener());\n }\n }\n }\n\n private invalidateBatchesContaining(documentId: string): void {\n for (const key of this.batchPromises.keys()) {\n if (key.split(\",\").includes(documentId)) {\n this.batchPromises.delete(key);\n }\n }\n }\n\n get(id: string, refetch?: boolean): Promise<PHDocument> {\n const currentData = this.documents.get(id);\n if (currentData) {\n if (currentData.status === \"pending\") {\n return currentData;\n }\n if (!refetch) {\n return currentData;\n }\n }\n\n const documentPromise = this.client.get(id);\n this.documents.set(id, addPromiseState(documentPromise));\n return documentPromise;\n }\n\n getBatch(ids: string[]): Promise<PHDocument[]> {\n const key = ids.join(\",\");\n const cached = this.batchPromises.get(key);\n\n const hasDeletedDocuments = ids.some((id) => !this.documents.has(id));\n const currentPromises = ids.map((id) => this.get(id));\n\n if (hasDeletedDocuments) {\n const batchPromise = fulfilledOnly(currentPromises);\n this.batchPromises.set(key, {\n promises: currentPromises,\n promise: batchPromise,\n });\n return batchPromise;\n }\n\n if (cached) {\n const samePromises = currentPromises.every(\n (p, i) => p === cached.promises[i],\n );\n if (samePromises) {\n return cached.promise;\n }\n }\n\n const states = currentPromises.map((p) =>\n readPromiseState(p as PromiseWithState<PHDocument>),\n );\n const allSettled = states.every((s) => s.status !== \"pending\");\n\n if (allSettled) {\n const values = states\n .filter(\n (s): s is { status: \"fulfilled\"; value: PHDocument } =>\n s.status === \"fulfilled\",\n )\n .map((s) => s.value);\n const batchPromise = Promise.resolve(values) as PromiseWithState<\n PHDocument[]\n >;\n batchPromise.status = \"fulfilled\";\n (batchPromise as FulfilledPromise<PHDocument[]>).value = values;\n\n this.batchPromises.set(key, {\n promises: currentPromises,\n promise: batchPromise,\n });\n return batchPromise;\n }\n\n if (cached) {\n return cached.promise;\n }\n\n const batchPromise = fulfilledOnly(currentPromises);\n this.batchPromises.set(key, {\n promises: currentPromises,\n promise: batchPromise,\n });\n return batchPromise;\n }\n\n subscribe(id: string | string[], callback: () => void): () => void {\n const ids = Array.isArray(id) ? id : [id];\n for (const docId of ids) {\n const listeners = this.listeners.get(docId) ?? [];\n this.listeners.set(docId, [...listeners, callback]);\n }\n return () => {\n for (const docId of ids) {\n const listeners = this.listeners.get(docId) ?? [];\n this.listeners.set(\n docId,\n listeners.filter((listener) => listener !== callback),\n );\n }\n };\n }\n\n /**\n * Disposes of the cache and unsubscribes from document change events.\n */\n dispose(): void {\n if (this.unsubscribe) {\n this.unsubscribe();\n this.unsubscribe = null;\n }\n }\n}\n","import type { PHDocument } from \"@powerhousedao/shared/document-model\";\nimport { use, useCallback, useSyncExternalStore } from \"react\";\nimport { readPromiseState } from \"../document-cache.js\";\nimport type { IDocumentCache } from \"../types/documents.js\";\nimport type { SetPHGlobalValue, UsePHGlobalValue } from \"../types/global.js\";\nimport { makePHEventFunctions } from \"./make-ph-event-functions.js\";\n\nconst documentEventFunctions = makePHEventFunctions(\"documentCache\");\n\n/** Returns all documents in the reactor. */\nexport const useDocumentCache: UsePHGlobalValue<IDocumentCache> =\n documentEventFunctions.useValue;\n\n/** Sets all of the documents in the reactor. */\nexport const setDocumentCache: SetPHGlobalValue<IDocumentCache> =\n documentEventFunctions.setValue;\n\n/** Adds an event handler for all of the documents in the reactor. */\nexport const addDocumentCacheEventHandler =\n documentEventFunctions.addEventHandler;\n\n/**\n * Reads the state of a document promise and converts it to a query state object.\n * @param promise - The document promise to read\n * @returns An object containing the status, data, error, and isPending flag\n */\nfunction getDocumentQueryState(promise: Promise<PHDocument>) {\n const state = readPromiseState(promise);\n switch (state.status) {\n case \"pending\":\n return {\n status: \"pending\",\n isPending: true,\n error: undefined,\n data: undefined,\n } as const;\n case \"fulfilled\":\n return {\n status: \"success\",\n isPending: false,\n error: undefined,\n data: state.value,\n } as const;\n case \"rejected\":\n return {\n status: \"error\",\n isPending: false,\n error: state.reason,\n data: undefined,\n } as const;\n }\n}\n\n/**\n * Retrieves a document from the reactor and subscribes to changes using React Suspense.\n * This hook will suspend rendering while the document is loading.\n * @param id - The document ID to retrieve, or null/undefined to skip retrieval\n * @returns The document if found, or undefined if id is null/undefined\n */\nexport function useDocument(id: string | null | undefined) {\n const documentCache = useDocumentCache();\n const document = useSyncExternalStore(\n (cb) => (id && documentCache ? documentCache.subscribe(id, cb) : () => {}),\n () => (id ? documentCache?.get(id) : undefined),\n );\n return document ? use(document) : undefined;\n}\n\n/**\n * Retrieves a document from the reactor and subscribes to changes without\n * suspending or throwing. Use this when the ID might be stale (e.g., a\n * previously selected node that has since been deleted) and the consumer\n * wants to render a placeholder instead of crashing.\n *\n * Unlike {@link useGetDocumentAsync}, this hook subscribes to cache\n * updates, so the returned state stays in sync with reactor changes.\n *\n * @param id - The document ID to retrieve, or null/undefined to skip retrieval\n * @returns An object containing:\n * - status: \"initial\" | \"pending\" | \"success\" | \"error\"\n * - data: The document if successfully loaded\n * - isPending: Whether the document is currently loading\n * - error: Any error that occurred during loading (e.g., document not found)\n * - reload: Function to force a refetch, or undefined when no id is supplied\n */\nexport function useDocumentSafe(id: string | null | undefined) {\n const documentCache = useDocumentCache();\n const promise = useSyncExternalStore(\n (cb) => (id && documentCache ? documentCache.subscribe(id, cb) : () => {}),\n () => (id ? documentCache?.get(id) : undefined),\n );\n\n if (!promise || !documentCache || !id) {\n return {\n status: \"initial\",\n isPending: false,\n error: undefined,\n data: undefined,\n reload: undefined,\n } as const;\n }\n\n const state = getDocumentQueryState(promise);\n return { ...state, reload: () => documentCache.get(id, true) } as const;\n}\n\n/**\n * Retrieves multiple documents from the reactor using React Suspense.\n * This hook will suspend rendering while any of the documents are loading.\n *\n * Uses getBatch from the document cache which handles promise caching internally,\n * ensuring stable references for useSyncExternalStore.\n *\n * @param ids - Array of document IDs to retrieve, or null/undefined to skip retrieval\n * @returns An array of documents if found, or empty array if ids is null/undefined\n */\nexport function useDocuments(ids: string[] | null | undefined) {\n const documentCache = useDocumentCache();\n\n const documents = useSyncExternalStore(\n (cb) =>\n ids?.length && documentCache\n ? documentCache.subscribe(ids, cb)\n : () => {},\n () =>\n ids?.length && documentCache ? documentCache.getBatch(ids) : undefined,\n );\n\n return documents ? use(documents) : [];\n}\n\n/**\n * Returns a function to retrieve a document from the cache.\n * The returned function fetches and returns a document by ID.\n * @returns A function that takes a document ID and returns a Promise of the document\n */\nexport function useGetDocument() {\n const documentCache = useDocumentCache();\n\n return useCallback(\n (id: string) => {\n if (!documentCache) {\n return Promise.reject(new Error(\"Document cache not initialized\"));\n }\n return documentCache.get(id);\n },\n [documentCache],\n );\n}\n\n/**\n * Returns a function to retrieve multiple documents from the cache.\n * The returned function fetches and returns documents by their IDs.\n * @returns A function that takes an array of document IDs and returns a Promise of the documents\n */\nexport function useGetDocuments() {\n const documentCache = useDocumentCache();\n\n return useCallback(\n (ids: string[]) => {\n if (!documentCache) {\n return Promise.reject(new Error(\"Document cache not initialized\"));\n }\n return documentCache.getBatch(ids);\n },\n [documentCache],\n );\n}\n\n/**\n * Retrieves a document from the reactor without suspending rendering.\n * Returns the current state of the document loading operation.\n * @param id - The document ID to retrieve, or null/undefined to skip retrieval\n * @returns An object containing:\n * - status: \"initial\" | \"pending\" | \"success\" | \"error\"\n * - data: The document if successfully loaded\n * - isPending: Boolean indicating if the document is currently loading\n * - error: Any error that occurred during loading\n * - reload: Function to force reload the document from cache\n */\nexport function useGetDocumentAsync(id: string | null | undefined) {\n const documentCache = useDocumentCache();\n if (!id || !documentCache) {\n return {\n status: \"initial\",\n data: undefined,\n isPending: false,\n error: undefined,\n reload: undefined,\n } as const;\n }\n\n const promise = documentCache.get(id);\n const state = getDocumentQueryState(promise);\n\n return { ...state, reload: () => documentCache.get(id, true) } as const;\n}\n","import type { Action, PHDocument } from \"@powerhousedao/shared/document-model\";\nimport { logger } from \"document-model\";\nimport { dispatchActions } from \"../actions/dispatch.js\";\n\n/**\n * Returns a dispatch function for dispatching actions to a document.\n * Used internally by other hooks to provide action dispatching capabilities.\n * @param document - The document to dispatch actions to.\n * @returns A tuple containing the document and a dispatch function.\n */\nexport type DispatchFn<TAction> = (\n actionOrActions: TAction[] | TAction | undefined,\n onErrors?: (errors: Error[]) => void,\n onSuccess?: (result: PHDocument) => void,\n) => void;\n\nexport type UseDispatchResult<TDocument, TAction> = readonly [\n TDocument | undefined,\n DispatchFn<TAction>,\n];\n\nexport function useDispatch<TDocument = PHDocument, TAction = Action>(\n document: TDocument | undefined,\n): UseDispatchResult<TDocument, TAction> {\n /**\n * Dispatches actions to the document.\n * @param actionOrActions - The action or actions to dispatch.\n * @param onErrors - Callback invoked with any errors that occurred during action execution.\n */\n function dispatch(\n actionOrActions: TAction[] | TAction | undefined,\n onErrors?: (errors: Error[]) => void,\n onSuccess?: (result: PHDocument) => void,\n ) {\n dispatchActions(actionOrActions, document, onErrors, onSuccess).catch(\n logger.error,\n );\n }\n return [document, dispatch] as const;\n}\n","import type { Action, PHDocument } from \"@powerhousedao/shared/document-model\";\nimport { useDispatch, type UseDispatchResult } from \"./dispatch.js\";\nimport { useDocument, useDocuments } from \"./document-cache.js\";\n\n/** Returns a document by id. */\nexport function useDocumentById(\n id: string | null | undefined,\n): UseDispatchResult<PHDocument, Action> {\n const document = useDocument(id);\n const [, dispatch] = useDispatch<PHDocument, Action>(document);\n return [document, dispatch] as const;\n}\n\n/** Returns documents by ids. */\nexport function useDocumentsByIds(ids: string[] | null | undefined) {\n return useDocuments(ids);\n}\n"],"mappings":";;;;;;;;AASA,eAAsB,aACpB,UACA,iBACA;AACA,KAAI,CAAC,SACH,OAAM,IAAI,MAAM,uBAAuB;AAEzC,KAAI,CAAC,gBACH,OAAM,IAAI,MAAM,sBAAsB;CAExC,MAAM,UAAU,MAAM,QAAQ,gBAAgB,GAC1C,kBACA,CAAC,gBAAgB;AAErB,KAAI,QAAQ,WAAW,EACrB,OAAM,IAAI,MAAM,sBAAsB;CAGxC,MAAM,gBAAgB,OAAO,IAAI;AACjC,KAAI,CAAC,cACH,OAAM,IAAI,MAAM,gCAAgC;AAGlD,QAAO,MAAM,cAAc,QAAQ,SAAS,OAAO,IAAI,QAAQ,QAAQ;;AAGzE,eAAsB,gBACpB,YACA,uBACA;AACA,KAAI,CAAC,WACH,OAAM,IAAI,MAAM,yBAAyB;AAE3C,KAAI,CAAC,sBACH,OAAM,IAAI,MAAM,yBAAyB;CAE3C,MAAM,aAAa,MAAM,QAAQ,sBAAsB,GACnD,wBACA,CAAC,sBAAsB;AAE3B,KAAI,WAAW,WAAW,EACxB,OAAM,IAAI,MAAM,yBAAyB;CAG3C,MAAM,gBAAgB,OAAO,IAAI;AACjC,KAAI,CAAC,cACH,OAAM,IAAI,MAAM,gCAAgC;CAGlD,MAAM,UAAU,WAAW,KAAK,OAAO,GAAG,OAAO;AACjD,QAAO,MAAM,cAAc,QAAQ,YAAY,QAAQ,QAAQ;;AAqFjE,eAAsB,iBACpB,YACA,eACA,gBAIA,SAIA;CACA,MAAM,kBAAkB,SAAS,mBAAmB;CACpD,MAAM,aAAa,SAAS;AAE5B,QAAO,QACL,uCAAuC,WAAW,SAAS,OAAO,KAAK,cAAc,CAAC,KAAK,IAAI,CAAC,UAAU,gBAAgB,GAC3H;CAGD,MAAM,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H,SAAgB,oBAAoB,IAA+B;CACjE,MAAM,gBAAgB,kBAAkB;AACxC,KAAI,CAAC,MAAM,CAAC,cACV,QAAO;EACL,QAAQ;EACR,MAAM,KAAA;EACN,WAAW;EACX,OAAO,KAAA;EACP,QAAQ,KAAA;EACT;AAMH,QAAO;EAAE,GAFK,sBADE,cAAc,IAAI,GAAG,CACO;EAEzB,cAAc,cAAc,IAAI,IAAI,KAAK;EAAE;;;;AC9KhE,SAAgB,YACd,UACuC;;;;;;CAMvC,SAAS,SACP,iBACA,UACA,WACA;AACA,kBAAgB,iBAAiB,UAAU,UAAU,UAAU,CAAC,MAC9D,OAAO,MACR;;AAEH,QAAO,CAAC,UAAU,SAAS;;;;;ACjC7B,SAAgB,gBACd,IACuC;CACvC,MAAM,WAAW,YAAY,GAAG;CAChC,MAAM,GAAG,YAAY,YAAgC,SAAS;AAC9D,QAAO,CAAC,UAAU,SAAS;;;AAI7B,SAAgB,kBAAkB,KAAkC;AAClE,QAAO,aAAa,IAAI"}
|
|
1
|
+
{"version":3,"file":"document-by-id-BrIy0iHX.js","names":[],"sources":["../src/actions/queue.ts","../src/actions/sign.ts","../src/actions/dispatch.ts","../src/global/core.ts","../src/analytics/store.ts","../src/document-cache.ts","../src/hooks/document-cache.ts","../src/hooks/dispatch.ts","../src/hooks/document-by-id.ts"],"sourcesContent":["import type { FileUploadProgressCallback } from \"@powerhousedao/reactor-browser\";\nimport type {\n Action,\n DocumentOperations,\n Operation,\n PHDocument,\n} from \"@powerhousedao/shared/document-model\";\nimport { logger } from \"document-model\";\n\nexport async function queueActions(\n document: PHDocument | undefined,\n actionOrActions: Action[] | Action | undefined,\n) {\n if (!document) {\n throw new Error(\"No document provided\");\n }\n if (!actionOrActions) {\n throw new Error(\"No actions provided\");\n }\n const actions = Array.isArray(actionOrActions)\n ? actionOrActions\n : [actionOrActions];\n\n if (actions.length === 0) {\n throw new Error(\"No actions provided\");\n }\n\n const reactorClient = window.ph?.reactorClient;\n if (!reactorClient) {\n throw new Error(\"ReactorClient not initialized\");\n }\n\n return await reactorClient.execute(document.header.id, \"main\", actions);\n}\n\nexport async function queueOperations(\n documentId: string,\n operationOrOperations: Operation[] | Operation | undefined,\n) {\n if (!documentId) {\n throw new Error(\"No documentId provided\");\n }\n if (!operationOrOperations) {\n throw new Error(\"No operations provided\");\n }\n const operations = Array.isArray(operationOrOperations)\n ? operationOrOperations\n : [operationOrOperations];\n\n if (operations.length === 0) {\n throw new Error(\"No operations provided\");\n }\n\n const reactorClient = window.ph?.reactorClient;\n if (!reactorClient) {\n throw new Error(\"ReactorClient not initialized\");\n }\n\n const actions = operations.map((op) => op.action);\n return await reactorClient.execute(documentId, \"main\", actions);\n}\n\nexport function deduplicateOperations(\n existingOperations: Record<string, Operation[]>,\n operationsToDeduplicate: Operation[],\n) {\n // make a set of all the operation indices for each scope to avoid duplicates\n const operationIndicesByScope = {} as Record<string, Set<number>>;\n for (const scope of Object.keys(existingOperations)) {\n operationIndicesByScope[scope] = new Set(\n existingOperations[scope].map((op) => op.index),\n );\n }\n\n const newOperations: Operation[] = [];\n\n for (const operation of operationsToDeduplicate) {\n const scope = operation.action.scope;\n const index = operation.index;\n if (operationIndicesByScope[scope].has(index)) {\n const duplicatedExistingOperation = existingOperations[scope].find(\n (op) => op.index === index,\n );\n const duplicatedNewOperation = newOperations.find(\n (op) => op.index === index,\n );\n console.warn(\"skipping duplicate operation\");\n if (duplicatedExistingOperation) {\n console.warn(\n \"duplicate existing operation\",\n duplicatedExistingOperation,\n );\n }\n if (duplicatedNewOperation) {\n console.warn(\"duplicate new operation\", duplicatedNewOperation);\n }\n continue;\n }\n newOperations.push(operation);\n operationIndicesByScope[scope].add(index);\n }\n\n const uniqueOperationIds = new Set<string>();\n const operationsDedupedById: Operation[] = [];\n\n for (const [scope, operations] of Object.entries(existingOperations)) {\n for (const operation of operations) {\n const id = operation.id;\n if (!id) {\n console.warn(\"skipping operation with no id\", operation);\n continue;\n }\n if (uniqueOperationIds.has(id)) {\n console.warn(\n \"skipping existing operation with duplicate id in scope\",\n scope,\n operation,\n );\n continue;\n }\n uniqueOperationIds.add(id);\n }\n }\n\n for (const operation of newOperations) {\n const id = operation.id;\n if (!id) {\n console.warn(\"skipping operation with no id\", operation);\n continue;\n }\n if (uniqueOperationIds.has(id)) {\n console.warn(\n \"skipping new operation with duplicate id in scope\",\n operation.action.scope,\n operation,\n );\n continue;\n }\n uniqueOperationIds.add(id);\n operationsDedupedById.push(operation);\n }\n return operationsDedupedById;\n}\n\nexport async function uploadOperations(\n documentId: string,\n allOperations: DocumentOperations,\n pushOperations: (\n documentId: string,\n operations: Operation[],\n ) => Promise<PHDocument | undefined>,\n options?: {\n operationsLimit?: number;\n onProgress?: FileUploadProgressCallback;\n },\n) {\n const operationsLimit = options?.operationsLimit || 50;\n const onProgress = options?.onProgress;\n\n logger.verbose(\n `uploadDocumentOperations(documentId:${documentId}, ops: ${Object.keys(allOperations).join(\",\")}, limit:${operationsLimit})`,\n );\n\n // Calculate total operations for progress tracking\n const allOperationsArray = Object.values(allOperations).filter(\n (ops): ops is Operation[] => ops !== undefined,\n );\n const totalOperations = allOperationsArray.reduce(\n (total, operations) => total + operations.length,\n 0,\n );\n let uploadedOperations = 0;\n\n for (const operations of allOperationsArray) {\n for (let i = 0; i < operations.length; i += operationsLimit) {\n logger.verbose(\n `uploadDocumentOperations:for(i:${i}, ops:${operations.length}, limit:${operationsLimit}): START`,\n );\n const chunk = operations.slice(i, i + operationsLimit);\n const operation = chunk.at(-1);\n if (!operation) {\n break;\n }\n const scope = operation.action.scope;\n\n await pushOperations(documentId, chunk);\n\n uploadedOperations += chunk.length;\n\n // Report progress\n if (onProgress) {\n const progress = Math.round(\n (uploadedOperations / totalOperations) * 100,\n );\n onProgress({\n stage: \"uploading\",\n progress,\n totalOperations,\n uploadedOperations,\n });\n }\n\n logger.verbose(\n `uploadDocumentOperations:for:waitForUpdate(${documentId}:${scope} rev ${operation.index}): NEXT`,\n );\n }\n }\n\n logger.verbose(\n `uploadDocumentOperations:for:waitForUpdate(${documentId}): END`,\n );\n}\n","import type { Action, PHDocument } from \"@powerhousedao/shared/document-model\";\nimport {\n buildSignedAction,\n type ActionSigner,\n} from \"@powerhousedao/shared/document-model\";\nimport { logger } from \"document-model\";\n\nexport async function signAction(action: Action, document: PHDocument) {\n const reactor = window.ph?.reactorClient;\n if (!reactor) return action;\n\n const documentModelModule = await reactor.getDocumentModelModule(\n document.header.documentType,\n );\n const reducer = documentModelModule.reducer;\n const renown = window.ph?.renown;\n if (!renown?.user) return action;\n if (!action.context?.signer) return action;\n\n const actionSigner = action.context.signer;\n const unsafeSignedAction = await buildSignedAction(\n action,\n reducer,\n document,\n actionSigner,\n renown.crypto.sign,\n );\n\n // TODO: this is super dangerous and is caused by the `buildSignedAction` function returning an `Operation` instead of an `Action`\n return unsafeSignedAction as unknown as Action;\n}\n\nexport function addActionContext(action: Action) {\n const renown = window.ph?.renown;\n if (!renown?.user) return action;\n\n const signer: ActionSigner = {\n app: {\n name: \"Connect\",\n key: renown.did,\n },\n user: {\n address: renown.user.address,\n networkId: renown.user.networkId,\n chainId: renown.user.chainId,\n },\n signatures: [],\n };\n\n return {\n context: { signer },\n ...action,\n };\n}\n\nasync function makeSignedActionWithContext(\n action: Action | undefined,\n document: PHDocument | undefined,\n) {\n if (!action) {\n logger.error(\"No action found\");\n return;\n }\n if (!document) {\n logger.error(\"No document found\");\n return;\n }\n const signedAction = await signAction(action, document);\n const signedActionWithContext = addActionContext(signedAction);\n return signedActionWithContext;\n}\n\nexport async function makeSignedActionsWithContext(\n actionOrActions: Action[] | Action | undefined,\n document: PHDocument | undefined,\n) {\n if (!actionOrActions) {\n logger.error(\"No actions found\");\n return;\n }\n const actions = Array.isArray(actionOrActions)\n ? actionOrActions\n : [actionOrActions];\n\n const signedActionsWithContext = await Promise.all(\n actions.map((action) => makeSignedActionWithContext(action, document)),\n );\n return signedActionsWithContext.filter((a) => a !== undefined);\n}\n","import type { Action, PHDocument } from \"@powerhousedao/shared/document-model\";\nimport { logger } from \"document-model\";\nimport { queueActions } from \"./queue.js\";\nimport { makeSignedActionsWithContext } from \"./sign.js\";\n\nasync function getDocument(\n documentId: string,\n): Promise<PHDocument | undefined> {\n try {\n return await window.ph?.reactorClient?.get(documentId);\n } catch (error) {\n logger.debug(`Failed to get document with id ${documentId}:`, error);\n return undefined;\n }\n}\n\nfunction getActionErrors(result: PHDocument, actions: Action[]) {\n return actions.reduce((errors, a) => {\n const scopeOperations = result.operations[a.scope];\n if (!scopeOperations) {\n return errors;\n }\n const op = scopeOperations.findLast((op) => op.action.id === a.id);\n\n if (op?.error) {\n errors.push(new Error(op.error));\n }\n return errors;\n }, new Array<Error>());\n}\n\n/**\n * Dispatches actions to a document.\n * @param actionOrActions - The action or actions to dispatch.\n * @param document - The document to dispatch actions to.\n * @param onErrors - Callback invoked with any errors that occurred during action execution.\n * @returns The updated document, or undefined if the dispatch failed.\n */\nexport async function dispatchActions<TDocument = PHDocument, TAction = Action>(\n actionOrActions: TAction[] | TAction | undefined,\n document: TDocument | undefined,\n onErrors?: (errors: Error[]) => void,\n onSuccess?: (result: PHDocument) => void,\n): Promise<PHDocument | undefined>;\n/**\n * Dispatches actions to a document.\n * @param actionOrActions - The action or actions to dispatch.\n * @param documentId - The ID of the document to dispatch actions to.\n * @param onErrors - Callback invoked with any errors that occurred during action execution.\n * @returns The updated document, or undefined if the dispatch failed.\n */\nexport async function dispatchActions(\n actionOrActions: Action[] | Action | undefined,\n documentId: string,\n onErrors?: (errors: Error[]) => void,\n onSuccess?: (result: PHDocument) => void,\n): Promise<PHDocument | undefined>;\nexport async function dispatchActions(\n actionOrActions: Action[] | Action | undefined,\n documentOrDocumentId: PHDocument | string | undefined,\n onErrors?: (errors: Error[]) => void,\n onSuccess?: (result: PHDocument) => void,\n): Promise<PHDocument | undefined> {\n const document =\n typeof documentOrDocumentId === \"string\"\n ? await getDocument(documentOrDocumentId)\n : documentOrDocumentId;\n\n if (!document) {\n logger.error(\n `Document with id ${JSON.stringify(documentOrDocumentId)} not found`,\n );\n return;\n }\n\n const signedActionsWithContext = await makeSignedActionsWithContext(\n actionOrActions,\n document,\n );\n if (!signedActionsWithContext) {\n logger.error(\"No signed actions with context found\");\n return;\n }\n const result = await queueActions(document, signedActionsWithContext);\n\n if (onErrors && result) {\n const errors = getActionErrors(result, signedActionsWithContext);\n if (errors.length) {\n onErrors(errors);\n }\n }\n\n if (onSuccess && result) {\n onSuccess(result);\n }\n\n return result;\n}\n","import type { PowerhouseGlobal } from \"./types.js\";\n\nexport function getGlobal<K extends keyof PowerhouseGlobal>(\n namespace: K,\n): PowerhouseGlobal[K] | undefined {\n if (typeof window === \"undefined\") return undefined;\n return window.powerhouse?.[namespace];\n}\n\nexport function setGlobal<K extends keyof PowerhouseGlobal>(\n namespace: K,\n value: PowerhouseGlobal[K],\n): void {\n if (typeof window === \"undefined\") return;\n window.powerhouse = window.powerhouse || {};\n window.powerhouse[namespace] = value;\n}\n\nexport function clearGlobal(namespace: keyof PowerhouseGlobal): void {\n if (typeof window === \"undefined\") return;\n\n if (window.powerhouse?.[namespace]) {\n delete window.powerhouse[namespace];\n if (Object.keys(window.powerhouse).length === 0) {\n delete window.powerhouse;\n }\n }\n}\n","import type { BrowserAnalyticsStoreOptions } from \"@powerhousedao/analytics-engine-browser\";\nimport { BrowserAnalyticsStore } from \"@powerhousedao/analytics-engine-browser\";\nimport type { IAnalyticsStore } from \"@powerhousedao/analytics-engine-core\";\nimport { AnalyticsQueryEngine } from \"@powerhousedao/analytics-engine-core\";\nimport { getGlobal } from \"../global/core.js\";\n\nexport type CreateStoreOptions = BrowserAnalyticsStoreOptions;\n\nexport async function createAnalyticsStore(options: CreateStoreOptions) {\n const store = new BrowserAnalyticsStore(options);\n await store.init();\n\n const engine = new AnalyticsQueryEngine(store);\n return {\n store,\n engine,\n options,\n };\n}\n\nexport async function getAnalyticsStore(): Promise<IAnalyticsStore | null> {\n const globalAnalytics = await getGlobal(\"analytics\");\n\n return globalAnalytics?.store ?? null;\n}\n","import {\n DocumentChangeType,\n type DocumentChangeEvent,\n type IReactorClient,\n} from \"@powerhousedao/reactor\";\nimport type { PHDocument } from \"@powerhousedao/shared/document-model\";\nimport type {\n FulfilledPromise,\n IDocumentCache,\n PromiseState,\n PromiseWithState,\n RejectedPromise,\n} from \"./types/documents.js\";\n\nexport function addPromiseState<T>(promise: Promise<T>): PromiseWithState<T> {\n if (\"status\" in promise) {\n return promise as PromiseWithState<T>;\n }\n\n const promiseWithState = promise as PromiseWithState<T>;\n promiseWithState.status = \"pending\";\n promiseWithState.then(\n (value) => {\n promiseWithState.status = \"fulfilled\";\n (promiseWithState as FulfilledPromise<T>).value = value;\n },\n (reason) => {\n promiseWithState.status = \"rejected\";\n (promiseWithState as RejectedPromise<T>).reason = reason;\n // Re-throw to preserve unhandled rejection behavior\n // This allows React's error boundaries to catch the error\n throw reason;\n },\n );\n\n return promiseWithState;\n}\n\nexport function readPromiseState<T>(\n promise: Promise<T> | PromiseWithState<T>,\n): PromiseState<T> {\n return \"status\" in promise ? promise : { status: \"pending\" };\n}\n\n/**\n * Resolves an array of document promises using `Promise.allSettled`,\n * returning only the fulfilled values. A single missing/rejected\n * document does not poison the whole batch. Rejected entries are\n * logged at warn level so developers can see dangling references.\n */\nfunction fulfilledOnly(promises: Promise<PHDocument>[]): Promise<PHDocument[]> {\n return Promise.allSettled(promises).then((results) => {\n const documents: PHDocument[] = [];\n for (const result of results) {\n if (result.status === \"fulfilled\") {\n documents.push(result.value);\n } else {\n console.warn(\n \"[DocumentCache] Skipped unavailable document:\",\n result.reason,\n );\n }\n }\n return documents;\n });\n}\n\n/**\n * Document cache implementation that uses the new ReactorClient API.\n *\n * This cache subscribes to document change events via IReactorClient.subscribe()\n * and automatically updates the cache when documents are created, updated, or deleted.\n */\nexport class DocumentCache implements IDocumentCache {\n private documents = new Map<string, PromiseWithState<PHDocument>>();\n private batchPromises = new Map<\n string,\n { promises: Promise<PHDocument>[]; promise: Promise<PHDocument[]> }\n >();\n private listeners = new Map<string, (() => void)[]>();\n private unsubscribe: (() => void) | null = null;\n\n constructor(private client: IReactorClient) {\n this.unsubscribe = client.subscribe({}, (event: DocumentChangeEvent) => {\n this.handleDocumentChange(event);\n });\n }\n\n private handleDocumentChange(event: DocumentChangeEvent): void {\n if (event.type === DocumentChangeType.Deleted) {\n const documentId = event.context?.childId;\n if (documentId) {\n this.handleDocumentDeleted(documentId);\n }\n } else if (event.type === DocumentChangeType.Updated) {\n for (const doc of event.documents) {\n this.handleDocumentUpdated(doc.header.id).catch(console.warn);\n }\n }\n }\n\n private handleDocumentDeleted(documentId: string): void {\n const listeners = this.listeners.get(documentId);\n this.documents.delete(documentId);\n this.invalidateBatchesContaining(documentId);\n if (listeners) {\n listeners.forEach((listener) => listener());\n }\n this.listeners.delete(documentId);\n }\n\n private async handleDocumentUpdated(documentId: string): Promise<void> {\n if (this.documents.has(documentId)) {\n await this.get(documentId, true);\n const listeners = this.listeners.get(documentId);\n if (listeners) {\n listeners.forEach((listener) => listener());\n }\n }\n }\n\n private invalidateBatchesContaining(documentId: string): void {\n for (const key of this.batchPromises.keys()) {\n if (key.split(\",\").includes(documentId)) {\n this.batchPromises.delete(key);\n }\n }\n }\n\n get(id: string, refetch?: boolean): Promise<PHDocument> {\n const currentData = this.documents.get(id);\n if (currentData) {\n if (currentData.status === \"pending\") {\n return currentData;\n }\n if (!refetch) {\n return currentData;\n }\n }\n\n const documentPromise = this.client.get(id);\n this.documents.set(id, addPromiseState(documentPromise));\n return documentPromise;\n }\n\n getBatch(ids: string[]): Promise<PHDocument[]> {\n const key = ids.join(\",\");\n const cached = this.batchPromises.get(key);\n\n const hasDeletedDocuments = ids.some((id) => !this.documents.has(id));\n const currentPromises = ids.map((id) => this.get(id));\n\n if (hasDeletedDocuments) {\n const batchPromise = fulfilledOnly(currentPromises);\n this.batchPromises.set(key, {\n promises: currentPromises,\n promise: batchPromise,\n });\n return batchPromise;\n }\n\n if (cached) {\n const samePromises = currentPromises.every(\n (p, i) => p === cached.promises[i],\n );\n if (samePromises) {\n return cached.promise;\n }\n }\n\n const states = currentPromises.map((p) =>\n readPromiseState(p as PromiseWithState<PHDocument>),\n );\n const allSettled = states.every((s) => s.status !== \"pending\");\n\n if (allSettled) {\n const values = states\n .filter(\n (s): s is { status: \"fulfilled\"; value: PHDocument } =>\n s.status === \"fulfilled\",\n )\n .map((s) => s.value);\n const batchPromise = Promise.resolve(values) as PromiseWithState<\n PHDocument[]\n >;\n batchPromise.status = \"fulfilled\";\n (batchPromise as FulfilledPromise<PHDocument[]>).value = values;\n\n this.batchPromises.set(key, {\n promises: currentPromises,\n promise: batchPromise,\n });\n return batchPromise;\n }\n\n if (cached) {\n return cached.promise;\n }\n\n const batchPromise = fulfilledOnly(currentPromises);\n this.batchPromises.set(key, {\n promises: currentPromises,\n promise: batchPromise,\n });\n return batchPromise;\n }\n\n subscribe(id: string | string[], callback: () => void): () => void {\n const ids = Array.isArray(id) ? id : [id];\n for (const docId of ids) {\n const listeners = this.listeners.get(docId) ?? [];\n this.listeners.set(docId, [...listeners, callback]);\n }\n return () => {\n for (const docId of ids) {\n const listeners = this.listeners.get(docId) ?? [];\n this.listeners.set(\n docId,\n listeners.filter((listener) => listener !== callback),\n );\n }\n };\n }\n\n /**\n * Disposes of the cache and unsubscribes from document change events.\n */\n dispose(): void {\n if (this.unsubscribe) {\n this.unsubscribe();\n this.unsubscribe = null;\n }\n }\n}\n","import type { PHDocument } from \"@powerhousedao/shared/document-model\";\nimport { use, useCallback, useSyncExternalStore } from \"react\";\nimport { readPromiseState } from \"../document-cache.js\";\nimport type { IDocumentCache } from \"../types/documents.js\";\nimport type { SetPHGlobalValue, UsePHGlobalValue } from \"../types/global.js\";\nimport { makePHEventFunctions } from \"./make-ph-event-functions.js\";\n\nconst documentEventFunctions = makePHEventFunctions(\"documentCache\");\n\n/** Returns all documents in the reactor. */\nexport const useDocumentCache: UsePHGlobalValue<IDocumentCache> =\n documentEventFunctions.useValue;\n\n/** Sets all of the documents in the reactor. */\nexport const setDocumentCache: SetPHGlobalValue<IDocumentCache> =\n documentEventFunctions.setValue;\n\n/** Adds an event handler for all of the documents in the reactor. */\nexport const addDocumentCacheEventHandler =\n documentEventFunctions.addEventHandler;\n\n/**\n * Reads the state of a document promise and converts it to a query state object.\n * @param promise - The document promise to read\n * @returns An object containing the status, data, error, and isPending flag\n */\nfunction getDocumentQueryState(promise: Promise<PHDocument>) {\n const state = readPromiseState(promise);\n switch (state.status) {\n case \"pending\":\n return {\n status: \"pending\",\n isPending: true,\n error: undefined,\n data: undefined,\n } as const;\n case \"fulfilled\":\n return {\n status: \"success\",\n isPending: false,\n error: undefined,\n data: state.value,\n } as const;\n case \"rejected\":\n return {\n status: \"error\",\n isPending: false,\n error: state.reason,\n data: undefined,\n } as const;\n }\n}\n\n/**\n * Retrieves a document from the reactor and subscribes to changes using React Suspense.\n * This hook will suspend rendering while the document is loading.\n * @param id - The document ID to retrieve, or null/undefined to skip retrieval\n * @returns The document if found, or undefined if id is null/undefined\n */\nexport function useDocument(id: string | null | undefined) {\n const documentCache = useDocumentCache();\n const document = useSyncExternalStore(\n (cb) => (id && documentCache ? documentCache.subscribe(id, cb) : () => {}),\n () => (id ? documentCache?.get(id) : undefined),\n );\n return document ? use(document) : undefined;\n}\n\n/**\n * Retrieves a document from the reactor and subscribes to changes without\n * suspending or throwing. Use this when the ID might be stale (e.g., a\n * previously selected node that has since been deleted) and the consumer\n * wants to render a placeholder instead of crashing.\n *\n * Unlike {@link useGetDocumentAsync}, this hook subscribes to cache\n * updates, so the returned state stays in sync with reactor changes.\n *\n * @param id - The document ID to retrieve, or null/undefined to skip retrieval\n * @returns An object containing:\n * - status: \"initial\" | \"pending\" | \"success\" | \"error\"\n * - data: The document if successfully loaded\n * - isPending: Whether the document is currently loading\n * - error: Any error that occurred during loading (e.g., document not found)\n * - reload: Function to force a refetch, or undefined when no id is supplied\n */\nexport function useDocumentSafe(id: string | null | undefined) {\n const documentCache = useDocumentCache();\n const promise = useSyncExternalStore(\n (cb) => (id && documentCache ? documentCache.subscribe(id, cb) : () => {}),\n () => (id ? documentCache?.get(id) : undefined),\n );\n\n if (!promise || !documentCache || !id) {\n return {\n status: \"initial\",\n isPending: false,\n error: undefined,\n data: undefined,\n reload: undefined,\n } as const;\n }\n\n const state = getDocumentQueryState(promise);\n return { ...state, reload: () => documentCache.get(id, true) } as const;\n}\n\n/**\n * Retrieves multiple documents from the reactor using React Suspense.\n * This hook will suspend rendering while any of the documents are loading.\n *\n * Uses getBatch from the document cache which handles promise caching internally,\n * ensuring stable references for useSyncExternalStore.\n *\n * @param ids - Array of document IDs to retrieve, or null/undefined to skip retrieval\n * @returns An array of documents if found, or empty array if ids is null/undefined\n */\nexport function useDocuments(ids: string[] | null | undefined) {\n const documentCache = useDocumentCache();\n\n const documents = useSyncExternalStore(\n (cb) =>\n ids?.length && documentCache\n ? documentCache.subscribe(ids, cb)\n : () => {},\n () =>\n ids?.length && documentCache ? documentCache.getBatch(ids) : undefined,\n );\n\n return documents ? use(documents) : [];\n}\n\n/**\n * Returns a function to retrieve a document from the cache.\n * The returned function fetches and returns a document by ID.\n * @returns A function that takes a document ID and returns a Promise of the document\n */\nexport function useGetDocument() {\n const documentCache = useDocumentCache();\n\n return useCallback(\n (id: string) => {\n if (!documentCache) {\n return Promise.reject(new Error(\"Document cache not initialized\"));\n }\n return documentCache.get(id);\n },\n [documentCache],\n );\n}\n\n/**\n * Returns a function to retrieve multiple documents from the cache.\n * The returned function fetches and returns documents by their IDs.\n * @returns A function that takes an array of document IDs and returns a Promise of the documents\n */\nexport function useGetDocuments() {\n const documentCache = useDocumentCache();\n\n return useCallback(\n (ids: string[]) => {\n if (!documentCache) {\n return Promise.reject(new Error(\"Document cache not initialized\"));\n }\n return documentCache.getBatch(ids);\n },\n [documentCache],\n );\n}\n\n/**\n * Retrieves a document from the reactor without suspending rendering.\n * Returns the current state of the document loading operation.\n * @param id - The document ID to retrieve, or null/undefined to skip retrieval\n * @returns An object containing:\n * - status: \"initial\" | \"pending\" | \"success\" | \"error\"\n * - data: The document if successfully loaded\n * - isPending: Boolean indicating if the document is currently loading\n * - error: Any error that occurred during loading\n * - reload: Function to force reload the document from cache\n */\nexport function useGetDocumentAsync(id: string | null | undefined) {\n const documentCache = useDocumentCache();\n if (!id || !documentCache) {\n return {\n status: \"initial\",\n data: undefined,\n isPending: false,\n error: undefined,\n reload: undefined,\n } as const;\n }\n\n const promise = documentCache.get(id);\n const state = getDocumentQueryState(promise);\n\n return { ...state, reload: () => documentCache.get(id, true) } as const;\n}\n","import type { Action, PHDocument } from \"@powerhousedao/shared/document-model\";\nimport { logger } from \"document-model\";\nimport { dispatchActions } from \"../actions/dispatch.js\";\n\n/**\n * Returns a dispatch function for dispatching actions to a document.\n * Used internally by other hooks to provide action dispatching capabilities.\n * @param document - The document to dispatch actions to.\n * @returns A tuple containing the document and a dispatch function.\n */\nexport type DispatchFn<TAction> = (\n actionOrActions: TAction[] | TAction | undefined,\n onErrors?: (errors: Error[]) => void,\n onSuccess?: (result: PHDocument) => void,\n) => void;\n\nexport type UseDispatchResult<TDocument, TAction> = readonly [\n TDocument | undefined,\n DispatchFn<TAction>,\n];\n\nexport function useDispatch<TDocument = PHDocument, TAction = Action>(\n document: TDocument | undefined,\n): UseDispatchResult<TDocument, TAction> {\n /**\n * Dispatches actions to the document.\n * @param actionOrActions - The action or actions to dispatch.\n * @param onErrors - Callback invoked with any errors that occurred during action execution.\n */\n function dispatch(\n actionOrActions: TAction[] | TAction | undefined,\n onErrors?: (errors: Error[]) => void,\n onSuccess?: (result: PHDocument) => void,\n ) {\n dispatchActions(actionOrActions, document, onErrors, onSuccess).catch(\n logger.error,\n );\n }\n return [document, dispatch] as const;\n}\n","import type { Action, PHDocument } from \"@powerhousedao/shared/document-model\";\nimport { useDispatch, type UseDispatchResult } from \"./dispatch.js\";\nimport { useDocument, useDocuments } from \"./document-cache.js\";\n\n/** Returns a document by id. */\nexport function useDocumentById(\n id: string | null | undefined,\n): UseDispatchResult<PHDocument, Action> {\n const document = useDocument(id);\n const [, dispatch] = useDispatch<PHDocument, Action>(document);\n return [document, dispatch] as const;\n}\n\n/** Returns documents by ids. */\nexport function useDocumentsByIds(ids: string[] | null | undefined) {\n return useDocuments(ids);\n}\n"],"mappings":";;;;;;;;AASA,eAAsB,aACpB,UACA,iBACA;AACA,KAAI,CAAC,SACH,OAAM,IAAI,MAAM,uBAAuB;AAEzC,KAAI,CAAC,gBACH,OAAM,IAAI,MAAM,sBAAsB;CAExC,MAAM,UAAU,MAAM,QAAQ,gBAAgB,GAC1C,kBACA,CAAC,gBAAgB;AAErB,KAAI,QAAQ,WAAW,EACrB,OAAM,IAAI,MAAM,sBAAsB;CAGxC,MAAM,gBAAgB,OAAO,IAAI;AACjC,KAAI,CAAC,cACH,OAAM,IAAI,MAAM,gCAAgC;AAGlD,QAAO,MAAM,cAAc,QAAQ,SAAS,OAAO,IAAI,QAAQ,QAAQ;;AAGzE,eAAsB,gBACpB,YACA,uBACA;AACA,KAAI,CAAC,WACH,OAAM,IAAI,MAAM,yBAAyB;AAE3C,KAAI,CAAC,sBACH,OAAM,IAAI,MAAM,yBAAyB;CAE3C,MAAM,aAAa,MAAM,QAAQ,sBAAsB,GACnD,wBACA,CAAC,sBAAsB;AAE3B,KAAI,WAAW,WAAW,EACxB,OAAM,IAAI,MAAM,yBAAyB;CAG3C,MAAM,gBAAgB,OAAO,IAAI;AACjC,KAAI,CAAC,cACH,OAAM,IAAI,MAAM,gCAAgC;CAGlD,MAAM,UAAU,WAAW,KAAK,OAAO,GAAG,OAAO;AACjD,QAAO,MAAM,cAAc,QAAQ,YAAY,QAAQ,QAAQ;;AAqFjE,eAAsB,iBACpB,YACA,eACA,gBAIA,SAIA;CACA,MAAM,kBAAkB,SAAS,mBAAmB;CACpD,MAAM,aAAa,SAAS;AAE5B,QAAO,QACL,uCAAuC,WAAW,SAAS,OAAO,KAAK,cAAc,CAAC,KAAK,IAAI,CAAC,UAAU,gBAAgB,GAC3H;C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;;;;;;AAcH,SAAgB,oBAAoB,IAA+B;CACjE,MAAM,gBAAgB,kBAAkB;AACxC,KAAI,CAAC,MAAM,CAAC,cACV,QAAO;EACL,QAAQ;EACR,MAAM,KAAA;EACN,WAAW;EACX,OAAO,KAAA;EACP,QAAQ,KAAA;EACT;AAMH,QAAO;EAAE,GAFK,sBADE,cAAc,IAAI,GAAG,CACO;EAEzB,cAAc,cAAc,IAAI,IAAI,KAAK;EAAE;;;;AC9KhE,SAAgB,YACd,UACuC;;;;;;CAMvC,SAAS,SACP,iBACA,UACA,WACA;AACA,kBAAgB,iBAAiB,UAAU,UAAU,UAAU,CAAC,MAC9D,OAAO,MACR;;AAEH,QAAO,CAAC,UAAU,SAAS;;;;;ACjC7B,SAAgB,gBACd,IACuC;CACvC,MAAM,WAAW,YAAY,GAAG;CAChC,MAAM,GAAG,YAAY,YAAgC,SAAS;AAC9D,QAAO,CAAC,UAAU,SAAS;;;AAI7B,SAAgB,kBAAkB,KAAkC;AAClE,QAAO,aAAa,IAAI"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from "react";
|
|
2
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
2
|
import * as _renown_sdk0 from "@renown/sdk";
|
|
4
|
-
import { IRenown, LoginStatus, User } from "@renown/sdk";
|
|
3
|
+
import { CREDENTIAL_SCHEMA_EIP712_TYPE, CREDENTIAL_SUBJECT_TYPE, CREDENTIAL_TYPES, DOMAIN_TYPE, IRenown, ISSUER_TYPE, LoginStatus, User, VERIFIABLE_CREDENTIAL_EIP712_TYPE } from "@renown/sdk";
|
|
4
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/renown/use-renown-auth.d.ts
|
|
7
7
|
type RenownAuthStatus = LoginStatus | "loading";
|
|
@@ -158,132 +158,6 @@ declare function initRenownCrypto(): Promise<_renown_sdk0.RenownCrypto>;
|
|
|
158
158
|
declare const RENOWN_URL = "https://www.renown.id";
|
|
159
159
|
declare const RENOWN_NETWORK_ID = "eip155";
|
|
160
160
|
declare const RENOWN_CHAIN_ID = "1";
|
|
161
|
-
declare const DOMAIN_TYPE: readonly [{
|
|
162
|
-
readonly name: "name";
|
|
163
|
-
readonly type: "string";
|
|
164
|
-
}, {
|
|
165
|
-
readonly name: "version";
|
|
166
|
-
readonly type: "string";
|
|
167
|
-
}, {
|
|
168
|
-
readonly name: "chainId";
|
|
169
|
-
readonly type: "uint256";
|
|
170
|
-
}, {
|
|
171
|
-
readonly name: "verifyingContract";
|
|
172
|
-
readonly type: "address";
|
|
173
|
-
}];
|
|
174
|
-
declare const VERIFIABLE_CREDENTIAL_EIP712_TYPE: readonly [{
|
|
175
|
-
readonly name: "@context";
|
|
176
|
-
readonly type: "string[]";
|
|
177
|
-
}, {
|
|
178
|
-
readonly name: "type";
|
|
179
|
-
readonly type: "string[]";
|
|
180
|
-
}, {
|
|
181
|
-
readonly name: "id";
|
|
182
|
-
readonly type: "string";
|
|
183
|
-
}, {
|
|
184
|
-
readonly name: "issuer";
|
|
185
|
-
readonly type: "Issuer";
|
|
186
|
-
}, {
|
|
187
|
-
readonly name: "credentialSubject";
|
|
188
|
-
readonly type: "CredentialSubject";
|
|
189
|
-
}, {
|
|
190
|
-
readonly name: "credentialSchema";
|
|
191
|
-
readonly type: "CredentialSchema";
|
|
192
|
-
}, {
|
|
193
|
-
readonly name: "issuanceDate";
|
|
194
|
-
readonly type: "string";
|
|
195
|
-
}, {
|
|
196
|
-
readonly name: "expirationDate";
|
|
197
|
-
readonly type: "string";
|
|
198
|
-
}];
|
|
199
|
-
declare const CREDENTIAL_SCHEMA_EIP712_TYPE: readonly [{
|
|
200
|
-
readonly name: "id";
|
|
201
|
-
readonly type: "string";
|
|
202
|
-
}, {
|
|
203
|
-
readonly name: "type";
|
|
204
|
-
readonly type: "string";
|
|
205
|
-
}];
|
|
206
|
-
declare const CREDENTIAL_SUBJECT_TYPE: readonly [{
|
|
207
|
-
readonly name: "app";
|
|
208
|
-
readonly type: "string";
|
|
209
|
-
}, {
|
|
210
|
-
readonly name: "id";
|
|
211
|
-
readonly type: "string";
|
|
212
|
-
}, {
|
|
213
|
-
readonly name: "name";
|
|
214
|
-
readonly type: "string";
|
|
215
|
-
}];
|
|
216
|
-
declare const ISSUER_TYPE: readonly [{
|
|
217
|
-
readonly name: "id";
|
|
218
|
-
readonly type: "string";
|
|
219
|
-
}, {
|
|
220
|
-
readonly name: "ethereumAddress";
|
|
221
|
-
readonly type: "string";
|
|
222
|
-
}];
|
|
223
|
-
declare const CREDENTIAL_TYPES: {
|
|
224
|
-
readonly EIP712Domain: readonly [{
|
|
225
|
-
readonly name: "name";
|
|
226
|
-
readonly type: "string";
|
|
227
|
-
}, {
|
|
228
|
-
readonly name: "version";
|
|
229
|
-
readonly type: "string";
|
|
230
|
-
}, {
|
|
231
|
-
readonly name: "chainId";
|
|
232
|
-
readonly type: "uint256";
|
|
233
|
-
}, {
|
|
234
|
-
readonly name: "verifyingContract";
|
|
235
|
-
readonly type: "address";
|
|
236
|
-
}];
|
|
237
|
-
readonly VerifiableCredential: readonly [{
|
|
238
|
-
readonly name: "@context";
|
|
239
|
-
readonly type: "string[]";
|
|
240
|
-
}, {
|
|
241
|
-
readonly name: "type";
|
|
242
|
-
readonly type: "string[]";
|
|
243
|
-
}, {
|
|
244
|
-
readonly name: "id";
|
|
245
|
-
readonly type: "string";
|
|
246
|
-
}, {
|
|
247
|
-
readonly name: "issuer";
|
|
248
|
-
readonly type: "Issuer";
|
|
249
|
-
}, {
|
|
250
|
-
readonly name: "credentialSubject";
|
|
251
|
-
readonly type: "CredentialSubject";
|
|
252
|
-
}, {
|
|
253
|
-
readonly name: "credentialSchema";
|
|
254
|
-
readonly type: "CredentialSchema";
|
|
255
|
-
}, {
|
|
256
|
-
readonly name: "issuanceDate";
|
|
257
|
-
readonly type: "string";
|
|
258
|
-
}, {
|
|
259
|
-
readonly name: "expirationDate";
|
|
260
|
-
readonly type: "string";
|
|
261
|
-
}];
|
|
262
|
-
readonly CredentialSchema: readonly [{
|
|
263
|
-
readonly name: "id";
|
|
264
|
-
readonly type: "string";
|
|
265
|
-
}, {
|
|
266
|
-
readonly name: "type";
|
|
267
|
-
readonly type: "string";
|
|
268
|
-
}];
|
|
269
|
-
readonly CredentialSubject: readonly [{
|
|
270
|
-
readonly name: "app";
|
|
271
|
-
readonly type: "string";
|
|
272
|
-
}, {
|
|
273
|
-
readonly name: "id";
|
|
274
|
-
readonly type: "string";
|
|
275
|
-
}, {
|
|
276
|
-
readonly name: "name";
|
|
277
|
-
readonly type: "string";
|
|
278
|
-
}];
|
|
279
|
-
readonly Issuer: readonly [{
|
|
280
|
-
readonly name: "id";
|
|
281
|
-
readonly type: "string";
|
|
282
|
-
}, {
|
|
283
|
-
readonly name: "ethereumAddress";
|
|
284
|
-
readonly type: "string";
|
|
285
|
-
}];
|
|
286
|
-
};
|
|
287
161
|
//#endregion
|
|
288
162
|
//#region src/renown/use-renown-init.d.ts
|
|
289
163
|
interface RenownInitOptions {
|
|
@@ -340,4 +214,4 @@ declare function Renown({
|
|
|
340
214
|
}: RenownProps): null;
|
|
341
215
|
//#endregion
|
|
342
216
|
export { logout as A, RenownUserButtonMenuItem as C, RenownAuthButton as D, RenownLoginButtonProps as E, RenownAuth as M, RenownAuthStatus as N, RenownAuthButtonProps as O, useRenownAuth as P, RenownUserButton as S, RenownLoginButton as T, CopyIcon as _, CREDENTIAL_SCHEMA_EIP712_TYPE as a, SpinnerIcon as b, DOMAIN_TYPE as c, RENOWN_NETWORK_ID as d, RENOWN_URL as f, ChevronDownIcon as g, initRenownCrypto as h, useRenownInit as i, openRenown as j, login as k, ISSUER_TYPE as l, initConnectCrypto as m, RenownProps as n, CREDENTIAL_SUBJECT_TYPE as o, VERIFIABLE_CREDENTIAL_EIP712_TYPE as p, RenownInitOptions as r, CREDENTIAL_TYPES as s, Renown as t, RENOWN_CHAIN_ID as u, DisconnectIcon as v, RenownUserButtonProps as w, UserIcon as x, RenownLogo as y };
|
|
343
|
-
//# sourceMappingURL=index-
|
|
217
|
+
//# sourceMappingURL=index-Bz4MqX_j.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-Bz4MqX_j.d.ts","names":[],"sources":["../src/renown/use-renown-auth.ts","../src/renown/utils.ts","../src/renown/components/RenownAuthButton.tsx","../src/renown/components/RenownLoginButton.tsx","../src/renown/components/RenownUserButton.tsx","../src/renown/components/icons.tsx","../src/renown/crypto.ts","../src/renown/constants.ts","../src/renown/use-renown-init.ts","../src/renown/renown-init.tsx"],"mappings":";;;;;;KAKY,gBAAA,GAAmB,WAAA;AAAA,UAEd,UAAA;EACf,MAAA,EAAQ,gBAAA;EACR,IAAA,EAAM,IAAA;EACN,OAAA;EACA,OAAA;EACA,SAAA;EACA,SAAA;EACA,WAAA;EACA,cAAA;EACA,KAAA;EACA,MAAA,QAAc,OAAA;EACd,WAAA;AAAA;AAAA,iBAkBc,aAAA,CAAA,GAAiB,UAAA;;;iBChCjB,UAAA,CAAW,UAAA;;;;;ADC3B;;iBCkDsB,KAAA,CACpB,OAAA,sBACA,MAAA,EAAQ,OAAA,eACP,OAAA,CAAQ,IAAA;AAAA,iBA0BW,MAAA,CAAA,GAAM,OAAA;;;UC/EX,qBAAA;EACf,SAAA;EACA,QAAA;EACA,YAAA,GAAe,SAAA;EACf,WAAA,GAAc,SAAA;EACd,cAAA,GAAiB,SAAA;EACjB,QAAA,IAAY,IAAA,EAAM,UAAA,KAAe,SAAA;AAAA;AAAA,iBAGnB,gBAAA,CAAA;EACd,SAAA;EACA,QAAA;EACA,YAAA;EACA,WAAA;EACA,cAAA;EACA;AAAA,GACC,qBAAA,GAAqB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;UCfP,sBAAA;EACf,OAAA;EACA,QAAA;EACA,KAAA,GAAQ,aAAA;EACR,SAAA;EACA,OAAA;EACA,QAAA,GAAW,SA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BAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAiE5D,eAAA,CAAA;EACd,IAAA;EACA,KAAA;EACA;AAAA,GACC,SAAA,GAAS,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAqBI,QAAA,CAAA;EAAW,IAAA;EAAW;AAAA,GAAqB,SAAA,GAAS,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;;;;;;iBC5L9C,iBAAA,CAAA,GAAiB,OAAA,CAAA,YAAA,CAAA,YAAA;;;;;iBAQjB,gBAAA,CAAA,GAAgB,OAAA,CAAA,YAAA,CAAA,YAAA;;;cChBzB,UAAA;AAAA,cACA,iBAAA;AAAA,cACA,eAAA;;;UCKI,iBAAA;EACf,OAAA;;;;ARHF;EQQE,SAAA;EACA,GAAA;AAAA;;ARPF;;;;;;;;;;;;iBQ2CgB,aAAA,CAAA;EACd,OAAA;EACA,SAAA;EACA;AAAA,GACC,iBAAA,GAAoB,OAAA,CAAQ,OAAA;;;UCpDd,WAAA,SAAoB,iBAAA;EACnC,OAAA,IAAW,KAAA;AAAA;;;ATEb;;;;;AAEA;;;;;;;;;iBSegB,MAAA,CAAA;EAAS,OAAA;EAAA,GAAY;AAAA,GAAe,WAAA"}
|
|
@@ -702,7 +702,7 @@ type QueryCallbackReturnType$1 = {
|
|
|
702
702
|
type useRelationalQueryOptions$1 = {
|
|
703
703
|
hashNamespace?: boolean;
|
|
704
704
|
};
|
|
705
|
-
declare function useRelationalQuery<Schema, T = unknown, TParams = undefined>(ProcessorClass: RelationalDbProcessorClass<Schema>, driveId: string, queryCallback: (db: IRelationalQueryBuilder<Schema>, parameters?: TParams) => QueryCallbackReturnType$1, parameters?: TParams,
|
|
705
|
+
declare function useRelationalQuery<Schema, T = unknown, TParams = undefined>(ProcessorClass: RelationalDbProcessorClass<Schema>, driveId: string, queryCallback: (db: IRelationalQueryBuilder<Schema>, parameters?: TParams) => QueryCallbackReturnType$1, parameters?: TParams, _options?: useRelationalQueryOptions$1): {
|
|
706
706
|
readonly isLoading: boolean;
|
|
707
707
|
readonly error: Error | null;
|
|
708
708
|
readonly result: LiveQueryResults<T> | null;
|
|
@@ -723,4 +723,4 @@ declare function createProcessorQuery<TSchema>(ProcessorClass: RelationalDbProce
|
|
|
723
723
|
};
|
|
724
724
|
//#endregion
|
|
725
725
|
export { type RelationalDbWithLive as a, type PGlite as c, type useRelationalQueryOptions$1 as i, type QueryCallbackReturnType$1 as n, type useRelationalDb as o, type useRelationalQuery as r, type PGliteWithLive as s, createProcessorQuery as t };
|
|
726
|
-
//# sourceMappingURL=index-
|
|
726
|
+
//# sourceMappingURL=index-ZltD7u5Z.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-Ce4S7Kk1.d.ts","names":["Modes","text","binary","Mode","BufferParameter","ArrayBuffer","ArrayBufferView","MessageName","BackendMessage","name","length","parseComplete","bindComplete","closeComplete","noData","portalSuspended","replicationStart","emptyQuery","copyDone","AuthenticationOk","constructor","AuthenticationCleartextPassword","AuthenticationMD5Password","Uint8Array","salt","AuthenticationSASL","mechanisms","AuthenticationSASLContinue","data","AuthenticationSASLFinal","AuthenticationMessage","NoticeOrError","message","severity","code","detail","hint","position","internalPosition","internalQuery","where","schema","table","column","dataType","constraint","file","line","routine","DatabaseError","Error","CopyDataMessage","chunk","CopyResponse","columnTypes","columnCount","Field","tableID","columnID","dataTypeID","dataTypeSize","dataTypeModifier","format","RowDescriptionMessage","fieldCount","fields","ParameterDescriptionMessage","parameterCount","dataTypeIDs","ParameterStatusMessage","parameterName","parameterValue","BackendKeyDataMessage","processID","secretKey","NotificationResponseMessage","processId","channel","payload","ReadyForQueryMessage","status","CommandCompleteMessage","DataRowMessage","NoticeMessage","messages_AuthenticationCleartextPassword","messages_AuthenticationMD5Password","messages_AuthenticationMessage","messages_AuthenticationOk","messages_AuthenticationSASL","messages_AuthenticationSASLContinue","messages_AuthenticationSASLFinal","messages_BackendKeyDataMessage","messages_BackendMessage","messages_CommandCompleteMessage","messages_CopyDataMessage","messages_CopyResponse","messages_DataRowMessage","messages_DatabaseError","messages_Field","messages_MessageName","messages_NoticeMessage","messages_NotificationResponseMessage","messages_ParameterDescriptionMessage","messages_ParameterStatusMessage","messages_ReadyForQueryMessage","messages_RowDescriptionMessage","messages_bindComplete","messages_closeComplete","messages_copyDone","messages_emptyQuery","messages_noData","messages_parseComplete","messages_portalSuspended","messages_replicationStart","messages","IDBFS","Emscripten","FileSystemType","IDBDatabase","Record","quit","dbs","FS","filesystems","MEMFS","NODEFS","PostgresMod","EmscriptenModule","Array","Blob","Promise","Omit","preInit","mod","preRun","postRun","FD_BUFFER_MAX","WASM_PREFIX","INITIAL_MEMORY","pg_extensions","_pgl_initdb","_pgl_backend","_pgl_shutdown","_interactive_write","msgLength","_interactive_one","peek","_set_read_write_cbs","read_cb","write_cb","addFunction","ptr","cb","signature","removeFunction","f","PostgresFactory","T","Partial","moduleOverrides","_default","postgresMod_FS","postgresMod_PostgresMod","postgresMod","default","DumpTarCompressionOptions","PGDATA","FsType","Filesystem","PGlite","File","init","pg","emscriptenOptions","emscriptenOpts","syncToFs","relaxedDurability","initialSyncFs","dumpTar","dbname","compression","closeFs","EmscriptenBuiltinFilesystem","dataDir","_relaxedDurability","BaseFilesystem","debug","FsStats","chmod","path","mode","close","fd","fstat","lstat","mkdir","recursive","options","open","flags","readdir","read","buffer","offset","rename","oldPath","newPath","rmdir","truncate","len","unlink","utimes","atime","mtime","writeFile","encoding","flag","write","dev","ino","nlink","uid","gid","rdev","size","blksize","blocks","ctime","ERRNO_CODES","EBADF","EBADFD","EEXIST","EINVAL","EISDIR","ENODEV","ENOENT","ENOTDIR","ENOTEMPTY","FilesystemType","DebugLevel","RowMode","ParserOptions","pgType","value","SerializerOptions","QueryOptions","rowMode","parsers","serializers","blob","onNotice","notice","paramTypes","ExecProtocolOptions","throwOnError","ExtensionSetupResult","TNamespace","URL","namespaceObj","bundlePath","ExtensionSetup","PGliteInterface","clientOnly","Extension","setup","ExtensionNamespace","Extensions","namespace","InitializedExtensions","TExtensions","K","ExecProtocolResult","DumpDataDirResult","tarball","extension","filename","PGliteOptions","WebAssembly","Module","username","database","fs","extensions","loadDataDir","initialMemory","wasmModule","fsBundle","Results","TemplateStringsArray","DescribeQueryResult","Transaction","waitReady","ready","closed","query","params","sql","sqlStrings","exec","describeQuery","transaction","tx","callback","execProtocolRaw","execProtocol","runExclusive","fn","listen","unlisten","onNotification","offNotification","dumpDataDir","refreshArrayTypes","PGliteInterfaceExtensions","E","ReturnType","Awaited","N","Row","key","rows","affectedRows","rollback","Serializer","Parser","queryParams","serializer","resultFields","parser","BOOL","BYTEA","CHAR","INT8","INT2","INT4","REGPROC","TEXT","OID","TID","XID","CID","JSON","XML","PG_NODE_TREE","SMGR","PATH","POLYGON","CIDR","FLOAT4","FLOAT8","ABSTIME","RELTIME","TINTERVAL","CIRCLE","MACADDR8","MONEY","MACADDR","INET","ACLITEM","BPCHAR","VARCHAR","DATE","TIME","TIMESTAMP","TIMESTAMPTZ","INTERVAL","TIMETZ","BIT","VARBIT","NUMERIC","REFCURSOR","REGPROCEDURE","REGOPER","REGOPERATOR","REGCLASS","REGTYPE","UUID","TXID_SNAPSHOT","PG_LSN","PG_NDISTINCT","PG_DEPENDENCIES","TSVECTOR","TSQUERY","GTSVECTOR","REGCONFIG","REGDICTIONARY","JSONB","REGNAMESPACE","REGROLE","types","Date","string","to","from","serialize","x","parse","number","bigint","json","boolean","date","bytea","typeId","TypeHandler","TypeHandlers","parseType","type","arraySerializer","xs","typarray","arrayParser","types$1_ABSTIME","types$1_ACLITEM","types$1_BIT","types$1_BOOL","types$1_BPCHAR","types$1_BYTEA","types$1_CHAR","types$1_CID","types$1_CIDR","types$1_CIRCLE","types$1_DATE","types$1_FLOAT4","types$1_FLOAT8","types$1_GTSVECTOR","types$1_INET","types$1_INT2","types$1_INT4","types$1_INT8","types$1_INTERVAL","types$1_JSON","types$1_JSONB","types$1_MACADDR","types$1_MACADDR8","types$1_MONEY","types$1_NUMERIC","types$1_OID","types$1_PATH","types$1_PG_DEPENDENCIES","types$1_PG_LSN","types$1_PG_NDISTINCT","types$1_PG_NODE_TREE","types$1_POLYGON","types$1_Parser","types$1_REFCURSOR","types$1_REGCLASS","types$1_REGCONFIG","types$1_REGDICTIONARY","types$1_REGNAMESPACE","types$1_REGOPER","types$1_REGOPERATOR","types$1_REGPROC","types$1_REGPROCEDURE","types$1_REGROLE","types$1_REGTYPE","types$1_RELTIME","types$1_SMGR","types$1_Serializer","types$1_TEXT","types$1_TID","types$1_TIME","types$1_TIMESTAMP","types$1_TIMESTAMPTZ","types$1_TIMETZ","types$1_TINTERVAL","types$1_TSQUERY","types$1_TSVECTOR","types$1_TXID_SNAPSHOT","types$1_TypeHandler","types$1_TypeHandlers","types$1_UUID","types$1_VARBIT","types$1_VARCHAR","types$1_XID","types$1_XML","types$1_arrayParser","types$1_arraySerializer","types$1_parseType","types$1_parsers","types$1_serializers","types$1_types","types$1","BasePGlite","force","Pick","private","execProtocolStream","_handleBlob","_getWrittenBlob","_cleanupBlob","_checkReady","_runExclusiveQuery","_runExclusiveTransaction","_initArrayTypes","O","Symbol","asyncDispose","AsyncDisposable","DEFAULT_RECV_BUF_SIZE","MAX_BUFFER_SIZE","create","execProtocolRawSync","isInTransaction","clone","_runExclusiveListen","A","B","C","D","F","G","I","M","P","Q","R","S","W","a","b","c","d","e","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","y","z","R","Results","d","PGliteInterface","LiveQueryOptions","T","AbortSignal","key","query","params","offset","limit","callback","results","signal","LiveChangesOptions","Change","Array","changes","LiveIncrementalQueryOptions","LiveNamespace","LiveQuery","Promise","LiveChanges","options","incrementalQuery","LiveQueryResults","totalCount","initialResults","subscribe","unsubscribe","refresh","fields","name","dataTypeID","initialChanges","ChangeInsert","__changed_columns__","__op__","__after__","ChangeDelete","ChangeUpdate","ChangeReset","live","setup","pg","_emscriptenOpts","namespaceObj","PGliteWithLive"],"sources":["../../../node_modules/.pnpm/@electric-sql+pglite@0.3.15/node_modules/@electric-sql/pglite/dist/pglite-CntadC_p.d.ts","../../../node_modules/.pnpm/@electric-sql+pglite@0.3.15/node_modules/@electric-sql/pglite/dist/live/index.d.ts","../src/relational/hooks/useRelationalDb.ts","../src/relational/hooks/useRelationalQuery.ts","../src/relational/utils/createProcessorQuery.ts"],"x_google_ignoreList":[0,1],"mappings":";;;;;KAOKO,WAAAA;AAAAA,KACAC,cAAAA;EACDC,IAAAA,EAAMF,WAAAA;EACNG,MAAAA;AAAAA;AAAAA,UA6CMqB,aAAAA;EACNC,OAAAA;EACAC,QAAAA;EACAC,IAAAA;EACAC,MAAAA;EACAC,IAAAA;EACAC,QAAAA;EACAC,gBAAAA;EACAC,aAAAA;EACAC,KAAAA;EACAC,MAAAA;EACAC,KAAAA;EACAC,MAAAA;EACAC,QAAAA;EACAC,UAAAA;EACAC,IAAAA;EACAC,IAAAA;EACAC,OAAAA;AAAAA;AAAAA,cAqGUmC,aAAAA,YAAyB3E,cAAAA,EAAgBuB,aAAAA;EAAAA,SAC1CrB,MAAAA;EAAAA,SACAsB,OAAAA;EACTZ,WAAAA,CAAYV,MAAAA,UAAgBsB,OAAAA;EAAAA,SACnBvB,IAAAA;EACTwB,QAAAA;EACAC,IAAAA;EACAC,MAAAA;EACAC,IAAAA;EACAC,QAAAA;EACAC,gBAAAA;EACAC,aAAAA;EACAC,KAAAA;EACAC,MAAAA;EACAC,KAAAA;EACAC,MAAAA;EACAC,QAAAA;EACAC,UAAAA;EACAC,IAAAA;EACAC,IAAAA;EACAC,OAAAA;AAAAA;AAAAA,KAwDCmE,KAAAA,GAAQC,UAAAA,CAAWC,cAAAA;EACpBG,IAAAA;EACAC,GAAAA,EAAKF,MAAAA,SAAeD,WAAAA;AAAAA;AAAAA,KAEnBI,EAAAA,UAAYA,EAAAA;EACbC,WAAAA;IACIC,KAAAA,EAAOR,UAAAA,CAAWC,cAAAA;IAClBQ,MAAAA,EAAQT,UAAAA,CAAWC,cAAAA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CACd,cAAA,EAAgB,0BAAA,CAA2B,OAAA;EAAA,wBAKvC,EAAA,EAAI,uBAAA,CAAwB,OAAA,MACzB,uBAAA,EAAuB,OAAA,UAEb,aAAA,EACA,aAAA;IAEf,SAAA;IACA,KAAA,EAAO,KAAA;IACP,MAAA,EAAQ,gBAAA,CACN,UAAA,CAAW,aAAA,UAAuB,aAAA,YAAyB,CAAA;EAAA;EAAA,iCAQ3D,EAAA,EAAI,uBAAA,CAAwB,OAAA,GAC5B,UAAA,EAAY,OAAA,KACT,uBAAA,EAAuB,OAAA,UAEb,aAAA,EACA,aAAA,EAAa,UAAA,EAChB,OAAA,EAAO,OAAA,GACT,yBAAA;IAEV,SAAA;IACA,KAAA,EAAO,KAAA;IACP,MAAA,EAAQ,gBAAA,CACN,UAAA,CAAW,aAAA,UAAuB,aAAA,YAAyB,CAAA;EAAA;AAAA"}
|
|
1
|
+
{"version":3,"file":"index-ZltD7u5Z.d.ts","names":["Modes","text","binary","Mode","BufferParameter","ArrayBuffer","ArrayBufferView","MessageName","BackendMessage","name","length","parseComplete","bindComplete","closeComplete","noData","portalSuspended","replicationStart","emptyQuery","copyDone","AuthenticationOk","constructor","AuthenticationCleartextPassword","AuthenticationMD5Password","Uint8Array","salt","AuthenticationSASL","mechanisms","AuthenticationSASLContinue","data","AuthenticationSASLFinal","AuthenticationMessage","NoticeOrError","message","severity","code","detail","hint","position","internalPosition","internalQuery","where","schema","table","column","dataType","constraint","file","line","routine","DatabaseError","Error","CopyDataMessage","chunk","CopyResponse","columnTypes","columnCount","Field","tableID","columnID","dataTypeID","dataTypeSize","dataTypeModifier","format","RowDescriptionMessage","fieldCount","fields","ParameterDescriptionMessage","parameterCount","dataTypeIDs","ParameterStatusMessage","parameterName","parameterValue","BackendKeyDataMessage","processID","secretKey","NotificationResponseMessage","processId","channel","payload","ReadyForQueryMessage","status","CommandCompleteMessage","DataRowMessage","NoticeMessage","messages_AuthenticationCleartextPassword","messages_AuthenticationMD5Password","messages_AuthenticationMessage","messages_AuthenticationOk","messages_AuthenticationSASL","messages_AuthenticationSASLContinue","messages_AuthenticationSASLFinal","messages_BackendKeyDataMessage","messages_BackendMessage","messages_CommandCompleteMessage","messages_CopyDataMessage","messages_CopyResponse","messages_DataRowMessage","messages_DatabaseError","messages_Field","messages_MessageName","messages_NoticeMessage","messages_NotificationResponseMessage","messages_ParameterDescriptionMessage","messages_ParameterStatusMessage","messages_ReadyForQueryMessage","messages_RowDescriptionMessage","messages_bindComplete","messages_closeComplete","messages_copyDone","messages_emptyQuery","messages_noData","messages_parseComplete","messages_portalSuspended","messages_replicationStart","messages","IDBFS","Emscripten","FileSystemType","IDBDatabase","Record","quit","dbs","FS","filesystems","MEMFS","NODEFS","PostgresMod","EmscriptenModule","Array","Blob","Promise","Omit","preInit","mod","preRun","postRun","FD_BUFFER_MAX","WASM_PREFIX","INITIAL_MEMORY","pg_extensions","_pgl_initdb","_pgl_backend","_pgl_shutdown","_interactive_write","msgLength","_interactive_one","peek","_set_read_write_cbs","read_cb","write_cb","addFunction","ptr","cb","signature","removeFunction","f","PostgresFactory","T","Partial","moduleOverrides","_default","postgresMod_FS","postgresMod_PostgresMod","postgresMod","default","DumpTarCompressionOptions","PGDATA","FsType","Filesystem","PGlite","File","init","pg","emscriptenOptions","emscriptenOpts","syncToFs","relaxedDurability","initialSyncFs","dumpTar","dbname","compression","closeFs","EmscriptenBuiltinFilesystem","dataDir","_relaxedDurability","BaseFilesystem","debug","FsStats","chmod","path","mode","close","fd","fstat","lstat","mkdir","recursive","options","open","flags","readdir","read","buffer","offset","rename","oldPath","newPath","rmdir","truncate","len","unlink","utimes","atime","mtime","writeFile","encoding","flag","write","dev","ino","nlink","uid","gid","rdev","size","blksize","blocks","ctime","ERRNO_CODES","EBADF","EBADFD","EEXIST","EINVAL","EISDIR","ENODEV","ENOENT","ENOTDIR","ENOTEMPTY","FilesystemType","DebugLevel","RowMode","ParserOptions","pgType","value","SerializerOptions","QueryOptions","rowMode","parsers","serializers","blob","onNotice","notice","paramTypes","ExecProtocolOptions","throwOnError","ExtensionSetupResult","TNamespace","URL","namespaceObj","bundlePath","ExtensionSetup","PGliteInterface","clientOnly","Extension","setup","ExtensionNamespace","Extensions","namespace","InitializedExtensions","TExtensions","K","ExecProtocolResult","DumpDataDirResult","tarball","extension","filename","PGliteOptions","WebAssembly","Module","username","database","fs","extensions","loadDataDir","initialMemory","wasmModule","fsBundle","Results","TemplateStringsArray","DescribeQueryResult","Transaction","waitReady","ready","closed","query","params","sql","sqlStrings","exec","describeQuery","transaction","tx","callback","execProtocolRaw","execProtocol","runExclusive","fn","listen","unlisten","onNotification","offNotification","dumpDataDir","refreshArrayTypes","PGliteInterfaceExtensions","E","ReturnType","Awaited","N","Row","key","rows","affectedRows","rollback","Serializer","Parser","queryParams","serializer","resultFields","parser","BOOL","BYTEA","CHAR","INT8","INT2","INT4","REGPROC","TEXT","OID","TID","XID","CID","JSON","XML","PG_NODE_TREE","SMGR","PATH","POLYGON","CIDR","FLOAT4","FLOAT8","ABSTIME","RELTIME","TINTERVAL","CIRCLE","MACADDR8","MONEY","MACADDR","INET","ACLITEM","BPCHAR","VARCHAR","DATE","TIME","TIMESTAMP","TIMESTAMPTZ","INTERVAL","TIMETZ","BIT","VARBIT","NUMERIC","REFCURSOR","REGPROCEDURE","REGOPER","REGOPERATOR","REGCLASS","REGTYPE","UUID","TXID_SNAPSHOT","PG_LSN","PG_NDISTINCT","PG_DEPENDENCIES","TSVECTOR","TSQUERY","GTSVECTOR","REGCONFIG","REGDICTIONARY","JSONB","REGNAMESPACE","REGROLE","types","Date","string","to","from","serialize","x","parse","number","bigint","json","boolean","date","bytea","typeId","TypeHandler","TypeHandlers","parseType","type","arraySerializer","xs","typarray","arrayParser","types$1_ABSTIME","types$1_ACLITEM","types$1_BIT","types$1_BOOL","types$1_BPCHAR","types$1_BYTEA","types$1_CHAR","types$1_CID","types$1_CIDR","types$1_CIRCLE","types$1_DATE","types$1_FLOAT4","types$1_FLOAT8","types$1_GTSVECTOR","types$1_INET","types$1_INT2","types$1_INT4","types$1_INT8","types$1_INTERVAL","types$1_JSON","types$1_JSONB","types$1_MACADDR","types$1_MACADDR8","types$1_MONEY","types$1_NUMERIC","types$1_OID","types$1_PATH","types$1_PG_DEPENDENCIES","types$1_PG_LSN","types$1_PG_NDISTINCT","types$1_PG_NODE_TREE","types$1_POLYGON","types$1_Parser","types$1_REFCURSOR","types$1_REGCLASS","types$1_REGCONFIG","types$1_REGDICTIONARY","types$1_REGNAMESPACE","types$1_REGOPER","types$1_REGOPERATOR","types$1_REGPROC","types$1_REGPROCEDURE","types$1_REGROLE","types$1_REGTYPE","types$1_RELTIME","types$1_SMGR","types$1_Serializer","types$1_TEXT","types$1_TID","types$1_TIME","types$1_TIMESTAMP","types$1_TIMESTAMPTZ","types$1_TIMETZ","types$1_TINTERVAL","types$1_TSQUERY","types$1_TSVECTOR","types$1_TXID_SNAPSHOT","types$1_TypeHandler","types$1_TypeHandlers","types$1_UUID","types$1_VARBIT","types$1_VARCHAR","types$1_XID","types$1_XML","types$1_arrayParser","types$1_arraySerializer","types$1_parseType","types$1_parsers","types$1_serializers","types$1_types","types$1","BasePGlite","force","Pick","private","execProtocolStream","_handleBlob","_getWrittenBlob","_cleanupBlob","_checkReady","_runExclusiveQuery","_runExclusiveTransaction","_initArrayTypes","O","Symbol","asyncDispose","AsyncDisposable","DEFAULT_RECV_BUF_SIZE","MAX_BUFFER_SIZE","create","execProtocolRawSync","isInTransaction","clone","_runExclusiveListen","A","B","C","D","F","G","I","M","P","Q","R","S","W","a","b","c","d","e","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","y","z","R","Results","d","PGliteInterface","LiveQueryOptions","T","AbortSignal","key","query","params","offset","limit","callback","results","signal","LiveChangesOptions","Change","Array","changes","LiveIncrementalQueryOptions","LiveNamespace","LiveQuery","Promise","LiveChanges","options","incrementalQuery","LiveQueryResults","totalCount","initialResults","subscribe","unsubscribe","refresh","fields","name","dataTypeID","initialChanges","ChangeInsert","__changed_columns__","__op__","__after__","ChangeDelete","ChangeUpdate","ChangeReset","live","setup","pg","_emscriptenOpts","namespaceObj","PGliteWithLive"],"sources":["../../../node_modules/.pnpm/@electric-sql+pglite@0.3.15/node_modules/@electric-sql/pglite/dist/pglite-CntadC_p.d.ts","../../../node_modules/.pnpm/@electric-sql+pglite@0.3.15/node_modules/@electric-sql/pglite/dist/live/index.d.ts","../src/relational/hooks/useRelationalDb.ts","../src/relational/hooks/useRelationalQuery.ts","../src/relational/utils/createProcessorQuery.ts"],"x_google_ignoreList":[0,1],"mappings":";;;;;KAOKO,WAAAA;AAAAA,KACAC,cAAAA;EACDC,IAAAA,EAAMF,WAAAA;EACNG,MAAAA;AAAAA;AAAAA,UA6CMqB,aAAAA;EACNC,OAAAA;EACAC,QAAAA;EACAC,IAAAA;EACAC,MAAAA;EACAC,IAAAA;EACAC,QAAAA;EACAC,gBAAAA;EACAC,aAAAA;EACAC,KAAAA;EACAC,MAAAA;EACAC,KAAAA;EACAC,MAAAA;EACAC,QAAAA;EACAC,UAAAA;EACAC,IAAAA;EACAC,IAAAA;EACAC,OAAAA;AAAAA;AAAAA,cAqGUmC,aAAAA,YAAyB3E,cAAAA,EAAgBuB,aAAAA;EAAAA,SAC1CrB,MAAAA;EAAAA,SACAsB,OAAAA;EACTZ,WAAAA,CAAYV,MAAAA,UAAgBsB,OAAAA;EAAAA,SACnBvB,IAAAA;EACTwB,QAAAA;EACAC,IAAAA;EACAC,MAAAA;EACAC,IAAAA;EACAC,QAAAA;EACAC,gBAAAA;EACAC,aAAAA;EACAC,KAAAA;EACAC,MAAAA;EACAC,KAAAA;EACAC,MAAAA;EACAC,QAAAA;EACAC,UAAAA;EACAC,IAAAA;EACAC,IAAAA;EACAC,OAAAA;AAAAA;AAAAA,KAwDCmE,KAAAA,GAAQC,UAAAA,CAAWC,cAAAA;EACpBG,IAAAA;EACAC,GAAAA,EAAKF,MAAAA,SAAeD,WAAAA;AAAAA;AAAAA,KAEnBI,E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