@schemarch/mcp-server-schemarch 0.0.0-stage → 0.14.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 +201 -0
- package/dist/chunk-5DTK5H23.js +2 -0
- package/dist/chunk-5DTK5H23.js.map +1 -0
- package/dist/chunk-BV2TY4MO.cjs +2 -0
- package/dist/chunk-BV2TY4MO.cjs.map +1 -0
- package/dist/chunk-GEJ6NAOC.cjs +2 -0
- package/dist/chunk-GEJ6NAOC.cjs.map +1 -0
- package/dist/chunk-LU6L7C36.js +1 -0
- package/dist/chunk-LU6L7C36.js.map +1 -0
- package/dist/chunk-N4WMNFDY.cjs +65 -0
- package/dist/chunk-N4WMNFDY.cjs.map +1 -0
- package/dist/chunk-ONL2HNNT.js +284 -0
- package/dist/chunk-ONL2HNNT.js.map +1 -0
- package/dist/chunk-ORH6UYIY.js +65 -0
- package/dist/chunk-ORH6UYIY.js.map +1 -0
- package/dist/chunk-PHWSETKC.cjs +1 -0
- package/dist/chunk-PHWSETKC.cjs.map +1 -0
- package/dist/chunk-T3Q2DPRT.cjs +284 -0
- package/dist/chunk-T3Q2DPRT.cjs.map +1 -0
- package/dist/chunk-XKU4Q6WQ.js +2 -0
- package/dist/chunk-XKU4Q6WQ.js.map +1 -0
- package/dist/cli.cjs +3 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/cli.d.cts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +3 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2405 -0
- package/dist/index.d.ts +2405 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/platform/api-platform.cjs +2 -0
- package/dist/platform/api-platform.cjs.map +1 -0
- package/dist/platform/api-platform.d.cts +20 -0
- package/dist/platform/api-platform.d.ts +20 -0
- package/dist/platform/api-platform.js +2 -0
- package/dist/platform/api-platform.js.map +1 -0
- package/dist/platform/index.cjs +2 -0
- package/dist/platform/index.cjs.map +1 -0
- package/dist/platform/index.d.cts +577 -0
- package/dist/platform/index.d.ts +577 -0
- package/dist/platform/index.js +2 -0
- package/dist/platform/index.js.map +1 -0
- package/package.json +88 -3
- package/README.md +0 -3
package/dist/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as c,b as a,c as p,d as m,h as s,i as n,j as e}from"./chunk-ONL2HNNT.js";import{a as r,g as t}from"./chunk-ORH6UYIY.js";import"./chunk-XKU4Q6WQ.js";import{createMcpHandler as i}from"@modelcontextprotocol/server";function h(o){return i(()=>e(o),{legacy:"reject"})}var v=r.version;export{p as CURRENT_ELICITATION_TOOLS,m as CURRENT_FEATURE_GROUPS,c as ToolCallerError,t as createFeedbackOperations,h as createSchemarchMcpHandler,e as createSchemarchMcpServer,n as createToolSchemas,a as isToolCallerError,s as schemarchMcpToolSchemas,v as version};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/transports/http.ts","../src/index.ts"],"sourcesContent":["import { createMcpHandler } from '@modelcontextprotocol/server';\n\nimport {\n createSchemarchMcpServer,\n type SchemarchMcpServerOptions,\n} from '../server.js';\n\n// Modern protocol only: created with `legacy: 'reject'`, so a client that\n// speaks just the 2025-era protocol gets an HTTP 400 instead of being served.\nexport function createSchemarchMcpHandler(options: SchemarchMcpServerOptions) {\n return createMcpHandler(() => createSchemarchMcpServer(options), {\n legacy: 'reject',\n });\n}\n","import packageJson from '../package.json' with { type: 'json' };\n\nexport type {\n ObservationContext,\n ObservationEnd,\n ObservationFact,\n ObservedMethod,\n ObservedTool,\n ConfirmationFeature,\n RequestObservation,\n RequestObserver,\n} from './observation.js';\nexport { isToolCallerError, ToolCallerError } from './errors.js';\nexport type { ToolCallCallback } from '@schemarch/mcp-utils';\nexport {\n createFeedbackOperations,\n type FeedbackOperationsOptions,\n} from './platform/feedback.js';\nexport type { FeedbackOperations, SchemarchPlatform } from './platform/index.js';\nexport {\n createSchemarchMcpServer,\n type SchemarchMcpServerOptions,\n} from './server.js';\nexport { createSchemarchMcpHandler } from './transports/http.js';\nexport {\n CURRENT_ELICITATION_TOOLS,\n CURRENT_FEATURE_GROUPS,\n type ElicitationToolName,\n type FeatureGroup,\n} from './types.js';\nexport const version = packageJson.version;\n\nexport {\n createToolSchemas,\n schemarchMcpToolSchemas,\n} from './tools/tool-schemas.js';\n"],"mappings":"6JAAA,OAAS,oBAAAA,MAAwB,+BAS1B,SAASC,EAA0BC,EAAoC,CAC5E,OAAOC,EAAiB,IAAMC,EAAyBF,CAAO,EAAG,CAC/D,OAAQ,QACV,CAAC,CACH,CCiBO,IAAMG,EAAUC,EAAY","names":["createMcpHandler","createSchemarchMcpHandler","options","createMcpHandler","createSchemarchMcpServer","version","package_default"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkBV2TY4MOcjs = require('../chunk-BV2TY4MO.cjs');require('../chunk-N4WMNFDY.cjs');require('../chunk-PHWSETKC.cjs');require('../chunk-GEJ6NAOC.cjs');exports.createSchemarchApiPlatform = _chunkBV2TY4MOcjs.a;
|
|
2
|
+
//# sourceMappingURL=api-platform.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/copilot/dev/schemarch-rebuild/mcp/packages/mcp-server-schemarch/dist/platform/api-platform.cjs"],"names":[],"mappings":"AAAA,kIAAoC,iCAA8B,iCAA8B,iCAA8B,yDAAwC","file":"/home/copilot/dev/schemarch-rebuild/mcp/packages/mcp-server-schemarch/dist/platform/api-platform.cjs"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SchemarchPlatform } from './index.cjs';
|
|
2
|
+
import '@schemarch/mcp-utils';
|
|
3
|
+
import 'zod/v4';
|
|
4
|
+
|
|
5
|
+
type SchemarchApiPlatformOptions = {
|
|
6
|
+
/**
|
|
7
|
+
* The access token for the Schemarch Management API.
|
|
8
|
+
*/
|
|
9
|
+
accessToken: string;
|
|
10
|
+
/**
|
|
11
|
+
* The API URL for the Schemarch Management API.
|
|
12
|
+
*/
|
|
13
|
+
apiUrl?: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Creates a Schemarch platform implementation using the Schemarch Management API.
|
|
17
|
+
*/
|
|
18
|
+
declare function createSchemarchApiPlatform(options: SchemarchApiPlatformOptions): SchemarchPlatform;
|
|
19
|
+
|
|
20
|
+
export { type SchemarchApiPlatformOptions, createSchemarchApiPlatform };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SchemarchPlatform } from './index.js';
|
|
2
|
+
import '@schemarch/mcp-utils';
|
|
3
|
+
import 'zod/v4';
|
|
4
|
+
|
|
5
|
+
type SchemarchApiPlatformOptions = {
|
|
6
|
+
/**
|
|
7
|
+
* The access token for the Schemarch Management API.
|
|
8
|
+
*/
|
|
9
|
+
accessToken: string;
|
|
10
|
+
/**
|
|
11
|
+
* The API URL for the Schemarch Management API.
|
|
12
|
+
*/
|
|
13
|
+
apiUrl?: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Creates a Schemarch platform implementation using the Schemarch Management API.
|
|
17
|
+
*/
|
|
18
|
+
declare function createSchemarchApiPlatform(options: SchemarchApiPlatformOptions): SchemarchPlatform;
|
|
19
|
+
|
|
20
|
+
export { type SchemarchApiPlatformOptions, createSchemarchApiPlatform };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-PHWSETKC.cjs');var _chunkGEJ6NAOCcjs = require('../chunk-GEJ6NAOC.cjs');exports.apiKeyTypeSchema = _chunkGEJ6NAOCcjs.x; exports.applyMigrationOptionsSchema = _chunkGEJ6NAOCcjs.n; exports.branchSchema = _chunkGEJ6NAOCcjs.f; exports.createBranchOptionsSchema = _chunkGEJ6NAOCcjs.j; exports.createNotebookOptionsSchema = _chunkGEJ6NAOCcjs.u; exports.createProjectOptionsSchema = _chunkGEJ6NAOCcjs.i; exports.deployEdgeFunctionOptionsSchema = _chunkGEJ6NAOCcjs.l; exports.edgeFunctionSchema = _chunkGEJ6NAOCcjs.g; exports.edgeFunctionWithBodySchema = _chunkGEJ6NAOCcjs.h; exports.executeSqlOptionsSchema = _chunkGEJ6NAOCcjs.m; exports.generateTypescriptTypesResultSchema = _chunkGEJ6NAOCcjs.s; exports.getLogsOptionsSchema = _chunkGEJ6NAOCcjs.q; exports.logsServiceSchema = _chunkGEJ6NAOCcjs.p; exports.migrationSchema = _chunkGEJ6NAOCcjs.o; exports.notebookCellSchema = _chunkGEJ6NAOCcjs.t; exports.notebookSchema = _chunkGEJ6NAOCcjs.v; exports.notebookWithContentSchema = _chunkGEJ6NAOCcjs.w; exports.organizationSchema = _chunkGEJ6NAOCcjs.d; exports.projectSchema = _chunkGEJ6NAOCcjs.e; exports.queryLogsOptionsSchema = _chunkGEJ6NAOCcjs.r; exports.resetBranchOptionsSchema = _chunkGEJ6NAOCcjs.k; exports.storageBucketSchema = _chunkGEJ6NAOCcjs.b; exports.storageConfigSchema = _chunkGEJ6NAOCcjs.c;
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/copilot/dev/schemarch-rebuild/mcp/packages/mcp-server-schemarch/dist/platform/index.cjs"],"names":[],"mappings":"AAAA,0GAA6B,yDAAoM,ysCAA4nB","file":"/home/copilot/dev/schemarch-rebuild/mcp/packages/mcp-server-schemarch/dist/platform/index.cjs"}
|
|
@@ -0,0 +1,577 @@
|
|
|
1
|
+
import { InitData } from '@schemarch/mcp-utils';
|
|
2
|
+
import { z } from 'zod/v4';
|
|
3
|
+
|
|
4
|
+
type SuccessResponse = {
|
|
5
|
+
success: true;
|
|
6
|
+
};
|
|
7
|
+
declare const storageBucketSchema: z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
name: z.ZodString;
|
|
10
|
+
owner: z.ZodString;
|
|
11
|
+
created_at: z.ZodString;
|
|
12
|
+
updated_at: z.ZodString;
|
|
13
|
+
public: z.ZodBoolean;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
declare const storageConfigSchema: z.ZodObject<{
|
|
16
|
+
fileSizeLimit: z.ZodNumber;
|
|
17
|
+
features: z.ZodObject<{
|
|
18
|
+
imageTransformation: z.ZodObject<{
|
|
19
|
+
enabled: z.ZodBoolean;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
s3Protocol: z.ZodObject<{
|
|
22
|
+
enabled: z.ZodBoolean;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
declare const organizationSchema: z.ZodObject<{
|
|
27
|
+
id: z.ZodString;
|
|
28
|
+
name: z.ZodString;
|
|
29
|
+
plan: z.ZodOptional<z.ZodString>;
|
|
30
|
+
allowed_release_channels: z.ZodArray<z.ZodString>;
|
|
31
|
+
opt_in_tags: z.ZodArray<z.ZodString>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
declare const projectSchema: z.ZodObject<{
|
|
34
|
+
id: z.ZodString;
|
|
35
|
+
ref: z.ZodString;
|
|
36
|
+
organization_id: z.ZodString;
|
|
37
|
+
organization_slug: z.ZodString;
|
|
38
|
+
name: z.ZodString;
|
|
39
|
+
status: z.ZodString;
|
|
40
|
+
created_at: z.ZodString;
|
|
41
|
+
region: z.ZodString;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
declare const branchSchema: z.ZodObject<{
|
|
44
|
+
id: z.ZodString;
|
|
45
|
+
name: z.ZodString;
|
|
46
|
+
project_ref: z.ZodString;
|
|
47
|
+
parent_project_ref: z.ZodString;
|
|
48
|
+
is_default: z.ZodBoolean;
|
|
49
|
+
git_branch: z.ZodOptional<z.ZodString>;
|
|
50
|
+
pr_number: z.ZodOptional<z.ZodNumber>;
|
|
51
|
+
latest_check_run_id: z.ZodOptional<z.ZodNumber>;
|
|
52
|
+
persistent: z.ZodBoolean;
|
|
53
|
+
status: z.ZodEnum<{
|
|
54
|
+
CREATING_PROJECT: "CREATING_PROJECT";
|
|
55
|
+
RUNNING_MIGRATIONS: "RUNNING_MIGRATIONS";
|
|
56
|
+
MIGRATIONS_PASSED: "MIGRATIONS_PASSED";
|
|
57
|
+
MIGRATIONS_FAILED: "MIGRATIONS_FAILED";
|
|
58
|
+
FUNCTIONS_DEPLOYED: "FUNCTIONS_DEPLOYED";
|
|
59
|
+
FUNCTIONS_FAILED: "FUNCTIONS_FAILED";
|
|
60
|
+
}>;
|
|
61
|
+
created_at: z.ZodString;
|
|
62
|
+
updated_at: z.ZodString;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
declare const edgeFunctionSchema: z.ZodObject<{
|
|
65
|
+
id: z.ZodString;
|
|
66
|
+
slug: z.ZodString;
|
|
67
|
+
name: z.ZodString;
|
|
68
|
+
status: z.ZodString;
|
|
69
|
+
version: z.ZodNumber;
|
|
70
|
+
created_at: z.ZodOptional<z.ZodNumber>;
|
|
71
|
+
updated_at: z.ZodOptional<z.ZodNumber>;
|
|
72
|
+
verify_jwt: z.ZodOptional<z.ZodBoolean>;
|
|
73
|
+
import_map: z.ZodOptional<z.ZodBoolean>;
|
|
74
|
+
import_map_path: z.ZodOptional<z.ZodString>;
|
|
75
|
+
entrypoint_path: z.ZodOptional<z.ZodString>;
|
|
76
|
+
}, z.core.$strip>;
|
|
77
|
+
declare const edgeFunctionWithBodySchema: z.ZodObject<{
|
|
78
|
+
id: z.ZodString;
|
|
79
|
+
slug: z.ZodString;
|
|
80
|
+
name: z.ZodString;
|
|
81
|
+
status: z.ZodString;
|
|
82
|
+
version: z.ZodNumber;
|
|
83
|
+
created_at: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
updated_at: z.ZodOptional<z.ZodNumber>;
|
|
85
|
+
verify_jwt: z.ZodOptional<z.ZodBoolean>;
|
|
86
|
+
import_map: z.ZodOptional<z.ZodBoolean>;
|
|
87
|
+
import_map_path: z.ZodOptional<z.ZodString>;
|
|
88
|
+
entrypoint_path: z.ZodOptional<z.ZodString>;
|
|
89
|
+
files: z.ZodArray<z.ZodObject<{
|
|
90
|
+
name: z.ZodString;
|
|
91
|
+
content: z.ZodString;
|
|
92
|
+
}, z.core.$strip>>;
|
|
93
|
+
}, z.core.$strip>;
|
|
94
|
+
declare const createProjectOptionsSchema: z.ZodObject<{
|
|
95
|
+
name: z.ZodString;
|
|
96
|
+
organization_id: z.ZodString;
|
|
97
|
+
region: z.ZodEnum<{
|
|
98
|
+
"us-west-1": "us-west-1";
|
|
99
|
+
"us-east-1": "us-east-1";
|
|
100
|
+
"us-east-2": "us-east-2";
|
|
101
|
+
"ca-central-1": "ca-central-1";
|
|
102
|
+
"eu-west-1": "eu-west-1";
|
|
103
|
+
"eu-west-2": "eu-west-2";
|
|
104
|
+
"eu-west-3": "eu-west-3";
|
|
105
|
+
"eu-central-1": "eu-central-1";
|
|
106
|
+
"eu-central-2": "eu-central-2";
|
|
107
|
+
"eu-north-1": "eu-north-1";
|
|
108
|
+
"ap-south-1": "ap-south-1";
|
|
109
|
+
"ap-southeast-1": "ap-southeast-1";
|
|
110
|
+
"ap-northeast-1": "ap-northeast-1";
|
|
111
|
+
"ap-northeast-2": "ap-northeast-2";
|
|
112
|
+
"ap-southeast-2": "ap-southeast-2";
|
|
113
|
+
"sa-east-1": "sa-east-1";
|
|
114
|
+
}>;
|
|
115
|
+
db_pass: z.ZodOptional<z.ZodString>;
|
|
116
|
+
}, z.core.$strip>;
|
|
117
|
+
declare const createBranchOptionsSchema: z.ZodObject<{
|
|
118
|
+
name: z.ZodString;
|
|
119
|
+
}, z.core.$strip>;
|
|
120
|
+
declare const resetBranchOptionsSchema: z.ZodObject<{
|
|
121
|
+
migration_version: z.ZodOptional<z.ZodString>;
|
|
122
|
+
}, z.core.$strip>;
|
|
123
|
+
declare const deployEdgeFunctionOptionsSchema: z.ZodObject<{
|
|
124
|
+
name: z.ZodString;
|
|
125
|
+
entrypoint_path: z.ZodString;
|
|
126
|
+
import_map_path: z.ZodOptional<z.ZodString>;
|
|
127
|
+
verify_jwt: z.ZodOptional<z.ZodBoolean>;
|
|
128
|
+
files: z.ZodArray<z.ZodObject<{
|
|
129
|
+
name: z.ZodString;
|
|
130
|
+
content: z.ZodString;
|
|
131
|
+
}, z.core.$strip>>;
|
|
132
|
+
}, z.core.$strip>;
|
|
133
|
+
declare const executeSqlOptionsSchema: z.ZodObject<{
|
|
134
|
+
query: z.ZodString;
|
|
135
|
+
parameters: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
136
|
+
read_only: z.ZodOptional<z.ZodBoolean>;
|
|
137
|
+
max_result_bytes: z.ZodOptional<z.ZodNumber>;
|
|
138
|
+
}, z.core.$strip>;
|
|
139
|
+
declare const applyMigrationOptionsSchema: z.ZodObject<{
|
|
140
|
+
name: z.ZodString;
|
|
141
|
+
query: z.ZodString;
|
|
142
|
+
}, z.core.$strip>;
|
|
143
|
+
declare const migrationSchema: z.ZodObject<{
|
|
144
|
+
version: z.ZodString;
|
|
145
|
+
name: z.ZodOptional<z.ZodString>;
|
|
146
|
+
}, z.core.$strip>;
|
|
147
|
+
declare const logsServiceSchema: z.ZodEnum<{
|
|
148
|
+
storage: "storage";
|
|
149
|
+
api: "api";
|
|
150
|
+
"branch-action": "branch-action";
|
|
151
|
+
postgres: "postgres";
|
|
152
|
+
"edge-function": "edge-function";
|
|
153
|
+
"edge-function-runtime": "edge-function-runtime";
|
|
154
|
+
auth: "auth";
|
|
155
|
+
realtime: "realtime";
|
|
156
|
+
}>;
|
|
157
|
+
declare const getLogsOptionsSchema: z.ZodObject<{
|
|
158
|
+
service: z.ZodEnum<{
|
|
159
|
+
storage: "storage";
|
|
160
|
+
api: "api";
|
|
161
|
+
"branch-action": "branch-action";
|
|
162
|
+
postgres: "postgres";
|
|
163
|
+
"edge-function": "edge-function";
|
|
164
|
+
"edge-function-runtime": "edge-function-runtime";
|
|
165
|
+
auth: "auth";
|
|
166
|
+
realtime: "realtime";
|
|
167
|
+
}>;
|
|
168
|
+
iso_timestamp_start: z.ZodOptional<z.ZodString>;
|
|
169
|
+
iso_timestamp_end: z.ZodOptional<z.ZodString>;
|
|
170
|
+
}, z.core.$strip>;
|
|
171
|
+
declare const queryLogsOptionsSchema: z.ZodObject<{
|
|
172
|
+
sql: z.ZodString;
|
|
173
|
+
iso_timestamp_start: z.ZodOptional<z.ZodString>;
|
|
174
|
+
iso_timestamp_end: z.ZodOptional<z.ZodString>;
|
|
175
|
+
}, z.core.$strip>;
|
|
176
|
+
declare const generateTypescriptTypesResultSchema: z.ZodObject<{
|
|
177
|
+
types: z.ZodString;
|
|
178
|
+
}, z.core.$strip>;
|
|
179
|
+
declare const notebookCellSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
180
|
+
id: z.ZodString;
|
|
181
|
+
type: z.ZodLiteral<"markdown">;
|
|
182
|
+
text: z.ZodString;
|
|
183
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
184
|
+
id: z.ZodString;
|
|
185
|
+
type: z.ZodLiteral<"database">;
|
|
186
|
+
sql: z.ZodString;
|
|
187
|
+
row_limit: z.ZodNumber;
|
|
188
|
+
database_identifier: z.ZodOptional<z.ZodString>;
|
|
189
|
+
title: z.ZodOptional<z.ZodString>;
|
|
190
|
+
view: z.ZodOptional<z.ZodEnum<{
|
|
191
|
+
table: "table";
|
|
192
|
+
chart: "chart";
|
|
193
|
+
}>>;
|
|
194
|
+
chart: z.ZodOptional<z.ZodObject<{
|
|
195
|
+
type: z.ZodEnum<{
|
|
196
|
+
bar: "bar";
|
|
197
|
+
line: "line";
|
|
198
|
+
}>;
|
|
199
|
+
x_column: z.ZodString;
|
|
200
|
+
y_series: z.ZodArray<z.ZodObject<{
|
|
201
|
+
column: z.ZodString;
|
|
202
|
+
}, z.core.$strip>>;
|
|
203
|
+
scale: z.ZodEnum<{
|
|
204
|
+
linear: "linear";
|
|
205
|
+
log: "log";
|
|
206
|
+
}>;
|
|
207
|
+
cumulative: z.ZodBoolean;
|
|
208
|
+
show_labels: z.ZodBoolean;
|
|
209
|
+
}, z.core.$strip>>;
|
|
210
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
211
|
+
id: z.ZodString;
|
|
212
|
+
type: z.ZodLiteral<"log">;
|
|
213
|
+
sql: z.ZodString;
|
|
214
|
+
time_range: z.ZodUnion<readonly [z.ZodObject<{
|
|
215
|
+
type: z.ZodLiteral<"absolute">;
|
|
216
|
+
start: z.ZodString;
|
|
217
|
+
end: z.ZodString;
|
|
218
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
219
|
+
type: z.ZodLiteral<"relative">;
|
|
220
|
+
unit: z.ZodEnum<{
|
|
221
|
+
minute: "minute";
|
|
222
|
+
hour: "hour";
|
|
223
|
+
day: "day";
|
|
224
|
+
week: "week";
|
|
225
|
+
month: "month";
|
|
226
|
+
year: "year";
|
|
227
|
+
}>;
|
|
228
|
+
amount: z.ZodNumber;
|
|
229
|
+
}, z.core.$strip>]>;
|
|
230
|
+
title: z.ZodOptional<z.ZodString>;
|
|
231
|
+
view: z.ZodOptional<z.ZodEnum<{
|
|
232
|
+
table: "table";
|
|
233
|
+
chart: "chart";
|
|
234
|
+
}>>;
|
|
235
|
+
chart: z.ZodOptional<z.ZodObject<{
|
|
236
|
+
type: z.ZodEnum<{
|
|
237
|
+
bar: "bar";
|
|
238
|
+
line: "line";
|
|
239
|
+
}>;
|
|
240
|
+
x_column: z.ZodString;
|
|
241
|
+
y_series: z.ZodArray<z.ZodObject<{
|
|
242
|
+
column: z.ZodString;
|
|
243
|
+
}, z.core.$strip>>;
|
|
244
|
+
scale: z.ZodEnum<{
|
|
245
|
+
linear: "linear";
|
|
246
|
+
log: "log";
|
|
247
|
+
}>;
|
|
248
|
+
cumulative: z.ZodBoolean;
|
|
249
|
+
show_labels: z.ZodBoolean;
|
|
250
|
+
}, z.core.$strip>>;
|
|
251
|
+
}, z.core.$strip>], "type">;
|
|
252
|
+
declare const createNotebookOptionsSchema: z.ZodObject<{
|
|
253
|
+
name: z.ZodString;
|
|
254
|
+
description: z.ZodOptional<z.ZodString>;
|
|
255
|
+
content: z.ZodObject<{
|
|
256
|
+
cells: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
257
|
+
type: z.ZodLiteral<"markdown">;
|
|
258
|
+
text: z.ZodString;
|
|
259
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
260
|
+
type: z.ZodLiteral<"database">;
|
|
261
|
+
title: z.ZodOptional<z.ZodString>;
|
|
262
|
+
view: z.ZodOptional<z.ZodEnum<{
|
|
263
|
+
table: "table";
|
|
264
|
+
chart: "chart";
|
|
265
|
+
}>>;
|
|
266
|
+
sql: z.ZodString;
|
|
267
|
+
row_limit: z.ZodNumber;
|
|
268
|
+
database_identifier: z.ZodOptional<z.ZodString>;
|
|
269
|
+
chart: z.ZodOptional<z.ZodObject<{
|
|
270
|
+
type: z.ZodEnum<{
|
|
271
|
+
bar: "bar";
|
|
272
|
+
line: "line";
|
|
273
|
+
}>;
|
|
274
|
+
x_column: z.ZodString;
|
|
275
|
+
scale: z.ZodEnum<{
|
|
276
|
+
linear: "linear";
|
|
277
|
+
log: "log";
|
|
278
|
+
}>;
|
|
279
|
+
cumulative: z.ZodBoolean;
|
|
280
|
+
show_labels: z.ZodBoolean;
|
|
281
|
+
y_series: z.ZodArray<z.ZodObject<{
|
|
282
|
+
column: z.ZodString;
|
|
283
|
+
}, z.core.$strict>>;
|
|
284
|
+
}, z.core.$strict>>;
|
|
285
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
286
|
+
type: z.ZodLiteral<"log">;
|
|
287
|
+
title: z.ZodOptional<z.ZodString>;
|
|
288
|
+
view: z.ZodOptional<z.ZodEnum<{
|
|
289
|
+
table: "table";
|
|
290
|
+
chart: "chart";
|
|
291
|
+
}>>;
|
|
292
|
+
sql: z.ZodString;
|
|
293
|
+
time_range: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
294
|
+
type: z.ZodLiteral<"absolute">;
|
|
295
|
+
start: z.ZodISODateTime;
|
|
296
|
+
end: z.ZodISODateTime;
|
|
297
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
298
|
+
type: z.ZodLiteral<"relative">;
|
|
299
|
+
unit: z.ZodEnum<{
|
|
300
|
+
minute: "minute";
|
|
301
|
+
hour: "hour";
|
|
302
|
+
day: "day";
|
|
303
|
+
week: "week";
|
|
304
|
+
month: "month";
|
|
305
|
+
year: "year";
|
|
306
|
+
}>;
|
|
307
|
+
amount: z.ZodNumber;
|
|
308
|
+
}, z.core.$strict>], "type">;
|
|
309
|
+
chart: z.ZodOptional<z.ZodObject<{
|
|
310
|
+
type: z.ZodEnum<{
|
|
311
|
+
bar: "bar";
|
|
312
|
+
line: "line";
|
|
313
|
+
}>;
|
|
314
|
+
x_column: z.ZodString;
|
|
315
|
+
scale: z.ZodEnum<{
|
|
316
|
+
linear: "linear";
|
|
317
|
+
log: "log";
|
|
318
|
+
}>;
|
|
319
|
+
cumulative: z.ZodBoolean;
|
|
320
|
+
show_labels: z.ZodBoolean;
|
|
321
|
+
y_series: z.ZodArray<z.ZodObject<{
|
|
322
|
+
column: z.ZodString;
|
|
323
|
+
}, z.core.$strict>>;
|
|
324
|
+
}, z.core.$strict>>;
|
|
325
|
+
}, z.core.$strict>], "type">>;
|
|
326
|
+
}, z.core.$strip>;
|
|
327
|
+
}, z.core.$strip>;
|
|
328
|
+
declare const notebookSchema: z.ZodObject<{
|
|
329
|
+
id: z.ZodString;
|
|
330
|
+
name: z.ZodString;
|
|
331
|
+
description: z.ZodNullable<z.ZodString>;
|
|
332
|
+
favorite: z.ZodBoolean;
|
|
333
|
+
inserted_at: z.ZodString;
|
|
334
|
+
updated_at: z.ZodString;
|
|
335
|
+
owner: z.ZodNullable<z.ZodObject<{
|
|
336
|
+
id: z.ZodNumber;
|
|
337
|
+
username: z.ZodString;
|
|
338
|
+
}, z.core.$strip>>;
|
|
339
|
+
updated_by: z.ZodNullable<z.ZodObject<{
|
|
340
|
+
id: z.ZodNumber;
|
|
341
|
+
username: z.ZodString;
|
|
342
|
+
}, z.core.$strip>>;
|
|
343
|
+
}, z.core.$strip>;
|
|
344
|
+
declare const notebookWithContentSchema: z.ZodObject<{
|
|
345
|
+
id: z.ZodString;
|
|
346
|
+
name: z.ZodString;
|
|
347
|
+
description: z.ZodNullable<z.ZodString>;
|
|
348
|
+
favorite: z.ZodBoolean;
|
|
349
|
+
inserted_at: z.ZodString;
|
|
350
|
+
updated_at: z.ZodString;
|
|
351
|
+
owner: z.ZodNullable<z.ZodObject<{
|
|
352
|
+
id: z.ZodNumber;
|
|
353
|
+
username: z.ZodString;
|
|
354
|
+
}, z.core.$strip>>;
|
|
355
|
+
updated_by: z.ZodNullable<z.ZodObject<{
|
|
356
|
+
id: z.ZodNumber;
|
|
357
|
+
username: z.ZodString;
|
|
358
|
+
}, z.core.$strip>>;
|
|
359
|
+
content: z.ZodObject<{
|
|
360
|
+
schema_version: z.ZodNumber;
|
|
361
|
+
cells: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
362
|
+
id: z.ZodString;
|
|
363
|
+
type: z.ZodLiteral<"markdown">;
|
|
364
|
+
text: z.ZodString;
|
|
365
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
366
|
+
id: z.ZodString;
|
|
367
|
+
type: z.ZodLiteral<"database">;
|
|
368
|
+
sql: z.ZodString;
|
|
369
|
+
row_limit: z.ZodNumber;
|
|
370
|
+
database_identifier: z.ZodOptional<z.ZodString>;
|
|
371
|
+
title: z.ZodOptional<z.ZodString>;
|
|
372
|
+
view: z.ZodOptional<z.ZodEnum<{
|
|
373
|
+
table: "table";
|
|
374
|
+
chart: "chart";
|
|
375
|
+
}>>;
|
|
376
|
+
chart: z.ZodOptional<z.ZodObject<{
|
|
377
|
+
type: z.ZodEnum<{
|
|
378
|
+
bar: "bar";
|
|
379
|
+
line: "line";
|
|
380
|
+
}>;
|
|
381
|
+
x_column: z.ZodString;
|
|
382
|
+
y_series: z.ZodArray<z.ZodObject<{
|
|
383
|
+
column: z.ZodString;
|
|
384
|
+
}, z.core.$strip>>;
|
|
385
|
+
scale: z.ZodEnum<{
|
|
386
|
+
linear: "linear";
|
|
387
|
+
log: "log";
|
|
388
|
+
}>;
|
|
389
|
+
cumulative: z.ZodBoolean;
|
|
390
|
+
show_labels: z.ZodBoolean;
|
|
391
|
+
}, z.core.$strip>>;
|
|
392
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
393
|
+
id: z.ZodString;
|
|
394
|
+
type: z.ZodLiteral<"log">;
|
|
395
|
+
sql: z.ZodString;
|
|
396
|
+
time_range: z.ZodUnion<readonly [z.ZodObject<{
|
|
397
|
+
type: z.ZodLiteral<"absolute">;
|
|
398
|
+
start: z.ZodString;
|
|
399
|
+
end: z.ZodString;
|
|
400
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
401
|
+
type: z.ZodLiteral<"relative">;
|
|
402
|
+
unit: z.ZodEnum<{
|
|
403
|
+
minute: "minute";
|
|
404
|
+
hour: "hour";
|
|
405
|
+
day: "day";
|
|
406
|
+
week: "week";
|
|
407
|
+
month: "month";
|
|
408
|
+
year: "year";
|
|
409
|
+
}>;
|
|
410
|
+
amount: z.ZodNumber;
|
|
411
|
+
}, z.core.$strip>]>;
|
|
412
|
+
title: z.ZodOptional<z.ZodString>;
|
|
413
|
+
view: z.ZodOptional<z.ZodEnum<{
|
|
414
|
+
table: "table";
|
|
415
|
+
chart: "chart";
|
|
416
|
+
}>>;
|
|
417
|
+
chart: z.ZodOptional<z.ZodObject<{
|
|
418
|
+
type: z.ZodEnum<{
|
|
419
|
+
bar: "bar";
|
|
420
|
+
line: "line";
|
|
421
|
+
}>;
|
|
422
|
+
x_column: z.ZodString;
|
|
423
|
+
y_series: z.ZodArray<z.ZodObject<{
|
|
424
|
+
column: z.ZodString;
|
|
425
|
+
}, z.core.$strip>>;
|
|
426
|
+
scale: z.ZodEnum<{
|
|
427
|
+
linear: "linear";
|
|
428
|
+
log: "log";
|
|
429
|
+
}>;
|
|
430
|
+
cumulative: z.ZodBoolean;
|
|
431
|
+
show_labels: z.ZodBoolean;
|
|
432
|
+
}, z.core.$strip>>;
|
|
433
|
+
}, z.core.$strip>], "type">>;
|
|
434
|
+
}, z.core.$strip>;
|
|
435
|
+
}, z.core.$strip>;
|
|
436
|
+
type Organization = z.infer<typeof organizationSchema>;
|
|
437
|
+
type Project = z.infer<typeof projectSchema>;
|
|
438
|
+
type Branch = z.infer<typeof branchSchema>;
|
|
439
|
+
type EdgeFunction = z.infer<typeof edgeFunctionSchema>;
|
|
440
|
+
type EdgeFunctionWithBody = z.infer<typeof edgeFunctionWithBodySchema>;
|
|
441
|
+
type CreateProjectOptions = z.infer<typeof createProjectOptionsSchema>;
|
|
442
|
+
type CreateBranchOptions = z.infer<typeof createBranchOptionsSchema>;
|
|
443
|
+
type ResetBranchOptions = z.infer<typeof resetBranchOptionsSchema>;
|
|
444
|
+
type DeployEdgeFunctionOptions = z.infer<typeof deployEdgeFunctionOptionsSchema>;
|
|
445
|
+
type ExecuteSqlOptions = z.infer<typeof executeSqlOptionsSchema>;
|
|
446
|
+
type ApplyMigrationOptions = z.infer<typeof applyMigrationOptionsSchema>;
|
|
447
|
+
type Migration = z.infer<typeof migrationSchema>;
|
|
448
|
+
type ListMigrationsResult = z.infer<typeof migrationSchema>;
|
|
449
|
+
type LogsService = z.infer<typeof logsServiceSchema>;
|
|
450
|
+
type GetLogsOptions = z.infer<typeof getLogsOptionsSchema>;
|
|
451
|
+
type QueryLogsOptions = z.infer<typeof queryLogsOptionsSchema>;
|
|
452
|
+
type GenerateTypescriptTypesResult = z.infer<typeof generateTypescriptTypesResultSchema>;
|
|
453
|
+
type StorageConfig = z.infer<typeof storageConfigSchema>;
|
|
454
|
+
type StorageBucket = z.infer<typeof storageBucketSchema>;
|
|
455
|
+
type NotebookCell = z.infer<typeof notebookCellSchema>;
|
|
456
|
+
type CreateNotebookOptions = z.infer<typeof createNotebookOptionsSchema>;
|
|
457
|
+
type Notebook = z.infer<typeof notebookSchema>;
|
|
458
|
+
type NotebookWithContent = z.infer<typeof notebookWithContentSchema>;
|
|
459
|
+
type DatabaseOperations = {
|
|
460
|
+
executeSql<T>(projectId: string, options: ExecuteSqlOptions): Promise<T[]>;
|
|
461
|
+
listMigrations(projectId: string): Promise<Migration[]>;
|
|
462
|
+
applyMigration(projectId: string, options: ApplyMigrationOptions): Promise<void>;
|
|
463
|
+
};
|
|
464
|
+
type AccountOperations = {
|
|
465
|
+
listOrganizations(): Promise<{
|
|
466
|
+
id: string;
|
|
467
|
+
slug: string;
|
|
468
|
+
name: string;
|
|
469
|
+
}[]>;
|
|
470
|
+
getOrganization(organizationId: string): Promise<Organization>;
|
|
471
|
+
listProjects(): Promise<Project[]>;
|
|
472
|
+
getProject(projectId: string): Promise<Project>;
|
|
473
|
+
createProject(options: CreateProjectOptions): Promise<Project>;
|
|
474
|
+
pauseProject(projectId: string): Promise<void>;
|
|
475
|
+
restoreProject(projectId: string): Promise<void>;
|
|
476
|
+
};
|
|
477
|
+
type EdgeFunctionsOperations = {
|
|
478
|
+
listEdgeFunctions(projectId: string): Promise<EdgeFunction[]>;
|
|
479
|
+
getEdgeFunction(projectId: string, functionSlug: string): Promise<EdgeFunctionWithBody>;
|
|
480
|
+
deployEdgeFunction(projectId: string, options: DeployEdgeFunctionOptions): Promise<Omit<EdgeFunction, 'files'>>;
|
|
481
|
+
};
|
|
482
|
+
/**
|
|
483
|
+
* SQL dialect that a platform's logs endpoint speaks. Selects the
|
|
484
|
+
* dialect-appropriate `query_logs` description and `sql` parameter hint so a
|
|
485
|
+
* single tool can roll out across environments that back logs with different
|
|
486
|
+
* engines (hosted ClickHouse vs. self-hosted/CLI BigQuery).
|
|
487
|
+
*/
|
|
488
|
+
type LogsDialect = 'clickhouse' | 'bigquery';
|
|
489
|
+
type DebuggingOperations = {
|
|
490
|
+
/**
|
|
491
|
+
* SQL dialect accepted by `queryLogs`. Defaults to `'clickhouse'` when unset,
|
|
492
|
+
* preserving the behavior of platforms that predate this field.
|
|
493
|
+
*/
|
|
494
|
+
logsDialect?: LogsDialect;
|
|
495
|
+
getLogs(projectId: string, options: GetLogsOptions): Promise<unknown>;
|
|
496
|
+
queryLogs?(projectId: string, options: QueryLogsOptions): Promise<unknown>;
|
|
497
|
+
getSecurityAdvisors(projectId: string): Promise<unknown>;
|
|
498
|
+
getPerformanceAdvisors(projectId: string): Promise<unknown>;
|
|
499
|
+
getHealthAdvisors?(projectId: string): Promise<unknown>;
|
|
500
|
+
};
|
|
501
|
+
declare const apiKeyTypeSchema: z.ZodEnum<{
|
|
502
|
+
legacy: "legacy";
|
|
503
|
+
publishable: "publishable";
|
|
504
|
+
}>;
|
|
505
|
+
type ApiKeyType = z.infer<typeof apiKeyTypeSchema>;
|
|
506
|
+
type ApiKey = {
|
|
507
|
+
api_key: string;
|
|
508
|
+
name: string;
|
|
509
|
+
type: ApiKeyType;
|
|
510
|
+
description?: string;
|
|
511
|
+
id?: string;
|
|
512
|
+
disabled?: boolean;
|
|
513
|
+
};
|
|
514
|
+
type DevelopmentOperations = {
|
|
515
|
+
getProjectUrl(projectId: string): Promise<string>;
|
|
516
|
+
getPublishableKeys(projectId: string): Promise<ApiKey[]>;
|
|
517
|
+
generateTypescriptTypes(projectId: string): Promise<GenerateTypescriptTypesResult>;
|
|
518
|
+
};
|
|
519
|
+
type StorageOperations = {
|
|
520
|
+
getStorageConfig(projectId: string): Promise<StorageConfig>;
|
|
521
|
+
updateStorageConfig(projectId: string, config: StorageConfig): Promise<void>;
|
|
522
|
+
listAllBuckets(projectId: string): Promise<StorageBucket[]>;
|
|
523
|
+
};
|
|
524
|
+
type BranchingOperations = {
|
|
525
|
+
listBranches(projectId: string): Promise<Branch[]>;
|
|
526
|
+
createBranch(projectId: string, options: CreateBranchOptions): Promise<Branch>;
|
|
527
|
+
deleteBranch(branchId: string): Promise<void>;
|
|
528
|
+
mergeBranch(branchId: string): Promise<void>;
|
|
529
|
+
resetBranch(branchId: string, options: ResetBranchOptions): Promise<void>;
|
|
530
|
+
rebaseBranch(branchId: string): Promise<void>;
|
|
531
|
+
};
|
|
532
|
+
/**
|
|
533
|
+
* Returns only the `updated_at` timestamp of the named secret, never its
|
|
534
|
+
* value or digest.
|
|
535
|
+
*/
|
|
536
|
+
type SecretOperations = {
|
|
537
|
+
getUpdatedAt(projectId: string, name: string): Promise<Date | undefined>;
|
|
538
|
+
};
|
|
539
|
+
type NotebookOperations = {
|
|
540
|
+
/** Optional for platforms that only support reading notebooks. */
|
|
541
|
+
createNotebook?(projectId: string, options: CreateNotebookOptions): Promise<NotebookWithContent>;
|
|
542
|
+
listNotebooks(projectId: string): Promise<Notebook[]>;
|
|
543
|
+
getNotebook(projectId: string, notebookId: string): Promise<NotebookWithContent>;
|
|
544
|
+
};
|
|
545
|
+
type FeedbackOperations = {
|
|
546
|
+
submit(input: {
|
|
547
|
+
feedback: string;
|
|
548
|
+
projectId?: string;
|
|
549
|
+
clientInfo?: {
|
|
550
|
+
name: string;
|
|
551
|
+
version: string;
|
|
552
|
+
};
|
|
553
|
+
}): Promise<{
|
|
554
|
+
deleteToken: string;
|
|
555
|
+
}>;
|
|
556
|
+
delete(input: {
|
|
557
|
+
deleteToken: string;
|
|
558
|
+
projectId?: string;
|
|
559
|
+
}): Promise<{
|
|
560
|
+
deleted: boolean;
|
|
561
|
+
}>;
|
|
562
|
+
};
|
|
563
|
+
type SchemarchPlatform = {
|
|
564
|
+
init?(info: InitData): Promise<void>;
|
|
565
|
+
account?: AccountOperations;
|
|
566
|
+
database?: DatabaseOperations;
|
|
567
|
+
functions?: EdgeFunctionsOperations;
|
|
568
|
+
debugging?: DebuggingOperations;
|
|
569
|
+
development?: DevelopmentOperations;
|
|
570
|
+
storage?: StorageOperations;
|
|
571
|
+
branching?: BranchingOperations;
|
|
572
|
+
secrets?: SecretOperations;
|
|
573
|
+
notebooks?: NotebookOperations;
|
|
574
|
+
feedback?: FeedbackOperations;
|
|
575
|
+
};
|
|
576
|
+
|
|
577
|
+
export { type AccountOperations, type ApiKey, type ApiKeyType, type ApplyMigrationOptions, type Branch, type BranchingOperations, type CreateBranchOptions, type CreateNotebookOptions, type CreateProjectOptions, type DatabaseOperations, type DebuggingOperations, type DeployEdgeFunctionOptions, type DevelopmentOperations, type EdgeFunction, type EdgeFunctionWithBody, type EdgeFunctionsOperations, type ExecuteSqlOptions, type FeedbackOperations, type GenerateTypescriptTypesResult, type GetLogsOptions, type ListMigrationsResult, type LogsDialect, type LogsService, type Migration, type Notebook, type NotebookCell, type NotebookOperations, type NotebookWithContent, type Organization, type Project, type QueryLogsOptions, type ResetBranchOptions, type SchemarchPlatform, type SecretOperations, type StorageBucket, type StorageConfig, type StorageOperations, type SuccessResponse, apiKeyTypeSchema, applyMigrationOptionsSchema, branchSchema, createBranchOptionsSchema, createNotebookOptionsSchema, createProjectOptionsSchema, deployEdgeFunctionOptionsSchema, edgeFunctionSchema, edgeFunctionWithBodySchema, executeSqlOptionsSchema, generateTypescriptTypesResultSchema, getLogsOptionsSchema, logsServiceSchema, migrationSchema, notebookCellSchema, notebookSchema, notebookWithContentSchema, organizationSchema, projectSchema, queryLogsOptionsSchema, resetBranchOptionsSchema, storageBucketSchema, storageConfigSchema };
|