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.
Files changed (94) hide show
  1. package/LICENSE +5 -0
  2. package/dist/adapter/index.cjs +314 -0
  3. package/dist/adapter/index.cjs.map +1 -0
  4. package/dist/adapter/index.d.cts +34 -0
  5. package/dist/adapter/index.d.ts +34 -0
  6. package/dist/adapter/index.js +6 -0
  7. package/dist/adapter/index.js.map +1 -0
  8. package/dist/adapter-BjJm71wW.d.cts +30 -0
  9. package/dist/adapter-DJSjDewg.d.ts +30 -0
  10. package/dist/adapters/sqlite/index.cjs +251 -0
  11. package/dist/adapters/sqlite/index.cjs.map +1 -0
  12. package/dist/adapters/sqlite/index.d.cts +21 -0
  13. package/dist/adapters/sqlite/index.d.ts +21 -0
  14. package/dist/adapters/sqlite/index.js +6 -0
  15. package/dist/adapters/sqlite/index.js.map +1 -0
  16. package/dist/chunk-2JGL2JVD.js +52 -0
  17. package/dist/chunk-2JGL2JVD.js.map +1 -0
  18. package/dist/chunk-AZECU6D7.js +27 -0
  19. package/dist/chunk-AZECU6D7.js.map +1 -0
  20. package/dist/chunk-BLOSGEQV.js +71 -0
  21. package/dist/chunk-BLOSGEQV.js.map +1 -0
  22. package/dist/chunk-CPVVIH5G.js +258 -0
  23. package/dist/chunk-CPVVIH5G.js.map +1 -0
  24. package/dist/chunk-DGUM43GV.js +10 -0
  25. package/dist/chunk-DGUM43GV.js.map +1 -0
  26. package/dist/chunk-HIDZTOJ3.js +9 -0
  27. package/dist/chunk-HIDZTOJ3.js.map +1 -0
  28. package/dist/chunk-I65IM47D.js +243 -0
  29. package/dist/chunk-I65IM47D.js.map +1 -0
  30. package/dist/chunk-MXVIGMVT.js +3 -0
  31. package/dist/chunk-MXVIGMVT.js.map +1 -0
  32. package/dist/chunk-O6AO7KHA.js +3 -0
  33. package/dist/chunk-O6AO7KHA.js.map +1 -0
  34. package/dist/chunk-TNDOAHT5.js +1784 -0
  35. package/dist/chunk-TNDOAHT5.js.map +1 -0
  36. package/dist/chunk-ZS5MZR75.js +655 -0
  37. package/dist/chunk-ZS5MZR75.js.map +1 -0
  38. package/dist/cli.cjs +2053 -0
  39. package/dist/cli.cjs.map +1 -0
  40. package/dist/client/index.cjs +947 -0
  41. package/dist/client/index.cjs.map +1 -0
  42. package/dist/client/index.d.cts +75 -0
  43. package/dist/client/index.d.ts +75 -0
  44. package/dist/client/index.js +98 -0
  45. package/dist/client/index.js.map +1 -0
  46. package/dist/createDevToolsServer-B7NQ_5H4.d.cts +292 -0
  47. package/dist/createDevToolsServer-DlNMoCJR.d.ts +292 -0
  48. package/dist/handleDeviceSnapshot-CR-4QMdk.d.ts +116 -0
  49. package/dist/handleDeviceSnapshot-cYGuitSc.d.cts +116 -0
  50. package/dist/index.cjs +5877 -0
  51. package/dist/index.cjs.map +1 -0
  52. package/dist/index.d.cts +61 -0
  53. package/dist/index.d.ts +61 -0
  54. package/dist/index.js +2748 -0
  55. package/dist/index.js.map +1 -0
  56. package/dist/inspector/index.cjs +57 -0
  57. package/dist/inspector/index.cjs.map +1 -0
  58. package/dist/inspector/index.d.cts +26 -0
  59. package/dist/inspector/index.d.ts +26 -0
  60. package/dist/inspector/index.js +5 -0
  61. package/dist/inspector/index.js.map +1 -0
  62. package/dist/inspectors/sqlite/index.cjs +306 -0
  63. package/dist/inspectors/sqlite/index.cjs.map +1 -0
  64. package/dist/inspectors/sqlite/index.d.cts +53 -0
  65. package/dist/inspectors/sqlite/index.d.ts +53 -0
  66. package/dist/inspectors/sqlite/index.js +260 -0
  67. package/dist/inspectors/sqlite/index.js.map +1 -0
  68. package/dist/register-BuicFu9L.d.cts +32 -0
  69. package/dist/register-aITLN9Q9.d.ts +32 -0
  70. package/dist/server/index.cjs +1948 -0
  71. package/dist/server/index.cjs.map +1 -0
  72. package/dist/server/index.d.cts +15 -0
  73. package/dist/server/index.d.ts +15 -0
  74. package/dist/server/index.js +7 -0
  75. package/dist/server/index.js.map +1 -0
  76. package/dist/snapshot-Dhyecgo2.d.cts +33 -0
  77. package/dist/snapshot-Dhyecgo2.d.ts +33 -0
  78. package/dist/types/protocol.cjs +309 -0
  79. package/dist/types/protocol.cjs.map +1 -0
  80. package/dist/types/protocol.d.cts +291 -0
  81. package/dist/types/protocol.d.ts +291 -0
  82. package/dist/types/protocol.js +4 -0
  83. package/dist/types/protocol.js.map +1 -0
  84. package/dist/types-BRLJdBRY.d.cts +16 -0
  85. package/dist/types-CF6qEU-_.d.ts +16 -0
  86. package/dist/types-CIA11diJ.d.cts +62 -0
  87. package/dist/types-CKVRCX-e.d.ts +62 -0
  88. package/dist/web/assets/index-CLEaIsUd.css +1 -0
  89. package/dist/web/assets/index-DQrPRTOy.js +100 -0
  90. package/dist/web/assets/sql-wasm-UFUCzYNW.wasm +0 -0
  91. package/dist/web/index.html +26 -0
  92. package/dist/write-C3toEIMs.d.cts +21 -0
  93. package/dist/write-C3toEIMs.d.ts +21 -0
  94. package/package.json +137 -0
@@ -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 };
@@ -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 };