@squadbase/connectors 0.0.2 → 0.0.4
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/README.md +37 -0
- package/dist/index.d.ts +718 -69
- package/dist/index.js +2946 -92
- package/package.json +12 -18
- package/dist/index.ui.d.ts +0 -14
- package/dist/index.ui.js +0 -387
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,41 @@
|
|
|
1
|
+
import { ConnectorConnectionObject } from '@squadbase/dashboard-types';
|
|
1
2
|
import { Tool } from 'ai';
|
|
2
3
|
import { ZodType } from 'zod';
|
|
3
4
|
|
|
5
|
+
type SetupLanguage = "en" | "ja";
|
|
6
|
+
declare class ConnectorSetup {
|
|
7
|
+
readonly prompts: Readonly<Record<SetupLanguage, string>>;
|
|
8
|
+
constructor(prompts: Record<SetupLanguage, string>);
|
|
9
|
+
getPrompt(language: SetupLanguage): string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declare class ParameterDefinition {
|
|
13
|
+
readonly slug: string;
|
|
14
|
+
readonly name: string;
|
|
15
|
+
readonly description: string;
|
|
16
|
+
readonly envVarBaseKey: string;
|
|
17
|
+
readonly type: "text" | "base64EncodedJson" | "base64EncodedText";
|
|
18
|
+
readonly secret: boolean;
|
|
19
|
+
readonly required: boolean;
|
|
20
|
+
constructor(config: {
|
|
21
|
+
slug: string;
|
|
22
|
+
name: string;
|
|
23
|
+
description: string;
|
|
24
|
+
envVarBaseKey: string;
|
|
25
|
+
type: "text" | "base64EncodedJson" | "base64EncodedText";
|
|
26
|
+
secret: boolean;
|
|
27
|
+
required: boolean;
|
|
28
|
+
});
|
|
29
|
+
/**
|
|
30
|
+
* Get the parameter value from a ConnectorConnectionObject.
|
|
31
|
+
*/
|
|
32
|
+
getValue(connection: ConnectorConnectionObject): string;
|
|
33
|
+
/**
|
|
34
|
+
* Try to get the parameter value. Returns undefined if not found (for optional params).
|
|
35
|
+
*/
|
|
36
|
+
tryGetValue(connection: ConnectorConnectionObject): string | undefined;
|
|
37
|
+
}
|
|
38
|
+
|
|
4
39
|
interface ReleaseFlag {
|
|
5
40
|
dev1: boolean;
|
|
6
41
|
dev2: boolean;
|
|
@@ -17,14 +52,6 @@ interface ProxyPolicyRule {
|
|
|
17
52
|
interface ProxyPolicy {
|
|
18
53
|
allowlist: ProxyPolicyRule[];
|
|
19
54
|
}
|
|
20
|
-
interface ConnectorConnection {
|
|
21
|
-
id: string;
|
|
22
|
-
name: string;
|
|
23
|
-
parameters: {
|
|
24
|
-
slug: string;
|
|
25
|
-
value: string | null;
|
|
26
|
-
}[];
|
|
27
|
-
}
|
|
28
55
|
interface ConnectorToolsConfig {
|
|
29
56
|
oauthProxy: {
|
|
30
57
|
appApiKey: string;
|
|
@@ -35,53 +62,6 @@ interface ConnectorToolsConfig {
|
|
|
35
62
|
previewBaseDomain: string;
|
|
36
63
|
};
|
|
37
64
|
}
|
|
38
|
-
interface DatabaseClient {
|
|
39
|
-
query(sql: string, params?: unknown[]): Promise<{
|
|
40
|
-
rows: Record<string, unknown>[];
|
|
41
|
-
}>;
|
|
42
|
-
}
|
|
43
|
-
interface ConnectionEntry {
|
|
44
|
-
connector: {
|
|
45
|
-
slug: string;
|
|
46
|
-
authType?: string | null;
|
|
47
|
-
};
|
|
48
|
-
envVars: Record<string, string>;
|
|
49
|
-
}
|
|
50
|
-
interface DynamicToolProps {
|
|
51
|
-
toolName: string;
|
|
52
|
-
state: string;
|
|
53
|
-
input: unknown;
|
|
54
|
-
output: unknown;
|
|
55
|
-
errorText: string | undefined;
|
|
56
|
-
onSuggest?: (prompt: string, newThread: boolean) => void;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
declare class ParameterDefinition {
|
|
60
|
-
readonly slug: string;
|
|
61
|
-
readonly name: string;
|
|
62
|
-
readonly description: string;
|
|
63
|
-
readonly envVarBaseKey: string;
|
|
64
|
-
readonly type: "text" | "base64EncodedJson";
|
|
65
|
-
readonly secret: boolean;
|
|
66
|
-
readonly required: boolean;
|
|
67
|
-
constructor(config: {
|
|
68
|
-
slug: string;
|
|
69
|
-
name: string;
|
|
70
|
-
description: string;
|
|
71
|
-
envVarBaseKey: string;
|
|
72
|
-
type: "text" | "base64EncodedJson";
|
|
73
|
-
secret: boolean;
|
|
74
|
-
required: boolean;
|
|
75
|
-
});
|
|
76
|
-
/**
|
|
77
|
-
* Resolve a parameter value from a connection object (agent environment).
|
|
78
|
-
*/
|
|
79
|
-
resolve(connection: ConnectorConnection): string;
|
|
80
|
-
/**
|
|
81
|
-
* Resolve the value of a connection parameter from environment variables (vite-server).
|
|
82
|
-
*/
|
|
83
|
-
resolveEnvVar(entry: ConnectionEntry, connectionId: string): string;
|
|
84
|
-
}
|
|
85
65
|
|
|
86
66
|
declare class ConnectorTool<I = any, O = any> {
|
|
87
67
|
readonly name: string;
|
|
@@ -94,39 +74,56 @@ declare class ConnectorTool<I = any, O = any> {
|
|
|
94
74
|
readonly description: string;
|
|
95
75
|
readonly inputSchema: ZodType<I>;
|
|
96
76
|
readonly outputSchema: ZodType<O>;
|
|
97
|
-
readonly execute: (input: I, connections:
|
|
77
|
+
readonly execute: (input: I, connections: ConnectorConnectionObject[], config: ConnectorToolsConfig) => Promise<O>;
|
|
98
78
|
});
|
|
99
|
-
createTool(connections:
|
|
79
|
+
createTool(connections: ConnectorConnectionObject[], config: ConnectorToolsConfig): Tool;
|
|
100
80
|
}
|
|
101
81
|
|
|
102
|
-
declare class ConnectorPlugin {
|
|
82
|
+
declare class ConnectorPlugin<P extends Record<string, ParameterDefinition> = Record<string, ParameterDefinition>, T extends Record<string, ConnectorTool> = Record<string, ConnectorTool>> {
|
|
103
83
|
readonly slug: string;
|
|
104
84
|
readonly authType: string | null;
|
|
105
85
|
readonly name: string;
|
|
106
86
|
readonly description: string;
|
|
107
87
|
readonly iconUrl: string;
|
|
108
|
-
readonly
|
|
109
|
-
readonly parameters: readonly ParameterDefinition[];
|
|
88
|
+
readonly parameters: P;
|
|
110
89
|
readonly releaseFlag: ReleaseFlag;
|
|
111
90
|
readonly proxyPolicy?: ProxyPolicy;
|
|
91
|
+
readonly experimentalAttributes?: Record<string, unknown> | null;
|
|
92
|
+
readonly setup?: ConnectorSetup;
|
|
112
93
|
readonly systemPrompt: string;
|
|
113
|
-
readonly tools:
|
|
114
|
-
readonly
|
|
94
|
+
readonly tools: T;
|
|
95
|
+
readonly query?: (params: Record<string, string>, sql: string, namedParams: Record<string, unknown> | undefined, context: {
|
|
96
|
+
proxyFetch: typeof fetch;
|
|
97
|
+
}) => Promise<{
|
|
98
|
+
rows: Record<string, unknown>[];
|
|
99
|
+
}>;
|
|
115
100
|
constructor(config: {
|
|
116
101
|
slug: string;
|
|
117
102
|
authType: string | null;
|
|
118
103
|
name: string;
|
|
119
104
|
description: string;
|
|
120
105
|
iconUrl: string;
|
|
121
|
-
|
|
122
|
-
parameters: readonly ParameterDefinition[];
|
|
106
|
+
parameters: P;
|
|
123
107
|
releaseFlag: ReleaseFlag;
|
|
124
108
|
proxyPolicy?: ProxyPolicy;
|
|
109
|
+
experimentalAttributes?: Record<string, unknown> | null;
|
|
110
|
+
setup?: ConnectorSetup;
|
|
125
111
|
systemPrompt: string;
|
|
126
|
-
tools:
|
|
127
|
-
|
|
112
|
+
tools: T;
|
|
113
|
+
query?: (params: Record<string, string>, sql: string, namedParams: Record<string, unknown> | undefined, context: {
|
|
114
|
+
proxyFetch: typeof fetch;
|
|
115
|
+
}) => Promise<{
|
|
116
|
+
rows: Record<string, unknown>[];
|
|
117
|
+
}>;
|
|
128
118
|
});
|
|
129
119
|
get connectorKey(): string;
|
|
120
|
+
/**
|
|
121
|
+
* Create tools for connections that belong to this connector.
|
|
122
|
+
* Filters connections by connectorKey internally.
|
|
123
|
+
* Returns tools keyed as `${connectorKey}_${toolName}`.
|
|
124
|
+
*/
|
|
125
|
+
createTools(connections: ConnectorConnectionObject[], config: ConnectorToolsConfig): Record<string, Tool<any, any>>;
|
|
126
|
+
static deriveKey(slug: string, authType: string | null | undefined): string;
|
|
130
127
|
}
|
|
131
128
|
|
|
132
129
|
declare const AUTH_TYPES: {
|
|
@@ -137,8 +134,660 @@ declare const AUTH_TYPES: {
|
|
|
137
134
|
readonly PAT: "pat";
|
|
138
135
|
};
|
|
139
136
|
|
|
140
|
-
declare const connectors:
|
|
137
|
+
declare const connectors: {
|
|
138
|
+
/**
|
|
139
|
+
* Return plugins that have at least one matching connection.
|
|
140
|
+
*/
|
|
141
|
+
pluginsFor(connections: ConnectorConnectionObject[]): ConnectorPlugin[];
|
|
142
|
+
/**
|
|
143
|
+
* Find a plugin by slug and authType.
|
|
144
|
+
*/
|
|
145
|
+
findByKey(slug: string, authType?: string | null): ConnectorPlugin | undefined;
|
|
146
|
+
snowflake: ConnectorPlugin<{
|
|
147
|
+
account: ParameterDefinition;
|
|
148
|
+
user: ParameterDefinition;
|
|
149
|
+
role: ParameterDefinition;
|
|
150
|
+
warehouse: ParameterDefinition;
|
|
151
|
+
privateKeyBase64: ParameterDefinition;
|
|
152
|
+
}, {
|
|
153
|
+
executeQuery: ConnectorTool<{
|
|
154
|
+
connectionId: string;
|
|
155
|
+
sql: string;
|
|
156
|
+
toolUseIntent?: string | undefined;
|
|
157
|
+
}, {
|
|
158
|
+
success: true;
|
|
159
|
+
rowCount: number;
|
|
160
|
+
truncated: boolean;
|
|
161
|
+
rows: Record<string, unknown>[];
|
|
162
|
+
} | {
|
|
163
|
+
success: false;
|
|
164
|
+
error: string;
|
|
165
|
+
}>;
|
|
166
|
+
}>;
|
|
167
|
+
snowflakePat: ConnectorPlugin<{
|
|
168
|
+
account: ParameterDefinition;
|
|
169
|
+
user: ParameterDefinition;
|
|
170
|
+
role: ParameterDefinition;
|
|
171
|
+
warehouse: ParameterDefinition;
|
|
172
|
+
pat: ParameterDefinition;
|
|
173
|
+
}, {
|
|
174
|
+
executeQuery: ConnectorTool<{
|
|
175
|
+
connectionId: string;
|
|
176
|
+
sql: string;
|
|
177
|
+
toolUseIntent?: string | undefined;
|
|
178
|
+
}, {
|
|
179
|
+
success: true;
|
|
180
|
+
rowCount: number;
|
|
181
|
+
truncated: boolean;
|
|
182
|
+
rows: Record<string, unknown>[];
|
|
183
|
+
} | {
|
|
184
|
+
success: false;
|
|
185
|
+
error: string;
|
|
186
|
+
}>;
|
|
187
|
+
}>;
|
|
188
|
+
bigquery: ConnectorPlugin<{
|
|
189
|
+
serviceAccountKeyJsonBase64: ParameterDefinition;
|
|
190
|
+
projectId: ParameterDefinition;
|
|
191
|
+
}, {
|
|
192
|
+
executeQuery: ConnectorTool<{
|
|
193
|
+
connectionId: string;
|
|
194
|
+
sql: string;
|
|
195
|
+
toolUseIntent?: string | undefined;
|
|
196
|
+
}, {
|
|
197
|
+
success: true;
|
|
198
|
+
rowCount: number;
|
|
199
|
+
truncated: boolean;
|
|
200
|
+
rows: Record<string, unknown>[];
|
|
201
|
+
} | {
|
|
202
|
+
success: false;
|
|
203
|
+
error: string;
|
|
204
|
+
}>;
|
|
205
|
+
listProjects: ConnectorTool<{
|
|
206
|
+
connectionId: string;
|
|
207
|
+
toolUseIntent?: string | undefined;
|
|
208
|
+
}, {
|
|
209
|
+
success: true;
|
|
210
|
+
projects: {
|
|
211
|
+
projectId: string;
|
|
212
|
+
friendlyName: string;
|
|
213
|
+
}[];
|
|
214
|
+
} | {
|
|
215
|
+
success: false;
|
|
216
|
+
error: string;
|
|
217
|
+
}>;
|
|
218
|
+
}>;
|
|
219
|
+
bigqueryOauth: ConnectorPlugin<{
|
|
220
|
+
projectId: ParameterDefinition;
|
|
221
|
+
}, {
|
|
222
|
+
executeQuery: ConnectorTool<{
|
|
223
|
+
connectionId: string;
|
|
224
|
+
sql: string;
|
|
225
|
+
toolUseIntent?: string | undefined;
|
|
226
|
+
}, {
|
|
227
|
+
success: true;
|
|
228
|
+
rowCount: number;
|
|
229
|
+
truncated: boolean;
|
|
230
|
+
rows: Record<string, unknown>[];
|
|
231
|
+
} | {
|
|
232
|
+
success: false;
|
|
233
|
+
error: string;
|
|
234
|
+
}>;
|
|
235
|
+
listProjects: ConnectorTool<{
|
|
236
|
+
connectionId: string;
|
|
237
|
+
toolUseIntent?: string | undefined;
|
|
238
|
+
}, {
|
|
239
|
+
success: true;
|
|
240
|
+
projects: {
|
|
241
|
+
projectId: string;
|
|
242
|
+
friendlyName: string;
|
|
243
|
+
}[];
|
|
244
|
+
} | {
|
|
245
|
+
success: false;
|
|
246
|
+
error: string;
|
|
247
|
+
}>;
|
|
248
|
+
}>;
|
|
249
|
+
databricks: ConnectorPlugin<{
|
|
250
|
+
host: ParameterDefinition;
|
|
251
|
+
token: ParameterDefinition;
|
|
252
|
+
httpPath: ParameterDefinition;
|
|
253
|
+
}, {
|
|
254
|
+
executeQuery: ConnectorTool<{
|
|
255
|
+
connectionId: string;
|
|
256
|
+
sql: string;
|
|
257
|
+
toolUseIntent?: string | undefined;
|
|
258
|
+
}, {
|
|
259
|
+
success: true;
|
|
260
|
+
rowCount: number;
|
|
261
|
+
truncated: boolean;
|
|
262
|
+
rows: Record<string, unknown>[];
|
|
263
|
+
} | {
|
|
264
|
+
success: false;
|
|
265
|
+
error: string;
|
|
266
|
+
}>;
|
|
267
|
+
}>;
|
|
268
|
+
redshift: ConnectorPlugin<{
|
|
269
|
+
awsAccessKeyId: ParameterDefinition;
|
|
270
|
+
awsSecretAccessKey: ParameterDefinition;
|
|
271
|
+
awsRegion: ParameterDefinition;
|
|
272
|
+
database: ParameterDefinition;
|
|
273
|
+
clusterIdentifier: ParameterDefinition;
|
|
274
|
+
workgroupName: ParameterDefinition;
|
|
275
|
+
secretArn: ParameterDefinition;
|
|
276
|
+
dbUser: ParameterDefinition;
|
|
277
|
+
}, {
|
|
278
|
+
executeQuery: ConnectorTool<{
|
|
279
|
+
connectionId: string;
|
|
280
|
+
sql: string;
|
|
281
|
+
toolUseIntent?: string | undefined;
|
|
282
|
+
}, {
|
|
283
|
+
success: true;
|
|
284
|
+
rowCount: number;
|
|
285
|
+
truncated: boolean;
|
|
286
|
+
rows: Record<string, unknown>[];
|
|
287
|
+
} | {
|
|
288
|
+
success: false;
|
|
289
|
+
error: string;
|
|
290
|
+
}>;
|
|
291
|
+
}>;
|
|
292
|
+
dbt: ConnectorPlugin<{
|
|
293
|
+
host: ParameterDefinition;
|
|
294
|
+
accountId: ParameterDefinition;
|
|
295
|
+
prodEnvId: ParameterDefinition;
|
|
296
|
+
token: ParameterDefinition;
|
|
297
|
+
}, {
|
|
298
|
+
request: ConnectorTool<{
|
|
299
|
+
connectionId: string;
|
|
300
|
+
query: string;
|
|
301
|
+
toolUseIntent?: string | undefined;
|
|
302
|
+
variables?: Record<string, unknown> | undefined;
|
|
303
|
+
}, {
|
|
304
|
+
success: true;
|
|
305
|
+
data: Record<string, unknown>;
|
|
306
|
+
} | {
|
|
307
|
+
success: false;
|
|
308
|
+
error: string;
|
|
309
|
+
}>;
|
|
310
|
+
}>;
|
|
311
|
+
awsAthena: ConnectorPlugin<{
|
|
312
|
+
awsAccessKeyId: ParameterDefinition;
|
|
313
|
+
awsSecretAccessKey: ParameterDefinition;
|
|
314
|
+
awsRegion: ParameterDefinition;
|
|
315
|
+
workgroup: ParameterDefinition;
|
|
316
|
+
outputLocation: ParameterDefinition;
|
|
317
|
+
}, {
|
|
318
|
+
executeQuery: ConnectorTool<{
|
|
319
|
+
connectionId: string;
|
|
320
|
+
sql: string;
|
|
321
|
+
toolUseIntent?: string | undefined;
|
|
322
|
+
}, {
|
|
323
|
+
success: true;
|
|
324
|
+
rowCount: number;
|
|
325
|
+
truncated: boolean;
|
|
326
|
+
rows: Record<string, unknown>[];
|
|
327
|
+
} | {
|
|
328
|
+
success: false;
|
|
329
|
+
error: string;
|
|
330
|
+
}>;
|
|
331
|
+
}>;
|
|
332
|
+
postgresql: ConnectorPlugin<{
|
|
333
|
+
connectionUrl: ParameterDefinition;
|
|
334
|
+
}, {
|
|
335
|
+
executeQuery: ConnectorTool<{
|
|
336
|
+
connectionId: string;
|
|
337
|
+
sql: string;
|
|
338
|
+
toolUseIntent?: string | undefined;
|
|
339
|
+
}, {
|
|
340
|
+
success: true;
|
|
341
|
+
rowCount: number;
|
|
342
|
+
truncated: boolean;
|
|
343
|
+
rows: Record<string, unknown>[];
|
|
344
|
+
} | {
|
|
345
|
+
success: false;
|
|
346
|
+
error: string;
|
|
347
|
+
}>;
|
|
348
|
+
}>;
|
|
349
|
+
mysql: ConnectorPlugin<{
|
|
350
|
+
connectionUrl: ParameterDefinition;
|
|
351
|
+
}, {
|
|
352
|
+
executeQuery: ConnectorTool<{
|
|
353
|
+
connectionId: string;
|
|
354
|
+
sql: string;
|
|
355
|
+
toolUseIntent?: string | undefined;
|
|
356
|
+
}, {
|
|
357
|
+
success: true;
|
|
358
|
+
rowCount: number;
|
|
359
|
+
truncated: boolean;
|
|
360
|
+
rows: Record<string, unknown>[];
|
|
361
|
+
} | {
|
|
362
|
+
success: false;
|
|
363
|
+
error: string;
|
|
364
|
+
}>;
|
|
365
|
+
}>;
|
|
366
|
+
googleAnalytics: ConnectorPlugin<{
|
|
367
|
+
serviceAccountKeyJsonBase64: ParameterDefinition;
|
|
368
|
+
propertyId: ParameterDefinition;
|
|
369
|
+
}, {
|
|
370
|
+
request: ConnectorTool<{
|
|
371
|
+
connectionId: string;
|
|
372
|
+
method: "GET" | "POST";
|
|
373
|
+
path: string;
|
|
374
|
+
toolUseIntent?: string | undefined;
|
|
375
|
+
body?: Record<string, unknown> | undefined;
|
|
376
|
+
}, {
|
|
377
|
+
success: true;
|
|
378
|
+
status: number;
|
|
379
|
+
data: Record<string, unknown>;
|
|
380
|
+
} | {
|
|
381
|
+
success: false;
|
|
382
|
+
error: string;
|
|
383
|
+
}>;
|
|
384
|
+
}>;
|
|
385
|
+
airtable: ConnectorPlugin<{
|
|
386
|
+
baseId: ParameterDefinition;
|
|
387
|
+
apiKey: ParameterDefinition;
|
|
388
|
+
}, {
|
|
389
|
+
request: ConnectorTool<{
|
|
390
|
+
connectionId: string;
|
|
391
|
+
method: "GET" | "POST" | "PATCH" | "DELETE";
|
|
392
|
+
path: string;
|
|
393
|
+
toolUseIntent?: string | undefined;
|
|
394
|
+
body?: Record<string, unknown> | undefined;
|
|
395
|
+
}, {
|
|
396
|
+
success: true;
|
|
397
|
+
status: number;
|
|
398
|
+
data: Record<string, unknown>;
|
|
399
|
+
} | {
|
|
400
|
+
success: false;
|
|
401
|
+
error: string;
|
|
402
|
+
}>;
|
|
403
|
+
}>;
|
|
404
|
+
squadbaseDb: ConnectorPlugin<{
|
|
405
|
+
connectionUrl: ParameterDefinition;
|
|
406
|
+
}, {
|
|
407
|
+
executeQuery: ConnectorTool<{
|
|
408
|
+
connectionId: string;
|
|
409
|
+
sql: string;
|
|
410
|
+
toolUseIntent?: string | undefined;
|
|
411
|
+
}, {
|
|
412
|
+
success: true;
|
|
413
|
+
rowCount: number;
|
|
414
|
+
truncated: boolean;
|
|
415
|
+
rows: Record<string, unknown>[];
|
|
416
|
+
} | {
|
|
417
|
+
success: false;
|
|
418
|
+
error: string;
|
|
419
|
+
}>;
|
|
420
|
+
}>;
|
|
421
|
+
kintone: ConnectorPlugin<{
|
|
422
|
+
baseUrl: ParameterDefinition;
|
|
423
|
+
username: ParameterDefinition;
|
|
424
|
+
password: ParameterDefinition;
|
|
425
|
+
}, {
|
|
426
|
+
request: ConnectorTool<{
|
|
427
|
+
connectionId: string;
|
|
428
|
+
method: "GET" | "POST" | "PUT" | "DELETE";
|
|
429
|
+
path: string;
|
|
430
|
+
toolUseIntent?: string | undefined;
|
|
431
|
+
body?: Record<string, unknown> | undefined;
|
|
432
|
+
}, {
|
|
433
|
+
success: true;
|
|
434
|
+
status: number;
|
|
435
|
+
data: Record<string, unknown>;
|
|
436
|
+
} | {
|
|
437
|
+
success: false;
|
|
438
|
+
error: string;
|
|
439
|
+
}>;
|
|
440
|
+
}>;
|
|
441
|
+
wixStore: ConnectorPlugin<{
|
|
442
|
+
accountId: ParameterDefinition;
|
|
443
|
+
siteId: ParameterDefinition;
|
|
444
|
+
apiKey: ParameterDefinition;
|
|
445
|
+
}, {
|
|
446
|
+
request: ConnectorTool<{
|
|
447
|
+
connectionId: string;
|
|
448
|
+
method: "GET" | "POST";
|
|
449
|
+
path: string;
|
|
450
|
+
toolUseIntent?: string | undefined;
|
|
451
|
+
body?: Record<string, unknown> | undefined;
|
|
452
|
+
}, {
|
|
453
|
+
success: true;
|
|
454
|
+
status: number;
|
|
455
|
+
data: Record<string, unknown>;
|
|
456
|
+
} | {
|
|
457
|
+
success: false;
|
|
458
|
+
error: string;
|
|
459
|
+
}>;
|
|
460
|
+
}>;
|
|
461
|
+
};
|
|
462
|
+
|
|
463
|
+
declare const snowflakeConnector: ConnectorPlugin<{
|
|
464
|
+
account: ParameterDefinition;
|
|
465
|
+
user: ParameterDefinition;
|
|
466
|
+
role: ParameterDefinition;
|
|
467
|
+
warehouse: ParameterDefinition;
|
|
468
|
+
privateKeyBase64: ParameterDefinition;
|
|
469
|
+
}, {
|
|
470
|
+
executeQuery: ConnectorTool<{
|
|
471
|
+
connectionId: string;
|
|
472
|
+
sql: string;
|
|
473
|
+
toolUseIntent?: string | undefined;
|
|
474
|
+
}, {
|
|
475
|
+
success: true;
|
|
476
|
+
rowCount: number;
|
|
477
|
+
truncated: boolean;
|
|
478
|
+
rows: Record<string, unknown>[];
|
|
479
|
+
} | {
|
|
480
|
+
success: false;
|
|
481
|
+
error: string;
|
|
482
|
+
}>;
|
|
483
|
+
}>;
|
|
484
|
+
|
|
485
|
+
declare const snowflakePatConnector: ConnectorPlugin<{
|
|
486
|
+
account: ParameterDefinition;
|
|
487
|
+
user: ParameterDefinition;
|
|
488
|
+
role: ParameterDefinition;
|
|
489
|
+
warehouse: ParameterDefinition;
|
|
490
|
+
pat: ParameterDefinition;
|
|
491
|
+
}, {
|
|
492
|
+
executeQuery: ConnectorTool<{
|
|
493
|
+
connectionId: string;
|
|
494
|
+
sql: string;
|
|
495
|
+
toolUseIntent?: string | undefined;
|
|
496
|
+
}, {
|
|
497
|
+
success: true;
|
|
498
|
+
rowCount: number;
|
|
499
|
+
truncated: boolean;
|
|
500
|
+
rows: Record<string, unknown>[];
|
|
501
|
+
} | {
|
|
502
|
+
success: false;
|
|
503
|
+
error: string;
|
|
504
|
+
}>;
|
|
505
|
+
}>;
|
|
506
|
+
|
|
507
|
+
declare const postgresqlConnector: ConnectorPlugin<{
|
|
508
|
+
connectionUrl: ParameterDefinition;
|
|
509
|
+
}, {
|
|
510
|
+
executeQuery: ConnectorTool<{
|
|
511
|
+
connectionId: string;
|
|
512
|
+
sql: string;
|
|
513
|
+
toolUseIntent?: string | undefined;
|
|
514
|
+
}, {
|
|
515
|
+
success: true;
|
|
516
|
+
rowCount: number;
|
|
517
|
+
truncated: boolean;
|
|
518
|
+
rows: Record<string, unknown>[];
|
|
519
|
+
} | {
|
|
520
|
+
success: false;
|
|
521
|
+
error: string;
|
|
522
|
+
}>;
|
|
523
|
+
}>;
|
|
524
|
+
|
|
525
|
+
declare const mysqlConnector: ConnectorPlugin<{
|
|
526
|
+
connectionUrl: ParameterDefinition;
|
|
527
|
+
}, {
|
|
528
|
+
executeQuery: ConnectorTool<{
|
|
529
|
+
connectionId: string;
|
|
530
|
+
sql: string;
|
|
531
|
+
toolUseIntent?: string | undefined;
|
|
532
|
+
}, {
|
|
533
|
+
success: true;
|
|
534
|
+
rowCount: number;
|
|
535
|
+
truncated: boolean;
|
|
536
|
+
rows: Record<string, unknown>[];
|
|
537
|
+
} | {
|
|
538
|
+
success: false;
|
|
539
|
+
error: string;
|
|
540
|
+
}>;
|
|
541
|
+
}>;
|
|
141
542
|
|
|
142
|
-
declare const
|
|
543
|
+
declare const bigqueryConnector: ConnectorPlugin<{
|
|
544
|
+
serviceAccountKeyJsonBase64: ParameterDefinition;
|
|
545
|
+
projectId: ParameterDefinition;
|
|
546
|
+
}, {
|
|
547
|
+
executeQuery: ConnectorTool<{
|
|
548
|
+
connectionId: string;
|
|
549
|
+
sql: string;
|
|
550
|
+
toolUseIntent?: string | undefined;
|
|
551
|
+
}, {
|
|
552
|
+
success: true;
|
|
553
|
+
rowCount: number;
|
|
554
|
+
truncated: boolean;
|
|
555
|
+
rows: Record<string, unknown>[];
|
|
556
|
+
} | {
|
|
557
|
+
success: false;
|
|
558
|
+
error: string;
|
|
559
|
+
}>;
|
|
560
|
+
listProjects: ConnectorTool<{
|
|
561
|
+
connectionId: string;
|
|
562
|
+
toolUseIntent?: string | undefined;
|
|
563
|
+
}, {
|
|
564
|
+
success: true;
|
|
565
|
+
projects: {
|
|
566
|
+
projectId: string;
|
|
567
|
+
friendlyName: string;
|
|
568
|
+
}[];
|
|
569
|
+
} | {
|
|
570
|
+
success: false;
|
|
571
|
+
error: string;
|
|
572
|
+
}>;
|
|
573
|
+
}>;
|
|
574
|
+
|
|
575
|
+
declare const bigqueryOauthConnector: ConnectorPlugin<{
|
|
576
|
+
projectId: ParameterDefinition;
|
|
577
|
+
}, {
|
|
578
|
+
executeQuery: ConnectorTool<{
|
|
579
|
+
connectionId: string;
|
|
580
|
+
sql: string;
|
|
581
|
+
toolUseIntent?: string | undefined;
|
|
582
|
+
}, {
|
|
583
|
+
success: true;
|
|
584
|
+
rowCount: number;
|
|
585
|
+
truncated: boolean;
|
|
586
|
+
rows: Record<string, unknown>[];
|
|
587
|
+
} | {
|
|
588
|
+
success: false;
|
|
589
|
+
error: string;
|
|
590
|
+
}>;
|
|
591
|
+
listProjects: ConnectorTool<{
|
|
592
|
+
connectionId: string;
|
|
593
|
+
toolUseIntent?: string | undefined;
|
|
594
|
+
}, {
|
|
595
|
+
success: true;
|
|
596
|
+
projects: {
|
|
597
|
+
projectId: string;
|
|
598
|
+
friendlyName: string;
|
|
599
|
+
}[];
|
|
600
|
+
} | {
|
|
601
|
+
success: false;
|
|
602
|
+
error: string;
|
|
603
|
+
}>;
|
|
604
|
+
}>;
|
|
605
|
+
|
|
606
|
+
declare const awsAthenaConnector: ConnectorPlugin<{
|
|
607
|
+
awsAccessKeyId: ParameterDefinition;
|
|
608
|
+
awsSecretAccessKey: ParameterDefinition;
|
|
609
|
+
awsRegion: ParameterDefinition;
|
|
610
|
+
workgroup: ParameterDefinition;
|
|
611
|
+
outputLocation: ParameterDefinition;
|
|
612
|
+
}, {
|
|
613
|
+
executeQuery: ConnectorTool<{
|
|
614
|
+
connectionId: string;
|
|
615
|
+
sql: string;
|
|
616
|
+
toolUseIntent?: string | undefined;
|
|
617
|
+
}, {
|
|
618
|
+
success: true;
|
|
619
|
+
rowCount: number;
|
|
620
|
+
truncated: boolean;
|
|
621
|
+
rows: Record<string, unknown>[];
|
|
622
|
+
} | {
|
|
623
|
+
success: false;
|
|
624
|
+
error: string;
|
|
625
|
+
}>;
|
|
626
|
+
}>;
|
|
627
|
+
|
|
628
|
+
declare const redshiftConnector: ConnectorPlugin<{
|
|
629
|
+
awsAccessKeyId: ParameterDefinition;
|
|
630
|
+
awsSecretAccessKey: ParameterDefinition;
|
|
631
|
+
awsRegion: ParameterDefinition;
|
|
632
|
+
database: ParameterDefinition;
|
|
633
|
+
clusterIdentifier: ParameterDefinition;
|
|
634
|
+
workgroupName: ParameterDefinition;
|
|
635
|
+
secretArn: ParameterDefinition;
|
|
636
|
+
dbUser: ParameterDefinition;
|
|
637
|
+
}, {
|
|
638
|
+
executeQuery: ConnectorTool<{
|
|
639
|
+
connectionId: string;
|
|
640
|
+
sql: string;
|
|
641
|
+
toolUseIntent?: string | undefined;
|
|
642
|
+
}, {
|
|
643
|
+
success: true;
|
|
644
|
+
rowCount: number;
|
|
645
|
+
truncated: boolean;
|
|
646
|
+
rows: Record<string, unknown>[];
|
|
647
|
+
} | {
|
|
648
|
+
success: false;
|
|
649
|
+
error: string;
|
|
650
|
+
}>;
|
|
651
|
+
}>;
|
|
652
|
+
|
|
653
|
+
declare const databricksConnector: ConnectorPlugin<{
|
|
654
|
+
host: ParameterDefinition;
|
|
655
|
+
token: ParameterDefinition;
|
|
656
|
+
httpPath: ParameterDefinition;
|
|
657
|
+
}, {
|
|
658
|
+
executeQuery: ConnectorTool<{
|
|
659
|
+
connectionId: string;
|
|
660
|
+
sql: string;
|
|
661
|
+
toolUseIntent?: string | undefined;
|
|
662
|
+
}, {
|
|
663
|
+
success: true;
|
|
664
|
+
rowCount: number;
|
|
665
|
+
truncated: boolean;
|
|
666
|
+
rows: Record<string, unknown>[];
|
|
667
|
+
} | {
|
|
668
|
+
success: false;
|
|
669
|
+
error: string;
|
|
670
|
+
}>;
|
|
671
|
+
}>;
|
|
672
|
+
|
|
673
|
+
declare const airtableConnector: ConnectorPlugin<{
|
|
674
|
+
baseId: ParameterDefinition;
|
|
675
|
+
apiKey: ParameterDefinition;
|
|
676
|
+
}, {
|
|
677
|
+
request: ConnectorTool<{
|
|
678
|
+
connectionId: string;
|
|
679
|
+
method: "GET" | "POST" | "PATCH" | "DELETE";
|
|
680
|
+
path: string;
|
|
681
|
+
toolUseIntent?: string | undefined;
|
|
682
|
+
body?: Record<string, unknown> | undefined;
|
|
683
|
+
}, {
|
|
684
|
+
success: true;
|
|
685
|
+
status: number;
|
|
686
|
+
data: Record<string, unknown>;
|
|
687
|
+
} | {
|
|
688
|
+
success: false;
|
|
689
|
+
error: string;
|
|
690
|
+
}>;
|
|
691
|
+
}>;
|
|
692
|
+
|
|
693
|
+
declare const googleAnalyticsConnector: ConnectorPlugin<{
|
|
694
|
+
serviceAccountKeyJsonBase64: ParameterDefinition;
|
|
695
|
+
propertyId: ParameterDefinition;
|
|
696
|
+
}, {
|
|
697
|
+
request: ConnectorTool<{
|
|
698
|
+
connectionId: string;
|
|
699
|
+
method: "GET" | "POST";
|
|
700
|
+
path: string;
|
|
701
|
+
toolUseIntent?: string | undefined;
|
|
702
|
+
body?: Record<string, unknown> | undefined;
|
|
703
|
+
}, {
|
|
704
|
+
success: true;
|
|
705
|
+
status: number;
|
|
706
|
+
data: Record<string, unknown>;
|
|
707
|
+
} | {
|
|
708
|
+
success: false;
|
|
709
|
+
error: string;
|
|
710
|
+
}>;
|
|
711
|
+
}>;
|
|
712
|
+
|
|
713
|
+
declare const kintoneConnector: ConnectorPlugin<{
|
|
714
|
+
baseUrl: ParameterDefinition;
|
|
715
|
+
username: ParameterDefinition;
|
|
716
|
+
password: ParameterDefinition;
|
|
717
|
+
}, {
|
|
718
|
+
request: ConnectorTool<{
|
|
719
|
+
connectionId: string;
|
|
720
|
+
method: "GET" | "POST" | "PUT" | "DELETE";
|
|
721
|
+
path: string;
|
|
722
|
+
toolUseIntent?: string | undefined;
|
|
723
|
+
body?: Record<string, unknown> | undefined;
|
|
724
|
+
}, {
|
|
725
|
+
success: true;
|
|
726
|
+
status: number;
|
|
727
|
+
data: Record<string, unknown>;
|
|
728
|
+
} | {
|
|
729
|
+
success: false;
|
|
730
|
+
error: string;
|
|
731
|
+
}>;
|
|
732
|
+
}>;
|
|
733
|
+
|
|
734
|
+
declare const wixStoreConnector: ConnectorPlugin<{
|
|
735
|
+
accountId: ParameterDefinition;
|
|
736
|
+
siteId: ParameterDefinition;
|
|
737
|
+
apiKey: ParameterDefinition;
|
|
738
|
+
}, {
|
|
739
|
+
request: ConnectorTool<{
|
|
740
|
+
connectionId: string;
|
|
741
|
+
method: "GET" | "POST";
|
|
742
|
+
path: string;
|
|
743
|
+
toolUseIntent?: string | undefined;
|
|
744
|
+
body?: Record<string, unknown> | undefined;
|
|
745
|
+
}, {
|
|
746
|
+
success: true;
|
|
747
|
+
status: number;
|
|
748
|
+
data: Record<string, unknown>;
|
|
749
|
+
} | {
|
|
750
|
+
success: false;
|
|
751
|
+
error: string;
|
|
752
|
+
}>;
|
|
753
|
+
}>;
|
|
754
|
+
|
|
755
|
+
declare const dbtConnector: ConnectorPlugin<{
|
|
756
|
+
host: ParameterDefinition;
|
|
757
|
+
accountId: ParameterDefinition;
|
|
758
|
+
prodEnvId: ParameterDefinition;
|
|
759
|
+
token: ParameterDefinition;
|
|
760
|
+
}, {
|
|
761
|
+
request: ConnectorTool<{
|
|
762
|
+
connectionId: string;
|
|
763
|
+
query: string;
|
|
764
|
+
toolUseIntent?: string | undefined;
|
|
765
|
+
variables?: Record<string, unknown> | undefined;
|
|
766
|
+
}, {
|
|
767
|
+
success: true;
|
|
768
|
+
data: Record<string, unknown>;
|
|
769
|
+
} | {
|
|
770
|
+
success: false;
|
|
771
|
+
error: string;
|
|
772
|
+
}>;
|
|
773
|
+
}>;
|
|
774
|
+
|
|
775
|
+
declare const squadbaseDbConnector: ConnectorPlugin<{
|
|
776
|
+
connectionUrl: ParameterDefinition;
|
|
777
|
+
}, {
|
|
778
|
+
executeQuery: ConnectorTool<{
|
|
779
|
+
connectionId: string;
|
|
780
|
+
sql: string;
|
|
781
|
+
toolUseIntent?: string | undefined;
|
|
782
|
+
}, {
|
|
783
|
+
success: true;
|
|
784
|
+
rowCount: number;
|
|
785
|
+
truncated: boolean;
|
|
786
|
+
rows: Record<string, unknown>[];
|
|
787
|
+
} | {
|
|
788
|
+
success: false;
|
|
789
|
+
error: string;
|
|
790
|
+
}>;
|
|
791
|
+
}>;
|
|
143
792
|
|
|
144
|
-
export { AUTH_TYPES,
|
|
793
|
+
export { AUTH_TYPES, ConnectorPlugin, ConnectorSetup, ConnectorTool, type ConnectorToolsConfig, ParameterDefinition, type ProxyPolicy, type ProxyPolicyRule, type ReleaseFlag, type SetupLanguage, airtableConnector, awsAthenaConnector, bigqueryConnector, bigqueryOauthConnector, connectors, databricksConnector, dbtConnector, googleAnalyticsConnector, kintoneConnector, mysqlConnector, postgresqlConnector, redshiftConnector, snowflakeConnector, snowflakePatConnector, squadbaseDbConnector, wixStoreConnector };
|