@powerhousedao/reactor-browser 6.2.3-dev.10 → 6.2.3-dev.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{attachment-service-BW1v0OAT.d.ts → attachment-service-DXfpfp98.d.ts} +767 -108
- package/dist/attachment-service-DXfpfp98.d.ts.map +1 -0
- package/dist/auth-DzIYxeEJ.d.ts +32 -0
- package/dist/auth-DzIYxeEJ.d.ts.map +1 -0
- package/dist/client-1n_ZUXeu.js +135 -0
- package/dist/client-1n_ZUXeu.js.map +1 -0
- package/dist/{client-CxJD0Ck2.d.ts → client-BFk0MY6A.d.ts} +4 -3
- package/dist/client-BFk0MY6A.d.ts.map +1 -0
- package/dist/{client-DjK30EQ-.js → client-BFnMV-EO.js} +39 -22
- package/dist/client-BFnMV-EO.js.map +1 -0
- package/dist/dispatch-Cylwl2Dk.js +1173 -0
- package/dist/dispatch-Cylwl2Dk.js.map +1 -0
- package/dist/document-by-id-DdvqanGR.js +16 -0
- package/dist/document-by-id-DdvqanGR.js.map +1 -0
- package/dist/document-model-modules-BG-61uke.js +710 -0
- package/dist/document-model-modules-BG-61uke.js.map +1 -0
- package/dist/document-operations-D5QXcJbV.js +4609 -0
- package/dist/document-operations-D5QXcJbV.js.map +1 -0
- package/dist/global-DAAmZGCO.d.ts +612 -0
- package/dist/global-DAAmZGCO.d.ts.map +1 -0
- package/dist/{index-CBjFO54H.d.ts → index-Bj1poVfa.d.ts} +31 -100
- package/dist/index-Bj1poVfa.d.ts.map +1 -0
- package/dist/{index-BIVDXw3K.d.ts → index-rtDmzViP.d.ts} +3 -3
- package/dist/index-rtDmzViP.d.ts.map +1 -0
- package/dist/index.d.ts +907 -411
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +851 -306
- package/dist/index.js.map +1 -1
- package/dist/inspector-proxy-DODqs15F.d.ts +25 -0
- package/dist/inspector-proxy-DODqs15F.d.ts.map +1 -0
- package/dist/make-ph-event-functions-B5GU5xcR.js +180 -0
- package/dist/make-ph-event-functions-B5GU5xcR.js.map +1 -0
- package/dist/{pglite-CntadC_p-9NDG14dS.d.ts → pglite-CntadC_p-DTkdF8sr.d.ts} +11 -33
- package/dist/pglite-CntadC_p-DTkdF8sr.d.ts.map +1 -0
- package/dist/{relational-D1RB45sA.js → relational-DZuyKp2y.js} +66 -5
- package/dist/relational-DZuyKp2y.js.map +1 -0
- package/dist/{renown-rqK8sokh.js → renown-B3MUaiq7.js} +61 -31
- package/dist/renown-B3MUaiq7.js.map +1 -0
- package/dist/renown-CBoTdGrg.js +394 -0
- package/dist/renown-CBoTdGrg.js.map +1 -0
- package/dist/{types-N3Jy6Nry.d.ts → schema-Bn6L3QR1.d.ts} +255 -65
- package/dist/schema-Bn6L3QR1.d.ts.map +1 -0
- package/dist/{client-D4bkR4pH.js → schema-D0G1oAo9.js} +247 -152
- package/dist/schema-D0G1oAo9.js.map +1 -0
- package/dist/src/ai/index.d.ts +313 -79
- package/dist/src/ai/index.d.ts.map +1 -1
- package/dist/src/ai/index.js +1030 -173
- package/dist/src/ai/index.js.map +1 -1
- package/dist/src/analytics/index.d.ts +36 -44
- package/dist/src/analytics/index.d.ts.map +1 -1
- package/dist/src/analytics/index.js +4 -4
- package/dist/src/analytics/index.js.map +1 -1
- package/dist/src/document-model.d.ts +3 -4
- package/dist/src/document-model.d.ts.map +1 -1
- package/dist/src/document-model.js.map +1 -1
- package/dist/src/graphql/client.d.ts +4 -3
- package/dist/src/graphql/client.js +1 -1
- package/dist/src/graphql-client/entry.d.ts +7 -4
- package/dist/src/graphql-client/entry.js +4 -4
- package/dist/src/relational/index.d.ts +15 -9
- package/dist/src/relational/index.d.ts.map +1 -1
- package/dist/src/relational/index.js +1 -1
- package/dist/src/renown/index.d.ts +3 -2
- package/dist/src/renown/index.js +3 -3
- package/dist/src/rpc/index.d.ts +217 -140
- package/dist/src/rpc/index.d.ts.map +1 -1
- package/dist/src/rpc/index.js +600 -623
- package/dist/src/rpc/index.js.map +1 -1
- package/dist/{store-BJYcr_FL.js → store-DInXcjal.js} +1 -1
- package/dist/{store-BJYcr_FL.js.map → store-DInXcjal.js.map} +1 -1
- package/dist/switchboard-directory-CWf5SRo7.js +435 -0
- package/dist/switchboard-directory-CWf5SRo7.js.map +1 -0
- package/dist/switchboards-D-_JBUbF.d.ts +75 -0
- package/dist/switchboards-D-_JBUbF.d.ts.map +1 -0
- package/dist/{types-6vDzbRRS.d.ts → types-520nWrB3.d.ts} +2 -2
- package/dist/types-520nWrB3.d.ts.map +1 -0
- package/dist/types-CyPDurGV.d.ts +63 -0
- package/dist/types-CyPDurGV.d.ts.map +1 -0
- package/package.json +24 -23
- package/dist/attachment-service-BW1v0OAT.d.ts.map +0 -1
- package/dist/client-CxJD0Ck2.d.ts.map +0 -1
- package/dist/client-D4bkR4pH.js.map +0 -1
- package/dist/client-DjK30EQ-.js.map +0 -1
- package/dist/document-by-id-B4FIzG1w.js +0 -519
- package/dist/document-by-id-B4FIzG1w.js.map +0 -1
- package/dist/document-model-modules-bTP87nyr.js +0 -419
- package/dist/document-model-modules-bTP87nyr.js.map +0 -1
- package/dist/document-operations-Cm4EtaZs.js +0 -2603
- package/dist/document-operations-Cm4EtaZs.js.map +0 -1
- package/dist/global-CgCouXuH.d.ts +0 -401
- package/dist/global-CgCouXuH.d.ts.map +0 -1
- package/dist/index-BIVDXw3K.d.ts.map +0 -1
- package/dist/index-CBjFO54H.d.ts.map +0 -1
- package/dist/inspector-proxy-6h5VKAwt.d.ts +0 -257
- package/dist/inspector-proxy-6h5VKAwt.d.ts.map +0 -1
- package/dist/make-ph-event-functions-DBq3iWYn.js +0 -53
- package/dist/make-ph-event-functions-DBq3iWYn.js.map +0 -1
- package/dist/pglite-CntadC_p-9NDG14dS.d.ts.map +0 -1
- package/dist/relational-D1RB45sA.js.map +0 -1
- package/dist/renown-BHxwP7xU.js +0 -97
- package/dist/renown-BHxwP7xU.js.map +0 -1
- package/dist/renown-rqK8sokh.js.map +0 -1
- package/dist/switchboard-CaXQ4-5Q.js +0 -271
- package/dist/switchboard-CaXQ4-5Q.js.map +0 -1
- package/dist/types-6vDzbRRS.d.ts.map +0 -1
- package/dist/types-N3Jy6Nry.d.ts.map +0 -1
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
import { a as getAnalyticsStore, i as createAnalyticsStore, n as IPowerhouseAnalytics, r as CreateStoreOptions, t as IAnalyticsStoreOptions } from "../../types-
|
|
1
|
+
import { a as getAnalyticsStore, i as createAnalyticsStore, n as IPowerhouseAnalytics, r as CreateStoreOptions, t as IAnalyticsStoreOptions } from "../../types-520nWrB3.js";
|
|
2
2
|
import { PropsWithChildren } from "react";
|
|
3
|
-
import * as _powerhousedao_analytics_engine_browser0 from "@powerhousedao/analytics-engine-browser";
|
|
4
|
-
import * as _powerhousedao_analytics_engine_core0 from "@powerhousedao/analytics-engine-core";
|
|
5
3
|
import { AnalyticsPath, AnalyticsQuery, AnalyticsQueryEngine, AnalyticsSeries, AnalyticsSeriesInput, AnalyticsSeriesQuery, GroupedPeriodResults } from "@powerhousedao/analytics-engine-core";
|
|
6
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
7
|
-
import * as _tanstack_react_query0 from "@tanstack/react-query";
|
|
8
4
|
import { QueryClient, UseMutationOptions, UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
|
|
9
|
-
|
|
10
5
|
//#region src/analytics/context.d.ts
|
|
11
|
-
declare const analyticsOptionsKey: readonly ["analytics", "options"];
|
|
12
|
-
declare const analyticsStoreKey: readonly ["analytics", "store"];
|
|
13
|
-
declare const analyticsEngineKey: readonly ["analytics", "engine"];
|
|
14
|
-
declare function useAnalyticsStoreOptions():
|
|
15
|
-
declare function useCreateAnalyticsStore(options?: CreateStoreOptions):
|
|
16
|
-
declare function useAnalyticsStoreQuery(options?: CreateStoreOptions):
|
|
17
|
-
declare function useAnalyticsStore(options?: CreateStoreOptions):
|
|
18
|
-
declare function useAnalyticsStoreAsync(options?: CreateStoreOptions):
|
|
6
|
+
export declare const analyticsOptionsKey: readonly ["analytics", "options"];
|
|
7
|
+
export declare const analyticsStoreKey: readonly ["analytics", "store"];
|
|
8
|
+
export declare const analyticsEngineKey: readonly ["analytics", "engine"];
|
|
9
|
+
export declare function useAnalyticsStoreOptions(): import("@powerhousedao/analytics-engine-browser").BrowserAnalyticsStoreOptions | undefined;
|
|
10
|
+
export declare function useCreateAnalyticsStore(options?: CreateStoreOptions): import("@tanstack/react-query").UseMutationResult<import("@powerhousedao/analytics-engine-core").IAnalyticsStore | null, Error, void, unknown>;
|
|
11
|
+
export declare function useAnalyticsStoreQuery(options?: CreateStoreOptions): import("@tanstack/react-query").UseSuspenseQueryResult<import("@powerhousedao/analytics-engine-core").IAnalyticsStore | null, Error>;
|
|
12
|
+
export declare function useAnalyticsStore(options?: CreateStoreOptions): import("@powerhousedao/analytics-engine-core").IAnalyticsStore | null;
|
|
13
|
+
export declare function useAnalyticsStoreAsync(options?: CreateStoreOptions): import("@tanstack/react-query").UseQueryResult<import("@powerhousedao/analytics-engine-core").IAnalyticsStore | null, Error>;
|
|
19
14
|
interface BaseAnalyticsProviderProps extends PropsWithChildren {
|
|
20
15
|
/**
|
|
21
16
|
* Custom QueryClient instance
|
|
@@ -28,45 +23,41 @@ type AnalyticsProviderProps = BaseAnalyticsProviderProps & ({
|
|
|
28
23
|
} | {
|
|
29
24
|
databaseName?: string;
|
|
30
25
|
});
|
|
31
|
-
declare function AnalyticsProvider({
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
..._props
|
|
35
|
-
}: AnalyticsProviderProps): react_jsx_runtime0.JSX.Element;
|
|
36
|
-
declare function useAnalyticsEngine(): AnalyticsQueryEngine | undefined;
|
|
37
|
-
declare function useAnalyticsEngineAsync(): _tanstack_react_query0.UseQueryResult<AnalyticsQueryEngine, Error>;
|
|
26
|
+
export declare function AnalyticsProvider({ children, queryClient, ..._props }: AnalyticsProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare function useAnalyticsEngine(): AnalyticsQueryEngine | undefined;
|
|
28
|
+
export declare function useAnalyticsEngineAsync(): import("@tanstack/react-query").UseQueryResult<AnalyticsQueryEngine, Error>;
|
|
38
29
|
//#endregion
|
|
39
30
|
//#region src/analytics/hooks/analytics-query.d.ts
|
|
40
|
-
type UseAnalyticsQueryOptions<TData = GroupedPeriodResults> = Omit<UseQueryOptions<GroupedPeriodResults, Error, TData>, "queryKey" | "queryFn"> & {
|
|
31
|
+
export type UseAnalyticsQueryOptions<TData = GroupedPeriodResults> = Omit<UseQueryOptions<GroupedPeriodResults, Error, TData>, "queryKey" | "queryFn"> & {
|
|
41
32
|
sources?: AnalyticsPath[];
|
|
42
33
|
};
|
|
43
|
-
type UseAnalyticsQueryResult<TData = GroupedPeriodResults> = UseQueryResult<TData>;
|
|
44
|
-
declare function useAnalyticsQuery<TData = GroupedPeriodResults>(query: AnalyticsQuery, options?: UseAnalyticsQueryOptions<TData>): UseAnalyticsQueryResult<TData>;
|
|
45
|
-
type UseAnalyticsSeriesOptions = Omit<UseQueryOptions<AnalyticsSeries[], Error, AnalyticsSeries[]>, "queryKey" | "queryFn">;
|
|
46
|
-
declare function useAnalyticsSeries(query: AnalyticsSeriesQuery, options?: UseAnalyticsSeriesOptions): UseQueryResult<AnalyticsSeries[], Error>;
|
|
47
|
-
type UseAddSeriesValueOptions = Omit<UseMutationOptions<void, Error, AnalyticsSeriesInput>, "mutationKey" | "mutationFn">;
|
|
48
|
-
declare function useAddSeriesValue(options?: UseAddSeriesValueOptions):
|
|
49
|
-
type UseClearSeriesBySourceOptions = Omit<UseMutationOptions<number, Error, {
|
|
34
|
+
export type UseAnalyticsQueryResult<TData = GroupedPeriodResults> = UseQueryResult<TData>;
|
|
35
|
+
export declare function useAnalyticsQuery<TData = GroupedPeriodResults>(query: AnalyticsQuery, options?: UseAnalyticsQueryOptions<TData>): UseAnalyticsQueryResult<TData>;
|
|
36
|
+
export type UseAnalyticsSeriesOptions = Omit<UseQueryOptions<AnalyticsSeries[], Error, AnalyticsSeries[]>, "queryKey" | "queryFn">;
|
|
37
|
+
export declare function useAnalyticsSeries(query: AnalyticsSeriesQuery, options?: UseAnalyticsSeriesOptions): UseQueryResult<AnalyticsSeries[], Error>;
|
|
38
|
+
export type UseAddSeriesValueOptions = Omit<UseMutationOptions<void, Error, AnalyticsSeriesInput>, "mutationKey" | "mutationFn">;
|
|
39
|
+
export declare function useAddSeriesValue(options?: UseAddSeriesValueOptions): import("@tanstack/react-query").UseMutationResult<void, Error, AnalyticsSeriesInput, unknown>;
|
|
40
|
+
export type UseClearSeriesBySourceOptions = Omit<UseMutationOptions<number, Error, {
|
|
50
41
|
source: AnalyticsPath;
|
|
51
42
|
cleanUpDimensions?: boolean;
|
|
52
43
|
}>, "mutationKey" | "mutationFn">;
|
|
53
|
-
declare function useClearSeriesBySource(options?: UseClearSeriesBySourceOptions):
|
|
44
|
+
export declare function useClearSeriesBySource(options?: UseClearSeriesBySourceOptions): import("@tanstack/react-query").UseMutationResult<number, Error, {
|
|
54
45
|
source: AnalyticsPath;
|
|
55
46
|
cleanUpDimensions?: boolean;
|
|
56
47
|
}, unknown>;
|
|
57
|
-
type UseClearEmptyAnalyticsDimensionsOptions = Omit<UseMutationOptions<number>, "mutationKey" | "mutationFn">;
|
|
58
|
-
declare function useClearEmptyAnalyticsDimensions(options?: UseClearEmptyAnalyticsDimensionsOptions):
|
|
59
|
-
type UseAddSeriesValuesOptions = Omit<UseMutationOptions<void, Error, AnalyticsSeriesInput[]>, "mutationKey" | "mutationFn">;
|
|
60
|
-
declare function useAddSeriesValues(options?: UseAddSeriesValuesOptions):
|
|
61
|
-
type UseGetDimensionsOptions<TData> = Omit<UseQueryOptions<any, Error, TData>, "queryKey" | "queryFn">;
|
|
62
|
-
declare function useGetDimensions<TData = any>(options?: UseGetDimensionsOptions<TData>): UseQueryResult<
|
|
63
|
-
type UseMatchingSeriesOptions = Omit<UseQueryOptions<AnalyticsSeries[], Error, AnalyticsSeries[]>, "queryKey" | "queryFn">;
|
|
64
|
-
declare function useMatchingSeries(query: AnalyticsSeriesQuery, options?: UseMatchingSeriesOptions): UseQueryResult<AnalyticsSeries[], Error>;
|
|
65
|
-
type UseQuerySourcesOptions = Omit<UseQueryOptions<AnalyticsPath[] | undefined>, "queryKey" | "queryFn">;
|
|
66
|
-
declare function useQuerySources(query: AnalyticsSeriesQuery, options?: UseQuerySourcesOptions): UseQueryResult<AnalyticsPath[] | undefined, Error>;
|
|
48
|
+
export type UseClearEmptyAnalyticsDimensionsOptions = Omit<UseMutationOptions<number>, "mutationKey" | "mutationFn">;
|
|
49
|
+
export declare function useClearEmptyAnalyticsDimensions(options?: UseClearEmptyAnalyticsDimensionsOptions): import("@tanstack/react-query").UseMutationResult<number, Error, void, unknown>;
|
|
50
|
+
export type UseAddSeriesValuesOptions = Omit<UseMutationOptions<void, Error, AnalyticsSeriesInput[]>, "mutationKey" | "mutationFn">;
|
|
51
|
+
export declare function useAddSeriesValues(options?: UseAddSeriesValuesOptions): import("@tanstack/react-query").UseMutationResult<void, Error, AnalyticsSeriesInput[], unknown>;
|
|
52
|
+
export type UseGetDimensionsOptions<TData> = Omit<UseQueryOptions<any, Error, TData>, "queryKey" | "queryFn">;
|
|
53
|
+
export declare function useGetDimensions<TData = any>(options?: UseGetDimensionsOptions<TData>): UseQueryResult<import("@tanstack/react-query").NoInfer<TData>, Error>;
|
|
54
|
+
export type UseMatchingSeriesOptions = Omit<UseQueryOptions<AnalyticsSeries[], Error, AnalyticsSeries[]>, "queryKey" | "queryFn">;
|
|
55
|
+
export declare function useMatchingSeries(query: AnalyticsSeriesQuery, options?: UseMatchingSeriesOptions): UseQueryResult<AnalyticsSeries[], Error>;
|
|
56
|
+
export type UseQuerySourcesOptions = Omit<UseQueryOptions<AnalyticsPath[] | undefined>, "queryKey" | "queryFn">;
|
|
57
|
+
export declare function useQuerySources(query: AnalyticsSeriesQuery, options?: UseQuerySourcesOptions): UseQueryResult<AnalyticsPath[] | undefined, Error>;
|
|
67
58
|
//#endregion
|
|
68
59
|
//#region src/analytics/hooks/document-timeline.d.ts
|
|
69
|
-
declare function useDocumentTimeline(documentId?: string): ({
|
|
60
|
+
export declare function useDocumentTimeline(documentId?: string): ({
|
|
70
61
|
id: string;
|
|
71
62
|
type: "bar";
|
|
72
63
|
addSize: 0 | 1 | 2 | 3 | 4;
|
|
@@ -106,8 +97,9 @@ type DividerItem = {
|
|
|
106
97
|
endDate?: Date;
|
|
107
98
|
};
|
|
108
99
|
type TimelineItem = BarItem | DividerItem;
|
|
109
|
-
type UseTimelineItemsResult = UseAnalyticsQueryResult<TimelineItem[]>;
|
|
110
|
-
declare const useTimelineItems: (documentId?: string, startTimestamp?: string, driveId?: string) => UseTimelineItemsResult;
|
|
100
|
+
export type UseTimelineItemsResult = UseAnalyticsQueryResult<TimelineItem[]>;
|
|
101
|
+
export declare const useTimelineItems: (documentId?: string, startTimestamp?: string, driveId?: string) => UseTimelineItemsResult;
|
|
111
102
|
//#endregion
|
|
112
|
-
export {
|
|
103
|
+
export { CreateStoreOptions, type IAnalyticsStoreOptions, type IPowerhouseAnalytics, createAnalyticsStore, getAnalyticsStore };
|
|
104
|
+
export {};
|
|
113
105
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/analytics/context.tsx","../../../src/analytics/hooks/analytics-query.ts","../../../src/analytics/hooks/document-timeline.ts","../../../src/analytics/hooks/timeline-items.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/analytics/context.tsx","../../../src/analytics/hooks/analytics-query.ts","../../../src/analytics/hooks/document-timeline.ts","../../../src/analytics/hooks/timeline-items.ts"],"mappings":";;;;;qBAoBa;qBACA;qBACA;wBAEG,8EAAwB;wBAMxB,wBAAwB,UAAU,qDAAkB,iEAAA,wBAAA;wBAuBpD,uBAAuB,UAAU,qDAAkB,sEAAA,wBAAA;wBAQnD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KAGG;EACH;EACA;EACA;EACA,YAAY;EACZ,UAAU;;KAGP,eAAe,UAAU;YAwFlB,yBAAyB,wBAAwB;qBAEhD,mBAAgB,qBACR,yBACI,qBAEtB"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import {
|
|
3
|
-
import { childLogger } from "document-model";
|
|
1
|
+
import { i as getGlobal, n as getAnalyticsStore, t as createAnalyticsStore } from "../../store-DInXcjal.js";
|
|
2
|
+
import { t as useDocumentById } from "../../document-by-id-DdvqanGR.js";
|
|
4
3
|
import { useEffect } from "react";
|
|
5
|
-
import { AnalyticsGranularity, AnalyticsPath } from "@powerhousedao/analytics-engine-core";
|
|
6
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { childLogger } from "document-model";
|
|
6
|
+
import { AnalyticsGranularity, AnalyticsPath } from "@powerhousedao/analytics-engine-core";
|
|
7
7
|
import { QueryClient, QueryClientProvider, useMutation, useQuery, useQueryClient, useSuspenseQuery } from "@tanstack/react-query";
|
|
8
8
|
import { DateTime } from "luxon";
|
|
9
9
|
//#region src/analytics/context.tsx
|
|
@@ -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;EACtB,UAAU,CAAC,mBAAmB,QAAQ;EACtC,eAAe,mBAAmB;EAClC,OAAO;EACR,CAAC;;AAGJ,SAAgB,kBAAkB,SAA8B;AAE9D,QADc,uBAAuB,QAAQ,CAChC;;AAGf,SAAgB,uBAAuB,SAA8B;AACnE,QAAO,SAAS;EACd,UAAU,CAAC,mBAAmB,QAAQ;EACtC,eAAe,mBAAmB;EAClC,OAAO;EACP,cAAc;EACf,CAAC;;AAqBJ,SAAS,uBAAuB;CAC9B,MAAM,EAAE,WAAW,yBAAyB;AAE5C,iBAAgB;AACd,UAAQ;IACP,EAAE,CAAC;AAEN,QAAO;;AAGT,SAAgB,kBAAkB,EAChC,UACA,cAAc,oBACd,GAAG,UACsB;AACzB,QACE,qBAAC,qBAAD;EAAq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;KAET;GAAE,WAAW;GAAG,WAAW;GAAG,CAC/B;EAED,MAAM,YAAY,IAAI,KAAK,OAAO,MAAyB;AAE3D,SAAO;GACL,IAAI,UAAU,aAAa;GAC3B,MAAM;GACN,SAAS,WAAW,UAAU;GAC9B,SAAS,WAAW,UAAU;GAC9B;GACA;GACA,gBAAgB,UAAU,aAAa;GAC5B;GACX,SAAS,IAAI,KAAK,OAAO,IAAuB;GAChD,UAAU;GACX;GACD,CAE0B;;AAKhC,MAAa,oBACX,YACA,gBACA,YAC2B;AAK3B,QAAO,kBACL;EACE,OANU,iBACV,SAAS,QAAQ,eAAe,GAChC,SAAS,KAAK,CAAC,QAAQ,MAAM;EAK7B,KAAK,SAAS,KAAK,CAAC,MAAM,MAAM;EAChC,aAAa,qBAAqB;EAClC,SAAS,CAAC,QAAQ;EAClB,QAAQ;GACN,SAAS,CAAC,cAAc,WAAW,kBAAkB,CAAC;GACtD,UAAU,CAAC,cAAc,WAAW,oBAAoB,aAAa,CAAC;GACvE;EACD,KAAK,EACH,SAAS,GACV;EACF,EACD;EACE,SAAS,CAAC,cAAc,WAAW,WAAW,QAAQ,GAAG,aAAa,CAAC;EACvE,QAAQ;EACT,CACF;;;;ACzJH,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;CAEzB,OAAO,YAAY,EACjB,YAAY,YAAY;EACtB,MAAM,QAAQ,kBAAkB;EAChC,YAAY,iBAAiB,mBAAmB;GAC9C,eAAe;GACf,WAAW;GACX,QAAQ;EACV,CAAC;EACD,OAAO;CACT,EACF,CAAC;AACH;AAEA,SAAgB,uBAAuB,SAA8B;CACnE,OAAO,iBAAiB;EACtB,UAAU,CAAC,mBAAmB,OAAO;EACrC,eAAe,kBAAkB;EACjC,OAAO;CACT,CAAC;AACH;AAEA,SAAgB,kBAAkB,SAA8B;CAE9D,OADc,uBAAuB,OAC1B,CAAC,CAAC;AACf;AAEA,SAAgB,uBAAuB,SAA8B;CACnE,OAAO,SAAS;EACd,UAAU,CAAC,mBAAmB,OAAO;EACrC,eAAe,kBA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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 {
|
|
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":"
|
|
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;
|
|
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-
|
|
2
|
-
import { t as createClient } from "../../client-
|
|
3
|
-
export { ReactorGraphQLClient, RunDocumentOptions, createClient };
|
|
1
|
+
import { c as ReactorGraphQLClient, l as RunDocumentOptions } from "../../types-CyPDurGV.js";
|
|
2
|
+
import { t as createClient } from "../../client-BFk0MY6A.js";
|
|
3
|
+
export { type ReactorGraphQLClient, type RunDocumentOptions, createClient };
|
|
4
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createClient } from "../../client-
|
|
1
|
+
import { t as createClient } from "../../client-1n_ZUXeu.js";
|
|
2
2
|
export { createClient };
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { rt as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { $ as createJobChangesSocket, $t as GetDocumentQueryFields, At as GraphQLRequestOptions, B as DEFAULT_BREAKER, Bt as switchboardFetch, Ct as GraphQLReactorClientOptions, Dn as IDLE_OPERATIONS_ENTRY, Dt as findIsServableOverGraphQL, Et as createGraphQLDriveNodeSource, F as useDocuments, Ft as subgraphUrlFromGraphqlUrl, G as SwitchboardUnreachableError, Gt as GraphQLWrongBackendError, H as SwitchboardBackend, Ht as withStreamedBodies, I as useGetDocument, It as GraphQLFetch, J as DocumentChangesEventPayload, Jt as queriesUnknownField, K as createSwitchboardBackend, Kt as JobFailedError, L as useGetDocumentAsync, Lt as globalFetch, M as useDocument, Mn as readPromiseState, Mt as SubgraphSdkRegistry, N as useDocumentCache, Nt as TypedGraphQLDocument, Ot as isGraphQLReactorClient, P as useDocumentSafe, Pt as describeGraphQLDocument, Q as JobChangesSocketOptions, Qt as toLegacyNode, R as useGetDocuments, Rt as isDeadlineError, St as GraphQLReactorClient, T as useReactorClient, Tt as ambientRenownSigner, U as SwitchboardBackendDescriptor, Ut as BatchJobFailedError, V as DEFAULT_REQUEST_TIMEOUT_MS, Vt as withRequestDeadline, W as SwitchboardBreaker, Wt as GraphQLOperationNotSupportedError, X as IJobChangesSocket, Xt as GraphQLDriveNodeSource, Y as DocumentChangesSubscriptionOptions, Yt as DriveNodeQueries, Z as JobChangesEventPayload, Zt as GraphQLDriveReadClient, _t as GraphQLReactorProvider, a as DocumentOperationsState, an as revisionMapFromRevisionsList, at as packageFromDocumentModels, b as setReactorClient, bt as useSwitchboardClient, c as useDocumentModelModuleById, ct as signStampedAction, d as UseDispatchResult, dt as GetDocumentAtConsistencyResult, en as GetDocumentQueryResult, et as isAuthRefusalClose, ft as GetDocumentAtConsistencyVariables, gt as ReactorOperationFieldsFragmentDoc, ht as MutateDocumentWithOperationsVariables, i as DocumentOperationsResult, in as phDocumentFromMutation, it as StaticPackageManager, j as setDocumentCache, jn as isOperationCache, jt as SubgraphSdkFactory, kn as addPromiseState, kt as viewFilterInputFromViewFilter, l as useDocumentModelModules, lt as stampAction, mt as MutateDocumentWithOperationsResult, nn as isoStringFromDateTime, nt as startDocumentChangesSubscription, o as UseDocumentOperationsOptions, ot as resolveDocumentModelModule, p as useDispatch, pt as MutateDocumentWithOperationsDocument, q as ConnectionParams, qt as queriesUnknownArgument, r as useAttachmentService, rn as phDocumentFromGetDocument, rt as subscriptionsUrlFromGraphqlUrl, s as useDocumentOperations, st as prepareSignedActions, tn as RevisionsListSelection, tt as makeAuthConnectionParams, u as DispatchFn, ut as GetDocumentAtConsistencyDocument, vt as GraphQLReactorProviderProps, wn as DocumentCache, wt as GraphQLReactorReadClient, xt as DriveIdCall, yt as ensurePHEventHandlers, z as DEFAULT_BATCH_REQUEST_TIMEOUT_MS, zt as isNodeFetch } from "../../attachment-service-DXfpfp98.js";
|
|
2
|
+
import { v as SdkFunctionWrapper } from "../../schema-Bn6L3QR1.js";
|
|
3
|
+
import { n as ambientRenownTokenProvider, r as makeAuthMiddleware, t as BearerTokenProvider } from "../../auth-DzIYxeEJ.js";
|
|
4
|
+
import { Ut as IOperationCache, Wt as OperationsCacheEntry } from "../../global-DAAmZGCO.js";
|
|
5
|
+
import { i as IReactorBrowserClient } from "../../switchboards-D-_JBUbF.js";
|
|
6
|
+
export { BatchJobFailedError, BearerTokenProvider, ConnectionParams, DEFAULT_BATCH_REQUEST_TIMEOUT_MS, DEFAULT_BREAKER, DEFAULT_REQUEST_TIMEOUT_MS, type DispatchFn, DocumentCache, DocumentChangesEventPayload, DocumentChangesSubscriptionOptions, type DocumentOperationsResult, type DocumentOperationsState, DriveIdCall, DriveNodeQueries, GetDocumentAtConsistencyDocument, GetDocumentAtConsistencyResult, GetDocumentAtConsistencyVariables, GetDocumentQueryFields, GetDocumentQueryResult, GraphQLDriveNodeSource, GraphQLDriveReadClient, GraphQLFetch, GraphQLOperationNotSupportedError, GraphQLReactorClient, GraphQLReactorClientOptions, GraphQLReactorProvider, GraphQLReactorProviderProps, GraphQLReactorReadClient, GraphQLRequestOptions, GraphQLWrongBackendError, IDLE_OPERATIONS_ENTRY, IJobChangesSocket, type IOperationCache, type IReactorBrowserClient, JobChangesEventPayload, JobChangesSocketOptions, JobFailedError, MutateDocumentWithOperationsDocument, MutateDocumentWithOperationsResult, MutateDocumentWithOperationsVariables, type OperationsCacheEntry, ReactorOperationFieldsFragmentDoc, RevisionsListSelection, type SdkFunctionWrapper, StaticPackageManager, SubgraphSdkFactory, SubgraphSdkRegistry, SwitchboardBackend, SwitchboardBackendDescriptor, SwitchboardBreaker, SwitchboardUnreachableError, TypedGraphQLDocument, type UseDispatchResult, type UseDocumentOperationsOptions, addPromiseState, ambientRenownSigner, ambientRenownTokenProvider, createGraphQLDriveNodeSource, createJobChangesSocket, createSwitchboardBackend, describeGraphQLDocument, ensurePHEventHandlers, findIsServableOverGraphQL, globalFetch, isAuthRefusalClose, isDeadlineError, isGraphQLReactorClient, isNodeFetch, isOperationCache, isoStringFromDateTime, makeAuthConnectionParams, makeAuthMiddleware, packageFromDocumentModels, phDocumentFromGetDocument, phDocumentFromMutation, prepareSignedActions, queriesUnknownArgument, queriesUnknownField, readPromiseState, resolveDocumentModelModule, revisionMapFromRevisionsList, setDocumentCache, setReactorClient, signStampedAction, stampAction, startDocumentChangesSubscription, subgraphUrlFromGraphqlUrl, subscriptionsUrlFromGraphqlUrl, switchboardFetch, toLegacyNode, useAttachmentService, useDispatch, useDocument, useDocumentCache, useDocumentModelModuleById, useDocumentModelModules, useDocumentOperations, useDocumentSafe, useDocuments, useGetDocument, useGetDocumentAsync, useGetDocuments, useReactorClient, useSwitchboardClient, viewFilterInputFromViewFilter, withRequestDeadline, withStreamedBodies };
|
|
7
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { K as ambientRenownTokenProvider, n as useDocumentModelModules,
|
|
3
|
-
import { $r as
|
|
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 useDocument, c as useDocuments, d as useGetDocuments, f as DocumentCache, g as addPromiseState, h as IDLE_OPERATIONS_ENTRY, i as setDocumentCache, l as useGetDocument, n as useDispatch, o as useDocumentCache, s as useDocumentSafe, u as useGetDocumentAsync, v as isOperationCache, y as readPromiseState } from "../../dispatch-Cylwl2Dk.js";
|
|
2
|
+
import { K as setReactorClient, Z as useReactorClient, _t as ambientRenownTokenProvider, n as useDocumentModelModules, t as useDocumentModelModuleById, vt as makeAuthMiddleware } from "../../document-model-modules-BG-61uke.js";
|
|
3
|
+
import { $r as isGraphQLReactorClient, Ai as phDocumentFromGetDocument, Ci as switchboardFetch, Di as GraphQLDriveReadClient, Ei as GraphQLDriveNodeSource, Gi as GraphQLOperationNotSupportedError, Ji as queriesUnknownArgument, Ki as GraphQLWrongBackendError, Mi as revisionMapFromRevisionsList, Oi as toLegacyNode, Qr as findIsServableOverGraphQL, Si as isNodeFetch, Ti as withStreamedBodies, V as useAttachmentService, Wi as BatchJobFailedError, Xr as ambientRenownSigner, Yi as queriesUnknownField, Yr as GraphQLReactorClient, Zr as createGraphQLDriveNodeSource, _i as ReactorOperationFieldsFragmentDoc, a as SwitchboardUnreachableError, ai as subscriptionsUrlFromGraphqlUrl, bi as globalFetch, c as ensurePHEventHandlers, ci as subgraphUrlFromGraphqlUrl, di as resolveDocumentModelModule, ei as viewFilterInputFromViewFilter, fi as prepareSignedActions, gi as MutateDocumentWithOperationsDocument, hi as GetDocumentAtConsistencyDocument, i as DEFAULT_REQUEST_TIMEOUT_MS, ii as startDocumentChangesSubscription, ji as phDocumentFromMutation, ki as isoStringFromDateTime, l as useSwitchboardClient, li as StaticPackageManager, mi as stampAction, n as DEFAULT_BATCH_REQUEST_TIMEOUT_MS, ni as isAuthRefusalClose, o as createSwitchboardBackend, oi as SubgraphSdkRegistry, pi as signStampedAction, qi as JobFailedError, r as DEFAULT_BREAKER, ri as makeAuthConnectionParams, s as GraphQLReactorProvider, si as describeGraphQLDocument, t as useDocumentOperations, ti as createJobChangesSocket, ui as packageFromDocumentModels, wi as withRequestDeadline, xi as isDeadlineError } from "../../document-operations-D5QXcJbV.js";
|
|
4
|
+
export { BatchJobFailedError, DEFAULT_BATCH_REQUEST_TIMEOUT_MS, DEFAULT_BREAKER, DEFAULT_REQUEST_TIMEOUT_MS, DocumentCache, GetDocumentAtConsistencyDocument, GraphQLDriveNodeSource, GraphQLDriveReadClient, GraphQLOperationNotSupportedError, GraphQLReactorClient, GraphQLReactorProvider, GraphQLWrongBackendError, IDLE_OPERATIONS_ENTRY, JobFailedError, MutateDocumentWithOperationsDocument, ReactorOperationFieldsFragmentDoc, StaticPackageManager, SubgraphSdkRegistry, SwitchboardUnreachableError, addPromiseState, ambientRenownSigner, ambientRenownTokenProvider, createGraphQLDriveNodeSource, createJobChangesSocket, createSwitchboardBackend, describeGraphQLDocument, ensurePHEventHandlers, findIsServableOverGraphQL, globalFetch, isAuthRefusalClose, isDeadlineError, isGraphQLReactorClient, isNodeFetch, isOperationCache, isoStringFromDateTime, makeAuthConnectionParams, makeAuthMiddleware, packageFromDocumentModels, phDocumentFromGetDocument, phDocumentFromMutation, prepareSignedActions, queriesUnknownArgument, queriesUnknownField, readPromiseState, resolveDocumentModelModule, revisionMapFromRevisionsList, setDocumentCache, setReactorClient, signStampedAction, stampAction, startDocumentChangesSubscription, subgraphUrlFromGraphqlUrl, subscriptionsUrlFromGraphqlUrl, switchboardFetch, toLegacyNode, useAttachmentService, useDispatch, useDocument, useDocumentCache, useDocumentModelModuleById, useDocumentModelModules, useDocumentOperations, useDocumentSafe, useDocuments, useGetDocument, useGetDocumentAsync, useGetDocuments, useReactorClient, useSwitchboardClient, viewFilterInputFromViewFilter, withRequestDeadline, withStreamedBodies };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { n as LiveQueryResults, t as LiveNamespace } from "../../index-
|
|
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
|
-
|
|
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 {
|
|
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":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/relational/hooks/useRelationalDb.ts","../../../src/relational/hooks/useRelationalQuery.ts","../../../src/relational/utils/createProcessorQuery.ts"],"mappings":";;;;;YAWY,qBAAqB,UAAU,cAAkB;EAC3D,MAAM;;UAGE,mBAAmB;EAC3B,IAAI,qBAAqB;EACzB;EACA,OAAO;;YAkBG;;;;;EAKV,cAAc,OAAO;;qBAGV,kBAAmB,QAAM,UAC3B,wBACR,mBAAmB;;;YCtCV;EACV;EACA;;YAGU;EAEV;;wBAwBc,mBAAmB,QAAQ,aAAa,qBACtD,gBAAgB,2BAA2B,SAC3C,iBACA,gBACE,IAAI,wBAAwB,SAC5B,aAAa,YACV,yBACL,aAAa,SACb,WAAW;;;;;;;wBCrBG,qBAAqB,SACnC,gBAAgB,2BAA2B;GAIzC,uBACE,IAAI,wBAAwB,aACzB,2BAAuB,iBAEb,eACA;IAEf;IACA,OAAO;IACP,QAAQ,iBACN,WAAW,uBAAuB,oBAAoB,KAAK;;GAM7D,SACA,uBACE,IAAI,wBAAwB,UAC5B,YAAY,YACT,2BAAuB,iBAEb,eACA,eAAa,YAChB,SAAO,UACT;IAEV;IACA,OAAO;IACP,QAAQ,iBACN,WAAW,uBAAuB,oBAAoB,KAAK"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as useRelationalQuery, r as useRelationalDb, t as createProcessorQuery } from "../../relational-
|
|
1
|
+
import { n as useRelationalQuery, r as useRelationalDb, t as createProcessorQuery } from "../../relational-DZuyKp2y.js";
|
|
2
2
|
export { createProcessorQuery, useRelationalDb, useRelationalQuery };
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { CREDENTIAL_SCHEMA_EIP712_TYPE, CREDENTIAL_SUBJECT_TYPE, CREDENTIAL_TYPES, ChevronDownIcon, CopyIcon, DOMAIN_TYPE, DisconnectIcon, ISSUER_TYPE, RENOWN_CHAIN_ID, RENOWN_INITIAL_ANONYMOUS, RENOWN_INITIAL_UNKNOWN, RENOWN_NETWORK_ID, RENOWN_RETURN_URL_STRIPPED_PARAMS, RENOWN_URL, Renown, 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 DOMAIN_TYPE, B as CopyIcon, C as RenownInitialUserProvider, D as CREDENTIAL_SCHEMA_EIP712_TYPE, E as useRenownInitialUser, F as RENOWN_URL, G as RenownUserButton, H as RenownLogo, I as VERIFIABLE_CREDENTIAL_EIP712_TYPE, J as RenownLoginButton, K as RenownUserButtonMenuItem, L as initConnectCrypto, M as RENOWN_CHAIN_ID, N as RENOWN_NETWORK_ID, O as CREDENTIAL_SUBJECT_TYPE, P as RENOWN_RETURN_URL_STRIPPED_PARAMS, R as initRenownCrypto, S as RenownInitialAuth, T as useRenownInitialAuth, U as SpinnerIcon, V as DisconnectIcon, W as UserIcon, X as RenownAuthButton, Y as RenownLoginButtonProps, Z as RenownAuthButtonProps, _ as RenownSessionCookieState, a as useRenownWalletAdapter, at as desktopShell, b as RENOWN_INITIAL_ANONYMOUS, c as RenownWalletProvider, ct as openRenown, d as RenownProviderProps, dt as RenownAuthResolution, f as Renown, ft as RenownAuthStatus, g as RenownSessionCookieOptions, h as useRenownInit, i as decodeDelegation, it as DesktopShell, j as ISSUER_TYPE, k as CREDENTIAL_TYPES, l as RenownWalletProviderProps, lt as RenownAuth, m as RenownInitOptions, mt as useRenownAuthAsync, n as DelegationScope, nt as useRenown, o as RenownLoginMethod, p as RenownProps, pt as useRenownAuth, q as RenownUserButtonProps, r as createDelegation, s as useRenownLoginMethods, t as DelegationClaims, u as RenownProvider, ut as RenownAuthAsync, v as useRenownSessionCookie, w as RenownInitialUserProviderProps, x as RENOWN_INITIAL_UNKNOWN, y as useRenownSessionSynced, z as ChevronDownIcon } from "../../index-Bj1poVfa.js";
|
|
2
|
+
export { CREDENTIAL_SCHEMA_EIP712_TYPE, CREDENTIAL_SUBJECT_TYPE, CREDENTIAL_TYPES, ChevronDownIcon, CopyIcon, DOMAIN_TYPE, type DelegationClaims, type DelegationScope, type DesktopShell, DisconnectIcon, ISSUER_TYPE, RENOWN_CHAIN_ID, RENOWN_INITIAL_ANONYMOUS, RENOWN_INITIAL_UNKNOWN, RENOWN_NETWORK_ID, RENOWN_RETURN_URL_STRIPPED_PARAMS, RENOWN_URL, Renown, type RenownAuth, type RenownAuthAsync, RenownAuthButton, type RenownAuthButtonProps, type RenownAuthResolution, type RenownAuthStatus, type RenownInitOptions, type RenownInitialAuth, RenownInitialUserProvider, type RenownInitialUserProviderProps, RenownLoginButton, type RenownLoginButtonProps, type RenownLoginMethod, RenownLogo, type RenownProps, RenownProvider, type RenownProviderProps, type RenownSessionCookieOptions, type RenownSessionCookieState, RenownUserButton, type RenownUserButtonMenuItem, type RenownUserButtonProps, RenownWalletProvider, type RenownWalletProviderProps, SpinnerIcon, UserIcon, VERIFIABLE_CREDENTIAL_EIP712_TYPE, createDelegation, decodeDelegation, desktopShell, initConnectCrypto, initRenownCrypto, openRenown, useRenown, useRenownAuth, useRenownAuthAsync, useRenownInit, useRenownInitialAuth, useRenownInitialUser, useRenownLoginMethods, useRenownSessionCookie, useRenownSessionSynced, useRenownWalletAdapter };
|
|
3
|
+
export {};
|
package/dist/src/renown/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as useRenown, c as RENOWN_INITIAL_UNKNOWN, d as useRenownInitialUser, l as RenownInitialUserProvider, s as RENOWN_INITIAL_ANONYMOUS, u as useRenownInitialAuth } from "../../renown-
|
|
2
|
-
import { A as
|
|
3
|
-
export { CREDENTIAL_SCHEMA_EIP712_TYPE, CREDENTIAL_SUBJECT_TYPE, CREDENTIAL_TYPES, ChevronDownIcon, CopyIcon, DOMAIN_TYPE, DisconnectIcon, ISSUER_TYPE, RENOWN_CHAIN_ID, RENOWN_INITIAL_ANONYMOUS, RENOWN_INITIAL_UNKNOWN, RENOWN_NETWORK_ID, RENOWN_RETURN_URL_STRIPPED_PARAMS, RENOWN_URL, Renown, RenownAuthButton, RenownInitialUserProvider, RenownLoginButton, RenownLogo, RenownProvider, RenownUserButton, RenownWalletProvider, SpinnerIcon, UserIcon, VERIFIABLE_CREDENTIAL_EIP712_TYPE, initConnectCrypto, initRenownCrypto, openRenown, useRenown, useRenownAuth, useRenownAuthAsync, useRenownInit, useRenownInitialAuth, useRenownInitialUser, useRenownLoginMethods, useRenownSessionCookie, useRenownSessionSynced, useRenownWalletAdapter };
|
|
1
|
+
import { a as useRenown, c as RENOWN_INITIAL_UNKNOWN, d as useRenownInitialUser, l as RenownInitialUserProvider, s as RENOWN_INITIAL_ANONYMOUS, u as useRenownInitialAuth } from "../../renown-CBoTdGrg.js";
|
|
2
|
+
import { A as CREDENTIAL_TYPES, C as useRenownAuthAsync, D as openRenown, F as RENOWN_RETURN_URL_STRIPPED_PARAMS, I as RENOWN_URL, L as VERIFIABLE_CREDENTIAL_EIP712_TYPE, M as ISSUER_TYPE, N as RENOWN_CHAIN_ID, O as CREDENTIAL_SCHEMA_EIP712_TYPE, P as RENOWN_NETWORK_ID, S as useRenownAuth, _ as CopyIcon, a as RenownProvider, b as SpinnerIcon, c as useRenownInit, d as initConnectCrypto, f as initRenownCrypto, g as ChevronDownIcon, h as RenownLoginButton, i as useRenownLoginMethods, j as DOMAIN_TYPE, k as CREDENTIAL_SUBJECT_TYPE, l as useRenownSessionCookie, m as RenownUserButton, n as decodeDelegation, o as RenownWalletProvider, p as RenownAuthButton, r as useRenownWalletAdapter, s as Renown, t as createDelegation, u as useRenownSessionSynced, v as DisconnectIcon, w as desktopShell, x as UserIcon, y as RenownLogo } from "../../renown-B3MUaiq7.js";
|
|
3
|
+
export { CREDENTIAL_SCHEMA_EIP712_TYPE, CREDENTIAL_SUBJECT_TYPE, CREDENTIAL_TYPES, ChevronDownIcon, CopyIcon, DOMAIN_TYPE, DisconnectIcon, ISSUER_TYPE, RENOWN_CHAIN_ID, RENOWN_INITIAL_ANONYMOUS, RENOWN_INITIAL_UNKNOWN, RENOWN_NETWORK_ID, RENOWN_RETURN_URL_STRIPPED_PARAMS, RENOWN_URL, Renown, RenownAuthButton, RenownInitialUserProvider, RenownLoginButton, RenownLogo, RenownProvider, RenownUserButton, RenownWalletProvider, SpinnerIcon, UserIcon, VERIFIABLE_CREDENTIAL_EIP712_TYPE, createDelegation, decodeDelegation, desktopShell, initConnectCrypto, initRenownCrypto, openRenown, useRenown, useRenownAuth, useRenownAuthAsync, useRenownInit, useRenownInitialAuth, useRenownInitialUser, useRenownLoginMethods, useRenownSessionCookie, useRenownSessionSynced, useRenownWalletAdapter };
|