@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
|
@@ -1,3 +1,42 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
3
|
+
var __esm = (fn, res) => function __init() {
|
|
4
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
5
|
+
};
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
// ../connectors/src/connectors/google-sheets/utils.ts
|
|
12
|
+
function extractSpreadsheetId(urlOrId) {
|
|
13
|
+
const trimmed = urlOrId.trim();
|
|
14
|
+
const match = trimmed.match(SPREADSHEET_URL_PATTERN);
|
|
15
|
+
if (match) {
|
|
16
|
+
return match[1];
|
|
17
|
+
}
|
|
18
|
+
return trimmed;
|
|
19
|
+
}
|
|
20
|
+
var SPREADSHEET_URL_PATTERN;
|
|
21
|
+
var init_utils = __esm({
|
|
22
|
+
"../connectors/src/connectors/google-sheets/utils.ts"() {
|
|
23
|
+
"use strict";
|
|
24
|
+
SPREADSHEET_URL_PATTERN = /docs\.google\.com\/spreadsheets\/d\/([a-zA-Z0-9_-]+)/;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// ../connectors/src/connectors/google-sheets-oauth/utils.ts
|
|
29
|
+
var utils_exports = {};
|
|
30
|
+
__export(utils_exports, {
|
|
31
|
+
extractSpreadsheetId: () => extractSpreadsheetId
|
|
32
|
+
});
|
|
33
|
+
var init_utils2 = __esm({
|
|
34
|
+
"../connectors/src/connectors/google-sheets-oauth/utils.ts"() {
|
|
35
|
+
"use strict";
|
|
36
|
+
init_utils();
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
1
40
|
// ../connectors/src/parameter-definition.ts
|
|
2
41
|
var ParameterDefinition = class {
|
|
3
42
|
slug;
|
|
@@ -44,21 +83,23 @@ var ParameterDefinition = class {
|
|
|
44
83
|
|
|
45
84
|
// ../connectors/src/connectors/google-sheets-oauth/parameters.ts
|
|
46
85
|
var parameters = {
|
|
47
|
-
|
|
48
|
-
slug: "spreadsheet-
|
|
49
|
-
name: "
|
|
50
|
-
description: "The
|
|
51
|
-
envVarBaseKey: "
|
|
86
|
+
spreadsheetUrl: new ParameterDefinition({
|
|
87
|
+
slug: "spreadsheet-url",
|
|
88
|
+
name: "Google Spreadsheet URL",
|
|
89
|
+
description: "The URL of the Google Spreadsheet (e.g., https://docs.google.com/spreadsheets/d/xxxxx/edit). The spreadsheet ID is automatically extracted from the URL.",
|
|
90
|
+
envVarBaseKey: "GOOGLE_SHEETS_OAUTH_SPREADSHEET_URL",
|
|
52
91
|
type: "text",
|
|
53
92
|
secret: false,
|
|
54
|
-
required:
|
|
93
|
+
required: true
|
|
55
94
|
})
|
|
56
95
|
};
|
|
57
96
|
|
|
58
97
|
// ../connectors/src/connectors/google-sheets-oauth/sdk/index.ts
|
|
98
|
+
init_utils2();
|
|
59
99
|
var BASE_URL = "https://sheets.googleapis.com/v4/spreadsheets";
|
|
60
100
|
function createClient(params, fetchFn = fetch) {
|
|
61
|
-
const
|
|
101
|
+
const spreadsheetUrl = params[parameters.spreadsheetUrl.slug];
|
|
102
|
+
const defaultSpreadsheetId = spreadsheetUrl ? extractSpreadsheetId(spreadsheetUrl) : void 0;
|
|
62
103
|
function resolveSpreadsheetId(override) {
|
|
63
104
|
const id = override ?? defaultSpreadsheetId;
|
|
64
105
|
if (!id) {
|
|
@@ -227,11 +268,13 @@ var AUTH_TYPES = {
|
|
|
227
268
|
API_KEY: "api-key",
|
|
228
269
|
JWT: "jwt",
|
|
229
270
|
SERVICE_ACCOUNT: "service-account",
|
|
230
|
-
PAT: "pat"
|
|
271
|
+
PAT: "pat",
|
|
272
|
+
USER_PASSWORD: "user-password"
|
|
231
273
|
};
|
|
232
274
|
|
|
233
275
|
// ../connectors/src/connectors/google-sheets-oauth/tools/request.ts
|
|
234
276
|
import { z } from "zod";
|
|
277
|
+
init_utils2();
|
|
235
278
|
var BASE_URL2 = "https://sheets.googleapis.com/v4/spreadsheets";
|
|
236
279
|
var REQUEST_TIMEOUT_MS = 6e4;
|
|
237
280
|
var cachedToken = null;
|
|
@@ -306,7 +349,8 @@ Authentication is handled automatically via OAuth proxy.
|
|
|
306
349
|
`[connector-request] google-sheets-oauth/${connection2.name}: ${method} ${path2}`
|
|
307
350
|
);
|
|
308
351
|
try {
|
|
309
|
-
const
|
|
352
|
+
const spreadsheetUrl = parameters.spreadsheetUrl.tryGetValue(connection2);
|
|
353
|
+
const spreadsheetId = spreadsheetUrl ? extractSpreadsheetId(spreadsheetUrl) : void 0;
|
|
310
354
|
const resolvedPath = spreadsheetId ? path2.replace(/\{spreadsheetId\}/g, spreadsheetId) : path2;
|
|
311
355
|
let url = `${BASE_URL2}${resolvedPath.startsWith("/") ? "" : "/"}${resolvedPath}`;
|
|
312
356
|
if (queryParams) {
|
|
@@ -350,43 +394,35 @@ Authentication is handled automatically via OAuth proxy.
|
|
|
350
394
|
var requestToolName = `google-sheets-oauth_${requestTool.name}`;
|
|
351
395
|
var googleSheetsOnboarding = new ConnectorOnboarding({
|
|
352
396
|
connectionSetupInstructions: {
|
|
353
|
-
ja: `\u4EE5\u4E0B\u306E\u624B\u9806\u3067Google Sheets\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002
|
|
354
|
-
|
|
355
|
-
1. \
|
|
356
|
-
2. \u30E6\u30FC\u30B6\u30FC\u304CURL\u307E\u305F\u306F\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8ID\u3092\u63D0\u4F9B\u3057\u305F\u3089\u3001URL\u304B\u3089ID\u3092\u62BD\u51FA\u3059\u308B\uFF08\`/d/\` \u3068 \`/edit\` \u306E\u9593\u306E\u6587\u5B57\u5217\uFF09
|
|
357
|
-
3. \`updateConnectionParameters\` \u3092\u547C\u3073\u51FA\u3059:
|
|
358
|
-
- \`parameterSlug\`: \`"spreadsheet-id"\`
|
|
359
|
-
- \`value\`: \u62BD\u51FA\u3057\u305F\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8ID
|
|
360
|
-
4. \`${requestToolName}\` \u3092\u547C\u3073\u51FA\u3057\u3066\u3001\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306E\u30E1\u30BF\u30C7\u30FC\u30BF\u3092\u53D6\u5F97\u3059\u308B:
|
|
397
|
+
ja: `\u4EE5\u4E0B\u306E\u624B\u9806\u3067Google Sheets\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8URL\u306F\u63A5\u7D9A\u30D1\u30E9\u30E1\u30FC\u30BF\u3068\u3057\u3066\u65E2\u306B\u767B\u9332\u6E08\u307F\u3067\u3059\u3002\u30E6\u30FC\u30B6\u30FC\u306B\u805E\u304D\u8FD4\u3055\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002
|
|
398
|
+
|
|
399
|
+
1. \`${requestToolName}\` \u3092\u547C\u3073\u51FA\u3057\u3066\u3001\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306E\u30E1\u30BF\u30C7\u30FC\u30BF\u3092\u53D6\u5F97\u3059\u308B:
|
|
361
400
|
- \`method\`: \`"GET"\`
|
|
362
401
|
- \`path\`: \`"/{spreadsheetId}?fields=spreadsheetId,properties.title,sheets.properties.title"\`
|
|
363
|
-
|
|
364
|
-
|
|
402
|
+
2. \u30A8\u30E9\u30FC\u304C\u8FD4\u3055\u308C\u305F\u5834\u5408\u3001\u30E6\u30FC\u30B6\u30FC\u306B\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306E\u5171\u6709\u8A2D\u5B9A\u3092\u78BA\u8A8D\u3059\u308B\u3088\u3046\u4F1D\u3048\u308B
|
|
403
|
+
3. \`updateConnectionContext\` \u3092\u547C\u3073\u51FA\u3059:
|
|
365
404
|
- \`spreadsheet\`: \u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306E\u30BF\u30A4\u30C8\u30EB
|
|
366
405
|
- \`sheets\`: \u30B7\u30FC\u30C8\u540D\u4E00\u89A7\uFF08\u30AB\u30F3\u30DE\u533A\u5207\u308A\uFF09
|
|
367
406
|
- \`note\`: \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u5185\u5BB9\u306E\u7C21\u5358\u306A\u8AAC\u660E
|
|
368
407
|
|
|
369
408
|
#### \u5236\u7D04
|
|
370
409
|
- **\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u4E2D\u306B\u30B7\u30FC\u30C8\u306E\u30C7\u30FC\u30BF\u3092\u8AAD\u307F\u53D6\u3089\u306A\u3044\u3053\u3068**\u3002\u5B9F\u884C\u3057\u3066\u3088\u3044\u306E\u306F\u4E0A\u8A18\u624B\u9806\u3067\u6307\u5B9A\u3055\u308C\u305F\u30E1\u30BF\u30C7\u30FC\u30BF\u53D6\u5F97\u30EA\u30AF\u30A8\u30B9\u30C8\u306E\u307F
|
|
410
|
+
- \u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8URL\u3092\u30E6\u30FC\u30B6\u30FC\u306B\u805E\u304D\u8FD4\u3055\u306A\u3044\u3053\u3068\uFF08\u767B\u9332\u6E08\u307F\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u305D\u306E\u307E\u307E\u4F7F\u7528\u3059\u308B\uFF09
|
|
371
411
|
- \u30C4\u30FC\u30EB\u9593\u306F1\u6587\u3060\u3051\u66F8\u3044\u3066\u5373\u6B21\u306E\u30C4\u30FC\u30EB\u547C\u3073\u51FA\u3057\u3002\u4E0D\u8981\u306A\u8AAC\u660E\u306F\u7701\u7565\u3057\u3001\u52B9\u7387\u7684\u306B\u9032\u3081\u308B`,
|
|
372
|
-
en: `Follow these steps to set up the Google Sheets connection.
|
|
373
|
-
|
|
374
|
-
1.
|
|
375
|
-
2. When the user provides a URL or spreadsheet ID, extract the ID from the URL (the string between \`/d/\` and \`/edit\`)
|
|
376
|
-
3. Call \`updateConnectionParameters\`:
|
|
377
|
-
- \`parameterSlug\`: \`"spreadsheet-id"\`
|
|
378
|
-
- \`value\`: The extracted spreadsheet ID
|
|
379
|
-
4. Call \`${requestToolName}\` to fetch spreadsheet metadata:
|
|
412
|
+
en: `Follow these steps to set up the Google Sheets connection. The spreadsheet URL is already registered as a connection parameter \u2014 do NOT ask the user for it again.
|
|
413
|
+
|
|
414
|
+
1. Call \`${requestToolName}\` to fetch spreadsheet metadata:
|
|
380
415
|
- \`method\`: \`"GET"\`
|
|
381
416
|
- \`path\`: \`"/{spreadsheetId}?fields=spreadsheetId,properties.title,sheets.properties.title"\`
|
|
382
|
-
|
|
383
|
-
|
|
417
|
+
2. If an error is returned, ask the user to check the spreadsheet sharing settings
|
|
418
|
+
3. Call \`updateConnectionContext\`:
|
|
384
419
|
- \`spreadsheet\`: The spreadsheet title
|
|
385
420
|
- \`sheets\`: Sheet names (comma-separated)
|
|
386
421
|
- \`note\`: Brief description of the setup
|
|
387
422
|
|
|
388
423
|
#### Constraints
|
|
389
424
|
- **Do NOT read sheet data during setup**. Only the metadata request specified in the steps above is allowed
|
|
425
|
+
- Do NOT ask the user for the spreadsheet URL \u2014 it is already stored as a connection parameter
|
|
390
426
|
- Write only 1 sentence between tool calls, then immediately call the next tool. Skip unnecessary explanations and proceed efficiently`
|
|
391
427
|
},
|
|
392
428
|
dataOverviewInstructions: {
|
|
@@ -402,7 +438,7 @@ var tools = { request: requestTool };
|
|
|
402
438
|
var googleSheetsOauthConnector = new ConnectorPlugin({
|
|
403
439
|
slug: "google-sheets",
|
|
404
440
|
authType: AUTH_TYPES.OAUTH,
|
|
405
|
-
name: "Google Sheets
|
|
441
|
+
name: "Google Sheets",
|
|
406
442
|
description: "Connect to Google Sheets for spreadsheet data access using OAuth.",
|
|
407
443
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/1UPQuggyiZmbb26CuaSr2h/032770e8739b183fa00b7625f024e536/google-sheets.svg",
|
|
408
444
|
parameters,
|
|
@@ -517,10 +553,12 @@ batch.valueRanges.forEach(vr => console.log(vr.range, vr.values));
|
|
|
517
553
|
tools,
|
|
518
554
|
async checkConnection(params, config) {
|
|
519
555
|
const { proxyFetch } = config;
|
|
520
|
-
const
|
|
521
|
-
if (!
|
|
556
|
+
const spreadsheetUrl = params[parameters.spreadsheetUrl.slug];
|
|
557
|
+
if (!spreadsheetUrl) {
|
|
522
558
|
return { success: true };
|
|
523
559
|
}
|
|
560
|
+
const { extractSpreadsheetId: extractSpreadsheetId2 } = await Promise.resolve().then(() => (init_utils2(), utils_exports));
|
|
561
|
+
const spreadsheetId = extractSpreadsheetId2(spreadsheetUrl);
|
|
524
562
|
const url = `https://sheets.googleapis.com/v4/spreadsheets/${spreadsheetId}?fields=spreadsheetId,properties.title`;
|
|
525
563
|
try {
|
|
526
564
|
const res = await proxyFetch(url, { method: "GET" });
|
|
@@ -563,6 +601,79 @@ function resolveEnvVarOptional(entry, key) {
|
|
|
563
601
|
return process.env[envVarName] || void 0;
|
|
564
602
|
}
|
|
565
603
|
|
|
604
|
+
// src/connector-client/proxy-fetch.ts
|
|
605
|
+
import { getContext } from "hono/context-storage";
|
|
606
|
+
import { getCookie } from "hono/cookie";
|
|
607
|
+
var APP_SESSION_COOKIE_NAME = "__Host-squadbase-session";
|
|
608
|
+
function createSandboxProxyFetch(connectionId) {
|
|
609
|
+
return async (input, init) => {
|
|
610
|
+
const token = process.env.INTERNAL_SQUADBASE_OAUTH_MACHINE_CREDENTIAL;
|
|
611
|
+
const sandboxId = process.env.INTERNAL_SQUADBASE_SANDBOX_ID;
|
|
612
|
+
if (!token || !sandboxId) {
|
|
613
|
+
throw new Error(
|
|
614
|
+
"Connection proxy is not configured. Please check your deployment settings."
|
|
615
|
+
);
|
|
616
|
+
}
|
|
617
|
+
const originalUrl = typeof input === "string" ? input : input instanceof URL ? input.href : input.url;
|
|
618
|
+
const originalMethod = init?.method ?? "GET";
|
|
619
|
+
const originalBody = init?.body ? JSON.parse(init.body) : void 0;
|
|
620
|
+
const baseDomain = process.env["SQUADBASE_PREVIEW_BASE_DOMAIN"] ?? "preview.app.squadbase.dev";
|
|
621
|
+
const proxyUrl = `https://${sandboxId}.${baseDomain}/_sqcore/connections/${connectionId}/request`;
|
|
622
|
+
return fetch(proxyUrl, {
|
|
623
|
+
method: "POST",
|
|
624
|
+
headers: {
|
|
625
|
+
"Content-Type": "application/json",
|
|
626
|
+
Authorization: `Bearer ${token}`
|
|
627
|
+
},
|
|
628
|
+
body: JSON.stringify({
|
|
629
|
+
url: originalUrl,
|
|
630
|
+
method: originalMethod,
|
|
631
|
+
body: originalBody
|
|
632
|
+
})
|
|
633
|
+
});
|
|
634
|
+
};
|
|
635
|
+
}
|
|
636
|
+
function createDeployedAppProxyFetch(connectionId) {
|
|
637
|
+
const projectId = process.env["SQUADBASE_PROJECT_ID"];
|
|
638
|
+
if (!projectId) {
|
|
639
|
+
throw new Error(
|
|
640
|
+
"Connection proxy is not configured. Please check your deployment settings."
|
|
641
|
+
);
|
|
642
|
+
}
|
|
643
|
+
const baseDomain = process.env["SQUADBASE_APP_BASE_DOMAIN"] ?? "squadbase.app";
|
|
644
|
+
const proxyUrl = `https://${projectId}.${baseDomain}/_sqcore/connections/${connectionId}/request`;
|
|
645
|
+
return async (input, init) => {
|
|
646
|
+
const originalUrl = typeof input === "string" ? input : input instanceof URL ? input.href : input.url;
|
|
647
|
+
const originalMethod = init?.method ?? "GET";
|
|
648
|
+
const originalBody = init?.body ? JSON.parse(init.body) : void 0;
|
|
649
|
+
const c = getContext();
|
|
650
|
+
const appSession = getCookie(c, APP_SESSION_COOKIE_NAME);
|
|
651
|
+
if (!appSession) {
|
|
652
|
+
throw new Error(
|
|
653
|
+
"No authentication method available for connection proxy."
|
|
654
|
+
);
|
|
655
|
+
}
|
|
656
|
+
return fetch(proxyUrl, {
|
|
657
|
+
method: "POST",
|
|
658
|
+
headers: {
|
|
659
|
+
"Content-Type": "application/json",
|
|
660
|
+
Authorization: `Bearer ${appSession}`
|
|
661
|
+
},
|
|
662
|
+
body: JSON.stringify({
|
|
663
|
+
url: originalUrl,
|
|
664
|
+
method: originalMethod,
|
|
665
|
+
body: originalBody
|
|
666
|
+
})
|
|
667
|
+
});
|
|
668
|
+
};
|
|
669
|
+
}
|
|
670
|
+
function createProxyFetch(connectionId) {
|
|
671
|
+
if (process.env.INTERNAL_SQUADBASE_SANDBOX_ID) {
|
|
672
|
+
return createSandboxProxyFetch(connectionId);
|
|
673
|
+
}
|
|
674
|
+
return createDeployedAppProxyFetch(connectionId);
|
|
675
|
+
}
|
|
676
|
+
|
|
566
677
|
// src/connectors/create-connector-sdk.ts
|
|
567
678
|
function loadConnectionsSync() {
|
|
568
679
|
const filePath = process.env.CONNECTIONS_PATH ?? path.join(process.cwd(), ".squadbase/connections.json");
|
|
@@ -596,7 +707,7 @@ function createConnectorSdk(plugin, createClient2) {
|
|
|
596
707
|
if (val !== void 0) params[param.slug] = val;
|
|
597
708
|
}
|
|
598
709
|
}
|
|
599
|
-
return createClient2(params);
|
|
710
|
+
return createClient2(params, createProxyFetch(connectionId));
|
|
600
711
|
};
|
|
601
712
|
}
|
|
602
713
|
|