@squadbase/vite-server 0.1.17 → 0.1.19-dev.a00d9c3
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 +5961 -2986
- 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 +291 -18
- 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 +40 -16
- package/dist/connectors/google-analytics.js +39 -15
- package/dist/connectors/google-audit-log.js +39 -15
- package/dist/connectors/google-calendar-oauth.js +40 -16
- 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.d.ts +5 -0
- package/dist/connectors/hackernews.js +909 -0
- 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 +70 -19
- 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 +293 -19
- package/dist/connectors/outlook-oauth.js +33 -14
- package/dist/connectors/powerbi-oauth.js +33 -14
- 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/slack.d.ts +5 -0
- package/dist/connectors/slack.js +656 -0
- package/dist/connectors/sqlserver.js +291 -18
- package/dist/connectors/stripe-api-key.js +39 -15
- package/dist/connectors/stripe-oauth.js +32 -13
- package/dist/connectors/supabase.js +293 -16
- package/dist/connectors/tableau.js +40 -16
- package/dist/connectors/tiktok-ads.js +39 -15
- package/dist/connectors/wix-store.js +39 -15
- package/dist/connectors/x.d.ts +5 -0
- package/dist/connectors/x.js +951 -0
- package/dist/connectors/zendesk-oauth.js +32 -13
- package/dist/connectors/zendesk.js +39 -15
- package/dist/index.js +6425 -3397
- package/dist/main.js +6425 -3397
- package/dist/vite-plugin.js +5965 -2987
- package/package.json +13 -4
|
@@ -193,6 +193,15 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
193
193
|
* `runSetupFlow` from `setup-flow.ts`.
|
|
194
194
|
*/
|
|
195
195
|
setup;
|
|
196
|
+
/**
|
|
197
|
+
* 統一 introspection。SQL DB の `information_schema` / `SHOW` / `DESCRIBE` や SaaS の
|
|
198
|
+
* メタデータ API といった取得経路の差を吸収し、tables / columns / PK / FK を共通型
|
|
199
|
+
* {@link IntrospectedSchema} へ正規化して返す。取得経路は {@link IntrospectContext} で
|
|
200
|
+
* 抽象化され、SQL DB は `ctx.query`、SaaS は `ctx.proxyFetch` + `ctx.params` を使う。
|
|
201
|
+
* `ctx.profile === true` のときは L2 プロファイル(行数・NULL 率等)も best-effort で埋める。
|
|
202
|
+
* coding-agent の `DataContextIndex` がデータ地図を構築する際に使う。
|
|
203
|
+
*/
|
|
204
|
+
introspect;
|
|
196
205
|
/**
|
|
197
206
|
* Opt-out of the default "verify before save" behavior on connection
|
|
198
207
|
* creation. The backend invokes `checkConnection` synchronously while
|
|
@@ -207,6 +216,14 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
207
216
|
* the default verify-on-create behavior without opt-in.
|
|
208
217
|
*/
|
|
209
218
|
skipConnectionCheckOnCreate;
|
|
219
|
+
/**
|
|
220
|
+
* 決定論的な「立ち上げ survey」レシピ(ルールベース prewarm 基盤)。実装した connector は、LLM を使わずに
|
|
221
|
+
* read-only で自分を survey する probe 列(テーブル/列メタデータ → 小サンプル)を宣言する。coding-agent の
|
|
222
|
+
* recon driver がこれを読み、connector ツールの `execute` を直接呼んで結果を seed にする。未実装の connector は
|
|
223
|
+
* driver 側で safely skip される(その connection は listConnections のみ seed)。標準 `information_schema` を
|
|
224
|
+
* 持つ SQL connector は `makeStandardSqlSurveyProbes` を使える。**probe は必ず read-only**。
|
|
225
|
+
*/
|
|
226
|
+
surveyProbes;
|
|
210
227
|
constructor(config) {
|
|
211
228
|
this.slug = config.slug;
|
|
212
229
|
this.authType = config.authType;
|
|
@@ -224,7 +241,9 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
224
241
|
this.query = config.query;
|
|
225
242
|
this.checkConnection = config.checkConnection;
|
|
226
243
|
this.setup = config.setup;
|
|
244
|
+
this.introspect = config.introspect;
|
|
227
245
|
this.skipConnectionCheckOnCreate = config.skipConnectionCheckOnCreate;
|
|
246
|
+
this.surveyProbes = config.surveyProbes;
|
|
228
247
|
}
|
|
229
248
|
get connectorKey() {
|
|
230
249
|
return _ConnectorPlugin.deriveKey(this.slug, this.authType);
|
|
@@ -262,25 +281,25 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
262
281
|
if (authType) return `${slug}-${authType}`;
|
|
263
282
|
const LEGACY_NULL_AUTH_TYPE_MAP = {
|
|
264
283
|
// user-password
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
284
|
+
postgresql: "user-password",
|
|
285
|
+
mysql: "user-password",
|
|
286
|
+
clickhouse: "user-password",
|
|
287
|
+
kintone: "user-password",
|
|
269
288
|
"squadbase-db": "user-password",
|
|
270
289
|
// service-account
|
|
271
|
-
|
|
272
|
-
|
|
290
|
+
snowflake: "service-account",
|
|
291
|
+
bigquery: "service-account",
|
|
273
292
|
"google-analytics": "service-account",
|
|
274
293
|
"google-calendar": "service-account",
|
|
275
294
|
"aws-athena": "service-account",
|
|
276
|
-
|
|
295
|
+
redshift: "service-account",
|
|
277
296
|
// api-key
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
297
|
+
databricks: "api-key",
|
|
298
|
+
dbt: "api-key",
|
|
299
|
+
airtable: "api-key",
|
|
300
|
+
openai: "api-key",
|
|
301
|
+
gemini: "api-key",
|
|
302
|
+
anthropic: "api-key",
|
|
284
303
|
"wix-store": "api-key"
|
|
285
304
|
};
|
|
286
305
|
const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];
|
|
@@ -653,7 +672,7 @@ var outlookOauthConnector = new ConnectorPlugin({
|
|
|
653
672
|
description: "Connect to Microsoft Outlook (Mail + Calendar) via Microsoft Graph using OAuth. Read-only access to the user's mailbox, mail folders, messages, attachments, calendars, and events.",
|
|
654
673
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/1J1FrRTYJjOh3CcSIqsz3I/6a467b4d926075ff99dc60820e0ae4b1/Microsoft_Outlook_Icon__2025%C3%A2__present_.svg",
|
|
655
674
|
parameters,
|
|
656
|
-
releaseFlag: { dev1: true, dev2:
|
|
675
|
+
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
657
676
|
categories: ["productivity"],
|
|
658
677
|
onboarding: outlookOnboarding,
|
|
659
678
|
proxyPolicy: {
|
|
@@ -151,6 +151,15 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
151
151
|
* `runSetupFlow` from `setup-flow.ts`.
|
|
152
152
|
*/
|
|
153
153
|
setup;
|
|
154
|
+
/**
|
|
155
|
+
* 統一 introspection。SQL DB の `information_schema` / `SHOW` / `DESCRIBE` や SaaS の
|
|
156
|
+
* メタデータ API といった取得経路の差を吸収し、tables / columns / PK / FK を共通型
|
|
157
|
+
* {@link IntrospectedSchema} へ正規化して返す。取得経路は {@link IntrospectContext} で
|
|
158
|
+
* 抽象化され、SQL DB は `ctx.query`、SaaS は `ctx.proxyFetch` + `ctx.params` を使う。
|
|
159
|
+
* `ctx.profile === true` のときは L2 プロファイル(行数・NULL 率等)も best-effort で埋める。
|
|
160
|
+
* coding-agent の `DataContextIndex` がデータ地図を構築する際に使う。
|
|
161
|
+
*/
|
|
162
|
+
introspect;
|
|
154
163
|
/**
|
|
155
164
|
* Opt-out of the default "verify before save" behavior on connection
|
|
156
165
|
* creation. The backend invokes `checkConnection` synchronously while
|
|
@@ -165,6 +174,14 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
165
174
|
* the default verify-on-create behavior without opt-in.
|
|
166
175
|
*/
|
|
167
176
|
skipConnectionCheckOnCreate;
|
|
177
|
+
/**
|
|
178
|
+
* 決定論的な「立ち上げ survey」レシピ(ルールベース prewarm 基盤)。実装した connector は、LLM を使わずに
|
|
179
|
+
* read-only で自分を survey する probe 列(テーブル/列メタデータ → 小サンプル)を宣言する。coding-agent の
|
|
180
|
+
* recon driver がこれを読み、connector ツールの `execute` を直接呼んで結果を seed にする。未実装の connector は
|
|
181
|
+
* driver 側で safely skip される(その connection は listConnections のみ seed)。標準 `information_schema` を
|
|
182
|
+
* 持つ SQL connector は `makeStandardSqlSurveyProbes` を使える。**probe は必ず read-only**。
|
|
183
|
+
*/
|
|
184
|
+
surveyProbes;
|
|
168
185
|
constructor(config) {
|
|
169
186
|
this.slug = config.slug;
|
|
170
187
|
this.authType = config.authType;
|
|
@@ -182,7 +199,9 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
182
199
|
this.query = config.query;
|
|
183
200
|
this.checkConnection = config.checkConnection;
|
|
184
201
|
this.setup = config.setup;
|
|
202
|
+
this.introspect = config.introspect;
|
|
185
203
|
this.skipConnectionCheckOnCreate = config.skipConnectionCheckOnCreate;
|
|
204
|
+
this.surveyProbes = config.surveyProbes;
|
|
186
205
|
}
|
|
187
206
|
get connectorKey() {
|
|
188
207
|
return _ConnectorPlugin.deriveKey(this.slug, this.authType);
|
|
@@ -220,25 +239,25 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
220
239
|
if (authType) return `${slug}-${authType}`;
|
|
221
240
|
const LEGACY_NULL_AUTH_TYPE_MAP = {
|
|
222
241
|
// user-password
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
242
|
+
postgresql: "user-password",
|
|
243
|
+
mysql: "user-password",
|
|
244
|
+
clickhouse: "user-password",
|
|
245
|
+
kintone: "user-password",
|
|
227
246
|
"squadbase-db": "user-password",
|
|
228
247
|
// service-account
|
|
229
|
-
|
|
230
|
-
|
|
248
|
+
snowflake: "service-account",
|
|
249
|
+
bigquery: "service-account",
|
|
231
250
|
"google-analytics": "service-account",
|
|
232
251
|
"google-calendar": "service-account",
|
|
233
252
|
"aws-athena": "service-account",
|
|
234
|
-
|
|
253
|
+
redshift: "service-account",
|
|
235
254
|
// api-key
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
255
|
+
databricks: "api-key",
|
|
256
|
+
dbt: "api-key",
|
|
257
|
+
airtable: "api-key",
|
|
258
|
+
openai: "api-key",
|
|
259
|
+
gemini: "api-key",
|
|
260
|
+
anthropic: "api-key",
|
|
242
261
|
"wix-store": "api-key"
|
|
243
262
|
};
|
|
244
263
|
const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];
|
|
@@ -892,7 +911,7 @@ var powerbiOauthConnector = new ConnectorPlugin({
|
|
|
892
911
|
description: "Connect to Microsoft Power BI using OAuth (Microsoft Entra ID). Use it to enumerate workspaces, datasets, and reports the signed-in user has access to, and to run DAX queries.",
|
|
893
912
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/2vXQCKGpMJ9kGSaqkZl9IS/cc5669c267fc5d11e7b1f8c01723e461/power-bi-icon.png",
|
|
894
913
|
parameters,
|
|
895
|
-
releaseFlag: { dev1: true, dev2:
|
|
914
|
+
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
896
915
|
categories: ["bi"],
|
|
897
916
|
onboarding: powerbiOauthOnboarding,
|
|
898
917
|
proxyPolicy: {
|
|
@@ -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];
|