@squadbase/vite-server 0.1.4-dev.1 → 0.1.5-dev.0

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 CHANGED
@@ -18864,14 +18864,14 @@ var init_NormalizedSchema = __esm({
18864
18864
  throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");
18865
18865
  }
18866
18866
  const struct = this.getSchema();
18867
- const z78 = struct[4].length;
18867
+ const z79 = struct[4].length;
18868
18868
  let it = struct[anno.it];
18869
- if (it && z78 === it.length) {
18869
+ if (it && z79 === it.length) {
18870
18870
  yield* it;
18871
18871
  return;
18872
18872
  }
18873
- it = Array(z78);
18874
- for (let i6 = 0; i6 < z78; ++i6) {
18873
+ it = Array(z79);
18874
+ for (let i6 = 0; i6 < z79; ++i6) {
18875
18875
  const k6 = struct[4][i6];
18876
18876
  const v7 = member([struct[5][i6], 0], k6);
18877
18877
  yield it[i6] = [k6, v7];
@@ -19547,12 +19547,12 @@ var init_split_header = __esm({
19547
19547
  "../../node_modules/@smithy/core/dist-es/submodules/serde/split-header.js"() {
19548
19548
  "use strict";
19549
19549
  splitHeader = (value) => {
19550
- const z78 = value.length;
19550
+ const z79 = value.length;
19551
19551
  const values = [];
19552
19552
  let withinQuotes = false;
19553
19553
  let prevChar = void 0;
19554
19554
  let anchor = 0;
19555
- for (let i6 = 0; i6 < z78; ++i6) {
19555
+ for (let i6 = 0; i6 < z79; ++i6) {
19556
19556
  const char = value[i6];
19557
19557
  switch (char) {
19558
19558
  case `"`:
@@ -19573,12 +19573,12 @@ var init_split_header = __esm({
19573
19573
  values.push(value.slice(anchor));
19574
19574
  return values.map((v7) => {
19575
19575
  v7 = v7.trim();
19576
- const z79 = v7.length;
19577
- if (z79 < 2) {
19576
+ const z80 = v7.length;
19577
+ if (z80 < 2) {
19578
19578
  return v7;
19579
19579
  }
19580
- if (v7[0] === `"` && v7[z79 - 1] === `"`) {
19581
- v7 = v7.slice(1, z79 - 1);
19580
+ if (v7[0] === `"` && v7[z80 - 1] === `"`) {
19581
+ v7 = v7.slice(1, z80 - 1);
19582
19582
  }
19583
19583
  return v7.replace(/\\"/g, '"');
19584
19584
  });
@@ -20976,11 +20976,11 @@ var init_EndpointCache = __esm({
20976
20976
  }
20977
20977
  hash(endpointParams) {
20978
20978
  let buffer = "";
20979
- const { parameters: parameters62 } = this;
20980
- if (parameters62.length === 0) {
20979
+ const { parameters: parameters63 } = this;
20980
+ if (parameters63.length === 0) {
20981
20981
  return false;
20982
20982
  }
20983
- for (const param of parameters62) {
20983
+ for (const param of parameters63) {
20984
20984
  const val = String(endpointParams[param] ?? "");
20985
20985
  if (val.includes("|;")) {
20986
20986
  return false;
@@ -21697,15 +21697,15 @@ var init_resolveEndpoint = __esm({
21697
21697
  init_utils();
21698
21698
  resolveEndpoint = (ruleSetObject, options) => {
21699
21699
  const { endpointParams, logger: logger2 } = options;
21700
- const { parameters: parameters62, rules } = ruleSetObject;
21700
+ const { parameters: parameters63, rules } = ruleSetObject;
21701
21701
  options.logger?.debug?.(`${debugId} Initial EndpointParams: ${toDebugString(endpointParams)}`);
21702
- const paramsWithDefault = Object.entries(parameters62).filter(([, v7]) => v7.default != null).map(([k6, v7]) => [k6, v7.default]);
21702
+ const paramsWithDefault = Object.entries(parameters63).filter(([, v7]) => v7.default != null).map(([k6, v7]) => [k6, v7.default]);
21703
21703
  if (paramsWithDefault.length > 0) {
21704
21704
  for (const [paramKey, paramDefaultValue] of paramsWithDefault) {
21705
21705
  endpointParams[paramKey] = endpointParams[paramKey] ?? paramDefaultValue;
21706
21706
  }
21707
21707
  }
21708
- const requiredParams = Object.entries(parameters62).filter(([, v7]) => v7.required).map(([k6]) => k6);
21708
+ const requiredParams = Object.entries(parameters63).filter(([, v7]) => v7.required).map(([k6]) => k6);
21709
21709
  for (const requiredParam of requiredParams) {
21710
21710
  if (endpointParams[requiredParam] == null) {
21711
21711
  throw new EndpointError(`Missing required parameter: '${requiredParam}'`);
@@ -27315,8 +27315,8 @@ var init_ProtocolLib = __esm({
27315
27315
  constructor(queryCompat = false) {
27316
27316
  this.queryCompat = queryCompat;
27317
27317
  }
27318
- resolveRestContentType(defaultContentType, inputSchema75) {
27319
- const members = inputSchema75.getMemberSchemas();
27318
+ resolveRestContentType(defaultContentType, inputSchema76) {
27319
+ const members = inputSchema76.getMemberSchemas();
27320
27320
  const httpPayloadMember = Object.values(members).find((m6) => {
27321
27321
  return !!m6.getMergedTraits().httpPayload;
27322
27322
  });
@@ -27331,7 +27331,7 @@ var init_ProtocolLib = __esm({
27331
27331
  } else {
27332
27332
  return defaultContentType;
27333
27333
  }
27334
- } else if (!inputSchema75.isUnitSchema()) {
27334
+ } else if (!inputSchema76.isUnitSchema()) {
27335
27335
  const hasBody = Object.values(members).find((m6) => {
27336
27336
  const { httpQuery, httpQueryParams, httpHeader, httpLabel, httpPrefixHeaders } = m6.getMergedTraits();
27337
27337
  const noPrefixHeaders = httpPrefixHeaders === void 0;
@@ -28174,9 +28174,9 @@ var init_AwsRestJsonProtocol = __esm({
28174
28174
  }
28175
28175
  async serializeRequest(operationSchema, input, context) {
28176
28176
  const request2 = await super.serializeRequest(operationSchema, input, context);
28177
- const inputSchema75 = NormalizedSchema.of(operationSchema.input);
28177
+ const inputSchema76 = NormalizedSchema.of(operationSchema.input);
28178
28178
  if (!request2.headers["content-type"]) {
28179
- const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema75);
28179
+ const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema76);
28180
28180
  if (contentType) {
28181
28181
  request2.headers["content-type"] = contentType;
28182
28182
  }
@@ -28188,8 +28188,8 @@ var init_AwsRestJsonProtocol = __esm({
28188
28188
  }
28189
28189
  async deserializeResponse(operationSchema, context, response) {
28190
28190
  const output = await super.deserializeResponse(operationSchema, context, response);
28191
- const outputSchema75 = NormalizedSchema.of(operationSchema.output);
28192
- for (const [name, member2] of outputSchema75.structIterator()) {
28191
+ const outputSchema76 = NormalizedSchema.of(operationSchema.output);
28192
+ for (const [name, member2] of outputSchema76.structIterator()) {
28193
28193
  if (member2.getMemberTraits().httpPayload && !(name in output)) {
28194
28194
  output[name] = null;
28195
28195
  }
@@ -32053,22 +32053,22 @@ var init_loadCognitoIdentity = __esm({
32053
32053
  });
32054
32054
 
32055
32055
  // ../../node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/fromCognitoIdentity.js
32056
- function fromCognitoIdentity(parameters62) {
32056
+ function fromCognitoIdentity(parameters63) {
32057
32057
  return async (awsIdentityProperties) => {
32058
- parameters62.logger?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");
32058
+ parameters63.logger?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");
32059
32059
  const { GetCredentialsForIdentityCommand: GetCredentialsForIdentityCommand2, CognitoIdentityClient: CognitoIdentityClient2 } = await Promise.resolve().then(() => (init_loadCognitoIdentity(), loadCognitoIdentity_exports));
32060
- const fromConfigs = (property) => parameters62.clientConfig?.[property] ?? parameters62.parentClientConfig?.[property] ?? awsIdentityProperties?.callerClientConfig?.[property];
32061
- const { Credentials: { AccessKeyId = throwOnMissingAccessKeyId(parameters62.logger), Expiration, SecretKey = throwOnMissingSecretKey(parameters62.logger), SessionToken } = throwOnMissingCredentials(parameters62.logger) } = await (parameters62.client ?? new CognitoIdentityClient2(Object.assign({}, parameters62.clientConfig ?? {}, {
32060
+ const fromConfigs = (property) => parameters63.clientConfig?.[property] ?? parameters63.parentClientConfig?.[property] ?? awsIdentityProperties?.callerClientConfig?.[property];
32061
+ const { Credentials: { AccessKeyId = throwOnMissingAccessKeyId(parameters63.logger), Expiration, SecretKey = throwOnMissingSecretKey(parameters63.logger), SessionToken } = throwOnMissingCredentials(parameters63.logger) } = await (parameters63.client ?? new CognitoIdentityClient2(Object.assign({}, parameters63.clientConfig ?? {}, {
32062
32062
  region: fromConfigs("region"),
32063
32063
  profile: fromConfigs("profile"),
32064
32064
  userAgentAppId: fromConfigs("userAgentAppId")
32065
32065
  }))).send(new GetCredentialsForIdentityCommand2({
32066
- CustomRoleArn: parameters62.customRoleArn,
32067
- IdentityId: parameters62.identityId,
32068
- Logins: parameters62.logins ? await resolveLogins(parameters62.logins) : void 0
32066
+ CustomRoleArn: parameters63.customRoleArn,
32067
+ IdentityId: parameters63.identityId,
32068
+ Logins: parameters63.logins ? await resolveLogins(parameters63.logins) : void 0
32069
32069
  }));
32070
32070
  return {
32071
- identityId: parameters62.identityId,
32071
+ identityId: parameters63.identityId,
32072
32072
  accessKeyId: AccessKeyId,
32073
32073
  secretAccessKey: SecretKey,
32074
32074
  sessionToken: SessionToken,
@@ -44629,11 +44629,11 @@ var require_bignumber = __commonJS({
44629
44629
  return n6 > 0 || n6 === i6 ? i6 : i6 - 1;
44630
44630
  }
44631
44631
  function coeffToString(a6) {
44632
- var s6, z78, i6 = 1, j6 = a6.length, r6 = a6[0] + "";
44632
+ var s6, z79, i6 = 1, j6 = a6.length, r6 = a6[0] + "";
44633
44633
  for (; i6 < j6; ) {
44634
44634
  s6 = a6[i6++] + "";
44635
- z78 = LOG_BASE - s6.length;
44636
- for (; z78--; s6 = "0" + s6) ;
44635
+ z79 = LOG_BASE - s6.length;
44636
+ for (; z79--; s6 = "0" + s6) ;
44637
44637
  r6 += s6;
44638
44638
  }
44639
44639
  for (j6 = r6.length; r6.charCodeAt(--j6) === 48; ) ;
@@ -44666,15 +44666,15 @@ var require_bignumber = __commonJS({
44666
44666
  function toExponential(str, e6) {
44667
44667
  return (str.length > 1 ? str.charAt(0) + "." + str.slice(1) : str) + (e6 < 0 ? "e" : "e+") + e6;
44668
44668
  }
44669
- function toFixedPoint(str, e6, z78) {
44669
+ function toFixedPoint(str, e6, z79) {
44670
44670
  var len, zs;
44671
44671
  if (e6 < 0) {
44672
- for (zs = z78 + "."; ++e6; zs += z78) ;
44672
+ for (zs = z79 + "."; ++e6; zs += z79) ;
44673
44673
  str = zs + str;
44674
44674
  } else {
44675
44675
  len = str.length;
44676
44676
  if (++e6 > len) {
44677
- for (zs = z78, e6 -= len; --e6; zs += z78) ;
44677
+ for (zs = z79, e6 -= len; --e6; zs += z79) ;
44678
44678
  str += zs;
44679
44679
  } else if (e6 < len) {
44680
44680
  str = str.slice(0, e6) + "." + str.slice(e6);
@@ -72164,7 +72164,9 @@ Authentication is handled automatically via OAuth proxy.`,
72164
72164
  });
72165
72165
  const data = await response.json();
72166
72166
  if (!response.ok) {
72167
- const errorMessage = typeof data?.error === "string" ? data.error : typeof data?.message === "string" ? data.message : `HTTP ${response.status} ${response.statusText}`;
72167
+ const googleError = data?.error && typeof data.error === "object" ? data.error : null;
72168
+ const googleErrorMessage = googleError && typeof googleError.message === "string" ? googleError.status && typeof googleError.status === "string" ? `${googleError.status}: ${googleError.message}` : googleError.message : null;
72169
+ const errorMessage = googleErrorMessage ?? (typeof data?.error === "string" ? data.error : typeof data?.message === "string" ? data.message : `HTTP ${response.status} ${response.statusText}`);
72168
72170
  return { success: false, error: errorMessage };
72169
72171
  }
72170
72172
  return { success: true, status: response.status, data };
@@ -74152,7 +74154,7 @@ var stripeApiKeyConnector = new ConnectorPlugin({
74152
74154
  description: "Connect to Stripe for payment, customer, and subscription data using a Secret API Key or Restricted API Key.",
74153
74155
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/2QNK0u2doqp41uL0POS4Ks/7a92367e2388ec77c7f4ada143606f9a/stripe.jpeg",
74154
74156
  parameters: parameters22,
74155
- releaseFlag: { dev1: true, dev2: false, prod: false },
74157
+ releaseFlag: { dev1: true, dev2: true, prod: true },
74156
74158
  onboarding: stripeApiKeyOnboarding,
74157
74159
  systemPrompt: {
74158
74160
  en: `### Tools
@@ -75043,7 +75045,7 @@ var kintoneApiTokenConnector = new ConnectorPlugin({
75043
75045
  description: "Connect to kintone for business application data retrieval and analytics using API token authentication.",
75044
75046
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/76nPGMJFZkMFE3UQNo2JFy/e71dc5f5d5cec1306ce0e17aafbfd9f0/kintone.png",
75045
75047
  parameters: parameters25,
75046
- releaseFlag: { dev1: true, dev2: false, prod: false },
75048
+ releaseFlag: { dev1: true, dev2: true, prod: true },
75047
75049
  onboarding: kintoneApiTokenOnboarding,
75048
75050
  systemPrompt: {
75049
75051
  en: `### Tools
@@ -76381,7 +76383,7 @@ var amplitudeConnector = new ConnectorPlugin({
76381
76383
  description: "Connect to Amplitude for product analytics and user behavior data.",
76382
76384
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/2UBJSdRlFJaLq52WUCTBEB/308b59b374cf6c662ac70989860bffd7/amplitude-icon.svg",
76383
76385
  parameters: parameters32,
76384
- releaseFlag: { dev1: true, dev2: false, prod: false },
76386
+ releaseFlag: { dev1: true, dev2: true, prod: true },
76385
76387
  onboarding: amplitudeOnboarding,
76386
76388
  systemPrompt: {
76387
76389
  en: `### Tools
@@ -76634,7 +76636,7 @@ var attioConnector = new ConnectorPlugin({
76634
76636
  description: "Connect to Attio for CRM data and relationship intelligence.",
76635
76637
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/2qqx99vvXJojUM3tSrSWPX/1e7c35e13da6b365b8b475c1effe568f/attio.svg",
76636
76638
  parameters: parameters33,
76637
- releaseFlag: { dev1: true, dev2: false, prod: false },
76639
+ releaseFlag: { dev1: true, dev2: true, prod: true },
76638
76640
  onboarding: attioOnboarding,
76639
76641
  systemPrompt: {
76640
76642
  en: `### Tools
@@ -77651,7 +77653,7 @@ var hubspotConnector = new ConnectorPlugin({
77651
77653
  description: "Connect to HubSpot CRM for contacts, deals, companies, and marketing data using a Personal Access Key.",
77652
77654
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/5UcSkKkzhUMA4RsM45ynuo/43b967e36915ca0fc5d277684b204320/hubspot.svg",
77653
77655
  parameters: parameters36,
77654
- releaseFlag: { dev1: true, dev2: false, prod: false },
77656
+ releaseFlag: { dev1: true, dev2: true, prod: true },
77655
77657
  onboarding: hubspotOnboarding2,
77656
77658
  systemPrompt: {
77657
77659
  en: `### Tools
@@ -77919,7 +77921,7 @@ var jiraConnector = new ConnectorPlugin({
77919
77921
  description: "Connect to Jira Cloud for issue tracking, project management, and workflow data retrieval using API token authentication.",
77920
77922
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/5zt4yjb36szSPPkCECYlPL/bc3e7223dc84fb16a1cce53a80f5afcc/jira.png",
77921
77923
  parameters: parameters37,
77922
- releaseFlag: { dev1: true, dev2: false, prod: false },
77924
+ releaseFlag: { dev1: true, dev2: true, prod: true },
77923
77925
  onboarding: jiraOnboarding,
77924
77926
  systemPrompt: {
77925
77927
  en: `### Tools
@@ -78194,7 +78196,7 @@ var linearConnector = new ConnectorPlugin({
78194
78196
  description: "Connect to Linear for project management data \u2014 issues, projects, teams, cycles, and more.",
78195
78197
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6oR77h6TeniXGdmnp2P2LX/a2ac8630ae52d164363adb0c695d9f0b/linear.webp",
78196
78198
  parameters: parameters38,
78197
- releaseFlag: { dev1: true, dev2: false, prod: false },
78199
+ releaseFlag: { dev1: true, dev2: true, prod: true },
78198
78200
  onboarding: linearOnboarding,
78199
78201
  systemPrompt: {
78200
78202
  en: `### Tools
@@ -78456,7 +78458,7 @@ var asanaConnector = new ConnectorPlugin({
78456
78458
  description: "Connect to Asana for project management, task tracking, and team collaboration data.",
78457
78459
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/3eIdaoqzIIZs2Md0OoDJMf/2fa66e0841adb985da4d3120466f3ec4/asana-icon.png",
78458
78460
  parameters: parameters39,
78459
- releaseFlag: { dev1: true, dev2: false, prod: false },
78461
+ releaseFlag: { dev1: true, dev2: true, prod: true },
78460
78462
  onboarding: asanaOnboarding,
78461
78463
  systemPrompt: {
78462
78464
  en: `### Tools
@@ -78781,7 +78783,7 @@ var clickhouseConnector = new ConnectorPlugin({
78781
78783
  description: "Connect to ClickHouse for high-performance columnar analytics and real-time data processing.",
78782
78784
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/MencimqP92UmucqstLl51/d9f2b6160206f5454b26e223a763ab8f/clickhouse.png",
78783
78785
  parameters: parameters40,
78784
- releaseFlag: { dev1: true, dev2: false, prod: false },
78786
+ releaseFlag: { dev1: true, dev2: true, prod: true },
78785
78787
  onboarding: clickhouseOnboarding,
78786
78788
  systemPrompt: {
78787
78789
  en: `### Tools
@@ -79189,7 +79191,7 @@ var mongodbConnector = new ConnectorPlugin({
79189
79191
  description: "Connect to MongoDB for document-oriented data storage and querying.",
79190
79192
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/48JSUx9HE6oSa9JrHGg2E1/12b4cac65924cac3641d4bafcef37dbe/mongodb-icon.webp",
79191
79193
  parameters: parameters41,
79192
- releaseFlag: { dev1: true, dev2: false, prod: false },
79194
+ releaseFlag: { dev1: true, dev2: true, prod: true },
79193
79195
  onboarding: mongodbOnboarding,
79194
79196
  systemPrompt: {
79195
79197
  en: `### Tools
@@ -79373,7 +79375,7 @@ var notionConnector = new ConnectorPlugin({
79373
79375
  description: "Connect to Notion to query databases, pages, and workspace content using an Internal Integration Token.",
79374
79376
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/797V5GDDTA8bsfKUHBCoQO/290ec49b70b68ddb4acd3bf0a6ab8bda/notion-icon.webp",
79375
79377
  parameters: parameters42,
79376
- releaseFlag: { dev1: true, dev2: false, prod: false },
79378
+ releaseFlag: { dev1: true, dev2: true, prod: true },
79377
79379
  onboarding: notionOnboarding,
79378
79380
  systemPrompt: {
79379
79381
  en: `### Tools
@@ -79689,7 +79691,7 @@ var notionOauthConnector = new ConnectorPlugin({
79689
79691
  description: "Connect to Notion to query databases, pages, and workspace content using OAuth.",
79690
79692
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/797V5GDDTA8bsfKUHBCoQO/290ec49b70b68ddb4acd3bf0a6ab8bda/notion-icon.webp",
79691
79693
  parameters: parameters43,
79692
- releaseFlag: { dev1: true, dev2: false, prod: false },
79694
+ releaseFlag: { dev1: true, dev2: true, prod: true },
79693
79695
  onboarding: notionOauthOnboarding,
79694
79696
  proxyPolicy: {
79695
79697
  allowlist: [
@@ -81302,7 +81304,7 @@ var mailchimpConnector = new ConnectorPlugin({
81302
81304
  description: "Connect to Mailchimp for email marketing, audiences, campaigns, and analytics.",
81303
81305
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/19Rac6B8eGiLpQb4lKMbG3/10f567f85572aeb16f2ee6aaa6602987/mailchimp.png",
81304
81306
  parameters: parameters47,
81305
- releaseFlag: { dev1: true, dev2: false, prod: false },
81307
+ releaseFlag: { dev1: true, dev2: true, prod: true },
81306
81308
  onboarding: mailchimpOnboarding,
81307
81309
  systemPrompt: {
81308
81310
  en: `### Tools
@@ -81948,7 +81950,7 @@ var customerioConnector = new ConnectorPlugin({
81948
81950
  description: "Connect to Customer.io App API for reading customer data, managing campaigns, segments, and sending transactional messages.",
81949
81951
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/nngohabT7oHDIgQYAVBpz/6f6c7662ef4692eb9869e3e69dd57114/customerio.png",
81950
81952
  parameters: parameters49,
81951
- releaseFlag: { dev1: true, dev2: false, prod: false },
81953
+ releaseFlag: { dev1: true, dev2: true, prod: true },
81952
81954
  onboarding: customerioOnboarding,
81953
81955
  systemPrompt: {
81954
81956
  en: `### Tools
@@ -82324,7 +82326,7 @@ var gmailConnector = new ConnectorPlugin({
82324
82326
  description: "Connect to Gmail for email data access using a service account with domain-wide delegation. Read-only access to messages, threads, and labels.",
82325
82327
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/4V3rfaSc1ksFIt2eHBNIwJ/7f3be41a154a6d96dcf229ed0e5858c9/Gmail_icon__2020_.svg.png",
82326
82328
  parameters: parameters50,
82327
- releaseFlag: { dev1: true, dev2: false, prod: false },
82329
+ releaseFlag: { dev1: true, dev2: true, prod: true },
82328
82330
  onboarding: gmailOnboarding,
82329
82331
  systemPrompt: {
82330
82332
  en: `### Tools
@@ -83593,7 +83595,7 @@ var zendeskConnector = new ConnectorPlugin({
83593
83595
  description: "Connect to Zendesk Support for tickets, users, organizations, and customer service data using an API token.",
83594
83596
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/7e9Q7PwV6MJRJMj543m2gl/55385fae903ccfa1599e35be9d3516aa/zendesk-icon.svg",
83595
83597
  parameters: parameters53,
83596
- releaseFlag: { dev1: true, dev2: false, prod: false },
83598
+ releaseFlag: { dev1: true, dev2: true, prod: true },
83597
83599
  onboarding: zendeskOnboarding,
83598
83600
  systemPrompt: {
83599
83601
  en: `### Tools
@@ -84216,7 +84218,7 @@ var intercomConnector = new ConnectorPlugin({
84216
84218
  description: "Connect to Intercom for contacts, conversations, companies, and customer engagement data using an Access Token.",
84217
84219
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/sb2cRMGClpId0LKiSqsok/ae90a0849f21ffe3faf73e04a5676b45/intercom.svg",
84218
84220
  parameters: parameters55,
84219
- releaseFlag: { dev1: true, dev2: false, prod: false },
84221
+ releaseFlag: { dev1: true, dev2: true, prod: true },
84220
84222
  onboarding: intercomOnboarding,
84221
84223
  systemPrompt: {
84222
84224
  en: `### Tools
@@ -84936,7 +84938,7 @@ var mixpanelConnector = new ConnectorPlugin({
84936
84938
  description: "Connect to Mixpanel for product analytics, event tracking, and user behavior analysis.",
84937
84939
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/7ykz0vNRjMqvTVrxS8wsj1/b2cd795be5b373877dee77cc6147c758/images__3_.png",
84938
84940
  parameters: parameters57,
84939
- releaseFlag: { dev1: true, dev2: false, prod: false },
84941
+ releaseFlag: { dev1: true, dev2: true, prod: true },
84940
84942
  onboarding: mixpanelOnboarding,
84941
84943
  systemPrompt: {
84942
84944
  en: `### Tools
@@ -85431,7 +85433,7 @@ var backlogConnector = new ConnectorPlugin({
85431
85433
  description: "Connect to Nulab Backlog for project management, issue tracking, and wiki data retrieval using API key authentication.",
85432
85434
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6KcVBGf3mUHnuCOQgQMvtT/e8558c7990e40e3be46948e9476190fb/backlog-favicon.svg",
85433
85435
  parameters: parameters59,
85434
- releaseFlag: { dev1: true, dev2: true, prod: false },
85436
+ releaseFlag: { dev1: true, dev2: true, prod: true },
85435
85437
  onboarding: backlogOnboarding,
85436
85438
  systemPrompt: {
85437
85439
  en: `### Tools
@@ -85869,7 +85871,7 @@ var gammaConnector = new ConnectorPlugin({
85869
85871
  description: "Connect to Gamma for AI-powered presentation, document, webpage, and social post generation.",
85870
85872
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/KoMGPpPcgtB9oDYe1OBjS/1ba7eb061c4497106bf6d249866dc471/gamma.svg",
85871
85873
  parameters: parameters60,
85872
- releaseFlag: { dev1: true, dev2: false, prod: false },
85874
+ releaseFlag: { dev1: true, dev2: true, prod: true },
85873
85875
  onboarding: gammaOnboarding,
85874
85876
  systemPrompt: {
85875
85877
  en: `### Tools
@@ -86149,7 +86151,7 @@ var sentryConnector = new ConnectorPlugin({
86149
86151
  description: "Connect to Sentry for error tracking and performance monitoring data.",
86150
86152
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/4B8ZEGFGjTeMWNnXQb1dAL/ac10f813f02353f5b0cbe64fb5c06d8f/sentry.svg",
86151
86153
  parameters: parameters61,
86152
- releaseFlag: { dev1: true, dev2: false, prod: false },
86154
+ releaseFlag: { dev1: true, dev2: true, prod: true },
86153
86155
  onboarding: sentryOnboarding,
86154
86156
  systemPrompt: {
86155
86157
  en: `### Tools
@@ -86353,6 +86355,389 @@ await sentry.updateIssue("12345", { status: "resolved" });
86353
86355
  }
86354
86356
  });
86355
86357
 
86358
+ // ../connectors/src/connectors/salesforce/setup.ts
86359
+ var salesforceOnboarding = new ConnectorOnboarding({
86360
+ connectionSetupInstructions: {
86361
+ en: `#### Create a Connected App in Salesforce
86362
+ 1. In Salesforce Setup, go to App Manager \u2192 New Connected App
86363
+ 2. Under API (Enable OAuth Settings), check "Enable OAuth Settings"
86364
+ 3. Add OAuth scopes: "Manage user data via APIs (api)" and "Perform requests at any time (refresh_token, offline_access)"
86365
+ 4. Save and note the Consumer Key (client_id) and Consumer Secret (client_secret)
86366
+
86367
+ #### Allow Username-Password Flow
86368
+ 1. Go to Setup \u2192 Identity \u2192 OAuth and OpenID Connect Settings
86369
+ 2. Enable "Allow OAuth Username-Password Flows"
86370
+
86371
+ #### Reset your Security Token
86372
+ 1. Go to Settings \u2192 My Personal Information \u2192 Reset My Security Token
86373
+ 2. Salesforce emails you a new security token \u2014 append it to your password when entering the Password parameter (password + securityToken)
86374
+
86375
+ #### Sandbox vs Production
86376
+ - Leave Use Sandbox as "false" (or empty) to connect to production (login.salesforce.com)
86377
+ - Set Use Sandbox to "true" to connect to a sandbox (test.salesforce.com)`,
86378
+ ja: `#### Salesforce \u3067 Connected App \u3092\u4F5C\u6210
86379
+ 1. Setup \u2192 App Manager \u2192 New Connected App
86380
+ 2. API (Enable OAuth Settings) \u30BB\u30AF\u30B7\u30E7\u30F3\u3067 "Enable OAuth Settings" \u3092\u6709\u52B9\u5316
86381
+ 3. OAuth \u30B9\u30B3\u30FC\u30D7\u306B "Manage user data via APIs (api)" \u3068 "Perform requests at any time (refresh_token, offline_access)" \u3092\u8FFD\u52A0
86382
+ 4. \u4FDD\u5B58\u5F8C\u3001Consumer Key (client_id) \u3068 Consumer Secret (client_secret) \u3092\u63A7\u3048\u308B
86383
+
86384
+ #### Username-Password Flow \u3092\u8A31\u53EF
86385
+ 1. Setup \u2192 Identity \u2192 OAuth and OpenID Connect Settings
86386
+ 2. "Allow OAuth Username-Password Flows" \u3092\u6709\u52B9\u5316
86387
+
86388
+ #### Security Token \u306E\u767A\u884C
86389
+ 1. \u500B\u4EBA\u8A2D\u5B9A \u2192 My Personal Information \u2192 Reset My Security Token
86390
+ 2. Salesforce \u304B\u3089\u9001\u3089\u308C\u308B\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u30C8\u30FC\u30AF\u30F3\u3092\u30D1\u30B9\u30EF\u30FC\u30C9\u306B\u9023\u7D50\u3057\u3066\u5165\u529B\uFF08password + securityToken\uFF09
86391
+
86392
+ #### Sandbox / Production
86393
+ - \u672C\u756A (login.salesforce.com) \u306E\u5834\u5408: Use Sandbox \u3092 "false" \u307E\u305F\u306F\u672A\u5165\u529B
86394
+ - Sandbox (test.salesforce.com) \u306E\u5834\u5408: Use Sandbox \u3092 "true" \u306B\u8A2D\u5B9A`
86395
+ },
86396
+ dataOverviewInstructions: {
86397
+ en: `1. Call salesforce_request with GET /services/data/v60.0/sobjects/ to list available sObjects (standard + custom)
86398
+ 2. Call salesforce_request with GET /services/data/v60.0/sobjects/Account/describe to inspect Account fields; repeat for Contact, Opportunity, Lead as needed
86399
+ 3. Run a sample SOQL query: GET /services/data/v60.0/query?q=SELECT+Id,Name,Industry+FROM+Account+LIMIT+5 to verify access and explore data`,
86400
+ ja: `1. salesforce_request \u3067 GET /services/data/v60.0/sobjects/ \u3092\u547C\u3073\u51FA\u3057\u3001\u5229\u7528\u53EF\u80FD\u306A sObject\uFF08\u6A19\u6E96 + \u30AB\u30B9\u30BF\u30E0\uFF09\u3092\u4E00\u89A7\u53D6\u5F97
86401
+ 2. salesforce_request \u3067 GET /services/data/v60.0/sobjects/Account/describe \u3092\u547C\u3073\u51FA\u3057 Account \u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u78BA\u8A8D\u3002Contact / Opportunity / Lead \u306A\u3069\u5FC5\u8981\u306A sObject \u306B\u5BFE\u3057\u3066\u540C\u69D8\u306B\u5B9F\u884C
86402
+ 3. \u30B5\u30F3\u30D7\u30EB SOQL \u3092\u5B9F\u884C: GET /services/data/v60.0/query?q=SELECT+Id,Name,Industry+FROM+Account+LIMIT+5 \u3067\u30A2\u30AF\u30BB\u30B9\u53EF\u5426\u3068\u30C7\u30FC\u30BF\u69CB\u9020\u3092\u78BA\u8A8D`
86403
+ }
86404
+ });
86405
+
86406
+ // ../connectors/src/connectors/salesforce/parameters.ts
86407
+ var parameters62 = {
86408
+ username: new ParameterDefinition({
86409
+ slug: "username",
86410
+ name: "Username",
86411
+ description: "Your Salesforce account username (the email you use to sign in).",
86412
+ envVarBaseKey: "SALESFORCE_USERNAME",
86413
+ type: "text",
86414
+ secret: false,
86415
+ required: true
86416
+ }),
86417
+ password: new ParameterDefinition({
86418
+ slug: "password",
86419
+ name: "Password",
86420
+ description: "Your Salesforce account password concatenated with your security token (password + securityToken). The security token is emailed to you when you reset it from Settings \u2192 My Personal Information \u2192 Reset My Security Token.",
86421
+ envVarBaseKey: "SALESFORCE_PASSWORD",
86422
+ type: "text",
86423
+ secret: true,
86424
+ required: true
86425
+ }),
86426
+ clientId: new ParameterDefinition({
86427
+ slug: "client-id",
86428
+ name: "Consumer Key",
86429
+ description: "The Consumer Key (client_id) of your Salesforce Connected App. Enable OAuth Settings and 'Allow OAuth Username-Password Flows' in your org's identity settings.",
86430
+ envVarBaseKey: "SALESFORCE_CLIENT_ID",
86431
+ type: "text",
86432
+ secret: false,
86433
+ required: true
86434
+ }),
86435
+ clientSecret: new ParameterDefinition({
86436
+ slug: "client-secret",
86437
+ name: "Consumer Secret",
86438
+ description: "The Consumer Secret (client_secret) of your Salesforce Connected App.",
86439
+ envVarBaseKey: "SALESFORCE_CLIENT_SECRET",
86440
+ type: "text",
86441
+ secret: true,
86442
+ required: true
86443
+ }),
86444
+ isSandbox: new ParameterDefinition({
86445
+ slug: "is-sandbox",
86446
+ name: "Use Sandbox",
86447
+ description: 'Set to "true" to authenticate against a Salesforce sandbox (test.salesforce.com) instead of production (login.salesforce.com). Defaults to "false".',
86448
+ envVarBaseKey: "SALESFORCE_IS_SANDBOX",
86449
+ type: "text",
86450
+ secret: false,
86451
+ required: false
86452
+ })
86453
+ };
86454
+
86455
+ // ../connectors/src/connectors/salesforce/tools/request.ts
86456
+ import { z as z77 } from "zod";
86457
+ var REQUEST_TIMEOUT_MS59 = 6e4;
86458
+ var inputSchema75 = z77.object({
86459
+ toolUseIntent: z77.string().optional().describe(
86460
+ "Brief description of what you intend to accomplish with this tool call"
86461
+ ),
86462
+ connectionId: z77.string().describe("ID of the Salesforce connection to use"),
86463
+ method: z77.enum(["GET", "POST", "PATCH", "DELETE"]).describe(
86464
+ "HTTP method. GET for reading resources and SOQL queries, POST for creating, PATCH for updating, DELETE for removing."
86465
+ ),
86466
+ path: z77.string().describe(
86467
+ "API path appended to the instance URL (e.g., '/services/data/v60.0/sobjects/Account', '/services/data/v60.0/query?q=SELECT+Id,Name+FROM+Account+LIMIT+5'). Always start the path with '/services/data/'."
86468
+ ),
86469
+ body: z77.record(z77.string(), z77.unknown()).optional().describe("Request body (JSON) for POST/PATCH requests")
86470
+ });
86471
+ var outputSchema75 = z77.discriminatedUnion("success", [
86472
+ z77.object({
86473
+ success: z77.literal(true),
86474
+ status: z77.number(),
86475
+ data: z77.record(z77.string(), z77.unknown())
86476
+ }),
86477
+ z77.object({
86478
+ success: z77.literal(false),
86479
+ error: z77.string()
86480
+ })
86481
+ ]);
86482
+ var requestTool47 = new ConnectorTool({
86483
+ name: "request",
86484
+ description: `Send authenticated requests to the Salesforce REST API.
86485
+ Authentication is handled automatically using the OAuth 2.0 username-password flow (Connected App Consumer Key + Secret with the Salesforce account credentials). An access token and instance URL are obtained on each request, so the tool user only provides the API path.
86486
+ Use this tool for all Salesforce interactions: describing sObjects, running SOQL queries (GET /services/data/vXX.X/query?q=...), reading/creating/updating standard (Account, Contact, Opportunity, Lead, Case) and custom objects.
86487
+ Prefer SOQL via the /query endpoint for filtered, joined, or aggregated reads rather than paginating /sobjects/{Type} endpoints.`,
86488
+ inputSchema: inputSchema75,
86489
+ outputSchema: outputSchema75,
86490
+ async execute({ connectionId, method, path: path5, body }, connections) {
86491
+ const connection = connections.find((c6) => c6.id === connectionId);
86492
+ if (!connection) {
86493
+ return {
86494
+ success: false,
86495
+ error: `Connection ${connectionId} not found`
86496
+ };
86497
+ }
86498
+ console.log(
86499
+ `[connector-request] salesforce/${connection.name}: ${method} ${path5}`
86500
+ );
86501
+ try {
86502
+ const username = parameters62.username.getValue(connection);
86503
+ const password = parameters62.password.getValue(connection);
86504
+ const clientId = parameters62.clientId.getValue(connection);
86505
+ const clientSecret = parameters62.clientSecret.getValue(connection);
86506
+ const isSandbox = parameters62.isSandbox.tryGetValue(connection)?.toLowerCase() === "true";
86507
+ const loginHost = isSandbox ? "https://test.salesforce.com" : "https://login.salesforce.com";
86508
+ const tokenBody = new URLSearchParams({
86509
+ grant_type: "password",
86510
+ client_id: clientId,
86511
+ client_secret: clientSecret,
86512
+ username,
86513
+ password
86514
+ });
86515
+ const tokenRes = await fetch(`${loginHost}/services/oauth2/token`, {
86516
+ method: "POST",
86517
+ headers: {
86518
+ "Content-Type": "application/x-www-form-urlencoded"
86519
+ },
86520
+ body: tokenBody.toString()
86521
+ });
86522
+ if (!tokenRes.ok) {
86523
+ const errText = await tokenRes.text().catch(() => "(unreadable body)");
86524
+ return {
86525
+ success: false,
86526
+ error: `Failed to obtain access token: ${tokenRes.status} ${tokenRes.statusText} \u2014 ${errText}`
86527
+ };
86528
+ }
86529
+ const tokenJson = await tokenRes.json();
86530
+ if (!tokenJson.access_token || !tokenJson.instance_url) {
86531
+ return {
86532
+ success: false,
86533
+ error: "access_token or instance_url not found in token response"
86534
+ };
86535
+ }
86536
+ const url = `${tokenJson.instance_url}${path5.startsWith("/") ? "" : "/"}${path5}`;
86537
+ const controller = new AbortController();
86538
+ const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS59);
86539
+ try {
86540
+ const response = await fetch(url, {
86541
+ method,
86542
+ headers: {
86543
+ Authorization: `Bearer ${tokenJson.access_token}`,
86544
+ "Content-Type": "application/json"
86545
+ },
86546
+ body: body ? JSON.stringify(body) : void 0,
86547
+ signal: controller.signal
86548
+ });
86549
+ const text = await response.text();
86550
+ let data;
86551
+ try {
86552
+ data = text ? JSON.parse(text) : {};
86553
+ } catch {
86554
+ data = { raw: text };
86555
+ }
86556
+ if (!response.ok) {
86557
+ let errorMessage = `HTTP ${response.status} ${response.statusText}`;
86558
+ if (Array.isArray(data) && data.length > 0) {
86559
+ const first = data[0];
86560
+ if (first.message) {
86561
+ errorMessage = first.errorCode ? `${first.errorCode}: ${first.message}` : first.message;
86562
+ }
86563
+ } else if (typeof data.message === "string") {
86564
+ errorMessage = data.message;
86565
+ } else if (typeof data.error === "string") {
86566
+ errorMessage = data.error;
86567
+ }
86568
+ return { success: false, error: errorMessage };
86569
+ }
86570
+ return { success: true, status: response.status, data };
86571
+ } finally {
86572
+ clearTimeout(timeout);
86573
+ }
86574
+ } catch (err) {
86575
+ const msg = err instanceof Error ? err.message : String(err);
86576
+ return { success: false, error: msg };
86577
+ }
86578
+ }
86579
+ });
86580
+
86581
+ // ../connectors/src/connectors/salesforce/index.ts
86582
+ var tools62 = { request: requestTool47 };
86583
+ var salesforceConnector = new ConnectorPlugin({
86584
+ slug: "salesforce",
86585
+ authType: AUTH_TYPES.USER_PASSWORD,
86586
+ name: "Salesforce",
86587
+ description: "Connect to Salesforce CRM for accounts, contacts, opportunities, leads, cases, and custom objects via SOQL and the REST API.",
86588
+ iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6vZlbrUKhxXIiuvWJlb8YB/bbc5e08b88de46c8ed338a74c7d0abb3/salesforce-icon.png",
86589
+ parameters: parameters62,
86590
+ releaseFlag: { dev1: true, dev2: false, prod: false },
86591
+ onboarding: salesforceOnboarding,
86592
+ systemPrompt: {
86593
+ en: `### Tools
86594
+
86595
+ - \`salesforce_request\`: The only way to call the Salesforce REST API. Use it to run SOQL queries, describe sObjects, and read/create/update/delete standard (Account, Contact, Opportunity, Lead, Case) and custom objects. Authentication (OAuth 2.0 username-password flow against the Connected App) is configured automatically \u2014 an access token and the org's instance URL are resolved on each request. Prefer SOQL via \`GET /services/data/v60.0/query?q=...\` over paginating \`/sobjects/{Type}\` endpoints for filtered or joined reads.
86596
+
86597
+ ### Business Logic
86598
+
86599
+ The business logic type for this connector is "typescript". Use the connector SDK in your handler. Do NOT read credentials from environment variables.
86600
+
86601
+ SDK methods (client created via \`connection(connectionId)\`):
86602
+ - \`client.request(path, init?)\` \u2014 low-level authenticated fetch against the Salesforce instance URL
86603
+ - \`client.query(soql)\` \u2014 run a SOQL query and return \`{ totalSize, done, records, nextRecordsUrl? }\`
86604
+ - \`client.queryMore(nextRecordsUrl)\` \u2014 fetch the next page of SOQL results
86605
+ - \`client.describeSObject(objectType)\` \u2014 describe an sObject's metadata
86606
+ - \`client.getRecord(objectType, id, options?)\` \u2014 fetch a single record (optionally restrict fields)
86607
+ - \`client.createRecord(objectType, fields)\` \u2014 create a new record
86608
+ - \`client.updateRecord(objectType, id, fields)\` \u2014 patch an existing record
86609
+ - \`client.deleteRecord(objectType, id)\` \u2014 delete a record
86610
+
86611
+ \`\`\`ts
86612
+ import type { Context } from "hono";
86613
+ import { connection } from "@squadbase/vite-server/connectors/salesforce";
86614
+
86615
+ const salesforce = connection("<connectionId>");
86616
+
86617
+ export default async function handler(c: Context) {
86618
+ const { industry, limit = 50 } = await c.req.json<{
86619
+ industry?: string;
86620
+ limit?: number;
86621
+ }>();
86622
+
86623
+ const where = industry
86624
+ ? \`WHERE Industry = '\${industry.replace(/'/g, "\\\\'")}'\`
86625
+ : "";
86626
+ const soql = \`SELECT Id, Name, Industry, AnnualRevenue FROM Account \${where} ORDER BY AnnualRevenue DESC NULLS LAST LIMIT \${limit}\`;
86627
+
86628
+ const { records } = await salesforce.query<{
86629
+ Id: string;
86630
+ Name: string;
86631
+ Industry: string | null;
86632
+ AnnualRevenue: number | null;
86633
+ }>(soql);
86634
+
86635
+ return c.json({ accounts: records });
86636
+ }
86637
+ \`\`\`
86638
+
86639
+ ### Salesforce REST API Reference
86640
+
86641
+ - Login host: \`https://login.salesforce.com\` (production) or \`https://test.salesforce.com\` (sandbox)
86642
+ - Token endpoint: \`POST /services/oauth2/token\` (grant_type=password + client_id/secret + username/password)
86643
+ - Base path after login: \`{instance_url}/services/data/v60.0\`
86644
+ - Authentication: Bearer token (handled automatically per request)
86645
+ - Pagination (SOQL): follow \`nextRecordsUrl\` from the response (absolute path starting with \`/services/data/v60.0/query/...\`)
86646
+
86647
+ #### Common Endpoints
86648
+ - GET \`/services/data/\` \u2014 List available API versions
86649
+ - GET \`/services/data/v60.0/sobjects/\` \u2014 List all sObjects (standard + custom)
86650
+ - GET \`/services/data/v60.0/sobjects/{Type}/describe\` \u2014 Describe an sObject (fields, relationships, picklists)
86651
+ - GET \`/services/data/v60.0/sobjects/{Type}/{id}\` \u2014 Get a record (supports \`?fields=...\`)
86652
+ - POST \`/services/data/v60.0/sobjects/{Type}\` \u2014 Create a record
86653
+ - PATCH \`/services/data/v60.0/sobjects/{Type}/{id}\` \u2014 Update a record
86654
+ - DELETE \`/services/data/v60.0/sobjects/{Type}/{id}\` \u2014 Delete a record
86655
+ - GET \`/services/data/v60.0/query?q={soql}\` \u2014 Run SOQL
86656
+ - GET \`/services/data/v60.0/search?q={sosl}\` \u2014 Run SOSL
86657
+
86658
+ #### SOQL Reference
86659
+ - SELECT column list is required (no \`SELECT *\`)
86660
+ - Filter: \`WHERE\`, \`AND\` / \`OR\`, parent/child relationship fields (e.g., \`Account.Name\`)
86661
+ - Sort: \`ORDER BY field [ASC|DESC] [NULLS FIRST|NULLS LAST]\`
86662
+ - Paginate: \`LIMIT n\`, \`OFFSET m\`; for large result sets, follow \`nextRecordsUrl\` instead of OFFSET
86663
+ - Aggregate: \`GROUP BY\`, \`HAVING\`, \`COUNT()\`, \`SUM()\`, \`AVG()\`, \`MIN()\`, \`MAX()\`
86664
+ - Parent-to-child subquery: \`SELECT Id, Name, (SELECT Id, Email FROM Contacts) FROM Account\``,
86665
+ ja: `### \u30C4\u30FC\u30EB
86666
+
86667
+ - \`salesforce_request\`: Salesforce REST API \u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002SOQL \u30AF\u30A8\u30EA\u306E\u5B9F\u884C\u3001sObject \u306E describe\u3001\u6A19\u6E96\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\uFF08Account, Contact, Opportunity, Lead, Case\uFF09\u3084\u30AB\u30B9\u30BF\u30E0\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u8AAD\u307F\u66F8\u304D\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u8A8D\u8A3C\uFF08Connected App + OAuth 2.0 Username-Password Flow\uFF09\u306F\u81EA\u52D5\u3067\u884C\u308F\u308C\u3001\u30EA\u30AF\u30A8\u30B9\u30C8\u3054\u3068\u306B\u30A2\u30AF\u30BB\u30B9\u30C8\u30FC\u30AF\u30F3\u3068\u7D44\u7E54\u306E instance URL \u304C\u89E3\u6C7A\u3055\u308C\u307E\u3059\u3002\u30D5\u30A3\u30EB\u30BF\u3084\u7D50\u5408\u306E\u3042\u308B\u8AAD\u307F\u53D6\u308A\u3067\u306F \`/sobjects/{Type}\` \u3092\u30DA\u30FC\u30B8\u30F3\u30B0\u3059\u308B\u306E\u3067\u306F\u306A\u304F\u3001\`GET /services/data/v60.0/query?q=...\` \u306E SOQL \u3092\u512A\u5148\u3057\u3066\u304F\u3060\u3055\u3044\u3002
86668
+
86669
+ ### Business Logic
86670
+
86671
+ \u3053\u306E\u30B3\u30CD\u30AF\u30BF\u306E\u30D3\u30B8\u30CD\u30B9\u30ED\u30B8\u30C3\u30AF\u30BF\u30A4\u30D7\u306F "typescript" \u3067\u3059\u3002\u30CF\u30F3\u30C9\u30E9\u5185\u3067\u306F\u30B3\u30CD\u30AF\u30BF SDK \u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u74B0\u5883\u5909\u6570\u304B\u3089\u8A8D\u8A3C\u60C5\u5831\u3092\u8AAD\u307F\u53D6\u3089\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002
86672
+
86673
+ SDK\u30E1\u30BD\u30C3\u30C9 (\`connection(connectionId)\` \u3067\u4F5C\u6210\u3057\u305F\u30AF\u30E9\u30A4\u30A2\u30F3\u30C8):
86674
+ - \`client.request(path, init?)\` \u2014 Salesforce \u306E instance URL \u306B\u5BFE\u3059\u308B\u4F4E\u30EC\u30D9\u30EB\u306E\u8A8D\u8A3C\u4ED8\u304D fetch
86675
+ - \`client.query(soql)\` \u2014 SOQL \u30AF\u30A8\u30EA\u3092\u5B9F\u884C\u3057 \`{ totalSize, done, records, nextRecordsUrl? }\` \u3092\u8FD4\u5374
86676
+ - \`client.queryMore(nextRecordsUrl)\` \u2014 SOQL \u7D50\u679C\u306E\u6B21\u30DA\u30FC\u30B8\u3092\u53D6\u5F97
86677
+ - \`client.describeSObject(objectType)\` \u2014 sObject \u306E\u30E1\u30BF\u30C7\u30FC\u30BF\u3092\u53D6\u5F97
86678
+ - \`client.getRecord(objectType, id, options?)\` \u2014 1 \u4EF6\u306E\u30EC\u30B3\u30FC\u30C9\u3092\u53D6\u5F97\uFF08\u4EFB\u610F\u3067\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u6307\u5B9A\uFF09
86679
+ - \`client.createRecord(objectType, fields)\` \u2014 \u30EC\u30B3\u30FC\u30C9\u3092\u65B0\u898F\u4F5C\u6210
86680
+ - \`client.updateRecord(objectType, id, fields)\` \u2014 \u65E2\u5B58\u30EC\u30B3\u30FC\u30C9\u3092\u66F4\u65B0\uFF08PATCH\uFF09
86681
+ - \`client.deleteRecord(objectType, id)\` \u2014 \u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664
86682
+
86683
+ \`\`\`ts
86684
+ import type { Context } from "hono";
86685
+ import { connection } from "@squadbase/vite-server/connectors/salesforce";
86686
+
86687
+ const salesforce = connection("<connectionId>");
86688
+
86689
+ export default async function handler(c: Context) {
86690
+ const { industry, limit = 50 } = await c.req.json<{
86691
+ industry?: string;
86692
+ limit?: number;
86693
+ }>();
86694
+
86695
+ const where = industry
86696
+ ? \`WHERE Industry = '\${industry.replace(/'/g, "\\\\'")}'\`
86697
+ : "";
86698
+ const soql = \`SELECT Id, Name, Industry, AnnualRevenue FROM Account \${where} ORDER BY AnnualRevenue DESC NULLS LAST LIMIT \${limit}\`;
86699
+
86700
+ const { records } = await salesforce.query<{
86701
+ Id: string;
86702
+ Name: string;
86703
+ Industry: string | null;
86704
+ AnnualRevenue: number | null;
86705
+ }>(soql);
86706
+
86707
+ return c.json({ accounts: records });
86708
+ }
86709
+ \`\`\`
86710
+
86711
+ ### Salesforce REST API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
86712
+
86713
+ - \u30ED\u30B0\u30A4\u30F3\u30DB\u30B9\u30C8: \`https://login.salesforce.com\`\uFF08\u672C\u756A\uFF09\u307E\u305F\u306F \`https://test.salesforce.com\`\uFF08Sandbox\uFF09
86714
+ - \u30C8\u30FC\u30AF\u30F3\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8: \`POST /services/oauth2/token\`\uFF08grant_type=password + client_id/secret + username/password\uFF09
86715
+ - \u30ED\u30B0\u30A4\u30F3\u5F8C\u306E\u30D9\u30FC\u30B9\u30D1\u30B9: \`{instance_url}/services/data/v60.0\`
86716
+ - \u8A8D\u8A3C: Bearer \u30C8\u30FC\u30AF\u30F3\uFF08\u30EA\u30AF\u30A8\u30B9\u30C8\u3054\u3068\u306B\u81EA\u52D5\u8A2D\u5B9A\uFF09
86717
+ - \u30DA\u30FC\u30B8\u30CD\u30FC\u30B7\u30E7\u30F3\uFF08SOQL\uFF09: \u30EC\u30B9\u30DD\u30F3\u30B9\u306E \`nextRecordsUrl\`\uFF08\`/services/data/v60.0/query/...\` \u304B\u3089\u59CB\u307E\u308B\u7D76\u5BFE\u30D1\u30B9\uFF09\u3092\u8FBF\u308B
86718
+
86719
+ #### \u4E3B\u8981\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8
86720
+ - GET \`/services/data/\` \u2014 \u5229\u7528\u53EF\u80FD\u306A API \u30D0\u30FC\u30B8\u30E7\u30F3\u4E00\u89A7
86721
+ - GET \`/services/data/v60.0/sobjects/\` \u2014 sObject \u4E00\u89A7\uFF08\u6A19\u6E96 + \u30AB\u30B9\u30BF\u30E0\uFF09
86722
+ - GET \`/services/data/v60.0/sobjects/{Type}/describe\` \u2014 sObject \u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u30FB\u30EA\u30EC\u30FC\u30B7\u30E7\u30F3\u30FB\u30D4\u30C3\u30AF\u30EA\u30B9\u30C8\u3092\u53D6\u5F97
86723
+ - GET \`/services/data/v60.0/sobjects/{Type}/{id}\` \u2014 \u30EC\u30B3\u30FC\u30C9\u53D6\u5F97\uFF08\`?fields=...\` \u3067\u7D5E\u308A\u8FBC\u307F\u53EF\uFF09
86724
+ - POST \`/services/data/v60.0/sobjects/{Type}\` \u2014 \u30EC\u30B3\u30FC\u30C9\u4F5C\u6210
86725
+ - PATCH \`/services/data/v60.0/sobjects/{Type}/{id}\` \u2014 \u30EC\u30B3\u30FC\u30C9\u66F4\u65B0
86726
+ - DELETE \`/services/data/v60.0/sobjects/{Type}/{id}\` \u2014 \u30EC\u30B3\u30FC\u30C9\u524A\u9664
86727
+ - GET \`/services/data/v60.0/query?q={soql}\` \u2014 SOQL \u3092\u5B9F\u884C
86728
+ - GET \`/services/data/v60.0/search?q={sosl}\` \u2014 SOSL \u3092\u5B9F\u884C
86729
+
86730
+ #### SOQL \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
86731
+ - SELECT \u5217\u306E\u660E\u793A\u304C\u5FC5\u9808\uFF08\`SELECT *\` \u306F\u4E0D\u53EF\uFF09
86732
+ - \u30D5\u30A3\u30EB\u30BF: \`WHERE\`\u3001\`AND\` / \`OR\`\u3001\u89AA\u5B50\u30EA\u30EC\u30FC\u30B7\u30E7\u30F3\u53C2\u7167\uFF08\u4F8B: \`Account.Name\`\uFF09
86733
+ - \u4E26\u3073\u66FF\u3048: \`ORDER BY field [ASC|DESC] [NULLS FIRST|NULLS LAST]\`
86734
+ - \u30DA\u30FC\u30B8\u30F3\u30B0: \`LIMIT n\`, \`OFFSET m\`\u3002\u5927\u91CF\u30C7\u30FC\u30BF\u3067\u306F OFFSET \u3067\u306F\u306A\u304F \`nextRecordsUrl\` \u3092\u5229\u7528\u3059\u308B
86735
+ - \u96C6\u8A08: \`GROUP BY\`, \`HAVING\`, \`COUNT()\`, \`SUM()\`, \`AVG()\`, \`MIN()\`, \`MAX()\`
86736
+ - \u89AA\u2192\u5B50\u30B5\u30D6\u30AF\u30A8\u30EA: \`SELECT Id, Name, (SELECT Id, Email FROM Contacts) FROM Account\``
86737
+ },
86738
+ tools: tools62
86739
+ });
86740
+
86356
86741
  // ../connectors/src/connectors/registry.ts
86357
86742
  var plugins = {
86358
86743
  snowflake: snowflakeConnector,
@@ -86415,7 +86800,8 @@ var plugins = {
86415
86800
  grafana: grafanaConnector,
86416
86801
  backlog: backlogConnector,
86417
86802
  gamma: gammaConnector,
86418
- sentry: sentryConnector
86803
+ sentry: sentryConnector,
86804
+ salesforce: salesforceConnector
86419
86805
  };
86420
86806
  var connectors = {
86421
86807
  ...plugins,
@@ -86642,62 +87028,62 @@ import { watch as fsWatch2 } from "fs";
86642
87028
  import path2 from "path";
86643
87029
 
86644
87030
  // src/types/server-logic.ts
86645
- import { z as z77 } from "zod";
86646
- var parameterMetaSchema = z77.object({
86647
- name: z77.string(),
86648
- type: z77.enum(["string", "number", "boolean"]),
86649
- description: z77.string(),
86650
- required: z77.boolean().optional(),
86651
- default: z77.union([z77.string(), z77.number(), z77.boolean()]).optional()
86652
- });
86653
- var serverLogicCacheConfigSchema = z77.object({
86654
- ttl: z77.number(),
86655
- staleWhileRevalidate: z77.boolean().optional()
86656
- });
86657
- var serverLogicSchemaObjectSchema = z77.lazy(
86658
- () => z77.object({
86659
- type: z77.enum(["string", "number", "integer", "boolean", "object", "array", "null"]).optional(),
86660
- format: z77.string().optional(),
86661
- description: z77.string().optional(),
86662
- nullable: z77.boolean().optional(),
86663
- enum: z77.array(z77.union([z77.string(), z77.number(), z77.boolean(), z77.null()])).optional(),
87031
+ import { z as z78 } from "zod";
87032
+ var parameterMetaSchema = z78.object({
87033
+ name: z78.string(),
87034
+ type: z78.enum(["string", "number", "boolean"]),
87035
+ description: z78.string(),
87036
+ required: z78.boolean().optional(),
87037
+ default: z78.union([z78.string(), z78.number(), z78.boolean()]).optional()
87038
+ });
87039
+ var serverLogicCacheConfigSchema = z78.object({
87040
+ ttl: z78.number(),
87041
+ staleWhileRevalidate: z78.boolean().optional()
87042
+ });
87043
+ var serverLogicSchemaObjectSchema = z78.lazy(
87044
+ () => z78.object({
87045
+ type: z78.enum(["string", "number", "integer", "boolean", "object", "array", "null"]).optional(),
87046
+ format: z78.string().optional(),
87047
+ description: z78.string().optional(),
87048
+ nullable: z78.boolean().optional(),
87049
+ enum: z78.array(z78.union([z78.string(), z78.number(), z78.boolean(), z78.null()])).optional(),
86664
87050
  items: serverLogicSchemaObjectSchema.optional(),
86665
- properties: z77.record(z77.string(), serverLogicSchemaObjectSchema).optional(),
86666
- required: z77.array(z77.string()).optional(),
86667
- additionalProperties: z77.union([z77.boolean(), serverLogicSchemaObjectSchema]).optional(),
86668
- minimum: z77.number().optional(),
86669
- maximum: z77.number().optional(),
86670
- minLength: z77.number().optional(),
86671
- maxLength: z77.number().optional(),
86672
- pattern: z77.string().optional()
87051
+ properties: z78.record(z78.string(), serverLogicSchemaObjectSchema).optional(),
87052
+ required: z78.array(z78.string()).optional(),
87053
+ additionalProperties: z78.union([z78.boolean(), serverLogicSchemaObjectSchema]).optional(),
87054
+ minimum: z78.number().optional(),
87055
+ maximum: z78.number().optional(),
87056
+ minLength: z78.number().optional(),
87057
+ maxLength: z78.number().optional(),
87058
+ pattern: z78.string().optional()
86673
87059
  })
86674
87060
  );
86675
- var serverLogicMediaTypeSchema = z77.object({
87061
+ var serverLogicMediaTypeSchema = z78.object({
86676
87062
  schema: serverLogicSchemaObjectSchema.optional(),
86677
- example: z77.unknown().optional()
87063
+ example: z78.unknown().optional()
86678
87064
  });
86679
- var serverLogicResponseSchema = z77.object({
86680
- description: z77.string().optional(),
86681
- content: z77.record(z77.string(), serverLogicMediaTypeSchema).optional()
87065
+ var serverLogicResponseSchema = z78.object({
87066
+ description: z78.string().optional(),
87067
+ content: z78.record(z78.string(), serverLogicMediaTypeSchema).optional()
86682
87068
  });
86683
87069
  var jsonBaseFields = {
86684
- description: z77.string(),
86685
- parameters: z77.array(parameterMetaSchema).optional(),
87070
+ description: z78.string(),
87071
+ parameters: z78.array(parameterMetaSchema).optional(),
86686
87072
  response: serverLogicResponseSchema.optional(),
86687
87073
  cache: serverLogicCacheConfigSchema.optional()
86688
87074
  };
86689
- var jsonSqlServerLogicSchema = z77.object({
87075
+ var jsonSqlServerLogicSchema = z78.object({
86690
87076
  ...jsonBaseFields,
86691
- type: z77.literal("sql").optional(),
86692
- query: z77.string(),
86693
- connectionId: z77.string()
87077
+ type: z78.literal("sql").optional(),
87078
+ query: z78.string(),
87079
+ connectionId: z78.string()
86694
87080
  });
86695
- var jsonTypeScriptServerLogicSchema = z77.object({
87081
+ var jsonTypeScriptServerLogicSchema = z78.object({
86696
87082
  ...jsonBaseFields,
86697
- type: z77.literal("typescript"),
86698
- handlerPath: z77.string()
87083
+ type: z78.literal("typescript"),
87084
+ handlerPath: z78.string()
86699
87085
  });
86700
- var anyJsonServerLogicSchema = z77.union([
87086
+ var anyJsonServerLogicSchema = z78.union([
86701
87087
  jsonTypeScriptServerLogicSchema,
86702
87088
  jsonSqlServerLogicSchema
86703
87089
  ]);