@squadbase/vite-server 0.1.3-dev.8 → 0.1.3
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 +14229 -29321
- package/dist/connectors/airtable-oauth.js +43 -6
- package/dist/connectors/airtable.js +43 -6
- package/dist/connectors/amplitude.js +43 -6
- package/dist/connectors/anthropic.js +43 -6
- package/dist/connectors/asana.js +43 -6
- package/dist/connectors/attio.js +43 -6
- package/dist/connectors/{google-ads-oauth.d.ts → backlog-api-key.d.ts} +1 -1
- package/dist/connectors/backlog-api-key.js +629 -0
- package/dist/connectors/customerio.js +43 -6
- package/dist/connectors/dbt.js +43 -6
- package/dist/connectors/{google-sheets-oauth.d.ts → gamma.d.ts} +1 -1
- package/dist/connectors/gamma.js +866 -0
- package/dist/connectors/gemini.js +43 -6
- package/dist/connectors/gmail-oauth.js +65 -8
- package/dist/connectors/gmail.js +104 -44
- package/dist/connectors/google-ads.d.ts +1 -1
- package/dist/connectors/google-ads.js +410 -332
- package/dist/connectors/google-analytics-oauth.js +61 -8
- package/dist/connectors/google-analytics.js +107 -292
- package/dist/connectors/google-calendar-oauth.js +61 -8
- package/dist/connectors/google-calendar.js +111 -58
- package/dist/connectors/{linkedin-ads-oauth.d.ts → google-docs.d.ts} +1 -1
- package/dist/connectors/google-docs.js +631 -0
- package/dist/connectors/google-drive.d.ts +5 -0
- package/dist/connectors/google-drive.js +875 -0
- package/dist/connectors/google-sheets.d.ts +1 -1
- package/dist/connectors/google-sheets.js +267 -285
- package/dist/connectors/google-slides.d.ts +5 -0
- package/dist/connectors/google-slides.js +663 -0
- package/dist/connectors/grafana.js +43 -6
- package/dist/connectors/hubspot-oauth.js +43 -6
- package/dist/connectors/hubspot.js +43 -6
- package/dist/connectors/intercom-oauth.js +43 -6
- package/dist/connectors/intercom.js +43 -6
- package/dist/connectors/jira-api-key.js +43 -6
- package/dist/connectors/kintone-api-token.js +256 -82
- package/dist/connectors/kintone.js +43 -6
- package/dist/connectors/linkedin-ads.js +188 -168
- package/dist/connectors/mailchimp-oauth.js +43 -6
- package/dist/connectors/mailchimp.js +43 -6
- package/dist/connectors/mixpanel.d.ts +5 -0
- package/dist/connectors/mixpanel.js +779 -0
- package/dist/connectors/notion-oauth.js +43 -6
- package/dist/connectors/notion.js +43 -6
- package/dist/connectors/openai.js +43 -6
- package/dist/connectors/sentry.d.ts +5 -0
- package/dist/connectors/sentry.js +761 -0
- package/dist/connectors/shopify-oauth.js +43 -6
- package/dist/connectors/shopify.js +43 -6
- package/dist/connectors/stripe-api-key.js +46 -7
- package/dist/connectors/stripe-oauth.js +43 -6
- package/dist/connectors/wix-store.js +43 -6
- package/dist/connectors/zendesk-oauth.js +43 -6
- package/dist/connectors/zendesk.js +43 -6
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4419 -3855
- package/dist/main.js +5481 -4918
- package/dist/vite-plugin.js +4474 -3948
- package/package.json +30 -12
- package/dist/connectors/google-ads-oauth.js +0 -890
- package/dist/connectors/google-sheets-oauth.js +0 -718
- package/dist/connectors/linkedin-ads-oauth.js +0 -848
package/dist/connectors/dbt.js
CHANGED
|
@@ -399,21 +399,58 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
399
399
|
* Filters connections by connectorKey internally.
|
|
400
400
|
* Returns tools keyed as `${connectorKey}_${toolName}`.
|
|
401
401
|
*/
|
|
402
|
-
createTools(connections, config) {
|
|
402
|
+
createTools(connections, config, opts) {
|
|
403
403
|
const myConnections = connections.filter(
|
|
404
404
|
(c) => _ConnectorPlugin.deriveKey(c.connector.slug, c.connector.authType) === this.connectorKey
|
|
405
405
|
);
|
|
406
406
|
const result = {};
|
|
407
407
|
for (const t of Object.values(this.tools)) {
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
408
|
+
const tool = t.createTool(myConnections, config);
|
|
409
|
+
const originalToModelOutput = tool.toModelOutput;
|
|
410
|
+
result[`${this.connectorKey}_${t.name}`] = {
|
|
411
|
+
...tool,
|
|
412
|
+
toModelOutput: async (options) => {
|
|
413
|
+
if (!originalToModelOutput) {
|
|
414
|
+
return opts.truncateOutput(options.output);
|
|
415
|
+
}
|
|
416
|
+
const modelOutput = await originalToModelOutput(options);
|
|
417
|
+
if (modelOutput.type === "text" || modelOutput.type === "json") {
|
|
418
|
+
return opts.truncateOutput(modelOutput.value);
|
|
419
|
+
}
|
|
420
|
+
return modelOutput;
|
|
421
|
+
}
|
|
422
|
+
};
|
|
412
423
|
}
|
|
413
424
|
return result;
|
|
414
425
|
}
|
|
415
426
|
static deriveKey(slug, authType) {
|
|
416
|
-
|
|
427
|
+
if (authType) return `${slug}-${authType}`;
|
|
428
|
+
const LEGACY_NULL_AUTH_TYPE_MAP = {
|
|
429
|
+
// user-password
|
|
430
|
+
"postgresql": "user-password",
|
|
431
|
+
"mysql": "user-password",
|
|
432
|
+
"clickhouse": "user-password",
|
|
433
|
+
"kintone": "user-password",
|
|
434
|
+
"squadbase-db": "user-password",
|
|
435
|
+
// service-account
|
|
436
|
+
"snowflake": "service-account",
|
|
437
|
+
"bigquery": "service-account",
|
|
438
|
+
"google-analytics": "service-account",
|
|
439
|
+
"google-calendar": "service-account",
|
|
440
|
+
"aws-athena": "service-account",
|
|
441
|
+
"redshift": "service-account",
|
|
442
|
+
// api-key
|
|
443
|
+
"databricks": "api-key",
|
|
444
|
+
"dbt": "api-key",
|
|
445
|
+
"airtable": "api-key",
|
|
446
|
+
"openai": "api-key",
|
|
447
|
+
"gemini": "api-key",
|
|
448
|
+
"anthropic": "api-key",
|
|
449
|
+
"wix-store": "api-key"
|
|
450
|
+
};
|
|
451
|
+
const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];
|
|
452
|
+
if (fallbackAuthType) return `${slug}-${fallbackAuthType}`;
|
|
453
|
+
return slug;
|
|
417
454
|
}
|
|
418
455
|
};
|
|
419
456
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _squadbase_connectors_sdk from '@squadbase/connectors/sdk';
|
|
2
2
|
|
|
3
|
-
declare const connection: (connectionId: string) => _squadbase_connectors_sdk.
|
|
3
|
+
declare const connection: (connectionId: string) => _squadbase_connectors_sdk.GammaConnectorSdk;
|
|
4
4
|
|
|
5
5
|
export { connection };
|