@squadbase/vite-server 0.1.4 → 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/index.js CHANGED
@@ -18863,14 +18863,14 @@ var init_NormalizedSchema = __esm({
18863
18863
  throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");
18864
18864
  }
18865
18865
  const struct = this.getSchema();
18866
- const z78 = struct[4].length;
18866
+ const z79 = struct[4].length;
18867
18867
  let it = struct[anno.it];
18868
- if (it && z78 === it.length) {
18868
+ if (it && z79 === it.length) {
18869
18869
  yield* it;
18870
18870
  return;
18871
18871
  }
18872
- it = Array(z78);
18873
- for (let i6 = 0; i6 < z78; ++i6) {
18872
+ it = Array(z79);
18873
+ for (let i6 = 0; i6 < z79; ++i6) {
18874
18874
  const k6 = struct[4][i6];
18875
18875
  const v7 = member([struct[5][i6], 0], k6);
18876
18876
  yield it[i6] = [k6, v7];
@@ -19546,12 +19546,12 @@ var init_split_header = __esm({
19546
19546
  "../../node_modules/@smithy/core/dist-es/submodules/serde/split-header.js"() {
19547
19547
  "use strict";
19548
19548
  splitHeader = (value) => {
19549
- const z78 = value.length;
19549
+ const z79 = value.length;
19550
19550
  const values = [];
19551
19551
  let withinQuotes = false;
19552
19552
  let prevChar = void 0;
19553
19553
  let anchor = 0;
19554
- for (let i6 = 0; i6 < z78; ++i6) {
19554
+ for (let i6 = 0; i6 < z79; ++i6) {
19555
19555
  const char = value[i6];
19556
19556
  switch (char) {
19557
19557
  case `"`:
@@ -19572,12 +19572,12 @@ var init_split_header = __esm({
19572
19572
  values.push(value.slice(anchor));
19573
19573
  return values.map((v7) => {
19574
19574
  v7 = v7.trim();
19575
- const z79 = v7.length;
19576
- if (z79 < 2) {
19575
+ const z80 = v7.length;
19576
+ if (z80 < 2) {
19577
19577
  return v7;
19578
19578
  }
19579
- if (v7[0] === `"` && v7[z79 - 1] === `"`) {
19580
- v7 = v7.slice(1, z79 - 1);
19579
+ if (v7[0] === `"` && v7[z80 - 1] === `"`) {
19580
+ v7 = v7.slice(1, z80 - 1);
19581
19581
  }
19582
19582
  return v7.replace(/\\"/g, '"');
19583
19583
  });
@@ -20975,11 +20975,11 @@ var init_EndpointCache = __esm({
20975
20975
  }
20976
20976
  hash(endpointParams) {
20977
20977
  let buffer = "";
20978
- const { parameters: parameters62 } = this;
20979
- if (parameters62.length === 0) {
20978
+ const { parameters: parameters63 } = this;
20979
+ if (parameters63.length === 0) {
20980
20980
  return false;
20981
20981
  }
20982
- for (const param of parameters62) {
20982
+ for (const param of parameters63) {
20983
20983
  const val = String(endpointParams[param] ?? "");
20984
20984
  if (val.includes("|;")) {
20985
20985
  return false;
@@ -21696,15 +21696,15 @@ var init_resolveEndpoint = __esm({
21696
21696
  init_utils();
21697
21697
  resolveEndpoint = (ruleSetObject, options) => {
21698
21698
  const { endpointParams, logger: logger2 } = options;
21699
- const { parameters: parameters62, rules } = ruleSetObject;
21699
+ const { parameters: parameters63, rules } = ruleSetObject;
21700
21700
  options.logger?.debug?.(`${debugId} Initial EndpointParams: ${toDebugString(endpointParams)}`);
21701
- const paramsWithDefault = Object.entries(parameters62).filter(([, v7]) => v7.default != null).map(([k6, v7]) => [k6, v7.default]);
21701
+ const paramsWithDefault = Object.entries(parameters63).filter(([, v7]) => v7.default != null).map(([k6, v7]) => [k6, v7.default]);
21702
21702
  if (paramsWithDefault.length > 0) {
21703
21703
  for (const [paramKey, paramDefaultValue] of paramsWithDefault) {
21704
21704
  endpointParams[paramKey] = endpointParams[paramKey] ?? paramDefaultValue;
21705
21705
  }
21706
21706
  }
21707
- const requiredParams = Object.entries(parameters62).filter(([, v7]) => v7.required).map(([k6]) => k6);
21707
+ const requiredParams = Object.entries(parameters63).filter(([, v7]) => v7.required).map(([k6]) => k6);
21708
21708
  for (const requiredParam of requiredParams) {
21709
21709
  if (endpointParams[requiredParam] == null) {
21710
21710
  throw new EndpointError(`Missing required parameter: '${requiredParam}'`);
@@ -27314,8 +27314,8 @@ var init_ProtocolLib = __esm({
27314
27314
  constructor(queryCompat = false) {
27315
27315
  this.queryCompat = queryCompat;
27316
27316
  }
27317
- resolveRestContentType(defaultContentType, inputSchema75) {
27318
- const members = inputSchema75.getMemberSchemas();
27317
+ resolveRestContentType(defaultContentType, inputSchema76) {
27318
+ const members = inputSchema76.getMemberSchemas();
27319
27319
  const httpPayloadMember = Object.values(members).find((m6) => {
27320
27320
  return !!m6.getMergedTraits().httpPayload;
27321
27321
  });
@@ -27330,7 +27330,7 @@ var init_ProtocolLib = __esm({
27330
27330
  } else {
27331
27331
  return defaultContentType;
27332
27332
  }
27333
- } else if (!inputSchema75.isUnitSchema()) {
27333
+ } else if (!inputSchema76.isUnitSchema()) {
27334
27334
  const hasBody = Object.values(members).find((m6) => {
27335
27335
  const { httpQuery, httpQueryParams, httpHeader, httpLabel, httpPrefixHeaders } = m6.getMergedTraits();
27336
27336
  const noPrefixHeaders = httpPrefixHeaders === void 0;
@@ -28173,9 +28173,9 @@ var init_AwsRestJsonProtocol = __esm({
28173
28173
  }
28174
28174
  async serializeRequest(operationSchema, input, context) {
28175
28175
  const request2 = await super.serializeRequest(operationSchema, input, context);
28176
- const inputSchema75 = NormalizedSchema.of(operationSchema.input);
28176
+ const inputSchema76 = NormalizedSchema.of(operationSchema.input);
28177
28177
  if (!request2.headers["content-type"]) {
28178
- const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema75);
28178
+ const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema76);
28179
28179
  if (contentType) {
28180
28180
  request2.headers["content-type"] = contentType;
28181
28181
  }
@@ -28187,8 +28187,8 @@ var init_AwsRestJsonProtocol = __esm({
28187
28187
  }
28188
28188
  async deserializeResponse(operationSchema, context, response) {
28189
28189
  const output = await super.deserializeResponse(operationSchema, context, response);
28190
- const outputSchema75 = NormalizedSchema.of(operationSchema.output);
28191
- for (const [name, member2] of outputSchema75.structIterator()) {
28190
+ const outputSchema76 = NormalizedSchema.of(operationSchema.output);
28191
+ for (const [name, member2] of outputSchema76.structIterator()) {
28192
28192
  if (member2.getMemberTraits().httpPayload && !(name in output)) {
28193
28193
  output[name] = null;
28194
28194
  }
@@ -32052,22 +32052,22 @@ var init_loadCognitoIdentity = __esm({
32052
32052
  });
32053
32053
 
32054
32054
  // ../../node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/fromCognitoIdentity.js
32055
- function fromCognitoIdentity(parameters62) {
32055
+ function fromCognitoIdentity(parameters63) {
32056
32056
  return async (awsIdentityProperties) => {
32057
- parameters62.logger?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");
32057
+ parameters63.logger?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");
32058
32058
  const { GetCredentialsForIdentityCommand: GetCredentialsForIdentityCommand2, CognitoIdentityClient: CognitoIdentityClient2 } = await Promise.resolve().then(() => (init_loadCognitoIdentity(), loadCognitoIdentity_exports));
32059
- const fromConfigs = (property) => parameters62.clientConfig?.[property] ?? parameters62.parentClientConfig?.[property] ?? awsIdentityProperties?.callerClientConfig?.[property];
32060
- const { Credentials: { AccessKeyId = throwOnMissingAccessKeyId(parameters62.logger), Expiration, SecretKey = throwOnMissingSecretKey(parameters62.logger), SessionToken } = throwOnMissingCredentials(parameters62.logger) } = await (parameters62.client ?? new CognitoIdentityClient2(Object.assign({}, parameters62.clientConfig ?? {}, {
32059
+ const fromConfigs = (property) => parameters63.clientConfig?.[property] ?? parameters63.parentClientConfig?.[property] ?? awsIdentityProperties?.callerClientConfig?.[property];
32060
+ const { Credentials: { AccessKeyId = throwOnMissingAccessKeyId(parameters63.logger), Expiration, SecretKey = throwOnMissingSecretKey(parameters63.logger), SessionToken } = throwOnMissingCredentials(parameters63.logger) } = await (parameters63.client ?? new CognitoIdentityClient2(Object.assign({}, parameters63.clientConfig ?? {}, {
32061
32061
  region: fromConfigs("region"),
32062
32062
  profile: fromConfigs("profile"),
32063
32063
  userAgentAppId: fromConfigs("userAgentAppId")
32064
32064
  }))).send(new GetCredentialsForIdentityCommand2({
32065
- CustomRoleArn: parameters62.customRoleArn,
32066
- IdentityId: parameters62.identityId,
32067
- Logins: parameters62.logins ? await resolveLogins(parameters62.logins) : void 0
32065
+ CustomRoleArn: parameters63.customRoleArn,
32066
+ IdentityId: parameters63.identityId,
32067
+ Logins: parameters63.logins ? await resolveLogins(parameters63.logins) : void 0
32068
32068
  }));
32069
32069
  return {
32070
- identityId: parameters62.identityId,
32070
+ identityId: parameters63.identityId,
32071
32071
  accessKeyId: AccessKeyId,
32072
32072
  secretAccessKey: SecretKey,
32073
32073
  sessionToken: SessionToken,
@@ -44628,11 +44628,11 @@ var require_bignumber = __commonJS({
44628
44628
  return n6 > 0 || n6 === i6 ? i6 : i6 - 1;
44629
44629
  }
44630
44630
  function coeffToString(a6) {
44631
- var s6, z78, i6 = 1, j6 = a6.length, r6 = a6[0] + "";
44631
+ var s6, z79, i6 = 1, j6 = a6.length, r6 = a6[0] + "";
44632
44632
  for (; i6 < j6; ) {
44633
44633
  s6 = a6[i6++] + "";
44634
- z78 = LOG_BASE - s6.length;
44635
- for (; z78--; s6 = "0" + s6) ;
44634
+ z79 = LOG_BASE - s6.length;
44635
+ for (; z79--; s6 = "0" + s6) ;
44636
44636
  r6 += s6;
44637
44637
  }
44638
44638
  for (j6 = r6.length; r6.charCodeAt(--j6) === 48; ) ;
@@ -44665,15 +44665,15 @@ var require_bignumber = __commonJS({
44665
44665
  function toExponential(str, e6) {
44666
44666
  return (str.length > 1 ? str.charAt(0) + "." + str.slice(1) : str) + (e6 < 0 ? "e" : "e+") + e6;
44667
44667
  }
44668
- function toFixedPoint(str, e6, z78) {
44668
+ function toFixedPoint(str, e6, z79) {
44669
44669
  var len, zs;
44670
44670
  if (e6 < 0) {
44671
- for (zs = z78 + "."; ++e6; zs += z78) ;
44671
+ for (zs = z79 + "."; ++e6; zs += z79) ;
44672
44672
  str = zs + str;
44673
44673
  } else {
44674
44674
  len = str.length;
44675
44675
  if (++e6 > len) {
44676
- for (zs = z78, e6 -= len; --e6; zs += z78) ;
44676
+ for (zs = z79, e6 -= len; --e6; zs += z79) ;
44677
44677
  str += zs;
44678
44678
  } else if (e6 < len) {
44679
44679
  str = str.slice(0, e6) + "." + str.slice(e6);
@@ -72099,7 +72099,9 @@ Authentication is handled automatically via OAuth proxy.`,
72099
72099
  });
72100
72100
  const data = await response.json();
72101
72101
  if (!response.ok) {
72102
- const errorMessage = typeof data?.error === "string" ? data.error : typeof data?.message === "string" ? data.message : `HTTP ${response.status} ${response.statusText}`;
72102
+ const googleError = data?.error && typeof data.error === "object" ? data.error : null;
72103
+ const googleErrorMessage = googleError && typeof googleError.message === "string" ? googleError.status && typeof googleError.status === "string" ? `${googleError.status}: ${googleError.message}` : googleError.message : null;
72104
+ const errorMessage = googleErrorMessage ?? (typeof data?.error === "string" ? data.error : typeof data?.message === "string" ? data.message : `HTTP ${response.status} ${response.statusText}`);
72103
72105
  return { success: false, error: errorMessage };
72104
72106
  }
72105
72107
  return { success: true, status: response.status, data };
@@ -74087,7 +74089,7 @@ var stripeApiKeyConnector = new ConnectorPlugin({
74087
74089
  description: "Connect to Stripe for payment, customer, and subscription data using a Secret API Key or Restricted API Key.",
74088
74090
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/2QNK0u2doqp41uL0POS4Ks/7a92367e2388ec77c7f4ada143606f9a/stripe.jpeg",
74089
74091
  parameters: parameters22,
74090
- releaseFlag: { dev1: true, dev2: false, prod: false },
74092
+ releaseFlag: { dev1: true, dev2: true, prod: true },
74091
74093
  onboarding: stripeApiKeyOnboarding,
74092
74094
  systemPrompt: {
74093
74095
  en: `### Tools
@@ -74978,7 +74980,7 @@ var kintoneApiTokenConnector = new ConnectorPlugin({
74978
74980
  description: "Connect to kintone for business application data retrieval and analytics using API token authentication.",
74979
74981
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/76nPGMJFZkMFE3UQNo2JFy/e71dc5f5d5cec1306ce0e17aafbfd9f0/kintone.png",
74980
74982
  parameters: parameters25,
74981
- releaseFlag: { dev1: true, dev2: false, prod: false },
74983
+ releaseFlag: { dev1: true, dev2: true, prod: true },
74982
74984
  onboarding: kintoneApiTokenOnboarding,
74983
74985
  systemPrompt: {
74984
74986
  en: `### Tools
@@ -76316,7 +76318,7 @@ var amplitudeConnector = new ConnectorPlugin({
76316
76318
  description: "Connect to Amplitude for product analytics and user behavior data.",
76317
76319
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/2UBJSdRlFJaLq52WUCTBEB/308b59b374cf6c662ac70989860bffd7/amplitude-icon.svg",
76318
76320
  parameters: parameters32,
76319
- releaseFlag: { dev1: true, dev2: false, prod: false },
76321
+ releaseFlag: { dev1: true, dev2: true, prod: true },
76320
76322
  onboarding: amplitudeOnboarding,
76321
76323
  systemPrompt: {
76322
76324
  en: `### Tools
@@ -76569,7 +76571,7 @@ var attioConnector = new ConnectorPlugin({
76569
76571
  description: "Connect to Attio for CRM data and relationship intelligence.",
76570
76572
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/2qqx99vvXJojUM3tSrSWPX/1e7c35e13da6b365b8b475c1effe568f/attio.svg",
76571
76573
  parameters: parameters33,
76572
- releaseFlag: { dev1: true, dev2: false, prod: false },
76574
+ releaseFlag: { dev1: true, dev2: true, prod: true },
76573
76575
  onboarding: attioOnboarding,
76574
76576
  systemPrompt: {
76575
76577
  en: `### Tools
@@ -77586,7 +77588,7 @@ var hubspotConnector = new ConnectorPlugin({
77586
77588
  description: "Connect to HubSpot CRM for contacts, deals, companies, and marketing data using a Personal Access Key.",
77587
77589
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/5UcSkKkzhUMA4RsM45ynuo/43b967e36915ca0fc5d277684b204320/hubspot.svg",
77588
77590
  parameters: parameters36,
77589
- releaseFlag: { dev1: true, dev2: false, prod: false },
77591
+ releaseFlag: { dev1: true, dev2: true, prod: true },
77590
77592
  onboarding: hubspotOnboarding2,
77591
77593
  systemPrompt: {
77592
77594
  en: `### Tools
@@ -77854,7 +77856,7 @@ var jiraConnector = new ConnectorPlugin({
77854
77856
  description: "Connect to Jira Cloud for issue tracking, project management, and workflow data retrieval using API token authentication.",
77855
77857
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/5zt4yjb36szSPPkCECYlPL/bc3e7223dc84fb16a1cce53a80f5afcc/jira.png",
77856
77858
  parameters: parameters37,
77857
- releaseFlag: { dev1: true, dev2: false, prod: false },
77859
+ releaseFlag: { dev1: true, dev2: true, prod: true },
77858
77860
  onboarding: jiraOnboarding,
77859
77861
  systemPrompt: {
77860
77862
  en: `### Tools
@@ -78129,7 +78131,7 @@ var linearConnector = new ConnectorPlugin({
78129
78131
  description: "Connect to Linear for project management data \u2014 issues, projects, teams, cycles, and more.",
78130
78132
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6oR77h6TeniXGdmnp2P2LX/a2ac8630ae52d164363adb0c695d9f0b/linear.webp",
78131
78133
  parameters: parameters38,
78132
- releaseFlag: { dev1: true, dev2: false, prod: false },
78134
+ releaseFlag: { dev1: true, dev2: true, prod: true },
78133
78135
  onboarding: linearOnboarding,
78134
78136
  systemPrompt: {
78135
78137
  en: `### Tools
@@ -78391,7 +78393,7 @@ var asanaConnector = new ConnectorPlugin({
78391
78393
  description: "Connect to Asana for project management, task tracking, and team collaboration data.",
78392
78394
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/3eIdaoqzIIZs2Md0OoDJMf/2fa66e0841adb985da4d3120466f3ec4/asana-icon.png",
78393
78395
  parameters: parameters39,
78394
- releaseFlag: { dev1: true, dev2: false, prod: false },
78396
+ releaseFlag: { dev1: true, dev2: true, prod: true },
78395
78397
  onboarding: asanaOnboarding,
78396
78398
  systemPrompt: {
78397
78399
  en: `### Tools
@@ -78716,7 +78718,7 @@ var clickhouseConnector = new ConnectorPlugin({
78716
78718
  description: "Connect to ClickHouse for high-performance columnar analytics and real-time data processing.",
78717
78719
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/MencimqP92UmucqstLl51/d9f2b6160206f5454b26e223a763ab8f/clickhouse.png",
78718
78720
  parameters: parameters40,
78719
- releaseFlag: { dev1: true, dev2: false, prod: false },
78721
+ releaseFlag: { dev1: true, dev2: true, prod: true },
78720
78722
  onboarding: clickhouseOnboarding,
78721
78723
  systemPrompt: {
78722
78724
  en: `### Tools
@@ -79124,7 +79126,7 @@ var mongodbConnector = new ConnectorPlugin({
79124
79126
  description: "Connect to MongoDB for document-oriented data storage and querying.",
79125
79127
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/48JSUx9HE6oSa9JrHGg2E1/12b4cac65924cac3641d4bafcef37dbe/mongodb-icon.webp",
79126
79128
  parameters: parameters41,
79127
- releaseFlag: { dev1: true, dev2: false, prod: false },
79129
+ releaseFlag: { dev1: true, dev2: true, prod: true },
79128
79130
  onboarding: mongodbOnboarding,
79129
79131
  systemPrompt: {
79130
79132
  en: `### Tools
@@ -79308,7 +79310,7 @@ var notionConnector = new ConnectorPlugin({
79308
79310
  description: "Connect to Notion to query databases, pages, and workspace content using an Internal Integration Token.",
79309
79311
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/797V5GDDTA8bsfKUHBCoQO/290ec49b70b68ddb4acd3bf0a6ab8bda/notion-icon.webp",
79310
79312
  parameters: parameters42,
79311
- releaseFlag: { dev1: true, dev2: false, prod: false },
79313
+ releaseFlag: { dev1: true, dev2: true, prod: true },
79312
79314
  onboarding: notionOnboarding,
79313
79315
  systemPrompt: {
79314
79316
  en: `### Tools
@@ -79624,7 +79626,7 @@ var notionOauthConnector = new ConnectorPlugin({
79624
79626
  description: "Connect to Notion to query databases, pages, and workspace content using OAuth.",
79625
79627
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/797V5GDDTA8bsfKUHBCoQO/290ec49b70b68ddb4acd3bf0a6ab8bda/notion-icon.webp",
79626
79628
  parameters: parameters43,
79627
- releaseFlag: { dev1: true, dev2: false, prod: false },
79629
+ releaseFlag: { dev1: true, dev2: true, prod: true },
79628
79630
  onboarding: notionOauthOnboarding,
79629
79631
  proxyPolicy: {
79630
79632
  allowlist: [
@@ -81237,7 +81239,7 @@ var mailchimpConnector = new ConnectorPlugin({
81237
81239
  description: "Connect to Mailchimp for email marketing, audiences, campaigns, and analytics.",
81238
81240
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/19Rac6B8eGiLpQb4lKMbG3/10f567f85572aeb16f2ee6aaa6602987/mailchimp.png",
81239
81241
  parameters: parameters47,
81240
- releaseFlag: { dev1: true, dev2: false, prod: false },
81242
+ releaseFlag: { dev1: true, dev2: true, prod: true },
81241
81243
  onboarding: mailchimpOnboarding,
81242
81244
  systemPrompt: {
81243
81245
  en: `### Tools
@@ -81883,7 +81885,7 @@ var customerioConnector = new ConnectorPlugin({
81883
81885
  description: "Connect to Customer.io App API for reading customer data, managing campaigns, segments, and sending transactional messages.",
81884
81886
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/nngohabT7oHDIgQYAVBpz/6f6c7662ef4692eb9869e3e69dd57114/customerio.png",
81885
81887
  parameters: parameters49,
81886
- releaseFlag: { dev1: true, dev2: false, prod: false },
81888
+ releaseFlag: { dev1: true, dev2: true, prod: true },
81887
81889
  onboarding: customerioOnboarding,
81888
81890
  systemPrompt: {
81889
81891
  en: `### Tools
@@ -82259,7 +82261,7 @@ var gmailConnector = new ConnectorPlugin({
82259
82261
  description: "Connect to Gmail for email data access using a service account with domain-wide delegation. Read-only access to messages, threads, and labels.",
82260
82262
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/4V3rfaSc1ksFIt2eHBNIwJ/7f3be41a154a6d96dcf229ed0e5858c9/Gmail_icon__2020_.svg.png",
82261
82263
  parameters: parameters50,
82262
- releaseFlag: { dev1: true, dev2: false, prod: false },
82264
+ releaseFlag: { dev1: true, dev2: true, prod: true },
82263
82265
  onboarding: gmailOnboarding,
82264
82266
  systemPrompt: {
82265
82267
  en: `### Tools
@@ -83528,7 +83530,7 @@ var zendeskConnector = new ConnectorPlugin({
83528
83530
  description: "Connect to Zendesk Support for tickets, users, organizations, and customer service data using an API token.",
83529
83531
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/7e9Q7PwV6MJRJMj543m2gl/55385fae903ccfa1599e35be9d3516aa/zendesk-icon.svg",
83530
83532
  parameters: parameters53,
83531
- releaseFlag: { dev1: true, dev2: false, prod: false },
83533
+ releaseFlag: { dev1: true, dev2: true, prod: true },
83532
83534
  onboarding: zendeskOnboarding,
83533
83535
  systemPrompt: {
83534
83536
  en: `### Tools
@@ -84151,7 +84153,7 @@ var intercomConnector = new ConnectorPlugin({
84151
84153
  description: "Connect to Intercom for contacts, conversations, companies, and customer engagement data using an Access Token.",
84152
84154
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/sb2cRMGClpId0LKiSqsok/ae90a0849f21ffe3faf73e04a5676b45/intercom.svg",
84153
84155
  parameters: parameters55,
84154
- releaseFlag: { dev1: true, dev2: false, prod: false },
84156
+ releaseFlag: { dev1: true, dev2: true, prod: true },
84155
84157
  onboarding: intercomOnboarding,
84156
84158
  systemPrompt: {
84157
84159
  en: `### Tools
@@ -84871,7 +84873,7 @@ var mixpanelConnector = new ConnectorPlugin({
84871
84873
  description: "Connect to Mixpanel for product analytics, event tracking, and user behavior analysis.",
84872
84874
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/7ykz0vNRjMqvTVrxS8wsj1/b2cd795be5b373877dee77cc6147c758/images__3_.png",
84873
84875
  parameters: parameters57,
84874
- releaseFlag: { dev1: true, dev2: false, prod: false },
84876
+ releaseFlag: { dev1: true, dev2: true, prod: true },
84875
84877
  onboarding: mixpanelOnboarding,
84876
84878
  systemPrompt: {
84877
84879
  en: `### Tools
@@ -85366,7 +85368,7 @@ var backlogConnector = new ConnectorPlugin({
85366
85368
  description: "Connect to Nulab Backlog for project management, issue tracking, and wiki data retrieval using API key authentication.",
85367
85369
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6KcVBGf3mUHnuCOQgQMvtT/e8558c7990e40e3be46948e9476190fb/backlog-favicon.svg",
85368
85370
  parameters: parameters59,
85369
- releaseFlag: { dev1: true, dev2: true, prod: false },
85371
+ releaseFlag: { dev1: true, dev2: true, prod: true },
85370
85372
  onboarding: backlogOnboarding,
85371
85373
  systemPrompt: {
85372
85374
  en: `### Tools
@@ -85804,7 +85806,7 @@ var gammaConnector = new ConnectorPlugin({
85804
85806
  description: "Connect to Gamma for AI-powered presentation, document, webpage, and social post generation.",
85805
85807
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/KoMGPpPcgtB9oDYe1OBjS/1ba7eb061c4497106bf6d249866dc471/gamma.svg",
85806
85808
  parameters: parameters60,
85807
- releaseFlag: { dev1: true, dev2: false, prod: false },
85809
+ releaseFlag: { dev1: true, dev2: true, prod: true },
85808
85810
  onboarding: gammaOnboarding,
85809
85811
  systemPrompt: {
85810
85812
  en: `### Tools
@@ -86084,7 +86086,7 @@ var sentryConnector = new ConnectorPlugin({
86084
86086
  description: "Connect to Sentry for error tracking and performance monitoring data.",
86085
86087
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/4B8ZEGFGjTeMWNnXQb1dAL/ac10f813f02353f5b0cbe64fb5c06d8f/sentry.svg",
86086
86088
  parameters: parameters61,
86087
- releaseFlag: { dev1: true, dev2: false, prod: false },
86089
+ releaseFlag: { dev1: true, dev2: true, prod: true },
86088
86090
  onboarding: sentryOnboarding,
86089
86091
  systemPrompt: {
86090
86092
  en: `### Tools
@@ -86288,6 +86290,389 @@ await sentry.updateIssue("12345", { status: "resolved" });
86288
86290
  }
86289
86291
  });
86290
86292
 
86293
+ // ../connectors/src/connectors/salesforce/setup.ts
86294
+ var salesforceOnboarding = new ConnectorOnboarding({
86295
+ connectionSetupInstructions: {
86296
+ en: `#### Create a Connected App in Salesforce
86297
+ 1. In Salesforce Setup, go to App Manager \u2192 New Connected App
86298
+ 2. Under API (Enable OAuth Settings), check "Enable OAuth Settings"
86299
+ 3. Add OAuth scopes: "Manage user data via APIs (api)" and "Perform requests at any time (refresh_token, offline_access)"
86300
+ 4. Save and note the Consumer Key (client_id) and Consumer Secret (client_secret)
86301
+
86302
+ #### Allow Username-Password Flow
86303
+ 1. Go to Setup \u2192 Identity \u2192 OAuth and OpenID Connect Settings
86304
+ 2. Enable "Allow OAuth Username-Password Flows"
86305
+
86306
+ #### Reset your Security Token
86307
+ 1. Go to Settings \u2192 My Personal Information \u2192 Reset My Security Token
86308
+ 2. Salesforce emails you a new security token \u2014 append it to your password when entering the Password parameter (password + securityToken)
86309
+
86310
+ #### Sandbox vs Production
86311
+ - Leave Use Sandbox as "false" (or empty) to connect to production (login.salesforce.com)
86312
+ - Set Use Sandbox to "true" to connect to a sandbox (test.salesforce.com)`,
86313
+ ja: `#### Salesforce \u3067 Connected App \u3092\u4F5C\u6210
86314
+ 1. Setup \u2192 App Manager \u2192 New Connected App
86315
+ 2. API (Enable OAuth Settings) \u30BB\u30AF\u30B7\u30E7\u30F3\u3067 "Enable OAuth Settings" \u3092\u6709\u52B9\u5316
86316
+ 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
86317
+ 4. \u4FDD\u5B58\u5F8C\u3001Consumer Key (client_id) \u3068 Consumer Secret (client_secret) \u3092\u63A7\u3048\u308B
86318
+
86319
+ #### Username-Password Flow \u3092\u8A31\u53EF
86320
+ 1. Setup \u2192 Identity \u2192 OAuth and OpenID Connect Settings
86321
+ 2. "Allow OAuth Username-Password Flows" \u3092\u6709\u52B9\u5316
86322
+
86323
+ #### Security Token \u306E\u767A\u884C
86324
+ 1. \u500B\u4EBA\u8A2D\u5B9A \u2192 My Personal Information \u2192 Reset My Security Token
86325
+ 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
86326
+
86327
+ #### Sandbox / Production
86328
+ - \u672C\u756A (login.salesforce.com) \u306E\u5834\u5408: Use Sandbox \u3092 "false" \u307E\u305F\u306F\u672A\u5165\u529B
86329
+ - Sandbox (test.salesforce.com) \u306E\u5834\u5408: Use Sandbox \u3092 "true" \u306B\u8A2D\u5B9A`
86330
+ },
86331
+ dataOverviewInstructions: {
86332
+ en: `1. Call salesforce_request with GET /services/data/v60.0/sobjects/ to list available sObjects (standard + custom)
86333
+ 2. Call salesforce_request with GET /services/data/v60.0/sobjects/Account/describe to inspect Account fields; repeat for Contact, Opportunity, Lead as needed
86334
+ 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`,
86335
+ 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
86336
+ 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
86337
+ 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`
86338
+ }
86339
+ });
86340
+
86341
+ // ../connectors/src/connectors/salesforce/parameters.ts
86342
+ var parameters62 = {
86343
+ username: new ParameterDefinition({
86344
+ slug: "username",
86345
+ name: "Username",
86346
+ description: "Your Salesforce account username (the email you use to sign in).",
86347
+ envVarBaseKey: "SALESFORCE_USERNAME",
86348
+ type: "text",
86349
+ secret: false,
86350
+ required: true
86351
+ }),
86352
+ password: new ParameterDefinition({
86353
+ slug: "password",
86354
+ name: "Password",
86355
+ 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.",
86356
+ envVarBaseKey: "SALESFORCE_PASSWORD",
86357
+ type: "text",
86358
+ secret: true,
86359
+ required: true
86360
+ }),
86361
+ clientId: new ParameterDefinition({
86362
+ slug: "client-id",
86363
+ name: "Consumer Key",
86364
+ 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.",
86365
+ envVarBaseKey: "SALESFORCE_CLIENT_ID",
86366
+ type: "text",
86367
+ secret: false,
86368
+ required: true
86369
+ }),
86370
+ clientSecret: new ParameterDefinition({
86371
+ slug: "client-secret",
86372
+ name: "Consumer Secret",
86373
+ description: "The Consumer Secret (client_secret) of your Salesforce Connected App.",
86374
+ envVarBaseKey: "SALESFORCE_CLIENT_SECRET",
86375
+ type: "text",
86376
+ secret: true,
86377
+ required: true
86378
+ }),
86379
+ isSandbox: new ParameterDefinition({
86380
+ slug: "is-sandbox",
86381
+ name: "Use Sandbox",
86382
+ description: 'Set to "true" to authenticate against a Salesforce sandbox (test.salesforce.com) instead of production (login.salesforce.com). Defaults to "false".',
86383
+ envVarBaseKey: "SALESFORCE_IS_SANDBOX",
86384
+ type: "text",
86385
+ secret: false,
86386
+ required: false
86387
+ })
86388
+ };
86389
+
86390
+ // ../connectors/src/connectors/salesforce/tools/request.ts
86391
+ import { z as z77 } from "zod";
86392
+ var REQUEST_TIMEOUT_MS59 = 6e4;
86393
+ var inputSchema75 = z77.object({
86394
+ toolUseIntent: z77.string().optional().describe(
86395
+ "Brief description of what you intend to accomplish with this tool call"
86396
+ ),
86397
+ connectionId: z77.string().describe("ID of the Salesforce connection to use"),
86398
+ method: z77.enum(["GET", "POST", "PATCH", "DELETE"]).describe(
86399
+ "HTTP method. GET for reading resources and SOQL queries, POST for creating, PATCH for updating, DELETE for removing."
86400
+ ),
86401
+ path: z77.string().describe(
86402
+ "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/'."
86403
+ ),
86404
+ body: z77.record(z77.string(), z77.unknown()).optional().describe("Request body (JSON) for POST/PATCH requests")
86405
+ });
86406
+ var outputSchema75 = z77.discriminatedUnion("success", [
86407
+ z77.object({
86408
+ success: z77.literal(true),
86409
+ status: z77.number(),
86410
+ data: z77.record(z77.string(), z77.unknown())
86411
+ }),
86412
+ z77.object({
86413
+ success: z77.literal(false),
86414
+ error: z77.string()
86415
+ })
86416
+ ]);
86417
+ var requestTool47 = new ConnectorTool({
86418
+ name: "request",
86419
+ description: `Send authenticated requests to the Salesforce REST API.
86420
+ 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.
86421
+ 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.
86422
+ Prefer SOQL via the /query endpoint for filtered, joined, or aggregated reads rather than paginating /sobjects/{Type} endpoints.`,
86423
+ inputSchema: inputSchema75,
86424
+ outputSchema: outputSchema75,
86425
+ async execute({ connectionId, method, path: path5, body }, connections) {
86426
+ const connection2 = connections.find((c6) => c6.id === connectionId);
86427
+ if (!connection2) {
86428
+ return {
86429
+ success: false,
86430
+ error: `Connection ${connectionId} not found`
86431
+ };
86432
+ }
86433
+ console.log(
86434
+ `[connector-request] salesforce/${connection2.name}: ${method} ${path5}`
86435
+ );
86436
+ try {
86437
+ const username = parameters62.username.getValue(connection2);
86438
+ const password = parameters62.password.getValue(connection2);
86439
+ const clientId = parameters62.clientId.getValue(connection2);
86440
+ const clientSecret = parameters62.clientSecret.getValue(connection2);
86441
+ const isSandbox = parameters62.isSandbox.tryGetValue(connection2)?.toLowerCase() === "true";
86442
+ const loginHost = isSandbox ? "https://test.salesforce.com" : "https://login.salesforce.com";
86443
+ const tokenBody = new URLSearchParams({
86444
+ grant_type: "password",
86445
+ client_id: clientId,
86446
+ client_secret: clientSecret,
86447
+ username,
86448
+ password
86449
+ });
86450
+ const tokenRes = await fetch(`${loginHost}/services/oauth2/token`, {
86451
+ method: "POST",
86452
+ headers: {
86453
+ "Content-Type": "application/x-www-form-urlencoded"
86454
+ },
86455
+ body: tokenBody.toString()
86456
+ });
86457
+ if (!tokenRes.ok) {
86458
+ const errText = await tokenRes.text().catch(() => "(unreadable body)");
86459
+ return {
86460
+ success: false,
86461
+ error: `Failed to obtain access token: ${tokenRes.status} ${tokenRes.statusText} \u2014 ${errText}`
86462
+ };
86463
+ }
86464
+ const tokenJson = await tokenRes.json();
86465
+ if (!tokenJson.access_token || !tokenJson.instance_url) {
86466
+ return {
86467
+ success: false,
86468
+ error: "access_token or instance_url not found in token response"
86469
+ };
86470
+ }
86471
+ const url = `${tokenJson.instance_url}${path5.startsWith("/") ? "" : "/"}${path5}`;
86472
+ const controller = new AbortController();
86473
+ const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS59);
86474
+ try {
86475
+ const response = await fetch(url, {
86476
+ method,
86477
+ headers: {
86478
+ Authorization: `Bearer ${tokenJson.access_token}`,
86479
+ "Content-Type": "application/json"
86480
+ },
86481
+ body: body ? JSON.stringify(body) : void 0,
86482
+ signal: controller.signal
86483
+ });
86484
+ const text = await response.text();
86485
+ let data;
86486
+ try {
86487
+ data = text ? JSON.parse(text) : {};
86488
+ } catch {
86489
+ data = { raw: text };
86490
+ }
86491
+ if (!response.ok) {
86492
+ let errorMessage = `HTTP ${response.status} ${response.statusText}`;
86493
+ if (Array.isArray(data) && data.length > 0) {
86494
+ const first = data[0];
86495
+ if (first.message) {
86496
+ errorMessage = first.errorCode ? `${first.errorCode}: ${first.message}` : first.message;
86497
+ }
86498
+ } else if (typeof data.message === "string") {
86499
+ errorMessage = data.message;
86500
+ } else if (typeof data.error === "string") {
86501
+ errorMessage = data.error;
86502
+ }
86503
+ return { success: false, error: errorMessage };
86504
+ }
86505
+ return { success: true, status: response.status, data };
86506
+ } finally {
86507
+ clearTimeout(timeout);
86508
+ }
86509
+ } catch (err) {
86510
+ const msg = err instanceof Error ? err.message : String(err);
86511
+ return { success: false, error: msg };
86512
+ }
86513
+ }
86514
+ });
86515
+
86516
+ // ../connectors/src/connectors/salesforce/index.ts
86517
+ var tools62 = { request: requestTool47 };
86518
+ var salesforceConnector = new ConnectorPlugin({
86519
+ slug: "salesforce",
86520
+ authType: AUTH_TYPES.USER_PASSWORD,
86521
+ name: "Salesforce",
86522
+ description: "Connect to Salesforce CRM for accounts, contacts, opportunities, leads, cases, and custom objects via SOQL and the REST API.",
86523
+ iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6vZlbrUKhxXIiuvWJlb8YB/bbc5e08b88de46c8ed338a74c7d0abb3/salesforce-icon.png",
86524
+ parameters: parameters62,
86525
+ releaseFlag: { dev1: true, dev2: false, prod: false },
86526
+ onboarding: salesforceOnboarding,
86527
+ systemPrompt: {
86528
+ en: `### Tools
86529
+
86530
+ - \`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.
86531
+
86532
+ ### Business Logic
86533
+
86534
+ The business logic type for this connector is "typescript". Use the connector SDK in your handler. Do NOT read credentials from environment variables.
86535
+
86536
+ SDK methods (client created via \`connection(connectionId)\`):
86537
+ - \`client.request(path, init?)\` \u2014 low-level authenticated fetch against the Salesforce instance URL
86538
+ - \`client.query(soql)\` \u2014 run a SOQL query and return \`{ totalSize, done, records, nextRecordsUrl? }\`
86539
+ - \`client.queryMore(nextRecordsUrl)\` \u2014 fetch the next page of SOQL results
86540
+ - \`client.describeSObject(objectType)\` \u2014 describe an sObject's metadata
86541
+ - \`client.getRecord(objectType, id, options?)\` \u2014 fetch a single record (optionally restrict fields)
86542
+ - \`client.createRecord(objectType, fields)\` \u2014 create a new record
86543
+ - \`client.updateRecord(objectType, id, fields)\` \u2014 patch an existing record
86544
+ - \`client.deleteRecord(objectType, id)\` \u2014 delete a record
86545
+
86546
+ \`\`\`ts
86547
+ import type { Context } from "hono";
86548
+ import { connection } from "@squadbase/vite-server/connectors/salesforce";
86549
+
86550
+ const salesforce = connection("<connectionId>");
86551
+
86552
+ export default async function handler(c: Context) {
86553
+ const { industry, limit = 50 } = await c.req.json<{
86554
+ industry?: string;
86555
+ limit?: number;
86556
+ }>();
86557
+
86558
+ const where = industry
86559
+ ? \`WHERE Industry = '\${industry.replace(/'/g, "\\\\'")}'\`
86560
+ : "";
86561
+ const soql = \`SELECT Id, Name, Industry, AnnualRevenue FROM Account \${where} ORDER BY AnnualRevenue DESC NULLS LAST LIMIT \${limit}\`;
86562
+
86563
+ const { records } = await salesforce.query<{
86564
+ Id: string;
86565
+ Name: string;
86566
+ Industry: string | null;
86567
+ AnnualRevenue: number | null;
86568
+ }>(soql);
86569
+
86570
+ return c.json({ accounts: records });
86571
+ }
86572
+ \`\`\`
86573
+
86574
+ ### Salesforce REST API Reference
86575
+
86576
+ - Login host: \`https://login.salesforce.com\` (production) or \`https://test.salesforce.com\` (sandbox)
86577
+ - Token endpoint: \`POST /services/oauth2/token\` (grant_type=password + client_id/secret + username/password)
86578
+ - Base path after login: \`{instance_url}/services/data/v60.0\`
86579
+ - Authentication: Bearer token (handled automatically per request)
86580
+ - Pagination (SOQL): follow \`nextRecordsUrl\` from the response (absolute path starting with \`/services/data/v60.0/query/...\`)
86581
+
86582
+ #### Common Endpoints
86583
+ - GET \`/services/data/\` \u2014 List available API versions
86584
+ - GET \`/services/data/v60.0/sobjects/\` \u2014 List all sObjects (standard + custom)
86585
+ - GET \`/services/data/v60.0/sobjects/{Type}/describe\` \u2014 Describe an sObject (fields, relationships, picklists)
86586
+ - GET \`/services/data/v60.0/sobjects/{Type}/{id}\` \u2014 Get a record (supports \`?fields=...\`)
86587
+ - POST \`/services/data/v60.0/sobjects/{Type}\` \u2014 Create a record
86588
+ - PATCH \`/services/data/v60.0/sobjects/{Type}/{id}\` \u2014 Update a record
86589
+ - DELETE \`/services/data/v60.0/sobjects/{Type}/{id}\` \u2014 Delete a record
86590
+ - GET \`/services/data/v60.0/query?q={soql}\` \u2014 Run SOQL
86591
+ - GET \`/services/data/v60.0/search?q={sosl}\` \u2014 Run SOSL
86592
+
86593
+ #### SOQL Reference
86594
+ - SELECT column list is required (no \`SELECT *\`)
86595
+ - Filter: \`WHERE\`, \`AND\` / \`OR\`, parent/child relationship fields (e.g., \`Account.Name\`)
86596
+ - Sort: \`ORDER BY field [ASC|DESC] [NULLS FIRST|NULLS LAST]\`
86597
+ - Paginate: \`LIMIT n\`, \`OFFSET m\`; for large result sets, follow \`nextRecordsUrl\` instead of OFFSET
86598
+ - Aggregate: \`GROUP BY\`, \`HAVING\`, \`COUNT()\`, \`SUM()\`, \`AVG()\`, \`MIN()\`, \`MAX()\`
86599
+ - Parent-to-child subquery: \`SELECT Id, Name, (SELECT Id, Email FROM Contacts) FROM Account\``,
86600
+ ja: `### \u30C4\u30FC\u30EB
86601
+
86602
+ - \`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
86603
+
86604
+ ### Business Logic
86605
+
86606
+ \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
86607
+
86608
+ SDK\u30E1\u30BD\u30C3\u30C9 (\`connection(connectionId)\` \u3067\u4F5C\u6210\u3057\u305F\u30AF\u30E9\u30A4\u30A2\u30F3\u30C8):
86609
+ - \`client.request(path, init?)\` \u2014 Salesforce \u306E instance URL \u306B\u5BFE\u3059\u308B\u4F4E\u30EC\u30D9\u30EB\u306E\u8A8D\u8A3C\u4ED8\u304D fetch
86610
+ - \`client.query(soql)\` \u2014 SOQL \u30AF\u30A8\u30EA\u3092\u5B9F\u884C\u3057 \`{ totalSize, done, records, nextRecordsUrl? }\` \u3092\u8FD4\u5374
86611
+ - \`client.queryMore(nextRecordsUrl)\` \u2014 SOQL \u7D50\u679C\u306E\u6B21\u30DA\u30FC\u30B8\u3092\u53D6\u5F97
86612
+ - \`client.describeSObject(objectType)\` \u2014 sObject \u306E\u30E1\u30BF\u30C7\u30FC\u30BF\u3092\u53D6\u5F97
86613
+ - \`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
86614
+ - \`client.createRecord(objectType, fields)\` \u2014 \u30EC\u30B3\u30FC\u30C9\u3092\u65B0\u898F\u4F5C\u6210
86615
+ - \`client.updateRecord(objectType, id, fields)\` \u2014 \u65E2\u5B58\u30EC\u30B3\u30FC\u30C9\u3092\u66F4\u65B0\uFF08PATCH\uFF09
86616
+ - \`client.deleteRecord(objectType, id)\` \u2014 \u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664
86617
+
86618
+ \`\`\`ts
86619
+ import type { Context } from "hono";
86620
+ import { connection } from "@squadbase/vite-server/connectors/salesforce";
86621
+
86622
+ const salesforce = connection("<connectionId>");
86623
+
86624
+ export default async function handler(c: Context) {
86625
+ const { industry, limit = 50 } = await c.req.json<{
86626
+ industry?: string;
86627
+ limit?: number;
86628
+ }>();
86629
+
86630
+ const where = industry
86631
+ ? \`WHERE Industry = '\${industry.replace(/'/g, "\\\\'")}'\`
86632
+ : "";
86633
+ const soql = \`SELECT Id, Name, Industry, AnnualRevenue FROM Account \${where} ORDER BY AnnualRevenue DESC NULLS LAST LIMIT \${limit}\`;
86634
+
86635
+ const { records } = await salesforce.query<{
86636
+ Id: string;
86637
+ Name: string;
86638
+ Industry: string | null;
86639
+ AnnualRevenue: number | null;
86640
+ }>(soql);
86641
+
86642
+ return c.json({ accounts: records });
86643
+ }
86644
+ \`\`\`
86645
+
86646
+ ### Salesforce REST API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
86647
+
86648
+ - \u30ED\u30B0\u30A4\u30F3\u30DB\u30B9\u30C8: \`https://login.salesforce.com\`\uFF08\u672C\u756A\uFF09\u307E\u305F\u306F \`https://test.salesforce.com\`\uFF08Sandbox\uFF09
86649
+ - \u30C8\u30FC\u30AF\u30F3\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8: \`POST /services/oauth2/token\`\uFF08grant_type=password + client_id/secret + username/password\uFF09
86650
+ - \u30ED\u30B0\u30A4\u30F3\u5F8C\u306E\u30D9\u30FC\u30B9\u30D1\u30B9: \`{instance_url}/services/data/v60.0\`
86651
+ - \u8A8D\u8A3C: Bearer \u30C8\u30FC\u30AF\u30F3\uFF08\u30EA\u30AF\u30A8\u30B9\u30C8\u3054\u3068\u306B\u81EA\u52D5\u8A2D\u5B9A\uFF09
86652
+ - \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
86653
+
86654
+ #### \u4E3B\u8981\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8
86655
+ - GET \`/services/data/\` \u2014 \u5229\u7528\u53EF\u80FD\u306A API \u30D0\u30FC\u30B8\u30E7\u30F3\u4E00\u89A7
86656
+ - GET \`/services/data/v60.0/sobjects/\` \u2014 sObject \u4E00\u89A7\uFF08\u6A19\u6E96 + \u30AB\u30B9\u30BF\u30E0\uFF09
86657
+ - 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
86658
+ - GET \`/services/data/v60.0/sobjects/{Type}/{id}\` \u2014 \u30EC\u30B3\u30FC\u30C9\u53D6\u5F97\uFF08\`?fields=...\` \u3067\u7D5E\u308A\u8FBC\u307F\u53EF\uFF09
86659
+ - POST \`/services/data/v60.0/sobjects/{Type}\` \u2014 \u30EC\u30B3\u30FC\u30C9\u4F5C\u6210
86660
+ - PATCH \`/services/data/v60.0/sobjects/{Type}/{id}\` \u2014 \u30EC\u30B3\u30FC\u30C9\u66F4\u65B0
86661
+ - DELETE \`/services/data/v60.0/sobjects/{Type}/{id}\` \u2014 \u30EC\u30B3\u30FC\u30C9\u524A\u9664
86662
+ - GET \`/services/data/v60.0/query?q={soql}\` \u2014 SOQL \u3092\u5B9F\u884C
86663
+ - GET \`/services/data/v60.0/search?q={sosl}\` \u2014 SOSL \u3092\u5B9F\u884C
86664
+
86665
+ #### SOQL \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
86666
+ - SELECT \u5217\u306E\u660E\u793A\u304C\u5FC5\u9808\uFF08\`SELECT *\` \u306F\u4E0D\u53EF\uFF09
86667
+ - \u30D5\u30A3\u30EB\u30BF: \`WHERE\`\u3001\`AND\` / \`OR\`\u3001\u89AA\u5B50\u30EA\u30EC\u30FC\u30B7\u30E7\u30F3\u53C2\u7167\uFF08\u4F8B: \`Account.Name\`\uFF09
86668
+ - \u4E26\u3073\u66FF\u3048: \`ORDER BY field [ASC|DESC] [NULLS FIRST|NULLS LAST]\`
86669
+ - \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
86670
+ - \u96C6\u8A08: \`GROUP BY\`, \`HAVING\`, \`COUNT()\`, \`SUM()\`, \`AVG()\`, \`MIN()\`, \`MAX()\`
86671
+ - \u89AA\u2192\u5B50\u30B5\u30D6\u30AF\u30A8\u30EA: \`SELECT Id, Name, (SELECT Id, Email FROM Contacts) FROM Account\``
86672
+ },
86673
+ tools: tools62
86674
+ });
86675
+
86291
86676
  // ../connectors/src/connectors/registry.ts
86292
86677
  var plugins = {
86293
86678
  snowflake: snowflakeConnector,
@@ -86350,7 +86735,8 @@ var plugins = {
86350
86735
  grafana: grafanaConnector,
86351
86736
  backlog: backlogConnector,
86352
86737
  gamma: gammaConnector,
86353
- sentry: sentryConnector
86738
+ sentry: sentryConnector,
86739
+ salesforce: salesforceConnector
86354
86740
  };
86355
86741
  var connectors = {
86356
86742
  ...plugins,
@@ -86823,62 +87209,62 @@ function createDbtClient(entry, slug) {
86823
87209
  var { getQuery, loadConnections, reloadEnvFile, watchConnectionsFile } = createConnectorRegistry();
86824
87210
 
86825
87211
  // src/types/server-logic.ts
86826
- import { z as z77 } from "zod";
86827
- var parameterMetaSchema = z77.object({
86828
- name: z77.string(),
86829
- type: z77.enum(["string", "number", "boolean"]),
86830
- description: z77.string(),
86831
- required: z77.boolean().optional(),
86832
- default: z77.union([z77.string(), z77.number(), z77.boolean()]).optional()
86833
- });
86834
- var serverLogicCacheConfigSchema = z77.object({
86835
- ttl: z77.number(),
86836
- staleWhileRevalidate: z77.boolean().optional()
86837
- });
86838
- var serverLogicSchemaObjectSchema = z77.lazy(
86839
- () => z77.object({
86840
- type: z77.enum(["string", "number", "integer", "boolean", "object", "array", "null"]).optional(),
86841
- format: z77.string().optional(),
86842
- description: z77.string().optional(),
86843
- nullable: z77.boolean().optional(),
86844
- enum: z77.array(z77.union([z77.string(), z77.number(), z77.boolean(), z77.null()])).optional(),
87212
+ import { z as z78 } from "zod";
87213
+ var parameterMetaSchema = z78.object({
87214
+ name: z78.string(),
87215
+ type: z78.enum(["string", "number", "boolean"]),
87216
+ description: z78.string(),
87217
+ required: z78.boolean().optional(),
87218
+ default: z78.union([z78.string(), z78.number(), z78.boolean()]).optional()
87219
+ });
87220
+ var serverLogicCacheConfigSchema = z78.object({
87221
+ ttl: z78.number(),
87222
+ staleWhileRevalidate: z78.boolean().optional()
87223
+ });
87224
+ var serverLogicSchemaObjectSchema = z78.lazy(
87225
+ () => z78.object({
87226
+ type: z78.enum(["string", "number", "integer", "boolean", "object", "array", "null"]).optional(),
87227
+ format: z78.string().optional(),
87228
+ description: z78.string().optional(),
87229
+ nullable: z78.boolean().optional(),
87230
+ enum: z78.array(z78.union([z78.string(), z78.number(), z78.boolean(), z78.null()])).optional(),
86845
87231
  items: serverLogicSchemaObjectSchema.optional(),
86846
- properties: z77.record(z77.string(), serverLogicSchemaObjectSchema).optional(),
86847
- required: z77.array(z77.string()).optional(),
86848
- additionalProperties: z77.union([z77.boolean(), serverLogicSchemaObjectSchema]).optional(),
86849
- minimum: z77.number().optional(),
86850
- maximum: z77.number().optional(),
86851
- minLength: z77.number().optional(),
86852
- maxLength: z77.number().optional(),
86853
- pattern: z77.string().optional()
87232
+ properties: z78.record(z78.string(), serverLogicSchemaObjectSchema).optional(),
87233
+ required: z78.array(z78.string()).optional(),
87234
+ additionalProperties: z78.union([z78.boolean(), serverLogicSchemaObjectSchema]).optional(),
87235
+ minimum: z78.number().optional(),
87236
+ maximum: z78.number().optional(),
87237
+ minLength: z78.number().optional(),
87238
+ maxLength: z78.number().optional(),
87239
+ pattern: z78.string().optional()
86854
87240
  })
86855
87241
  );
86856
- var serverLogicMediaTypeSchema = z77.object({
87242
+ var serverLogicMediaTypeSchema = z78.object({
86857
87243
  schema: serverLogicSchemaObjectSchema.optional(),
86858
- example: z77.unknown().optional()
87244
+ example: z78.unknown().optional()
86859
87245
  });
86860
- var serverLogicResponseSchema = z77.object({
86861
- description: z77.string().optional(),
86862
- content: z77.record(z77.string(), serverLogicMediaTypeSchema).optional()
87246
+ var serverLogicResponseSchema = z78.object({
87247
+ description: z78.string().optional(),
87248
+ content: z78.record(z78.string(), serverLogicMediaTypeSchema).optional()
86863
87249
  });
86864
87250
  var jsonBaseFields = {
86865
- description: z77.string(),
86866
- parameters: z77.array(parameterMetaSchema).optional(),
87251
+ description: z78.string(),
87252
+ parameters: z78.array(parameterMetaSchema).optional(),
86867
87253
  response: serverLogicResponseSchema.optional(),
86868
87254
  cache: serverLogicCacheConfigSchema.optional()
86869
87255
  };
86870
- var jsonSqlServerLogicSchema = z77.object({
87256
+ var jsonSqlServerLogicSchema = z78.object({
86871
87257
  ...jsonBaseFields,
86872
- type: z77.literal("sql").optional(),
86873
- query: z77.string(),
86874
- connectionId: z77.string()
87258
+ type: z78.literal("sql").optional(),
87259
+ query: z78.string(),
87260
+ connectionId: z78.string()
86875
87261
  });
86876
- var jsonTypeScriptServerLogicSchema = z77.object({
87262
+ var jsonTypeScriptServerLogicSchema = z78.object({
86877
87263
  ...jsonBaseFields,
86878
- type: z77.literal("typescript"),
86879
- handlerPath: z77.string()
87264
+ type: z78.literal("typescript"),
87265
+ handlerPath: z78.string()
86880
87266
  });
86881
- var anyJsonServerLogicSchema = z77.union([
87267
+ var anyJsonServerLogicSchema = z78.union([
86882
87268
  jsonTypeScriptServerLogicSchema,
86883
87269
  jsonSqlServerLogicSchema
86884
87270
  ]);