@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.
Files changed (70) hide show
  1. package/dist/cli/index.js +82859 -9645
  2. package/dist/connectors/airtable-oauth.js +77 -3
  3. package/dist/connectors/airtable.js +85 -2
  4. package/dist/connectors/amplitude.js +85 -2
  5. package/dist/connectors/anthropic.js +85 -2
  6. package/dist/connectors/{slack.d.ts → asana.d.ts} +1 -1
  7. package/dist/connectors/asana.js +744 -0
  8. package/dist/connectors/attio.js +85 -2
  9. package/dist/connectors/{microsoft-teams-oauth.d.ts → customerio.d.ts} +1 -1
  10. package/dist/connectors/customerio.js +716 -0
  11. package/dist/connectors/dbt.js +85 -2
  12. package/dist/connectors/gemini.js +86 -3
  13. package/dist/connectors/{microsoft-teams.d.ts → gmail-oauth.d.ts} +1 -1
  14. package/dist/connectors/gmail-oauth.js +713 -0
  15. package/dist/connectors/gmail.d.ts +5 -0
  16. package/dist/connectors/gmail.js +875 -0
  17. package/dist/connectors/google-ads-oauth.js +78 -4
  18. package/dist/connectors/google-ads.d.ts +5 -0
  19. package/dist/connectors/google-ads.js +867 -0
  20. package/dist/connectors/google-analytics-oauth.js +90 -8
  21. package/dist/connectors/google-analytics.js +85 -2
  22. package/dist/connectors/google-calendar-oauth.d.ts +5 -0
  23. package/dist/connectors/google-calendar-oauth.js +817 -0
  24. package/dist/connectors/google-calendar.d.ts +5 -0
  25. package/dist/connectors/google-calendar.js +991 -0
  26. package/dist/connectors/google-sheets-oauth.js +144 -33
  27. package/dist/connectors/google-sheets.d.ts +5 -0
  28. package/dist/connectors/google-sheets.js +707 -0
  29. package/dist/connectors/grafana.d.ts +5 -0
  30. package/dist/connectors/grafana.js +638 -0
  31. package/dist/connectors/hubspot-oauth.js +77 -3
  32. package/dist/connectors/hubspot.js +89 -6
  33. package/dist/connectors/intercom-oauth.d.ts +5 -0
  34. package/dist/connectors/intercom-oauth.js +584 -0
  35. package/dist/connectors/intercom.d.ts +5 -0
  36. package/dist/connectors/intercom.js +710 -0
  37. package/dist/connectors/jira-api-key.d.ts +5 -0
  38. package/dist/connectors/jira-api-key.js +598 -0
  39. package/dist/connectors/kintone-api-token.js +77 -3
  40. package/dist/connectors/kintone.js +86 -3
  41. package/dist/connectors/linkedin-ads-oauth.d.ts +5 -0
  42. package/dist/connectors/linkedin-ads-oauth.js +848 -0
  43. package/dist/connectors/linkedin-ads.d.ts +5 -0
  44. package/dist/connectors/linkedin-ads.js +865 -0
  45. package/dist/connectors/mailchimp-oauth.d.ts +5 -0
  46. package/dist/connectors/mailchimp-oauth.js +613 -0
  47. package/dist/connectors/mailchimp.d.ts +5 -0
  48. package/dist/connectors/mailchimp.js +729 -0
  49. package/dist/connectors/notion-oauth.d.ts +5 -0
  50. package/dist/connectors/notion-oauth.js +567 -0
  51. package/dist/connectors/notion.d.ts +5 -0
  52. package/dist/connectors/notion.js +663 -0
  53. package/dist/connectors/openai.js +85 -2
  54. package/dist/connectors/shopify-oauth.js +77 -3
  55. package/dist/connectors/shopify.js +85 -2
  56. package/dist/connectors/stripe-api-key.d.ts +5 -0
  57. package/dist/connectors/stripe-api-key.js +600 -0
  58. package/dist/connectors/stripe-oauth.js +77 -3
  59. package/dist/connectors/wix-store.js +85 -2
  60. package/dist/connectors/zendesk-oauth.d.ts +5 -0
  61. package/dist/connectors/zendesk-oauth.js +579 -0
  62. package/dist/connectors/zendesk.d.ts +5 -0
  63. package/dist/connectors/zendesk.js +714 -0
  64. package/dist/index.js +83024 -7099
  65. package/dist/main.js +82988 -7063
  66. package/dist/vite-plugin.js +82862 -6974
  67. package/package.json +86 -2
  68. package/dist/connectors/microsoft-teams-oauth.js +0 -479
  69. package/dist/connectors/microsoft-teams.js +0 -381
  70. package/dist/connectors/slack.js +0 -362
@@ -60,7 +60,7 @@ var parameters = {
60
60
  envVarBaseKey: "GOOGLE_ADS_DEVELOPER_TOKEN",
61
61
  type: "text",
62
62
  secret: true,
63
- required: false
63
+ required: true
64
64
  })
65
65
  };
66
66
 
@@ -244,7 +244,8 @@ var AUTH_TYPES = {
244
244
  API_KEY: "api-key",
245
245
  JWT: "jwt",
246
246
  SERVICE_ACCOUNT: "service-account",
247
- PAT: "pat"
247
+ PAT: "pat",
248
+ USER_PASSWORD: "user-password"
248
249
  };
249
250
 
250
251
  // ../connectors/src/connectors/google-ads-oauth/tools/list-customers.ts
@@ -583,7 +584,7 @@ var tools = {
583
584
  var googleAdsOauthConnector = new ConnectorPlugin({
584
585
  slug: "google-ads",
585
586
  authType: AUTH_TYPES.OAUTH,
586
- name: "Google Ads (OAuth)",
587
+ name: "Google Ads",
587
588
  description: "Connect to Google Ads for advertising campaign data and reporting using OAuth.",
588
589
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/1NGvmgvCxX7Tn11EST2N3N/a745fe7c63d360ed40a27ddaad3af168/google-ads.svg",
589
590
  parameters,
@@ -772,6 +773,79 @@ function resolveEnvVarOptional(entry, key) {
772
773
  return process.env[envVarName] || void 0;
773
774
  }
774
775
 
776
+ // src/connector-client/proxy-fetch.ts
777
+ import { getContext } from "hono/context-storage";
778
+ import { getCookie } from "hono/cookie";
779
+ var APP_SESSION_COOKIE_NAME = "__Host-squadbase-session";
780
+ function createSandboxProxyFetch(connectionId) {
781
+ return async (input, init) => {
782
+ const token = process.env.INTERNAL_SQUADBASE_OAUTH_MACHINE_CREDENTIAL;
783
+ const sandboxId = process.env.INTERNAL_SQUADBASE_SANDBOX_ID;
784
+ if (!token || !sandboxId) {
785
+ throw new Error(
786
+ "Connection proxy is not configured. Please check your deployment settings."
787
+ );
788
+ }
789
+ const originalUrl = typeof input === "string" ? input : input instanceof URL ? input.href : input.url;
790
+ const originalMethod = init?.method ?? "GET";
791
+ const originalBody = init?.body ? JSON.parse(init.body) : void 0;
792
+ const baseDomain = process.env["SQUADBASE_PREVIEW_BASE_DOMAIN"] ?? "preview.app.squadbase.dev";
793
+ const proxyUrl = `https://${sandboxId}.${baseDomain}/_sqcore/connections/${connectionId}/request`;
794
+ return fetch(proxyUrl, {
795
+ method: "POST",
796
+ headers: {
797
+ "Content-Type": "application/json",
798
+ Authorization: `Bearer ${token}`
799
+ },
800
+ body: JSON.stringify({
801
+ url: originalUrl,
802
+ method: originalMethod,
803
+ body: originalBody
804
+ })
805
+ });
806
+ };
807
+ }
808
+ function createDeployedAppProxyFetch(connectionId) {
809
+ const projectId = process.env["SQUADBASE_PROJECT_ID"];
810
+ if (!projectId) {
811
+ throw new Error(
812
+ "Connection proxy is not configured. Please check your deployment settings."
813
+ );
814
+ }
815
+ const baseDomain = process.env["SQUADBASE_APP_BASE_DOMAIN"] ?? "squadbase.app";
816
+ const proxyUrl = `https://${projectId}.${baseDomain}/_sqcore/connections/${connectionId}/request`;
817
+ return async (input, init) => {
818
+ const originalUrl = typeof input === "string" ? input : input instanceof URL ? input.href : input.url;
819
+ const originalMethod = init?.method ?? "GET";
820
+ const originalBody = init?.body ? JSON.parse(init.body) : void 0;
821
+ const c = getContext();
822
+ const appSession = getCookie(c, APP_SESSION_COOKIE_NAME);
823
+ if (!appSession) {
824
+ throw new Error(
825
+ "No authentication method available for connection proxy."
826
+ );
827
+ }
828
+ return fetch(proxyUrl, {
829
+ method: "POST",
830
+ headers: {
831
+ "Content-Type": "application/json",
832
+ Authorization: `Bearer ${appSession}`
833
+ },
834
+ body: JSON.stringify({
835
+ url: originalUrl,
836
+ method: originalMethod,
837
+ body: originalBody
838
+ })
839
+ });
840
+ };
841
+ }
842
+ function createProxyFetch(connectionId) {
843
+ if (process.env.INTERNAL_SQUADBASE_SANDBOX_ID) {
844
+ return createSandboxProxyFetch(connectionId);
845
+ }
846
+ return createDeployedAppProxyFetch(connectionId);
847
+ }
848
+
775
849
  // src/connectors/create-connector-sdk.ts
776
850
  function loadConnectionsSync() {
777
851
  const filePath = process.env.CONNECTIONS_PATH ?? path.join(process.cwd(), ".squadbase/connections.json");
@@ -805,7 +879,7 @@ function createConnectorSdk(plugin, createClient2) {
805
879
  if (val !== void 0) params[param.slug] = val;
806
880
  }
807
881
  }
808
- return createClient2(params);
882
+ return createClient2(params, createProxyFetch(connectionId));
809
883
  };
810
884
  }
811
885
 
@@ -0,0 +1,5 @@
1
+ import * as _squadbase_connectors_sdk from '@squadbase/connectors/sdk';
2
+
3
+ declare const connection: (connectionId: string) => _squadbase_connectors_sdk.GoogleAdsServiceAccountConnectorSdk;
4
+
5
+ export { connection };