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