@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
|
|
@@ -294,6 +299,15 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
294
299
|
* `runSetupFlow` from `setup-flow.ts`.
|
|
295
300
|
*/
|
|
296
301
|
setup;
|
|
302
|
+
/**
|
|
303
|
+
* 統一 introspection。SQL DB の `information_schema` / `SHOW` / `DESCRIBE` や SaaS の
|
|
304
|
+
* メタデータ API といった取得経路の差を吸収し、tables / columns / PK / FK を共通型
|
|
305
|
+
* {@link IntrospectedSchema} へ正規化して返す。取得経路は {@link IntrospectContext} で
|
|
306
|
+
* 抽象化され、SQL DB は `ctx.query`、SaaS は `ctx.proxyFetch` + `ctx.params` を使う。
|
|
307
|
+
* `ctx.profile === true` のときは L2 プロファイル(行数・NULL 率等)も best-effort で埋める。
|
|
308
|
+
* coding-agent の `DataContextIndex` がデータ地図を構築する際に使う。
|
|
309
|
+
*/
|
|
310
|
+
introspect;
|
|
297
311
|
/**
|
|
298
312
|
* Opt-out of the default "verify before save" behavior on connection
|
|
299
313
|
* creation. The backend invokes `checkConnection` synchronously while
|
|
@@ -308,6 +322,14 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
308
322
|
* the default verify-on-create behavior without opt-in.
|
|
309
323
|
*/
|
|
310
324
|
skipConnectionCheckOnCreate;
|
|
325
|
+
/**
|
|
326
|
+
* 決定論的な「立ち上げ survey」レシピ(ルールベース prewarm 基盤)。実装した connector は、LLM を使わずに
|
|
327
|
+
* read-only で自分を survey する probe 列(テーブル/列メタデータ → 小サンプル)を宣言する。coding-agent の
|
|
328
|
+
* recon driver がこれを読み、connector ツールの `execute` を直接呼んで結果を seed にする。未実装の connector は
|
|
329
|
+
* driver 側で safely skip される(その connection は listConnections のみ seed)。標準 `information_schema` を
|
|
330
|
+
* 持つ SQL connector は `makeStandardSqlSurveyProbes` を使える。**probe は必ず read-only**。
|
|
331
|
+
*/
|
|
332
|
+
surveyProbes;
|
|
311
333
|
constructor(config) {
|
|
312
334
|
this.slug = config.slug;
|
|
313
335
|
this.authType = config.authType;
|
|
@@ -325,7 +347,9 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
325
347
|
this.query = config.query;
|
|
326
348
|
this.checkConnection = config.checkConnection;
|
|
327
349
|
this.setup = config.setup;
|
|
350
|
+
this.introspect = config.introspect;
|
|
328
351
|
this.skipConnectionCheckOnCreate = config.skipConnectionCheckOnCreate;
|
|
352
|
+
this.surveyProbes = config.surveyProbes;
|
|
329
353
|
}
|
|
330
354
|
get connectorKey() {
|
|
331
355
|
return _ConnectorPlugin.deriveKey(this.slug, this.authType);
|
|
@@ -363,25 +387,25 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
363
387
|
if (authType) return `${slug}-${authType}`;
|
|
364
388
|
const LEGACY_NULL_AUTH_TYPE_MAP = {
|
|
365
389
|
// user-password
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
390
|
+
postgresql: "user-password",
|
|
391
|
+
mysql: "user-password",
|
|
392
|
+
clickhouse: "user-password",
|
|
393
|
+
kintone: "user-password",
|
|
370
394
|
"squadbase-db": "user-password",
|
|
371
395
|
// service-account
|
|
372
|
-
|
|
373
|
-
|
|
396
|
+
snowflake: "service-account",
|
|
397
|
+
bigquery: "service-account",
|
|
374
398
|
"google-analytics": "service-account",
|
|
375
399
|
"google-calendar": "service-account",
|
|
376
400
|
"aws-athena": "service-account",
|
|
377
|
-
|
|
401
|
+
redshift: "service-account",
|
|
378
402
|
// api-key
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
403
|
+
databricks: "api-key",
|
|
404
|
+
dbt: "api-key",
|
|
405
|
+
airtable: "api-key",
|
|
406
|
+
openai: "api-key",
|
|
407
|
+
gemini: "api-key",
|
|
408
|
+
anthropic: "api-key",
|
|
385
409
|
"wix-store": "api-key"
|
|
386
410
|
};
|
|
387
411
|
const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];
|
|
@@ -460,6 +484,24 @@ async function resolveSetupSelection(params) {
|
|
|
460
484
|
return resolved.slice(0, limit);
|
|
461
485
|
}
|
|
462
486
|
|
|
487
|
+
// ../connectors/src/introspect-concurrency.ts
|
|
488
|
+
async function mapWithConcurrency(items, limit, fn) {
|
|
489
|
+
const results = new Array(items.length);
|
|
490
|
+
let next = 0;
|
|
491
|
+
const workers = Array.from(
|
|
492
|
+
{ length: Math.min(Math.max(limit, 1), items.length) },
|
|
493
|
+
async () => {
|
|
494
|
+
for (; ; ) {
|
|
495
|
+
const i = next++;
|
|
496
|
+
if (i >= items.length) return;
|
|
497
|
+
results[i] = await fn(items[i]);
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
);
|
|
501
|
+
await Promise.all(workers);
|
|
502
|
+
return results;
|
|
503
|
+
}
|
|
504
|
+
|
|
463
505
|
// ../connectors/src/auth-types.ts
|
|
464
506
|
var AUTH_TYPES = {
|
|
465
507
|
OAUTH: "oauth",
|
|
@@ -660,6 +702,56 @@ var salesforceSetupFlow = {
|
|
|
660
702
|
}
|
|
661
703
|
};
|
|
662
704
|
|
|
705
|
+
// ../connectors/src/connectors/salesforce/introspect.ts
|
|
706
|
+
var MAX_SOBJECTS = 100;
|
|
707
|
+
var CONCURRENCY = 5;
|
|
708
|
+
async function introspectSalesforce(ctx) {
|
|
709
|
+
const { accessToken, instanceUrl } = await getAccessToken(ctx.params);
|
|
710
|
+
const base = `${instanceUrl}/services/data/${SALESFORCE_API_VERSION}`;
|
|
711
|
+
const headers = {
|
|
712
|
+
Authorization: `Bearer ${accessToken}`,
|
|
713
|
+
Accept: "application/json"
|
|
714
|
+
};
|
|
715
|
+
const listRes = await fetch(`${base}/sobjects`, { headers });
|
|
716
|
+
if (!listRes.ok) {
|
|
717
|
+
throw new Error(`salesforce: sobjects failed (${listRes.status})`);
|
|
718
|
+
}
|
|
719
|
+
const listData = await listRes.json();
|
|
720
|
+
const sobjects = (listData.sobjects ?? []).filter((s) => s.queryable && !s.deprecatedAndHidden).slice(0, MAX_SOBJECTS);
|
|
721
|
+
const tables = (await mapWithConcurrency(sobjects, CONCURRENCY, async (so) => {
|
|
722
|
+
try {
|
|
723
|
+
const res = await fetch(
|
|
724
|
+
`${base}/sobjects/${encodeURIComponent(so.name)}/describe`,
|
|
725
|
+
{ headers }
|
|
726
|
+
);
|
|
727
|
+
if (!res.ok) return [];
|
|
728
|
+
const data = await res.json();
|
|
729
|
+
const columns = (data.fields ?? []).map((f) => {
|
|
730
|
+
const column = {
|
|
731
|
+
name: f.name,
|
|
732
|
+
dataType: f.type ?? "unknown",
|
|
733
|
+
nullable: f.nillable !== false
|
|
734
|
+
};
|
|
735
|
+
if (f.type === "id") column.isPrimaryKey = true;
|
|
736
|
+
if (f.type === "reference" && f.referenceTo?.length) {
|
|
737
|
+
column.foreignKey = { table: f.referenceTo[0], column: "Id" };
|
|
738
|
+
}
|
|
739
|
+
return column;
|
|
740
|
+
});
|
|
741
|
+
const table = {
|
|
742
|
+
schema: "",
|
|
743
|
+
name: so.name,
|
|
744
|
+
type: "table",
|
|
745
|
+
columns
|
|
746
|
+
};
|
|
747
|
+
return [table];
|
|
748
|
+
} catch {
|
|
749
|
+
return [];
|
|
750
|
+
}
|
|
751
|
+
})).flat();
|
|
752
|
+
return { tables };
|
|
753
|
+
}
|
|
754
|
+
|
|
663
755
|
// ../connectors/src/connectors/salesforce/tools/request.ts
|
|
664
756
|
import { z } from "zod";
|
|
665
757
|
var REQUEST_TIMEOUT_MS = 6e4;
|
|
@@ -947,6 +1039,7 @@ export default async function handler(c: Context) {
|
|
|
947
1039
|
- \u89AA\u2192\u5B50\u30B5\u30D6\u30AF\u30A8\u30EA: \`SELECT Id, Name, (SELECT Id, Email FROM Contacts) FROM Account\``
|
|
948
1040
|
},
|
|
949
1041
|
tools,
|
|
1042
|
+
introspect: (ctx) => introspectSalesforce(ctx),
|
|
950
1043
|
setup: (params, ctx, config) => runSetupFlow(salesforceSetupFlow, params, ctx, config),
|
|
951
1044
|
async checkConnection(params, _config) {
|
|
952
1045
|
const instanceUrlParam = params[parameters.instanceUrl.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
|
|
@@ -258,6 +263,15 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
258
263
|
* `runSetupFlow` from `setup-flow.ts`.
|
|
259
264
|
*/
|
|
260
265
|
setup;
|
|
266
|
+
/**
|
|
267
|
+
* 統一 introspection。SQL DB の `information_schema` / `SHOW` / `DESCRIBE` や SaaS の
|
|
268
|
+
* メタデータ API といった取得経路の差を吸収し、tables / columns / PK / FK を共通型
|
|
269
|
+
* {@link IntrospectedSchema} へ正規化して返す。取得経路は {@link IntrospectContext} で
|
|
270
|
+
* 抽象化され、SQL DB は `ctx.query`、SaaS は `ctx.proxyFetch` + `ctx.params` を使う。
|
|
271
|
+
* `ctx.profile === true` のときは L2 プロファイル(行数・NULL 率等)も best-effort で埋める。
|
|
272
|
+
* coding-agent の `DataContextIndex` がデータ地図を構築する際に使う。
|
|
273
|
+
*/
|
|
274
|
+
introspect;
|
|
261
275
|
/**
|
|
262
276
|
* Opt-out of the default "verify before save" behavior on connection
|
|
263
277
|
* creation. The backend invokes `checkConnection` synchronously while
|
|
@@ -272,6 +286,14 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
272
286
|
* the default verify-on-create behavior without opt-in.
|
|
273
287
|
*/
|
|
274
288
|
skipConnectionCheckOnCreate;
|
|
289
|
+
/**
|
|
290
|
+
* 決定論的な「立ち上げ survey」レシピ(ルールベース prewarm 基盤)。実装した connector は、LLM を使わずに
|
|
291
|
+
* read-only で自分を survey する probe 列(テーブル/列メタデータ → 小サンプル)を宣言する。coding-agent の
|
|
292
|
+
* recon driver がこれを読み、connector ツールの `execute` を直接呼んで結果を seed にする。未実装の connector は
|
|
293
|
+
* driver 側で safely skip される(その connection は listConnections のみ seed)。標準 `information_schema` を
|
|
294
|
+
* 持つ SQL connector は `makeStandardSqlSurveyProbes` を使える。**probe は必ず read-only**。
|
|
295
|
+
*/
|
|
296
|
+
surveyProbes;
|
|
275
297
|
constructor(config) {
|
|
276
298
|
this.slug = config.slug;
|
|
277
299
|
this.authType = config.authType;
|
|
@@ -289,7 +311,9 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
289
311
|
this.query = config.query;
|
|
290
312
|
this.checkConnection = config.checkConnection;
|
|
291
313
|
this.setup = config.setup;
|
|
314
|
+
this.introspect = config.introspect;
|
|
292
315
|
this.skipConnectionCheckOnCreate = config.skipConnectionCheckOnCreate;
|
|
316
|
+
this.surveyProbes = config.surveyProbes;
|
|
293
317
|
}
|
|
294
318
|
get connectorKey() {
|
|
295
319
|
return _ConnectorPlugin.deriveKey(this.slug, this.authType);
|
|
@@ -327,25 +351,25 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
327
351
|
if (authType) return `${slug}-${authType}`;
|
|
328
352
|
const LEGACY_NULL_AUTH_TYPE_MAP = {
|
|
329
353
|
// user-password
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
354
|
+
postgresql: "user-password",
|
|
355
|
+
mysql: "user-password",
|
|
356
|
+
clickhouse: "user-password",
|
|
357
|
+
kintone: "user-password",
|
|
334
358
|
"squadbase-db": "user-password",
|
|
335
359
|
// service-account
|
|
336
|
-
|
|
337
|
-
|
|
360
|
+
snowflake: "service-account",
|
|
361
|
+
bigquery: "service-account",
|
|
338
362
|
"google-analytics": "service-account",
|
|
339
363
|
"google-calendar": "service-account",
|
|
340
364
|
"aws-athena": "service-account",
|
|
341
|
-
|
|
365
|
+
redshift: "service-account",
|
|
342
366
|
// api-key
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
367
|
+
databricks: "api-key",
|
|
368
|
+
dbt: "api-key",
|
|
369
|
+
airtable: "api-key",
|
|
370
|
+
openai: "api-key",
|
|
371
|
+
gemini: "api-key",
|
|
372
|
+
anthropic: "api-key",
|
|
349
373
|
"wix-store": "api-key"
|
|
350
374
|
};
|
|
351
375
|
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
|
|
@@ -249,6 +254,15 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
249
254
|
* `runSetupFlow` from `setup-flow.ts`.
|
|
250
255
|
*/
|
|
251
256
|
setup;
|
|
257
|
+
/**
|
|
258
|
+
* 統一 introspection。SQL DB の `information_schema` / `SHOW` / `DESCRIBE` や SaaS の
|
|
259
|
+
* メタデータ API といった取得経路の差を吸収し、tables / columns / PK / FK を共通型
|
|
260
|
+
* {@link IntrospectedSchema} へ正規化して返す。取得経路は {@link IntrospectContext} で
|
|
261
|
+
* 抽象化され、SQL DB は `ctx.query`、SaaS は `ctx.proxyFetch` + `ctx.params` を使う。
|
|
262
|
+
* `ctx.profile === true` のときは L2 プロファイル(行数・NULL 率等)も best-effort で埋める。
|
|
263
|
+
* coding-agent の `DataContextIndex` がデータ地図を構築する際に使う。
|
|
264
|
+
*/
|
|
265
|
+
introspect;
|
|
252
266
|
/**
|
|
253
267
|
* Opt-out of the default "verify before save" behavior on connection
|
|
254
268
|
* creation. The backend invokes `checkConnection` synchronously while
|
|
@@ -263,6 +277,14 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
263
277
|
* the default verify-on-create behavior without opt-in.
|
|
264
278
|
*/
|
|
265
279
|
skipConnectionCheckOnCreate;
|
|
280
|
+
/**
|
|
281
|
+
* 決定論的な「立ち上げ survey」レシピ(ルールベース prewarm 基盤)。実装した connector は、LLM を使わずに
|
|
282
|
+
* read-only で自分を survey する probe 列(テーブル/列メタデータ → 小サンプル)を宣言する。coding-agent の
|
|
283
|
+
* recon driver がこれを読み、connector ツールの `execute` を直接呼んで結果を seed にする。未実装の connector は
|
|
284
|
+
* driver 側で safely skip される(その connection は listConnections のみ seed)。標準 `information_schema` を
|
|
285
|
+
* 持つ SQL connector は `makeStandardSqlSurveyProbes` を使える。**probe は必ず read-only**。
|
|
286
|
+
*/
|
|
287
|
+
surveyProbes;
|
|
266
288
|
constructor(config) {
|
|
267
289
|
this.slug = config.slug;
|
|
268
290
|
this.authType = config.authType;
|
|
@@ -280,7 +302,9 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
280
302
|
this.query = config.query;
|
|
281
303
|
this.checkConnection = config.checkConnection;
|
|
282
304
|
this.setup = config.setup;
|
|
305
|
+
this.introspect = config.introspect;
|
|
283
306
|
this.skipConnectionCheckOnCreate = config.skipConnectionCheckOnCreate;
|
|
307
|
+
this.surveyProbes = config.surveyProbes;
|
|
284
308
|
}
|
|
285
309
|
get connectorKey() {
|
|
286
310
|
return _ConnectorPlugin.deriveKey(this.slug, this.authType);
|
|
@@ -318,25 +342,25 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
318
342
|
if (authType) return `${slug}-${authType}`;
|
|
319
343
|
const LEGACY_NULL_AUTH_TYPE_MAP = {
|
|
320
344
|
// user-password
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
345
|
+
postgresql: "user-password",
|
|
346
|
+
mysql: "user-password",
|
|
347
|
+
clickhouse: "user-password",
|
|
348
|
+
kintone: "user-password",
|
|
325
349
|
"squadbase-db": "user-password",
|
|
326
350
|
// service-account
|
|
327
|
-
|
|
328
|
-
|
|
351
|
+
snowflake: "service-account",
|
|
352
|
+
bigquery: "service-account",
|
|
329
353
|
"google-analytics": "service-account",
|
|
330
354
|
"google-calendar": "service-account",
|
|
331
355
|
"aws-athena": "service-account",
|
|
332
|
-
|
|
356
|
+
redshift: "service-account",
|
|
333
357
|
// api-key
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
358
|
+
databricks: "api-key",
|
|
359
|
+
dbt: "api-key",
|
|
360
|
+
airtable: "api-key",
|
|
361
|
+
openai: "api-key",
|
|
362
|
+
gemini: "api-key",
|
|
363
|
+
anthropic: "api-key",
|
|
340
364
|
"wix-store": "api-key"
|
|
341
365
|
};
|
|
342
366
|
const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];
|
|
@@ -73,6 +73,15 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
73
73
|
* `runSetupFlow` from `setup-flow.ts`.
|
|
74
74
|
*/
|
|
75
75
|
setup;
|
|
76
|
+
/**
|
|
77
|
+
* 統一 introspection。SQL DB の `information_schema` / `SHOW` / `DESCRIBE` や SaaS の
|
|
78
|
+
* メタデータ API といった取得経路の差を吸収し、tables / columns / PK / FK を共通型
|
|
79
|
+
* {@link IntrospectedSchema} へ正規化して返す。取得経路は {@link IntrospectContext} で
|
|
80
|
+
* 抽象化され、SQL DB は `ctx.query`、SaaS は `ctx.proxyFetch` + `ctx.params` を使う。
|
|
81
|
+
* `ctx.profile === true` のときは L2 プロファイル(行数・NULL 率等)も best-effort で埋める。
|
|
82
|
+
* coding-agent の `DataContextIndex` がデータ地図を構築する際に使う。
|
|
83
|
+
*/
|
|
84
|
+
introspect;
|
|
76
85
|
/**
|
|
77
86
|
* Opt-out of the default "verify before save" behavior on connection
|
|
78
87
|
* creation. The backend invokes `checkConnection` synchronously while
|
|
@@ -87,6 +96,14 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
87
96
|
* the default verify-on-create behavior without opt-in.
|
|
88
97
|
*/
|
|
89
98
|
skipConnectionCheckOnCreate;
|
|
99
|
+
/**
|
|
100
|
+
* 決定論的な「立ち上げ survey」レシピ(ルールベース prewarm 基盤)。実装した connector は、LLM を使わずに
|
|
101
|
+
* read-only で自分を survey する probe 列(テーブル/列メタデータ → 小サンプル)を宣言する。coding-agent の
|
|
102
|
+
* recon driver がこれを読み、connector ツールの `execute` を直接呼んで結果を seed にする。未実装の connector は
|
|
103
|
+
* driver 側で safely skip される(その connection は listConnections のみ seed)。標準 `information_schema` を
|
|
104
|
+
* 持つ SQL connector は `makeStandardSqlSurveyProbes` を使える。**probe は必ず read-only**。
|
|
105
|
+
*/
|
|
106
|
+
surveyProbes;
|
|
90
107
|
constructor(config) {
|
|
91
108
|
this.slug = config.slug;
|
|
92
109
|
this.authType = config.authType;
|
|
@@ -104,7 +121,9 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
104
121
|
this.query = config.query;
|
|
105
122
|
this.checkConnection = config.checkConnection;
|
|
106
123
|
this.setup = config.setup;
|
|
124
|
+
this.introspect = config.introspect;
|
|
107
125
|
this.skipConnectionCheckOnCreate = config.skipConnectionCheckOnCreate;
|
|
126
|
+
this.surveyProbes = config.surveyProbes;
|
|
108
127
|
}
|
|
109
128
|
get connectorKey() {
|
|
110
129
|
return _ConnectorPlugin.deriveKey(this.slug, this.authType);
|
|
@@ -142,25 +161,25 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
142
161
|
if (authType) return `${slug}-${authType}`;
|
|
143
162
|
const LEGACY_NULL_AUTH_TYPE_MAP = {
|
|
144
163
|
// user-password
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
164
|
+
postgresql: "user-password",
|
|
165
|
+
mysql: "user-password",
|
|
166
|
+
clickhouse: "user-password",
|
|
167
|
+
kintone: "user-password",
|
|
149
168
|
"squadbase-db": "user-password",
|
|
150
169
|
// service-account
|
|
151
|
-
|
|
152
|
-
|
|
170
|
+
snowflake: "service-account",
|
|
171
|
+
bigquery: "service-account",
|
|
153
172
|
"google-analytics": "service-account",
|
|
154
173
|
"google-calendar": "service-account",
|
|
155
174
|
"aws-athena": "service-account",
|
|
156
|
-
|
|
175
|
+
redshift: "service-account",
|
|
157
176
|
// api-key
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
177
|
+
databricks: "api-key",
|
|
178
|
+
dbt: "api-key",
|
|
179
|
+
airtable: "api-key",
|
|
180
|
+
openai: "api-key",
|
|
181
|
+
gemini: "api-key",
|
|
182
|
+
anthropic: "api-key",
|
|
164
183
|
"wix-store": "api-key"
|
|
165
184
|
};
|
|
166
185
|
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
|
|
@@ -362,6 +367,15 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
362
367
|
* `runSetupFlow` from `setup-flow.ts`.
|
|
363
368
|
*/
|
|
364
369
|
setup;
|
|
370
|
+
/**
|
|
371
|
+
* 統一 introspection。SQL DB の `information_schema` / `SHOW` / `DESCRIBE` や SaaS の
|
|
372
|
+
* メタデータ API といった取得経路の差を吸収し、tables / columns / PK / FK を共通型
|
|
373
|
+
* {@link IntrospectedSchema} へ正規化して返す。取得経路は {@link IntrospectContext} で
|
|
374
|
+
* 抽象化され、SQL DB は `ctx.query`、SaaS は `ctx.proxyFetch` + `ctx.params` を使う。
|
|
375
|
+
* `ctx.profile === true` のときは L2 プロファイル(行数・NULL 率等)も best-effort で埋める。
|
|
376
|
+
* coding-agent の `DataContextIndex` がデータ地図を構築する際に使う。
|
|
377
|
+
*/
|
|
378
|
+
introspect;
|
|
365
379
|
/**
|
|
366
380
|
* Opt-out of the default "verify before save" behavior on connection
|
|
367
381
|
* creation. The backend invokes `checkConnection` synchronously while
|
|
@@ -376,6 +390,14 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
376
390
|
* the default verify-on-create behavior without opt-in.
|
|
377
391
|
*/
|
|
378
392
|
skipConnectionCheckOnCreate;
|
|
393
|
+
/**
|
|
394
|
+
* 決定論的な「立ち上げ survey」レシピ(ルールベース prewarm 基盤)。実装した connector は、LLM を使わずに
|
|
395
|
+
* read-only で自分を survey する probe 列(テーブル/列メタデータ → 小サンプル)を宣言する。coding-agent の
|
|
396
|
+
* recon driver がこれを読み、connector ツールの `execute` を直接呼んで結果を seed にする。未実装の connector は
|
|
397
|
+
* driver 側で safely skip される(その connection は listConnections のみ seed)。標準 `information_schema` を
|
|
398
|
+
* 持つ SQL connector は `makeStandardSqlSurveyProbes` を使える。**probe は必ず read-only**。
|
|
399
|
+
*/
|
|
400
|
+
surveyProbes;
|
|
379
401
|
constructor(config) {
|
|
380
402
|
this.slug = config.slug;
|
|
381
403
|
this.authType = config.authType;
|
|
@@ -393,7 +415,9 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
393
415
|
this.query = config.query;
|
|
394
416
|
this.checkConnection = config.checkConnection;
|
|
395
417
|
this.setup = config.setup;
|
|
418
|
+
this.introspect = config.introspect;
|
|
396
419
|
this.skipConnectionCheckOnCreate = config.skipConnectionCheckOnCreate;
|
|
420
|
+
this.surveyProbes = config.surveyProbes;
|
|
397
421
|
}
|
|
398
422
|
get connectorKey() {
|
|
399
423
|
return _ConnectorPlugin.deriveKey(this.slug, this.authType);
|
|
@@ -431,25 +455,25 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
431
455
|
if (authType) return `${slug}-${authType}`;
|
|
432
456
|
const LEGACY_NULL_AUTH_TYPE_MAP = {
|
|
433
457
|
// user-password
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
458
|
+
postgresql: "user-password",
|
|
459
|
+
mysql: "user-password",
|
|
460
|
+
clickhouse: "user-password",
|
|
461
|
+
kintone: "user-password",
|
|
438
462
|
"squadbase-db": "user-password",
|
|
439
463
|
// service-account
|
|
440
|
-
|
|
441
|
-
|
|
464
|
+
snowflake: "service-account",
|
|
465
|
+
bigquery: "service-account",
|
|
442
466
|
"google-analytics": "service-account",
|
|
443
467
|
"google-calendar": "service-account",
|
|
444
468
|
"aws-athena": "service-account",
|
|
445
|
-
|
|
469
|
+
redshift: "service-account",
|
|
446
470
|
// api-key
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
471
|
+
databricks: "api-key",
|
|
472
|
+
dbt: "api-key",
|
|
473
|
+
airtable: "api-key",
|
|
474
|
+
openai: "api-key",
|
|
475
|
+
gemini: "api-key",
|
|
476
|
+
anthropic: "api-key",
|
|
453
477
|
"wix-store": "api-key"
|
|
454
478
|
};
|
|
455
479
|
const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];
|