@syncular/console 0.0.0 → 0.0.3-23
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/App.d.ts +14 -0
- package/dist/App.d.ts.map +1 -0
- package/dist/App.js +33 -0
- package/dist/App.js.map +1 -0
- package/dist/browser-main.d.ts +2 -0
- package/dist/browser-main.d.ts.map +1 -0
- package/dist/browser-main.js +9 -0
- package/dist/browser-main.js.map +1 -0
- package/dist/hooks/ConnectionContext.d.ts +30 -0
- package/dist/hooks/ConnectionContext.d.ts.map +1 -0
- package/dist/hooks/ConnectionContext.js +127 -0
- package/dist/hooks/ConnectionContext.js.map +1 -0
- package/dist/hooks/index.d.ts +10 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +10 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/useConsoleApi.d.ts +152 -0
- package/dist/hooks/useConsoleApi.d.ts.map +1 -0
- package/dist/hooks/useConsoleApi.js +623 -0
- package/dist/hooks/useConsoleApi.js.map +1 -0
- package/dist/hooks/useInstanceContext.d.ts +9 -0
- package/dist/hooks/useInstanceContext.d.ts.map +1 -0
- package/dist/hooks/useInstanceContext.js +14 -0
- package/dist/hooks/useInstanceContext.js.map +1 -0
- package/dist/hooks/useLiveEvents.d.ts +33 -0
- package/dist/hooks/useLiveEvents.d.ts.map +1 -0
- package/dist/hooks/useLiveEvents.js +199 -0
- package/dist/hooks/useLiveEvents.js.map +1 -0
- package/dist/hooks/useLocalStorage.d.ts +2 -0
- package/dist/hooks/useLocalStorage.d.ts.map +1 -0
- package/dist/hooks/useLocalStorage.js +36 -0
- package/dist/hooks/useLocalStorage.js.map +1 -0
- package/dist/hooks/usePartitionContext.d.ts +9 -0
- package/dist/hooks/usePartitionContext.d.ts.map +1 -0
- package/dist/hooks/usePartitionContext.js +14 -0
- package/dist/hooks/usePartitionContext.js.map +1 -0
- package/dist/hooks/usePreferences.d.ts +35 -0
- package/dist/hooks/usePreferences.d.ts.map +1 -0
- package/dist/hooks/usePreferences.js +48 -0
- package/dist/hooks/usePreferences.js.map +1 -0
- package/dist/hooks/useRequestEvents.d.ts +7 -0
- package/dist/hooks/useRequestEvents.d.ts.map +1 -0
- package/dist/hooks/useRequestEvents.js +33 -0
- package/dist/hooks/useRequestEvents.js.map +1 -0
- package/dist/hooks/useTimeRange.d.ts +18 -0
- package/dist/hooks/useTimeRange.d.ts.map +1 -0
- package/dist/hooks/useTimeRange.js +18 -0
- package/dist/hooks/useTimeRange.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/layout.d.ts +6 -0
- package/dist/layout.d.ts.map +1 -0
- package/dist/layout.js +85 -0
- package/dist/layout.js.map +1 -0
- package/dist/lib/api.d.ts +11 -0
- package/dist/lib/api.d.ts.map +1 -0
- package/dist/lib/api.js +20 -0
- package/dist/lib/api.js.map +1 -0
- package/dist/lib/topology.d.ts +8 -0
- package/dist/lib/topology.d.ts.map +1 -0
- package/dist/lib/topology.js +76 -0
- package/dist/lib/topology.js.map +1 -0
- package/dist/lib/types.d.ts +194 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/dist/lib/types.js +5 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/mount.d.ts +10 -0
- package/dist/mount.d.ts.map +1 -0
- package/dist/mount.js +25 -0
- package/dist/mount.js.map +1 -0
- package/dist/pages/Command.d.ts +2 -0
- package/dist/pages/Command.d.ts.map +1 -0
- package/dist/pages/Command.js +215 -0
- package/dist/pages/Command.js.map +1 -0
- package/dist/pages/Config.d.ts +2 -0
- package/dist/pages/Config.d.ts.map +1 -0
- package/dist/pages/Config.js +504 -0
- package/dist/pages/Config.js.map +1 -0
- package/dist/pages/Fleet.d.ts +2 -0
- package/dist/pages/Fleet.d.ts.map +1 -0
- package/dist/pages/Fleet.js +126 -0
- package/dist/pages/Fleet.js.map +1 -0
- package/dist/pages/Ops.d.ts +2 -0
- package/dist/pages/Ops.d.ts.map +1 -0
- package/dist/pages/Ops.js +294 -0
- package/dist/pages/Ops.js.map +1 -0
- package/dist/pages/Stream.d.ts +6 -0
- package/dist/pages/Stream.d.ts.map +1 -0
- package/dist/pages/Stream.js +403 -0
- package/dist/pages/Stream.js.map +1 -0
- package/dist/pages/index.d.ts +6 -0
- package/dist/pages/index.d.ts.map +1 -0
- package/dist/pages/index.js +6 -0
- package/dist/pages/index.js.map +1 -0
- package/dist/routeTree.d.ts +2 -0
- package/dist/routeTree.d.ts.map +1 -0
- package/dist/routeTree.js +18 -0
- package/dist/routeTree.js.map +1 -0
- package/dist/routes/__root.d.ts +2 -0
- package/dist/routes/__root.d.ts.map +1 -0
- package/dist/routes/__root.js +6 -0
- package/dist/routes/__root.js.map +1 -0
- package/dist/routes/config.d.ts +2 -0
- package/dist/routes/config.d.ts.map +1 -0
- package/dist/routes/config.js +9 -0
- package/dist/routes/config.js.map +1 -0
- package/dist/routes/fleet.d.ts +2 -0
- package/dist/routes/fleet.d.ts.map +1 -0
- package/dist/routes/fleet.js +9 -0
- package/dist/routes/fleet.js.map +1 -0
- package/dist/routes/index.d.ts +2 -0
- package/dist/routes/index.d.ts.map +1 -0
- package/dist/routes/index.js +9 -0
- package/dist/routes/index.js.map +1 -0
- package/dist/routes/investigate-commit.d.ts +2 -0
- package/dist/routes/investigate-commit.d.ts.map +1 -0
- package/dist/routes/investigate-commit.js +14 -0
- package/dist/routes/investigate-commit.js.map +1 -0
- package/dist/routes/investigate-event.d.ts +2 -0
- package/dist/routes/investigate-event.d.ts.map +1 -0
- package/dist/routes/investigate-event.js +14 -0
- package/dist/routes/investigate-event.js.map +1 -0
- package/dist/routes/ops.d.ts +2 -0
- package/dist/routes/ops.d.ts.map +1 -0
- package/dist/routes/ops.js +9 -0
- package/dist/routes/ops.js.map +1 -0
- package/dist/routes/stream.d.ts +2 -0
- package/dist/routes/stream.d.ts.map +1 -0
- package/dist/routes/stream.js +9 -0
- package/dist/routes/stream.js.map +1 -0
- package/dist/runtime-config.d.ts +12 -0
- package/dist/runtime-config.d.ts.map +1 -0
- package/dist/runtime-config.js +35 -0
- package/dist/runtime-config.js.map +1 -0
- package/dist/sentry.d.ts +11 -0
- package/dist/sentry.d.ts.map +1 -0
- package/dist/sentry.js +60 -0
- package/dist/sentry.js.map +1 -0
- package/package.json +27 -7
- package/src/App.tsx +46 -25
- package/src/browser-main.tsx +10 -0
- package/src/index.ts +1 -0
- package/src/mount.tsx +6 -3
- package/src/runtime-config.ts +50 -0
- package/web-dist/apple-touch-icon.png +0 -0
- package/web-dist/chunk-7ayekhzx.css +1 -0
- package/web-dist/chunk-xrafhx03.js +90 -0
- package/web-dist/favicon-96x96.png +0 -0
- package/web-dist/favicon.ico +0 -0
- package/web-dist/favicon.svg +3 -0
- package/web-dist/index.html +19 -0
- package/web-dist/site.webmanifest +21 -0
- package/web-dist/web-app-manifest-192x192.png +0 -0
- package/web-dist/web-app-manifest-512x512.png +0 -0
package/dist/App.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ConnectionConfig } from './lib/api';
|
|
2
|
+
declare const routerForTypes: import("@tanstack/router-core").RouterCore<import("@tanstack/router-core").Route<Register, any, "/", "/", string, "__root__", undefined, {}, {}, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, {}, undefined, readonly [import("@tanstack/react-router").Route<unknown, import("@tanstack/react-router").RootRoute<Register, undefined, {}, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/", "/", string, "/", undefined, import("@tanstack/react-router").ResolveParams<"/">, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, import("@tanstack/react-router").Route<unknown, import("@tanstack/react-router").RootRoute<Register, undefined, {}, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/stream", "/stream", string, "/stream", undefined, import("@tanstack/react-router").ResolveParams<"/stream">, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, import("@tanstack/react-router").Route<unknown, import("@tanstack/react-router").RootRoute<Register, undefined, {}, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/investigate/commit/$seq", "/investigate/commit/$seq", string, "/investigate/commit/$seq", undefined, import("@tanstack/react-router").ResolveParams<"/investigate/commit/$seq">, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, import("@tanstack/react-router").Route<unknown, import("@tanstack/react-router").RootRoute<Register, undefined, {}, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/investigate/event/$id", "/investigate/event/$id", string, "/investigate/event/$id", undefined, import("@tanstack/react-router").ResolveParams<"/investigate/event/$id">, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, import("@tanstack/react-router").Route<unknown, import("@tanstack/react-router").RootRoute<Register, undefined, {}, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/fleet", "/fleet", string, "/fleet", undefined, import("@tanstack/react-router").ResolveParams<"/fleet">, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, import("@tanstack/react-router").Route<unknown, import("@tanstack/react-router").RootRoute<Register, undefined, {}, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/ops", "/ops", string, "/ops", undefined, import("@tanstack/react-router").ResolveParams<"/ops">, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, import("@tanstack/react-router").Route<unknown, import("@tanstack/react-router").RootRoute<Register, undefined, {}, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/config", "/config", string, "/config", undefined, import("@tanstack/react-router").ResolveParams<"/config">, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>], unknown, unknown, unknown, undefined>, "never", false, import("@tanstack/history").RouterHistory, Record<string, any>>;
|
|
3
|
+
declare module '@tanstack/react-router' {
|
|
4
|
+
interface Register {
|
|
5
|
+
router: typeof routerForTypes;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export interface SyncularConsoleProps {
|
|
9
|
+
basePath?: string;
|
|
10
|
+
defaultConfig?: ConnectionConfig | null;
|
|
11
|
+
}
|
|
12
|
+
export declare function App(props: SyncularConsoleProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=App.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAQlD,QAAA,MAAM,cAAc,m6IAA6C,CAAC;AAElE,OAAO,QAAQ,wBAAwB,CAAC,CAAC;IACvC,UAAU,QAAQ;QAChB,MAAM,EAAE,OAAO,cAAc,CAAC;KAC/B;CACF;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACzC;AAuCD,wBAAgB,GAAG,CAAC,KAAK,EAAE,oBAAoB,2CAE9C"}
|
package/dist/App.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
3
|
+
import { createRouter, RouterProvider } from '@tanstack/react-router';
|
|
4
|
+
import { useMemo, useState } from 'react';
|
|
5
|
+
import { ConnectionProvider } from './hooks/ConnectionContext.js';
|
|
6
|
+
import { routeTree } from './routeTree.js';
|
|
7
|
+
import { normalizeBasePath, resolveConsoleBasePathFromMeta, resolveConsoleConnectionConfigFromMeta, } from './runtime-config.js';
|
|
8
|
+
const routerForTypes = createRouter({ routeTree, basepath: '/' });
|
|
9
|
+
function createDefaultQueryClient() {
|
|
10
|
+
return new QueryClient({
|
|
11
|
+
defaultOptions: {
|
|
12
|
+
queries: {
|
|
13
|
+
staleTime: 5000,
|
|
14
|
+
retry: 1,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function resolveBasePath(basePath) {
|
|
20
|
+
return normalizeBasePath(basePath ?? resolveConsoleBasePathFromMeta());
|
|
21
|
+
}
|
|
22
|
+
function SyncularConsole(props) {
|
|
23
|
+
const [queryClient] = useState(() => createDefaultQueryClient());
|
|
24
|
+
const router = useMemo(() => createRouter({ routeTree, basepath: resolveBasePath(props.basePath) }), [props.basePath]);
|
|
25
|
+
const defaultConfig = props.defaultConfig === undefined
|
|
26
|
+
? resolveConsoleConnectionConfigFromMeta()
|
|
27
|
+
: props.defaultConfig;
|
|
28
|
+
return (_jsx(QueryClientProvider, { client: queryClient, children: _jsx(ConnectionProvider, { defaultConfig: defaultConfig, children: _jsx(RouterProvider, { router: router }) }) }));
|
|
29
|
+
}
|
|
30
|
+
export function App(props) {
|
|
31
|
+
return _jsx(SyncularConsole, { ...props });
|
|
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ACjB,CAAC;IAEF,MAAM,aAAa,GACjB,KAAK,CAAC,aAAa,KAAK,SAAS;QAC/B,CAAC,CAAC,sCAAsC,EAAE;QAC1C,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC;IAE1B,OAAO,CACL,KAAC,mBAAmB,IAAC,MAAM,EAAE,WAAW,YACtC,KAAC,kBAAkB,IAAC,aAAa,EAAE,aAAa,YAC9C,KAAC,cAAc,IAAC,MAAM,EAAE,MAAM,GAAI,GACf,GACD,CACvB,CAAC;AAAA,CACH;AAED,MAAM,UAAU,GAAG,CAAC,KAA2B,EAAE;IAC/C,OAAO,KAAC,eAAe,OAAK,KAAK,GAAI,CAAC;AAAA,CACvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-main.d.ts","sourceRoot":"","sources":["../src/browser-main.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { initAndConfigureBrowserSentry } from '@syncular/observability-sentry';
|
|
2
|
+
import { mountSyncularConsoleApp } from './mount.js';
|
|
3
|
+
import { resolveConsoleBrowserSentryOptions } from './sentry.js';
|
|
4
|
+
const sentryOptions = resolveConsoleBrowserSentryOptions();
|
|
5
|
+
if (sentryOptions) {
|
|
6
|
+
initAndConfigureBrowserSentry(sentryOptions);
|
|
7
|
+
}
|
|
8
|
+
mountSyncularConsoleApp('#root');
|
|
9
|
+
//# sourceMappingURL=browser-main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-main.js","sourceRoot":"","sources":["../src/browser-main.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,kCAAkC,EAAE,MAAM,UAAU,CAAC;AAE9D,MAAM,aAAa,GAAG,kCAAkC,EAAE,CAAC;AAC3D,IAAI,aAAa,EAAE,CAAC;IAClB,6BAA6B,CAAC,aAAa,CAAC,CAAC;AAC/C,CAAC;AAED,uBAAuB,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Connection context for shared connection state across components
|
|
3
|
+
*/
|
|
4
|
+
import type { SyncClient } from '@syncular/transport-http';
|
|
5
|
+
import { type ReactNode } from 'react';
|
|
6
|
+
import { type ConnectionConfig } from '../lib/api';
|
|
7
|
+
interface ConnectionContextValue {
|
|
8
|
+
config: ConnectionConfig | null;
|
|
9
|
+
setConfig: (config: ConnectionConfig | null) => void;
|
|
10
|
+
isConnected: boolean;
|
|
11
|
+
isConnecting: boolean;
|
|
12
|
+
error: string | null;
|
|
13
|
+
client: SyncClient | null;
|
|
14
|
+
connect: (overrideConfig?: ConnectionConfig, options?: {
|
|
15
|
+
persistOverride?: boolean;
|
|
16
|
+
}) => Promise<boolean>;
|
|
17
|
+
disconnect: (options?: {
|
|
18
|
+
clearSavedConfig?: boolean;
|
|
19
|
+
}) => void;
|
|
20
|
+
clearError: () => void;
|
|
21
|
+
}
|
|
22
|
+
interface ConnectionProviderProps {
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
defaultConfig?: ConnectionConfig | null;
|
|
25
|
+
}
|
|
26
|
+
export declare function ConnectionProvider({ children, defaultConfig }: ConnectionProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare function useConnection(): ConnectionContextValue;
|
|
28
|
+
export declare function useApiClient(): SyncClient | null;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=ConnectionContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectionContext.d.ts","sourceRoot":"","sources":["../../src/hooks/ConnectionContext.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAEL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AACf,OAAO,EACL,KAAK,gBAAgB,EAGtB,MAAM,YAAY,CAAC;AAUpB,UAAU,sBAAsB;IAC9B,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAChC,SAAS,EAAE,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,KAAK,IAAI,CAAC;IACrD,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IAC1B,OAAO,EAAE,CACP,cAAc,CAAC,EAAE,gBAAgB,EACjC,OAAO,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,OAAO,CAAA;KAAE,KACpC,OAAO,CAAC,OAAO,CAAC,CAAC;IACtB,UAAU,EAAE,CAAC,OAAO,CAAC,EAAE;QAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IAC/D,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,UAAU,uBAAuB;IAC/B,QAAQ,EAAE,SAAS,CAAC;IACpB,aAAa,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACzC;AAID,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,aAAoB,EACrB,EAAE,uBAAuB,2CAkJzB;AAED,wBAAgB,aAAa,IAAI,sBAAsB,CAMtD;AAED,wBAAgB,YAAY,IAAI,UAAU,GAAG,IAAI,CAGhD"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useCallback, useContext, useEffect, useMemo, useState, } from 'react';
|
|
3
|
+
import { createConsoleClient, testConnection, } from '../lib/api.js';
|
|
4
|
+
import { useLocalStorage } from './useLocalStorage.js';
|
|
5
|
+
const ConnectionContext = createContext(null);
|
|
6
|
+
export function ConnectionProvider({ children, defaultConfig = null, }) {
|
|
7
|
+
const [config, setConfigStorage] = useLocalStorage('sync-console-connection', null);
|
|
8
|
+
const [state, setState] = useState({
|
|
9
|
+
isConnected: false,
|
|
10
|
+
isConnecting: false,
|
|
11
|
+
error: null,
|
|
12
|
+
client: null,
|
|
13
|
+
});
|
|
14
|
+
// Resolve initial config: saved config -> provided defaults
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (config?.serverUrl?.trim() && config.token?.trim()) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (defaultConfig?.serverUrl?.trim() && defaultConfig.token?.trim()) {
|
|
20
|
+
setConfigStorage({
|
|
21
|
+
serverUrl: defaultConfig.serverUrl.trim(),
|
|
22
|
+
token: defaultConfig.token.trim(),
|
|
23
|
+
});
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
}, [setConfigStorage, config, defaultConfig]);
|
|
27
|
+
const connect = useCallback(async (overrideConfig, options) => {
|
|
28
|
+
const effectiveConfig = overrideConfig ?? config;
|
|
29
|
+
if (!effectiveConfig) {
|
|
30
|
+
setState((s) => ({ ...s, error: 'No connection configured' }));
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
const normalizedConfig = {
|
|
34
|
+
serverUrl: effectiveConfig.serverUrl?.trim() ?? '',
|
|
35
|
+
token: effectiveConfig.token?.trim() ?? '',
|
|
36
|
+
};
|
|
37
|
+
// Validate config has required fields
|
|
38
|
+
if (!normalizedConfig.serverUrl) {
|
|
39
|
+
setState((s) => ({ ...s, error: 'Server URL is required' }));
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
if (!normalizedConfig.token) {
|
|
43
|
+
setState((s) => ({ ...s, error: 'Token is required' }));
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
if (overrideConfig && (options?.persistOverride ?? true)) {
|
|
47
|
+
setConfigStorage(normalizedConfig);
|
|
48
|
+
}
|
|
49
|
+
setState((s) => ({ ...s, isConnecting: true, error: null }));
|
|
50
|
+
try {
|
|
51
|
+
const client = createConsoleClient(normalizedConfig);
|
|
52
|
+
const ok = await testConnection(client);
|
|
53
|
+
if (ok) {
|
|
54
|
+
setState({
|
|
55
|
+
isConnected: true,
|
|
56
|
+
isConnecting: false,
|
|
57
|
+
client,
|
|
58
|
+
error: null,
|
|
59
|
+
});
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
setState({
|
|
63
|
+
isConnected: false,
|
|
64
|
+
isConnecting: false,
|
|
65
|
+
client: null,
|
|
66
|
+
error: 'Failed to connect',
|
|
67
|
+
});
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
setState({
|
|
72
|
+
isConnected: false,
|
|
73
|
+
isConnecting: false,
|
|
74
|
+
client: null,
|
|
75
|
+
error: err instanceof Error ? err.message : 'Connection failed',
|
|
76
|
+
});
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
}, [config, setConfigStorage]);
|
|
80
|
+
const disconnect = useCallback((options) => {
|
|
81
|
+
if (options?.clearSavedConfig) {
|
|
82
|
+
setConfigStorage(null);
|
|
83
|
+
}
|
|
84
|
+
setState({
|
|
85
|
+
isConnected: false,
|
|
86
|
+
isConnecting: false,
|
|
87
|
+
client: null,
|
|
88
|
+
error: null,
|
|
89
|
+
});
|
|
90
|
+
}, [setConfigStorage]);
|
|
91
|
+
const clearError = useCallback(() => {
|
|
92
|
+
setState((s) => ({ ...s, error: null }));
|
|
93
|
+
}, []);
|
|
94
|
+
const setConfig = useCallback((newConfig) => {
|
|
95
|
+
setConfigStorage(newConfig);
|
|
96
|
+
setState({
|
|
97
|
+
isConnected: false,
|
|
98
|
+
isConnecting: false,
|
|
99
|
+
client: null,
|
|
100
|
+
error: null,
|
|
101
|
+
});
|
|
102
|
+
}, [setConfigStorage]);
|
|
103
|
+
const value = useMemo(() => ({
|
|
104
|
+
config,
|
|
105
|
+
setConfig,
|
|
106
|
+
isConnected: state.isConnected,
|
|
107
|
+
isConnecting: state.isConnecting,
|
|
108
|
+
error: state.error,
|
|
109
|
+
client: state.client,
|
|
110
|
+
connect,
|
|
111
|
+
disconnect,
|
|
112
|
+
clearError,
|
|
113
|
+
}), [config, setConfig, state, connect, disconnect, clearError]);
|
|
114
|
+
return (_jsx(ConnectionContext.Provider, { value: value, children: children }));
|
|
115
|
+
}
|
|
116
|
+
export function useConnection() {
|
|
117
|
+
const context = useContext(ConnectionContext);
|
|
118
|
+
if (!context) {
|
|
119
|
+
throw new Error('useConnection must be used within a ConnectionProvider');
|
|
120
|
+
}
|
|
121
|
+
return context;
|
|
122
|
+
}
|
|
123
|
+
export function useApiClient() {
|
|
124
|
+
const { client } = useConnection();
|
|
125
|
+
return client;
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=ConnectionContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectionContext.js","sourceRoot":"","sources":["../../src/hooks/ConnectionContext.tsx"],"names":[],"mappings":";AAKA,OAAO,EACL,aAAa,EAEb,WAAW,EACX,UAAU,EACV,SAAS,EACT,OAAO,EACP,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,EAEL,mBAAmB,EACnB,cAAc,GACf,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AA6BpD,MAAM,iBAAiB,GAAG,aAAa,CAAgC,IAAI,CAAC,CAAC;AAE7E,MAAM,UAAU,kBAAkB,CAAC,EACjC,QAAQ,EACR,aAAa,GAAG,IAAI,GACI,EAAE;IAC1B,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,GAAG,eAAe,CAChD,yBAAyB,EACzB,IAAI,CACL,CAAC;IAEF,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAkB;QAClD,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,KAAK;QACnB,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,IAAI;KACb,CAAC,CAAC;IAEH,4DAA4D;IA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S,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,CAAC,CAC5D,CAAC;IAEF,OAAO,CACL,KAAC,iBAAiB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YACrC,QAAQ,GACkB,CAC9B,CAAC;AAAA,CACH;AAED,MAAM,UAAU,aAAa,GAA2B;IACtD,MAAM,OAAO,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAC9C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;IAC5E,CAAC;IACD,OAAO,OAAO,CAAC;AAAA,CAChB;AAED,MAAM,UAAU,YAAY,GAAsB;IAChD,MAAM,EAAE,MAAM,EAAE,GAAG,aAAa,EAAE,CAAC;IACnC,OAAO,MAAM,CAAC;AAAA,CACf"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './ConnectionContext';
|
|
2
|
+
export * from './useConsoleApi';
|
|
3
|
+
export * from './useInstanceContext';
|
|
4
|
+
export * from './useLiveEvents';
|
|
5
|
+
export * from './useLocalStorage';
|
|
6
|
+
export * from './usePartitionContext';
|
|
7
|
+
export * from './usePreferences';
|
|
8
|
+
export * from './useRequestEvents';
|
|
9
|
+
export * from './useTimeRange';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './ConnectionContext.js';
|
|
2
|
+
export * from './useConsoleApi.js';
|
|
3
|
+
export * from './useInstanceContext.js';
|
|
4
|
+
export * from './useLiveEvents.js';
|
|
5
|
+
export * from './useLocalStorage.js';
|
|
6
|
+
export * from './usePartitionContext.js';
|
|
7
|
+
export * from './usePreferences.js';
|
|
8
|
+
export * from './useRequestEvents.js';
|
|
9
|
+
export * from './useTimeRange.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React Query hooks for Console API
|
|
3
|
+
*/
|
|
4
|
+
import type { ConsoleApiKey, ConsoleApiKeyBulkRevokeResponse, ConsoleClient, ConsoleCommitDetail, ConsoleCommitListItem, ConsoleHandler, ConsoleNotifyDataChangeResponse, ConsoleOperationEvent, ConsoleOperationType, ConsoleRequestEvent, ConsoleRequestPayload, ConsoleTimelineItem, LatencyStatsResponse, PaginatedResponse, SyncStats, TimeseriesInterval, TimeseriesRange, TimeseriesStatsResponse } from '../lib/types';
|
|
5
|
+
export declare function useStats(options?: {
|
|
6
|
+
refetchIntervalMs?: number;
|
|
7
|
+
partitionId?: string;
|
|
8
|
+
instanceId?: string;
|
|
9
|
+
}): import("@tanstack/react-query").UseQueryResult<SyncStats, Error>;
|
|
10
|
+
export declare function useTimeseriesStats(params?: {
|
|
11
|
+
interval?: TimeseriesInterval;
|
|
12
|
+
range?: TimeseriesRange;
|
|
13
|
+
partitionId?: string;
|
|
14
|
+
instanceId?: string;
|
|
15
|
+
}, options?: {
|
|
16
|
+
refetchIntervalMs?: number;
|
|
17
|
+
enabled?: boolean;
|
|
18
|
+
}): import("@tanstack/react-query").UseQueryResult<TimeseriesStatsResponse, Error>;
|
|
19
|
+
export declare function useLatencyStats(params?: {
|
|
20
|
+
range?: TimeseriesRange;
|
|
21
|
+
partitionId?: string;
|
|
22
|
+
instanceId?: string;
|
|
23
|
+
}, options?: {
|
|
24
|
+
refetchIntervalMs?: number;
|
|
25
|
+
enabled?: boolean;
|
|
26
|
+
}): import("@tanstack/react-query").UseQueryResult<LatencyStatsResponse, Error>;
|
|
27
|
+
export declare function useCommits(params?: {
|
|
28
|
+
limit?: number;
|
|
29
|
+
offset?: number;
|
|
30
|
+
partitionId?: string;
|
|
31
|
+
instanceId?: string;
|
|
32
|
+
}, options?: {
|
|
33
|
+
refetchIntervalMs?: number;
|
|
34
|
+
enabled?: boolean;
|
|
35
|
+
}): import("@tanstack/react-query").UseQueryResult<PaginatedResponse<ConsoleCommitListItem>, Error>;
|
|
36
|
+
export declare function useCommitDetail(seq: string | number | undefined, options?: {
|
|
37
|
+
enabled?: boolean;
|
|
38
|
+
partitionId?: string;
|
|
39
|
+
instanceId?: string;
|
|
40
|
+
}): import("@tanstack/react-query").UseQueryResult<ConsoleCommitDetail, Error>;
|
|
41
|
+
export declare function useTimeline(params?: {
|
|
42
|
+
limit?: number;
|
|
43
|
+
offset?: number;
|
|
44
|
+
partitionId?: string;
|
|
45
|
+
instanceId?: string;
|
|
46
|
+
view?: 'all' | 'commits' | 'events';
|
|
47
|
+
eventType?: 'push' | 'pull';
|
|
48
|
+
actorId?: string;
|
|
49
|
+
clientId?: string;
|
|
50
|
+
requestId?: string;
|
|
51
|
+
traceId?: string;
|
|
52
|
+
table?: string;
|
|
53
|
+
outcome?: string;
|
|
54
|
+
search?: string;
|
|
55
|
+
from?: string;
|
|
56
|
+
to?: string;
|
|
57
|
+
}, options?: {
|
|
58
|
+
refetchIntervalMs?: number;
|
|
59
|
+
enabled?: boolean;
|
|
60
|
+
}): import("@tanstack/react-query").UseQueryResult<PaginatedResponse<ConsoleTimelineItem>, Error>;
|
|
61
|
+
export declare function useClients(params?: {
|
|
62
|
+
limit?: number;
|
|
63
|
+
offset?: number;
|
|
64
|
+
partitionId?: string;
|
|
65
|
+
instanceId?: string;
|
|
66
|
+
}, options?: {
|
|
67
|
+
refetchIntervalMs?: number;
|
|
68
|
+
enabled?: boolean;
|
|
69
|
+
}): import("@tanstack/react-query").UseQueryResult<PaginatedResponse<ConsoleClient>, Error>;
|
|
70
|
+
export declare function useRequestEventDetail(id: string | number | undefined, options?: {
|
|
71
|
+
enabled?: boolean;
|
|
72
|
+
partitionId?: string;
|
|
73
|
+
instanceId?: string;
|
|
74
|
+
}): import("@tanstack/react-query").UseQueryResult<ConsoleRequestEvent, Error>;
|
|
75
|
+
export declare function useRequestEventPayload(id: string | number | undefined, options?: {
|
|
76
|
+
enabled?: boolean;
|
|
77
|
+
partitionId?: string;
|
|
78
|
+
instanceId?: string;
|
|
79
|
+
}): import("@tanstack/react-query").UseQueryResult<ConsoleRequestPayload, Error>;
|
|
80
|
+
export declare function useHandlers(options?: {
|
|
81
|
+
instanceId?: string;
|
|
82
|
+
}): import("@tanstack/react-query").UseQueryResult<{
|
|
83
|
+
items: ConsoleHandler[];
|
|
84
|
+
}, Error>;
|
|
85
|
+
export declare function usePrunePreview(options?: {
|
|
86
|
+
enabled?: boolean;
|
|
87
|
+
instanceId?: string;
|
|
88
|
+
}): import("@tanstack/react-query").UseQueryResult<{
|
|
89
|
+
watermarkCommitSeq: number;
|
|
90
|
+
commitsToDelete: number;
|
|
91
|
+
}, Error>;
|
|
92
|
+
export declare function useOperationEvents(params?: {
|
|
93
|
+
limit?: number;
|
|
94
|
+
offset?: number;
|
|
95
|
+
operationType?: ConsoleOperationType;
|
|
96
|
+
partitionId?: string;
|
|
97
|
+
instanceId?: string;
|
|
98
|
+
}, options?: {
|
|
99
|
+
enabled?: boolean;
|
|
100
|
+
refetchIntervalMs?: number;
|
|
101
|
+
}): import("@tanstack/react-query").UseQueryResult<PaginatedResponse<ConsoleOperationEvent>, Error>;
|
|
102
|
+
export declare function useEvictClientMutation(): import("@tanstack/react-query").UseMutationResult<{
|
|
103
|
+
evicted: boolean;
|
|
104
|
+
}, Error, {
|
|
105
|
+
clientId: string;
|
|
106
|
+
partitionId?: string | undefined;
|
|
107
|
+
instanceId?: string | undefined;
|
|
108
|
+
}, unknown>;
|
|
109
|
+
export declare function usePruneMutation(): import("@tanstack/react-query").UseMutationResult<{
|
|
110
|
+
deletedCommits: number;
|
|
111
|
+
}, Error, void, unknown>;
|
|
112
|
+
export declare function useCompactMutation(): import("@tanstack/react-query").UseMutationResult<{
|
|
113
|
+
deletedChanges: number;
|
|
114
|
+
}, Error, void, unknown>;
|
|
115
|
+
export declare function useNotifyDataChangeMutation(): import("@tanstack/react-query").UseMutationResult<ConsoleNotifyDataChangeResponse, Error, {
|
|
116
|
+
tables: string[];
|
|
117
|
+
partitionId?: string | undefined;
|
|
118
|
+
instanceId?: string | undefined;
|
|
119
|
+
}, unknown>;
|
|
120
|
+
export declare function useApiKeys(params?: {
|
|
121
|
+
limit?: number;
|
|
122
|
+
offset?: number;
|
|
123
|
+
type?: 'relay' | 'proxy' | 'admin';
|
|
124
|
+
status?: 'active' | 'revoked' | 'expiring';
|
|
125
|
+
expiresWithinDays?: number;
|
|
126
|
+
instanceId?: string;
|
|
127
|
+
}): import("@tanstack/react-query").UseQueryResult<PaginatedResponse<ConsoleApiKey>, Error>;
|
|
128
|
+
export declare function useCreateApiKeyMutation(): import("@tanstack/react-query").UseMutationResult<{
|
|
129
|
+
key: ConsoleApiKey;
|
|
130
|
+
secretKey: string;
|
|
131
|
+
}, Error, {
|
|
132
|
+
name: string;
|
|
133
|
+
keyType: "admin" | "proxy" | "relay";
|
|
134
|
+
scopeKeys?: string[] | undefined;
|
|
135
|
+
actorId?: string | undefined;
|
|
136
|
+
expiresInDays?: number | undefined;
|
|
137
|
+
}, unknown>;
|
|
138
|
+
export declare function useRevokeApiKeyMutation(): import("@tanstack/react-query").UseMutationResult<{
|
|
139
|
+
revoked: boolean;
|
|
140
|
+
}, Error, string, unknown>;
|
|
141
|
+
export declare function useBulkRevokeApiKeysMutation(): import("@tanstack/react-query").UseMutationResult<ConsoleApiKeyBulkRevokeResponse, Error, {
|
|
142
|
+
keyIds: string[];
|
|
143
|
+
}, unknown>;
|
|
144
|
+
export declare function useRotateApiKeyMutation(): import("@tanstack/react-query").UseMutationResult<{
|
|
145
|
+
key: ConsoleApiKey;
|
|
146
|
+
secretKey: string;
|
|
147
|
+
}, Error, string, unknown>;
|
|
148
|
+
export declare function useStageRotateApiKeyMutation(): import("@tanstack/react-query").UseMutationResult<{
|
|
149
|
+
key: ConsoleApiKey;
|
|
150
|
+
secretKey: string;
|
|
151
|
+
}, Error, string, unknown>;
|
|
152
|
+
//# sourceMappingURL=useConsoleApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useConsoleApi.d.ts","sourceRoot":"","sources":["../../src/hooks/useConsoleApi.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EACV,aAAa,EACb,+BAA+B,EAC/B,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,cAAc,EACd,+BAA+B,EAC/B,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,SAAS,EACT,kBAAkB,EAClB,eAAe,EACf,uBAAuB,EACxB,MAAM,cAAc,CAAC;AAqHtB,wBAAgB,QAAQ,CACtB,OAAO,GAAE;IACP,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CAChB,oEAsBP;AAED,wBAAgB,kBAAkB,CAChC,MAAM,GAA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