@squadbase/vite-server 0.1.3-dev.0 → 0.1.3-dev.10
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 +82859 -9645
- package/dist/connectors/airtable-oauth.js +77 -3
- package/dist/connectors/airtable.js +85 -2
- package/dist/connectors/amplitude.js +85 -2
- package/dist/connectors/anthropic.js +85 -2
- package/dist/connectors/{slack.d.ts → asana.d.ts} +1 -1
- package/dist/connectors/asana.js +744 -0
- package/dist/connectors/attio.js +85 -2
- package/dist/connectors/{microsoft-teams-oauth.d.ts → customerio.d.ts} +1 -1
- package/dist/connectors/customerio.js +716 -0
- package/dist/connectors/dbt.js +85 -2
- package/dist/connectors/gemini.js +86 -3
- package/dist/connectors/{microsoft-teams.d.ts → gmail-oauth.d.ts} +1 -1
- package/dist/connectors/gmail-oauth.js +713 -0
- package/dist/connectors/gmail.d.ts +5 -0
- package/dist/connectors/gmail.js +875 -0
- package/dist/connectors/google-ads-oauth.js +78 -4
- package/dist/connectors/google-ads.d.ts +5 -0
- package/dist/connectors/google-ads.js +867 -0
- package/dist/connectors/google-analytics-oauth.js +90 -8
- package/dist/connectors/google-analytics.js +85 -2
- package/dist/connectors/google-calendar-oauth.d.ts +5 -0
- package/dist/connectors/google-calendar-oauth.js +817 -0
- package/dist/connectors/google-calendar.d.ts +5 -0
- package/dist/connectors/google-calendar.js +991 -0
- package/dist/connectors/google-sheets-oauth.js +144 -33
- package/dist/connectors/google-sheets.d.ts +5 -0
- package/dist/connectors/google-sheets.js +707 -0
- package/dist/connectors/grafana.d.ts +5 -0
- package/dist/connectors/grafana.js +638 -0
- package/dist/connectors/hubspot-oauth.js +77 -3
- package/dist/connectors/hubspot.js +89 -6
- package/dist/connectors/intercom-oauth.d.ts +5 -0
- package/dist/connectors/intercom-oauth.js +584 -0
- package/dist/connectors/intercom.d.ts +5 -0
- package/dist/connectors/intercom.js +710 -0
- package/dist/connectors/jira-api-key.d.ts +5 -0
- package/dist/connectors/jira-api-key.js +598 -0
- package/dist/connectors/kintone-api-token.js +77 -3
- package/dist/connectors/kintone.js +86 -3
- package/dist/connectors/linkedin-ads-oauth.d.ts +5 -0
- package/dist/connectors/linkedin-ads-oauth.js +848 -0
- package/dist/connectors/linkedin-ads.d.ts +5 -0
- package/dist/connectors/linkedin-ads.js +865 -0
- package/dist/connectors/mailchimp-oauth.d.ts +5 -0
- package/dist/connectors/mailchimp-oauth.js +613 -0
- package/dist/connectors/mailchimp.d.ts +5 -0
- package/dist/connectors/mailchimp.js +729 -0
- package/dist/connectors/notion-oauth.d.ts +5 -0
- package/dist/connectors/notion-oauth.js +567 -0
- package/dist/connectors/notion.d.ts +5 -0
- package/dist/connectors/notion.js +663 -0
- package/dist/connectors/openai.js +85 -2
- package/dist/connectors/shopify-oauth.js +77 -3
- package/dist/connectors/shopify.js +85 -2
- package/dist/connectors/stripe-api-key.d.ts +5 -0
- package/dist/connectors/stripe-api-key.js +600 -0
- package/dist/connectors/stripe-oauth.js +77 -3
- package/dist/connectors/wix-store.js +85 -2
- package/dist/connectors/zendesk-oauth.d.ts +5 -0
- package/dist/connectors/zendesk-oauth.js +579 -0
- package/dist/connectors/zendesk.d.ts +5 -0
- package/dist/connectors/zendesk.js +714 -0
- package/dist/index.js +83024 -7099
- package/dist/main.js +82988 -7063
- package/dist/vite-plugin.js +82862 -6974
- package/package.json +86 -2
- package/dist/connectors/microsoft-teams-oauth.js +0 -479
- package/dist/connectors/microsoft-teams.js +0 -381
- package/dist/connectors/slack.js +0 -362
package/dist/connectors/attio.js
CHANGED
|
@@ -247,6 +247,16 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
249
|
|
|
250
|
+
// ../connectors/src/auth-types.ts
|
|
251
|
+
var AUTH_TYPES = {
|
|
252
|
+
OAUTH: "oauth",
|
|
253
|
+
API_KEY: "api-key",
|
|
254
|
+
JWT: "jwt",
|
|
255
|
+
SERVICE_ACCOUNT: "service-account",
|
|
256
|
+
PAT: "pat",
|
|
257
|
+
USER_PASSWORD: "user-password"
|
|
258
|
+
};
|
|
259
|
+
|
|
250
260
|
// ../connectors/src/connectors/attio/setup.ts
|
|
251
261
|
var attioOnboarding = new ConnectorOnboarding({
|
|
252
262
|
dataOverviewInstructions: {
|
|
@@ -343,7 +353,7 @@ Note that querying records uses POST (not GET) with a request body for filters.`
|
|
|
343
353
|
var tools = { request: requestTool };
|
|
344
354
|
var attioConnector = new ConnectorPlugin({
|
|
345
355
|
slug: "attio",
|
|
346
|
-
authType:
|
|
356
|
+
authType: AUTH_TYPES.API_KEY,
|
|
347
357
|
name: "Attio",
|
|
348
358
|
description: "Connect to Attio for CRM data and relationship intelligence.",
|
|
349
359
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/2qqx99vvXJojUM3tSrSWPX/1e7c35e13da6b365b8b475c1effe568f/attio.svg",
|
|
@@ -491,6 +501,79 @@ function resolveEnvVarOptional(entry, key) {
|
|
|
491
501
|
return process.env[envVarName] || void 0;
|
|
492
502
|
}
|
|
493
503
|
|
|
504
|
+
// src/connector-client/proxy-fetch.ts
|
|
505
|
+
import { getContext } from "hono/context-storage";
|
|
506
|
+
import { getCookie } from "hono/cookie";
|
|
507
|
+
var APP_SESSION_COOKIE_NAME = "__Host-squadbase-session";
|
|
508
|
+
function createSandboxProxyFetch(connectionId) {
|
|
509
|
+
return async (input, init) => {
|
|
510
|
+
const token = process.env.INTERNAL_SQUADBASE_OAUTH_MACHINE_CREDENTIAL;
|
|
511
|
+
const sandboxId = process.env.INTERNAL_SQUADBASE_SANDBOX_ID;
|
|
512
|
+
if (!token || !sandboxId) {
|
|
513
|
+
throw new Error(
|
|
514
|
+
"Connection proxy is not configured. Please check your deployment settings."
|
|
515
|
+
);
|
|
516
|
+
}
|
|
517
|
+
const originalUrl = typeof input === "string" ? input : input instanceof URL ? input.href : input.url;
|
|
518
|
+
const originalMethod = init?.method ?? "GET";
|
|
519
|
+
const originalBody = init?.body ? JSON.parse(init.body) : void 0;
|
|
520
|
+
const baseDomain = process.env["SQUADBASE_PREVIEW_BASE_DOMAIN"] ?? "preview.app.squadbase.dev";
|
|
521
|
+
const proxyUrl = `https://${sandboxId}.${baseDomain}/_sqcore/connections/${connectionId}/request`;
|
|
522
|
+
return fetch(proxyUrl, {
|
|
523
|
+
method: "POST",
|
|
524
|
+
headers: {
|
|
525
|
+
"Content-Type": "application/json",
|
|
526
|
+
Authorization: `Bearer ${token}`
|
|
527
|
+
},
|
|
528
|
+
body: JSON.stringify({
|
|
529
|
+
url: originalUrl,
|
|
530
|
+
method: originalMethod,
|
|
531
|
+
body: originalBody
|
|
532
|
+
})
|
|
533
|
+
});
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
function createDeployedAppProxyFetch(connectionId) {
|
|
537
|
+
const projectId = process.env["SQUADBASE_PROJECT_ID"];
|
|
538
|
+
if (!projectId) {
|
|
539
|
+
throw new Error(
|
|
540
|
+
"Connection proxy is not configured. Please check your deployment settings."
|
|
541
|
+
);
|
|
542
|
+
}
|
|
543
|
+
const baseDomain = process.env["SQUADBASE_APP_BASE_DOMAIN"] ?? "squadbase.app";
|
|
544
|
+
const proxyUrl = `https://${projectId}.${baseDomain}/_sqcore/connections/${connectionId}/request`;
|
|
545
|
+
return async (input, init) => {
|
|
546
|
+
const originalUrl = typeof input === "string" ? input : input instanceof URL ? input.href : input.url;
|
|
547
|
+
const originalMethod = init?.method ?? "GET";
|
|
548
|
+
const originalBody = init?.body ? JSON.parse(init.body) : void 0;
|
|
549
|
+
const c = getContext();
|
|
550
|
+
const appSession = getCookie(c, APP_SESSION_COOKIE_NAME);
|
|
551
|
+
if (!appSession) {
|
|
552
|
+
throw new Error(
|
|
553
|
+
"No authentication method available for connection proxy."
|
|
554
|
+
);
|
|
555
|
+
}
|
|
556
|
+
return fetch(proxyUrl, {
|
|
557
|
+
method: "POST",
|
|
558
|
+
headers: {
|
|
559
|
+
"Content-Type": "application/json",
|
|
560
|
+
Authorization: `Bearer ${appSession}`
|
|
561
|
+
},
|
|
562
|
+
body: JSON.stringify({
|
|
563
|
+
url: originalUrl,
|
|
564
|
+
method: originalMethod,
|
|
565
|
+
body: originalBody
|
|
566
|
+
})
|
|
567
|
+
});
|
|
568
|
+
};
|
|
569
|
+
}
|
|
570
|
+
function createProxyFetch(connectionId) {
|
|
571
|
+
if (process.env.INTERNAL_SQUADBASE_SANDBOX_ID) {
|
|
572
|
+
return createSandboxProxyFetch(connectionId);
|
|
573
|
+
}
|
|
574
|
+
return createDeployedAppProxyFetch(connectionId);
|
|
575
|
+
}
|
|
576
|
+
|
|
494
577
|
// src/connectors/create-connector-sdk.ts
|
|
495
578
|
function loadConnectionsSync() {
|
|
496
579
|
const filePath = process.env.CONNECTIONS_PATH ?? path.join(process.cwd(), ".squadbase/connections.json");
|
|
@@ -524,7 +607,7 @@ function createConnectorSdk(plugin, createClient2) {
|
|
|
524
607
|
if (val !== void 0) params[param.slug] = val;
|
|
525
608
|
}
|
|
526
609
|
}
|
|
527
|
-
return createClient2(params);
|
|
610
|
+
return createClient2(params, createProxyFetch(connectionId));
|
|
528
611
|
};
|
|
529
612
|
}
|
|
530
613
|
|
|
@@ -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.CustomerioConnectorSdk;
|
|
4
4
|
|
|
5
5
|
export { connection };
|