@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
|
@@ -114,7 +114,8 @@ var AUTH_TYPES = {
|
|
|
114
114
|
API_KEY: "api-key",
|
|
115
115
|
JWT: "jwt",
|
|
116
116
|
SERVICE_ACCOUNT: "service-account",
|
|
117
|
-
PAT: "pat"
|
|
117
|
+
PAT: "pat",
|
|
118
|
+
USER_PASSWORD: "user-password"
|
|
118
119
|
};
|
|
119
120
|
|
|
120
121
|
// ../connectors/src/connectors/hubspot-oauth/tools/request.ts
|
|
@@ -281,7 +282,7 @@ var tools = { request: requestTool };
|
|
|
281
282
|
var hubspotOauthConnector = new ConnectorPlugin({
|
|
282
283
|
slug: "hubspot",
|
|
283
284
|
authType: AUTH_TYPES.OAUTH,
|
|
284
|
-
name: "HubSpot
|
|
285
|
+
name: "HubSpot",
|
|
285
286
|
description: "Connect to HubSpot CRM for contacts, deals, companies, and marketing data using OAuth.",
|
|
286
287
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/5UcSkKkzhUMA4RsM45ynuo/43b967e36915ca0fc5d277684b204320/hubspot.svg",
|
|
287
288
|
parameters,
|
|
@@ -434,6 +435,79 @@ function resolveEnvVarOptional(entry, key) {
|
|
|
434
435
|
return process.env[envVarName] || void 0;
|
|
435
436
|
}
|
|
436
437
|
|
|
438
|
+
// src/connector-client/proxy-fetch.ts
|
|
439
|
+
import { getContext } from "hono/context-storage";
|
|
440
|
+
import { getCookie } from "hono/cookie";
|
|
441
|
+
var APP_SESSION_COOKIE_NAME = "__Host-squadbase-session";
|
|
442
|
+
function createSandboxProxyFetch(connectionId) {
|
|
443
|
+
return async (input, init) => {
|
|
444
|
+
const token = process.env.INTERNAL_SQUADBASE_OAUTH_MACHINE_CREDENTIAL;
|
|
445
|
+
const sandboxId = process.env.INTERNAL_SQUADBASE_SANDBOX_ID;
|
|
446
|
+
if (!token || !sandboxId) {
|
|
447
|
+
throw new Error(
|
|
448
|
+
"Connection proxy is not configured. Please check your deployment settings."
|
|
449
|
+
);
|
|
450
|
+
}
|
|
451
|
+
const originalUrl = typeof input === "string" ? input : input instanceof URL ? input.href : input.url;
|
|
452
|
+
const originalMethod = init?.method ?? "GET";
|
|
453
|
+
const originalBody = init?.body ? JSON.parse(init.body) : void 0;
|
|
454
|
+
const baseDomain = process.env["SQUADBASE_PREVIEW_BASE_DOMAIN"] ?? "preview.app.squadbase.dev";
|
|
455
|
+
const proxyUrl = `https://${sandboxId}.${baseDomain}/_sqcore/connections/${connectionId}/request`;
|
|
456
|
+
return fetch(proxyUrl, {
|
|
457
|
+
method: "POST",
|
|
458
|
+
headers: {
|
|
459
|
+
"Content-Type": "application/json",
|
|
460
|
+
Authorization: `Bearer ${token}`
|
|
461
|
+
},
|
|
462
|
+
body: JSON.stringify({
|
|
463
|
+
url: originalUrl,
|
|
464
|
+
method: originalMethod,
|
|
465
|
+
body: originalBody
|
|
466
|
+
})
|
|
467
|
+
});
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
function createDeployedAppProxyFetch(connectionId) {
|
|
471
|
+
const projectId = process.env["SQUADBASE_PROJECT_ID"];
|
|
472
|
+
if (!projectId) {
|
|
473
|
+
throw new Error(
|
|
474
|
+
"Connection proxy is not configured. Please check your deployment settings."
|
|
475
|
+
);
|
|
476
|
+
}
|
|
477
|
+
const baseDomain = process.env["SQUADBASE_APP_BASE_DOMAIN"] ?? "squadbase.app";
|
|
478
|
+
const proxyUrl = `https://${projectId}.${baseDomain}/_sqcore/connections/${connectionId}/request`;
|
|
479
|
+
return async (input, init) => {
|
|
480
|
+
const originalUrl = typeof input === "string" ? input : input instanceof URL ? input.href : input.url;
|
|
481
|
+
const originalMethod = init?.method ?? "GET";
|
|
482
|
+
const originalBody = init?.body ? JSON.parse(init.body) : void 0;
|
|
483
|
+
const c = getContext();
|
|
484
|
+
const appSession = getCookie(c, APP_SESSION_COOKIE_NAME);
|
|
485
|
+
if (!appSession) {
|
|
486
|
+
throw new Error(
|
|
487
|
+
"No authentication method available for connection proxy."
|
|
488
|
+
);
|
|
489
|
+
}
|
|
490
|
+
return fetch(proxyUrl, {
|
|
491
|
+
method: "POST",
|
|
492
|
+
headers: {
|
|
493
|
+
"Content-Type": "application/json",
|
|
494
|
+
Authorization: `Bearer ${appSession}`
|
|
495
|
+
},
|
|
496
|
+
body: JSON.stringify({
|
|
497
|
+
url: originalUrl,
|
|
498
|
+
method: originalMethod,
|
|
499
|
+
body: originalBody
|
|
500
|
+
})
|
|
501
|
+
});
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
function createProxyFetch(connectionId) {
|
|
505
|
+
if (process.env.INTERNAL_SQUADBASE_SANDBOX_ID) {
|
|
506
|
+
return createSandboxProxyFetch(connectionId);
|
|
507
|
+
}
|
|
508
|
+
return createDeployedAppProxyFetch(connectionId);
|
|
509
|
+
}
|
|
510
|
+
|
|
437
511
|
// src/connectors/create-connector-sdk.ts
|
|
438
512
|
function loadConnectionsSync() {
|
|
439
513
|
const filePath = process.env.CONNECTIONS_PATH ?? path.join(process.cwd(), ".squadbase/connections.json");
|
|
@@ -467,7 +541,7 @@ function createConnectorSdk(plugin, createClient2) {
|
|
|
467
541
|
if (val !== void 0) params[param.slug] = val;
|
|
468
542
|
}
|
|
469
543
|
}
|
|
470
|
-
return createClient2(params);
|
|
544
|
+
return createClient2(params, createProxyFetch(connectionId));
|
|
471
545
|
};
|
|
472
546
|
}
|
|
473
547
|
|
|
@@ -46,8 +46,8 @@ var ParameterDefinition = class {
|
|
|
46
46
|
var parameters = {
|
|
47
47
|
apiKey: new ParameterDefinition({
|
|
48
48
|
slug: "api-key",
|
|
49
|
-
name: "
|
|
50
|
-
description: "
|
|
49
|
+
name: "Private App Access Token",
|
|
50
|
+
description: "Your HubSpot Private App Access Token for authentication (starts with pat-). You can find it at Settings \u2192 Development \u2192 Legacy Apps \u2192 your Private App.",
|
|
51
51
|
envVarBaseKey: "HUBSPOT_API_KEY",
|
|
52
52
|
type: "text",
|
|
53
53
|
secret: true,
|
|
@@ -237,6 +237,16 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
237
237
|
}
|
|
238
238
|
};
|
|
239
239
|
|
|
240
|
+
// ../connectors/src/auth-types.ts
|
|
241
|
+
var AUTH_TYPES = {
|
|
242
|
+
OAUTH: "oauth",
|
|
243
|
+
API_KEY: "api-key",
|
|
244
|
+
JWT: "jwt",
|
|
245
|
+
SERVICE_ACCOUNT: "service-account",
|
|
246
|
+
PAT: "pat",
|
|
247
|
+
USER_PASSWORD: "user-password"
|
|
248
|
+
};
|
|
249
|
+
|
|
240
250
|
// ../connectors/src/connectors/hubspot/setup.ts
|
|
241
251
|
var hubspotOnboarding = new ConnectorOnboarding({
|
|
242
252
|
dataOverviewInstructions: {
|
|
@@ -280,7 +290,7 @@ var outputSchema = z.discriminatedUnion("success", [
|
|
|
280
290
|
var requestTool = new ConnectorTool({
|
|
281
291
|
name: "request",
|
|
282
292
|
description: `Send authenticated requests to the HubSpot API.
|
|
283
|
-
Authentication is handled automatically using the
|
|
293
|
+
Authentication is handled automatically using the Personal Access Key (Bearer token).
|
|
284
294
|
Use this tool for all HubSpot API interactions: querying contacts, deals, companies, tickets, and other CRM objects.
|
|
285
295
|
Use the search endpoint (POST /crm/v3/objects/{objectType}/search) for complex queries with filters.`,
|
|
286
296
|
inputSchema,
|
|
@@ -331,9 +341,9 @@ Use the search endpoint (POST /crm/v3/objects/{objectType}/search) for complex q
|
|
|
331
341
|
var tools = { request: requestTool };
|
|
332
342
|
var hubspotConnector = new ConnectorPlugin({
|
|
333
343
|
slug: "hubspot",
|
|
334
|
-
authType:
|
|
344
|
+
authType: AUTH_TYPES.API_KEY,
|
|
335
345
|
name: "HubSpot",
|
|
336
|
-
description: "Connect to HubSpot CRM for contacts, deals, companies, and marketing data using a
|
|
346
|
+
description: "Connect to HubSpot CRM for contacts, deals, companies, and marketing data using a Personal Access Key.",
|
|
337
347
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/5UcSkKkzhUMA4RsM45ynuo/43b967e36915ca0fc5d277684b204320/hubspot.svg",
|
|
338
348
|
parameters,
|
|
339
349
|
releaseFlag: { dev1: true, dev2: false, prod: false },
|
|
@@ -497,6 +507,79 @@ function resolveEnvVarOptional(entry, key) {
|
|
|
497
507
|
return process.env[envVarName] || void 0;
|
|
498
508
|
}
|
|
499
509
|
|
|
510
|
+
// src/connector-client/proxy-fetch.ts
|
|
511
|
+
import { getContext } from "hono/context-storage";
|
|
512
|
+
import { getCookie } from "hono/cookie";
|
|
513
|
+
var APP_SESSION_COOKIE_NAME = "__Host-squadbase-session";
|
|
514
|
+
function createSandboxProxyFetch(connectionId) {
|
|
515
|
+
return async (input, init) => {
|
|
516
|
+
const token = process.env.INTERNAL_SQUADBASE_OAUTH_MACHINE_CREDENTIAL;
|
|
517
|
+
const sandboxId = process.env.INTERNAL_SQUADBASE_SANDBOX_ID;
|
|
518
|
+
if (!token || !sandboxId) {
|
|
519
|
+
throw new Error(
|
|
520
|
+
"Connection proxy is not configured. Please check your deployment settings."
|
|
521
|
+
);
|
|
522
|
+
}
|
|
523
|
+
const originalUrl = typeof input === "string" ? input : input instanceof URL ? input.href : input.url;
|
|
524
|
+
const originalMethod = init?.method ?? "GET";
|
|
525
|
+
const originalBody = init?.body ? JSON.parse(init.body) : void 0;
|
|
526
|
+
const baseDomain = process.env["SQUADBASE_PREVIEW_BASE_DOMAIN"] ?? "preview.app.squadbase.dev";
|
|
527
|
+
const proxyUrl = `https://${sandboxId}.${baseDomain}/_sqcore/connections/${connectionId}/request`;
|
|
528
|
+
return fetch(proxyUrl, {
|
|
529
|
+
method: "POST",
|
|
530
|
+
headers: {
|
|
531
|
+
"Content-Type": "application/json",
|
|
532
|
+
Authorization: `Bearer ${token}`
|
|
533
|
+
},
|
|
534
|
+
body: JSON.stringify({
|
|
535
|
+
url: originalUrl,
|
|
536
|
+
method: originalMethod,
|
|
537
|
+
body: originalBody
|
|
538
|
+
})
|
|
539
|
+
});
|
|
540
|
+
};
|
|
541
|
+
}
|
|
542
|
+
function createDeployedAppProxyFetch(connectionId) {
|
|
543
|
+
const projectId = process.env["SQUADBASE_PROJECT_ID"];
|
|
544
|
+
if (!projectId) {
|
|
545
|
+
throw new Error(
|
|
546
|
+
"Connection proxy is not configured. Please check your deployment settings."
|
|
547
|
+
);
|
|
548
|
+
}
|
|
549
|
+
const baseDomain = process.env["SQUADBASE_APP_BASE_DOMAIN"] ?? "squadbase.app";
|
|
550
|
+
const proxyUrl = `https://${projectId}.${baseDomain}/_sqcore/connections/${connectionId}/request`;
|
|
551
|
+
return async (input, init) => {
|
|
552
|
+
const originalUrl = typeof input === "string" ? input : input instanceof URL ? input.href : input.url;
|
|
553
|
+
const originalMethod = init?.method ?? "GET";
|
|
554
|
+
const originalBody = init?.body ? JSON.parse(init.body) : void 0;
|
|
555
|
+
const c = getContext();
|
|
556
|
+
const appSession = getCookie(c, APP_SESSION_COOKIE_NAME);
|
|
557
|
+
if (!appSession) {
|
|
558
|
+
throw new Error(
|
|
559
|
+
"No authentication method available for connection proxy."
|
|
560
|
+
);
|
|
561
|
+
}
|
|
562
|
+
return fetch(proxyUrl, {
|
|
563
|
+
method: "POST",
|
|
564
|
+
headers: {
|
|
565
|
+
"Content-Type": "application/json",
|
|
566
|
+
Authorization: `Bearer ${appSession}`
|
|
567
|
+
},
|
|
568
|
+
body: JSON.stringify({
|
|
569
|
+
url: originalUrl,
|
|
570
|
+
method: originalMethod,
|
|
571
|
+
body: originalBody
|
|
572
|
+
})
|
|
573
|
+
});
|
|
574
|
+
};
|
|
575
|
+
}
|
|
576
|
+
function createProxyFetch(connectionId) {
|
|
577
|
+
if (process.env.INTERNAL_SQUADBASE_SANDBOX_ID) {
|
|
578
|
+
return createSandboxProxyFetch(connectionId);
|
|
579
|
+
}
|
|
580
|
+
return createDeployedAppProxyFetch(connectionId);
|
|
581
|
+
}
|
|
582
|
+
|
|
500
583
|
// src/connectors/create-connector-sdk.ts
|
|
501
584
|
function loadConnectionsSync() {
|
|
502
585
|
const filePath = process.env.CONNECTIONS_PATH ?? path.join(process.cwd(), ".squadbase/connections.json");
|
|
@@ -530,7 +613,7 @@ function createConnectorSdk(plugin, createClient2) {
|
|
|
530
613
|
if (val !== void 0) params[param.slug] = val;
|
|
531
614
|
}
|
|
532
615
|
}
|
|
533
|
-
return createClient2(params);
|
|
616
|
+
return createClient2(params, createProxyFetch(connectionId));
|
|
534
617
|
};
|
|
535
618
|
}
|
|
536
619
|
|