database-devtools 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +5 -0
- package/dist/adapter/index.cjs +314 -0
- package/dist/adapter/index.cjs.map +1 -0
- package/dist/adapter/index.d.cts +34 -0
- package/dist/adapter/index.d.ts +34 -0
- package/dist/adapter/index.js +6 -0
- package/dist/adapter/index.js.map +1 -0
- package/dist/adapter-BjJm71wW.d.cts +30 -0
- package/dist/adapter-DJSjDewg.d.ts +30 -0
- package/dist/adapters/sqlite/index.cjs +251 -0
- package/dist/adapters/sqlite/index.cjs.map +1 -0
- package/dist/adapters/sqlite/index.d.cts +21 -0
- package/dist/adapters/sqlite/index.d.ts +21 -0
- package/dist/adapters/sqlite/index.js +6 -0
- package/dist/adapters/sqlite/index.js.map +1 -0
- package/dist/chunk-2JGL2JVD.js +52 -0
- package/dist/chunk-2JGL2JVD.js.map +1 -0
- package/dist/chunk-AZECU6D7.js +27 -0
- package/dist/chunk-AZECU6D7.js.map +1 -0
- package/dist/chunk-BLOSGEQV.js +71 -0
- package/dist/chunk-BLOSGEQV.js.map +1 -0
- package/dist/chunk-CPVVIH5G.js +258 -0
- package/dist/chunk-CPVVIH5G.js.map +1 -0
- package/dist/chunk-DGUM43GV.js +10 -0
- package/dist/chunk-DGUM43GV.js.map +1 -0
- package/dist/chunk-HIDZTOJ3.js +9 -0
- package/dist/chunk-HIDZTOJ3.js.map +1 -0
- package/dist/chunk-I65IM47D.js +243 -0
- package/dist/chunk-I65IM47D.js.map +1 -0
- package/dist/chunk-MXVIGMVT.js +3 -0
- package/dist/chunk-MXVIGMVT.js.map +1 -0
- package/dist/chunk-O6AO7KHA.js +3 -0
- package/dist/chunk-O6AO7KHA.js.map +1 -0
- package/dist/chunk-TNDOAHT5.js +1784 -0
- package/dist/chunk-TNDOAHT5.js.map +1 -0
- package/dist/chunk-ZS5MZR75.js +655 -0
- package/dist/chunk-ZS5MZR75.js.map +1 -0
- package/dist/cli.cjs +2053 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/client/index.cjs +947 -0
- package/dist/client/index.cjs.map +1 -0
- package/dist/client/index.d.cts +75 -0
- package/dist/client/index.d.ts +75 -0
- package/dist/client/index.js +98 -0
- package/dist/client/index.js.map +1 -0
- package/dist/createDevToolsServer-B7NQ_5H4.d.cts +292 -0
- package/dist/createDevToolsServer-DlNMoCJR.d.ts +292 -0
- package/dist/handleDeviceSnapshot-CR-4QMdk.d.ts +116 -0
- package/dist/handleDeviceSnapshot-cYGuitSc.d.cts +116 -0
- package/dist/index.cjs +5877 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +61 -0
- package/dist/index.d.ts +61 -0
- package/dist/index.js +2748 -0
- package/dist/index.js.map +1 -0
- package/dist/inspector/index.cjs +57 -0
- package/dist/inspector/index.cjs.map +1 -0
- package/dist/inspector/index.d.cts +26 -0
- package/dist/inspector/index.d.ts +26 -0
- package/dist/inspector/index.js +5 -0
- package/dist/inspector/index.js.map +1 -0
- package/dist/inspectors/sqlite/index.cjs +306 -0
- package/dist/inspectors/sqlite/index.cjs.map +1 -0
- package/dist/inspectors/sqlite/index.d.cts +53 -0
- package/dist/inspectors/sqlite/index.d.ts +53 -0
- package/dist/inspectors/sqlite/index.js +260 -0
- package/dist/inspectors/sqlite/index.js.map +1 -0
- package/dist/register-BuicFu9L.d.cts +32 -0
- package/dist/register-aITLN9Q9.d.ts +32 -0
- package/dist/server/index.cjs +1948 -0
- package/dist/server/index.cjs.map +1 -0
- package/dist/server/index.d.cts +15 -0
- package/dist/server/index.d.ts +15 -0
- package/dist/server/index.js +7 -0
- package/dist/server/index.js.map +1 -0
- package/dist/snapshot-Dhyecgo2.d.cts +33 -0
- package/dist/snapshot-Dhyecgo2.d.ts +33 -0
- package/dist/types/protocol.cjs +309 -0
- package/dist/types/protocol.cjs.map +1 -0
- package/dist/types/protocol.d.cts +291 -0
- package/dist/types/protocol.d.ts +291 -0
- package/dist/types/protocol.js +4 -0
- package/dist/types/protocol.js.map +1 -0
- package/dist/types-BRLJdBRY.d.cts +16 -0
- package/dist/types-CF6qEU-_.d.ts +16 -0
- package/dist/types-CIA11diJ.d.cts +62 -0
- package/dist/types-CKVRCX-e.d.ts +62 -0
- package/dist/web/assets/index-CLEaIsUd.css +1 -0
- package/dist/web/assets/index-DQrPRTOy.js +100 -0
- package/dist/web/assets/sql-wasm-UFUCzYNW.wasm +0 -0
- package/dist/web/index.html +26 -0
- package/dist/write-C3toEIMs.d.cts +21 -0
- package/dist/write-C3toEIMs.d.ts +21 -0
- package/package.json +137 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { BeginTransactionMessage, TransactionAckMessage, CommitTransactionMessage, ExecuteWriteMessage, WriteAckMessage, RollbackTransactionMessage } from './types/protocol.cjs';
|
|
2
|
+
export { BroadcastMessage, BrowserConnectionInfo, ClientMessage, DEFAULT_DEVTOOLS_HOST, DEFAULT_DEVTOOLS_PORT, DEVICE_SNAPSHOT_API_PATH, DEVTOOLS_WS_PATH, DevToolsMessage, DevToolsMessageBase, DevToolsRole, DeviceMetadata, DeviceStatusMessage, DeviceStatusPayload, ExportSnapshotErrorMessage, ExportSnapshotRequestMessage, HEARTBEAT_INTERVAL_MS, HEARTBEAT_TIMEOUT_MS, MAX_SNAPSHOT_BYTES, MessageType, MessageTypeValue, MobileDeviceInfo, PROJECT_DATABASES_API_PATH, PROJECT_DATABASE_API_PATH, PROJECT_DATABASE_META_API_PATH, PROJECT_DEVICE_EXPORTS_API_PATH, PingMessage, PongMessage, REFRESH_TIMEOUT_MS, RefreshErrorCode, RefreshErrorMessage, RefreshInitiator, RefreshRequestMessage, RefreshState, RefreshStatusMessage, RefreshType, RegisterMessage, SNAPSHOT_API_PATH, SYNC_TIMEOUT_MS, ServerMessage, SnapshotReadyMessage, SnapshotUploadRequestedMessage, SyncErrorCode, SyncState, buildDevToolsHttpUrl, buildDevToolsWsUrl, buildDeviceSnapshotUrl, buildSnapshotUrl, createMessage, isBroadcastMessage, isClientMessage, isDeviceStatusMessage, isExportSnapshotErrorMessage, isExportSnapshotRequestMessage, isPingMessage, isPongMessage, isRefreshErrorMessage, isRefreshRequestMessage, isRefreshStatusMessage, isRegisterMessage, isServerMessage, isSnapshotReadyMessage, isSnapshotUploadRequestedMessage, wsUrlToHttpUrl } from './types/protocol.cjs';
|
|
3
|
+
import { D as DatabaseKind } from './snapshot-Dhyecgo2.cjs';
|
|
4
|
+
export { A as AdapterCapabilities, a as DATABASE_DEVTOOLS_KIND, I as InspectorCapabilities, b as SNAPSHOT_KIND_HEADER, c as SNAPSHOT_MIME_HEADER, d as SNAPSHOT_NAME_HEADER, e as SQLITE_SNAPSHOT_MIME_TYPE, S as SnapshotExport, r as readDatabaseKindMarker } from './snapshot-Dhyecgo2.cjs';
|
|
5
|
+
import { D as DatabaseAdapter } from './adapter-BjJm71wW.cjs';
|
|
6
|
+
export { E as EditableDatabaseAdapter, W as WritableDatabaseAdapter, a as WriteResult, i as isEditableDatabaseAdapter, b as isWritableDatabaseAdapter } from './adapter-BjJm71wW.cjs';
|
|
7
|
+
export { C as ColumnInfo, D as DatabaseInspector, I as InspectorDefinition, c as QueryError, Q as QueryResult, S as SchemaTable, T as TableInfo, a as TablePageRequest, b as TablePageResult } from './types-CIA11diJ.cjs';
|
|
8
|
+
export { D as DeleteOperation, I as InsertOperation, U as UpdateOperation, W as WriteCellValue, a as WriteOperation } from './write-C3toEIMs.cjs';
|
|
9
|
+
export { A as AdapterDefinition, R as ResolveAdapterOptions } from './types-BRLJdBRY.cjs';
|
|
10
|
+
export { AdapterRegistry, AdapterResolutionError, getAdapterRegistry, registerBuiltInAdapters, resetAdapterRegistry, resolveAdapter } from './adapter/index.cjs';
|
|
11
|
+
export { InspectorRegistry, createInspectorForSnapshot, getInspectorRegistry, resetInspectorRegistry } from './inspector/index.cjs';
|
|
12
|
+
import { C as ConnectionState } from './handleDeviceSnapshot-cYGuitSc.cjs';
|
|
13
|
+
export { D as DevToolsClient, a as DevToolsClientOptions, b as DeviceExportMeta, L as ListedDeviceExport, c as ListedProjectDatabase, P as ProjectDatabaseMeta, R as ResolveProjectDatabaseUrlOptions, T as TransactionState, d as createDevToolsClient, f as fetchDeviceExportDatabase, e as fetchDeviceExportMeta, g as fetchDeviceExports, h as fetchProjectDatabase, i as fetchProjectDatabaseMeta, j as fetchProjectDatabases, k as fetchSnapshot, l as handleDeviceSnapshotUpload, r as resolveDeviceExportDatabaseMetaUrl, m as resolveDeviceExportDatabaseUrl, n as resolveDeviceExportsUrl, o as resolveProjectDatabaseMetaUrl, p as resolveProjectDatabaseUrl, q as resolveProjectDatabasesUrl } from './handleDeviceSnapshot-cYGuitSc.cjs';
|
|
14
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
15
|
+
import { StyleProp, TextStyle } from 'react-native';
|
|
16
|
+
export { D as DevToolsServer, b as DevToolsServerOptions, f as createDevToolsServer } from './createDevToolsServer-B7NQ_5H4.cjs';
|
|
17
|
+
export { C as CreateExpoSqliteAdapterOptions, E as ExpoSqliteDatabase, c as createExpoSqliteAdapter, d as detectExpoSqlite, r as registerSqliteAdapter, s as sqliteAdapterDefinition } from './register-BuicFu9L.cjs';
|
|
18
|
+
import 'express';
|
|
19
|
+
import 'node:http';
|
|
20
|
+
import 'ws';
|
|
21
|
+
|
|
22
|
+
/** @deprecated Use `DatabaseKind` from `./kind` instead. */
|
|
23
|
+
type DatabaseDialect = DatabaseKind;
|
|
24
|
+
|
|
25
|
+
type TransactionAckReporter = (message: Omit<TransactionAckMessage, 'timestamp' | 'type'>) => void;
|
|
26
|
+
type WriteAckReporter = (message: Omit<WriteAckMessage, 'timestamp' | 'type'>) => void;
|
|
27
|
+
declare function handleBeginTransaction(adapter: DatabaseAdapter | undefined, message: BeginTransactionMessage, report: TransactionAckReporter): Promise<void>;
|
|
28
|
+
declare function handleCommitTransaction(adapter: DatabaseAdapter | undefined, message: CommitTransactionMessage, report: TransactionAckReporter): Promise<void>;
|
|
29
|
+
declare function handleRollbackTransaction(adapter: DatabaseAdapter | undefined, message: RollbackTransactionMessage, report: TransactionAckReporter): Promise<void>;
|
|
30
|
+
declare function handleExecuteWrite(adapter: DatabaseAdapter | undefined, message: ExecuteWriteMessage, report: WriteAckReporter): Promise<void>;
|
|
31
|
+
|
|
32
|
+
type FloatingButtonPosition = {
|
|
33
|
+
x: number;
|
|
34
|
+
y: number;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
type DatabaseDevToolsProps = {
|
|
38
|
+
/** Raw database instance (auto-detected) or a resolved adapter. */
|
|
39
|
+
database?: unknown;
|
|
40
|
+
/** Explicit database kind override. */
|
|
41
|
+
type?: DatabaseKind;
|
|
42
|
+
/** Custom adapter override (advanced). */
|
|
43
|
+
adapter?: DatabaseAdapter;
|
|
44
|
+
serverUrl?: string;
|
|
45
|
+
enabled?: boolean;
|
|
46
|
+
position?: 'bottom-right' | 'bottom-left';
|
|
47
|
+
/** Allow dragging the floating button around the screen. */
|
|
48
|
+
draggable?: boolean;
|
|
49
|
+
/** Snap the button to screen edges after dragging. */
|
|
50
|
+
snapToEdges?: boolean;
|
|
51
|
+
/** Controlled floating button position. */
|
|
52
|
+
floatingPosition?: FloatingButtonPosition;
|
|
53
|
+
/** Called when the user drags the floating button to a new position. */
|
|
54
|
+
onFloatingPositionChange?: (position: FloatingButtonPosition) => void;
|
|
55
|
+
/** Optional style for the floating button database icon. */
|
|
56
|
+
style?: StyleProp<TextStyle>;
|
|
57
|
+
onConnectionStateChange?: (state: ConnectionState) => void;
|
|
58
|
+
};
|
|
59
|
+
declare function DatabaseDevTools({ database, type, adapter, serverUrl, enabled, position, draggable, snapToEdges, floatingPosition, onFloatingPositionChange, style, onConnectionStateChange, }: DatabaseDevToolsProps): react_jsx_runtime.JSX.Element | null;
|
|
60
|
+
|
|
61
|
+
export { ConnectionState, DatabaseAdapter, DatabaseDevTools, type DatabaseDevToolsProps, type DatabaseDialect, DatabaseKind, type FloatingButtonPosition, handleBeginTransaction, handleCommitTransaction, handleExecuteWrite, handleRollbackTransaction };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { BeginTransactionMessage, TransactionAckMessage, CommitTransactionMessage, ExecuteWriteMessage, WriteAckMessage, RollbackTransactionMessage } from './types/protocol.js';
|
|
2
|
+
export { BroadcastMessage, BrowserConnectionInfo, ClientMessage, DEFAULT_DEVTOOLS_HOST, DEFAULT_DEVTOOLS_PORT, DEVICE_SNAPSHOT_API_PATH, DEVTOOLS_WS_PATH, DevToolsMessage, DevToolsMessageBase, DevToolsRole, DeviceMetadata, DeviceStatusMessage, DeviceStatusPayload, ExportSnapshotErrorMessage, ExportSnapshotRequestMessage, HEARTBEAT_INTERVAL_MS, HEARTBEAT_TIMEOUT_MS, MAX_SNAPSHOT_BYTES, MessageType, MessageTypeValue, MobileDeviceInfo, PROJECT_DATABASES_API_PATH, PROJECT_DATABASE_API_PATH, PROJECT_DATABASE_META_API_PATH, PROJECT_DEVICE_EXPORTS_API_PATH, PingMessage, PongMessage, REFRESH_TIMEOUT_MS, RefreshErrorCode, RefreshErrorMessage, RefreshInitiator, RefreshRequestMessage, RefreshState, RefreshStatusMessage, RefreshType, RegisterMessage, SNAPSHOT_API_PATH, SYNC_TIMEOUT_MS, ServerMessage, SnapshotReadyMessage, SnapshotUploadRequestedMessage, SyncErrorCode, SyncState, buildDevToolsHttpUrl, buildDevToolsWsUrl, buildDeviceSnapshotUrl, buildSnapshotUrl, createMessage, isBroadcastMessage, isClientMessage, isDeviceStatusMessage, isExportSnapshotErrorMessage, isExportSnapshotRequestMessage, isPingMessage, isPongMessage, isRefreshErrorMessage, isRefreshRequestMessage, isRefreshStatusMessage, isRegisterMessage, isServerMessage, isSnapshotReadyMessage, isSnapshotUploadRequestedMessage, wsUrlToHttpUrl } from './types/protocol.js';
|
|
3
|
+
import { D as DatabaseKind } from './snapshot-Dhyecgo2.js';
|
|
4
|
+
export { A as AdapterCapabilities, a as DATABASE_DEVTOOLS_KIND, I as InspectorCapabilities, b as SNAPSHOT_KIND_HEADER, c as SNAPSHOT_MIME_HEADER, d as SNAPSHOT_NAME_HEADER, e as SQLITE_SNAPSHOT_MIME_TYPE, S as SnapshotExport, r as readDatabaseKindMarker } from './snapshot-Dhyecgo2.js';
|
|
5
|
+
import { D as DatabaseAdapter } from './adapter-DJSjDewg.js';
|
|
6
|
+
export { E as EditableDatabaseAdapter, W as WritableDatabaseAdapter, a as WriteResult, i as isEditableDatabaseAdapter, b as isWritableDatabaseAdapter } from './adapter-DJSjDewg.js';
|
|
7
|
+
export { C as ColumnInfo, D as DatabaseInspector, I as InspectorDefinition, c as QueryError, Q as QueryResult, S as SchemaTable, T as TableInfo, a as TablePageRequest, b as TablePageResult } from './types-CKVRCX-e.js';
|
|
8
|
+
export { D as DeleteOperation, I as InsertOperation, U as UpdateOperation, W as WriteCellValue, a as WriteOperation } from './write-C3toEIMs.js';
|
|
9
|
+
export { A as AdapterDefinition, R as ResolveAdapterOptions } from './types-CF6qEU-_.js';
|
|
10
|
+
export { AdapterRegistry, AdapterResolutionError, getAdapterRegistry, registerBuiltInAdapters, resetAdapterRegistry, resolveAdapter } from './adapter/index.js';
|
|
11
|
+
export { InspectorRegistry, createInspectorForSnapshot, getInspectorRegistry, resetInspectorRegistry } from './inspector/index.js';
|
|
12
|
+
import { C as ConnectionState } from './handleDeviceSnapshot-CR-4QMdk.js';
|
|
13
|
+
export { D as DevToolsClient, a as DevToolsClientOptions, b as DeviceExportMeta, L as ListedDeviceExport, c as ListedProjectDatabase, P as ProjectDatabaseMeta, R as ResolveProjectDatabaseUrlOptions, T as TransactionState, d as createDevToolsClient, f as fetchDeviceExportDatabase, e as fetchDeviceExportMeta, g as fetchDeviceExports, h as fetchProjectDatabase, i as fetchProjectDatabaseMeta, j as fetchProjectDatabases, k as fetchSnapshot, l as handleDeviceSnapshotUpload, r as resolveDeviceExportDatabaseMetaUrl, m as resolveDeviceExportDatabaseUrl, n as resolveDeviceExportsUrl, o as resolveProjectDatabaseMetaUrl, p as resolveProjectDatabaseUrl, q as resolveProjectDatabasesUrl } from './handleDeviceSnapshot-CR-4QMdk.js';
|
|
14
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
15
|
+
import { StyleProp, TextStyle } from 'react-native';
|
|
16
|
+
export { D as DevToolsServer, b as DevToolsServerOptions, f as createDevToolsServer } from './createDevToolsServer-DlNMoCJR.js';
|
|
17
|
+
export { C as CreateExpoSqliteAdapterOptions, E as ExpoSqliteDatabase, c as createExpoSqliteAdapter, d as detectExpoSqlite, r as registerSqliteAdapter, s as sqliteAdapterDefinition } from './register-aITLN9Q9.js';
|
|
18
|
+
import 'express';
|
|
19
|
+
import 'node:http';
|
|
20
|
+
import 'ws';
|
|
21
|
+
|
|
22
|
+
/** @deprecated Use `DatabaseKind` from `./kind` instead. */
|
|
23
|
+
type DatabaseDialect = DatabaseKind;
|
|
24
|
+
|
|
25
|
+
type TransactionAckReporter = (message: Omit<TransactionAckMessage, 'timestamp' | 'type'>) => void;
|
|
26
|
+
type WriteAckReporter = (message: Omit<WriteAckMessage, 'timestamp' | 'type'>) => void;
|
|
27
|
+
declare function handleBeginTransaction(adapter: DatabaseAdapter | undefined, message: BeginTransactionMessage, report: TransactionAckReporter): Promise<void>;
|
|
28
|
+
declare function handleCommitTransaction(adapter: DatabaseAdapter | undefined, message: CommitTransactionMessage, report: TransactionAckReporter): Promise<void>;
|
|
29
|
+
declare function handleRollbackTransaction(adapter: DatabaseAdapter | undefined, message: RollbackTransactionMessage, report: TransactionAckReporter): Promise<void>;
|
|
30
|
+
declare function handleExecuteWrite(adapter: DatabaseAdapter | undefined, message: ExecuteWriteMessage, report: WriteAckReporter): Promise<void>;
|
|
31
|
+
|
|
32
|
+
type FloatingButtonPosition = {
|
|
33
|
+
x: number;
|
|
34
|
+
y: number;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
type DatabaseDevToolsProps = {
|
|
38
|
+
/** Raw database instance (auto-detected) or a resolved adapter. */
|
|
39
|
+
database?: unknown;
|
|
40
|
+
/** Explicit database kind override. */
|
|
41
|
+
type?: DatabaseKind;
|
|
42
|
+
/** Custom adapter override (advanced). */
|
|
43
|
+
adapter?: DatabaseAdapter;
|
|
44
|
+
serverUrl?: string;
|
|
45
|
+
enabled?: boolean;
|
|
46
|
+
position?: 'bottom-right' | 'bottom-left';
|
|
47
|
+
/** Allow dragging the floating button around the screen. */
|
|
48
|
+
draggable?: boolean;
|
|
49
|
+
/** Snap the button to screen edges after dragging. */
|
|
50
|
+
snapToEdges?: boolean;
|
|
51
|
+
/** Controlled floating button position. */
|
|
52
|
+
floatingPosition?: FloatingButtonPosition;
|
|
53
|
+
/** Called when the user drags the floating button to a new position. */
|
|
54
|
+
onFloatingPositionChange?: (position: FloatingButtonPosition) => void;
|
|
55
|
+
/** Optional style for the floating button database icon. */
|
|
56
|
+
style?: StyleProp<TextStyle>;
|
|
57
|
+
onConnectionStateChange?: (state: ConnectionState) => void;
|
|
58
|
+
};
|
|
59
|
+
declare function DatabaseDevTools({ database, type, adapter, serverUrl, enabled, position, draggable, snapToEdges, floatingPosition, onFloatingPositionChange, style, onConnectionStateChange, }: DatabaseDevToolsProps): react_jsx_runtime.JSX.Element | null;
|
|
60
|
+
|
|
61
|
+
export { ConnectionState, DatabaseAdapter, DatabaseDevTools, type DatabaseDevToolsProps, type DatabaseDialect, DatabaseKind, type FloatingButtonPosition, handleBeginTransaction, handleCommitTransaction, handleExecuteWrite, handleRollbackTransaction };
|