@geekmidas/studio 0.2.0 → 1.0.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/CHANGELOG.md +13 -0
- package/dist/{DataBrowser-hGwiTffZ.d.cts → DataBrowser-B-jz8KBR.d.mts} +5 -2
- package/dist/DataBrowser-B-jz8KBR.d.mts.map +1 -0
- package/dist/{DataBrowser-SOcqmZb2.d.mts → DataBrowser-BTe9HWJy.d.cts} +5 -2
- package/dist/DataBrowser-BTe9HWJy.d.cts.map +1 -0
- package/dist/{DataBrowser-c-Gs6PZB.cjs → DataBrowser-D8c_pBf4.cjs} +4 -4
- package/dist/DataBrowser-D8c_pBf4.cjs.map +1 -0
- package/dist/{DataBrowser-DQ3-ZxdV.mjs → DataBrowser-kgcI9ApJ.mjs} +4 -4
- package/dist/DataBrowser-kgcI9ApJ.mjs.map +1 -0
- package/dist/Studio-CYzz3wD2.d.cts +152 -0
- package/dist/Studio-CYzz3wD2.d.cts.map +1 -0
- package/dist/Studio-D5yGscb8.d.mts +152 -0
- package/dist/Studio-D5yGscb8.d.mts.map +1 -0
- package/dist/data/index.cjs +1 -1
- package/dist/data/index.d.cts +1 -1
- package/dist/data/index.d.mts +1 -1
- package/dist/data/index.mjs +1 -1
- package/dist/index.cjs +33 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -131
- package/dist/index.d.mts +4 -131
- package/dist/index.mjs +33 -3
- package/dist/index.mjs.map +1 -1
- package/dist/server/hono.cjs +168 -21
- package/dist/server/hono.cjs.map +1 -1
- package/dist/server/hono.d.cts +13 -2
- package/dist/server/hono.d.cts.map +1 -0
- package/dist/server/hono.d.mts +13 -2
- package/dist/server/hono.d.mts.map +1 -0
- package/dist/server/hono.mjs +168 -21
- package/dist/server/hono.mjs.map +1 -1
- package/dist/types-BZv87Ikv.mjs.map +1 -1
- package/dist/types-CMttUZYk.cjs.map +1 -1
- package/package.json +5 -5
- package/src/Studio.ts +341 -292
- package/src/__tests__/Studio.spec.ts +447 -0
- package/src/data/DataBrowser.ts +147 -143
- package/src/data/__tests__/DataBrowser.integration.spec.ts +404 -404
- package/src/data/__tests__/filtering.integration.spec.ts +726 -726
- package/src/data/__tests__/introspection.integration.spec.ts +340 -340
- package/src/data/__tests__/pagination.spec.ts +123 -0
- package/src/data/filtering.ts +154 -154
- package/src/data/introspection.ts +141 -141
- package/src/data/pagination.ts +15 -15
- package/src/index.ts +22 -24
- package/src/server/__tests__/hono.integration.spec.ts +605 -347
- package/src/server/hono.ts +392 -190
- package/src/types.ts +138 -138
- package/src/ui-assets.ts +10 -13
- package/tsconfig.json +9 -0
- package/tsdown.config.ts +9 -9
- package/ui/CHANGELOG.md +12 -0
- package/ui/package.json +28 -22
- package/ui/src/App.tsx +95 -235
- package/ui/src/api.ts +184 -42
- package/ui/src/components/FilterPanel.tsx +198 -198
- package/ui/src/components/NavRail.tsx +183 -0
- package/ui/src/components/RowDetail.tsx +106 -106
- package/ui/src/components/StudioHeader.tsx +109 -0
- package/ui/src/components/TableList.tsx +49 -49
- package/ui/src/components/TableView.tsx +530 -485
- package/ui/src/main.tsx +3 -3
- package/ui/src/pages/DashboardPage.tsx +500 -0
- package/ui/src/pages/DatabasePage.tsx +226 -0
- package/ui/src/pages/EndpointDetailsPage.tsx +288 -0
- package/ui/src/pages/ExceptionsPage.tsx +268 -0
- package/ui/src/pages/LogsPage.tsx +228 -0
- package/ui/src/pages/MonitoringPage.tsx +46 -0
- package/ui/src/pages/PerformancePage.tsx +307 -0
- package/ui/src/pages/RequestsPage.tsx +379 -0
- package/ui/src/providers/StudioProvider.tsx +194 -0
- package/ui/src/styles.css +53 -142
- package/ui/src/types.ts +154 -30
- package/ui/tsconfig.tsbuildinfo +1 -1
- package/ui/vite.config.ts +6 -6
- package/dist/DataBrowser-DQ3-ZxdV.mjs.map +0 -1
- package/dist/DataBrowser-c-Gs6PZB.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-BZv87Ikv.mjs","names":[],"sources":["../src/types.ts"],"sourcesContent":["import type { TelescopeStorage } from '@geekmidas/telescope';\nimport type { Kysely } from 'kysely';\n\n// ============================================\n// Enums\n// ============================================\n\n/**\n * Sort direction for cursor-based pagination and sorting.\n */\nexport enum Direction {\n
|
|
1
|
+
{"version":3,"file":"types-BZv87Ikv.mjs","names":[],"sources":["../src/types.ts"],"sourcesContent":["import type { TelescopeStorage } from '@geekmidas/telescope';\nimport type { Kysely } from 'kysely';\n\n// ============================================\n// Enums\n// ============================================\n\n/**\n * Sort direction for cursor-based pagination and sorting.\n */\nexport enum Direction {\n\tAsc = 'asc',\n\tDesc = 'desc',\n}\n\n/**\n * Filter operators for querying data.\n */\nexport enum FilterOperator {\n\tEq = 'eq',\n\tNeq = 'neq',\n\tGt = 'gt',\n\tGte = 'gte',\n\tLt = 'lt',\n\tLte = 'lte',\n\tLike = 'like',\n\tIlike = 'ilike',\n\tIn = 'in',\n\tNin = 'nin',\n\tIsNull = 'is_null',\n\tIsNotNull = 'is_not_null',\n}\n\n// ============================================\n// Cursor Configuration\n// ============================================\n\n/**\n * Configuration for cursor-based pagination.\n */\nexport interface CursorConfig {\n\t/** The field to use for cursor-based pagination (e.g., 'id', 'created_at') */\n\tfield: string;\n\t/** Sort direction for the cursor field */\n\tdirection: Direction;\n}\n\n/**\n * Per-table cursor configuration overrides.\n */\nexport interface TableCursorConfig {\n\t[tableName: string]: CursorConfig;\n}\n\n// ============================================\n// Monitoring Configuration\n// ============================================\n\n/**\n * Configuration for the monitoring feature (Telescope).\n */\nexport interface MonitoringOptions {\n\t/** Storage backend for monitoring data */\n\tstorage: TelescopeStorage;\n\t/** Patterns to ignore when recording requests (supports wildcards) */\n\tignorePatterns?: string[];\n\t/** Whether to record request/response bodies (default: true) */\n\trecordBody?: boolean;\n\t/** Maximum body size to record in bytes (default: 64KB) */\n\tmaxBodySize?: number;\n\t/** Hours after which to prune old entries */\n\tpruneAfterHours?: number;\n}\n\n// ============================================\n// Data Browser Configuration\n// ============================================\n\n/**\n * Configuration for the data browser feature.\n */\nexport interface DataBrowserOptions<DB = unknown> {\n\t/** Kysely database instance */\n\tdb: Kysely<DB>;\n\t/** Default cursor configuration for all tables */\n\tcursor: CursorConfig;\n\t/** Per-table cursor overrides */\n\ttableCursors?: TableCursorConfig;\n\t/** Tables to exclude from browsing */\n\texcludeTables?: string[];\n\t/** Maximum rows per page (default: 50, max: 100) */\n\tdefaultPageSize?: number;\n\t/** Whether to allow viewing of binary/blob columns (default: false) */\n\tshowBinaryColumns?: boolean;\n}\n\n// ============================================\n// Studio Configuration\n// ============================================\n\n/**\n * Configuration for the Studio dashboard.\n */\nexport interface StudioOptions<DB = unknown> {\n\t/** Monitoring configuration */\n\tmonitoring: MonitoringOptions;\n\t/** Data browser configuration */\n\tdata: DataBrowserOptions<DB>;\n\t/** Dashboard path (default: '/__studio') */\n\tpath?: string;\n\t/** Whether Studio is enabled (default: true) */\n\tenabled?: boolean;\n}\n\n/**\n * Normalized Studio options with all defaults applied.\n */\nexport interface NormalizedStudioOptions<DB = unknown> {\n\tmonitoring: Required<MonitoringOptions>;\n\tdata: Required<DataBrowserOptions<DB>>;\n\tpath: string;\n\tenabled: boolean;\n}\n\n// ============================================\n// Table Introspection Types\n// ============================================\n\n/**\n * Generic column type classification.\n */\nexport type ColumnType =\n\t| 'string'\n\t| 'number'\n\t| 'boolean'\n\t| 'date'\n\t| 'datetime'\n\t| 'json'\n\t| 'binary'\n\t| 'uuid'\n\t| 'unknown';\n\n/**\n * Information about a database column.\n */\nexport interface ColumnInfo {\n\t/** Column name */\n\tname: string;\n\t/** Generic column type */\n\ttype: ColumnType;\n\t/** Raw database type (e.g., 'varchar', 'int4') */\n\trawType: string;\n\t/** Whether the column allows NULL values */\n\tnullable: boolean;\n\t/** Whether this column is part of the primary key */\n\tisPrimaryKey: boolean;\n\t/** Whether this column is a foreign key */\n\tisForeignKey: boolean;\n\t/** Referenced table if foreign key */\n\tforeignKeyTable?: string;\n\t/** Referenced column if foreign key */\n\tforeignKeyColumn?: string;\n\t/** Default value expression */\n\tdefaultValue?: string;\n}\n\n/**\n * Information about a database table.\n */\nexport interface TableInfo {\n\t/** Table name */\n\tname: string;\n\t/** Schema name (e.g., 'public') */\n\tschema: string;\n\t/** List of columns */\n\tcolumns: ColumnInfo[];\n\t/** Primary key column names */\n\tprimaryKey: string[];\n\t/** Estimated row count (if available) */\n\testimatedRowCount?: number;\n}\n\n/**\n * Complete schema information.\n */\nexport interface SchemaInfo {\n\t/** List of tables */\n\ttables: TableInfo[];\n\t/** When the schema was last introspected */\n\tupdatedAt: Date;\n}\n\n// ============================================\n// Query Types\n// ============================================\n\n/**\n * A single filter condition.\n */\nexport interface FilterCondition {\n\t/** Column to filter on */\n\tcolumn: string;\n\t/** Filter operator */\n\toperator: FilterOperator;\n\t/** Value to compare against (optional for IsNull/IsNotNull operators) */\n\tvalue?: unknown;\n}\n\n/**\n * Sort configuration for a column.\n */\nexport interface SortConfig {\n\t/** Column to sort by */\n\tcolumn: string;\n\t/** Sort direction */\n\tdirection: Direction;\n}\n\n/**\n * Options for querying table data.\n */\nexport interface QueryOptions {\n\t/** Table to query */\n\ttable: string;\n\t/** Filter conditions */\n\tfilters?: FilterCondition[];\n\t/** Sort configuration */\n\tsort?: SortConfig[];\n\t/** Cursor for pagination */\n\tcursor?: string | null;\n\t/** Number of rows per page */\n\tpageSize?: number;\n\t/** Pagination direction */\n\tdirection?: 'next' | 'prev';\n}\n\n/**\n * Result of a paginated query.\n */\nexport interface QueryResult<T = Record<string, unknown>> {\n\t/** Retrieved rows */\n\trows: T[];\n\t/** Whether there are more rows */\n\thasMore: boolean;\n\t/** Cursor for next page */\n\tnextCursor: string | null;\n\t/** Cursor for previous page */\n\tprevCursor: string | null;\n\t/** Estimated total row count */\n\ttotalEstimate?: number;\n}\n\n// ============================================\n// WebSocket Events\n// ============================================\n\n/**\n * Types of events broadcast via WebSocket.\n */\nexport type StudioEventType =\n\t| 'request'\n\t| 'exception'\n\t| 'log'\n\t| 'stats'\n\t| 'connected'\n\t| 'schema_updated';\n\n/**\n * A WebSocket event payload.\n */\nexport interface StudioEvent<T = unknown> {\n\t/** Event type */\n\ttype: StudioEventType;\n\t/** Event payload */\n\tpayload: T;\n\t/** Event timestamp */\n\ttimestamp: number;\n}\n"],"mappings":";;;;AAUA,IAAY,kDAAL;AACN;AACA;;AACA;;;;AAKD,IAAY,4DAAL;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-CMttUZYk.cjs","names":[],"sources":["../src/types.ts"],"sourcesContent":["import type { TelescopeStorage } from '@geekmidas/telescope';\nimport type { Kysely } from 'kysely';\n\n// ============================================\n// Enums\n// ============================================\n\n/**\n * Sort direction for cursor-based pagination and sorting.\n */\nexport enum Direction {\n
|
|
1
|
+
{"version":3,"file":"types-CMttUZYk.cjs","names":[],"sources":["../src/types.ts"],"sourcesContent":["import type { TelescopeStorage } from '@geekmidas/telescope';\nimport type { Kysely } from 'kysely';\n\n// ============================================\n// Enums\n// ============================================\n\n/**\n * Sort direction for cursor-based pagination and sorting.\n */\nexport enum Direction {\n\tAsc = 'asc',\n\tDesc = 'desc',\n}\n\n/**\n * Filter operators for querying data.\n */\nexport enum FilterOperator {\n\tEq = 'eq',\n\tNeq = 'neq',\n\tGt = 'gt',\n\tGte = 'gte',\n\tLt = 'lt',\n\tLte = 'lte',\n\tLike = 'like',\n\tIlike = 'ilike',\n\tIn = 'in',\n\tNin = 'nin',\n\tIsNull = 'is_null',\n\tIsNotNull = 'is_not_null',\n}\n\n// ============================================\n// Cursor Configuration\n// ============================================\n\n/**\n * Configuration for cursor-based pagination.\n */\nexport interface CursorConfig {\n\t/** The field to use for cursor-based pagination (e.g., 'id', 'created_at') */\n\tfield: string;\n\t/** Sort direction for the cursor field */\n\tdirection: Direction;\n}\n\n/**\n * Per-table cursor configuration overrides.\n */\nexport interface TableCursorConfig {\n\t[tableName: string]: CursorConfig;\n}\n\n// ============================================\n// Monitoring Configuration\n// ============================================\n\n/**\n * Configuration for the monitoring feature (Telescope).\n */\nexport interface MonitoringOptions {\n\t/** Storage backend for monitoring data */\n\tstorage: TelescopeStorage;\n\t/** Patterns to ignore when recording requests (supports wildcards) */\n\tignorePatterns?: string[];\n\t/** Whether to record request/response bodies (default: true) */\n\trecordBody?: boolean;\n\t/** Maximum body size to record in bytes (default: 64KB) */\n\tmaxBodySize?: number;\n\t/** Hours after which to prune old entries */\n\tpruneAfterHours?: number;\n}\n\n// ============================================\n// Data Browser Configuration\n// ============================================\n\n/**\n * Configuration for the data browser feature.\n */\nexport interface DataBrowserOptions<DB = unknown> {\n\t/** Kysely database instance */\n\tdb: Kysely<DB>;\n\t/** Default cursor configuration for all tables */\n\tcursor: CursorConfig;\n\t/** Per-table cursor overrides */\n\ttableCursors?: TableCursorConfig;\n\t/** Tables to exclude from browsing */\n\texcludeTables?: string[];\n\t/** Maximum rows per page (default: 50, max: 100) */\n\tdefaultPageSize?: number;\n\t/** Whether to allow viewing of binary/blob columns (default: false) */\n\tshowBinaryColumns?: boolean;\n}\n\n// ============================================\n// Studio Configuration\n// ============================================\n\n/**\n * Configuration for the Studio dashboard.\n */\nexport interface StudioOptions<DB = unknown> {\n\t/** Monitoring configuration */\n\tmonitoring: MonitoringOptions;\n\t/** Data browser configuration */\n\tdata: DataBrowserOptions<DB>;\n\t/** Dashboard path (default: '/__studio') */\n\tpath?: string;\n\t/** Whether Studio is enabled (default: true) */\n\tenabled?: boolean;\n}\n\n/**\n * Normalized Studio options with all defaults applied.\n */\nexport interface NormalizedStudioOptions<DB = unknown> {\n\tmonitoring: Required<MonitoringOptions>;\n\tdata: Required<DataBrowserOptions<DB>>;\n\tpath: string;\n\tenabled: boolean;\n}\n\n// ============================================\n// Table Introspection Types\n// ============================================\n\n/**\n * Generic column type classification.\n */\nexport type ColumnType =\n\t| 'string'\n\t| 'number'\n\t| 'boolean'\n\t| 'date'\n\t| 'datetime'\n\t| 'json'\n\t| 'binary'\n\t| 'uuid'\n\t| 'unknown';\n\n/**\n * Information about a database column.\n */\nexport interface ColumnInfo {\n\t/** Column name */\n\tname: string;\n\t/** Generic column type */\n\ttype: ColumnType;\n\t/** Raw database type (e.g., 'varchar', 'int4') */\n\trawType: string;\n\t/** Whether the column allows NULL values */\n\tnullable: boolean;\n\t/** Whether this column is part of the primary key */\n\tisPrimaryKey: boolean;\n\t/** Whether this column is a foreign key */\n\tisForeignKey: boolean;\n\t/** Referenced table if foreign key */\n\tforeignKeyTable?: string;\n\t/** Referenced column if foreign key */\n\tforeignKeyColumn?: string;\n\t/** Default value expression */\n\tdefaultValue?: string;\n}\n\n/**\n * Information about a database table.\n */\nexport interface TableInfo {\n\t/** Table name */\n\tname: string;\n\t/** Schema name (e.g., 'public') */\n\tschema: string;\n\t/** List of columns */\n\tcolumns: ColumnInfo[];\n\t/** Primary key column names */\n\tprimaryKey: string[];\n\t/** Estimated row count (if available) */\n\testimatedRowCount?: number;\n}\n\n/**\n * Complete schema information.\n */\nexport interface SchemaInfo {\n\t/** List of tables */\n\ttables: TableInfo[];\n\t/** When the schema was last introspected */\n\tupdatedAt: Date;\n}\n\n// ============================================\n// Query Types\n// ============================================\n\n/**\n * A single filter condition.\n */\nexport interface FilterCondition {\n\t/** Column to filter on */\n\tcolumn: string;\n\t/** Filter operator */\n\toperator: FilterOperator;\n\t/** Value to compare against (optional for IsNull/IsNotNull operators) */\n\tvalue?: unknown;\n}\n\n/**\n * Sort configuration for a column.\n */\nexport interface SortConfig {\n\t/** Column to sort by */\n\tcolumn: string;\n\t/** Sort direction */\n\tdirection: Direction;\n}\n\n/**\n * Options for querying table data.\n */\nexport interface QueryOptions {\n\t/** Table to query */\n\ttable: string;\n\t/** Filter conditions */\n\tfilters?: FilterCondition[];\n\t/** Sort configuration */\n\tsort?: SortConfig[];\n\t/** Cursor for pagination */\n\tcursor?: string | null;\n\t/** Number of rows per page */\n\tpageSize?: number;\n\t/** Pagination direction */\n\tdirection?: 'next' | 'prev';\n}\n\n/**\n * Result of a paginated query.\n */\nexport interface QueryResult<T = Record<string, unknown>> {\n\t/** Retrieved rows */\n\trows: T[];\n\t/** Whether there are more rows */\n\thasMore: boolean;\n\t/** Cursor for next page */\n\tnextCursor: string | null;\n\t/** Cursor for previous page */\n\tprevCursor: string | null;\n\t/** Estimated total row count */\n\ttotalEstimate?: number;\n}\n\n// ============================================\n// WebSocket Events\n// ============================================\n\n/**\n * Types of events broadcast via WebSocket.\n */\nexport type StudioEventType =\n\t| 'request'\n\t| 'exception'\n\t| 'log'\n\t| 'stats'\n\t| 'connected'\n\t| 'schema_updated';\n\n/**\n * A WebSocket event payload.\n */\nexport interface StudioEvent<T = unknown> {\n\t/** Event type */\n\ttype: StudioEventType;\n\t/** Event payload */\n\tpayload: T;\n\t/** Event timestamp */\n\ttimestamp: number;\n}\n"],"mappings":";;;;;AAUA,IAAY,kDAAL;AACN;AACA;;AACA;;;;AAKD,IAAY,4DAAL;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geekmidas/studio",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Unified development tools dashboard with database browser and request monitoring",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"hono": "^4.0.0",
|
|
36
36
|
"kysely": "^0.28.0",
|
|
37
|
-
"@geekmidas/db": "^0.
|
|
38
|
-
"@geekmidas/telescope": "^0.
|
|
37
|
+
"@geekmidas/db": "^1.0.0",
|
|
38
|
+
"@geekmidas/telescope": "^1.0.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependenciesMeta": {
|
|
41
41
|
"@geekmidas/db": {
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"hono": "^4.7.0",
|
|
54
54
|
"kysely": "~0.28.2",
|
|
55
55
|
"pg": "~8.16.3",
|
|
56
|
-
"@geekmidas/db": "^0.
|
|
57
|
-
"@geekmidas/telescope": "^0.
|
|
56
|
+
"@geekmidas/db": "^1.0.0",
|
|
57
|
+
"@geekmidas/telescope": "^1.0.0"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
60
|
"build:ui": "pnpm --filter @geekmidas/studio-ui build && tsx ../ui/scripts/embed-ui.ts dist/ui src/ui-assets.ts"
|