@powerhousedao/reactor-browser 6.2.3-dev.6 → 6.2.3-dev.60

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.
Files changed (88) hide show
  1. package/dist/{attachment-service-D3EhiAJ7.d.ts → attachment-service-DG6UkyMv.d.ts} +362 -65
  2. package/dist/attachment-service-DG6UkyMv.d.ts.map +1 -0
  3. package/dist/{client-BIHN_UyR.d.ts → client-BnGewICj.d.ts} +3 -3
  4. package/dist/client-BnGewICj.d.ts.map +1 -0
  5. package/dist/{client-D66jVnot.js → client-CXDpILj6.js} +232 -32
  6. package/dist/client-CXDpILj6.js.map +1 -0
  7. package/dist/{client-DjK30EQ-.js → client-Cq5avLW5.js} +35 -22
  8. package/dist/client-Cq5avLW5.js.map +1 -0
  9. package/dist/{document-by-id-B4FIzG1w.js → dispatch-C1VVTn5S.js} +393 -54
  10. package/dist/dispatch-C1VVTn5S.js.map +1 -0
  11. package/dist/document-by-id-BRDkvmpn.js +16 -0
  12. package/dist/document-by-id-BRDkvmpn.js.map +1 -0
  13. package/dist/{document-model-modules-bTP87nyr.js → document-model-modules-Gsh1Xr7j.js} +60 -68
  14. package/dist/document-model-modules-Gsh1Xr7j.js.map +1 -0
  15. package/dist/{document-operations-WeE6wIDt.js → document-operations-BSzcF0mu.js} +805 -167
  16. package/dist/document-operations-BSzcF0mu.js.map +1 -0
  17. package/dist/{global-OuINvEGT.d.ts → global-BuSwbbY0.d.ts} +59 -13
  18. package/dist/global-BuSwbbY0.d.ts.map +1 -0
  19. package/dist/{index-B33TKEqp.d.ts → index-ewIc3pEO.d.ts} +19 -98
  20. package/dist/index-ewIc3pEO.d.ts.map +1 -0
  21. package/dist/{index-BIVDXw3K.d.ts → index-rtDmzViP.d.ts} +3 -3
  22. package/dist/index-rtDmzViP.d.ts.map +1 -0
  23. package/dist/index.d.ts +395 -371
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +116 -47
  26. package/dist/index.js.map +1 -1
  27. package/dist/inspector-proxy-DODqs15F.d.ts +25 -0
  28. package/dist/inspector-proxy-DODqs15F.d.ts.map +1 -0
  29. package/dist/{make-ph-event-functions-DBq3iWYn.js → make-ph-event-functions-CdsvEl5t.js} +4 -2
  30. package/dist/{make-ph-event-functions-DBq3iWYn.js.map → make-ph-event-functions-CdsvEl5t.js.map} +1 -1
  31. package/dist/{pglite-CntadC_p-9NDG14dS.d.ts → pglite-CntadC_p-DTkdF8sr.d.ts} +11 -33
  32. package/dist/pglite-CntadC_p-DTkdF8sr.d.ts.map +1 -0
  33. package/dist/{relational-D1RB45sA.js → relational-DxHuX41f.js} +66 -5
  34. package/dist/relational-DxHuX41f.js.map +1 -0
  35. package/dist/{renown-rqK8sokh.js → renown-CPAeJt5L.js} +7 -8
  36. package/dist/{renown-rqK8sokh.js.map → renown-CPAeJt5L.js.map} +1 -1
  37. package/dist/{renown-BHxwP7xU.js → renown-D05wkobG.js} +2 -2
  38. package/dist/{renown-BHxwP7xU.js.map → renown-D05wkobG.js.map} +1 -1
  39. package/dist/src/ai/index.d.ts +51 -62
  40. package/dist/src/ai/index.d.ts.map +1 -1
  41. package/dist/src/ai/index.js +5 -8
  42. package/dist/src/ai/index.js.map +1 -1
  43. package/dist/src/analytics/index.d.ts +36 -44
  44. package/dist/src/analytics/index.d.ts.map +1 -1
  45. package/dist/src/analytics/index.js +2 -2
  46. package/dist/src/analytics/index.js.map +1 -1
  47. package/dist/src/document-model.d.ts +3 -4
  48. package/dist/src/document-model.d.ts.map +1 -1
  49. package/dist/src/document-model.js.map +1 -1
  50. package/dist/src/graphql/client.d.ts +4 -3
  51. package/dist/src/graphql/client.js +1 -1
  52. package/dist/src/graphql-client/entry.d.ts +5 -4
  53. package/dist/src/graphql-client/entry.js +4 -4
  54. package/dist/src/relational/index.d.ts +15 -9
  55. package/dist/src/relational/index.d.ts.map +1 -1
  56. package/dist/src/relational/index.js +1 -1
  57. package/dist/src/renown/index.d.ts +3 -2
  58. package/dist/src/renown/index.js +2 -2
  59. package/dist/src/rpc/index.d.ts +176 -138
  60. package/dist/src/rpc/index.d.ts.map +1 -1
  61. package/dist/src/rpc/index.js +421 -618
  62. package/dist/src/rpc/index.js.map +1 -1
  63. package/dist/{store-BJYcr_FL.js → store-DInXcjal.js} +1 -1
  64. package/dist/{store-BJYcr_FL.js.map → store-DInXcjal.js.map} +1 -1
  65. package/dist/{switchboard-CaXQ4-5Q.js → switchboard-3vHbIV5W.js} +58 -6
  66. package/dist/switchboard-3vHbIV5W.js.map +1 -0
  67. package/dist/{types-Dcv1ZLoW.d.ts → types-0Fh1tNjy.d.ts} +242 -17
  68. package/dist/types-0Fh1tNjy.d.ts.map +1 -0
  69. package/dist/{types-6vDzbRRS.d.ts → types-520nWrB3.d.ts} +2 -2
  70. package/dist/types-520nWrB3.d.ts.map +1 -0
  71. package/package.json +19 -20
  72. package/dist/attachment-service-D3EhiAJ7.d.ts.map +0 -1
  73. package/dist/client-BIHN_UyR.d.ts.map +0 -1
  74. package/dist/client-D66jVnot.js.map +0 -1
  75. package/dist/client-DjK30EQ-.js.map +0 -1
  76. package/dist/document-by-id-B4FIzG1w.js.map +0 -1
  77. package/dist/document-model-modules-bTP87nyr.js.map +0 -1
  78. package/dist/document-operations-WeE6wIDt.js.map +0 -1
  79. package/dist/global-OuINvEGT.d.ts.map +0 -1
  80. package/dist/index-B33TKEqp.d.ts.map +0 -1
  81. package/dist/index-BIVDXw3K.d.ts.map +0 -1
  82. package/dist/inspector-proxy-6h5VKAwt.d.ts +0 -257
  83. package/dist/inspector-proxy-6h5VKAwt.d.ts.map +0 -1
  84. package/dist/pglite-CntadC_p-9NDG14dS.d.ts.map +0 -1
  85. package/dist/relational-D1RB45sA.js.map +0 -1
  86. package/dist/switchboard-CaXQ4-5Q.js.map +0 -1
  87. package/dist/types-6vDzbRRS.d.ts.map +0 -1
  88. package/dist/types-Dcv1ZLoW.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/analytics/context.tsx","../../../src/analytics/hooks/analytics-query.ts","../../../src/analytics/hooks/timeline-items.ts","../../../src/analytics/hooks/document-timeline.ts"],"sourcesContent":["import type { AnalyticsQueryEngine } from \"@powerhousedao/analytics-engine-core\";\nimport {\n QueryClient,\n QueryClientProvider,\n useMutation,\n useQuery,\n useQueryClient,\n useSuspenseQuery,\n} from \"@tanstack/react-query\";\nimport { childLogger } from \"document-model\";\nimport type { PropsWithChildren } from \"react\";\nimport { useEffect } from \"react\";\nimport { getGlobal } from \"../global/core.js\";\nimport type { CreateStoreOptions } from \"./store.js\";\nimport { getAnalyticsStore } from \"./store.js\";\n\nconst _logger = childLogger([\"reactor-browser\", \"analytics\", \"provider\"]);\n\nconst defaultQueryClient = new QueryClient();\n\nexport const analyticsOptionsKey = [\"analytics\", \"options\"] as const;\nexport const analyticsStoreKey = [\"analytics\", \"store\"] as const;\nexport const analyticsEngineKey = [\"analytics\", \"engine\"] as const;\n\nexport function useAnalyticsStoreOptions() {\n return useQuery<CreateStoreOptions | undefined>({\n queryKey: analyticsOptionsKey,\n }).data;\n}\n\nexport function useCreateAnalyticsStore(options?: CreateStoreOptions) {\n const queryClient = useQueryClient();\n useEffect(() => {\n queryClient.setQueryDefaults(analyticsOptionsKey, {\n queryFn: () => options,\n staleTime: Infinity,\n gcTime: Infinity,\n });\n }, [queryClient, options]);\n\n return useMutation({\n mutationFn: async () => {\n const store = getAnalyticsStore();\n queryClient.setQueryDefaults(analyticsStoreKey, {\n queryFn: () => store,\n staleTime: Infinity,\n gcTime: Infinity,\n });\n return store;\n },\n });\n}\n\nexport function useAnalyticsStoreQuery(options?: CreateStoreOptions) {\n return useSuspenseQuery({\n queryKey: [analyticsStoreKey, options],\n queryFn: () => getAnalyticsStore(),\n retry: true,\n });\n}\n\nexport function useAnalyticsStore(options?: CreateStoreOptions) {\n const store = useAnalyticsStoreQuery(options);\n return store.data;\n}\n\nexport function useAnalyticsStoreAsync(options?: CreateStoreOptions) {\n return useQuery({\n queryKey: [analyticsStoreKey, options],\n queryFn: () => getAnalyticsStore(),\n retry: true,\n throwOnError: false,\n });\n}\n\ninterface BaseAnalyticsProviderProps extends PropsWithChildren {\n /**\n * Custom QueryClient instance\n * @default undefined\n */\n queryClient?: QueryClient;\n}\n\ntype AnalyticsProviderProps = BaseAnalyticsProviderProps &\n (\n | {\n options?: CreateStoreOptions;\n }\n | {\n databaseName?: string;\n }\n );\n\nfunction CreateAnalyticsStore() {\n const { mutate } = useCreateAnalyticsStore();\n\n useEffect(() => {\n mutate();\n }, []);\n\n return null;\n}\n\nexport function AnalyticsProvider({\n children,\n queryClient = defaultQueryClient,\n ..._props\n}: AnalyticsProviderProps) {\n return (\n <QueryClientProvider client={queryClient}>\n <CreateAnalyticsStore />\n {children}\n </QueryClientProvider>\n );\n}\n\nexport function useAnalyticsEngine(): AnalyticsQueryEngine | undefined {\n return useSuspenseQuery({\n queryKey: analyticsEngineKey,\n queryFn: async () => {\n const globalAnalytics = getGlobal(\"analytics\");\n if (!globalAnalytics) {\n throw new Error(\"No analytics store available\");\n }\n return (await globalAnalytics).engine;\n },\n retry: false,\n }).data;\n}\n\nexport function useAnalyticsEngineAsync() {\n return useQuery({\n queryKey: analyticsEngineKey,\n queryFn: async () => {\n const globalAnalytics = getGlobal(\"analytics\");\n if (!globalAnalytics) {\n throw new Error(\"No analytics store available\");\n }\n return (await globalAnalytics).engine;\n },\n retry: false,\n });\n}\n","import type {\n AnalyticsQuery,\n AnalyticsQueryEngine,\n AnalyticsSeries,\n AnalyticsSeriesInput,\n AnalyticsSeriesQuery,\n GroupedPeriodResults,\n IAnalyticsStore,\n} from \"@powerhousedao/analytics-engine-core\";\nimport { AnalyticsPath } from \"@powerhousedao/analytics-engine-core\";\nimport type {\n UseMutationOptions,\n UseQueryOptions,\n UseQueryResult,\n} from \"@tanstack/react-query\";\nimport { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport { useEffect } from \"react\";\nimport {\n useAnalyticsEngineAsync,\n useAnalyticsStoreAsync,\n useAnalyticsStoreOptions,\n} from \"../context.js\";\nimport { getAnalyticsStore } from \"../store.js\";\n\nfunction useAnalyticsQueryWrapper<TQueryFnData = unknown, TData = TQueryFnData>(\n options: Omit<UseQueryOptions<TQueryFnData, Error, TData>, \"queryFn\"> & {\n queryFn: (analytics: {\n store: IAnalyticsStore;\n engine: AnalyticsQueryEngine;\n }) => Promise<TQueryFnData> | TQueryFnData;\n },\n) {\n const { queryFn, ...queryOptions } = options;\n const { data: store } = useAnalyticsStoreAsync();\n const { data: engine } = useAnalyticsEngineAsync();\n const enabled =\n \"enabled\" in queryOptions ? queryOptions.enabled : !!store && !!engine;\n\n return useQuery({\n ...queryOptions,\n enabled,\n queryFn: async () => {\n if (!store || !engine) {\n throw new Error(\n \"No analytics store available. Use within an AnalyticsProvider.\",\n );\n }\n return await queryFn({ store, engine });\n },\n });\n}\n\nfunction useAnalyticsMutationWrapper<TVariables, TData>(\n options: Omit<UseMutationOptions<TData, Error, TVariables>, \"mutationFn\"> & {\n mutationFn: (\n variables: TVariables,\n context: {\n store: IAnalyticsStore;\n },\n ) => Promise<TData> | TData;\n },\n) {\n const { mutationFn, ...mutationOptions } = options;\n const _storeOptions = useAnalyticsStoreOptions();\n\n return useMutation({\n ...mutationOptions,\n mutationFn: async (value: TVariables) => {\n let store: IAnalyticsStore | null = null;\n try {\n store = await getAnalyticsStore();\n } catch (e) {\n console.error(e);\n }\n\n if (!store) {\n throw new Error(\n \"No analytics store available. Use within an AnalyticsProvider.\",\n );\n }\n return await mutationFn(value, { store });\n },\n });\n}\n\nexport type UseAnalyticsQueryOptions<TData = GroupedPeriodResults> = Omit<\n UseQueryOptions<GroupedPeriodResults, Error, TData>,\n \"queryKey\" | \"queryFn\"\n> & {\n sources?: AnalyticsPath[];\n};\n\nexport type UseAnalyticsQueryResult<TData = GroupedPeriodResults> =\n UseQueryResult<TData>;\n\nconst DEBOUNCE_INTERVAL = 200;\n\nexport function useAnalyticsQuery<TData = GroupedPeriodResults>(\n query: AnalyticsQuery,\n options?: UseAnalyticsQueryOptions<TData>,\n): UseAnalyticsQueryResult<TData> {\n const { data: store } = useAnalyticsStoreAsync();\n const queryClient = useQueryClient();\n const sources = options?.sources ?? [];\n\n const result = useAnalyticsQueryWrapper({\n queryKey: [\"analytics\", \"query\", query],\n queryFn: ({ engine }) => engine.execute(query),\n ...options,\n });\n\n useEffect(() => {\n if (!sources.length || !store) {\n return;\n }\n\n const subscriptions = new Array<() => void>();\n // Debounce invalidateQueries so it's not called too frequently\n let invalidateTimeout: ReturnType<typeof setTimeout> | null = null;\n const debouncedInvalidate = () => {\n if (invalidateTimeout) clearTimeout(invalidateTimeout);\n invalidateTimeout = setTimeout(() => {\n queryClient\n .invalidateQueries({\n queryKey: [\"analytics\", \"query\", query],\n })\n .catch((e) => {\n console.error(e);\n });\n }, DEBOUNCE_INTERVAL);\n };\n\n sources.forEach((path) => {\n const unsub = store.subscribeToSource(path, debouncedInvalidate);\n subscriptions.push(unsub);\n });\n\n // Unsubscribes from store when component unmounts or dependencies change\n return () => {\n subscriptions.forEach((unsub) => unsub());\n };\n }, [query, store, sources]);\n\n return result;\n}\n\nexport type UseAnalyticsSeriesOptions = Omit<\n UseQueryOptions<AnalyticsSeries[], Error, AnalyticsSeries[]>,\n \"queryKey\" | \"queryFn\"\n>;\n\nexport function useAnalyticsSeries(\n query: AnalyticsSeriesQuery,\n options?: UseAnalyticsSeriesOptions,\n) {\n return useAnalyticsQueryWrapper({\n queryKey: [\"analytics\", \"series\", query],\n queryFn: ({ store }) => store.getMatchingSeries(query),\n ...options,\n });\n}\n\nexport type UseAddSeriesValueOptions = Omit<\n UseMutationOptions<void, Error, AnalyticsSeriesInput>,\n \"mutationKey\" | \"mutationFn\"\n>;\n\nexport function useAddSeriesValue(options?: UseAddSeriesValueOptions) {\n return useAnalyticsMutationWrapper({\n mutationKey: [\"analytics\", \"addSeries\"],\n mutationFn: async (value, { store }) => {\n return await store.addSeriesValue(value);\n },\n ...options,\n });\n}\n\nexport type UseClearSeriesBySourceOptions = Omit<\n UseMutationOptions<\n number,\n Error,\n { source: AnalyticsPath; cleanUpDimensions?: boolean }\n >,\n \"mutationKey\" | \"mutationFn\"\n>;\n\nexport function useClearSeriesBySource(\n options?: UseClearSeriesBySourceOptions,\n) {\n return useAnalyticsMutationWrapper({\n mutationKey: [\"analytics\", \"clearSeries\"],\n mutationFn: async ({ source, cleanUpDimensions }, { store }) => {\n return store.clearSeriesBySource(source, cleanUpDimensions);\n },\n ...options,\n });\n}\n\nexport type UseClearEmptyAnalyticsDimensionsOptions = Omit<\n UseMutationOptions<number>,\n \"mutationKey\" | \"mutationFn\"\n>;\n\nexport function useClearEmptyAnalyticsDimensions(\n options?: UseClearEmptyAnalyticsDimensionsOptions,\n) {\n return useAnalyticsMutationWrapper({\n mutationKey: [\"analytics\", \"clearEmptyDimensions\"],\n mutationFn: async (_, { store }) => {\n return store.clearEmptyAnalyticsDimensions();\n },\n ...options,\n });\n}\n\nexport type UseAddSeriesValuesOptions = Omit<\n UseMutationOptions<void, Error, AnalyticsSeriesInput[]>,\n \"mutationKey\" | \"mutationFn\"\n>;\n\nexport function useAddSeriesValues(options?: UseAddSeriesValuesOptions) {\n return useAnalyticsMutationWrapper({\n mutationKey: [\"analytics\", \"addSeriesValues\"],\n mutationFn: async (values, { store }) => {\n return store.addSeriesValues(values);\n },\n ...options,\n });\n}\n\nexport type UseGetDimensionsOptions<TData> = Omit<\n UseQueryOptions<any, Error, TData>,\n \"queryKey\" | \"queryFn\"\n>;\n\nexport function useGetDimensions<TData = any>(\n options?: UseGetDimensionsOptions<TData>,\n) {\n return useAnalyticsQueryWrapper({\n queryKey: [\"analytics\", \"dimensions\"],\n queryFn: ({ store }) => store.getDimensions(),\n ...options,\n });\n}\n\nexport type UseMatchingSeriesOptions = Omit<\n UseQueryOptions<AnalyticsSeries[], Error, AnalyticsSeries[]>,\n \"queryKey\" | \"queryFn\"\n>;\n\nexport function useMatchingSeries(\n query: AnalyticsSeriesQuery,\n options?: UseMatchingSeriesOptions,\n) {\n const result = useAnalyticsQueryWrapper({\n queryKey: [\"analytics\", \"matchingSeries\", query],\n queryFn: ({ store }) => store.getMatchingSeries(query),\n ...options,\n });\n\n return result;\n}\n\nexport type UseQuerySourcesOptions = Omit<\n UseQueryOptions<AnalyticsPath[] | undefined>,\n \"queryKey\" | \"queryFn\"\n>;\n\nexport function useQuerySources(\n query: AnalyticsSeriesQuery,\n options?: UseQuerySourcesOptions,\n) {\n const { data: matchingSeries } = useMatchingSeries(query);\n\n return useQuery({\n queryKey: [\"analytics\", \"sources\", query],\n queryFn: () => {\n if (!matchingSeries?.length) {\n return [];\n }\n const uniqueSources = [\n ...new Set(matchingSeries.map((s) => s.source.toString())),\n ];\n return uniqueSources.map((source) => AnalyticsPath.fromString(source));\n },\n enabled: !!matchingSeries,\n ...options,\n });\n}\n","import type { GroupedPeriodResults } from \"@powerhousedao/analytics-engine-core\";\nimport {\n AnalyticsGranularity,\n AnalyticsPath,\n} from \"@powerhousedao/analytics-engine-core\";\nimport { DateTime } from \"luxon\";\nimport type { UseAnalyticsQueryResult } from \"./analytics-query.js\";\nimport { useAnalyticsQuery } from \"./analytics-query.js\";\n\nconst getBarSize = (value: number) => {\n if (value <= 0) return 0;\n if (value > 0 && value <= 50) return 1;\n if (value > 50 && value <= 100) return 2;\n if (value > 100 && value <= 250) return 3;\n return 4;\n};\n\n// Define types for our timeline items\ntype BarItem = {\n id: string;\n type: \"bar\";\n addSize: 0 | 1 | 2 | 3 | 4;\n delSize: 0 | 1 | 2 | 3 | 4;\n additions: number;\n deletions: number;\n timestampUtcMs: string;\n startDate: Date;\n endDate: Date;\n revision?: number;\n};\n\ntype DividerItem = {\n id: string;\n type: \"divider\";\n revision?: number;\n startDate?: Date;\n endDate?: Date;\n};\n\ntype TimelineItem = BarItem | DividerItem;\n\nfunction addItemsDividers(items: BarItem[]): TimelineItem[] {\n if (!items.length) return [];\n\n const result: TimelineItem[] = [];\n items.forEach((item, index) => {\n result.push(item);\n\n // Check if there's a next item and if they're not in consecutive hours\n if (index < items.length - 1) {\n const currentDate = new Date(item.startDate);\n const nextDate = new Date(items[index + 1].startDate);\n\n const currentHour = currentDate.getHours();\n const nextHour = nextDate.getHours();\n\n // Get day parts (without time) for comparison\n const currentDay = currentDate.toDateString();\n const nextDay = nextDate.toDateString();\n\n // If different days or non-consecutive hours on the same day\n if (\n currentDay !== nextDay ||\n (currentDay === nextDay && Math.abs(nextHour - currentHour) > 1)\n ) {\n result.push({\n id: `divider-${item.id}-${items[index + 1].id}`,\n type: \"divider\" as const,\n revision: 0,\n });\n }\n }\n });\n\n return result;\n}\n\nfunction metricsToItems(metrics: GroupedPeriodResults): TimelineItem[] {\n if (!metrics) return [];\n\n const items = metrics\n .sort((a, b) => {\n const aDate = new Date(a.start as unknown as Date);\n const bDate = new Date(b.start as unknown as Date);\n return aDate.getTime() - bDate.getTime();\n })\n .filter((result) => {\n return result.rows.every((row) => row.value > 0);\n })\n .map((result) => {\n const { additions, deletions } = result.rows.reduce(\n (acc, row) => {\n if (\n (row.dimensions.changes.path as unknown as string) ===\n \"ph/diff/changes/add\"\n ) {\n acc.additions += row.value;\n } else if (\n (row.dimensions.changes.path as unknown as string) ===\n \"ph/diff/changes/remove\"\n ) {\n acc.deletions += row.value;\n }\n return acc;\n },\n { additions: 0, deletions: 0 },\n );\n\n const startDate = new Date(result.start as unknown as Date);\n\n return {\n id: startDate.toISOString(),\n type: \"bar\" as const,\n addSize: getBarSize(additions),\n delSize: getBarSize(deletions),\n additions,\n deletions,\n timestampUtcMs: startDate.toISOString(),\n startDate: startDate,\n endDate: new Date(result.end as unknown as Date),\n revision: 0,\n } as const;\n });\n\n return addItemsDividers(items);\n}\n\nexport type UseTimelineItemsResult = UseAnalyticsQueryResult<TimelineItem[]>;\n\nexport const useTimelineItems = (\n documentId?: string,\n startTimestamp?: string,\n driveId?: string,\n): UseTimelineItemsResult => {\n const start = startTimestamp\n ? DateTime.fromISO(startTimestamp)\n : DateTime.now().startOf(\"day\");\n\n return useAnalyticsQuery<TimelineItem[]>(\n {\n start,\n end: DateTime.now().endOf(\"day\"),\n granularity: AnalyticsGranularity.Hourly,\n metrics: [\"Count\"],\n select: {\n changes: [AnalyticsPath.fromString(`ph/diff/changes`)],\n document: [AnalyticsPath.fromString(`ph/diff/document/${documentId}`)],\n },\n lod: {\n changes: 4,\n },\n },\n {\n sources: [AnalyticsPath.fromString(`ph/diff/${driveId}/${documentId}`)],\n select: metricsToItems,\n },\n );\n};\n","import { useDocumentById } from \"../../hooks/document-by-id.js\";\nimport { useTimelineItems } from \"./timeline-items.js\";\n\nexport function useDocumentTimeline(documentId?: string) {\n const [document] = useDocumentById(documentId);\n\n const id = document?.header.id;\n const createdAt = document?.header.createdAtUtcIso;\n const timelineItems = useTimelineItems(id, createdAt);\n\n return timelineItems.data || [];\n}\n"],"mappings":";;;;;;;;;AAgBgB,YAAY;CAAC;CAAmB;CAAa;CAAW,CAAC;AAEzE,MAAM,qBAAqB,IAAI,aAAa;AAE5C,MAAa,sBAAsB,CAAC,aAAa,UAAU;AAC3D,MAAa,oBAAoB,CAAC,aAAa,QAAQ;AACvD,MAAa,qBAAqB,CAAC,aAAa,SAAS;AAEzD,SAAgB,2BAA2B;AACzC,QAAO,SAAyC,EAC9C,UAAU,qBACX,CAAC,CAAC;;AAGL,SAAgB,wBAAwB,SAA8B;CACpE,MAAM,cAAc,gBAAgB;AACpC,iBAAgB;AACd,cAAY,iBAAiB,qBAAqB;GAChD,eAAe;GACf,WAAW;GACX,QAAQ;GACT,CAAC;IACD,CAAC,aAAa,QAAQ,CAAC;AAE1B,QAAO,YAAY,EACjB,YAAY,YAAY;EACtB,MAAM,QAAQ,mBAAmB;AACjC,cAAY,iBAAiB,mBAAmB;GAC9C,eAAe;GACf,WAAW;GACX,QAAQ;GACT,CAAC;AACF,SAAO;IAEV,CAAC;;AAGJ,SAAgB,uBAAuB,SAA8B;AACnE,QAAO,iBAAiB;E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SAAgB,oBAAoB,YAAqB;CACvD,MAAM,CAAC,YAAY,gBAAgB,WAAW;CAE9C,MAAM,KAAK,UAAU,OAAO;CAC5B,MAAM,YAAY,UAAU,OAAO;AAGnC,QAFsB,iBAAiB,IAAI,UAAU,CAEhC,QAAQ,EAAE"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/analytics/context.tsx","../../../src/analytics/hooks/analytics-query.ts","../../../src/analytics/hooks/timeline-items.ts","../../../src/analytics/hooks/document-timeline.ts"],"sourcesContent":["import type { AnalyticsQueryEngine } from \"@powerhousedao/analytics-engine-core\";\nimport {\n QueryClient,\n QueryClientProvider,\n useMutation,\n useQuery,\n useQueryClient,\n useSuspenseQuery,\n} from \"@tanstack/react-query\";\nimport { childLogger } from \"document-model\";\nimport type { PropsWithChildren } from \"react\";\nimport { useEffect } from \"react\";\nimport { getGlobal } from \"../global/core.js\";\nimport type { CreateStoreOptions } from \"./store.js\";\nimport { getAnalyticsStore } from \"./store.js\";\n\nconst _logger = childLogger([\"reactor-browser\", \"analytics\", \"provider\"]);\n\nconst defaultQueryClient = new QueryClient();\n\nexport const analyticsOptionsKey = [\"analytics\", \"options\"] as const;\nexport const analyticsStoreKey = [\"analytics\", \"store\"] as const;\nexport const analyticsEngineKey = [\"analytics\", \"engine\"] as const;\n\nexport function useAnalyticsStoreOptions() {\n return useQuery<CreateStoreOptions | undefined>({\n queryKey: analyticsOptionsKey,\n }).data;\n}\n\nexport function useCreateAnalyticsStore(options?: CreateStoreOptions) {\n const queryClient = useQueryClient();\n useEffect(() => {\n queryClient.setQueryDefaults(analyticsOptionsKey, {\n queryFn: () => options,\n staleTime: Infinity,\n gcTime: Infinity,\n });\n }, [queryClient, options]);\n\n return useMutation({\n mutationFn: async () => {\n const store = getAnalyticsStore();\n queryClient.setQueryDefaults(analyticsStoreKey, {\n queryFn: () => store,\n staleTime: Infinity,\n gcTime: Infinity,\n });\n return store;\n },\n });\n}\n\nexport function useAnalyticsStoreQuery(options?: CreateStoreOptions) {\n return useSuspenseQuery({\n queryKey: [analyticsStoreKey, options],\n queryFn: () => getAnalyticsStore(),\n retry: true,\n });\n}\n\nexport function useAnalyticsStore(options?: CreateStoreOptions) {\n const store = useAnalyticsStoreQuery(options);\n return store.data;\n}\n\nexport function useAnalyticsStoreAsync(options?: CreateStoreOptions) {\n return useQuery({\n queryKey: [analyticsStoreKey, options],\n queryFn: () => getAnalyticsStore(),\n retry: true,\n throwOnError: false,\n });\n}\n\ninterface BaseAnalyticsProviderProps extends PropsWithChildren {\n /**\n * Custom QueryClient instance\n * @default undefined\n */\n queryClient?: QueryClient;\n}\n\ntype AnalyticsProviderProps = BaseAnalyticsProviderProps &\n (\n | {\n options?: CreateStoreOptions;\n }\n | {\n databaseName?: string;\n }\n );\n\nfunction CreateAnalyticsStore() {\n const { mutate } = useCreateAnalyticsStore();\n\n useEffect(() => {\n mutate();\n }, []);\n\n return null;\n}\n\nexport function AnalyticsProvider({\n children,\n queryClient = defaultQueryClient,\n ..._props\n}: AnalyticsProviderProps) {\n return (\n <QueryClientProvider client={queryClient}>\n <CreateAnalyticsStore />\n {children}\n </QueryClientProvider>\n );\n}\n\nexport function useAnalyticsEngine(): AnalyticsQueryEngine | undefined {\n return useSuspenseQuery({\n queryKey: analyticsEngineKey,\n queryFn: async () => {\n const globalAnalytics = getGlobal(\"analytics\");\n if (!globalAnalytics) {\n throw new Error(\"No analytics store available\");\n }\n return (await globalAnalytics).engine;\n },\n retry: false,\n }).data;\n}\n\nexport function useAnalyticsEngineAsync() {\n return useQuery({\n queryKey: analyticsEngineKey,\n queryFn: async () => {\n const globalAnalytics = getGlobal(\"analytics\");\n if (!globalAnalytics) {\n throw new Error(\"No analytics store available\");\n }\n return (await globalAnalytics).engine;\n },\n retry: false,\n });\n}\n","import type {\n AnalyticsQuery,\n AnalyticsQueryEngine,\n AnalyticsSeries,\n AnalyticsSeriesInput,\n AnalyticsSeriesQuery,\n GroupedPeriodResults,\n IAnalyticsStore,\n} from \"@powerhousedao/analytics-engine-core\";\nimport { AnalyticsPath } from \"@powerhousedao/analytics-engine-core\";\nimport type {\n UseMutationOptions,\n UseQueryOptions,\n UseQueryResult,\n} from \"@tanstack/react-query\";\nimport { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport { useEffect } from \"react\";\nimport {\n useAnalyticsEngineAsync,\n useAnalyticsStoreAsync,\n useAnalyticsStoreOptions,\n} from \"../context.js\";\nimport { getAnalyticsStore } from \"../store.js\";\n\nfunction useAnalyticsQueryWrapper<TQueryFnData = unknown, TData = TQueryFnData>(\n options: Omit<UseQueryOptions<TQueryFnData, Error, TData>, \"queryFn\"> & {\n queryFn: (analytics: {\n store: IAnalyticsStore;\n engine: AnalyticsQueryEngine;\n }) => Promise<TQueryFnData> | TQueryFnData;\n },\n) {\n const { queryFn, ...queryOptions } = options;\n const { data: store } = useAnalyticsStoreAsync();\n const { data: engine } = useAnalyticsEngineAsync();\n const enabled =\n \"enabled\" in queryOptions ? queryOptions.enabled : !!store && !!engine;\n\n return useQuery({\n ...queryOptions,\n enabled,\n queryFn: async () => {\n if (!store || !engine) {\n throw new Error(\n \"No analytics store available. Use within an AnalyticsProvider.\",\n );\n }\n return await queryFn({ store, engine });\n },\n });\n}\n\nfunction useAnalyticsMutationWrapper<TVariables, TData>(\n options: Omit<UseMutationOptions<TData, Error, TVariables>, \"mutationFn\"> & {\n mutationFn: (\n variables: TVariables,\n context: {\n store: IAnalyticsStore;\n },\n ) => Promise<TData> | TData;\n },\n) {\n const { mutationFn, ...mutationOptions } = options;\n const _storeOptions = useAnalyticsStoreOptions();\n\n return useMutation({\n ...mutationOptions,\n mutationFn: async (value: TVariables) => {\n let store: IAnalyticsStore | null = null;\n try {\n store = await getAnalyticsStore();\n } catch (e) {\n console.error(e);\n }\n\n if (!store) {\n throw new Error(\n \"No analytics store available. Use within an AnalyticsProvider.\",\n );\n }\n return await mutationFn(value, { store });\n },\n });\n}\n\nexport type UseAnalyticsQueryOptions<TData = GroupedPeriodResults> = Omit<\n UseQueryOptions<GroupedPeriodResults, Error, TData>,\n \"queryKey\" | \"queryFn\"\n> & {\n sources?: AnalyticsPath[];\n};\n\nexport type UseAnalyticsQueryResult<TData = GroupedPeriodResults> =\n UseQueryResult<TData>;\n\nconst DEBOUNCE_INTERVAL = 200;\n\nexport function useAnalyticsQuery<TData = GroupedPeriodResults>(\n query: AnalyticsQuery,\n options?: UseAnalyticsQueryOptions<TData>,\n): UseAnalyticsQueryResult<TData> {\n const { data: store } = useAnalyticsStoreAsync();\n const queryClient = useQueryClient();\n const sources = options?.sources ?? [];\n\n const result = useAnalyticsQueryWrapper({\n queryKey: [\"analytics\", \"query\", query],\n queryFn: ({ engine }) => engine.execute(query),\n ...options,\n });\n\n useEffect(() => {\n if (!sources.length || !store) {\n return;\n }\n\n const subscriptions = new Array<() => void>();\n // Debounce invalidateQueries so it's not called too frequently\n let invalidateTimeout: ReturnType<typeof setTimeout> | null = null;\n const debouncedInvalidate = () => {\n if (invalidateTimeout) clearTimeout(invalidateTimeout);\n invalidateTimeout = setTimeout(() => {\n queryClient\n .invalidateQueries({\n queryKey: [\"analytics\", \"query\", query],\n })\n .catch((e) => {\n console.error(e);\n });\n }, DEBOUNCE_INTERVAL);\n };\n\n sources.forEach((path) => {\n const unsub = store.subscribeToSource(path, debouncedInvalidate);\n subscriptions.push(unsub);\n });\n\n // Unsubscribes from store when component unmounts or dependencies change\n return () => {\n subscriptions.forEach((unsub) => unsub());\n };\n }, [query, store, sources]);\n\n return result;\n}\n\nexport type UseAnalyticsSeriesOptions = Omit<\n UseQueryOptions<AnalyticsSeries[], Error, AnalyticsSeries[]>,\n \"queryKey\" | \"queryFn\"\n>;\n\nexport function useAnalyticsSeries(\n query: AnalyticsSeriesQuery,\n options?: UseAnalyticsSeriesOptions,\n) {\n return useAnalyticsQueryWrapper({\n queryKey: [\"analytics\", \"series\", query],\n queryFn: ({ store }) => store.getMatchingSeries(query),\n ...options,\n });\n}\n\nexport type UseAddSeriesValueOptions = Omit<\n UseMutationOptions<void, Error, AnalyticsSeriesInput>,\n \"mutationKey\" | \"mutationFn\"\n>;\n\nexport function useAddSeriesValue(options?: UseAddSeriesValueOptions) {\n return useAnalyticsMutationWrapper({\n mutationKey: [\"analytics\", \"addSeries\"],\n mutationFn: async (value, { store }) => {\n return await store.addSeriesValue(value);\n },\n ...options,\n });\n}\n\nexport type UseClearSeriesBySourceOptions = Omit<\n UseMutationOptions<\n number,\n Error,\n { source: AnalyticsPath; cleanUpDimensions?: boolean }\n >,\n \"mutationKey\" | \"mutationFn\"\n>;\n\nexport function useClearSeriesBySource(\n options?: UseClearSeriesBySourceOptions,\n) {\n return useAnalyticsMutationWrapper({\n mutationKey: [\"analytics\", \"clearSeries\"],\n mutationFn: async ({ source, cleanUpDimensions }, { store }) => {\n return store.clearSeriesBySource(source, cleanUpDimensions);\n },\n ...options,\n });\n}\n\nexport type UseClearEmptyAnalyticsDimensionsOptions = Omit<\n UseMutationOptions<number>,\n \"mutationKey\" | \"mutationFn\"\n>;\n\nexport function useClearEmptyAnalyticsDimensions(\n options?: UseClearEmptyAnalyticsDimensionsOptions,\n) {\n return useAnalyticsMutationWrapper({\n mutationKey: [\"analytics\", \"clearEmptyDimensions\"],\n mutationFn: async (_, { store }) => {\n return store.clearEmptyAnalyticsDimensions();\n },\n ...options,\n });\n}\n\nexport type UseAddSeriesValuesOptions = Omit<\n UseMutationOptions<void, Error, AnalyticsSeriesInput[]>,\n \"mutationKey\" | \"mutationFn\"\n>;\n\nexport function useAddSeriesValues(options?: UseAddSeriesValuesOptions) {\n return useAnalyticsMutationWrapper({\n mutationKey: [\"analytics\", \"addSeriesValues\"],\n mutationFn: async (values, { store }) => {\n return store.addSeriesValues(values);\n },\n ...options,\n });\n}\n\nexport type UseGetDimensionsOptions<TData> = Omit<\n UseQueryOptions<any, Error, TData>,\n \"queryKey\" | \"queryFn\"\n>;\n\nexport function useGetDimensions<TData = any>(\n options?: UseGetDimensionsOptions<TData>,\n) {\n return useAnalyticsQueryWrapper({\n queryKey: [\"analytics\", \"dimensions\"],\n queryFn: ({ store }) => store.getDimensions(),\n ...options,\n });\n}\n\nexport type UseMatchingSeriesOptions = Omit<\n UseQueryOptions<AnalyticsSeries[], Error, AnalyticsSeries[]>,\n \"queryKey\" | \"queryFn\"\n>;\n\nexport function useMatchingSeries(\n query: AnalyticsSeriesQuery,\n options?: UseMatchingSeriesOptions,\n) {\n const result = useAnalyticsQueryWrapper({\n queryKey: [\"analytics\", \"matchingSeries\", query],\n queryFn: ({ store }) => store.getMatchingSeries(query),\n ...options,\n });\n\n return result;\n}\n\nexport type UseQuerySourcesOptions = Omit<\n UseQueryOptions<AnalyticsPath[] | undefined>,\n \"queryKey\" | \"queryFn\"\n>;\n\nexport function useQuerySources(\n query: AnalyticsSeriesQuery,\n options?: UseQuerySourcesOptions,\n) {\n const { data: matchingSeries } = useMatchingSeries(query);\n\n return useQuery({\n queryKey: [\"analytics\", \"sources\", query],\n queryFn: () => {\n if (!matchingSeries?.length) {\n return [];\n }\n const uniqueSources = [\n ...new Set(matchingSeries.map((s) => s.source.toString())),\n ];\n return uniqueSources.map((source) => AnalyticsPath.fromString(source));\n },\n enabled: !!matchingSeries,\n ...options,\n });\n}\n","import type { GroupedPeriodResults } from \"@powerhousedao/analytics-engine-core\";\nimport {\n AnalyticsGranularity,\n AnalyticsPath,\n} from \"@powerhousedao/analytics-engine-core\";\nimport { DateTime } from \"luxon\";\nimport type { UseAnalyticsQueryResult } from \"./analytics-query.js\";\nimport { useAnalyticsQuery } from \"./analytics-query.js\";\n\nconst getBarSize = (value: number) => {\n if (value <= 0) return 0;\n if (value > 0 && value <= 50) return 1;\n if (value > 50 && value <= 100) return 2;\n if (value > 100 && value <= 250) return 3;\n return 4;\n};\n\n// Define types for our timeline items\ntype BarItem = {\n id: string;\n type: \"bar\";\n addSize: 0 | 1 | 2 | 3 | 4;\n delSize: 0 | 1 | 2 | 3 | 4;\n additions: number;\n deletions: number;\n timestampUtcMs: string;\n startDate: Date;\n endDate: Date;\n revision?: number;\n};\n\ntype DividerItem = {\n id: string;\n type: \"divider\";\n revision?: number;\n startDate?: Date;\n endDate?: Date;\n};\n\ntype TimelineItem = BarItem | DividerItem;\n\nfunction addItemsDividers(items: BarItem[]): TimelineItem[] {\n if (!items.length) return [];\n\n const result: TimelineItem[] = [];\n items.forEach((item, index) => {\n result.push(item);\n\n // Check if there's a next item and if they're not in consecutive hours\n if (index < items.length - 1) {\n const currentDate = new Date(item.startDate);\n const nextDate = new Date(items[index + 1].startDate);\n\n const currentHour = currentDate.getHours();\n const nextHour = nextDate.getHours();\n\n // Get day parts (without time) for comparison\n const currentDay = currentDate.toDateString();\n const nextDay = nextDate.toDateString();\n\n // If different days or non-consecutive hours on the same day\n if (\n currentDay !== nextDay ||\n (currentDay === nextDay && Math.abs(nextHour - currentHour) > 1)\n ) {\n result.push({\n id: `divider-${item.id}-${items[index + 1].id}`,\n type: \"divider\" as const,\n revision: 0,\n });\n }\n }\n });\n\n return result;\n}\n\nfunction metricsToItems(metrics: GroupedPeriodResults): TimelineItem[] {\n if (!metrics) return [];\n\n const items = metrics\n .sort((a, b) => {\n const aDate = new Date(a.start as unknown as Date);\n const bDate = new Date(b.start as unknown as Date);\n return aDate.getTime() - bDate.getTime();\n })\n .filter((result) => {\n return result.rows.every((row) => row.value > 0);\n })\n .map((result) => {\n const { additions, deletions } = result.rows.reduce(\n (acc, row) => {\n if (\n (row.dimensions.changes.path as unknown as string) ===\n \"ph/diff/changes/add\"\n ) {\n acc.additions += row.value;\n } else if (\n (row.dimensions.changes.path as unknown as string) ===\n \"ph/diff/changes/remove\"\n ) {\n acc.deletions += row.value;\n }\n return acc;\n },\n { additions: 0, deletions: 0 },\n );\n\n const startDate = new Date(result.start as unknown as Date);\n\n return {\n id: startDate.toISOString(),\n type: \"bar\" as const,\n addSize: getBarSize(additions),\n delSize: getBarSize(deletions),\n additions,\n deletions,\n timestampUtcMs: startDate.toISOString(),\n startDate: startDate,\n endDate: new Date(result.end as unknown as Date),\n revision: 0,\n } as const;\n });\n\n return addItemsDividers(items);\n}\n\nexport type UseTimelineItemsResult = UseAnalyticsQueryResult<TimelineItem[]>;\n\nexport const useTimelineItems = (\n documentId?: string,\n startTimestamp?: string,\n driveId?: string,\n): UseTimelineItemsResult => {\n const start = startTimestamp\n ? DateTime.fromISO(startTimestamp)\n : DateTime.now().startOf(\"day\");\n\n return useAnalyticsQuery<TimelineItem[]>(\n {\n start,\n end: DateTime.now().endOf(\"day\"),\n granularity: AnalyticsGranularity.Hourly,\n metrics: [\"Count\"],\n select: {\n changes: [AnalyticsPath.fromString(`ph/diff/changes`)],\n document: [AnalyticsPath.fromString(`ph/diff/document/${documentId}`)],\n },\n lod: {\n changes: 4,\n },\n },\n {\n sources: [AnalyticsPath.fromString(`ph/diff/${driveId}/${documentId}`)],\n select: metricsToItems,\n },\n );\n};\n","import { useDocumentById } from \"../../hooks/document-by-id.js\";\nimport { useTimelineItems } from \"./timeline-items.js\";\n\nexport function useDocumentTimeline(documentId?: string) {\n const [document] = useDocumentById(documentId);\n\n const id = document?.header.id;\n const createdAt = document?.header.createdAtUtcIso;\n const timelineItems = useTimelineItems(id, createdAt);\n\n return timelineItems.data || [];\n}\n"],"mappings":";;;;;;;;;AAgBgB,YAAY;CAAC;CAAmB;CAAa;AAAU,CAAC;AAExE,MAAM,qBAAqB,IAAI,YAAY;AAE3C,MAAa,sBAAsB,CAAC,aAAa,SAAS;AAC1D,MAAa,oBAAoB,CAAC,aAAa,OAAO;AACtD,MAAa,qBAAqB,CAAC,aAAa,QAAQ;AAExD,SAAgB,2BAA2B;CACzC,OAAO,SAAyC,EAC9C,UAAU,oBACZ,CAAC,CAAC,CAAC;AACL;AAEA,SAAgB,wBAAwB,SAA8B;CACpE,MAAM,cAAc,eAAe;CACnC,gBAAgB;EACd,YAAY,iBAAiB,qBAAqB;GAChD,eAAe;GACf,WAAW;GACX,QAAQ;EACV,CAAC;CACH,GAAG,CAAC,aAAa,OAAO,CAAC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BACX,YACA,gBACA,YAC2B;CAK3B,OAAO,kBACL;EACE,OANU,iBACV,SAAS,QAAQ,cAAc,IAC/B,SAAS,IAAI,CAAC,CAAC,QAAQ,KAAK;EAK5B,KAAK,SAAS,IAAI,CAAC,CAAC,MAAM,KAAK;EAC/B,aAAa,qBAAqB;EAClC,SAAS,CAAC,OAAO;EACjB,QAAQ;GACN,SAAS,CAAC,cAAc,WAAW,iBAAiB,CAAC;GACrD,UAAU,CAAC,cAAc,WAAW,oBAAoB,YAAY,CAAC;EACvE;EACA,KAAK,EACH,SAAS,EACX;CACF,GACA;EACE,SAAS,CAAC,cAAc,WAAW,WAAW,QAAQ,GAAG,YAAY,CAAC;EACtE,QAAQ;CACV,CACF;AACF;;;AC1JA,SAAgB,oBAAoB,YAAqB;CACvD,MAAM,CAAC,YAAY,gBAAgB,UAAU;CAE7C,MAAM,KAAK,UAAU,OAAO;CAC5B,MAAM,YAAY,UAAU,OAAO;CAGnC,OAFsB,iBAAiB,IAAI,SAExB,CAAC,CAAC,QAAQ,CAAC;AAChC"}
@@ -1,8 +1,7 @@
1
1
  import { DocumentModelModule } from "@powerhousedao/shared/document-model";
2
-
3
2
  //#region src/document-model.d.ts
4
- declare const baseDocumentModelsMap: Record<string, DocumentModelModule>;
5
- declare const baseDocumentModels: DocumentModelModule[];
3
+ export declare const baseDocumentModelsMap: Record<string, DocumentModelModule>;
4
+ export declare const baseDocumentModels: DocumentModelModule[];
6
5
  //#endregion
7
- export { baseDocumentModels, baseDocumentModelsMap };
6
+ export {};
8
7
  //# sourceMappingURL=document-model.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"document-model.d.ts","names":[],"sources":["../../src/document-model.ts"],"mappings":";;;cAKa,qBAAA,EAAuB,MAAA,SAAe,mBAAA;AAAA,cAQtC,kBAAA,EAAkB,mBAAA"}
1
+ {"version":3,"file":"document-model.d.ts","names":[],"sources":["../../src/document-model.ts"],"mappings":";;qBAKa,uBAAuB,eAAe;qBAQtC,oBAAkB"}
@@ -1 +1 @@
1
- {"version":3,"file":"document-model.js","names":[],"sources":["../../src/document-model.ts"],"sourcesContent":["import { reactorDriveDocumentModelModule } from \"@powerhousedao/reactor-drive\";\nimport { driveDocumentModelModule } from \"@powerhousedao/shared/document-drive\";\nimport type { DocumentModelModule } from \"@powerhousedao/shared/document-model\";\nimport { documentModelDocumentModelModule } from \"document-model\";\n\nexport const baseDocumentModelsMap: Record<string, DocumentModelModule> = {\n DocumentModel:\n documentModelDocumentModelModule as unknown as DocumentModelModule,\n DocumentDrive: driveDocumentModelModule as unknown as DocumentModelModule,\n ReactorDrive:\n reactorDriveDocumentModelModule as unknown as DocumentModelModule,\n};\n\nexport const baseDocumentModels = Object.values(baseDocumentModelsMap);\n"],"mappings":";;;;AAKA,MAAa,wBAA6D;CACxE,eACE;CACF,eAAe;CACf,cACE;CACH;AAED,MAAa,qBAAqB,OAAO,OAAO,sBAAsB"}
1
+ {"version":3,"file":"document-model.js","names":[],"sources":["../../src/document-model.ts"],"sourcesContent":["import { reactorDriveDocumentModelModule } from \"@powerhousedao/reactor-drive\";\nimport { driveDocumentModelModule } from \"@powerhousedao/shared/document-drive\";\nimport type { DocumentModelModule } from \"@powerhousedao/shared/document-model\";\nimport { documentModelDocumentModelModule } from \"document-model\";\n\nexport const baseDocumentModelsMap: Record<string, DocumentModelModule> = {\n DocumentModel:\n documentModelDocumentModelModule as unknown as DocumentModelModule,\n DocumentDrive: driveDocumentModelModule as unknown as DocumentModelModule,\n ReactorDrive:\n reactorDriveDocumentModelModule as unknown as DocumentModelModule,\n};\n\nexport const baseDocumentModels = Object.values(baseDocumentModelsMap);\n"],"mappings":";;;;AAKA,MAAa,wBAA6D;CACxE,eACE;CACF,eAAe;CACf,cACE;AACJ;AAEA,MAAa,qBAAqB,OAAO,OAAO,qBAAqB"}
@@ -1,3 +1,4 @@
1
- import { c as ReactorGraphQLClient, l as RunDocumentOptions } from "../../types-Dcv1ZLoW.js";
2
- import { t as createClient } from "../../client-BIHN_UyR.js";
3
- export { ReactorGraphQLClient, RunDocumentOptions, createClient };
1
+ import { c as ReactorGraphQLClient, l as RunDocumentOptions } from "../../types-0Fh1tNjy.js";
2
+ import { t as createClient } from "../../client-BnGewICj.js";
3
+ export { type ReactorGraphQLClient, type RunDocumentOptions, createClient };
4
+ export {};
@@ -1,2 +1,2 @@
1
- import { t as createClient } from "../../client-D66jVnot.js";
1
+ import { t as createClient } from "../../client-CXDpILj6.js";
2
2
  export { createClient };
@@ -1,4 +1,5 @@
1
- import { rt as IReactorBrowserClient } from "../../global-OuINvEGT.js";
2
- import { $ as GraphQLReactorClientOptions, A as useGetDocuments, B as resolveDocumentModelModule, C as setDocumentCache, D as useDocuments, E as useDocumentSafe, F as makeAuthConnectionParams, Ft as DocumentCache, G as MutateDocumentWithOperationsResult, H as signStampedAction, I as startDocumentChangesSubscription, It as addPromiseState, J as GraphQLReactorProvider, K as MutateDocumentWithOperationsVariables, L as subscriptionsUrlFromGraphqlUrl, Lt as readPromiseState, M as DocumentChangesEventPayload, N as DocumentChangesSubscriptionOptions, O as useGetDocument, P as isAuthRefusalClose, Q as GraphQLReactorClient, R as StaticPackageManager, T as useDocumentCache, U as stampAction, V as prepareSignedActions, W as MutateDocumentWithOperationsDocument, X as ensurePHEventHandlers, Y as GraphQLReactorProviderProps, Z as useSwitchboardClient, a as useDocumentOperations, at as TypedGraphQLDocument, c as DispatchFn, ct as BearerTokenProvider, dt as GetDocumentQueryFields, et as isGraphQLReactorClient, ft as GetDocumentQueryResult, gt as revisionMapFromRevisionsList, ht as phDocumentFromMutation, i as DocumentOperationsState, it as SubgraphSdkRegistry, j as ConnectionParams, k as useGetDocumentAsync, l as UseDispatchResult, lt as ambientRenownTokenProvider, mt as phDocumentFromGetDocument, nt as GraphQLRequestOptions, o as useDocumentModelModuleById, ot as describeGraphQLDocument, p as setReactorClient, pt as RevisionsListSelection, q as ReactorOperationFieldsFragmentDoc, r as useAttachmentService, rt as SubgraphSdkFactory, s as useDocumentModelModules, st as subgraphUrlFromGraphqlUrl, tt as viewFilterInputFromViewFilter, u as useDispatch, ut as makeAuthMiddleware, v as useReactorClient, w as useDocument, z as packageFromDocumentModels } from "../../attachment-service-D3EhiAJ7.js";
3
- import { k as SdkFunctionWrapper } from "../../types-Dcv1ZLoW.js";
4
- export { BearerTokenProvider, ConnectionParams, type DispatchFn, DocumentCache, DocumentChangesEventPayload, DocumentChangesSubscriptionOptions, type DocumentOperationsState, GetDocumentQueryFields, GetDocumentQueryResult, GraphQLReactorClient, GraphQLReactorClientOptions, GraphQLReactorProvider, GraphQLReactorProviderProps, GraphQLRequestOptions, type IReactorBrowserClient, MutateDocumentWithOperationsDocument, MutateDocumentWithOperationsResult, MutateDocumentWithOperationsVariables, ReactorOperationFieldsFragmentDoc, RevisionsListSelection, SdkFunctionWrapper, StaticPackageManager, SubgraphSdkFactory, SubgraphSdkRegistry, TypedGraphQLDocument, type UseDispatchResult, addPromiseState, ambientRenownTokenProvider, describeGraphQLDocument, ensurePHEventHandlers, isAuthRefusalClose, isGraphQLReactorClient, 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 { ct as IOperationCache, lt as OperationsCacheEntry, rt as IReactorBrowserClient } from "../../global-BuSwbbY0.js";
2
+ import { $ as GraphQLReactorProvider, A as useDocumentCache, B as makeAuthConnectionParams, C as useReactorClient, Ct as RevisionsListSelection, Dt as revisionMapFromRevisionsList, Et as phDocumentFromMutation, F as useGetDocuments, G as resolveDocumentModelModule, H as subscriptionsUrlFromGraphqlUrl, I as ConnectionParams, J as stampAction, Jt as addPromiseState, K as prepareSignedActions, Kt as DocumentCache, L as DocumentChangesEventPayload, M as useDocuments, N as useGetDocument, O as setDocumentCache, P as useGetDocumentAsync, Q as ReactorOperationFieldsFragmentDoc, R as DocumentChangesSubscriptionOptions, St as GetDocumentQueryResult, Tt as phDocumentFromGetDocument, U as StaticPackageManager, V as startDocumentChangesSubscription, W as packageFromDocumentModels, X as MutateDocumentWithOperationsResult, Xt as readPromiseState, Y as MutateDocumentWithOperationsDocument, Yt as isOperationCache, Z as MutateDocumentWithOperationsVariables, _t as GraphQLWrongBackendError, a as DocumentOperationsState, at as GraphQLReactorClientOptions, bt as makeAuthMiddleware, c as useDocumentModelModuleById, ct as viewFilterInputFromViewFilter, d as UseDispatchResult, dt as SubgraphSdkRegistry, et as GraphQLReactorProviderProps, f as useDispatch, ft as TypedGraphQLDocument, gt as GraphQLOperationNotSupportedError, ht as BatchJobFailedError, i as DocumentOperationsResult, it as GraphQLReactorClient, j as useDocumentSafe, k as useDocument, l as useDocumentModelModules, lt as GraphQLRequestOptions, mt as subgraphUrlFromGraphqlUrl, nt as useSwitchboardClient, o as UseDocumentOperationsOptions, ot as findIsServableOverGraphQL, pt as describeGraphQLDocument, q as signStampedAction, qt as IDLE_OPERATIONS_ENTRY, r as useAttachmentService, rt as DriveIdCall, s as useDocumentOperations, st as isGraphQLReactorClient, tt as ensurePHEventHandlers, u as DispatchFn, ut as SubgraphSdkFactory, v as setReactorClient, vt as BearerTokenProvider, wt as isoStringFromDateTime, xt as GetDocumentQueryFields, yt as ambientRenownTokenProvider, z as isAuthRefusalClose } from "../../attachment-service-DG6UkyMv.js";
3
+ import { k as SdkFunctionWrapper } from "../../types-0Fh1tNjy.js";
4
+ export { BatchJobFailedError, BearerTokenProvider, ConnectionParams, type DispatchFn, DocumentCache, DocumentChangesEventPayload, DocumentChangesSubscriptionOptions, type DocumentOperationsResult, type DocumentOperationsState, DriveIdCall, GetDocumentQueryFields, GetDocumentQueryResult, GraphQLOperationNotSupportedError, GraphQLReactorClient, GraphQLReactorClientOptions, GraphQLReactorProvider, GraphQLReactorProviderProps, GraphQLRequestOptions, GraphQLWrongBackendError, IDLE_OPERATIONS_ENTRY, type IOperationCache, type IReactorBrowserClient, MutateDocumentWithOperationsDocument, MutateDocumentWithOperationsResult, MutateDocumentWithOperationsVariables, type OperationsCacheEntry, ReactorOperationFieldsFragmentDoc, RevisionsListSelection, type SdkFunctionWrapper, StaticPackageManager, SubgraphSdkFactory, SubgraphSdkRegistry, TypedGraphQLDocument, type UseDispatchResult, type UseDocumentOperationsOptions, addPromiseState, ambientRenownTokenProvider, describeGraphQLDocument, ensurePHEventHandlers, findIsServableOverGraphQL, isAuthRefusalClose, isGraphQLReactorClient, isOperationCache, isoStringFromDateTime, 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 };
5
+ export {};
@@ -1,4 +1,4 @@
1
- import { a as setDocumentCache, c as useDocumentSafe, d as useGetDocumentAsync, f as useGetDocuments, h as readPromiseState, l as useDocuments, m as addPromiseState, o as useDocument, p as DocumentCache, r as useDispatch, s as useDocumentCache, u as useGetDocument } from "../../document-by-id-B4FIzG1w.js";
2
- import { K as ambientRenownTokenProvider, n as useDocumentModelModules, q as makeAuthMiddleware, t as useDocumentModelModuleById } from "../../document-model-modules-bTP87nyr.js";
3
- import { $r as isAuthRefusalClose, J as useAttachmentService, Qr as viewFilterInputFromViewFilter, Xr as GraphQLReactorClient, Zr as isGraphQLReactorClient, ai as subgraphUrlFromGraphqlUrl, ci as resolveDocumentModelModule, di as stampAction, ei as makeAuthConnectionParams, fi as MutateDocumentWithOperationsDocument, gi as revisionMapFromRevisionsList, hi as phDocumentFromMutation, i as useSwitchboardClient, ii as describeGraphQLDocument, k as useReactorClient, li as prepareSignedActions, mi as phDocumentFromGetDocument, n as GraphQLReactorProvider, ni as subscriptionsUrlFromGraphqlUrl, oi as StaticPackageManager, pi as ReactorOperationFieldsFragmentDoc, r as ensurePHEventHandlers, ri as SubgraphSdkRegistry, si as packageFromDocumentModels, t as useDocumentOperations, ti as startDocumentChangesSubscription, ui as signStampedAction, w as setReactorClient } from "../../document-operations-WeE6wIDt.js";
4
- export { DocumentCache, GraphQLReactorClient, GraphQLReactorProvider, MutateDocumentWithOperationsDocument, ReactorOperationFieldsFragmentDoc, StaticPackageManager, SubgraphSdkRegistry, addPromiseState, ambientRenownTokenProvider, describeGraphQLDocument, ensurePHEventHandlers, isAuthRefusalClose, isGraphQLReactorClient, 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 useDocumentCache, c as useGetDocument, d as DocumentCache, f as IDLE_OPERATIONS_ENTRY, h as readPromiseState, i as useDocument, l as useGetDocumentAsync, m as isOperationCache, o as useDocumentSafe, p as addPromiseState, r as setDocumentCache, s as useDocuments, t as useDispatch, u as useGetDocuments } from "../../dispatch-C1VVTn5S.js";
2
+ import { B as ambientRenownTokenProvider, V as makeAuthMiddleware, n as useDocumentModelModules, t as useDocumentModelModuleById } from "../../document-model-modules-Gsh1Xr7j.js";
3
+ import { $r as prepareSignedActions, Br as findIsServableOverGraphQL, Gr as startDocumentChangesSubscription, Hi as setReactorClient, Hr as viewFilterInputFromViewFilter, Jr as describeGraphQLDocument, Kr as subscriptionsUrlFromGraphqlUrl, L as useAttachmentService, Qr as resolveDocumentModelModule, Ur as isAuthRefusalClose, Vr as isGraphQLReactorClient, Wr as makeAuthConnectionParams, Xr as StaticPackageManager, Yr as subgraphUrlFromGraphqlUrl, Zr as packageFromDocumentModels, ai as GraphQLOperationNotSupportedError, ci as phDocumentFromGetDocument, ei as signStampedAction, i as useSwitchboardClient, ii as BatchJobFailedError, li as phDocumentFromMutation, n as GraphQLReactorProvider, ni as MutateDocumentWithOperationsDocument, oi as GraphQLWrongBackendError, qi as useReactorClient, qr as SubgraphSdkRegistry, r as ensurePHEventHandlers, ri as ReactorOperationFieldsFragmentDoc, si as isoStringFromDateTime, t as useDocumentOperations, ti as stampAction, ui as revisionMapFromRevisionsList, zr as GraphQLReactorClient } from "../../document-operations-BSzcF0mu.js";
4
+ export { BatchJobFailedError, DocumentCache, GraphQLOperationNotSupportedError, GraphQLReactorClient, GraphQLReactorProvider, GraphQLWrongBackendError, IDLE_OPERATIONS_ENTRY, MutateDocumentWithOperationsDocument, ReactorOperationFieldsFragmentDoc, StaticPackageManager, SubgraphSdkRegistry, addPromiseState, ambientRenownTokenProvider, describeGraphQLDocument, ensurePHEventHandlers, findIsServableOverGraphQL, isAuthRefusalClose, isGraphQLReactorClient, isOperationCache, isoStringFromDateTime, 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,10 +1,9 @@
1
- import { n as LiveQueryResults, t as LiveNamespace } from "../../index-BIVDXw3K.js";
1
+ import { n as LiveQueryResults, t as LiveNamespace } from "../../index-rtDmzViP.js";
2
2
  import { CompiledQuery } from "kysely";
3
3
  import { QueryCallbackReturnType as QueryCallbackReturnType$1, useRelationalQueryOptions as useRelationalQueryOptions$1 } from "@powerhousedao/reactor-browser";
4
4
  import { IRelationalDb, IRelationalQueryBuilder, RelationalDbProcessorClass } from "@powerhousedao/shared/processors";
5
-
6
5
  //#region src/relational/hooks/useRelationalDb.d.ts
7
- type RelationalDbWithLive<Schema> = IRelationalDb<Schema> & {
6
+ export type RelationalDbWithLive<Schema> = IRelationalDb<Schema> & {
8
7
  live: LiveNamespace;
9
8
  };
10
9
  interface IRelationalDbState<Schema> {
@@ -12,24 +11,31 @@ interface IRelationalDbState<Schema> {
12
11
  isLoading: boolean;
13
12
  error: Error | null;
14
13
  }
15
- declare const useRelationalDb: <Schema>() => IRelationalDbState<Schema>;
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>;
16
22
  //#endregion
17
23
  //#region src/relational/hooks/useRelationalQuery.d.ts
18
- type QueryCallbackReturnType = {
24
+ export type QueryCallbackReturnType = {
19
25
  sql: string;
20
26
  parameters?: readonly unknown[];
21
27
  };
22
- type useRelationalQueryOptions = {
28
+ export type useRelationalQueryOptions = {
23
29
  hashNamespace?: boolean;
24
30
  };
25
- declare function useRelationalQuery<Schema, T = unknown, TParams = undefined>(ProcessorClass: RelationalDbProcessorClass<Schema>, driveId: string, queryCallback: (db: IRelationalQueryBuilder<Schema>, parameters?: TParams) => QueryCallbackReturnType, parameters?: TParams, _options?: useRelationalQueryOptions): {
31
+ export declare function useRelationalQuery<Schema, T = unknown, TParams = undefined>(ProcessorClass: RelationalDbProcessorClass<Schema>, driveId: string, queryCallback: (db: IRelationalQueryBuilder<Schema>, parameters?: TParams) => QueryCallbackReturnType, parameters?: TParams, _options?: useRelationalQueryOptions): {
26
32
  readonly isLoading: boolean;
27
33
  readonly error: Error | null;
28
34
  readonly result: LiveQueryResults<T> | null;
29
35
  };
30
36
  //#endregion
31
37
  //#region src/relational/utils/createProcessorQuery.d.ts
32
- declare function createProcessorQuery<TSchema>(ProcessorClass: RelationalDbProcessorClass<TSchema>): {
38
+ export declare function createProcessorQuery<TSchema>(ProcessorClass: RelationalDbProcessorClass<TSchema>): {
33
39
  <TQueryBuilder extends (db: IRelationalQueryBuilder<TSchema>) => QueryCallbackReturnType$1>(driveId: string, queryCallback: TQueryBuilder): {
34
40
  isLoading: boolean;
35
41
  error: Error | null;
@@ -42,5 +48,5 @@ declare function createProcessorQuery<TSchema>(ProcessorClass: RelationalDbProce
42
48
  };
43
49
  };
44
50
  //#endregion
45
- export { QueryCallbackReturnType, RelationalDbWithLive, createProcessorQuery, useRelationalDb, useRelationalQuery, useRelationalQueryOptions };
51
+ export {};
46
52
  //# sourceMappingURL=index.d.ts.map
@@ -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":";;;;;;KAUY,oBAAA,WAA+B,aAAA,CAAkB,MAAA;EAC3D,IAAA,EAAM,aAAA;AAAA;AAAA,UAGE,kBAAA;EACR,EAAA,EAAI,oBAAA,CAAqB,MAAA;EACzB,SAAA;EACA,KAAA,EAAO,KAAA;AAAA;AAAA,cAoBI,eAAA,gBAA8B,kBAAA,CAAmB,MAAA;;;KC7BlD,uBAAA;EACV,GAAA;EACA,UAAA;AAAA;AAAA,KAGU,yBAAA;EAEV,aAAA;AAAA;AAAA,iBAwBc,kBAAA,0CAAA,CACd,cAAA,EAAgB,0BAAA,CAA2B,MAAA,GAC3C,OAAA,UACA,aAAA,GACE,EAAA,EAAI,uBAAA,CAAwB,MAAA,GAC5B,UAAA,GAAa,OAAA,KACV,uBAAA,EACL,UAAA,GAAa,OAAA,EACb,QAAA,GAAW,yBAAA;EAAA;;;;;;iBCrBG,oBAAA,SAAA,CACd,cAAA,EAAgB,0BAAA,CAA2B,OAAA;EAAA,wBAKvC,EAAA,EAAI,uBAAA,CAAwB,OAAA,MACzB,yBAAA,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,yBAAA,EAAuB,OAAA,UAEb,aAAA,EACA,aAAA,EAAa,UAAA,EAChB,OAAA,EAAO,OAAA,GACT,2BAAA;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.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-D1RB45sA.js";
1
+ import { n as useRelationalQuery, r as useRelationalDb, t as createProcessorQuery } from "../../relational-DxHuX41f.js";
2
2
  export { createProcessorQuery, useRelationalDb, useRelationalQuery };
@@ -1,2 +1,3 @@
1
- import { A as RENOWN_RETURN_URL_STRIPPED_PARAMS, B as UserIcon, C as CREDENTIAL_SCHEMA_EIP712_TYPE, D as ISSUER_TYPE, E as DOMAIN_TYPE, F as ChevronDownIcon, G as RenownLoginButtonProps, H as RenownUserButtonMenuItem, I as CopyIcon, K as RenownAuthButton, L as DisconnectIcon, M as VERIFIABLE_CREDENTIAL_EIP712_TYPE, N as initConnectCrypto, O as RENOWN_CHAIN_ID, P as initRenownCrypto, Q as useRenown, R as RenownLogo, S as useRenownInitialUser, T as CREDENTIAL_TYPES, U as RenownUserButtonProps, V as RenownUserButton, W as RenownLoginButton, _ as RENOWN_INITIAL_UNKNOWN, a as RenownWalletProviderProps, at as RenownAuthResolution, b as RenownInitialUserProviderProps, c as Renown, ct as useRenownAuthAsync, d as useRenownInit, f as RenownSessionCookieOptions, g as RENOWN_INITIAL_ANONYMOUS, h as useRenownSessionSynced, i as RenownWalletProvider, it as RenownAuthAsync, j as RENOWN_URL, k as RENOWN_NETWORK_ID, l as RenownProps, m as useRenownSessionCookie, n as RenownLoginMethod, nt as openRenown, o as RenownProvider, ot as RenownAuthStatus, p as RenownSessionCookieState, q as RenownAuthButtonProps, r as useRenownLoginMethods, rt as RenownAuth, s as RenownProviderProps, st as useRenownAuth, t as useRenownWalletAdapter, u as RenownInitOptions, v as RenownInitialAuth, w as CREDENTIAL_SUBJECT_TYPE, x as useRenownInitialAuth, y as RenownInitialUserProvider, z as SpinnerIcon } from "../../index-B33TKEqp.js";
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, RenownAuth, RenownAuthAsync, RenownAuthButton, RenownAuthButtonProps, RenownAuthResolution, RenownAuthStatus, RenownInitOptions, RenownInitialAuth, RenownInitialUserProvider, RenownInitialUserProviderProps, RenownLoginButton, RenownLoginButtonProps, RenownLoginMethod, RenownLogo, RenownProps, RenownProvider, RenownProviderProps, RenownSessionCookieOptions, RenownSessionCookieState, RenownUserButton, RenownUserButtonMenuItem, RenownUserButtonProps, RenownWalletProvider, RenownWalletProviderProps, SpinnerIcon, UserIcon, VERIFIABLE_CREDENTIAL_EIP712_TYPE, initConnectCrypto, initRenownCrypto, openRenown, useRenown, useRenownAuth, useRenownAuthAsync, useRenownInit, useRenownInitialAuth, useRenownInitialUser, useRenownLoginMethods, useRenownSessionCookie, useRenownSessionSynced, useRenownWalletAdapter };
1
+ import { A as RENOWN_RETURN_URL_STRIPPED_PARAMS, B as UserIcon, C as CREDENTIAL_SCHEMA_EIP712_TYPE, D as ISSUER_TYPE, E as DOMAIN_TYPE, F as ChevronDownIcon, G as RenownLoginButtonProps, H as RenownUserButtonMenuItem, I as CopyIcon, K as RenownAuthButton, L as DisconnectIcon, M as VERIFIABLE_CREDENTIAL_EIP712_TYPE, N as initConnectCrypto, O as RENOWN_CHAIN_ID, P as initRenownCrypto, Q as useRenown, R as RenownLogo, S as useRenownInitialUser, T as CREDENTIAL_TYPES, U as RenownUserButtonProps, V as RenownUserButton, W as RenownLoginButton, _ as RENOWN_INITIAL_UNKNOWN, a as RenownWalletProviderProps, at as RenownAuthResolution, b as RenownInitialUserProviderProps, c as Renown, ct as useRenownAuthAsync, d as useRenownInit, f as RenownSessionCookieOptions, g as RENOWN_INITIAL_ANONYMOUS, h as useRenownSessionSynced, i as RenownWalletProvider, it as RenownAuthAsync, j as RENOWN_URL, k as RENOWN_NETWORK_ID, l as RenownProps, m as useRenownSessionCookie, n as RenownLoginMethod, nt as openRenown, o as RenownProvider, ot as RenownAuthStatus, p as RenownSessionCookieState, q as RenownAuthButtonProps, r as useRenownLoginMethods, rt as RenownAuth, s as RenownProviderProps, st as useRenownAuth, t as useRenownWalletAdapter, u as RenownInitOptions, v as RenownInitialAuth, w as CREDENTIAL_SUBJECT_TYPE, x as useRenownInitialAuth, y as RenownInitialUserProvider, z as SpinnerIcon } from "../../index-ewIc3pEO.js";
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 };
3
+ export {};
@@ -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-BHxwP7xU.js";
2
- import { A as RENOWN_CHAIN_ID, D as CREDENTIAL_TYPES, E as CREDENTIAL_SUBJECT_TYPE, M as RENOWN_RETURN_URL_STRIPPED_PARAMS, N as RENOWN_URL, O as DOMAIN_TYPE, P as VERIFIABLE_CREDENTIAL_EIP712_TYPE, T as CREDENTIAL_SCHEMA_EIP712_TYPE, _ as RenownLogo, a as Renown, b as useRenownAuth, c as useRenownSessionSynced, d as RenownAuthButton, f as RenownUserButton, g as DisconnectIcon, h as CopyIcon, i as RenownWalletProvider, j as RENOWN_NETWORK_ID, k as ISSUER_TYPE, l as initConnectCrypto, m as ChevronDownIcon, n as useRenownLoginMethods, o as useRenownInit, p as RenownLoginButton, r as RenownProvider, s as useRenownSessionCookie, t as useRenownWalletAdapter, u as initRenownCrypto, v as SpinnerIcon, w as openRenown, x as useRenownAuthAsync, y as UserIcon } from "../../renown-rqK8sokh.js";
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-D05wkobG.js";
2
+ import { A as RENOWN_CHAIN_ID, D as CREDENTIAL_TYPES, E as CREDENTIAL_SUBJECT_TYPE, M as RENOWN_RETURN_URL_STRIPPED_PARAMS, N as RENOWN_URL, O as DOMAIN_TYPE, P as VERIFIABLE_CREDENTIAL_EIP712_TYPE, T as CREDENTIAL_SCHEMA_EIP712_TYPE, _ as RenownLogo, a as Renown, b as useRenownAuth, c as useRenownSessionSynced, d as RenownAuthButton, f as RenownUserButton, g as DisconnectIcon, h as CopyIcon, i as RenownWalletProvider, j as RENOWN_NETWORK_ID, k as ISSUER_TYPE, l as initConnectCrypto, m as ChevronDownIcon, n as useRenownLoginMethods, o as useRenownInit, p as RenownLoginButton, r as RenownProvider, s as useRenownSessionCookie, t as useRenownWalletAdapter, u as initRenownCrypto, v as SpinnerIcon, w as openRenown, x as useRenownAuthAsync, y as UserIcon } from "../../renown-CPAeJt5L.js";
3
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 };