mirror of
https://github.com/Dvorinka/Primora.git
synced 2026-10-28 07:41:23 +00:00
feat: phase 2 databases via DBX (v0.3.0)
- dbx-mcp persistent stdio subprocess in Go backend (internal/dbx), lazy start + single retry, tool failures surface as 502 - core.db_connections registry: per-project connections, credentials server-side only, managed entries protected (409) - platform-postgres + platform-dragonfly auto-register per project - REST proxy: list/create/delete/test, databases, tables, describe, schema context, SQL query, redis command - Databases page: connection list, schema/table browser, column inspector, SQL editor with result grid + row detail, redis console - backend image moved to debian-slim for glibc; pinned dbx release with SHA256 verification Authored By: TDvorak <[email protected]>
This commit is contained in:
1 parent
420502eec1
commit
627bd89d5e
71 files changed
+3685
-49
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@primora/api-client",
|
||||
"version": "0.2.0",
|
||||
"version": "0.3.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"main": "./src/index.ts",
|
||||
|
||||
@@ -23,15 +23,32 @@ export type { BucketObjectListResponse } from './models/BucketObjectListResponse
|
||||
export type { Collection } from './models/Collection';
|
||||
export type { CollectionID } from './models/CollectionID';
|
||||
export type { CollectionListResponse } from './models/CollectionListResponse';
|
||||
export type { ConnectionID } from './models/ConnectionID';
|
||||
export type { CopyBucketObjectRequest } from './models/CopyBucketObjectRequest';
|
||||
export type { CreateApiKeyRequest } from './models/CreateApiKeyRequest';
|
||||
export { CreateBucketRequest } from './models/CreateBucketRequest';
|
||||
export type { CreateCollectionRequest } from './models/CreateCollectionRequest';
|
||||
export type { CreatedApiKey } from './models/CreatedApiKey';
|
||||
export { CreateDBConnectionRequest } from './models/CreateDBConnectionRequest';
|
||||
export type { CreateDocumentRequest } from './models/CreateDocumentRequest';
|
||||
export { CreateInvitationRequest } from './models/CreateInvitationRequest';
|
||||
export type { CreateOrganizationRequest } from './models/CreateOrganizationRequest';
|
||||
export type { CreateProjectRequest } from './models/CreateProjectRequest';
|
||||
export type { DatabaseQuery } from './models/DatabaseQuery';
|
||||
export type { DBConnection } from './models/DBConnection';
|
||||
export type { DBConnectionListResponse } from './models/DBConnectionListResponse';
|
||||
export type { DBConnectionTestResult } from './models/DBConnectionTestResult';
|
||||
export type { DBDatabaseListResponse } from './models/DBDatabaseListResponse';
|
||||
export type { DBDescribeResponse } from './models/DBDescribeResponse';
|
||||
export type { DBMDTable } from './models/DBMDTable';
|
||||
export type { DBObject } from './models/DBObject';
|
||||
export type { DBQueryRequest } from './models/DBQueryRequest';
|
||||
export type { DBQueryResponse } from './models/DBQueryResponse';
|
||||
export type { DBRedisRequest } from './models/DBRedisRequest';
|
||||
export type { DBRedisResponse } from './models/DBRedisResponse';
|
||||
export type { DBSchemaContextResponse } from './models/DBSchemaContextResponse';
|
||||
export type { DBTableListResponse } from './models/DBTableListResponse';
|
||||
export type { DBXStatus } from './models/DBXStatus';
|
||||
export type { Document } from './models/Document';
|
||||
export type { DocumentID } from './models/DocumentID';
|
||||
export type { DocumentListResponse } from './models/DocumentListResponse';
|
||||
@@ -55,6 +72,8 @@ export { ProjectMember } from './models/ProjectMember';
|
||||
export type { ProjectOverview } from './models/ProjectOverview';
|
||||
export type { ProjectSummary } from './models/ProjectSummary';
|
||||
export type { ReadinessStatus } from './models/ReadinessStatus';
|
||||
export type { SchemaQuery } from './models/SchemaQuery';
|
||||
export type { TableQuery } from './models/TableQuery';
|
||||
export type { UpdateBucketObjectRequest } from './models/UpdateBucketObjectRequest';
|
||||
export { UpdateBucketRequest } from './models/UpdateBucketRequest';
|
||||
export type { UpdateCollectionRequest } from './models/UpdateCollectionRequest';
|
||||
@@ -82,15 +101,32 @@ export { $BucketObjectListResponse } from './schemas/$BucketObjectListResponse';
|
||||
export { $Collection } from './schemas/$Collection';
|
||||
export { $CollectionID } from './schemas/$CollectionID';
|
||||
export { $CollectionListResponse } from './schemas/$CollectionListResponse';
|
||||
export { $ConnectionID } from './schemas/$ConnectionID';
|
||||
export { $CopyBucketObjectRequest } from './schemas/$CopyBucketObjectRequest';
|
||||
export { $CreateApiKeyRequest } from './schemas/$CreateApiKeyRequest';
|
||||
export { $CreateBucketRequest } from './schemas/$CreateBucketRequest';
|
||||
export { $CreateCollectionRequest } from './schemas/$CreateCollectionRequest';
|
||||
export { $CreatedApiKey } from './schemas/$CreatedApiKey';
|
||||
export { $CreateDBConnectionRequest } from './schemas/$CreateDBConnectionRequest';
|
||||
export { $CreateDocumentRequest } from './schemas/$CreateDocumentRequest';
|
||||
export { $CreateInvitationRequest } from './schemas/$CreateInvitationRequest';
|
||||
export { $CreateOrganizationRequest } from './schemas/$CreateOrganizationRequest';
|
||||
export { $CreateProjectRequest } from './schemas/$CreateProjectRequest';
|
||||
export { $DatabaseQuery } from './schemas/$DatabaseQuery';
|
||||
export { $DBConnection } from './schemas/$DBConnection';
|
||||
export { $DBConnectionListResponse } from './schemas/$DBConnectionListResponse';
|
||||
export { $DBConnectionTestResult } from './schemas/$DBConnectionTestResult';
|
||||
export { $DBDatabaseListResponse } from './schemas/$DBDatabaseListResponse';
|
||||
export { $DBDescribeResponse } from './schemas/$DBDescribeResponse';
|
||||
export { $DBMDTable } from './schemas/$DBMDTable';
|
||||
export { $DBObject } from './schemas/$DBObject';
|
||||
export { $DBQueryRequest } from './schemas/$DBQueryRequest';
|
||||
export { $DBQueryResponse } from './schemas/$DBQueryResponse';
|
||||
export { $DBRedisRequest } from './schemas/$DBRedisRequest';
|
||||
export { $DBRedisResponse } from './schemas/$DBRedisResponse';
|
||||
export { $DBSchemaContextResponse } from './schemas/$DBSchemaContextResponse';
|
||||
export { $DBTableListResponse } from './schemas/$DBTableListResponse';
|
||||
export { $DBXStatus } from './schemas/$DBXStatus';
|
||||
export { $Document } from './schemas/$Document';
|
||||
export { $DocumentID } from './schemas/$DocumentID';
|
||||
export { $DocumentListResponse } from './schemas/$DocumentListResponse';
|
||||
@@ -114,6 +150,8 @@ export { $ProjectMember } from './schemas/$ProjectMember';
|
||||
export { $ProjectOverview } from './schemas/$ProjectOverview';
|
||||
export { $ProjectSummary } from './schemas/$ProjectSummary';
|
||||
export { $ReadinessStatus } from './schemas/$ReadinessStatus';
|
||||
export { $SchemaQuery } from './schemas/$SchemaQuery';
|
||||
export { $TableQuery } from './schemas/$TableQuery';
|
||||
export { $UpdateBucketObjectRequest } from './schemas/$UpdateBucketObjectRequest';
|
||||
export { $UpdateBucketRequest } from './schemas/$UpdateBucketRequest';
|
||||
export { $UpdateCollectionRequest } from './schemas/$UpdateCollectionRequest';
|
||||
@@ -126,6 +164,7 @@ export { $UserID } from './schemas/$UserID';
|
||||
export { $UserSummary } from './schemas/$UserSummary';
|
||||
|
||||
export { CollectionsService } from './services/CollectionsService';
|
||||
export { DatabasesService } from './services/DatabasesService';
|
||||
export { HealthService } from './services/HealthService';
|
||||
export { OrganizationsService } from './services/OrganizationsService';
|
||||
export { PlatformService } from './services/PlatformService';
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type ConnectionID = string;
|
||||
@@ -0,0 +1,29 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type CreateDBConnectionRequest = {
|
||||
name: string;
|
||||
db_type: CreateDBConnectionRequest.db_type;
|
||||
host: string;
|
||||
port?: number;
|
||||
database?: string;
|
||||
username?: string;
|
||||
password?: string;
|
||||
ssl?: boolean;
|
||||
driver_profile?: string;
|
||||
};
|
||||
export namespace CreateDBConnectionRequest {
|
||||
export enum db_type {
|
||||
POSTGRES = 'postgres',
|
||||
MYSQL = 'mysql',
|
||||
SQLITE = 'sqlite',
|
||||
REDIS = 'redis',
|
||||
MONGODB = 'mongodb',
|
||||
SQLSERVER = 'sqlserver',
|
||||
DUCKDB = 'duckdb',
|
||||
CLICKHOUSE = 'clickhouse',
|
||||
CASSANDRA = 'cassandra',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type DBConnection = {
|
||||
id: string;
|
||||
project_id: string;
|
||||
name: string;
|
||||
db_type: string;
|
||||
host: string;
|
||||
port?: number | null;
|
||||
database?: string;
|
||||
username?: string;
|
||||
ssl?: boolean | null;
|
||||
is_managed: boolean;
|
||||
has_password: boolean;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { DBConnection } from './DBConnection';
|
||||
export type DBConnectionListResponse = {
|
||||
items: Array<DBConnection>;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type DBConnectionTestResult = {
|
||||
ok: boolean;
|
||||
error?: string;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type DBDatabaseListResponse = {
|
||||
databases: Array<string>;
|
||||
raw?: string;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { DBMDTable } from './DBMDTable';
|
||||
export type DBDescribeResponse = {
|
||||
table?: DBMDTable;
|
||||
raw?: string;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type DBMDTable = {
|
||||
columns: Array<string>;
|
||||
rows: Array<Array<string>>;
|
||||
note?: string;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type DBObject = {
|
||||
name: string;
|
||||
kind: string;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type DBQueryRequest = {
|
||||
sql: string;
|
||||
database?: string;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { DBMDTable } from './DBMDTable';
|
||||
export type DBQueryResponse = {
|
||||
table?: DBMDTable;
|
||||
raw?: string;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type DBRedisRequest = {
|
||||
command: string;
|
||||
db?: number;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type DBRedisResponse = {
|
||||
output: string;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type DBSchemaContextResponse = {
|
||||
context: string;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { DBMDTable } from './DBMDTable';
|
||||
import type { DBObject } from './DBObject';
|
||||
export type DBTableListResponse = {
|
||||
tables?: Array<DBObject>;
|
||||
table?: DBMDTable;
|
||||
raw?: string;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type DBXStatus = {
|
||||
available: boolean;
|
||||
command?: string;
|
||||
reason?: string;
|
||||
install?: string;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type DatabaseQuery = string;
|
||||
@@ -0,0 +1,5 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type SchemaQuery = string;
|
||||
@@ -0,0 +1,5 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type TableQuery = string;
|
||||
@@ -0,0 +1,8 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const $ConnectionID = {
|
||||
type: 'string',
|
||||
format: 'uuid',
|
||||
} as const;
|
||||
@@ -0,0 +1,38 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const $CreateDBConnectionRequest = {
|
||||
properties: {
|
||||
name: {
|
||||
type: 'string',
|
||||
isRequired: true,
|
||||
},
|
||||
db_type: {
|
||||
type: 'Enum',
|
||||
isRequired: true,
|
||||
},
|
||||
host: {
|
||||
type: 'string',
|
||||
isRequired: true,
|
||||
},
|
||||
port: {
|
||||
type: 'number',
|
||||
},
|
||||
database: {
|
||||
type: 'string',
|
||||
},
|
||||
username: {
|
||||
type: 'string',
|
||||
},
|
||||
password: {
|
||||
type: 'string',
|
||||
},
|
||||
ssl: {
|
||||
type: 'boolean',
|
||||
},
|
||||
driver_profile: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
@@ -0,0 +1,52 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const $DBConnection = {
|
||||
properties: {
|
||||
id: {
|
||||
type: 'string',
|
||||
isRequired: true,
|
||||
format: 'uuid',
|
||||
},
|
||||
project_id: {
|
||||
type: 'string',
|
||||
isRequired: true,
|
||||
format: 'uuid',
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
isRequired: true,
|
||||
},
|
||||
db_type: {
|
||||
type: 'string',
|
||||
isRequired: true,
|
||||
},
|
||||
host: {
|
||||
type: 'string',
|
||||
isRequired: true,
|
||||
},
|
||||
port: {
|
||||
type: 'number',
|
||||
isNullable: true,
|
||||
},
|
||||
database: {
|
||||
type: 'string',
|
||||
},
|
||||
username: {
|
||||
type: 'string',
|
||||
},
|
||||
ssl: {
|
||||
type: 'boolean',
|
||||
isNullable: true,
|
||||
},
|
||||
is_managed: {
|
||||
type: 'boolean',
|
||||
isRequired: true,
|
||||
},
|
||||
has_password: {
|
||||
type: 'boolean',
|
||||
isRequired: true,
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
@@ -0,0 +1,15 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const $DBConnectionListResponse = {
|
||||
properties: {
|
||||
items: {
|
||||
type: 'array',
|
||||
contains: {
|
||||
type: 'DBConnection',
|
||||
},
|
||||
isRequired: true,
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
@@ -0,0 +1,15 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const $DBConnectionTestResult = {
|
||||
properties: {
|
||||
ok: {
|
||||
type: 'boolean',
|
||||
isRequired: true,
|
||||
},
|
||||
error: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
@@ -0,0 +1,18 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const $DBDatabaseListResponse = {
|
||||
properties: {
|
||||
databases: {
|
||||
type: 'array',
|
||||
contains: {
|
||||
type: 'string',
|
||||
},
|
||||
isRequired: true,
|
||||
},
|
||||
raw: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
@@ -0,0 +1,14 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const $DBDescribeResponse = {
|
||||
properties: {
|
||||
table: {
|
||||
type: 'DBMDTable',
|
||||
},
|
||||
raw: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
@@ -0,0 +1,28 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const $DBMDTable = {
|
||||
properties: {
|
||||
columns: {
|
||||
type: 'array',
|
||||
contains: {
|
||||
type: 'string',
|
||||
},
|
||||
isRequired: true,
|
||||
},
|
||||
rows: {
|
||||
type: 'array',
|
||||
contains: {
|
||||
type: 'array',
|
||||
contains: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
isRequired: true,
|
||||
},
|
||||
note: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
@@ -0,0 +1,16 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const $DBObject = {
|
||||
properties: {
|
||||
name: {
|
||||
type: 'string',
|
||||
isRequired: true,
|
||||
},
|
||||
kind: {
|
||||
type: 'string',
|
||||
isRequired: true,
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
@@ -0,0 +1,15 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const $DBQueryRequest = {
|
||||
properties: {
|
||||
sql: {
|
||||
type: 'string',
|
||||
isRequired: true,
|
||||
},
|
||||
database: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
@@ -0,0 +1,14 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const $DBQueryResponse = {
|
||||
properties: {
|
||||
table: {
|
||||
type: 'DBMDTable',
|
||||
},
|
||||
raw: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
@@ -0,0 +1,15 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const $DBRedisRequest = {
|
||||
properties: {
|
||||
command: {
|
||||
type: 'string',
|
||||
isRequired: true,
|
||||
},
|
||||
db: {
|
||||
type: 'number',
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
@@ -0,0 +1,12 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const $DBRedisResponse = {
|
||||
properties: {
|
||||
output: {
|
||||
type: 'string',
|
||||
isRequired: true,
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
@@ -0,0 +1,12 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const $DBSchemaContextResponse = {
|
||||
properties: {
|
||||
context: {
|
||||
type: 'string',
|
||||
isRequired: true,
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
@@ -0,0 +1,20 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const $DBTableListResponse = {
|
||||
properties: {
|
||||
tables: {
|
||||
type: 'array',
|
||||
contains: {
|
||||
type: 'DBObject',
|
||||
},
|
||||
},
|
||||
table: {
|
||||
type: 'DBMDTable',
|
||||
},
|
||||
raw: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
@@ -0,0 +1,21 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const $DBXStatus = {
|
||||
properties: {
|
||||
available: {
|
||||
type: 'boolean',
|
||||
isRequired: true,
|
||||
},
|
||||
command: {
|
||||
type: 'string',
|
||||
},
|
||||
reason: {
|
||||
type: 'string',
|
||||
},
|
||||
install: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
@@ -0,0 +1,7 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const $DatabaseQuery = {
|
||||
type: 'string',
|
||||
} as const;
|
||||
@@ -0,0 +1,7 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const $SchemaQuery = {
|
||||
type: 'string',
|
||||
} as const;
|
||||
@@ -0,0 +1,7 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const $TableQuery = {
|
||||
type: 'string',
|
||||
} as const;
|
||||
@@ -0,0 +1,303 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { CreateDBConnectionRequest } from '../models/CreateDBConnectionRequest';
|
||||
import type { DBConnection } from '../models/DBConnection';
|
||||
import type { DBConnectionListResponse } from '../models/DBConnectionListResponse';
|
||||
import type { DBConnectionTestResult } from '../models/DBConnectionTestResult';
|
||||
import type { DBDatabaseListResponse } from '../models/DBDatabaseListResponse';
|
||||
import type { DBDescribeResponse } from '../models/DBDescribeResponse';
|
||||
import type { DBQueryRequest } from '../models/DBQueryRequest';
|
||||
import type { DBQueryResponse } from '../models/DBQueryResponse';
|
||||
import type { DBRedisRequest } from '../models/DBRedisRequest';
|
||||
import type { DBRedisResponse } from '../models/DBRedisResponse';
|
||||
import type { DBSchemaContextResponse } from '../models/DBSchemaContextResponse';
|
||||
import type { DBTableListResponse } from '../models/DBTableListResponse';
|
||||
import type { DBXStatus } from '../models/DBXStatus';
|
||||
import type { CancelablePromise } from '../core/CancelablePromise';
|
||||
import { OpenAPI } from '../core/OpenAPI';
|
||||
import { request as __request } from '../core/request';
|
||||
export class DatabasesService {
|
||||
/**
|
||||
* @returns DBXStatus DBX subprocess availability
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getDbxStatus(): CancelablePromise<DBXStatus> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/db/status',
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @returns DBConnectionListResponse Saved database connections for the project
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static listDbConnections({
|
||||
projectId,
|
||||
}: {
|
||||
projectId: string,
|
||||
}): CancelablePromise<DBConnectionListResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/projects/{projectID}/db-connections',
|
||||
path: {
|
||||
'projectID': projectId,
|
||||
},
|
||||
errors: {
|
||||
401: `Error response`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @returns DBConnection Connection created
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static createDbConnection({
|
||||
projectId,
|
||||
requestBody,
|
||||
}: {
|
||||
projectId: string,
|
||||
requestBody: CreateDBConnectionRequest,
|
||||
}): CancelablePromise<DBConnection> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/projects/{projectID}/db-connections',
|
||||
path: {
|
||||
'projectID': projectId,
|
||||
},
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
401: `Error response`,
|
||||
409: `Error response`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @returns void
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static deleteDbConnection({
|
||||
projectId,
|
||||
connectionId,
|
||||
}: {
|
||||
projectId: string,
|
||||
connectionId: string,
|
||||
}): CancelablePromise<void> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'DELETE',
|
||||
url: '/projects/{projectID}/db-connections/{connectionID}',
|
||||
path: {
|
||||
'projectID': projectId,
|
||||
'connectionID': connectionId,
|
||||
},
|
||||
errors: {
|
||||
404: `Error response`,
|
||||
409: `Error response`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @returns DBConnectionTestResult Connectivity probe result
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static testDbConnection({
|
||||
projectId,
|
||||
connectionId,
|
||||
}: {
|
||||
projectId: string,
|
||||
connectionId: string,
|
||||
}): CancelablePromise<DBConnectionTestResult> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/projects/{projectID}/db-connections/{connectionID}/test',
|
||||
path: {
|
||||
'projectID': projectId,
|
||||
'connectionID': connectionId,
|
||||
},
|
||||
errors: {
|
||||
404: `Error response`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @returns DBDatabaseListResponse Databases reachable through the connection
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static listDbDatabases({
|
||||
projectId,
|
||||
connectionId,
|
||||
}: {
|
||||
projectId: string,
|
||||
connectionId: string,
|
||||
}): CancelablePromise<DBDatabaseListResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/projects/{projectID}/db-connections/{connectionID}/databases',
|
||||
path: {
|
||||
'projectID': projectId,
|
||||
'connectionID': connectionId,
|
||||
},
|
||||
errors: {
|
||||
404: `Error response`,
|
||||
502: `Error response`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @returns DBTableListResponse Tables, views, or collections in the connection
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static listDbTables({
|
||||
projectId,
|
||||
connectionId,
|
||||
database,
|
||||
schema,
|
||||
}: {
|
||||
projectId: string,
|
||||
connectionId: string,
|
||||
database?: string,
|
||||
schema?: string,
|
||||
}): CancelablePromise<DBTableListResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/projects/{projectID}/db-connections/{connectionID}/tables',
|
||||
path: {
|
||||
'projectID': projectId,
|
||||
'connectionID': connectionId,
|
||||
},
|
||||
query: {
|
||||
'database': database,
|
||||
'schema': schema,
|
||||
},
|
||||
errors: {
|
||||
404: `Error response`,
|
||||
502: `Error response`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @returns DBDescribeResponse Column definitions for a table
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static describeDbTable({
|
||||
projectId,
|
||||
connectionId,
|
||||
table,
|
||||
database,
|
||||
schema,
|
||||
}: {
|
||||
projectId: string,
|
||||
connectionId: string,
|
||||
table: string,
|
||||
database?: string,
|
||||
schema?: string,
|
||||
}): CancelablePromise<DBDescribeResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/projects/{projectID}/db-connections/{connectionID}/describe',
|
||||
path: {
|
||||
'projectID': projectId,
|
||||
'connectionID': connectionId,
|
||||
},
|
||||
query: {
|
||||
'table': table,
|
||||
'database': database,
|
||||
'schema': schema,
|
||||
},
|
||||
errors: {
|
||||
404: `Error response`,
|
||||
502: `Error response`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @returns DBSchemaContextResponse Compact schema context for the connection
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getDbSchemaContext({
|
||||
projectId,
|
||||
connectionId,
|
||||
database,
|
||||
schema,
|
||||
}: {
|
||||
projectId: string,
|
||||
connectionId: string,
|
||||
database?: string,
|
||||
schema?: string,
|
||||
}): CancelablePromise<DBSchemaContextResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/projects/{projectID}/db-connections/{connectionID}/schema',
|
||||
path: {
|
||||
'projectID': projectId,
|
||||
'connectionID': connectionId,
|
||||
},
|
||||
query: {
|
||||
'database': database,
|
||||
'schema': schema,
|
||||
},
|
||||
errors: {
|
||||
404: `Error response`,
|
||||
502: `Error response`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @returns DBQueryResponse Query result (at most 100 rows)
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static executeDbQuery({
|
||||
projectId,
|
||||
connectionId,
|
||||
requestBody,
|
||||
}: {
|
||||
projectId: string,
|
||||
connectionId: string,
|
||||
requestBody: DBQueryRequest,
|
||||
}): CancelablePromise<DBQueryResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/projects/{projectID}/db-connections/{connectionID}/query',
|
||||
path: {
|
||||
'projectID': projectId,
|
||||
'connectionID': connectionId,
|
||||
},
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
404: `Error response`,
|
||||
502: `Error response`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @returns DBRedisResponse Redis command output
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static executeDbRedisCommand({
|
||||
projectId,
|
||||
connectionId,
|
||||
requestBody,
|
||||
}: {
|
||||
projectId: string,
|
||||
connectionId: string,
|
||||
requestBody: DBRedisRequest,
|
||||
}): CancelablePromise<DBRedisResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/projects/{projectID}/db-connections/{connectionID}/redis',
|
||||
path: {
|
||||
'projectID': projectId,
|
||||
'connectionID': connectionId,
|
||||
},
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
404: `Error response`,
|
||||
502: `Error response`,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@primora/shared-types",
|
||||
"version": "0.2.0",
|
||||
"version": "0.3.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"main": "./src/index.ts",
|
||||
|
||||
Reference in new issue
Block a user