@squadbase/vite-server 0.1.17-dev.d4fff69 → 0.1.17-dev.e4768d1
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/dist/cli/index.js +4786 -3023
- package/dist/connectors/airtable-oauth.js +39 -15
- package/dist/connectors/airtable.js +86 -15
- package/dist/connectors/amplitude.js +39 -15
- package/dist/connectors/anthropic.js +39 -15
- package/dist/connectors/asana.js +39 -15
- package/dist/connectors/attio.js +39 -15
- package/dist/connectors/aws-billing.js +39 -15
- package/dist/connectors/azure-sql.js +275 -15
- package/dist/connectors/backlog-api-key.js +39 -15
- package/dist/connectors/clickup.js +39 -15
- package/dist/connectors/cosmosdb.js +39 -15
- package/dist/connectors/customerio.js +39 -15
- package/dist/connectors/dbt.js +39 -15
- package/dist/connectors/freshdesk.js +39 -15
- package/dist/connectors/freshsales.js +39 -15
- package/dist/connectors/freshservice.js +39 -15
- package/dist/connectors/gamma.js +39 -15
- package/dist/connectors/gemini.js +39 -15
- package/dist/connectors/github.js +39 -15
- package/dist/connectors/gmail-oauth.js +32 -13
- package/dist/connectors/gmail.js +39 -15
- package/dist/connectors/google-ads.js +39 -15
- package/dist/connectors/google-analytics-oauth.js +39 -15
- package/dist/connectors/google-analytics.js +39 -15
- package/dist/connectors/google-audit-log.js +39 -15
- package/dist/connectors/google-calendar-oauth.js +39 -15
- package/dist/connectors/google-calendar.js +39 -15
- package/dist/connectors/google-docs.js +32 -13
- package/dist/connectors/google-drive.js +32 -13
- package/dist/connectors/google-search-console-oauth.js +39 -15
- package/dist/connectors/google-sheets.js +138 -195
- package/dist/connectors/google-slides.js +32 -13
- package/dist/connectors/grafana.js +39 -15
- package/dist/connectors/hackernews.js +32 -13
- package/dist/connectors/hubspot-oauth.js +32 -13
- package/dist/connectors/hubspot.js +39 -15
- package/dist/connectors/influxdb.js +39 -15
- package/dist/connectors/intercom-oauth.js +32 -13
- package/dist/connectors/intercom.js +39 -15
- package/dist/connectors/jdbc.js +39 -15
- package/dist/connectors/jira-api-key.js +39 -15
- package/dist/connectors/kintone-api-token.js +39 -15
- package/dist/connectors/kintone.js +128 -15
- package/dist/connectors/linear.js +39 -15
- package/dist/connectors/linkedin-ads.js +39 -15
- package/dist/connectors/mailchimp-oauth.js +39 -15
- package/dist/connectors/mailchimp.js +39 -15
- package/dist/connectors/meta-ads-oauth.js +39 -15
- package/dist/connectors/meta-ads.js +39 -15
- package/dist/connectors/mixpanel.js +39 -15
- package/dist/connectors/monday.js +39 -15
- package/dist/connectors/mongodb.js +39 -15
- package/dist/connectors/notion-oauth.js +32 -13
- package/dist/connectors/notion.js +84 -15
- package/dist/connectors/openai.js +39 -15
- package/dist/connectors/oracle.js +277 -15
- package/dist/connectors/outlook-oauth.js +32 -13
- package/dist/connectors/powerbi-oauth.js +32 -13
- package/dist/connectors/salesforce.js +108 -15
- package/dist/connectors/semrush.js +39 -15
- package/dist/connectors/sentry.js +39 -15
- package/dist/connectors/shopify-oauth.js +32 -13
- package/dist/connectors/shopify.js +39 -15
- package/dist/connectors/sqlserver.js +275 -15
- package/dist/connectors/stripe-api-key.js +39 -15
- package/dist/connectors/stripe-oauth.js +32 -13
- package/dist/connectors/supabase.js +284 -15
- package/dist/connectors/tableau.js +39 -15
- package/dist/connectors/tiktok-ads.js +39 -15
- package/dist/connectors/wix-store.js +39 -15
- package/dist/connectors/x.js +39 -15
- package/dist/connectors/zendesk-oauth.js +32 -13
- package/dist/connectors/zendesk.js +39 -15
- package/dist/index.js +4832 -3034
- package/dist/main.js +4832 -3034
- package/dist/vite-plugin.js +4786 -3023
- package/package.json +4 -4
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
2
|
-
var __esm = (fn, res) => function __init() {
|
|
3
|
-
|
|
2
|
+
var __esm = (fn, res, err) => function __init() {
|
|
3
|
+
if (err) throw err[0];
|
|
4
|
+
try {
|
|
5
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
6
|
+
} catch (e) {
|
|
7
|
+
throw err = [e], e;
|
|
8
|
+
}
|
|
4
9
|
};
|
|
5
10
|
|
|
6
11
|
// ../connectors/src/parameter-definition.ts
|
|
@@ -230,6 +235,15 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
230
235
|
* `runSetupFlow` from `setup-flow.ts`.
|
|
231
236
|
*/
|
|
232
237
|
setup;
|
|
238
|
+
/**
|
|
239
|
+
* 統一 introspection。SQL DB の `information_schema` / `SHOW` / `DESCRIBE` や SaaS の
|
|
240
|
+
* メタデータ API といった取得経路の差を吸収し、tables / columns / PK / FK を共通型
|
|
241
|
+
* {@link IntrospectedSchema} へ正規化して返す。取得経路は {@link IntrospectContext} で
|
|
242
|
+
* 抽象化され、SQL DB は `ctx.query`、SaaS は `ctx.proxyFetch` + `ctx.params` を使う。
|
|
243
|
+
* `ctx.profile === true` のときは L2 プロファイル(行数・NULL 率等)も best-effort で埋める。
|
|
244
|
+
* coding-agent の `DataContextIndex` がデータ地図を構築する際に使う。
|
|
245
|
+
*/
|
|
246
|
+
introspect;
|
|
233
247
|
/**
|
|
234
248
|
* Opt-out of the default "verify before save" behavior on connection
|
|
235
249
|
* creation. The backend invokes `checkConnection` synchronously while
|
|
@@ -244,6 +258,14 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
244
258
|
* the default verify-on-create behavior without opt-in.
|
|
245
259
|
*/
|
|
246
260
|
skipConnectionCheckOnCreate;
|
|
261
|
+
/**
|
|
262
|
+
* 決定論的な「立ち上げ survey」レシピ(ルールベース prewarm 基盤)。実装した connector は、LLM を使わずに
|
|
263
|
+
* read-only で自分を survey する probe 列(テーブル/列メタデータ → 小サンプル)を宣言する。coding-agent の
|
|
264
|
+
* recon driver がこれを読み、connector ツールの `execute` を直接呼んで結果を seed にする。未実装の connector は
|
|
265
|
+
* driver 側で safely skip される(その connection は listConnections のみ seed)。標準 `information_schema` を
|
|
266
|
+
* 持つ SQL connector は `makeStandardSqlSurveyProbes` を使える。**probe は必ず read-only**。
|
|
267
|
+
*/
|
|
268
|
+
surveyProbes;
|
|
247
269
|
constructor(config) {
|
|
248
270
|
this.slug = config.slug;
|
|
249
271
|
this.authType = config.authType;
|
|
@@ -261,7 +283,9 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
261
283
|
this.query = config.query;
|
|
262
284
|
this.checkConnection = config.checkConnection;
|
|
263
285
|
this.setup = config.setup;
|
|
286
|
+
this.introspect = config.introspect;
|
|
264
287
|
this.skipConnectionCheckOnCreate = config.skipConnectionCheckOnCreate;
|
|
288
|
+
this.surveyProbes = config.surveyProbes;
|
|
265
289
|
}
|
|
266
290
|
get connectorKey() {
|
|
267
291
|
return _ConnectorPlugin.deriveKey(this.slug, this.authType);
|
|
@@ -299,25 +323,25 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
299
323
|
if (authType) return `${slug}-${authType}`;
|
|
300
324
|
const LEGACY_NULL_AUTH_TYPE_MAP = {
|
|
301
325
|
// user-password
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
326
|
+
postgresql: "user-password",
|
|
327
|
+
mysql: "user-password",
|
|
328
|
+
clickhouse: "user-password",
|
|
329
|
+
kintone: "user-password",
|
|
306
330
|
"squadbase-db": "user-password",
|
|
307
331
|
// service-account
|
|
308
|
-
|
|
309
|
-
|
|
332
|
+
snowflake: "service-account",
|
|
333
|
+
bigquery: "service-account",
|
|
310
334
|
"google-analytics": "service-account",
|
|
311
335
|
"google-calendar": "service-account",
|
|
312
336
|
"aws-athena": "service-account",
|
|
313
|
-
|
|
337
|
+
redshift: "service-account",
|
|
314
338
|
// api-key
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
339
|
+
databricks: "api-key",
|
|
340
|
+
dbt: "api-key",
|
|
341
|
+
airtable: "api-key",
|
|
342
|
+
openai: "api-key",
|
|
343
|
+
gemini: "api-key",
|
|
344
|
+
anthropic: "api-key",
|
|
321
345
|
"wix-store": "api-key"
|
|
322
346
|
};
|
|
323
347
|
const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];
|
|
@@ -79,6 +79,15 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
79
79
|
* `runSetupFlow` from `setup-flow.ts`.
|
|
80
80
|
*/
|
|
81
81
|
setup;
|
|
82
|
+
/**
|
|
83
|
+
* 統一 introspection。SQL DB の `information_schema` / `SHOW` / `DESCRIBE` や SaaS の
|
|
84
|
+
* メタデータ API といった取得経路の差を吸収し、tables / columns / PK / FK を共通型
|
|
85
|
+
* {@link IntrospectedSchema} へ正規化して返す。取得経路は {@link IntrospectContext} で
|
|
86
|
+
* 抽象化され、SQL DB は `ctx.query`、SaaS は `ctx.proxyFetch` + `ctx.params` を使う。
|
|
87
|
+
* `ctx.profile === true` のときは L2 プロファイル(行数・NULL 率等)も best-effort で埋める。
|
|
88
|
+
* coding-agent の `DataContextIndex` がデータ地図を構築する際に使う。
|
|
89
|
+
*/
|
|
90
|
+
introspect;
|
|
82
91
|
/**
|
|
83
92
|
* Opt-out of the default "verify before save" behavior on connection
|
|
84
93
|
* creation. The backend invokes `checkConnection` synchronously while
|
|
@@ -93,6 +102,14 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
93
102
|
* the default verify-on-create behavior without opt-in.
|
|
94
103
|
*/
|
|
95
104
|
skipConnectionCheckOnCreate;
|
|
105
|
+
/**
|
|
106
|
+
* 決定論的な「立ち上げ survey」レシピ(ルールベース prewarm 基盤)。実装した connector は、LLM を使わずに
|
|
107
|
+
* read-only で自分を survey する probe 列(テーブル/列メタデータ → 小サンプル)を宣言する。coding-agent の
|
|
108
|
+
* recon driver がこれを読み、connector ツールの `execute` を直接呼んで結果を seed にする。未実装の connector は
|
|
109
|
+
* driver 側で safely skip される(その connection は listConnections のみ seed)。標準 `information_schema` を
|
|
110
|
+
* 持つ SQL connector は `makeStandardSqlSurveyProbes` を使える。**probe は必ず read-only**。
|
|
111
|
+
*/
|
|
112
|
+
surveyProbes;
|
|
96
113
|
constructor(config) {
|
|
97
114
|
this.slug = config.slug;
|
|
98
115
|
this.authType = config.authType;
|
|
@@ -110,7 +127,9 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
110
127
|
this.query = config.query;
|
|
111
128
|
this.checkConnection = config.checkConnection;
|
|
112
129
|
this.setup = config.setup;
|
|
130
|
+
this.introspect = config.introspect;
|
|
113
131
|
this.skipConnectionCheckOnCreate = config.skipConnectionCheckOnCreate;
|
|
132
|
+
this.surveyProbes = config.surveyProbes;
|
|
114
133
|
}
|
|
115
134
|
get connectorKey() {
|
|
116
135
|
return _ConnectorPlugin.deriveKey(this.slug, this.authType);
|
|
@@ -148,25 +167,25 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
148
167
|
if (authType) return `${slug}-${authType}`;
|
|
149
168
|
const LEGACY_NULL_AUTH_TYPE_MAP = {
|
|
150
169
|
// user-password
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
170
|
+
postgresql: "user-password",
|
|
171
|
+
mysql: "user-password",
|
|
172
|
+
clickhouse: "user-password",
|
|
173
|
+
kintone: "user-password",
|
|
155
174
|
"squadbase-db": "user-password",
|
|
156
175
|
// service-account
|
|
157
|
-
|
|
158
|
-
|
|
176
|
+
snowflake: "service-account",
|
|
177
|
+
bigquery: "service-account",
|
|
159
178
|
"google-analytics": "service-account",
|
|
160
179
|
"google-calendar": "service-account",
|
|
161
180
|
"aws-athena": "service-account",
|
|
162
|
-
|
|
181
|
+
redshift: "service-account",
|
|
163
182
|
// api-key
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
183
|
+
databricks: "api-key",
|
|
184
|
+
dbt: "api-key",
|
|
185
|
+
airtable: "api-key",
|
|
186
|
+
openai: "api-key",
|
|
187
|
+
gemini: "api-key",
|
|
188
|
+
anthropic: "api-key",
|
|
170
189
|
"wix-store": "api-key"
|
|
171
190
|
};
|
|
172
191
|
const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
2
|
-
var __esm = (fn, res) => function __init() {
|
|
3
|
-
|
|
2
|
+
var __esm = (fn, res, err) => function __init() {
|
|
3
|
+
if (err) throw err[0];
|
|
4
|
+
try {
|
|
5
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
6
|
+
} catch (e) {
|
|
7
|
+
throw err = [e], e;
|
|
8
|
+
}
|
|
4
9
|
};
|
|
5
10
|
|
|
6
11
|
// ../connectors/src/parameter-definition.ts
|
|
@@ -245,6 +250,15 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
245
250
|
* `runSetupFlow` from `setup-flow.ts`.
|
|
246
251
|
*/
|
|
247
252
|
setup;
|
|
253
|
+
/**
|
|
254
|
+
* 統一 introspection。SQL DB の `information_schema` / `SHOW` / `DESCRIBE` や SaaS の
|
|
255
|
+
* メタデータ API といった取得経路の差を吸収し、tables / columns / PK / FK を共通型
|
|
256
|
+
* {@link IntrospectedSchema} へ正規化して返す。取得経路は {@link IntrospectContext} で
|
|
257
|
+
* 抽象化され、SQL DB は `ctx.query`、SaaS は `ctx.proxyFetch` + `ctx.params` を使う。
|
|
258
|
+
* `ctx.profile === true` のときは L2 プロファイル(行数・NULL 率等)も best-effort で埋める。
|
|
259
|
+
* coding-agent の `DataContextIndex` がデータ地図を構築する際に使う。
|
|
260
|
+
*/
|
|
261
|
+
introspect;
|
|
248
262
|
/**
|
|
249
263
|
* Opt-out of the default "verify before save" behavior on connection
|
|
250
264
|
* creation. The backend invokes `checkConnection` synchronously while
|
|
@@ -259,6 +273,14 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
259
273
|
* the default verify-on-create behavior without opt-in.
|
|
260
274
|
*/
|
|
261
275
|
skipConnectionCheckOnCreate;
|
|
276
|
+
/**
|
|
277
|
+
* 決定論的な「立ち上げ survey」レシピ(ルールベース prewarm 基盤)。実装した connector は、LLM を使わずに
|
|
278
|
+
* read-only で自分を survey する probe 列(テーブル/列メタデータ → 小サンプル)を宣言する。coding-agent の
|
|
279
|
+
* recon driver がこれを読み、connector ツールの `execute` を直接呼んで結果を seed にする。未実装の connector は
|
|
280
|
+
* driver 側で safely skip される(その connection は listConnections のみ seed)。標準 `information_schema` を
|
|
281
|
+
* 持つ SQL connector は `makeStandardSqlSurveyProbes` を使える。**probe は必ず read-only**。
|
|
282
|
+
*/
|
|
283
|
+
surveyProbes;
|
|
262
284
|
constructor(config) {
|
|
263
285
|
this.slug = config.slug;
|
|
264
286
|
this.authType = config.authType;
|
|
@@ -276,7 +298,9 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
276
298
|
this.query = config.query;
|
|
277
299
|
this.checkConnection = config.checkConnection;
|
|
278
300
|
this.setup = config.setup;
|
|
301
|
+
this.introspect = config.introspect;
|
|
279
302
|
this.skipConnectionCheckOnCreate = config.skipConnectionCheckOnCreate;
|
|
303
|
+
this.surveyProbes = config.surveyProbes;
|
|
280
304
|
}
|
|
281
305
|
get connectorKey() {
|
|
282
306
|
return _ConnectorPlugin.deriveKey(this.slug, this.authType);
|
|
@@ -314,25 +338,25 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
314
338
|
if (authType) return `${slug}-${authType}`;
|
|
315
339
|
const LEGACY_NULL_AUTH_TYPE_MAP = {
|
|
316
340
|
// user-password
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
341
|
+
postgresql: "user-password",
|
|
342
|
+
mysql: "user-password",
|
|
343
|
+
clickhouse: "user-password",
|
|
344
|
+
kintone: "user-password",
|
|
321
345
|
"squadbase-db": "user-password",
|
|
322
346
|
// service-account
|
|
323
|
-
|
|
324
|
-
|
|
347
|
+
snowflake: "service-account",
|
|
348
|
+
bigquery: "service-account",
|
|
325
349
|
"google-analytics": "service-account",
|
|
326
350
|
"google-calendar": "service-account",
|
|
327
351
|
"aws-athena": "service-account",
|
|
328
|
-
|
|
352
|
+
redshift: "service-account",
|
|
329
353
|
// api-key
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
354
|
+
databricks: "api-key",
|
|
355
|
+
dbt: "api-key",
|
|
356
|
+
airtable: "api-key",
|
|
357
|
+
openai: "api-key",
|
|
358
|
+
gemini: "api-key",
|
|
359
|
+
anthropic: "api-key",
|
|
336
360
|
"wix-store": "api-key"
|
|
337
361
|
};
|
|
338
362
|
const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];
|
|
@@ -597,6 +621,50 @@ var notionSetupFlow = {
|
|
|
597
621
|
}
|
|
598
622
|
};
|
|
599
623
|
|
|
624
|
+
// ../connectors/src/connectors/notion/introspect.ts
|
|
625
|
+
var MAX_PAGES = 20;
|
|
626
|
+
var PAGE_SIZE = 100;
|
|
627
|
+
async function introspectNotion(ctx) {
|
|
628
|
+
const tables = [];
|
|
629
|
+
let cursor;
|
|
630
|
+
for (let page = 0; page < MAX_PAGES; page++) {
|
|
631
|
+
const body = {
|
|
632
|
+
filter: { property: "object", value: "database" },
|
|
633
|
+
page_size: PAGE_SIZE
|
|
634
|
+
};
|
|
635
|
+
if (cursor) body.start_cursor = cursor;
|
|
636
|
+
const res = await apiFetch(ctx.params, "/search", {
|
|
637
|
+
method: "POST",
|
|
638
|
+
body: JSON.stringify(body)
|
|
639
|
+
});
|
|
640
|
+
if (!res.ok) {
|
|
641
|
+
throw new Error(`notion: search failed (${res.status})`);
|
|
642
|
+
}
|
|
643
|
+
const data = await res.json();
|
|
644
|
+
for (const db of data.results ?? []) {
|
|
645
|
+
const name = (db.title ?? []).map((t) => t.plain_text ?? "").join("").trim() || "Untitled";
|
|
646
|
+
const columns = Object.entries(
|
|
647
|
+
db.properties ?? {}
|
|
648
|
+
).map(([propName, prop]) => {
|
|
649
|
+
const column = {
|
|
650
|
+
name: propName,
|
|
651
|
+
dataType: prop.type ?? "unknown",
|
|
652
|
+
nullable: true
|
|
653
|
+
};
|
|
654
|
+
if (prop.type === "title") column.isPrimaryKey = true;
|
|
655
|
+
if (prop.type === "relation" && prop.relation?.database_id) {
|
|
656
|
+
column.foreignKey = { table: prop.relation.database_id, column: "" };
|
|
657
|
+
}
|
|
658
|
+
return column;
|
|
659
|
+
});
|
|
660
|
+
tables.push({ schema: "", name, type: "table", columns });
|
|
661
|
+
}
|
|
662
|
+
if (!data.has_more || !data.next_cursor) break;
|
|
663
|
+
cursor = data.next_cursor;
|
|
664
|
+
}
|
|
665
|
+
return { tables };
|
|
666
|
+
}
|
|
667
|
+
|
|
600
668
|
// ../connectors/src/connectors/notion/tools/request.ts
|
|
601
669
|
import { z } from "zod";
|
|
602
670
|
var BASE_URL3 = "https://api.notion.com/v1";
|
|
@@ -832,6 +900,7 @@ export default async function handler(c: Context) {
|
|
|
832
900
|
- 25\u4EF6\u4EE5\u4E0A\u306E\u30A2\u30A4\u30C6\u30E0\u3092\u6301\u3064\u30D7\u30ED\u30D1\u30C6\u30A3\uFF08people\u3001relation\u306A\u3069\uFF09\u306F\u5B8C\u5168\u306A\u30C7\u30FC\u30BF\u53D6\u5F97\u306B\u30D7\u30ED\u30D1\u30C6\u30A3\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\u304C\u5FC5\u8981\u3067\u3059`
|
|
833
901
|
},
|
|
834
902
|
tools,
|
|
903
|
+
introspect: (ctx) => introspectNotion(ctx),
|
|
835
904
|
setup: (params, ctx, config) => runSetupFlow(notionSetupFlow, params, ctx, config),
|
|
836
905
|
async checkConnection(params, _config) {
|
|
837
906
|
const apiKey = params[parameters.apiKey.slug];
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
2
|
-
var __esm = (fn, res) => function __init() {
|
|
3
|
-
|
|
2
|
+
var __esm = (fn, res, err) => function __init() {
|
|
3
|
+
if (err) throw err[0];
|
|
4
|
+
try {
|
|
5
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
6
|
+
} catch (e) {
|
|
7
|
+
throw err = [e], e;
|
|
8
|
+
}
|
|
4
9
|
};
|
|
5
10
|
|
|
6
11
|
// ../connectors/src/parameter-definition.ts
|
|
@@ -105,6 +110,15 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
105
110
|
* `runSetupFlow` from `setup-flow.ts`.
|
|
106
111
|
*/
|
|
107
112
|
setup;
|
|
113
|
+
/**
|
|
114
|
+
* 統一 introspection。SQL DB の `information_schema` / `SHOW` / `DESCRIBE` や SaaS の
|
|
115
|
+
* メタデータ API といった取得経路の差を吸収し、tables / columns / PK / FK を共通型
|
|
116
|
+
* {@link IntrospectedSchema} へ正規化して返す。取得経路は {@link IntrospectContext} で
|
|
117
|
+
* 抽象化され、SQL DB は `ctx.query`、SaaS は `ctx.proxyFetch` + `ctx.params` を使う。
|
|
118
|
+
* `ctx.profile === true` のときは L2 プロファイル(行数・NULL 率等)も best-effort で埋める。
|
|
119
|
+
* coding-agent の `DataContextIndex` がデータ地図を構築する際に使う。
|
|
120
|
+
*/
|
|
121
|
+
introspect;
|
|
108
122
|
/**
|
|
109
123
|
* Opt-out of the default "verify before save" behavior on connection
|
|
110
124
|
* creation. The backend invokes `checkConnection` synchronously while
|
|
@@ -119,6 +133,14 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
119
133
|
* the default verify-on-create behavior without opt-in.
|
|
120
134
|
*/
|
|
121
135
|
skipConnectionCheckOnCreate;
|
|
136
|
+
/**
|
|
137
|
+
* 決定論的な「立ち上げ survey」レシピ(ルールベース prewarm 基盤)。実装した connector は、LLM を使わずに
|
|
138
|
+
* read-only で自分を survey する probe 列(テーブル/列メタデータ → 小サンプル)を宣言する。coding-agent の
|
|
139
|
+
* recon driver がこれを読み、connector ツールの `execute` を直接呼んで結果を seed にする。未実装の connector は
|
|
140
|
+
* driver 側で safely skip される(その connection は listConnections のみ seed)。標準 `information_schema` を
|
|
141
|
+
* 持つ SQL connector は `makeStandardSqlSurveyProbes` を使える。**probe は必ず read-only**。
|
|
142
|
+
*/
|
|
143
|
+
surveyProbes;
|
|
122
144
|
constructor(config) {
|
|
123
145
|
this.slug = config.slug;
|
|
124
146
|
this.authType = config.authType;
|
|
@@ -136,7 +158,9 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
136
158
|
this.query = config.query;
|
|
137
159
|
this.checkConnection = config.checkConnection;
|
|
138
160
|
this.setup = config.setup;
|
|
161
|
+
this.introspect = config.introspect;
|
|
139
162
|
this.skipConnectionCheckOnCreate = config.skipConnectionCheckOnCreate;
|
|
163
|
+
this.surveyProbes = config.surveyProbes;
|
|
140
164
|
}
|
|
141
165
|
get connectorKey() {
|
|
142
166
|
return _ConnectorPlugin.deriveKey(this.slug, this.authType);
|
|
@@ -174,25 +198,25 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
174
198
|
if (authType) return `${slug}-${authType}`;
|
|
175
199
|
const LEGACY_NULL_AUTH_TYPE_MAP = {
|
|
176
200
|
// user-password
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
201
|
+
postgresql: "user-password",
|
|
202
|
+
mysql: "user-password",
|
|
203
|
+
clickhouse: "user-password",
|
|
204
|
+
kintone: "user-password",
|
|
181
205
|
"squadbase-db": "user-password",
|
|
182
206
|
// service-account
|
|
183
|
-
|
|
184
|
-
|
|
207
|
+
snowflake: "service-account",
|
|
208
|
+
bigquery: "service-account",
|
|
185
209
|
"google-analytics": "service-account",
|
|
186
210
|
"google-calendar": "service-account",
|
|
187
211
|
"aws-athena": "service-account",
|
|
188
|
-
|
|
212
|
+
redshift: "service-account",
|
|
189
213
|
// api-key
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
214
|
+
databricks: "api-key",
|
|
215
|
+
dbt: "api-key",
|
|
216
|
+
airtable: "api-key",
|
|
217
|
+
openai: "api-key",
|
|
218
|
+
gemini: "api-key",
|
|
219
|
+
anthropic: "api-key",
|
|
196
220
|
"wix-store": "api-key"
|
|
197
221
|
};
|
|
198
222
|
const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];
|