@squadbase/vite-server 0.1.7-dev.4 → 0.1.7-dev.5

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
@@ -85030,7 +85030,7 @@ var grafanaConnector = new ConnectorPlugin({
85030
85030
  description: "Connect to Grafana for monitoring dashboards, datasource queries, and alerting.",
85031
85031
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/3nGaPhV94lXQsHcCtv4mXz/0559d42f83066e8ba79e78410806750c/grafana-icon.webp",
85032
85032
  parameters: parameters58,
85033
- releaseFlag: { dev1: true, dev2: false, prod: false },
85033
+ releaseFlag: { dev1: true, dev2: true, prod: true },
85034
85034
  onboarding: grafanaOnboarding,
85035
85035
  systemPrompt: {
85036
85036
  en: `### Tools
@@ -86199,42 +86199,6 @@ await sentry.updateIssue("12345", { status: "resolved" });
86199
86199
 
86200
86200
  // ../connectors/src/connectors/salesforce/setup.ts
86201
86201
  var salesforceOnboarding = new ConnectorOnboarding({
86202
- connectionSetupInstructions: {
86203
- en: `#### Create a Connected App in Salesforce
86204
- 1. In Salesforce Setup, go to App Manager \u2192 New Connected App
86205
- 2. Under API (Enable OAuth Settings), check "Enable OAuth Settings"
86206
- 3. Add OAuth scopes: "Manage user data via APIs (api)" and "Perform requests at any time (refresh_token, offline_access)"
86207
- 4. Save and note the Consumer Key (client_id) and Consumer Secret (client_secret)
86208
-
86209
- #### Allow Username-Password Flow
86210
- 1. Go to Setup \u2192 Identity \u2192 OAuth and OpenID Connect Settings
86211
- 2. Enable "Allow OAuth Username-Password Flows"
86212
-
86213
- #### Reset your Security Token
86214
- 1. Go to Settings \u2192 My Personal Information \u2192 Reset My Security Token
86215
- 2. Salesforce emails you a new security token \u2014 append it to your password when entering the Password parameter (password + securityToken)
86216
-
86217
- #### Sandbox vs Production
86218
- - Leave Use Sandbox as "false" (or empty) to connect to production (login.salesforce.com)
86219
- - Set Use Sandbox to "true" to connect to a sandbox (test.salesforce.com)`,
86220
- ja: `#### Salesforce \u3067 Connected App \u3092\u4F5C\u6210
86221
- 1. Setup \u2192 App Manager \u2192 New Connected App
86222
- 2. API (Enable OAuth Settings) \u30BB\u30AF\u30B7\u30E7\u30F3\u3067 "Enable OAuth Settings" \u3092\u6709\u52B9\u5316
86223
- 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
86224
- 4. \u4FDD\u5B58\u5F8C\u3001Consumer Key (client_id) \u3068 Consumer Secret (client_secret) \u3092\u63A7\u3048\u308B
86225
-
86226
- #### Username-Password Flow \u3092\u8A31\u53EF
86227
- 1. Setup \u2192 Identity \u2192 OAuth and OpenID Connect Settings
86228
- 2. "Allow OAuth Username-Password Flows" \u3092\u6709\u52B9\u5316
86229
-
86230
- #### Security Token \u306E\u767A\u884C
86231
- 1. \u500B\u4EBA\u8A2D\u5B9A \u2192 My Personal Information \u2192 Reset My Security Token
86232
- 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
86233
-
86234
- #### Sandbox / Production
86235
- - \u672C\u756A (login.salesforce.com) \u306E\u5834\u5408: Use Sandbox \u3092 "false" \u307E\u305F\u306F\u672A\u5165\u529B
86236
- - Sandbox (test.salesforce.com) \u306E\u5834\u5408: Use Sandbox \u3092 "true" \u306B\u8A2D\u5B9A`
86237
- },
86238
86202
  dataOverviewInstructions: {
86239
86203
  en: `1. Call salesforce_request with GET /services/data/v60.0/sobjects/ to list available sObjects (standard + custom)
86240
86204
  2. Call salesforce_request with GET /services/data/v60.0/sobjects/Account/describe to inspect Account fields; repeat for Contact, Opportunity, Lead as needed
@@ -86247,28 +86211,19 @@ var salesforceOnboarding = new ConnectorOnboarding({
86247
86211
 
86248
86212
  // ../connectors/src/connectors/salesforce/parameters.ts
86249
86213
  var parameters62 = {
86250
- username: new ParameterDefinition({
86251
- slug: "username",
86252
- name: "Username",
86253
- description: "Your Salesforce account username (the email you use to sign in).",
86254
- envVarBaseKey: "SALESFORCE_USERNAME",
86214
+ instanceUrl: new ParameterDefinition({
86215
+ slug: "instance-url",
86216
+ name: "Instance URL",
86217
+ description: "Your Salesforce org's My Domain URL (e.g., https://yourorg.my.salesforce.com). Find it under Setup \u2192 Company Settings \u2192 My Domain \u2192 Current My Domain URL.",
86218
+ envVarBaseKey: "SALESFORCE_INSTANCE_URL",
86255
86219
  type: "text",
86256
86220
  secret: false,
86257
86221
  required: true
86258
86222
  }),
86259
- password: new ParameterDefinition({
86260
- slug: "password",
86261
- name: "Password",
86262
- 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.",
86263
- envVarBaseKey: "SALESFORCE_PASSWORD",
86264
- type: "text",
86265
- secret: true,
86266
- required: true
86267
- }),
86268
86223
  clientId: new ParameterDefinition({
86269
86224
  slug: "client-id",
86270
86225
  name: "Consumer Key",
86271
- 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.",
86226
+ description: "The Consumer Key (client_id) of your External Client App (or Connected App). The app must enable the OAuth 2.0 Client Credentials Flow and bind a Run-As user with API access.",
86272
86227
  envVarBaseKey: "SALESFORCE_CLIENT_ID",
86273
86228
  type: "text",
86274
86229
  secret: false,
@@ -86277,20 +86232,11 @@ var parameters62 = {
86277
86232
  clientSecret: new ParameterDefinition({
86278
86233
  slug: "client-secret",
86279
86234
  name: "Consumer Secret",
86280
- description: "The Consumer Secret (client_secret) of your Salesforce Connected App.",
86235
+ description: "The Consumer Secret (client_secret) of your External Client App (or Connected App).",
86281
86236
  envVarBaseKey: "SALESFORCE_CLIENT_SECRET",
86282
86237
  type: "text",
86283
86238
  secret: true,
86284
86239
  required: true
86285
- }),
86286
- isSandbox: new ParameterDefinition({
86287
- slug: "is-sandbox",
86288
- name: "Use Sandbox",
86289
- description: 'Set to "true" to authenticate against a Salesforce sandbox (test.salesforce.com) instead of production (login.salesforce.com). Defaults to "false".',
86290
- envVarBaseKey: "SALESFORCE_IS_SANDBOX",
86291
- type: "text",
86292
- secret: false,
86293
- required: false
86294
86240
  })
86295
86241
  };
86296
86242
 
@@ -86321,10 +86267,17 @@ var outputSchema75 = z77.discriminatedUnion("success", [
86321
86267
  error: z77.string()
86322
86268
  })
86323
86269
  ]);
86270
+ function normalizeInstanceUrl(raw) {
86271
+ const trimmed = raw.trim().replace(/\/+$/, "");
86272
+ if (!/^https?:\/\//i.test(trimmed)) {
86273
+ return `https://${trimmed}`;
86274
+ }
86275
+ return trimmed;
86276
+ }
86324
86277
  var requestTool47 = new ConnectorTool({
86325
86278
  name: "request",
86326
86279
  description: `Send authenticated requests to the Salesforce REST API.
86327
- 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.
86280
+ Authentication is handled automatically using the OAuth 2.0 Client Credentials Flow (External Client App or Connected App Consumer Key + Secret). An access token is obtained on each request, so the tool user only provides the API path.
86328
86281
  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.
86329
86282
  Prefer SOQL via the /query endpoint for filtered, joined, or aggregated reads rather than paginating /sobjects/{Type} endpoints.`,
86330
86283
  inputSchema: inputSchema75,
@@ -86341,20 +86294,16 @@ Prefer SOQL via the /query endpoint for filtered, joined, or aggregated reads ra
86341
86294
  `[connector-request] salesforce/${connection2.name}: ${method} ${path5}`
86342
86295
  );
86343
86296
  try {
86344
- const username = parameters62.username.getValue(connection2);
86345
- const password = parameters62.password.getValue(connection2);
86297
+ const instanceUrlParam = parameters62.instanceUrl.getValue(connection2);
86346
86298
  const clientId = parameters62.clientId.getValue(connection2);
86347
86299
  const clientSecret = parameters62.clientSecret.getValue(connection2);
86348
- const isSandbox = parameters62.isSandbox.tryGetValue(connection2)?.toLowerCase() === "true";
86349
- const loginHost = isSandbox ? "https://test.salesforce.com" : "https://login.salesforce.com";
86300
+ const instanceUrl = normalizeInstanceUrl(instanceUrlParam);
86350
86301
  const tokenBody = new URLSearchParams({
86351
- grant_type: "password",
86302
+ grant_type: "client_credentials",
86352
86303
  client_id: clientId,
86353
- client_secret: clientSecret,
86354
- username,
86355
- password
86304
+ client_secret: clientSecret
86356
86305
  });
86357
- const tokenRes = await fetch(`${loginHost}/services/oauth2/token`, {
86306
+ const tokenRes = await fetch(`${instanceUrl}/services/oauth2/token`, {
86358
86307
  method: "POST",
86359
86308
  headers: {
86360
86309
  "Content-Type": "application/x-www-form-urlencoded"
@@ -86369,13 +86318,14 @@ Prefer SOQL via the /query endpoint for filtered, joined, or aggregated reads ra
86369
86318
  };
86370
86319
  }
86371
86320
  const tokenJson = await tokenRes.json();
86372
- if (!tokenJson.access_token || !tokenJson.instance_url) {
86321
+ if (!tokenJson.access_token) {
86373
86322
  return {
86374
86323
  success: false,
86375
- error: "access_token or instance_url not found in token response"
86324
+ error: "access_token not found in token response"
86376
86325
  };
86377
86326
  }
86378
- const url = `${tokenJson.instance_url}${path5.startsWith("/") ? "" : "/"}${path5}`;
86327
+ const resolvedInstanceUrl = tokenJson.instance_url ?? instanceUrl;
86328
+ const url = `${resolvedInstanceUrl}${path5.startsWith("/") ? "" : "/"}${path5}`;
86379
86329
  const controller = new AbortController();
86380
86330
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS59);
86381
86331
  try {
@@ -86424,7 +86374,7 @@ Prefer SOQL via the /query endpoint for filtered, joined, or aggregated reads ra
86424
86374
  var tools62 = { request: requestTool47 };
86425
86375
  var salesforceConnector = new ConnectorPlugin({
86426
86376
  slug: "salesforce",
86427
- authType: AUTH_TYPES.USER_PASSWORD,
86377
+ authType: AUTH_TYPES.API_KEY,
86428
86378
  name: "Salesforce",
86429
86379
  description: "Connect to Salesforce CRM for accounts, contacts, opportunities, leads, cases, and custom objects via SOQL and the REST API.",
86430
86380
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6vZlbrUKhxXIiuvWJlb8YB/bbc5e08b88de46c8ed338a74c7d0abb3/salesforce-icon.png",
@@ -86434,7 +86384,7 @@ var salesforceConnector = new ConnectorPlugin({
86434
86384
  systemPrompt: {
86435
86385
  en: `### Tools
86436
86386
 
86437
- - \`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.
86387
+ - \`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 Client Credentials Flow against the External Client App / Connected App) is configured automatically \u2014 an access token is resolved on each request against the configured org instance URL. Prefer SOQL via \`GET /services/data/v60.0/query?q=...\` over paginating \`/sobjects/{Type}\` endpoints for filtered or joined reads.
86438
86388
 
86439
86389
  ### Business Logic
86440
86390
 
@@ -86480,9 +86430,8 @@ export default async function handler(c: Context) {
86480
86430
 
86481
86431
  ### Salesforce REST API Reference
86482
86432
 
86483
- - Login host: \`https://login.salesforce.com\` (production) or \`https://test.salesforce.com\` (sandbox)
86484
- - Token endpoint: \`POST /services/oauth2/token\` (grant_type=password + client_id/secret + username/password)
86485
- - Base path after login: \`{instance_url}/services/data/v60.0\`
86433
+ - Token endpoint: \`POST {instance_url}/services/oauth2/token\` (grant_type=client_credentials + client_id/secret)
86434
+ - Base path: \`{instance_url}/services/data/v60.0\` where instance_url is the org's My Domain URL
86486
86435
  - Authentication: Bearer token (handled automatically per request)
86487
86436
  - Pagination (SOQL): follow \`nextRecordsUrl\` from the response (absolute path starting with \`/services/data/v60.0/query/...\`)
86488
86437
 
@@ -86506,7 +86455,7 @@ export default async function handler(c: Context) {
86506
86455
  - Parent-to-child subquery: \`SELECT Id, Name, (SELECT Id, Email FROM Contacts) FROM Account\``,
86507
86456
  ja: `### \u30C4\u30FC\u30EB
86508
86457
 
86509
- - \`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
86458
+ - \`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\uFF08External Client App / Connected App + OAuth 2.0 Client Credentials Flow\uFF09\u306F\u81EA\u52D5\u3067\u884C\u308F\u308C\u3001\u8A2D\u5B9A\u3055\u308C\u305F\u7D44\u7E54\u306E instance URL \u306B\u5BFE\u3057\u3066\u30EA\u30AF\u30A8\u30B9\u30C8\u3054\u3068\u306B\u30A2\u30AF\u30BB\u30B9\u30C8\u30FC\u30AF\u30F3\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
86510
86459
 
86511
86460
  ### Business Logic
86512
86461
 
@@ -86552,9 +86501,8 @@ export default async function handler(c: Context) {
86552
86501
 
86553
86502
  ### Salesforce REST API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
86554
86503
 
86555
- - \u30ED\u30B0\u30A4\u30F3\u30DB\u30B9\u30C8: \`https://login.salesforce.com\`\uFF08\u672C\u756A\uFF09\u307E\u305F\u306F \`https://test.salesforce.com\`\uFF08Sandbox\uFF09
86556
- - \u30C8\u30FC\u30AF\u30F3\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8: \`POST /services/oauth2/token\`\uFF08grant_type=password + client_id/secret + username/password\uFF09
86557
- - \u30ED\u30B0\u30A4\u30F3\u5F8C\u306E\u30D9\u30FC\u30B9\u30D1\u30B9: \`{instance_url}/services/data/v60.0\`
86504
+ - \u30C8\u30FC\u30AF\u30F3\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8: \`POST {instance_url}/services/oauth2/token\`\uFF08grant_type=client_credentials + client_id/secret\uFF09
86505
+ - \u30D9\u30FC\u30B9\u30D1\u30B9: \`{instance_url}/services/data/v60.0\`\uFF08instance_url \u306F\u7D44\u7E54\u306E My Domain URL\uFF09
86558
86506
  - \u8A8D\u8A3C: Bearer \u30C8\u30FC\u30AF\u30F3\uFF08\u30EA\u30AF\u30A8\u30B9\u30C8\u3054\u3068\u306B\u81EA\u52D5\u8A2D\u5B9A\uFF09
86559
86507
  - \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
86560
86508
 
@@ -86796,7 +86744,7 @@ var influxdbConnector = new ConnectorPlugin({
86796
86744
  description: "Connect to InfluxDB (Cloud or OSS) to query time-series data with SQL, InfluxQL, or Flux and to write line protocol.",
86797
86745
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/J1JauVRNmahSVTVrpPfQK/18350d8d3f2dc3be25e8e36ee52914a0/influxdb.png",
86798
86746
  parameters: parameters63,
86799
- releaseFlag: { dev1: true, dev2: false, prod: false },
86747
+ releaseFlag: { dev1: true, dev2: true, prod: true },
86800
86748
  onboarding: influxdbOnboarding,
86801
86749
  systemPrompt: {
86802
86750
  en: `### Variant Detection
package/dist/main.js CHANGED
@@ -85030,7 +85030,7 @@ var grafanaConnector = new ConnectorPlugin({
85030
85030
  description: "Connect to Grafana for monitoring dashboards, datasource queries, and alerting.",
85031
85031
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/3nGaPhV94lXQsHcCtv4mXz/0559d42f83066e8ba79e78410806750c/grafana-icon.webp",
85032
85032
  parameters: parameters58,
85033
- releaseFlag: { dev1: true, dev2: false, prod: false },
85033
+ releaseFlag: { dev1: true, dev2: true, prod: true },
85034
85034
  onboarding: grafanaOnboarding,
85035
85035
  systemPrompt: {
85036
85036
  en: `### Tools
@@ -86199,42 +86199,6 @@ await sentry.updateIssue("12345", { status: "resolved" });
86199
86199
 
86200
86200
  // ../connectors/src/connectors/salesforce/setup.ts
86201
86201
  var salesforceOnboarding = new ConnectorOnboarding({
86202
- connectionSetupInstructions: {
86203
- en: `#### Create a Connected App in Salesforce
86204
- 1. In Salesforce Setup, go to App Manager \u2192 New Connected App
86205
- 2. Under API (Enable OAuth Settings), check "Enable OAuth Settings"
86206
- 3. Add OAuth scopes: "Manage user data via APIs (api)" and "Perform requests at any time (refresh_token, offline_access)"
86207
- 4. Save and note the Consumer Key (client_id) and Consumer Secret (client_secret)
86208
-
86209
- #### Allow Username-Password Flow
86210
- 1. Go to Setup \u2192 Identity \u2192 OAuth and OpenID Connect Settings
86211
- 2. Enable "Allow OAuth Username-Password Flows"
86212
-
86213
- #### Reset your Security Token
86214
- 1. Go to Settings \u2192 My Personal Information \u2192 Reset My Security Token
86215
- 2. Salesforce emails you a new security token \u2014 append it to your password when entering the Password parameter (password + securityToken)
86216
-
86217
- #### Sandbox vs Production
86218
- - Leave Use Sandbox as "false" (or empty) to connect to production (login.salesforce.com)
86219
- - Set Use Sandbox to "true" to connect to a sandbox (test.salesforce.com)`,
86220
- ja: `#### Salesforce \u3067 Connected App \u3092\u4F5C\u6210
86221
- 1. Setup \u2192 App Manager \u2192 New Connected App
86222
- 2. API (Enable OAuth Settings) \u30BB\u30AF\u30B7\u30E7\u30F3\u3067 "Enable OAuth Settings" \u3092\u6709\u52B9\u5316
86223
- 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
86224
- 4. \u4FDD\u5B58\u5F8C\u3001Consumer Key (client_id) \u3068 Consumer Secret (client_secret) \u3092\u63A7\u3048\u308B
86225
-
86226
- #### Username-Password Flow \u3092\u8A31\u53EF
86227
- 1. Setup \u2192 Identity \u2192 OAuth and OpenID Connect Settings
86228
- 2. "Allow OAuth Username-Password Flows" \u3092\u6709\u52B9\u5316
86229
-
86230
- #### Security Token \u306E\u767A\u884C
86231
- 1. \u500B\u4EBA\u8A2D\u5B9A \u2192 My Personal Information \u2192 Reset My Security Token
86232
- 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
86233
-
86234
- #### Sandbox / Production
86235
- - \u672C\u756A (login.salesforce.com) \u306E\u5834\u5408: Use Sandbox \u3092 "false" \u307E\u305F\u306F\u672A\u5165\u529B
86236
- - Sandbox (test.salesforce.com) \u306E\u5834\u5408: Use Sandbox \u3092 "true" \u306B\u8A2D\u5B9A`
86237
- },
86238
86202
  dataOverviewInstructions: {
86239
86203
  en: `1. Call salesforce_request with GET /services/data/v60.0/sobjects/ to list available sObjects (standard + custom)
86240
86204
  2. Call salesforce_request with GET /services/data/v60.0/sobjects/Account/describe to inspect Account fields; repeat for Contact, Opportunity, Lead as needed
@@ -86247,28 +86211,19 @@ var salesforceOnboarding = new ConnectorOnboarding({
86247
86211
 
86248
86212
  // ../connectors/src/connectors/salesforce/parameters.ts
86249
86213
  var parameters62 = {
86250
- username: new ParameterDefinition({
86251
- slug: "username",
86252
- name: "Username",
86253
- description: "Your Salesforce account username (the email you use to sign in).",
86254
- envVarBaseKey: "SALESFORCE_USERNAME",
86214
+ instanceUrl: new ParameterDefinition({
86215
+ slug: "instance-url",
86216
+ name: "Instance URL",
86217
+ description: "Your Salesforce org's My Domain URL (e.g., https://yourorg.my.salesforce.com). Find it under Setup \u2192 Company Settings \u2192 My Domain \u2192 Current My Domain URL.",
86218
+ envVarBaseKey: "SALESFORCE_INSTANCE_URL",
86255
86219
  type: "text",
86256
86220
  secret: false,
86257
86221
  required: true
86258
86222
  }),
86259
- password: new ParameterDefinition({
86260
- slug: "password",
86261
- name: "Password",
86262
- 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.",
86263
- envVarBaseKey: "SALESFORCE_PASSWORD",
86264
- type: "text",
86265
- secret: true,
86266
- required: true
86267
- }),
86268
86223
  clientId: new ParameterDefinition({
86269
86224
  slug: "client-id",
86270
86225
  name: "Consumer Key",
86271
- 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.",
86226
+ description: "The Consumer Key (client_id) of your External Client App (or Connected App). The app must enable the OAuth 2.0 Client Credentials Flow and bind a Run-As user with API access.",
86272
86227
  envVarBaseKey: "SALESFORCE_CLIENT_ID",
86273
86228
  type: "text",
86274
86229
  secret: false,
@@ -86277,20 +86232,11 @@ var parameters62 = {
86277
86232
  clientSecret: new ParameterDefinition({
86278
86233
  slug: "client-secret",
86279
86234
  name: "Consumer Secret",
86280
- description: "The Consumer Secret (client_secret) of your Salesforce Connected App.",
86235
+ description: "The Consumer Secret (client_secret) of your External Client App (or Connected App).",
86281
86236
  envVarBaseKey: "SALESFORCE_CLIENT_SECRET",
86282
86237
  type: "text",
86283
86238
  secret: true,
86284
86239
  required: true
86285
- }),
86286
- isSandbox: new ParameterDefinition({
86287
- slug: "is-sandbox",
86288
- name: "Use Sandbox",
86289
- description: 'Set to "true" to authenticate against a Salesforce sandbox (test.salesforce.com) instead of production (login.salesforce.com). Defaults to "false".',
86290
- envVarBaseKey: "SALESFORCE_IS_SANDBOX",
86291
- type: "text",
86292
- secret: false,
86293
- required: false
86294
86240
  })
86295
86241
  };
86296
86242
 
@@ -86321,10 +86267,17 @@ var outputSchema75 = z77.discriminatedUnion("success", [
86321
86267
  error: z77.string()
86322
86268
  })
86323
86269
  ]);
86270
+ function normalizeInstanceUrl(raw) {
86271
+ const trimmed = raw.trim().replace(/\/+$/, "");
86272
+ if (!/^https?:\/\//i.test(trimmed)) {
86273
+ return `https://${trimmed}`;
86274
+ }
86275
+ return trimmed;
86276
+ }
86324
86277
  var requestTool47 = new ConnectorTool({
86325
86278
  name: "request",
86326
86279
  description: `Send authenticated requests to the Salesforce REST API.
86327
- 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.
86280
+ Authentication is handled automatically using the OAuth 2.0 Client Credentials Flow (External Client App or Connected App Consumer Key + Secret). An access token is obtained on each request, so the tool user only provides the API path.
86328
86281
  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.
86329
86282
  Prefer SOQL via the /query endpoint for filtered, joined, or aggregated reads rather than paginating /sobjects/{Type} endpoints.`,
86330
86283
  inputSchema: inputSchema75,
@@ -86341,20 +86294,16 @@ Prefer SOQL via the /query endpoint for filtered, joined, or aggregated reads ra
86341
86294
  `[connector-request] salesforce/${connection2.name}: ${method} ${path6}`
86342
86295
  );
86343
86296
  try {
86344
- const username = parameters62.username.getValue(connection2);
86345
- const password = parameters62.password.getValue(connection2);
86297
+ const instanceUrlParam = parameters62.instanceUrl.getValue(connection2);
86346
86298
  const clientId = parameters62.clientId.getValue(connection2);
86347
86299
  const clientSecret = parameters62.clientSecret.getValue(connection2);
86348
- const isSandbox = parameters62.isSandbox.tryGetValue(connection2)?.toLowerCase() === "true";
86349
- const loginHost = isSandbox ? "https://test.salesforce.com" : "https://login.salesforce.com";
86300
+ const instanceUrl = normalizeInstanceUrl(instanceUrlParam);
86350
86301
  const tokenBody = new URLSearchParams({
86351
- grant_type: "password",
86302
+ grant_type: "client_credentials",
86352
86303
  client_id: clientId,
86353
- client_secret: clientSecret,
86354
- username,
86355
- password
86304
+ client_secret: clientSecret
86356
86305
  });
86357
- const tokenRes = await fetch(`${loginHost}/services/oauth2/token`, {
86306
+ const tokenRes = await fetch(`${instanceUrl}/services/oauth2/token`, {
86358
86307
  method: "POST",
86359
86308
  headers: {
86360
86309
  "Content-Type": "application/x-www-form-urlencoded"
@@ -86369,13 +86318,14 @@ Prefer SOQL via the /query endpoint for filtered, joined, or aggregated reads ra
86369
86318
  };
86370
86319
  }
86371
86320
  const tokenJson = await tokenRes.json();
86372
- if (!tokenJson.access_token || !tokenJson.instance_url) {
86321
+ if (!tokenJson.access_token) {
86373
86322
  return {
86374
86323
  success: false,
86375
- error: "access_token or instance_url not found in token response"
86324
+ error: "access_token not found in token response"
86376
86325
  };
86377
86326
  }
86378
- const url = `${tokenJson.instance_url}${path6.startsWith("/") ? "" : "/"}${path6}`;
86327
+ const resolvedInstanceUrl = tokenJson.instance_url ?? instanceUrl;
86328
+ const url = `${resolvedInstanceUrl}${path6.startsWith("/") ? "" : "/"}${path6}`;
86379
86329
  const controller = new AbortController();
86380
86330
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS59);
86381
86331
  try {
@@ -86424,7 +86374,7 @@ Prefer SOQL via the /query endpoint for filtered, joined, or aggregated reads ra
86424
86374
  var tools62 = { request: requestTool47 };
86425
86375
  var salesforceConnector = new ConnectorPlugin({
86426
86376
  slug: "salesforce",
86427
- authType: AUTH_TYPES.USER_PASSWORD,
86377
+ authType: AUTH_TYPES.API_KEY,
86428
86378
  name: "Salesforce",
86429
86379
  description: "Connect to Salesforce CRM for accounts, contacts, opportunities, leads, cases, and custom objects via SOQL and the REST API.",
86430
86380
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6vZlbrUKhxXIiuvWJlb8YB/bbc5e08b88de46c8ed338a74c7d0abb3/salesforce-icon.png",
@@ -86434,7 +86384,7 @@ var salesforceConnector = new ConnectorPlugin({
86434
86384
  systemPrompt: {
86435
86385
  en: `### Tools
86436
86386
 
86437
- - \`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.
86387
+ - \`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 Client Credentials Flow against the External Client App / Connected App) is configured automatically \u2014 an access token is resolved on each request against the configured org instance URL. Prefer SOQL via \`GET /services/data/v60.0/query?q=...\` over paginating \`/sobjects/{Type}\` endpoints for filtered or joined reads.
86438
86388
 
86439
86389
  ### Business Logic
86440
86390
 
@@ -86480,9 +86430,8 @@ export default async function handler(c: Context) {
86480
86430
 
86481
86431
  ### Salesforce REST API Reference
86482
86432
 
86483
- - Login host: \`https://login.salesforce.com\` (production) or \`https://test.salesforce.com\` (sandbox)
86484
- - Token endpoint: \`POST /services/oauth2/token\` (grant_type=password + client_id/secret + username/password)
86485
- - Base path after login: \`{instance_url}/services/data/v60.0\`
86433
+ - Token endpoint: \`POST {instance_url}/services/oauth2/token\` (grant_type=client_credentials + client_id/secret)
86434
+ - Base path: \`{instance_url}/services/data/v60.0\` where instance_url is the org's My Domain URL
86486
86435
  - Authentication: Bearer token (handled automatically per request)
86487
86436
  - Pagination (SOQL): follow \`nextRecordsUrl\` from the response (absolute path starting with \`/services/data/v60.0/query/...\`)
86488
86437
 
@@ -86506,7 +86455,7 @@ export default async function handler(c: Context) {
86506
86455
  - Parent-to-child subquery: \`SELECT Id, Name, (SELECT Id, Email FROM Contacts) FROM Account\``,
86507
86456
  ja: `### \u30C4\u30FC\u30EB
86508
86457
 
86509
- - \`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
86458
+ - \`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\uFF08External Client App / Connected App + OAuth 2.0 Client Credentials Flow\uFF09\u306F\u81EA\u52D5\u3067\u884C\u308F\u308C\u3001\u8A2D\u5B9A\u3055\u308C\u305F\u7D44\u7E54\u306E instance URL \u306B\u5BFE\u3057\u3066\u30EA\u30AF\u30A8\u30B9\u30C8\u3054\u3068\u306B\u30A2\u30AF\u30BB\u30B9\u30C8\u30FC\u30AF\u30F3\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
86510
86459
 
86511
86460
  ### Business Logic
86512
86461
 
@@ -86552,9 +86501,8 @@ export default async function handler(c: Context) {
86552
86501
 
86553
86502
  ### Salesforce REST API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
86554
86503
 
86555
- - \u30ED\u30B0\u30A4\u30F3\u30DB\u30B9\u30C8: \`https://login.salesforce.com\`\uFF08\u672C\u756A\uFF09\u307E\u305F\u306F \`https://test.salesforce.com\`\uFF08Sandbox\uFF09
86556
- - \u30C8\u30FC\u30AF\u30F3\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8: \`POST /services/oauth2/token\`\uFF08grant_type=password + client_id/secret + username/password\uFF09
86557
- - \u30ED\u30B0\u30A4\u30F3\u5F8C\u306E\u30D9\u30FC\u30B9\u30D1\u30B9: \`{instance_url}/services/data/v60.0\`
86504
+ - \u30C8\u30FC\u30AF\u30F3\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8: \`POST {instance_url}/services/oauth2/token\`\uFF08grant_type=client_credentials + client_id/secret\uFF09
86505
+ - \u30D9\u30FC\u30B9\u30D1\u30B9: \`{instance_url}/services/data/v60.0\`\uFF08instance_url \u306F\u7D44\u7E54\u306E My Domain URL\uFF09
86558
86506
  - \u8A8D\u8A3C: Bearer \u30C8\u30FC\u30AF\u30F3\uFF08\u30EA\u30AF\u30A8\u30B9\u30C8\u3054\u3068\u306B\u81EA\u52D5\u8A2D\u5B9A\uFF09
86559
86507
  - \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
86560
86508
 
@@ -86796,7 +86744,7 @@ var influxdbConnector = new ConnectorPlugin({
86796
86744
  description: "Connect to InfluxDB (Cloud or OSS) to query time-series data with SQL, InfluxQL, or Flux and to write line protocol.",
86797
86745
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/J1JauVRNmahSVTVrpPfQK/18350d8d3f2dc3be25e8e36ee52914a0/influxdb.png",
86798
86746
  parameters: parameters63,
86799
- releaseFlag: { dev1: true, dev2: false, prod: false },
86747
+ releaseFlag: { dev1: true, dev2: true, prod: true },
86800
86748
  onboarding: influxdbOnboarding,
86801
86749
  systemPrompt: {
86802
86750
  en: `### Variant Detection