@squadbase/vite-server 0.1.18 → 0.1.19-dev.2880e8d
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/build-entry/server-entry.mjs +23 -0
- package/dist/cli/index.js +419 -452
- package/dist/connectors/google-analytics-oauth.js +102 -188
- package/dist/index.d.ts +25 -1
- package/dist/index.js +501 -592
- package/dist/main.d.ts +1 -0
- package/dist/main.js +505 -596
- package/dist/types/server-logic.d.ts +3 -0
- package/dist/vite-plugin.d.ts +7 -2
- package/dist/vite-plugin.js +53 -47455
- package/package.json +3 -7
package/dist/cli/index.js
CHANGED
|
@@ -436,15 +436,15 @@ function parseOracleJdbcUrl(jdbcUrl, options = {}) {
|
|
|
436
436
|
}
|
|
437
437
|
if (URL_PREFIX_RE.test(trimmed)) {
|
|
438
438
|
const url = new URL(trimmed);
|
|
439
|
-
const
|
|
440
|
-
if (!url.hostname || !
|
|
439
|
+
const path4 = url.pathname.replace(/^\//, "");
|
|
440
|
+
if (!url.hostname || !path4) {
|
|
441
441
|
throw new Error(
|
|
442
442
|
`Invalid Oracle URL "${redactOracleUrl(trimmed)}". Expected oracle://[user:password@]host:port/service`
|
|
443
443
|
);
|
|
444
444
|
}
|
|
445
445
|
const port = url.port || "1521";
|
|
446
446
|
return {
|
|
447
|
-
connectString: `${url.hostname}:${port}/${
|
|
447
|
+
connectString: `${url.hostname}:${port}/${path4}`,
|
|
448
448
|
user: url.username ? decodeURIComponent(url.username) : options.username,
|
|
449
449
|
password: url.password ? decodeURIComponent(url.password) : options.password
|
|
450
450
|
};
|
|
@@ -689,8 +689,8 @@ var init_interactive = __esm({
|
|
|
689
689
|
|
|
690
690
|
// src/cli/index.ts
|
|
691
691
|
import { parseArgs } from "util";
|
|
692
|
-
import
|
|
693
|
-
import { readFile as
|
|
692
|
+
import path3 from "path";
|
|
693
|
+
import { readFile as readFile3 } from "fs/promises";
|
|
694
694
|
|
|
695
695
|
// src/connector-client/registry.ts
|
|
696
696
|
import { readFileSync, watch as fsWatch } from "fs";
|
|
@@ -8141,12 +8141,12 @@ var parameters13 = {
|
|
|
8141
8141
|
|
|
8142
8142
|
// ../connectors/src/connectors/airtable/utils.ts
|
|
8143
8143
|
var BASE_URL = "https://api.airtable.com/v0";
|
|
8144
|
-
async function apiFetch(params,
|
|
8144
|
+
async function apiFetch(params, path4, init) {
|
|
8145
8145
|
const apiKey = params[parameters13.apiKey.slug];
|
|
8146
8146
|
if (!apiKey) {
|
|
8147
8147
|
throw new Error("airtable: missing required parameter: api-key");
|
|
8148
8148
|
}
|
|
8149
|
-
const url = `${BASE_URL}${
|
|
8149
|
+
const url = `${BASE_URL}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
8150
8150
|
const headers = new Headers(init?.headers);
|
|
8151
8151
|
headers.set("Authorization", `Bearer ${apiKey}`);
|
|
8152
8152
|
return fetch(url, { ...init, headers });
|
|
@@ -8348,16 +8348,16 @@ Authentication is handled automatically using the API Key.
|
|
|
8348
8348
|
{baseId} in the path is automatically replaced with the connection's base-id.`,
|
|
8349
8349
|
inputSchema: inputSchema19,
|
|
8350
8350
|
outputSchema: outputSchema19,
|
|
8351
|
-
async execute({ connectionId, method, path:
|
|
8351
|
+
async execute({ connectionId, method, path: path4, body }, connections) {
|
|
8352
8352
|
const connection = connections.find((c) => c.id === connectionId);
|
|
8353
8353
|
if (!connection) {
|
|
8354
8354
|
return { success: false, error: `Connection ${connectionId} not found` };
|
|
8355
8355
|
}
|
|
8356
|
-
console.log(`[connector-request] airtable/${connection.name}: ${method} ${
|
|
8356
|
+
console.log(`[connector-request] airtable/${connection.name}: ${method} ${path4}`);
|
|
8357
8357
|
try {
|
|
8358
8358
|
const apiKey = parameters13.apiKey.getValue(connection);
|
|
8359
8359
|
const baseId = parameters13.baseId.getValue(connection);
|
|
8360
|
-
const resolvedPath =
|
|
8360
|
+
const resolvedPath = path4.replace(/\{baseId\}/g, baseId);
|
|
8361
8361
|
const url = `${BASE_URL2}${resolvedPath}`;
|
|
8362
8362
|
const controller = new AbortController();
|
|
8363
8363
|
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS7);
|
|
@@ -9052,7 +9052,7 @@ Authentication is handled automatically via OAuth proxy.
|
|
|
9052
9052
|
{customerId} in the path is automatically replaced with the connection's customer ID (hyphens removed).`,
|
|
9053
9053
|
inputSchema: inputSchema21,
|
|
9054
9054
|
outputSchema: outputSchema21,
|
|
9055
|
-
async execute({ connectionId, method, path:
|
|
9055
|
+
async execute({ connectionId, method, path: path4, body }, connections, config) {
|
|
9056
9056
|
const connection = connections.find((c) => c.id === connectionId);
|
|
9057
9057
|
if (!connection) {
|
|
9058
9058
|
return {
|
|
@@ -9061,12 +9061,12 @@ Authentication is handled automatically via OAuth proxy.
|
|
|
9061
9061
|
};
|
|
9062
9062
|
}
|
|
9063
9063
|
console.log(
|
|
9064
|
-
`[connector-request] google-ads/${connection.name}: ${method} ${
|
|
9064
|
+
`[connector-request] google-ads/${connection.name}: ${method} ${path4}`
|
|
9065
9065
|
);
|
|
9066
9066
|
try {
|
|
9067
9067
|
const rawCustomerId = parameters14.customerId.tryGetValue(connection);
|
|
9068
9068
|
const customerId = rawCustomerId?.replace(/-/g, "") ?? "";
|
|
9069
|
-
const resolvedPath = customerId ?
|
|
9069
|
+
const resolvedPath = customerId ? path4.replace(/\{customerId\}/g, customerId) : path4;
|
|
9070
9070
|
const token = await getProxyToken5(config.oauthProxy);
|
|
9071
9071
|
const proxyUrl = `https://${config.oauthProxy.sandboxId}.${config.oauthProxy.previewBaseDomain}/_sqcore/connections/${connectionId}/request`;
|
|
9072
9072
|
const controller = new AbortController();
|
|
@@ -9413,7 +9413,7 @@ async function getAccessToken(serviceAccountKey) {
|
|
|
9413
9413
|
const data = await response.json();
|
|
9414
9414
|
return data.access_token;
|
|
9415
9415
|
}
|
|
9416
|
-
async function adminFetch(params,
|
|
9416
|
+
async function adminFetch(params, path4, init) {
|
|
9417
9417
|
const keyJsonBase64 = params[parameters15.serviceAccountKeyJsonBase64.slug];
|
|
9418
9418
|
if (!keyJsonBase64) {
|
|
9419
9419
|
throw new Error(
|
|
@@ -9422,12 +9422,12 @@ async function adminFetch(params, path5, init) {
|
|
|
9422
9422
|
}
|
|
9423
9423
|
const serviceAccountKey = decodeServiceAccount(keyJsonBase64);
|
|
9424
9424
|
const accessToken = await getAccessToken(serviceAccountKey);
|
|
9425
|
-
const url = `${ADMIN_BASE_URL}${
|
|
9425
|
+
const url = `${ADMIN_BASE_URL}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
9426
9426
|
const headers = new Headers(init?.headers);
|
|
9427
9427
|
headers.set("Authorization", `Bearer ${accessToken}`);
|
|
9428
9428
|
return fetch(url, { ...init, headers });
|
|
9429
9429
|
}
|
|
9430
|
-
async function dataFetch(params,
|
|
9430
|
+
async function dataFetch(params, path4, init) {
|
|
9431
9431
|
const keyJsonBase64 = params[parameters15.serviceAccountKeyJsonBase64.slug];
|
|
9432
9432
|
if (!keyJsonBase64) {
|
|
9433
9433
|
throw new Error(
|
|
@@ -9436,7 +9436,7 @@ async function dataFetch(params, path5, init) {
|
|
|
9436
9436
|
}
|
|
9437
9437
|
const serviceAccountKey = decodeServiceAccount(keyJsonBase64);
|
|
9438
9438
|
const accessToken = await getAccessToken(serviceAccountKey);
|
|
9439
|
-
const url = `${DATA_BASE_URL}${
|
|
9439
|
+
const url = `${DATA_BASE_URL}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
9440
9440
|
const headers = new Headers(init?.headers);
|
|
9441
9441
|
headers.set("Authorization", `Bearer ${accessToken}`);
|
|
9442
9442
|
return fetch(url, { ...init, headers });
|
|
@@ -9460,8 +9460,8 @@ async function listAccountSummaries(params) {
|
|
|
9460
9460
|
const summaries = [];
|
|
9461
9461
|
let pageToken;
|
|
9462
9462
|
do {
|
|
9463
|
-
const
|
|
9464
|
-
const res = await adminFetch(params,
|
|
9463
|
+
const path4 = pageToken ? `/accountSummaries?pageToken=${encodeURIComponent(pageToken)}` : `/accountSummaries`;
|
|
9464
|
+
const res = await adminFetch(params, path4);
|
|
9465
9465
|
if (!res.ok) {
|
|
9466
9466
|
const body = await res.text().catch(() => res.statusText);
|
|
9467
9467
|
throw new Error(
|
|
@@ -9700,9 +9700,9 @@ function renderTopPages(sections, report) {
|
|
|
9700
9700
|
sections.push("| Path | Page views | Active users | Avg session duration |");
|
|
9701
9701
|
sections.push("|------|------------|--------------|----------------------|");
|
|
9702
9702
|
for (const row of rows.slice(0, TOP_N_PAGES)) {
|
|
9703
|
-
const
|
|
9703
|
+
const path4 = truncate(row.dimensionValues?.[0]?.value, PAGE_PATH_MAX) || "-";
|
|
9704
9704
|
sections.push(
|
|
9705
|
-
`| ${escapePipe(
|
|
9705
|
+
`| ${escapePipe(path4)} | ${formatNumber(row.metricValues?.[0]?.value)} | ${formatNumber(
|
|
9706
9706
|
row.metricValues?.[1]?.value
|
|
9707
9707
|
)} | ${formatDuration(row.metricValues?.[2]?.value)} |`
|
|
9708
9708
|
);
|
|
@@ -10076,12 +10076,12 @@ var requestTool3 = new ConnectorTool({
|
|
|
10076
10076
|
Authentication is handled automatically using a service account.`,
|
|
10077
10077
|
inputSchema: inputSchema22,
|
|
10078
10078
|
outputSchema: outputSchema22,
|
|
10079
|
-
async execute({ connectionId, method, path:
|
|
10079
|
+
async execute({ connectionId, method, path: path4, body }, connections) {
|
|
10080
10080
|
const connection = connections.find((c) => c.id === connectionId);
|
|
10081
10081
|
if (!connection) {
|
|
10082
10082
|
return { success: false, error: `Connection ${connectionId} not found` };
|
|
10083
10083
|
}
|
|
10084
|
-
console.log(`[connector-request] google-analytics/${connection.name}: ${method} ${
|
|
10084
|
+
console.log(`[connector-request] google-analytics/${connection.name}: ${method} ${path4}`);
|
|
10085
10085
|
try {
|
|
10086
10086
|
const { GoogleAuth } = await import("google-auth-library");
|
|
10087
10087
|
const keyJsonBase64 = parameters15.serviceAccountKeyJsonBase64.getValue(connection);
|
|
@@ -10096,7 +10096,7 @@ Authentication is handled automatically using a service account.`,
|
|
|
10096
10096
|
if (!token) {
|
|
10097
10097
|
return { success: false, error: "Failed to obtain access token" };
|
|
10098
10098
|
}
|
|
10099
|
-
const url = `${BASE_URL3}${
|
|
10099
|
+
const url = `${BASE_URL3}${path4}`;
|
|
10100
10100
|
const controller = new AbortController();
|
|
10101
10101
|
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS10);
|
|
10102
10102
|
try {
|
|
@@ -10570,11 +10570,11 @@ var googleAnalyticsOauthOnboarding = new ConnectorOnboarding({
|
|
|
10570
10570
|
- \u30A2\u30AB\u30A6\u30F3\u30C8\u304C **1\u4EF6\u306E\u307F**: \`askUserQuestion\` \u306F\u30B9\u30AD\u30C3\u30D7\u3057\u3001\u305D\u306E\u30A2\u30AB\u30A6\u30F3\u30C8\u3092\u9078\u629E\u6E08\u307F\u3068\u3057\u3066\u6B21\u3078\u9032\u3080
|
|
10571
10571
|
- \u30A2\u30AB\u30A6\u30F3\u30C8\u304C **0\u4EF6**: \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3092\u4E2D\u65AD\u3057\u3001\u30E6\u30FC\u30B6\u30FC\u306B\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u30A2\u30AB\u30A6\u30F3\u30C8\u304C\u306A\u3044\u65E8\u3092\u4F1D\u3048\u308B
|
|
10572
10572
|
3. \`${listPropertiesToolName}\` \u3092\u547C\u3073\u51FA\u3057\u3066\u3001\u9078\u629E\u3055\u308C\u305F\u30A2\u30AB\u30A6\u30F3\u30C8\u306E\u30D7\u30ED\u30D1\u30C6\u30A3\u4E00\u89A7\u3092\u53D6\u5F97\u3059\u308B
|
|
10573
|
-
4.
|
|
10574
|
-
- \`
|
|
10575
|
-
-
|
|
10576
|
-
- \u30D7\u30ED\u30D1\u30C6\u30A3\u304C **0\u4EF6
|
|
10577
|
-
5. \
|
|
10573
|
+
4. \u30D7\u30ED\u30D1\u30C6\u30A3\u306E\u9078\u629E:
|
|
10574
|
+
- \u30D7\u30ED\u30D1\u30C6\u30A3\u304C **2\u4EF6\u4EE5\u4E0A**: \u300C\u4F7F\u7528\u3059\u308B\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u300D\u3068\u30E6\u30FC\u30B6\u30FC\u306B\u4F1D\u3048\u305F\u4E0A\u3067\u3001\`askUserQuestion\` \u3092\u547C\u3073\u51FA\u3059\uFF08\`options\`: \u5404 option \u306E \`label\` \u306F \`\u8868\u793A\u540D (id: \u30D7\u30ED\u30D1\u30C6\u30A3ID)\` \u306E\u5F62\u5F0F\u3001\`value\` \u306F\u30D7\u30ED\u30D1\u30C6\u30A3ID\uFF09
|
|
10575
|
+
- \u30D7\u30ED\u30D1\u30C6\u30A3\u304C **1\u4EF6\u306E\u307F**: \`askUserQuestion\` \u306F\u30B9\u30AD\u30C3\u30D7\u3057\u3001\u305D\u306E\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u9078\u629E\u6E08\u307F\u3068\u3057\u3066\u6B21\u3078\u9032\u3080
|
|
10576
|
+
- \u30D7\u30ED\u30D1\u30C6\u30A3\u304C **0\u4EF6**: \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3092\u4E2D\u65AD\u3057\u3001\u30E6\u30FC\u30B6\u30FC\u306B\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u30D7\u30ED\u30D1\u30C6\u30A3\u304C\u306A\u3044\u65E8\u3092\u4F1D\u3048\u308B
|
|
10577
|
+
5. \u9078\u629E\u3055\u308C\u305F\u30D7\u30ED\u30D1\u30C6\u30A3ID\uFF08\u6570\u5024\uFF09\u306F\u4EE5\u964D\u306E\u30EA\u30AF\u30A8\u30B9\u30C8\u3067\u30D1\u30B9\u306B\u76F4\u63A5\u6307\u5B9A\u3059\u308B\uFF08\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306B\u306F\u4FDD\u5B58\u3055\u308C\u306A\u3044\uFF09\u3002\u6B21\u306E\u30B9\u30C6\u30C3\u30D7\u306B\u9032\u3080
|
|
10578
10578
|
|
|
10579
10579
|
#### \u5236\u7D04
|
|
10580
10580
|
- **\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u4E2D\u306B\u30EC\u30DD\u30FC\u30C8\u30C7\u30FC\u30BF\u3092\u53D6\u5F97\u3057\u306A\u3044\u3053\u3068**\u3002\u5B9F\u884C\u3057\u3066\u3088\u3044\u306E\u306F\u4E0A\u8A18\u624B\u9806\u3067\u6307\u5B9A\u3055\u308C\u305F\u30E1\u30BF\u30C7\u30FC\u30BF\u53D6\u5F97\u306E\u307F
|
|
@@ -10588,11 +10588,11 @@ var googleAnalyticsOauthOnboarding = new ConnectorOnboarding({
|
|
|
10588
10588
|
- **Only 1 account**: Skip \`askUserQuestion\` and proceed using that account as the selection
|
|
10589
10589
|
- **0 accounts**: Abort setup and inform the user that no accessible accounts are available
|
|
10590
10590
|
3. Call \`${listPropertiesToolName}\` to get the list of properties for the selected account
|
|
10591
|
-
4.
|
|
10592
|
-
- \`
|
|
10593
|
-
-
|
|
10594
|
-
-
|
|
10595
|
-
5.
|
|
10591
|
+
4. Select a property:
|
|
10592
|
+
- **2 or more properties**: Tell the user "Please select a property.", then call \`askUserQuestion\` (\`options\`: each option's \`label\` should be \`Display Name (id: propertyId)\`, \`value\` should be the property ID)
|
|
10593
|
+
- **Only 1 property**: Skip \`askUserQuestion\` and proceed using that property as the selection
|
|
10594
|
+
- **0 properties**: Abort setup and inform the user that no accessible properties are available
|
|
10595
|
+
5. Write the selected numeric property id directly into the request path (it is not stored on the connection). Proceed to the next step
|
|
10596
10596
|
|
|
10597
10597
|
#### Constraints
|
|
10598
10598
|
- **Do NOT fetch report data during setup**. Only the metadata requests specified in the steps above are allowed
|
|
@@ -10600,26 +10600,17 @@ var googleAnalyticsOauthOnboarding = new ConnectorOnboarding({
|
|
|
10600
10600
|
- Write only 1 sentence between tool calls, then immediately call the next tool. Skip unnecessary explanations and proceed efficiently`
|
|
10601
10601
|
},
|
|
10602
10602
|
dataOverviewInstructions: {
|
|
10603
|
-
en: `
|
|
10604
|
-
|
|
10605
|
-
|
|
10606
|
-
|
|
10603
|
+
en: `Use the selected numeric property id in the path (write it directly, e.g. properties/123456789).
|
|
10604
|
+
1. Call connector_google-analytics-oauth_request with GET properties/<propertyId>/metadata to list available dimensions and metrics
|
|
10605
|
+
2. Call connector_google-analytics-oauth_request with POST properties/<propertyId>:runReport using a small date range and basic metrics to verify data availability`,
|
|
10606
|
+
ja: `\u9078\u629E\u3057\u305F\u6570\u5024\u306E\u30D7\u30ED\u30D1\u30C6\u30A3ID\u3092\u30D1\u30B9\u306B\u76F4\u63A5\u8A18\u8FF0\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u4F8B: properties/123456789\uFF09\u3002
|
|
10607
|
+
1. connector_google-analytics-oauth_request \u3067 GET properties/<propertyId>/metadata \u3092\u547C\u3073\u51FA\u3057\u3001\u5229\u7528\u53EF\u80FD\u306A\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u3068\u30E1\u30C8\u30EA\u30AF\u30B9\u306E\u4E00\u89A7\u3092\u53D6\u5F97
|
|
10608
|
+
2. connector_google-analytics-oauth_request \u3067 POST properties/<propertyId>:runReport \u3092\u77ED\u3044\u671F\u9593\u3068\u57FA\u672C\u30E1\u30C8\u30EA\u30AF\u30B9\u3067\u547C\u3073\u51FA\u3057\u3001\u30C7\u30FC\u30BF\u306E\u53EF\u7528\u6027\u3092\u78BA\u8A8D`
|
|
10607
10609
|
}
|
|
10608
10610
|
});
|
|
10609
10611
|
|
|
10610
10612
|
// ../connectors/src/connectors/google-analytics-oauth/parameters.ts
|
|
10611
|
-
|
|
10612
|
-
var parameters16 = {
|
|
10613
|
-
propertyId: new ParameterDefinition({
|
|
10614
|
-
slug: "property-id",
|
|
10615
|
-
name: "Google Analytics Property ID",
|
|
10616
|
-
description: "The Google Analytics 4 property ID (e.g., 123456789). Can be found in GA4 Admin > Property Settings.",
|
|
10617
|
-
envVarBaseKey: "GA_OAUTH_PROPERTY_ID",
|
|
10618
|
-
type: "text",
|
|
10619
|
-
secret: false,
|
|
10620
|
-
required: false
|
|
10621
|
-
})
|
|
10622
|
-
};
|
|
10613
|
+
var parameters16 = {};
|
|
10623
10614
|
|
|
10624
10615
|
// ../connectors/src/connectors/google-analytics-oauth/setup-flow.ts
|
|
10625
10616
|
var ADMIN_BASE_URL4 = "https://analyticsadmin.googleapis.com/v1beta";
|
|
@@ -10926,7 +10917,7 @@ var inputSchema25 = z25.object({
|
|
|
10926
10917
|
connectionId: z25.string().describe("ID of the Google Analytics OAuth connection to use"),
|
|
10927
10918
|
method: z25.enum(["GET", "POST"]).describe("HTTP method"),
|
|
10928
10919
|
path: z25.string().describe(
|
|
10929
|
-
"API path appended to https://analyticsdata.googleapis.com/v1beta/ (e.g., 'properties/
|
|
10920
|
+
"API path appended to https://analyticsdata.googleapis.com/v1beta/ (e.g., 'properties/123456789:runReport'). Write the numeric property id directly into the path."
|
|
10930
10921
|
),
|
|
10931
10922
|
body: z25.record(z25.string(), z25.unknown()).optional().describe("POST request body (JSON)")
|
|
10932
10923
|
});
|
|
@@ -10945,10 +10936,10 @@ var requestTool4 = new ConnectorTool({
|
|
|
10945
10936
|
name: "request",
|
|
10946
10937
|
description: `Send authenticated requests to the Google Analytics Data API v1beta.
|
|
10947
10938
|
Authentication is handled automatically via OAuth proxy.
|
|
10948
|
-
|
|
10939
|
+
Write the numeric property id directly into the path (e.g. properties/123456789:runReport).`,
|
|
10949
10940
|
inputSchema: inputSchema25,
|
|
10950
10941
|
outputSchema: outputSchema25,
|
|
10951
|
-
async execute({ connectionId, method, path:
|
|
10942
|
+
async execute({ connectionId, method, path: path4, body }, connections, config) {
|
|
10952
10943
|
const connection = connections.find((c) => c.id === connectionId);
|
|
10953
10944
|
if (!connection) {
|
|
10954
10945
|
return {
|
|
@@ -10957,12 +10948,10 @@ Authentication is handled automatically via OAuth proxy.
|
|
|
10957
10948
|
};
|
|
10958
10949
|
}
|
|
10959
10950
|
console.log(
|
|
10960
|
-
`[connector-request] google-analytics-oauth/${connection.name}: ${method} ${
|
|
10951
|
+
`[connector-request] google-analytics-oauth/${connection.name}: ${method} ${path4}`
|
|
10961
10952
|
);
|
|
10962
10953
|
try {
|
|
10963
|
-
const
|
|
10964
|
-
const resolvedPath = propertyId ? path5.replace(/\{propertyId\}/g, propertyId) : path5;
|
|
10965
|
-
const url = `${BASE_URL4}${resolvedPath}`;
|
|
10954
|
+
const url = `${BASE_URL4}${path4}`;
|
|
10966
10955
|
const token = await getProxyToken8(config.oauthProxy);
|
|
10967
10956
|
const proxyUrl = `https://${config.oauthProxy.sandboxId}.${config.oauthProxy.previewBaseDomain}/_sqcore/connections/${connectionId}/request`;
|
|
10968
10957
|
const controller = new AbortController();
|
|
@@ -11032,24 +11021,20 @@ var googleAnalyticsOauthConnector = new ConnectorPlugin({
|
|
|
11032
11021
|
systemPrompt: {
|
|
11033
11022
|
en: `### Tools
|
|
11034
11023
|
|
|
11035
|
-
- \`connector_google-analytics-oauth_request\`: Send authenticated requests to the GA4 Data API. Use it for running reports, getting metadata, and realtime reports.
|
|
11024
|
+
- \`connector_google-analytics-oauth_request\`: Send authenticated requests to the GA4 Data API. Use it for running reports, getting metadata, and realtime reports. Write the target property into the path as \`properties/{numericPropertyId}\`. Authentication is configured automatically via OAuth.
|
|
11036
11025
|
- \`connector_google-analytics-oauth_listAccounts\`: List accessible Google Analytics accounts. Use during setup to discover available accounts.
|
|
11037
11026
|
- \`connector_google-analytics-oauth_listProperties\`: List GA4 properties for a given account. Use during setup to select the target property.
|
|
11038
11027
|
|
|
11039
|
-
### GA4 Data API Reference
|
|
11028
|
+
### GA4 Data API Reference \u2014 for the \`connector_google-analytics-oauth_request\` **tool** only (setup/discovery)
|
|
11040
11029
|
|
|
11041
|
-
|
|
11042
|
-
- GET properties/{propertyId}/metadata
|
|
11030
|
+
These raw HTTP shapes describe the discovery **tool** above. **In server-logic (Business Logic below) do NOT hand-build these HTTP requests \u2014 call the SDK method on the same line, which takes the same body fields and returns already-parsed JSON:**
|
|
11043
11031
|
|
|
11044
|
-
|
|
11045
|
-
|
|
11046
|
-
|
|
11047
|
-
|
|
11048
|
-
|
|
11049
|
-
|
|
11050
|
-
"metrics": [{"name": "activeUsers"}],
|
|
11051
|
-
"limit": 100
|
|
11052
|
-
}
|
|
11032
|
+
| Raw HTTP (tool, discovery) | Server-logic (SDK method) |
|
|
11033
|
+
|---|---|
|
|
11034
|
+
| \`GET properties/{propertyId}/metadata\` | \`await client.getMetadata(propertyId)\` |
|
|
11035
|
+
| \`POST properties/{propertyId}:runReport\` with body \`{ dateRanges, dimensions, metrics, limit }\` | \`await client.runReport({ propertyId, dateRanges, dimensions, metrics, limit })\` \u2192 \`{ rows, rowCount }\` |
|
|
11036
|
+
|
|
11037
|
+
Report body fields: \`dateRanges: [{ startDate, endDate }]\`, \`dimensions: [{ name }]\`, \`metrics: [{ name }]\`, optional \`limit\`.
|
|
11053
11038
|
|
|
11054
11039
|
### Common Dimensions
|
|
11055
11040
|
date, country, city, deviceCategory, browser, pagePath, pageTitle,
|
|
@@ -11067,11 +11052,14 @@ averageSessionDuration, conversions, totalRevenue
|
|
|
11067
11052
|
|
|
11068
11053
|
The business logic type for this connector is "typescript". Write handler code using the connector SDK shown below. Do NOT access credentials directly from environment variables and do NOT read \`INTERNAL_SQUADBASE_*\` env vars \u2014 the SDK takes care of OAuth.
|
|
11069
11054
|
|
|
11070
|
-
SDK surface (client created via \`connection(connectionId)\`)
|
|
11071
|
-
- \`client.
|
|
11072
|
-
- \`client.
|
|
11073
|
-
- \`client.
|
|
11074
|
-
|
|
11055
|
+
SDK surface (client created via \`connection(connectionId)\`). **Every method returns already-parsed JSON \u2014 you never build an HTTP request or parse a response yourself:**
|
|
11056
|
+
- \`client.runReport({ propertyId, dateRanges, dimensions, metrics, limit? })\` \u2014 run a GA4 report. Returns \`{ rows, rowCount }\`. **Use this for all reporting.**
|
|
11057
|
+
- \`client.runRealtimeReport({ propertyId, dimensions, metrics })\` \u2014 realtime report. Returns \`{ rows, rowCount }\`.
|
|
11058
|
+
- \`client.getMetadata(propertyId)\` \u2014 available dimensions and metrics for a property.
|
|
11059
|
+
|
|
11060
|
+
**Anti-pattern \u2014 do NOT do this.** \`client.request(...)\` is a low-level escape hatch that returns a raw \`Response\`; it is NOT how you run a report. In particular, **never call \`client.request({ method, path, body })\`** \u2014 that object shape belongs to the discovery *tool*, not the SDK. It will not run the report, and \`(await client.request({...})).rows\` is always \`undefined\`. Use \`client.runReport({ propertyId, ... })\` instead.
|
|
11061
|
+
|
|
11062
|
+
**\`propertyId\` is required on every call** \u2014 pass the numeric id from the data overview. A GA connection can span multiple properties, so there is no stored default.
|
|
11075
11063
|
|
|
11076
11064
|
If a handler test fails with \`Connection proxy is not configured\`, retry \u2014 the sandbox is still initializing. Do NOT abandon the SDK and construct OAuth proxy URLs manually.
|
|
11077
11065
|
|
|
@@ -11080,48 +11068,42 @@ If a handler test fails with \`Connection proxy is not configured\`, retry \u201
|
|
|
11080
11068
|
\`\`\`ts
|
|
11081
11069
|
import { connection } from "@squadbase/vite-server/connectors/google-analytics-oauth";
|
|
11082
11070
|
|
|
11083
|
-
|
|
11071
|
+
export default async function handler(c) {
|
|
11072
|
+
const client = connection("<connectionId>");
|
|
11073
|
+
const propertyId = "123456789"; // numeric GA4 property id from the data overview
|
|
11084
11074
|
|
|
11085
|
-
|
|
11086
|
-
|
|
11087
|
-
|
|
11088
|
-
|
|
11089
|
-
}
|
|
11090
|
-
|
|
11075
|
+
const { rows } = await client.runReport({
|
|
11076
|
+
propertyId,
|
|
11077
|
+
dateRanges: [{ startDate: "28daysAgo", endDate: "today" }],
|
|
11078
|
+
dimensions: [{ name: "date" }, { name: "sessionDefaultChannelGroup" }],
|
|
11079
|
+
metrics: [{ name: "sessions" }],
|
|
11080
|
+
});
|
|
11091
11081
|
|
|
11092
|
-
|
|
11093
|
-
|
|
11094
|
-
|
|
11095
|
-
|
|
11096
|
-
|
|
11097
|
-
|
|
11098
|
-
|
|
11099
|
-
|
|
11100
|
-
const realtime = await ga.runRealtimeReport({
|
|
11101
|
-
metrics: [{ name: "activeUsers" }],
|
|
11102
|
-
dimensions: [{ name: "country" }],
|
|
11103
|
-
});
|
|
11082
|
+
const data = rows.map((row) => ({
|
|
11083
|
+
date: row.dimensionValues[0].value,
|
|
11084
|
+
channel: row.dimensionValues[1].value,
|
|
11085
|
+
sessions: Number(row.metricValues[0].value) || 0,
|
|
11086
|
+
}));
|
|
11087
|
+
|
|
11088
|
+
return c.json(data);
|
|
11089
|
+
}
|
|
11104
11090
|
\`\`\``,
|
|
11105
11091
|
ja: `### \u30C4\u30FC\u30EB
|
|
11106
11092
|
|
|
11107
|
-
- \`connector_google-analytics-oauth_request\`: GA4 Data API\u3078\u8A8D\u8A3C\u6E08\u307F\u30EA\u30AF\u30A8\u30B9\u30C8\u3092\u9001\u4FE1\u3057\u307E\u3059\u3002\u30EC\u30DD\u30FC\u30C8\u306E\u5B9F\u884C\u3001\u30E1\u30BF\u30C7\u30FC\u30BF\u306E\u53D6\u5F97\u3001\u30EA\u30A2\u30EB\u30BF\u30A4\u30E0\u30EC\u30DD\u30FC\u30C8\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u30D1\u30B9\
|
|
11093
|
+
- \`connector_google-analytics-oauth_request\`: GA4 Data API\u3078\u8A8D\u8A3C\u6E08\u307F\u30EA\u30AF\u30A8\u30B9\u30C8\u3092\u9001\u4FE1\u3057\u307E\u3059\u3002\u30EC\u30DD\u30FC\u30C8\u306E\u5B9F\u884C\u3001\u30E1\u30BF\u30C7\u30FC\u30BF\u306E\u53D6\u5F97\u3001\u30EA\u30A2\u30EB\u30BF\u30A4\u30E0\u30EC\u30DD\u30FC\u30C8\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u5BFE\u8C61\u30D7\u30ED\u30D1\u30C6\u30A3\u306F\u30D1\u30B9\u306B \`properties/{\u6570\u5024\u306E\u30D7\u30ED\u30D1\u30C6\u30A3ID}\` \u306E\u5F62\u3067\u76F4\u63A5\u8A18\u8FF0\u3057\u3066\u304F\u3060\u3055\u3044\u3002OAuth\u7D4C\u7531\u3067\u8A8D\u8A3C\u306F\u81EA\u52D5\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002
|
|
11108
11094
|
- \`connector_google-analytics-oauth_listAccounts\`: \u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306AGoogle Analytics\u30A2\u30AB\u30A6\u30F3\u30C8\u306E\u4E00\u89A7\u3092\u53D6\u5F97\u3057\u307E\u3059\u3002\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u6642\u306B\u5229\u7528\u53EF\u80FD\u306A\u30A2\u30AB\u30A6\u30F3\u30C8\u3092\u78BA\u8A8D\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002
|
|
11109
11095
|
- \`connector_google-analytics-oauth_listProperties\`: \u6307\u5B9A\u30A2\u30AB\u30A6\u30F3\u30C8\u306EGA4\u30D7\u30ED\u30D1\u30C6\u30A3\u4E00\u89A7\u3092\u53D6\u5F97\u3057\u307E\u3059\u3002\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u6642\u306B\u30BF\u30FC\u30B2\u30C3\u30C8\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u9078\u629E\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002
|
|
11110
11096
|
|
|
11111
|
-
### GA4 Data API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
|
|
11097
|
+
### GA4 Data API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9 \u2014 \`connector_google-analytics-oauth_request\` **\u30C4\u30FC\u30EB**\u5C02\u7528\uFF08\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7/\u63A2\u7D22\u6642\uFF09
|
|
11112
11098
|
|
|
11113
|
-
|
|
11114
|
-
- GET properties/{propertyId}/metadata
|
|
11099
|
+
\u4EE5\u4E0B\u306E\u751F\u306E HTTP \u5F62\u5F0F\u306F\u63A2\u7D22\u7528**\u30C4\u30FC\u30EB**\u306E\u3082\u306E\u3067\u3059\u3002**server-logic\uFF08\u4E0B\u8A18 Business Logic\uFF09\u3067\u306F\u3001\u3053\u308C\u3089\u306E HTTP \u30EA\u30AF\u30A8\u30B9\u30C8\u3092\u624B\u7D44\u307F\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044 \u2014 \u540C\u3058 body \u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u53D6\u308A\u3001\u30D1\u30FC\u30B9\u6E08\u307F JSON \u3092\u8FD4\u3059 SDK \u30E1\u30BD\u30C3\u30C9\u3092\u547C\u3093\u3067\u304F\u3060\u3055\u3044:**
|
|
11115
11100
|
|
|
11116
|
-
|
|
11117
|
-
|
|
11118
|
-
|
|
11119
|
-
|
|
11120
|
-
|
|
11121
|
-
|
|
11122
|
-
"metrics": [{"name": "activeUsers"}],
|
|
11123
|
-
"limit": 100
|
|
11124
|
-
}
|
|
11101
|
+
| \u751F\u306E HTTP\uFF08\u30C4\u30FC\u30EB\u30FB\u63A2\u7D22\u7528\uFF09 | server-logic\uFF08SDK \u30E1\u30BD\u30C3\u30C9\uFF09 |
|
|
11102
|
+
|---|---|
|
|
11103
|
+
| \`GET properties/{propertyId}/metadata\` | \`await client.getMetadata(propertyId)\` |
|
|
11104
|
+
| \`POST properties/{propertyId}:runReport\`\uFF08body: \`{ dateRanges, dimensions, metrics, limit }\`\uFF09 | \`await client.runReport({ propertyId, dateRanges, dimensions, metrics, limit })\` \u2192 \`{ rows, rowCount }\` |
|
|
11105
|
+
|
|
11106
|
+
\u30EC\u30DD\u30FC\u30C8\u306E body \u30D5\u30A3\u30FC\u30EB\u30C9: \`dateRanges: [{ startDate, endDate }]\`, \`dimensions: [{ name }]\`, \`metrics: [{ name }]\`, \u4EFB\u610F\u3067 \`limit\`\u3002
|
|
11125
11107
|
|
|
11126
11108
|
### \u4E3B\u8981\u306A\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3
|
|
11127
11109
|
date, country, city, deviceCategory, browser, pagePath, pageTitle,
|
|
@@ -11139,11 +11121,14 @@ averageSessionDuration, conversions, totalRevenue
|
|
|
11139
11121
|
|
|
11140
11122
|
\u3053\u306E\u30B3\u30CD\u30AF\u30BF\u306E\u30D3\u30B8\u30CD\u30B9\u30ED\u30B8\u30C3\u30AF\u30BF\u30A4\u30D7\u306F "typescript" \u3067\u3059\u3002\u4EE5\u4E0B\u306B\u793A\u3059\u30B3\u30CD\u30AF\u30BF SDK \u3092\u4F7F\u7528\u3057\u3066\u30CF\u30F3\u30C9\u30E9\u30B3\u30FC\u30C9\u3092\u8A18\u8FF0\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u74B0\u5883\u5909\u6570\u304B\u3089\u76F4\u63A5\u8A8D\u8A3C\u60C5\u5831\u306B\u30A2\u30AF\u30BB\u30B9\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002\`INTERNAL_SQUADBASE_*\` \u306E\u74B0\u5883\u5909\u6570\u3092\u4F7F\u3063\u3066\u624B\u52D5\u3067 OAuth \u30D7\u30ED\u30AD\u30B7\u3092\u53E9\u304F\u3053\u3068\u3082\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044 \u2014 SDK \u304C OAuth \u3092\u51E6\u7406\u3057\u307E\u3059\u3002
|
|
11141
11123
|
|
|
11142
|
-
SDK\uFF08\`connection(connectionId)\` \u3067\u4F5C\u6210\u3057\u305F\u30AF\u30E9\u30A4\u30A2\u30F3\u30C8\uFF09
|
|
11143
|
-
- \`client.
|
|
11144
|
-
- \`client.
|
|
11145
|
-
- \`client.
|
|
11146
|
-
|
|
11124
|
+
SDK\uFF08\`connection(connectionId)\` \u3067\u4F5C\u6210\u3057\u305F\u30AF\u30E9\u30A4\u30A2\u30F3\u30C8\uFF09\u3002**\u5404\u30E1\u30BD\u30C3\u30C9\u306F\u30D1\u30FC\u30B9\u6E08\u307F JSON \u3092\u8FD4\u3057\u307E\u3059 \u2014 HTTP \u30EA\u30AF\u30A8\u30B9\u30C8\u306E\u7D44\u307F\u7ACB\u3066\u3084\u30EC\u30B9\u30DD\u30F3\u30B9\u306E\u30D1\u30FC\u30B9\u3092\u81EA\u5206\u3067\u884C\u3046\u5FC5\u8981\u306F\u3042\u308A\u307E\u305B\u3093:**
|
|
11125
|
+
- \`client.runReport({ propertyId, dateRanges, dimensions, metrics, limit? })\` \u2014 GA4 \u30EC\u30DD\u30FC\u30C8\u3092\u5B9F\u884C\u3002\`{ rows, rowCount }\` \u3092\u8FD4\u3057\u307E\u3059\u3002**\u30EC\u30DD\u30FC\u30C8\u53D6\u5F97\u306F\u5FC5\u305A\u3053\u308C\u3092\u4F7F\u3063\u3066\u304F\u3060\u3055\u3044\u3002**
|
|
11126
|
+
- \`client.runRealtimeReport({ propertyId, dimensions, metrics })\` \u2014 \u30EA\u30A2\u30EB\u30BF\u30A4\u30E0\u30EC\u30DD\u30FC\u30C8\u3002\`{ rows, rowCount }\` \u3092\u8FD4\u3057\u307E\u3059\u3002
|
|
11127
|
+
- \`client.getMetadata(propertyId)\` \u2014 \u6307\u5B9A\u30D7\u30ED\u30D1\u30C6\u30A3\u306E\u5229\u7528\u53EF\u80FD\u306A\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u3068\u30E1\u30C8\u30EA\u30AF\u30B9\u3092\u53D6\u5F97\u3002
|
|
11128
|
+
|
|
11129
|
+
**\u30A2\u30F3\u30C1\u30D1\u30BF\u30FC\u30F3 \u2014 \u3053\u308C\u306F\u7D76\u5BFE\u306B\u3084\u3089\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002** \`client.request(...)\` \u306F\u751F\u306E \`Response\` \u3092\u8FD4\u3059\u4F4E\u30EC\u30D9\u30EB\u306E\u9003\u3052\u9053\u3067\u3042\u308A\u3001\u30EC\u30DD\u30FC\u30C8\u5B9F\u884C\u306E\u624B\u6BB5\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\u7279\u306B **\`client.request({ method, path, body })\` \u306F\u7D76\u5BFE\u306B\u547C\u3070\u306A\u3044\u3067\u304F\u3060\u3055\u3044** \u2014 \u305D\u306E\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u5F62\u306F\u63A2\u7D22\u7528*\u30C4\u30FC\u30EB*\u306E\u5F62\u3067\u3042\u3063\u3066 SDK \u306E\u3082\u306E\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\u30EC\u30DD\u30FC\u30C8\u306F\u5B9F\u884C\u3055\u308C\u305A\u3001\`(await client.request({...})).rows\` \u306F\u5E38\u306B \`undefined\` \u306B\u306A\u308A\u307E\u3059\u3002\u4EE3\u308F\u308A\u306B \`client.runReport({ propertyId, ... })\` \u3092\u4F7F\u3063\u3066\u304F\u3060\u3055\u3044\u3002
|
|
11130
|
+
|
|
11131
|
+
**\`propertyId\` \u306F\u3059\u3079\u3066\u306E\u547C\u3073\u51FA\u3057\u3067\u5FC5\u9808\u3067\u3059**\uFF08\u30C7\u30FC\u30BF\u6982\u8981\u306B\u8F09\u3063\u3066\u3044\u308B\u6570\u5024ID\uFF09\u3002GA \u306E\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306F\u8907\u6570\u30D7\u30ED\u30D1\u30C6\u30A3\u306B\u307E\u305F\u304C\u308B\u3053\u3068\u304C\u3042\u308B\u305F\u3081\u3001\u30C7\u30D5\u30A9\u30EB\u30C8\u306F\u4FDD\u5B58\u3055\u308C\u307E\u305B\u3093\u3002
|
|
11147
11132
|
|
|
11148
11133
|
\u30CF\u30F3\u30C9\u30E9\u306E\u30C6\u30B9\u30C8\u304C \`Connection proxy is not configured\` \u3067\u5931\u6557\u3059\u308B\u5834\u5408\u306F\u518D\u8A66\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u901A\u5E38\u306F\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306E\u521D\u671F\u5316\u4E2D\u306B\u8D77\u304D\u307E\u3059\u3002SDK \u3092\u8AE6\u3081\u3066 OAuth \u30D7\u30ED\u30AD\u30B7\u306E URL \u3092\u81EA\u5206\u3067\u7D44\u307F\u7ACB\u3066\u308B\u3053\u3068\u306F **\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044**\u3002
|
|
11149
11134
|
|
|
@@ -11152,38 +11137,32 @@ SDK\uFF08\`connection(connectionId)\` \u3067\u4F5C\u6210\u3057\u305F\u30AF\u30E9
|
|
|
11152
11137
|
\`\`\`ts
|
|
11153
11138
|
import { connection } from "@squadbase/vite-server/connectors/google-analytics-oauth";
|
|
11154
11139
|
|
|
11155
|
-
|
|
11140
|
+
export default async function handler(c) {
|
|
11141
|
+
const client = connection("<connectionId>");
|
|
11142
|
+
const propertyId = "123456789"; // \u30C7\u30FC\u30BF\u6982\u8981\u306B\u8F09\u3063\u3066\u3044\u308B\u6570\u5024\u306E GA4 \u30D7\u30ED\u30D1\u30C6\u30A3ID
|
|
11156
11143
|
|
|
11157
|
-
|
|
11158
|
-
|
|
11159
|
-
|
|
11160
|
-
|
|
11161
|
-
}
|
|
11162
|
-
|
|
11144
|
+
const { rows } = await client.runReport({
|
|
11145
|
+
propertyId,
|
|
11146
|
+
dateRanges: [{ startDate: "28daysAgo", endDate: "today" }],
|
|
11147
|
+
dimensions: [{ name: "date" }, { name: "sessionDefaultChannelGroup" }],
|
|
11148
|
+
metrics: [{ name: "sessions" }],
|
|
11149
|
+
});
|
|
11163
11150
|
|
|
11164
|
-
|
|
11165
|
-
|
|
11166
|
-
|
|
11167
|
-
|
|
11168
|
-
|
|
11169
|
-
|
|
11170
|
-
|
|
11171
|
-
|
|
11172
|
-
const realtime = await ga.runRealtimeReport({
|
|
11173
|
-
metrics: [{ name: "activeUsers" }],
|
|
11174
|
-
dimensions: [{ name: "country" }],
|
|
11175
|
-
});
|
|
11151
|
+
const data = rows.map((row) => ({
|
|
11152
|
+
date: row.dimensionValues[0].value,
|
|
11153
|
+
channel: row.dimensionValues[1].value,
|
|
11154
|
+
sessions: Number(row.metricValues[0].value) || 0,
|
|
11155
|
+
}));
|
|
11156
|
+
|
|
11157
|
+
return c.json(data);
|
|
11158
|
+
}
|
|
11176
11159
|
\`\`\``
|
|
11177
11160
|
},
|
|
11178
11161
|
tools: tools16,
|
|
11179
11162
|
setup: (params, ctx, config) => runSetupFlow(googleAnalyticsOauthSetupFlow, params, ctx, config),
|
|
11180
|
-
async checkConnection(
|
|
11163
|
+
async checkConnection(_params, config) {
|
|
11181
11164
|
const { proxyFetch } = config;
|
|
11182
|
-
const
|
|
11183
|
-
if (!propertyId) {
|
|
11184
|
-
return { success: true };
|
|
11185
|
-
}
|
|
11186
|
-
const url = `https://analyticsdata.googleapis.com/v1beta/properties/${propertyId}/metadata`;
|
|
11165
|
+
const url = "https://analyticsadmin.googleapis.com/v1beta/accountSummaries";
|
|
11187
11166
|
try {
|
|
11188
11167
|
const res = await proxyFetch(url, { method: "GET" });
|
|
11189
11168
|
if (!res.ok) {
|
|
@@ -11207,8 +11186,8 @@ const realtime = await ga.runRealtimeReport({
|
|
|
11207
11186
|
import { z as z26 } from "zod";
|
|
11208
11187
|
|
|
11209
11188
|
// ../connectors/src/lib/normalize-path.ts
|
|
11210
|
-
function normalizeRequestPath(
|
|
11211
|
-
let p =
|
|
11189
|
+
function normalizeRequestPath(path4, basePathSegment) {
|
|
11190
|
+
let p = path4.trim();
|
|
11212
11191
|
if (!p.startsWith("/")) p = "/" + p;
|
|
11213
11192
|
if (p === basePathSegment || p.startsWith(basePathSegment + "/")) {
|
|
11214
11193
|
p = p.slice(basePathSegment.length) || "/";
|
|
@@ -11272,7 +11251,7 @@ var requestTool5 = new ConnectorTool({
|
|
|
11272
11251
|
description: "Call the Google Calendar API as the service account itself (no delegation). Read-only operations only. Only calendars explicitly shared with the service account email are accessible. Pass `scopes` as a read-only Calendar scope (e.g., ['https://www.googleapis.com/auth/calendar.readonly']). Use this tool when the project knowledge records the calendar with `(service-account, ...)` (no `subject`).",
|
|
11273
11252
|
inputSchema: inputSchema26,
|
|
11274
11253
|
outputSchema: outputSchema26,
|
|
11275
|
-
async execute({ connectionId, method, path:
|
|
11254
|
+
async execute({ connectionId, method, path: path4, scopes, queryParams, body }, connections) {
|
|
11276
11255
|
const connection = connections.find((c) => c.id === connectionId);
|
|
11277
11256
|
if (!connection) {
|
|
11278
11257
|
return {
|
|
@@ -11293,7 +11272,7 @@ var requestTool5 = new ConnectorTool({
|
|
|
11293
11272
|
}
|
|
11294
11273
|
const serviceAccountEmail = serviceAccount.client_email;
|
|
11295
11274
|
console.log(
|
|
11296
|
-
`[connector-request] google-calendar/${connection.name}: ${method} ${
|
|
11275
|
+
`[connector-request] google-calendar/${connection.name}: ${method} ${path4} (service account)`
|
|
11297
11276
|
);
|
|
11298
11277
|
try {
|
|
11299
11278
|
const { GoogleAuth } = await import("google-auth-library");
|
|
@@ -11312,7 +11291,7 @@ var requestTool5 = new ConnectorTool({
|
|
|
11312
11291
|
serviceAccountEmail
|
|
11313
11292
|
};
|
|
11314
11293
|
}
|
|
11315
|
-
const normalizedPath = normalizeRequestPath(
|
|
11294
|
+
const normalizedPath = normalizeRequestPath(path4, BASE_PATH_SEGMENT);
|
|
11316
11295
|
let url = `${BASE_URL5}${normalizedPath}`;
|
|
11317
11296
|
if (queryParams) {
|
|
11318
11297
|
const searchParams = new URLSearchParams(queryParams);
|
|
@@ -11409,7 +11388,7 @@ var requestWithDelegationTool = new ConnectorTool({
|
|
|
11409
11388
|
description: "Call the Google Calendar API on behalf of the specified Workspace user via Domain-wide Delegation. Read-only operations only. Pass `subject` as the target user email and `scopes` as a read-only Calendar scope (e.g., ['https://www.googleapis.com/auth/calendar.readonly']). Use this tool when the project knowledge records the calendar with `(delegation, subject: <email>, ...)`. Requires Domain-wide Delegation to be authorized for the service account in the Workspace admin console.",
|
|
11410
11389
|
inputSchema: inputSchema27,
|
|
11411
11390
|
outputSchema: outputSchema27,
|
|
11412
|
-
async execute({ connectionId, method, path:
|
|
11391
|
+
async execute({ connectionId, method, path: path4, subject, scopes, queryParams, body }, connections) {
|
|
11413
11392
|
const connection = connections.find((c) => c.id === connectionId);
|
|
11414
11393
|
if (!connection) {
|
|
11415
11394
|
return {
|
|
@@ -11430,7 +11409,7 @@ var requestWithDelegationTool = new ConnectorTool({
|
|
|
11430
11409
|
}
|
|
11431
11410
|
const serviceAccountEmail = serviceAccount.client_email;
|
|
11432
11411
|
console.log(
|
|
11433
|
-
`[connector-request] google-calendar/${connection.name}: ${method} ${
|
|
11412
|
+
`[connector-request] google-calendar/${connection.name}: ${method} ${path4} subject=${subject}`
|
|
11434
11413
|
);
|
|
11435
11414
|
try {
|
|
11436
11415
|
const { GoogleAuth } = await import("google-auth-library");
|
|
@@ -11450,7 +11429,7 @@ var requestWithDelegationTool = new ConnectorTool({
|
|
|
11450
11429
|
serviceAccountEmail
|
|
11451
11430
|
};
|
|
11452
11431
|
}
|
|
11453
|
-
const normalizedPath = normalizeRequestPath(
|
|
11432
|
+
const normalizedPath = normalizeRequestPath(path4, BASE_PATH_SEGMENT2);
|
|
11454
11433
|
let url = `${BASE_URL6}${normalizedPath}`;
|
|
11455
11434
|
if (queryParams) {
|
|
11456
11435
|
const searchParams = new URLSearchParams(queryParams);
|
|
@@ -12532,7 +12511,7 @@ Authentication is handled automatically via OAuth proxy.
|
|
|
12532
12511
|
{calendarId} in the path is automatically replaced with the connection's default calendar ID.`,
|
|
12533
12512
|
inputSchema: inputSchema29,
|
|
12534
12513
|
outputSchema: outputSchema29,
|
|
12535
|
-
async execute({ connectionId, method, path:
|
|
12514
|
+
async execute({ connectionId, method, path: path4, queryParams, body }, connections, config) {
|
|
12536
12515
|
const connection = connections.find((c) => c.id === connectionId);
|
|
12537
12516
|
if (!connection) {
|
|
12538
12517
|
return {
|
|
@@ -12541,11 +12520,11 @@ Authentication is handled automatically via OAuth proxy.
|
|
|
12541
12520
|
};
|
|
12542
12521
|
}
|
|
12543
12522
|
console.log(
|
|
12544
|
-
`[connector-request] google-calendar-oauth/${connection.name}: ${method} ${
|
|
12523
|
+
`[connector-request] google-calendar-oauth/${connection.name}: ${method} ${path4}`
|
|
12545
12524
|
);
|
|
12546
12525
|
try {
|
|
12547
12526
|
const calendarId = parameters18.calendarId.tryGetValue(connection) ?? "primary";
|
|
12548
|
-
const resolvedPath =
|
|
12527
|
+
const resolvedPath = path4.replace(/\{calendarId\}/g, calendarId);
|
|
12549
12528
|
const normalizedPath = normalizeRequestPath(
|
|
12550
12529
|
resolvedPath,
|
|
12551
12530
|
BASE_PATH_SEGMENT3
|
|
@@ -12951,7 +12930,7 @@ Supports GET (read) and POST (create/update) methods.
|
|
|
12951
12930
|
Authentication is handled automatically via OAuth proxy.`,
|
|
12952
12931
|
inputSchema: inputSchema30,
|
|
12953
12932
|
outputSchema: outputSchema30,
|
|
12954
|
-
async execute({ connectionId, method, path:
|
|
12933
|
+
async execute({ connectionId, method, path: path4, body, queryParams }, connections, config) {
|
|
12955
12934
|
const connection = connections.find((c) => c.id === connectionId);
|
|
12956
12935
|
if (!connection) {
|
|
12957
12936
|
return {
|
|
@@ -12960,11 +12939,11 @@ Authentication is handled automatically via OAuth proxy.`,
|
|
|
12960
12939
|
};
|
|
12961
12940
|
}
|
|
12962
12941
|
console.log(
|
|
12963
|
-
`[connector-request] google-docs/${connection.name}: ${method} ${
|
|
12942
|
+
`[connector-request] google-docs/${connection.name}: ${method} ${path4}`
|
|
12964
12943
|
);
|
|
12965
12944
|
try {
|
|
12966
12945
|
const normalizedPath = normalizeRequestPath(
|
|
12967
|
-
|
|
12946
|
+
path4,
|
|
12968
12947
|
DOCS_BASE_PATH_SEGMENT
|
|
12969
12948
|
);
|
|
12970
12949
|
let url = `${DOCS_BASE_URL}${normalizedPath === "/" ? "" : normalizedPath}`;
|
|
@@ -13416,7 +13395,7 @@ Supports GET (read/list/download), POST (create/copy), and PATCH (update) method
|
|
|
13416
13395
|
Authentication is handled automatically via OAuth proxy.`,
|
|
13417
13396
|
inputSchema: inputSchema31,
|
|
13418
13397
|
outputSchema: outputSchema31,
|
|
13419
|
-
async execute({ connectionId, method, path:
|
|
13398
|
+
async execute({ connectionId, method, path: path4, body, queryParams }, connections, config) {
|
|
13420
13399
|
const connection = connections.find((c) => c.id === connectionId);
|
|
13421
13400
|
if (!connection) {
|
|
13422
13401
|
return {
|
|
@@ -13425,10 +13404,10 @@ Authentication is handled automatically via OAuth proxy.`,
|
|
|
13425
13404
|
};
|
|
13426
13405
|
}
|
|
13427
13406
|
console.log(
|
|
13428
|
-
`[connector-request] google-drive/${connection.name}: ${method} ${
|
|
13407
|
+
`[connector-request] google-drive/${connection.name}: ${method} ${path4}`
|
|
13429
13408
|
);
|
|
13430
13409
|
try {
|
|
13431
|
-
const normalizedPath = normalizeRequestPath(
|
|
13410
|
+
const normalizedPath = normalizeRequestPath(path4, BASE_PATH_SEGMENT4);
|
|
13432
13411
|
let url = `${BASE_URL9}${normalizedPath}`;
|
|
13433
13412
|
if (queryParams) {
|
|
13434
13413
|
const searchParams = new URLSearchParams(queryParams);
|
|
@@ -13857,7 +13836,7 @@ The caller must include the target spreadsheetId in the path explicitly.
|
|
|
13857
13836
|
Authentication is handled automatically via OAuth proxy.`,
|
|
13858
13837
|
inputSchema: inputSchema32,
|
|
13859
13838
|
outputSchema: outputSchema32,
|
|
13860
|
-
async execute({ connectionId, method, path:
|
|
13839
|
+
async execute({ connectionId, method, path: path4, queryParams }, connections, config) {
|
|
13861
13840
|
const connection = connections.find((c) => c.id === connectionId);
|
|
13862
13841
|
if (!connection) {
|
|
13863
13842
|
return {
|
|
@@ -13866,11 +13845,11 @@ Authentication is handled automatically via OAuth proxy.`,
|
|
|
13866
13845
|
};
|
|
13867
13846
|
}
|
|
13868
13847
|
console.log(
|
|
13869
|
-
`[connector-request] google-sheets/${connection.name}: ${method} ${
|
|
13848
|
+
`[connector-request] google-sheets/${connection.name}: ${method} ${path4}`
|
|
13870
13849
|
);
|
|
13871
13850
|
try {
|
|
13872
13851
|
const normalizedPath = normalizeRequestPath(
|
|
13873
|
-
|
|
13852
|
+
path4,
|
|
13874
13853
|
SHEETS_BASE_PATH_SEGMENT
|
|
13875
13854
|
);
|
|
13876
13855
|
let url = `${SHEETS_BASE_URL}${normalizedPath === "/" ? "" : normalizedPath}`;
|
|
@@ -14373,7 +14352,7 @@ Supports GET (read) and POST (create/update) methods.
|
|
|
14373
14352
|
Authentication is handled automatically via OAuth proxy.`,
|
|
14374
14353
|
inputSchema: inputSchema33,
|
|
14375
14354
|
outputSchema: outputSchema33,
|
|
14376
|
-
async execute({ connectionId, method, path:
|
|
14355
|
+
async execute({ connectionId, method, path: path4, body, queryParams }, connections, config) {
|
|
14377
14356
|
const connection = connections.find((c) => c.id === connectionId);
|
|
14378
14357
|
if (!connection) {
|
|
14379
14358
|
return {
|
|
@@ -14382,11 +14361,11 @@ Authentication is handled automatically via OAuth proxy.`,
|
|
|
14382
14361
|
};
|
|
14383
14362
|
}
|
|
14384
14363
|
console.log(
|
|
14385
|
-
`[connector-request] google-slides/${connection.name}: ${method} ${
|
|
14364
|
+
`[connector-request] google-slides/${connection.name}: ${method} ${path4}`
|
|
14386
14365
|
);
|
|
14387
14366
|
try {
|
|
14388
14367
|
const normalizedPath = normalizeRequestPath(
|
|
14389
|
-
|
|
14368
|
+
path4,
|
|
14390
14369
|
SLIDES_BASE_PATH_SEGMENT
|
|
14391
14370
|
);
|
|
14392
14371
|
let url = `${SLIDES_BASE_URL}${normalizedPath === "/" ? "" : normalizedPath}`;
|
|
@@ -14677,7 +14656,7 @@ var requestTool11 = new ConnectorTool({
|
|
|
14677
14656
|
Authentication is handled automatically via OAuth proxy.`,
|
|
14678
14657
|
inputSchema: inputSchema34,
|
|
14679
14658
|
outputSchema: outputSchema34,
|
|
14680
|
-
async execute({ connectionId, method, path:
|
|
14659
|
+
async execute({ connectionId, method, path: path4, queryParams, body }, connections, config) {
|
|
14681
14660
|
const connection = connections.find((c) => c.id === connectionId);
|
|
14682
14661
|
if (!connection) {
|
|
14683
14662
|
return {
|
|
@@ -14686,10 +14665,10 @@ Authentication is handled automatically via OAuth proxy.`,
|
|
|
14686
14665
|
};
|
|
14687
14666
|
}
|
|
14688
14667
|
console.log(
|
|
14689
|
-
`[connector-request] hubspot-oauth/${connection.name}: ${method} ${
|
|
14668
|
+
`[connector-request] hubspot-oauth/${connection.name}: ${method} ${path4}`
|
|
14690
14669
|
);
|
|
14691
14670
|
try {
|
|
14692
|
-
let url = `${BASE_URL10}${
|
|
14671
|
+
let url = `${BASE_URL10}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
14693
14672
|
if (queryParams) {
|
|
14694
14673
|
const searchParams = new URLSearchParams(queryParams);
|
|
14695
14674
|
url += `?${searchParams.toString()}`;
|
|
@@ -14765,8 +14744,8 @@ var hubspotOnboarding = new ConnectorOnboarding({
|
|
|
14765
14744
|
|
|
14766
14745
|
// ../connectors/src/connectors/hubspot-oauth/utils.ts
|
|
14767
14746
|
var BASE_URL11 = "https://api.hubapi.com";
|
|
14768
|
-
function apiFetch2(proxyFetch,
|
|
14769
|
-
const url = `${BASE_URL11}${
|
|
14747
|
+
function apiFetch2(proxyFetch, path4, init) {
|
|
14748
|
+
const url = `${BASE_URL11}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
14770
14749
|
return proxyFetch(url, init);
|
|
14771
14750
|
}
|
|
14772
14751
|
|
|
@@ -15088,7 +15067,7 @@ var requestTool12 = new ConnectorTool({
|
|
|
15088
15067
|
Authentication is handled automatically via OAuth proxy.`,
|
|
15089
15068
|
inputSchema: inputSchema35,
|
|
15090
15069
|
outputSchema: outputSchema35,
|
|
15091
|
-
async execute({ connectionId, method, path:
|
|
15070
|
+
async execute({ connectionId, method, path: path4, queryParams, body }, connections, config) {
|
|
15092
15071
|
const connection = connections.find((c) => c.id === connectionId);
|
|
15093
15072
|
if (!connection) {
|
|
15094
15073
|
return {
|
|
@@ -15097,10 +15076,10 @@ Authentication is handled automatically via OAuth proxy.`,
|
|
|
15097
15076
|
};
|
|
15098
15077
|
}
|
|
15099
15078
|
console.log(
|
|
15100
|
-
`[connector-request] stripe-oauth/${connection.name}: ${method} ${
|
|
15079
|
+
`[connector-request] stripe-oauth/${connection.name}: ${method} ${path4}`
|
|
15101
15080
|
);
|
|
15102
15081
|
try {
|
|
15103
|
-
let url = `${BASE_URL12}${
|
|
15082
|
+
let url = `${BASE_URL12}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
15104
15083
|
if (queryParams) {
|
|
15105
15084
|
const searchParams = new URLSearchParams(queryParams);
|
|
15106
15085
|
url += `?${searchParams.toString()}`;
|
|
@@ -15514,7 +15493,7 @@ Authentication is handled automatically using the configured API Key (Bearer tok
|
|
|
15514
15493
|
Use this tool for all Stripe API interactions: querying charges, customers, invoices, subscriptions, products, prices, payment intents, balances, and more.`,
|
|
15515
15494
|
inputSchema: inputSchema36,
|
|
15516
15495
|
outputSchema: outputSchema36,
|
|
15517
|
-
async execute({ connectionId, method, path:
|
|
15496
|
+
async execute({ connectionId, method, path: path4, queryParams, body }, connections) {
|
|
15518
15497
|
const connection = connections.find((c) => c.id === connectionId);
|
|
15519
15498
|
if (!connection) {
|
|
15520
15499
|
return {
|
|
@@ -15523,11 +15502,11 @@ Use this tool for all Stripe API interactions: querying charges, customers, invo
|
|
|
15523
15502
|
};
|
|
15524
15503
|
}
|
|
15525
15504
|
console.log(
|
|
15526
|
-
`[connector-request] stripe-api-key/${connection.name}: ${method} ${
|
|
15505
|
+
`[connector-request] stripe-api-key/${connection.name}: ${method} ${path4}`
|
|
15527
15506
|
);
|
|
15528
15507
|
try {
|
|
15529
15508
|
const apiKey = parameters25.apiKey.getValue(connection);
|
|
15530
|
-
let url = `${BASE_URL14}${
|
|
15509
|
+
let url = `${BASE_URL14}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
15531
15510
|
if (queryParams) {
|
|
15532
15511
|
const searchParams = new URLSearchParams(queryParams);
|
|
15533
15512
|
url += `?${searchParams.toString()}`;
|
|
@@ -15607,12 +15586,12 @@ var stripeApiKeyOnboarding = new ConnectorOnboarding({
|
|
|
15607
15586
|
|
|
15608
15587
|
// ../connectors/src/connectors/stripe-api-key/utils.ts
|
|
15609
15588
|
var BASE_URL15 = "https://api.stripe.com";
|
|
15610
|
-
async function apiFetch3(params,
|
|
15589
|
+
async function apiFetch3(params, path4, init) {
|
|
15611
15590
|
const apiKey = params[parameters25.apiKey.slug];
|
|
15612
15591
|
if (!apiKey) {
|
|
15613
15592
|
throw new Error("stripe-api-key: missing required parameter: api-key");
|
|
15614
15593
|
}
|
|
15615
|
-
const url = `${BASE_URL15}${
|
|
15594
|
+
const url = `${BASE_URL15}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
15616
15595
|
const headers = new Headers(init?.headers);
|
|
15617
15596
|
headers.set("Authorization", `Bearer ${apiKey}`);
|
|
15618
15597
|
return fetch(url, { ...init, headers });
|
|
@@ -15651,8 +15630,8 @@ var ENTITY_PATHS2 = {
|
|
|
15651
15630
|
paymentIntents: "/v1/payment_intents?limit=3"
|
|
15652
15631
|
};
|
|
15653
15632
|
var ENTITY_VALUES2 = Object.keys(ENTITY_PATHS2);
|
|
15654
|
-
async function defaultFetchEntity(params,
|
|
15655
|
-
return apiFetch3(params,
|
|
15633
|
+
async function defaultFetchEntity(params, path4) {
|
|
15634
|
+
return apiFetch3(params, path4);
|
|
15656
15635
|
}
|
|
15657
15636
|
function createStripeSetupFlow(fetchEntity = defaultFetchEntity, labelPrefix = "Stripe") {
|
|
15658
15637
|
return {
|
|
@@ -15986,7 +15965,7 @@ Authentication is handled automatically via OAuth proxy.
|
|
|
15986
15965
|
{baseId} in the path is automatically replaced with the connection's default base ID if configured.`,
|
|
15987
15966
|
inputSchema: inputSchema37,
|
|
15988
15967
|
outputSchema: outputSchema37,
|
|
15989
|
-
async execute({ connectionId, method, path:
|
|
15968
|
+
async execute({ connectionId, method, path: path4, queryParams, body }, connections, config) {
|
|
15990
15969
|
const connection = connections.find((c) => c.id === connectionId);
|
|
15991
15970
|
if (!connection) {
|
|
15992
15971
|
return {
|
|
@@ -15995,11 +15974,11 @@ Authentication is handled automatically via OAuth proxy.
|
|
|
15995
15974
|
};
|
|
15996
15975
|
}
|
|
15997
15976
|
console.log(
|
|
15998
|
-
`[connector-request] airtable-oauth/${connection.name}: ${method} ${
|
|
15977
|
+
`[connector-request] airtable-oauth/${connection.name}: ${method} ${path4}`
|
|
15999
15978
|
);
|
|
16000
15979
|
try {
|
|
16001
15980
|
const baseId = parameters26.baseId.tryGetValue(connection);
|
|
16002
|
-
const resolvedPath = baseId ?
|
|
15981
|
+
const resolvedPath = baseId ? path4.replace(/\{baseId\}/g, baseId) : path4;
|
|
16003
15982
|
let url = `${BASE_URL16}${resolvedPath.startsWith("/") ? "" : "/"}${resolvedPath}`;
|
|
16004
15983
|
if (queryParams) {
|
|
16005
15984
|
const searchParams = new URLSearchParams(queryParams);
|
|
@@ -16084,8 +16063,8 @@ var airtableOauthOnboarding = new ConnectorOnboarding({
|
|
|
16084
16063
|
|
|
16085
16064
|
// ../connectors/src/connectors/airtable-oauth/utils.ts
|
|
16086
16065
|
var BASE_URL17 = "https://api.airtable.com/v0";
|
|
16087
|
-
function apiFetch4(proxyFetch,
|
|
16088
|
-
const url = `${BASE_URL17}${
|
|
16066
|
+
function apiFetch4(proxyFetch, path4, init) {
|
|
16067
|
+
const url = `${BASE_URL17}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
16089
16068
|
return proxyFetch(url, init);
|
|
16090
16069
|
}
|
|
16091
16070
|
|
|
@@ -16424,7 +16403,7 @@ var parameters27 = {
|
|
|
16424
16403
|
};
|
|
16425
16404
|
|
|
16426
16405
|
// ../connectors/src/connectors/kintone/utils.ts
|
|
16427
|
-
async function apiFetch5(params,
|
|
16406
|
+
async function apiFetch5(params, path4, init) {
|
|
16428
16407
|
const baseUrl = params[parameters27.baseUrl.slug];
|
|
16429
16408
|
const username = params[parameters27.username.slug];
|
|
16430
16409
|
const password = params[parameters27.password.slug];
|
|
@@ -16434,7 +16413,7 @@ async function apiFetch5(params, path5, init) {
|
|
|
16434
16413
|
);
|
|
16435
16414
|
}
|
|
16436
16415
|
const authToken = Buffer.from(`${username}:${password}`).toString("base64");
|
|
16437
|
-
const normalizedPath =
|
|
16416
|
+
const normalizedPath = path4.replace(/^\/+/, "");
|
|
16438
16417
|
const url = `${baseUrl.replace(/\/+$/, "")}/k/v1/${normalizedPath}`;
|
|
16439
16418
|
const headers = new Headers(init?.headers);
|
|
16440
16419
|
headers.set("X-Cybozu-Authorization", authToken);
|
|
@@ -16648,18 +16627,18 @@ var requestTool15 = new ConnectorTool({
|
|
|
16648
16627
|
Authentication is handled automatically using username and password.`,
|
|
16649
16628
|
inputSchema: inputSchema38,
|
|
16650
16629
|
outputSchema: outputSchema38,
|
|
16651
|
-
async execute({ connectionId, method, path:
|
|
16630
|
+
async execute({ connectionId, method, path: path4, body }, connections) {
|
|
16652
16631
|
const connection = connections.find((c) => c.id === connectionId);
|
|
16653
16632
|
if (!connection) {
|
|
16654
16633
|
return { success: false, error: `Connection ${connectionId} not found` };
|
|
16655
16634
|
}
|
|
16656
|
-
console.log(`[connector-request] kintone/${connection.name}: ${method} ${
|
|
16635
|
+
console.log(`[connector-request] kintone/${connection.name}: ${method} ${path4}`);
|
|
16657
16636
|
try {
|
|
16658
16637
|
const baseUrl = parameters27.baseUrl.getValue(connection);
|
|
16659
16638
|
const username = parameters27.username.getValue(connection);
|
|
16660
16639
|
const password = parameters27.password.getValue(connection);
|
|
16661
16640
|
const authToken = Buffer.from(`${username}:${password}`).toString("base64");
|
|
16662
|
-
const url = `${baseUrl.replace(/\/+$/, "")}/k/v1/${
|
|
16641
|
+
const url = `${baseUrl.replace(/\/+$/, "")}/k/v1/${path4}`;
|
|
16663
16642
|
const controller = new AbortController();
|
|
16664
16643
|
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS26);
|
|
16665
16644
|
try {
|
|
@@ -16964,7 +16943,7 @@ var parameters28 = {
|
|
|
16964
16943
|
};
|
|
16965
16944
|
|
|
16966
16945
|
// ../connectors/src/connectors/kintone-api-token/utils.ts
|
|
16967
|
-
async function apiFetch6(params,
|
|
16946
|
+
async function apiFetch6(params, path4, init) {
|
|
16968
16947
|
const baseUrl = params[parameters28.baseUrl.slug];
|
|
16969
16948
|
const apiToken = params[parameters28.apiToken.slug];
|
|
16970
16949
|
if (!baseUrl || !apiToken) {
|
|
@@ -16972,7 +16951,7 @@ async function apiFetch6(params, path5, init) {
|
|
|
16972
16951
|
"kintone-api-token: missing required parameter(s): base-url, api-token"
|
|
16973
16952
|
);
|
|
16974
16953
|
}
|
|
16975
|
-
const normalizedPath =
|
|
16954
|
+
const normalizedPath = path4.replace(/^\/+/, "");
|
|
16976
16955
|
const url = `${baseUrl.replace(/\/+$/, "")}/k/v1/${normalizedPath}`;
|
|
16977
16956
|
const headers = new Headers(init?.headers);
|
|
16978
16957
|
headers.set("X-Cybozu-API-Token", apiToken);
|
|
@@ -17085,8 +17064,8 @@ var APP_PARAM_KEY_BY_ENDPOINT = {
|
|
|
17085
17064
|
"app.json": "id"
|
|
17086
17065
|
};
|
|
17087
17066
|
var DEFAULT_APP_PARAM_KEY = "app";
|
|
17088
|
-
function injectAppIntoPath(
|
|
17089
|
-
const [head, query = ""] =
|
|
17067
|
+
function injectAppIntoPath(path4, appId) {
|
|
17068
|
+
const [head, query = ""] = path4.split("?", 2);
|
|
17090
17069
|
const endpoint = head.toLowerCase();
|
|
17091
17070
|
const paramKey = APP_PARAM_KEY_BY_ENDPOINT[endpoint] ?? DEFAULT_APP_PARAM_KEY;
|
|
17092
17071
|
const params = new URLSearchParams(query);
|
|
@@ -17127,17 +17106,17 @@ var requestTool16 = new ConnectorTool({
|
|
|
17127
17106
|
Authentication is handled automatically using the API token.`,
|
|
17128
17107
|
inputSchema: inputSchema39,
|
|
17129
17108
|
outputSchema: outputSchema39,
|
|
17130
|
-
async execute({ connectionId, method, path:
|
|
17109
|
+
async execute({ connectionId, method, path: path4, body }, connections) {
|
|
17131
17110
|
const connection = connections.find((c) => c.id === connectionId);
|
|
17132
17111
|
if (!connection) {
|
|
17133
17112
|
return { success: false, error: `Connection ${connectionId} not found` };
|
|
17134
17113
|
}
|
|
17135
|
-
console.log(`[connector-request] kintone-api-token/${connection.name}: ${method} ${
|
|
17114
|
+
console.log(`[connector-request] kintone-api-token/${connection.name}: ${method} ${path4}`);
|
|
17136
17115
|
try {
|
|
17137
17116
|
const baseUrl = parameters28.baseUrl.getValue(connection);
|
|
17138
17117
|
const apiToken = parameters28.apiToken.getValue(connection);
|
|
17139
17118
|
const appId = parameters28.appId.getValue(connection);
|
|
17140
|
-
const normalizedPath =
|
|
17119
|
+
const normalizedPath = path4.replace(/^\/+/, "");
|
|
17141
17120
|
const pathHead = normalizedPath.split("?")[0] ?? "";
|
|
17142
17121
|
if (/^apps\.json$/i.test(pathHead)) {
|
|
17143
17122
|
return {
|
|
@@ -17354,8 +17333,8 @@ export default async function handler(c: Context) {
|
|
|
17354
17333
|
};
|
|
17355
17334
|
}
|
|
17356
17335
|
try {
|
|
17357
|
-
const
|
|
17358
|
-
const url = `${baseUrl.replace(/\/+$/, "")}/k/v1/${
|
|
17336
|
+
const path4 = appId ? `app.json?id=${encodeURIComponent(appId)}` : `app/form/fields.json?app=0`;
|
|
17337
|
+
const url = `${baseUrl.replace(/\/+$/, "")}/k/v1/${path4}`;
|
|
17359
17338
|
const res = await fetch(url, {
|
|
17360
17339
|
method: "GET",
|
|
17361
17340
|
headers: {
|
|
@@ -17436,7 +17415,7 @@ var parameters29 = {
|
|
|
17436
17415
|
|
|
17437
17416
|
// ../connectors/src/connectors/wix-store/utils.ts
|
|
17438
17417
|
var BASE_URL18 = "https://www.wixapis.com";
|
|
17439
|
-
async function apiFetch7(params,
|
|
17418
|
+
async function apiFetch7(params, path4, init) {
|
|
17440
17419
|
const apiKey = params[parameters29.apiKey.slug];
|
|
17441
17420
|
const siteId = params[parameters29.siteId.slug];
|
|
17442
17421
|
if (!apiKey || !siteId) {
|
|
@@ -17444,7 +17423,7 @@ async function apiFetch7(params, path5, init) {
|
|
|
17444
17423
|
"wix-store: missing required parameters: api-key and site-id"
|
|
17445
17424
|
);
|
|
17446
17425
|
}
|
|
17447
|
-
const url = `${BASE_URL18}${
|
|
17426
|
+
const url = `${BASE_URL18}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
17448
17427
|
const headers = new Headers(init?.headers);
|
|
17449
17428
|
headers.set("Authorization", apiKey);
|
|
17450
17429
|
headers.set("wix-site-id", siteId);
|
|
@@ -17490,8 +17469,8 @@ var QUERY_SPECS = {
|
|
|
17490
17469
|
totalField: "totalResults"
|
|
17491
17470
|
}
|
|
17492
17471
|
};
|
|
17493
|
-
function lookupNumeric(data,
|
|
17494
|
-
const parts =
|
|
17472
|
+
function lookupNumeric(data, path4) {
|
|
17473
|
+
const parts = path4.split(".");
|
|
17495
17474
|
let cur = data;
|
|
17496
17475
|
for (const p of parts) {
|
|
17497
17476
|
if (!cur || typeof cur !== "object") return void 0;
|
|
@@ -17573,16 +17552,16 @@ var requestTool17 = new ConnectorTool({
|
|
|
17573
17552
|
Authentication is handled automatically using the API Key and Site ID.`,
|
|
17574
17553
|
inputSchema: inputSchema40,
|
|
17575
17554
|
outputSchema: outputSchema40,
|
|
17576
|
-
async execute({ connectionId, method, path:
|
|
17555
|
+
async execute({ connectionId, method, path: path4, body }, connections) {
|
|
17577
17556
|
const connection = connections.find((c) => c.id === connectionId);
|
|
17578
17557
|
if (!connection) {
|
|
17579
17558
|
return { success: false, error: `Connection ${connectionId} not found` };
|
|
17580
17559
|
}
|
|
17581
|
-
console.log(`[connector-request] wix-store/${connection.name}: ${method} ${
|
|
17560
|
+
console.log(`[connector-request] wix-store/${connection.name}: ${method} ${path4}`);
|
|
17582
17561
|
try {
|
|
17583
17562
|
const apiKey = parameters29.apiKey.getValue(connection);
|
|
17584
17563
|
const siteId = parameters29.siteId.getValue(connection);
|
|
17585
|
-
const url = `${BASE_URL19}${
|
|
17564
|
+
const url = `${BASE_URL19}${path4}`;
|
|
17586
17565
|
const controller = new AbortController();
|
|
17587
17566
|
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS28);
|
|
17588
17567
|
try {
|
|
@@ -17880,7 +17859,7 @@ function adminApiBase(host) {
|
|
|
17880
17859
|
}
|
|
17881
17860
|
return `https://${trimmed}`;
|
|
17882
17861
|
}
|
|
17883
|
-
function adminApiFetch(params,
|
|
17862
|
+
function adminApiFetch(params, path4, init) {
|
|
17884
17863
|
const host = params[parameters30.host.slug];
|
|
17885
17864
|
const token = params[parameters30.token.slug];
|
|
17886
17865
|
if (!host) {
|
|
@@ -17889,7 +17868,7 @@ function adminApiFetch(params, path5, init) {
|
|
|
17889
17868
|
if (!token) {
|
|
17890
17869
|
throw new Error(`dbt: missing required parameter: ${parameters30.token.slug}`);
|
|
17891
17870
|
}
|
|
17892
|
-
const trimmedPath =
|
|
17871
|
+
const trimmedPath = path4.startsWith("/") ? path4 : `/${path4}`;
|
|
17893
17872
|
const headers = new Headers(init?.headers);
|
|
17894
17873
|
headers.set("Authorization", `Token ${token}`);
|
|
17895
17874
|
if (!headers.has("Accept")) headers.set("Accept", "application/json");
|
|
@@ -17978,8 +17957,8 @@ async function fetchRecentRunCount(params, projectId2) {
|
|
|
17978
17957
|
const accountId = params[parameters30.accountId.slug];
|
|
17979
17958
|
if (!accountId) return null;
|
|
17980
17959
|
try {
|
|
17981
|
-
const
|
|
17982
|
-
const res = await adminApiFetch(params,
|
|
17960
|
+
const path4 = `/api/v2/accounts/${encodeURIComponent(accountId)}/runs/?project_id=${encodeURIComponent(projectId2)}&limit=1&order_by=-id`;
|
|
17961
|
+
const res = await adminApiFetch(params, path4);
|
|
17983
17962
|
if (!res.ok) return null;
|
|
17984
17963
|
const data = await res.json();
|
|
17985
17964
|
const total = data.extra?.pagination?.total_count;
|
|
@@ -18230,11 +18209,11 @@ function classifyByTags(tags) {
|
|
|
18230
18209
|
function classifyModel(m) {
|
|
18231
18210
|
const fromTags = classifyByTags(m.tags ?? []);
|
|
18232
18211
|
if (fromTags) return fromTags;
|
|
18233
|
-
const
|
|
18234
|
-
if (
|
|
18235
|
-
if (MART_PATH_RE.test(
|
|
18236
|
-
if (INT_PATH_RE.test(
|
|
18237
|
-
if (STG_PATH_RE.test(
|
|
18212
|
+
const path4 = (m.filePath ?? "").toLowerCase();
|
|
18213
|
+
if (path4) {
|
|
18214
|
+
if (MART_PATH_RE.test(path4)) return "mart";
|
|
18215
|
+
if (INT_PATH_RE.test(path4)) return "intermediate";
|
|
18216
|
+
if (STG_PATH_RE.test(path4)) return "staging";
|
|
18238
18217
|
}
|
|
18239
18218
|
const name = (m.name ?? "").toLowerCase();
|
|
18240
18219
|
if (MART_NAME_RE.test(name)) return "mart";
|
|
@@ -19590,7 +19569,7 @@ function getBaseUrl(params) {
|
|
|
19590
19569
|
const region = params[parameters35.region.slug];
|
|
19591
19570
|
return region === "eu" ? "https://analytics.eu.amplitude.com" : "https://amplitude.com";
|
|
19592
19571
|
}
|
|
19593
|
-
async function apiFetch8(params,
|
|
19572
|
+
async function apiFetch8(params, path4, init) {
|
|
19594
19573
|
const apiKey = params[parameters35.apiKey.slug];
|
|
19595
19574
|
const secretKey = params[parameters35.secretKey.slug];
|
|
19596
19575
|
if (!apiKey || !secretKey) {
|
|
@@ -19598,7 +19577,7 @@ async function apiFetch8(params, path5, init) {
|
|
|
19598
19577
|
"amplitude: missing required parameters: api-key and secret-key"
|
|
19599
19578
|
);
|
|
19600
19579
|
}
|
|
19601
|
-
const url = `${getBaseUrl(params)}${
|
|
19580
|
+
const url = `${getBaseUrl(params)}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
19602
19581
|
const headers = new Headers(init?.headers);
|
|
19603
19582
|
headers.set("Authorization", `Basic ${btoa(`${apiKey}:${secretKey}`)}`);
|
|
19604
19583
|
return fetch(url, { ...init, headers });
|
|
@@ -20004,12 +19983,12 @@ var parameters36 = {
|
|
|
20004
19983
|
|
|
20005
19984
|
// ../connectors/src/connectors/attio/utils.ts
|
|
20006
19985
|
var BASE_URL20 = "https://api.attio.com/v2";
|
|
20007
|
-
async function apiFetch9(params,
|
|
19986
|
+
async function apiFetch9(params, path4, init) {
|
|
20008
19987
|
const apiKey = params[parameters36.apiKey.slug];
|
|
20009
19988
|
if (!apiKey) {
|
|
20010
19989
|
throw new Error("attio: missing required parameter: api-key");
|
|
20011
19990
|
}
|
|
20012
|
-
const url = `${BASE_URL20}${
|
|
19991
|
+
const url = `${BASE_URL20}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
20013
19992
|
const headers = new Headers(init?.headers);
|
|
20014
19993
|
headers.set("Authorization", `Bearer ${apiKey}`);
|
|
20015
19994
|
headers.set("Accept", "application/json");
|
|
@@ -20150,7 +20129,7 @@ Use this tool for every Attio API interaction, including: querying records (peop
|
|
|
20150
20129
|
Record queries use POST /objects/{object}/records/query with a JSON body containing \`filter\`, \`sorts\`, \`limit\`, and \`offset\`. Record updates use PATCH (append multiselect) or PUT (overwrite multiselect). Workspace members, tasks, webhooks, notes, threads, comments, and meetings live at top-level paths \u2014 the workspace-members path uses a snake_case underscore: /workspace_members.`,
|
|
20151
20130
|
inputSchema: inputSchema44,
|
|
20152
20131
|
outputSchema: outputSchema44,
|
|
20153
|
-
async execute({ connectionId, method, path:
|
|
20132
|
+
async execute({ connectionId, method, path: path4, body }, connections) {
|
|
20154
20133
|
const connection = connections.find((c) => c.id === connectionId);
|
|
20155
20134
|
if (!connection) {
|
|
20156
20135
|
return {
|
|
@@ -20159,11 +20138,11 @@ Record queries use POST /objects/{object}/records/query with a JSON body contain
|
|
|
20159
20138
|
};
|
|
20160
20139
|
}
|
|
20161
20140
|
console.log(
|
|
20162
|
-
`[connector-request] attio/${connection.name}: ${method} ${
|
|
20141
|
+
`[connector-request] attio/${connection.name}: ${method} ${path4}`
|
|
20163
20142
|
);
|
|
20164
20143
|
try {
|
|
20165
20144
|
const apiKey = parameters36.apiKey.getValue(connection);
|
|
20166
|
-
const url = `${BASE_URL21}${
|
|
20145
|
+
const url = `${BASE_URL21}${path4}`;
|
|
20167
20146
|
const controller = new AbortController();
|
|
20168
20147
|
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS31);
|
|
20169
20148
|
try {
|
|
@@ -20619,9 +20598,9 @@ async function getAccessToken3(params) {
|
|
|
20619
20598
|
}
|
|
20620
20599
|
return data.access_token;
|
|
20621
20600
|
}
|
|
20622
|
-
async function apiFetch10(params,
|
|
20601
|
+
async function apiFetch10(params, path4, init) {
|
|
20623
20602
|
const token = await getAccessToken3(params);
|
|
20624
|
-
const url = `${getStoreBaseUrl(params)}${
|
|
20603
|
+
const url = `${getStoreBaseUrl(params)}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
20625
20604
|
const headers = new Headers(init?.headers);
|
|
20626
20605
|
headers.set("X-Shopify-Access-Token", token);
|
|
20627
20606
|
if (!headers.has("Content-Type")) {
|
|
@@ -20656,8 +20635,8 @@ var COUNT_PATHS = {
|
|
|
20656
20635
|
inventory: null,
|
|
20657
20636
|
discounts: `/admin/api/${SHOPIFY_API_VERSION}/price_rules/count.json`
|
|
20658
20637
|
};
|
|
20659
|
-
async function defaultFetchCount(params,
|
|
20660
|
-
return apiFetch10(params,
|
|
20638
|
+
async function defaultFetchCount(params, path4) {
|
|
20639
|
+
return apiFetch10(params, path4);
|
|
20661
20640
|
}
|
|
20662
20641
|
function createShopifySetupFlow(fetchCount5 = defaultFetchCount, labelPrefix = "Shopify") {
|
|
20663
20642
|
return {
|
|
@@ -20688,10 +20667,10 @@ function createShopifySetupFlow(fetchCount5 = defaultFetchCount, labelPrefix = "
|
|
|
20688
20667
|
).slice(0, SHOPIFY_SETUP_MAX_ENTITIES);
|
|
20689
20668
|
const sections = [`## ${labelPrefix}`, ""];
|
|
20690
20669
|
for (const entity of selected) {
|
|
20691
|
-
const
|
|
20670
|
+
const path4 = COUNT_PATHS[entity];
|
|
20692
20671
|
let count = "available";
|
|
20693
|
-
if (
|
|
20694
|
-
const res = await fetchCount5(rt.params,
|
|
20672
|
+
if (path4) {
|
|
20673
|
+
const res = await fetchCount5(rt.params, path4);
|
|
20695
20674
|
if (res.ok) {
|
|
20696
20675
|
const data = await res.json();
|
|
20697
20676
|
if (typeof data.count === "number") count = String(data.count);
|
|
@@ -20741,7 +20720,7 @@ The store domain is resolved from the connection \u2014 only provide the path st
|
|
|
20741
20720
|
Use this tool for all Shopify API interactions: listing products, orders, customers, inventory, collections, and more.`,
|
|
20742
20721
|
inputSchema: inputSchema45,
|
|
20743
20722
|
outputSchema: outputSchema45,
|
|
20744
|
-
async execute({ connectionId, method, path:
|
|
20723
|
+
async execute({ connectionId, method, path: path4, body }, connections) {
|
|
20745
20724
|
const connection = connections.find((c) => c.id === connectionId);
|
|
20746
20725
|
if (!connection) {
|
|
20747
20726
|
return {
|
|
@@ -20750,7 +20729,7 @@ Use this tool for all Shopify API interactions: listing products, orders, custom
|
|
|
20750
20729
|
};
|
|
20751
20730
|
}
|
|
20752
20731
|
console.log(
|
|
20753
|
-
`[connector-request] shopify/${connection.name}: ${method} ${
|
|
20732
|
+
`[connector-request] shopify/${connection.name}: ${method} ${path4}`
|
|
20754
20733
|
);
|
|
20755
20734
|
try {
|
|
20756
20735
|
const storeDomain = parameters37.storeDomain.getValue(connection);
|
|
@@ -20782,7 +20761,7 @@ Use this tool for all Shopify API interactions: listing products, orders, custom
|
|
|
20782
20761
|
error: "access_token not found in token response"
|
|
20783
20762
|
};
|
|
20784
20763
|
}
|
|
20785
|
-
const url = `https://${storeDomain}${
|
|
20764
|
+
const url = `https://${storeDomain}${path4}`;
|
|
20786
20765
|
const controller = new AbortController();
|
|
20787
20766
|
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS32);
|
|
20788
20767
|
try {
|
|
@@ -21097,7 +21076,7 @@ var requestTool22 = new ConnectorTool({
|
|
|
21097
21076
|
Authentication is handled automatically via OAuth proxy.`,
|
|
21098
21077
|
inputSchema: inputSchema46,
|
|
21099
21078
|
outputSchema: outputSchema46,
|
|
21100
|
-
async execute({ connectionId, method, path:
|
|
21079
|
+
async execute({ connectionId, method, path: path4, queryParams, body }, connections, config) {
|
|
21101
21080
|
const connection = connections.find((c) => c.id === connectionId);
|
|
21102
21081
|
if (!connection) {
|
|
21103
21082
|
return {
|
|
@@ -21106,10 +21085,10 @@ Authentication is handled automatically via OAuth proxy.`,
|
|
|
21106
21085
|
};
|
|
21107
21086
|
}
|
|
21108
21087
|
console.log(
|
|
21109
|
-
`[connector-request] shopify-oauth/${connection.name}: ${method} ${
|
|
21088
|
+
`[connector-request] shopify-oauth/${connection.name}: ${method} ${path4}`
|
|
21110
21089
|
);
|
|
21111
21090
|
try {
|
|
21112
|
-
let url =
|
|
21091
|
+
let url = path4;
|
|
21113
21092
|
if (queryParams) {
|
|
21114
21093
|
const searchParams = new URLSearchParams(queryParams);
|
|
21115
21094
|
url += `${url.includes("?") ? "&" : "?"}${searchParams.toString()}`;
|
|
@@ -21244,10 +21223,10 @@ var shopifyOauthSetupFlow = {
|
|
|
21244
21223
|
sections.push("| Entity | Count |");
|
|
21245
21224
|
sections.push("|--------|-------|");
|
|
21246
21225
|
for (const entity of selected) {
|
|
21247
|
-
const
|
|
21226
|
+
const path4 = COUNT_PATHS2[entity];
|
|
21248
21227
|
let count = "available";
|
|
21249
|
-
if (
|
|
21250
|
-
const res = await rt.config.proxyFetch(
|
|
21228
|
+
if (path4) {
|
|
21229
|
+
const res = await rt.config.proxyFetch(path4, { method: "GET" });
|
|
21251
21230
|
if (res.ok) {
|
|
21252
21231
|
const data = await res.json();
|
|
21253
21232
|
if (typeof data.count === "number") count = String(data.count);
|
|
@@ -21460,12 +21439,12 @@ var parameters39 = {
|
|
|
21460
21439
|
|
|
21461
21440
|
// ../connectors/src/connectors/hubspot/utils.ts
|
|
21462
21441
|
var BASE_URL22 = "https://api.hubapi.com";
|
|
21463
|
-
async function apiFetch11(params,
|
|
21442
|
+
async function apiFetch11(params, path4, init) {
|
|
21464
21443
|
const apiKey = params[parameters39.apiKey.slug];
|
|
21465
21444
|
if (!apiKey) {
|
|
21466
21445
|
throw new Error("hubspot: missing required parameter: api-key");
|
|
21467
21446
|
}
|
|
21468
|
-
const url = `${BASE_URL22}${
|
|
21447
|
+
const url = `${BASE_URL22}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
21469
21448
|
const headers = new Headers(init?.headers);
|
|
21470
21449
|
headers.set("Authorization", `Bearer ${apiKey}`);
|
|
21471
21450
|
headers.set("Accept", "application/json");
|
|
@@ -21606,7 +21585,7 @@ Use this tool for all HubSpot API interactions: querying contacts, deals, compan
|
|
|
21606
21585
|
Use the search endpoint (POST /crm/v3/objects/{objectType}/search) for complex queries with filters.`,
|
|
21607
21586
|
inputSchema: inputSchema47,
|
|
21608
21587
|
outputSchema: outputSchema47,
|
|
21609
|
-
async execute({ connectionId, method, path:
|
|
21588
|
+
async execute({ connectionId, method, path: path4, body }, connections) {
|
|
21610
21589
|
const connection = connections.find((c) => c.id === connectionId);
|
|
21611
21590
|
if (!connection) {
|
|
21612
21591
|
return {
|
|
@@ -21615,11 +21594,11 @@ Use the search endpoint (POST /crm/v3/objects/{objectType}/search) for complex q
|
|
|
21615
21594
|
};
|
|
21616
21595
|
}
|
|
21617
21596
|
console.log(
|
|
21618
|
-
`[connector-request] hubspot/${connection.name}: ${method} ${
|
|
21597
|
+
`[connector-request] hubspot/${connection.name}: ${method} ${path4}`
|
|
21619
21598
|
);
|
|
21620
21599
|
try {
|
|
21621
21600
|
const apiKey = parameters39.apiKey.getValue(connection);
|
|
21622
|
-
const url = `${BASE_URL23}${
|
|
21601
|
+
const url = `${BASE_URL23}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
21623
21602
|
const controller = new AbortController();
|
|
21624
21603
|
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS34);
|
|
21625
21604
|
try {
|
|
@@ -21877,7 +21856,7 @@ var parameters40 = {
|
|
|
21877
21856
|
};
|
|
21878
21857
|
|
|
21879
21858
|
// ../connectors/src/connectors/jira/utils.ts
|
|
21880
|
-
async function apiFetch12(params,
|
|
21859
|
+
async function apiFetch12(params, path4, init) {
|
|
21881
21860
|
const instanceUrl = params[parameters40.instanceUrl.slug];
|
|
21882
21861
|
const email = params[parameters40.email.slug];
|
|
21883
21862
|
const apiToken = params[parameters40.apiToken.slug];
|
|
@@ -21891,7 +21870,7 @@ async function apiFetch12(params, path5, init) {
|
|
|
21891
21870
|
throw new Error("jira: missing required parameter: api-token");
|
|
21892
21871
|
}
|
|
21893
21872
|
const credentials = Buffer.from(`${email}:${apiToken}`).toString("base64");
|
|
21894
|
-
const trimmedPath =
|
|
21873
|
+
const trimmedPath = path4.replace(/^\/+/, "");
|
|
21895
21874
|
const url = `${instanceUrl.replace(/\/+$/, "")}/rest/api/3/${trimmedPath}`;
|
|
21896
21875
|
const headers = new Headers(init?.headers);
|
|
21897
21876
|
headers.set("Authorization", `Basic ${credentials}`);
|
|
@@ -22077,17 +22056,17 @@ Use this tool for all Jira operations: listing projects, searching issues with J
|
|
|
22077
22056
|
The base URL and authentication credentials are configured per connection \u2014 only specify the API path relative to /rest/api/3/.`,
|
|
22078
22057
|
inputSchema: inputSchema48,
|
|
22079
22058
|
outputSchema: outputSchema48,
|
|
22080
|
-
async execute({ connectionId, method, path:
|
|
22059
|
+
async execute({ connectionId, method, path: path4, body }, connections) {
|
|
22081
22060
|
const connection = connections.find((c) => c.id === connectionId);
|
|
22082
22061
|
if (!connection) {
|
|
22083
22062
|
return { success: false, error: `Connection ${connectionId} not found` };
|
|
22084
22063
|
}
|
|
22085
|
-
console.log(`[connector-request] jira-api-key/${connection.name}: ${method} ${
|
|
22064
|
+
console.log(`[connector-request] jira-api-key/${connection.name}: ${method} ${path4}`);
|
|
22086
22065
|
try {
|
|
22087
22066
|
const instanceUrl = parameters40.instanceUrl.getValue(connection);
|
|
22088
22067
|
const email = parameters40.email.getValue(connection);
|
|
22089
22068
|
const apiToken = parameters40.apiToken.getValue(connection);
|
|
22090
|
-
const baseUrl = `${instanceUrl.replace(/\/+$/, "")}/rest/api/3/${
|
|
22069
|
+
const baseUrl = `${instanceUrl.replace(/\/+$/, "")}/rest/api/3/${path4}`;
|
|
22091
22070
|
const credentials = Buffer.from(`${email}:${apiToken}`).toString("base64");
|
|
22092
22071
|
const controller = new AbortController();
|
|
22093
22072
|
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS35);
|
|
@@ -22806,12 +22785,12 @@ var parameters42 = {
|
|
|
22806
22785
|
|
|
22807
22786
|
// ../connectors/src/connectors/asana/utils.ts
|
|
22808
22787
|
var BASE_URL26 = "https://app.asana.com/api/1.0";
|
|
22809
|
-
async function apiFetch13(params,
|
|
22788
|
+
async function apiFetch13(params, path4, init) {
|
|
22810
22789
|
const token = params[parameters42.personalAccessToken.slug];
|
|
22811
22790
|
if (!token) {
|
|
22812
22791
|
throw new Error("asana: missing required parameter: personal-access-token");
|
|
22813
22792
|
}
|
|
22814
|
-
const url = `${BASE_URL26}${
|
|
22793
|
+
const url = `${BASE_URL26}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
22815
22794
|
const headers = new Headers(init?.headers);
|
|
22816
22795
|
headers.set("Authorization", `Bearer ${token}`);
|
|
22817
22796
|
if (!headers.has("Accept")) headers.set("Accept", "application/json");
|
|
@@ -23006,7 +22985,7 @@ Common endpoints:
|
|
|
23006
22985
|
Pagination: Use limit (1-100) and offset query parameters. The response includes next_page.offset for the next page.`,
|
|
23007
22986
|
inputSchema: inputSchema50,
|
|
23008
22987
|
outputSchema: outputSchema50,
|
|
23009
|
-
async execute({ connectionId, method, path:
|
|
22988
|
+
async execute({ connectionId, method, path: path4, body }, connections) {
|
|
23010
22989
|
const connection = connections.find((c) => c.id === connectionId);
|
|
23011
22990
|
if (!connection) {
|
|
23012
22991
|
return {
|
|
@@ -23015,11 +22994,11 @@ Pagination: Use limit (1-100) and offset query parameters. The response includes
|
|
|
23015
22994
|
};
|
|
23016
22995
|
}
|
|
23017
22996
|
console.log(
|
|
23018
|
-
`[connector-request] asana/${connection.name}: ${method} ${
|
|
22997
|
+
`[connector-request] asana/${connection.name}: ${method} ${path4}`
|
|
23019
22998
|
);
|
|
23020
22999
|
try {
|
|
23021
23000
|
const token = parameters42.personalAccessToken.getValue(connection);
|
|
23022
|
-
const normalizedPath = normalizeRequestPath(
|
|
23001
|
+
const normalizedPath = normalizeRequestPath(path4, BASE_PATH_SEGMENT5);
|
|
23023
23002
|
const url = `${BASE_URL27}${normalizedPath}`;
|
|
23024
23003
|
const controller = new AbortController();
|
|
23025
23004
|
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS37);
|
|
@@ -24315,12 +24294,12 @@ var parameters45 = {
|
|
|
24315
24294
|
// ../connectors/src/connectors/notion/utils.ts
|
|
24316
24295
|
var BASE_URL28 = "https://api.notion.com/v1";
|
|
24317
24296
|
var NOTION_VERSION = "2022-06-28";
|
|
24318
|
-
async function apiFetch14(params,
|
|
24297
|
+
async function apiFetch14(params, path4, init) {
|
|
24319
24298
|
const apiKey = params[parameters45.apiKey.slug];
|
|
24320
24299
|
if (!apiKey) {
|
|
24321
24300
|
throw new Error("notion: missing required parameter: api-key");
|
|
24322
24301
|
}
|
|
24323
|
-
const url = `${BASE_URL28}${
|
|
24302
|
+
const url = `${BASE_URL28}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
24324
24303
|
const headers = new Headers(init?.headers);
|
|
24325
24304
|
headers.set("Authorization", `Bearer ${apiKey}`);
|
|
24326
24305
|
headers.set("Notion-Version", NOTION_VERSION);
|
|
@@ -24555,7 +24534,7 @@ Use this tool for all Notion API interactions: searching pages/databases, queryi
|
|
|
24555
24534
|
Pagination uses cursor-based start_cursor and page_size (max 100).`,
|
|
24556
24535
|
inputSchema: inputSchema55,
|
|
24557
24536
|
outputSchema: outputSchema55,
|
|
24558
|
-
async execute({ connectionId, method, path:
|
|
24537
|
+
async execute({ connectionId, method, path: path4, body }, connections) {
|
|
24559
24538
|
const connection = connections.find((c) => c.id === connectionId);
|
|
24560
24539
|
if (!connection) {
|
|
24561
24540
|
return {
|
|
@@ -24564,11 +24543,11 @@ Pagination uses cursor-based start_cursor and page_size (max 100).`,
|
|
|
24564
24543
|
};
|
|
24565
24544
|
}
|
|
24566
24545
|
console.log(
|
|
24567
|
-
`[connector-request] notion/${connection.name}: ${method} ${
|
|
24546
|
+
`[connector-request] notion/${connection.name}: ${method} ${path4}`
|
|
24568
24547
|
);
|
|
24569
24548
|
try {
|
|
24570
24549
|
const apiKey = parameters45.apiKey.getValue(connection);
|
|
24571
|
-
const url = `${BASE_URL29}${
|
|
24550
|
+
const url = `${BASE_URL29}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
24572
24551
|
const controller = new AbortController();
|
|
24573
24552
|
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS38);
|
|
24574
24553
|
try {
|
|
@@ -24855,7 +24834,7 @@ Use this tool for all Notion API interactions: searching pages/databases, queryi
|
|
|
24855
24834
|
Pagination uses cursor-based start_cursor and page_size (max 100).`,
|
|
24856
24835
|
inputSchema: inputSchema56,
|
|
24857
24836
|
outputSchema: outputSchema56,
|
|
24858
|
-
async execute({ connectionId, method, path:
|
|
24837
|
+
async execute({ connectionId, method, path: path4, body }, connections, config) {
|
|
24859
24838
|
const connection = connections.find((c) => c.id === connectionId);
|
|
24860
24839
|
if (!connection) {
|
|
24861
24840
|
return {
|
|
@@ -24864,10 +24843,10 @@ Pagination uses cursor-based start_cursor and page_size (max 100).`,
|
|
|
24864
24843
|
};
|
|
24865
24844
|
}
|
|
24866
24845
|
console.log(
|
|
24867
|
-
`[connector-request] notion-oauth/${connection.name}: ${method} ${
|
|
24846
|
+
`[connector-request] notion-oauth/${connection.name}: ${method} ${path4}`
|
|
24868
24847
|
);
|
|
24869
24848
|
try {
|
|
24870
|
-
const url = `${BASE_URL30}${
|
|
24849
|
+
const url = `${BASE_URL30}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
24871
24850
|
const token = await getProxyToken19(config.oauthProxy);
|
|
24872
24851
|
const proxyUrl = `https://${config.oauthProxy.sandboxId}.${config.oauthProxy.previewBaseDomain}/_sqcore/connections/${connectionId}/request`;
|
|
24873
24852
|
const controller = new AbortController();
|
|
@@ -24946,8 +24925,8 @@ var parameters46 = {};
|
|
|
24946
24925
|
// ../connectors/src/connectors/notion-oauth/utils.ts
|
|
24947
24926
|
var BASE_URL31 = "https://api.notion.com/v1";
|
|
24948
24927
|
var NOTION_VERSION4 = "2022-06-28";
|
|
24949
|
-
function apiFetch15(proxyFetch,
|
|
24950
|
-
const url = `${BASE_URL31}${
|
|
24928
|
+
function apiFetch15(proxyFetch, path4, init) {
|
|
24929
|
+
const url = `${BASE_URL31}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
24951
24930
|
const headers = new Headers(init?.headers);
|
|
24952
24931
|
headers.set("Notion-Version", NOTION_VERSION4);
|
|
24953
24932
|
if (init?.body && !headers.has("Content-Type")) {
|
|
@@ -25388,13 +25367,13 @@ var metaAdsOnboarding = new ConnectorOnboarding({
|
|
|
25388
25367
|
|
|
25389
25368
|
// ../connectors/src/connectors/meta-ads/utils.ts
|
|
25390
25369
|
var BASE_URL33 = "https://graph.facebook.com/v21.0";
|
|
25391
|
-
async function apiFetch16(params,
|
|
25370
|
+
async function apiFetch16(params, path4, init) {
|
|
25392
25371
|
const accessToken = params[parameters47.accessToken.slug];
|
|
25393
25372
|
if (!accessToken) {
|
|
25394
25373
|
throw new Error("meta-ads: missing required parameter: access-token");
|
|
25395
25374
|
}
|
|
25396
|
-
const sep =
|
|
25397
|
-
const url = `${BASE_URL33}${
|
|
25375
|
+
const sep = path4.includes("?") ? "&" : "?";
|
|
25376
|
+
const url = `${BASE_URL33}${path4.startsWith("/") ? "" : "/"}${path4}${sep}access_token=${encodeURIComponent(accessToken)}`;
|
|
25398
25377
|
return fetch(url, init);
|
|
25399
25378
|
}
|
|
25400
25379
|
|
|
@@ -25549,7 +25528,7 @@ Authentication is handled via the configured access token.
|
|
|
25549
25528
|
{adAccountId} in the path is automatically replaced with the connection's ad account ID (with act_ prefix added).`,
|
|
25550
25529
|
inputSchema: inputSchema58,
|
|
25551
25530
|
outputSchema: outputSchema58,
|
|
25552
|
-
async execute({ connectionId, method, path:
|
|
25531
|
+
async execute({ connectionId, method, path: path4, queryParams, body }, connections) {
|
|
25553
25532
|
const connection = connections.find((c) => c.id === connectionId);
|
|
25554
25533
|
if (!connection) {
|
|
25555
25534
|
return {
|
|
@@ -25558,12 +25537,12 @@ Authentication is handled via the configured access token.
|
|
|
25558
25537
|
};
|
|
25559
25538
|
}
|
|
25560
25539
|
console.log(
|
|
25561
|
-
`[connector-request] meta-ads/${connection.name}: ${method} ${
|
|
25540
|
+
`[connector-request] meta-ads/${connection.name}: ${method} ${path4}`
|
|
25562
25541
|
);
|
|
25563
25542
|
try {
|
|
25564
25543
|
const accessToken = parameters47.accessToken.getValue(connection);
|
|
25565
25544
|
const adAccountId = parameters47.adAccountId.tryGetValue(connection) ?? "";
|
|
25566
|
-
const resolvedPath = adAccountId ?
|
|
25545
|
+
const resolvedPath = adAccountId ? path4.replace(/\{adAccountId\}/g, adAccountId) : path4;
|
|
25567
25546
|
let url = `${BASE_URL34}${resolvedPath}`;
|
|
25568
25547
|
const params = new URLSearchParams(queryParams ?? {});
|
|
25569
25548
|
params.set("access_token", accessToken);
|
|
@@ -26113,7 +26092,7 @@ Authentication is handled automatically via OAuth proxy.
|
|
|
26113
26092
|
{adAccountId} in the path is automatically replaced with the connection's ad account ID.`,
|
|
26114
26093
|
inputSchema: inputSchema60,
|
|
26115
26094
|
outputSchema: outputSchema60,
|
|
26116
|
-
async execute({ connectionId, method, path:
|
|
26095
|
+
async execute({ connectionId, method, path: path4, queryParams, body }, connections, config) {
|
|
26117
26096
|
const connection = connections.find((c) => c.id === connectionId);
|
|
26118
26097
|
if (!connection) {
|
|
26119
26098
|
return {
|
|
@@ -26122,11 +26101,11 @@ Authentication is handled automatically via OAuth proxy.
|
|
|
26122
26101
|
};
|
|
26123
26102
|
}
|
|
26124
26103
|
console.log(
|
|
26125
|
-
`[connector-request] meta-ads-oauth/${connection.name}: ${method} ${
|
|
26104
|
+
`[connector-request] meta-ads-oauth/${connection.name}: ${method} ${path4}`
|
|
26126
26105
|
);
|
|
26127
26106
|
try {
|
|
26128
26107
|
const adAccountId = parameters48.adAccountId.tryGetValue(connection) ?? "";
|
|
26129
|
-
const resolvedPath = adAccountId ?
|
|
26108
|
+
const resolvedPath = adAccountId ? path4.replace(/\{adAccountId\}/g, adAccountId) : path4;
|
|
26130
26109
|
let url = `${BASE_URL37}${resolvedPath}`;
|
|
26131
26110
|
if (queryParams && Object.keys(queryParams).length > 0) {
|
|
26132
26111
|
const params = new URLSearchParams(queryParams);
|
|
@@ -26697,7 +26676,7 @@ Authentication is handled automatically via OAuth proxy.
|
|
|
26697
26676
|
The advertiser_id is automatically injected if configured.`,
|
|
26698
26677
|
inputSchema: inputSchema62,
|
|
26699
26678
|
outputSchema: outputSchema62,
|
|
26700
|
-
async execute({ connectionId, method, path:
|
|
26679
|
+
async execute({ connectionId, method, path: path4, queryParams, body }, connections, config) {
|
|
26701
26680
|
const connection = connections.find((c) => c.id === connectionId);
|
|
26702
26681
|
if (!connection) {
|
|
26703
26682
|
return {
|
|
@@ -26706,11 +26685,11 @@ The advertiser_id is automatically injected if configured.`,
|
|
|
26706
26685
|
};
|
|
26707
26686
|
}
|
|
26708
26687
|
console.log(
|
|
26709
|
-
`[connector-request] tiktok-ads/${connection.name}: ${method} ${
|
|
26688
|
+
`[connector-request] tiktok-ads/${connection.name}: ${method} ${path4}`
|
|
26710
26689
|
);
|
|
26711
26690
|
try {
|
|
26712
26691
|
const advertiserId = parameters49.advertiserId.tryGetValue(connection) ?? "";
|
|
26713
|
-
const normalizedPath = normalizeRequestPath(
|
|
26692
|
+
const normalizedPath = normalizeRequestPath(path4, BASE_PATH_SEGMENT6);
|
|
26714
26693
|
let url = `${BASE_URL40}${normalizedPath}`;
|
|
26715
26694
|
if (method === "GET") {
|
|
26716
26695
|
const params = new URLSearchParams(queryParams ?? {});
|
|
@@ -26995,14 +26974,14 @@ function extractDatacenter(apiKey) {
|
|
|
26995
26974
|
}
|
|
26996
26975
|
return dc;
|
|
26997
26976
|
}
|
|
26998
|
-
async function apiFetch17(params,
|
|
26977
|
+
async function apiFetch17(params, path4, init) {
|
|
26999
26978
|
const apiKey = params[parameters50.apiKey.slug];
|
|
27000
26979
|
if (!apiKey) {
|
|
27001
26980
|
throw new Error("mailchimp: missing required parameter: api-key");
|
|
27002
26981
|
}
|
|
27003
26982
|
const dc = extractDatacenter(apiKey);
|
|
27004
26983
|
const baseUrl = `https://${dc}.api.mailchimp.com/3.0`;
|
|
27005
|
-
const url = `${baseUrl}${
|
|
26984
|
+
const url = `${baseUrl}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
27006
26985
|
const headers = new Headers(init?.headers);
|
|
27007
26986
|
headers.set("Authorization", `Basic ${btoa(`anystring:${apiKey}`)}`);
|
|
27008
26987
|
return fetch(url, { ...init, headers });
|
|
@@ -27135,7 +27114,7 @@ Use this tool for all Mailchimp API interactions: managing audiences/lists, camp
|
|
|
27135
27114
|
The datacenter is automatically extracted from the API key suffix.`,
|
|
27136
27115
|
inputSchema: inputSchema63,
|
|
27137
27116
|
outputSchema: outputSchema63,
|
|
27138
|
-
async execute({ connectionId, method, path:
|
|
27117
|
+
async execute({ connectionId, method, path: path4, queryParams, body }, connections) {
|
|
27139
27118
|
const connection = connections.find((c) => c.id === connectionId);
|
|
27140
27119
|
if (!connection) {
|
|
27141
27120
|
return {
|
|
@@ -27144,13 +27123,13 @@ The datacenter is automatically extracted from the API key suffix.`,
|
|
|
27144
27123
|
};
|
|
27145
27124
|
}
|
|
27146
27125
|
console.log(
|
|
27147
|
-
`[connector-request] mailchimp/${connection.name}: ${method} ${
|
|
27126
|
+
`[connector-request] mailchimp/${connection.name}: ${method} ${path4}`
|
|
27148
27127
|
);
|
|
27149
27128
|
try {
|
|
27150
27129
|
const apiKey = parameters50.apiKey.getValue(connection);
|
|
27151
27130
|
const dc = extractDatacenter2(apiKey);
|
|
27152
27131
|
const baseUrl = `https://${dc}.api.mailchimp.com/3.0`;
|
|
27153
|
-
let url = `${baseUrl}${
|
|
27132
|
+
let url = `${baseUrl}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
27154
27133
|
if (queryParams) {
|
|
27155
27134
|
const searchParams = new URLSearchParams(queryParams);
|
|
27156
27135
|
url += `?${searchParams.toString()}`;
|
|
@@ -27463,7 +27442,7 @@ var parameters51 = {
|
|
|
27463
27442
|
};
|
|
27464
27443
|
|
|
27465
27444
|
// ../connectors/src/connectors/mailchimp-oauth/utils.ts
|
|
27466
|
-
function apiFetch18(params, proxyFetch,
|
|
27445
|
+
function apiFetch18(params, proxyFetch, path4, init) {
|
|
27467
27446
|
const serverPrefix = params[parameters51.serverPrefix.slug];
|
|
27468
27447
|
if (!serverPrefix) {
|
|
27469
27448
|
throw new Error(
|
|
@@ -27471,7 +27450,7 @@ function apiFetch18(params, proxyFetch, path5, init) {
|
|
|
27471
27450
|
);
|
|
27472
27451
|
}
|
|
27473
27452
|
const baseUrl = `https://${serverPrefix}.api.mailchimp.com/3.0`;
|
|
27474
|
-
const url = `${baseUrl}${
|
|
27453
|
+
const url = `${baseUrl}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
27475
27454
|
return proxyFetch(url, init);
|
|
27476
27455
|
}
|
|
27477
27456
|
|
|
@@ -27619,7 +27598,7 @@ var requestTool33 = new ConnectorTool({
|
|
|
27619
27598
|
Authentication is handled automatically via OAuth proxy.`,
|
|
27620
27599
|
inputSchema: inputSchema64,
|
|
27621
27600
|
outputSchema: outputSchema64,
|
|
27622
|
-
async execute({ connectionId, method, path:
|
|
27601
|
+
async execute({ connectionId, method, path: path4, queryParams, body }, connections, config) {
|
|
27623
27602
|
const connection = connections.find((c) => c.id === connectionId);
|
|
27624
27603
|
if (!connection) {
|
|
27625
27604
|
return {
|
|
@@ -27628,12 +27607,12 @@ Authentication is handled automatically via OAuth proxy.`,
|
|
|
27628
27607
|
};
|
|
27629
27608
|
}
|
|
27630
27609
|
console.log(
|
|
27631
|
-
`[connector-request] mailchimp-oauth/${connection.name}: ${method} ${
|
|
27610
|
+
`[connector-request] mailchimp-oauth/${connection.name}: ${method} ${path4}`
|
|
27632
27611
|
);
|
|
27633
27612
|
try {
|
|
27634
27613
|
const serverPrefix = parameters51.serverPrefix.getValue(connection);
|
|
27635
27614
|
const baseUrl = `https://${serverPrefix}.api.mailchimp.com/3.0`;
|
|
27636
|
-
let url = `${baseUrl}${
|
|
27615
|
+
let url = `${baseUrl}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
27637
27616
|
if (queryParams) {
|
|
27638
27617
|
const searchParams = new URLSearchParams(queryParams);
|
|
27639
27618
|
url += `?${searchParams.toString()}`;
|
|
@@ -27876,14 +27855,14 @@ var parameters52 = {
|
|
|
27876
27855
|
};
|
|
27877
27856
|
|
|
27878
27857
|
// ../connectors/src/connectors/customerio/utils.ts
|
|
27879
|
-
async function apiFetch19(params,
|
|
27858
|
+
async function apiFetch19(params, path4, init) {
|
|
27880
27859
|
const apiKey = params[parameters52.appApiKey.slug];
|
|
27881
27860
|
if (!apiKey) {
|
|
27882
27861
|
throw new Error("customerio: missing required parameter: app-api-key");
|
|
27883
27862
|
}
|
|
27884
27863
|
const region = params[parameters52.region.slug];
|
|
27885
27864
|
const baseUrl = region === "eu" ? "https://api-eu.customer.io" : "https://api.customer.io";
|
|
27886
|
-
const url = `${baseUrl}${
|
|
27865
|
+
const url = `${baseUrl}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
27887
27866
|
const headers = new Headers(init?.headers);
|
|
27888
27867
|
headers.set("Authorization", `Bearer ${apiKey}`);
|
|
27889
27868
|
return fetch(url, { ...init, headers });
|
|
@@ -27940,10 +27919,10 @@ async function fetchEntityCount(params, entity) {
|
|
|
27940
27919
|
campaigns: "/v1/campaigns",
|
|
27941
27920
|
newsletters: "/v1/newsletters"
|
|
27942
27921
|
};
|
|
27943
|
-
const
|
|
27944
|
-
if (!
|
|
27922
|
+
const path4 = endpoint[entity];
|
|
27923
|
+
if (!path4) return "available";
|
|
27945
27924
|
try {
|
|
27946
|
-
const res = await apiFetch19(params,
|
|
27925
|
+
const res = await apiFetch19(params, path4);
|
|
27947
27926
|
if (!res.ok) return "available";
|
|
27948
27927
|
const data = await res.json();
|
|
27949
27928
|
if (typeof data.count === "number") return String(data.count);
|
|
@@ -28029,7 +28008,7 @@ Use this tool for reading customer data, managing campaigns, segments, broadcast
|
|
|
28029
28008
|
The App API is the read and management path for Customer.io data.`,
|
|
28030
28009
|
inputSchema: inputSchema65,
|
|
28031
28010
|
outputSchema: outputSchema65,
|
|
28032
|
-
async execute({ connectionId, method, path:
|
|
28011
|
+
async execute({ connectionId, method, path: path4, queryParams, body }, connections) {
|
|
28033
28012
|
const connection = connections.find((c) => c.id === connectionId);
|
|
28034
28013
|
if (!connection) {
|
|
28035
28014
|
return {
|
|
@@ -28038,13 +28017,13 @@ The App API is the read and management path for Customer.io data.`,
|
|
|
28038
28017
|
};
|
|
28039
28018
|
}
|
|
28040
28019
|
console.log(
|
|
28041
|
-
`[connector-request] customerio/${connection.name}: ${method} ${
|
|
28020
|
+
`[connector-request] customerio/${connection.name}: ${method} ${path4}`
|
|
28042
28021
|
);
|
|
28043
28022
|
try {
|
|
28044
28023
|
const appApiKey = parameters52.appApiKey.getValue(connection);
|
|
28045
28024
|
const region = parameters52.region.tryGetValue(connection);
|
|
28046
28025
|
const baseUrl = getBaseUrl2(region);
|
|
28047
|
-
let url = `${baseUrl}${
|
|
28026
|
+
let url = `${baseUrl}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
28048
28027
|
if (queryParams) {
|
|
28049
28028
|
const searchParams = new URLSearchParams(queryParams);
|
|
28050
28029
|
url += `?${searchParams.toString()}`;
|
|
@@ -28369,7 +28348,7 @@ var requestWithDelegationTool2 = new ConnectorTool({
|
|
|
28369
28348
|
description: "Call the Gmail API on behalf of the specified Workspace user via Domain-wide Delegation. Read-only operations only. Pass `subject` as the target user email and `scopes` as ['https://www.googleapis.com/auth/gmail.readonly']. Paths are relative to https://gmail.googleapis.com/gmail/v1/users \u2014 use '/me' as the userId prefix (e.g., '/me/messages'). Requires Domain-wide Delegation to be authorized for the service account in the Workspace admin console.",
|
|
28370
28349
|
inputSchema: inputSchema66,
|
|
28371
28350
|
outputSchema: outputSchema66,
|
|
28372
|
-
async execute({ connectionId, method, path:
|
|
28351
|
+
async execute({ connectionId, method, path: path4, subject, scopes, queryParams, body }, connections) {
|
|
28373
28352
|
const connection = connections.find((c) => c.id === connectionId);
|
|
28374
28353
|
if (!connection) {
|
|
28375
28354
|
return {
|
|
@@ -28390,7 +28369,7 @@ var requestWithDelegationTool2 = new ConnectorTool({
|
|
|
28390
28369
|
}
|
|
28391
28370
|
const serviceAccountEmail = serviceAccount.client_email;
|
|
28392
28371
|
console.log(
|
|
28393
|
-
`[connector-request] gmail/${connection.name}: ${method} ${
|
|
28372
|
+
`[connector-request] gmail/${connection.name}: ${method} ${path4} subject=${subject}`
|
|
28394
28373
|
);
|
|
28395
28374
|
try {
|
|
28396
28375
|
const { GoogleAuth } = await import("google-auth-library");
|
|
@@ -28410,7 +28389,7 @@ var requestWithDelegationTool2 = new ConnectorTool({
|
|
|
28410
28389
|
serviceAccountEmail
|
|
28411
28390
|
};
|
|
28412
28391
|
}
|
|
28413
|
-
const normalizedPath = normalizeRequestPath(
|
|
28392
|
+
const normalizedPath = normalizeRequestPath(path4, BASE_PATH_SEGMENT7);
|
|
28414
28393
|
let url = `${BASE_URL41}${normalizedPath}`;
|
|
28415
28394
|
if (queryParams) {
|
|
28416
28395
|
const searchParams = new URLSearchParams(queryParams);
|
|
@@ -28973,7 +28952,7 @@ Authentication is handled automatically via OAuth proxy.
|
|
|
28973
28952
|
All paths are relative to https://gmail.googleapis.com/gmail/v1/users. Use '/me' as the userId prefix (e.g., '/me/messages').`,
|
|
28974
28953
|
inputSchema: inputSchema67,
|
|
28975
28954
|
outputSchema: outputSchema67,
|
|
28976
|
-
async execute({ connectionId, method, path:
|
|
28955
|
+
async execute({ connectionId, method, path: path4, queryParams }, connections, config) {
|
|
28977
28956
|
const connection = connections.find((c) => c.id === connectionId);
|
|
28978
28957
|
if (!connection) {
|
|
28979
28958
|
return {
|
|
@@ -28982,10 +28961,10 @@ All paths are relative to https://gmail.googleapis.com/gmail/v1/users. Use '/me'
|
|
|
28982
28961
|
};
|
|
28983
28962
|
}
|
|
28984
28963
|
console.log(
|
|
28985
|
-
`[connector-request] gmail-oauth/${connection.name}: ${method} ${
|
|
28964
|
+
`[connector-request] gmail-oauth/${connection.name}: ${method} ${path4}`
|
|
28986
28965
|
);
|
|
28987
28966
|
try {
|
|
28988
|
-
const normalizedPath = normalizeRequestPath(
|
|
28967
|
+
const normalizedPath = normalizeRequestPath(path4, BASE_PATH_SEGMENT8);
|
|
28989
28968
|
let url = `${BASE_URL42}${normalizedPath}`;
|
|
28990
28969
|
if (queryParams) {
|
|
28991
28970
|
const searchParams = new URLSearchParams(queryParams);
|
|
@@ -29427,7 +29406,7 @@ var requestWithDelegationTool3 = new ConnectorTool({
|
|
|
29427
29406
|
description: "Call the Google Workspace Admin SDK Reports API on behalf of the specified Workspace admin via Domain-wide Delegation. Read-only operations only. Pass `subject` as the admin user email and `scopes` as one or both of ['https://www.googleapis.com/auth/admin.reports.audit.readonly', 'https://www.googleapis.com/auth/admin.reports.usage.readonly']. Paths are relative to https://admin.googleapis.com/admin/reports/v1 (e.g., '/activity/users/all/applications/login', '/usage/users/all/dates/2025-04-01'). Requires Domain-wide Delegation to be authorized for the service account in the Workspace admin console.",
|
|
29428
29407
|
inputSchema: inputSchema68,
|
|
29429
29408
|
outputSchema: outputSchema68,
|
|
29430
|
-
async execute({ connectionId, method, path:
|
|
29409
|
+
async execute({ connectionId, method, path: path4, subject, scopes, queryParams }, connections) {
|
|
29431
29410
|
const connection = connections.find((c) => c.id === connectionId);
|
|
29432
29411
|
if (!connection) {
|
|
29433
29412
|
return {
|
|
@@ -29448,7 +29427,7 @@ var requestWithDelegationTool3 = new ConnectorTool({
|
|
|
29448
29427
|
}
|
|
29449
29428
|
const serviceAccountEmail = serviceAccount.client_email;
|
|
29450
29429
|
console.log(
|
|
29451
|
-
`[connector-request] google-audit-log/${connection.name}: ${method} ${
|
|
29430
|
+
`[connector-request] google-audit-log/${connection.name}: ${method} ${path4} subject=${subject}`
|
|
29452
29431
|
);
|
|
29453
29432
|
try {
|
|
29454
29433
|
const { GoogleAuth } = await import("google-auth-library");
|
|
@@ -29468,7 +29447,7 @@ var requestWithDelegationTool3 = new ConnectorTool({
|
|
|
29468
29447
|
serviceAccountEmail
|
|
29469
29448
|
};
|
|
29470
29449
|
}
|
|
29471
|
-
const normalizedPath = normalizeRequestPath(
|
|
29450
|
+
const normalizedPath = normalizeRequestPath(path4, BASE_PATH_SEGMENT9);
|
|
29472
29451
|
let url = `${BASE_URL43}${normalizedPath}`;
|
|
29473
29452
|
if (queryParams) {
|
|
29474
29453
|
const searchParams = new URLSearchParams(queryParams);
|
|
@@ -30394,7 +30373,7 @@ Authentication is handled automatically via OAuth proxy.
|
|
|
30394
30373
|
Required headers (LinkedIn-Version, X-Restli-Protocol-Version) are set automatically.`,
|
|
30395
30374
|
inputSchema: inputSchema70,
|
|
30396
30375
|
outputSchema: outputSchema70,
|
|
30397
|
-
async execute({ connectionId, method, path:
|
|
30376
|
+
async execute({ connectionId, method, path: path4, queryParams, body }, connections, config) {
|
|
30398
30377
|
const connection = connections.find((c) => c.id === connectionId);
|
|
30399
30378
|
if (!connection) {
|
|
30400
30379
|
return {
|
|
@@ -30403,11 +30382,11 @@ Required headers (LinkedIn-Version, X-Restli-Protocol-Version) are set automatic
|
|
|
30403
30382
|
};
|
|
30404
30383
|
}
|
|
30405
30384
|
console.log(
|
|
30406
|
-
`[connector-request] linkedin-ads/${connection.name}: ${method} ${
|
|
30385
|
+
`[connector-request] linkedin-ads/${connection.name}: ${method} ${path4}`
|
|
30407
30386
|
);
|
|
30408
30387
|
try {
|
|
30409
30388
|
const adAccountId = parameters56.adAccountId.tryGetValue(connection) ?? "";
|
|
30410
|
-
const resolvedPath = adAccountId ?
|
|
30389
|
+
const resolvedPath = adAccountId ? path4.replace(/\{adAccountId\}/g, adAccountId) : path4;
|
|
30411
30390
|
let url = `${BASE_URL46}${resolvedPath}`;
|
|
30412
30391
|
if (queryParams && Object.keys(queryParams).length > 0) {
|
|
30413
30392
|
const params = new URLSearchParams(queryParams);
|
|
@@ -30755,7 +30734,7 @@ function normalizeSubdomain(raw) {
|
|
|
30755
30734
|
function basicAuthHeader(email, apiToken) {
|
|
30756
30735
|
return `Basic ${Buffer.from(`${email}/token:${apiToken}`).toString("base64")}`;
|
|
30757
30736
|
}
|
|
30758
|
-
async function apiFetch20(params,
|
|
30737
|
+
async function apiFetch20(params, path4, init) {
|
|
30759
30738
|
const subdomain = params[parameters57.subdomain.slug];
|
|
30760
30739
|
const email = params[parameters57.email.slug];
|
|
30761
30740
|
const apiToken = params[parameters57.apiToken.slug];
|
|
@@ -30764,7 +30743,7 @@ async function apiFetch20(params, path5, init) {
|
|
|
30764
30743
|
"zendesk: missing required parameter(s) (subdomain, email, api-token)"
|
|
30765
30744
|
);
|
|
30766
30745
|
}
|
|
30767
|
-
const url = `https://${normalizeSubdomain(subdomain)}.zendesk.com${
|
|
30746
|
+
const url = `https://${normalizeSubdomain(subdomain)}.zendesk.com${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
30768
30747
|
const headers = new Headers(init?.headers);
|
|
30769
30748
|
headers.set("Authorization", basicAuthHeader(email, apiToken));
|
|
30770
30749
|
headers.set("Accept", "application/json");
|
|
@@ -30811,8 +30790,8 @@ async function listBrands(params) {
|
|
|
30811
30790
|
const data = await res.json();
|
|
30812
30791
|
return data.brands ?? [];
|
|
30813
30792
|
}
|
|
30814
|
-
async function fetchCount(params,
|
|
30815
|
-
const res = await apiFetch20(params,
|
|
30793
|
+
async function fetchCount(params, path4, countField) {
|
|
30794
|
+
const res = await apiFetch20(params, path4);
|
|
30816
30795
|
if (!res.ok) return null;
|
|
30817
30796
|
const data = await res.json();
|
|
30818
30797
|
const raw = data[countField];
|
|
@@ -30927,7 +30906,7 @@ Use this tool for all Zendesk API interactions: querying tickets, users, organiz
|
|
|
30927
30906
|
Zendesk uses cursor-based pagination with page[size] and page[after] parameters. All endpoints return .json suffix.`,
|
|
30928
30907
|
inputSchema: inputSchema71,
|
|
30929
30908
|
outputSchema: outputSchema71,
|
|
30930
|
-
async execute({ connectionId, method, path:
|
|
30909
|
+
async execute({ connectionId, method, path: path4, body }, connections) {
|
|
30931
30910
|
const connection = connections.find((c) => c.id === connectionId);
|
|
30932
30911
|
if (!connection) {
|
|
30933
30912
|
return {
|
|
@@ -30936,7 +30915,7 @@ Zendesk uses cursor-based pagination with page[size] and page[after] parameters.
|
|
|
30936
30915
|
};
|
|
30937
30916
|
}
|
|
30938
30917
|
console.log(
|
|
30939
|
-
`[connector-request] zendesk/${connection.name}: ${method} ${
|
|
30918
|
+
`[connector-request] zendesk/${connection.name}: ${method} ${path4}`
|
|
30940
30919
|
);
|
|
30941
30920
|
try {
|
|
30942
30921
|
const subdomain = parameters57.subdomain.getValue(connection);
|
|
@@ -30945,7 +30924,7 @@ Zendesk uses cursor-based pagination with page[size] and page[after] parameters.
|
|
|
30945
30924
|
const authToken = Buffer.from(`${email}/token:${apiToken}`).toString(
|
|
30946
30925
|
"base64"
|
|
30947
30926
|
);
|
|
30948
|
-
const url = `https://${subdomain}.zendesk.com${
|
|
30927
|
+
const url = `https://${subdomain}.zendesk.com${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
30949
30928
|
const controller = new AbortController();
|
|
30950
30929
|
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS54);
|
|
30951
30930
|
try {
|
|
@@ -31269,7 +31248,7 @@ Use this tool for all Zendesk API interactions: querying tickets, users, organiz
|
|
|
31269
31248
|
Zendesk uses cursor-based pagination with page[size] and page[after] parameters. All endpoint paths end with .json.`,
|
|
31270
31249
|
inputSchema: inputSchema72,
|
|
31271
31250
|
outputSchema: outputSchema72,
|
|
31272
|
-
async execute({ connectionId, method, path:
|
|
31251
|
+
async execute({ connectionId, method, path: path4, queryParams, body }, connections, config) {
|
|
31273
31252
|
const connection = connections.find((c) => c.id === connectionId);
|
|
31274
31253
|
if (!connection) {
|
|
31275
31254
|
return {
|
|
@@ -31278,10 +31257,10 @@ Zendesk uses cursor-based pagination with page[size] and page[after] parameters.
|
|
|
31278
31257
|
};
|
|
31279
31258
|
}
|
|
31280
31259
|
console.log(
|
|
31281
|
-
`[connector-request] zendesk-oauth/${connection.name}: ${method} ${
|
|
31260
|
+
`[connector-request] zendesk-oauth/${connection.name}: ${method} ${path4}`
|
|
31282
31261
|
);
|
|
31283
31262
|
try {
|
|
31284
|
-
let url =
|
|
31263
|
+
let url = path4;
|
|
31285
31264
|
if (queryParams) {
|
|
31286
31265
|
const searchParams = new URLSearchParams(queryParams);
|
|
31287
31266
|
const separator = url.includes("?") ? "&" : "?";
|
|
@@ -31359,8 +31338,8 @@ var zendeskOauthOnboarding = new ConnectorOnboarding({
|
|
|
31359
31338
|
});
|
|
31360
31339
|
|
|
31361
31340
|
// ../connectors/src/connectors/zendesk-oauth/utils.ts
|
|
31362
|
-
function apiFetch21(proxyFetch,
|
|
31363
|
-
const url =
|
|
31341
|
+
function apiFetch21(proxyFetch, path4, init) {
|
|
31342
|
+
const url = path4.startsWith("/") ? path4 : `/${path4}`;
|
|
31364
31343
|
const headers = new Headers(init?.headers);
|
|
31365
31344
|
headers.set("Accept", "application/json");
|
|
31366
31345
|
return proxyFetch(url, { ...init, headers });
|
|
@@ -31401,8 +31380,8 @@ async function listBrands2(proxyFetch) {
|
|
|
31401
31380
|
const data = await res.json();
|
|
31402
31381
|
return data.brands ?? [];
|
|
31403
31382
|
}
|
|
31404
|
-
async function fetchCount2(proxyFetch,
|
|
31405
|
-
const res = await apiFetch21(proxyFetch,
|
|
31383
|
+
async function fetchCount2(proxyFetch, path4) {
|
|
31384
|
+
const res = await apiFetch21(proxyFetch, path4);
|
|
31406
31385
|
if (!res.ok) return null;
|
|
31407
31386
|
const data = await res.json();
|
|
31408
31387
|
if (typeof data["count"] === "number") return data["count"];
|
|
@@ -31717,12 +31696,12 @@ var parameters59 = {
|
|
|
31717
31696
|
// ../connectors/src/connectors/intercom/utils.ts
|
|
31718
31697
|
var BASE_URL47 = "https://api.intercom.io";
|
|
31719
31698
|
var INTERCOM_VERSION = "2.11";
|
|
31720
|
-
async function apiFetch22(params,
|
|
31699
|
+
async function apiFetch22(params, path4, init) {
|
|
31721
31700
|
const accessToken = params[parameters59.accessToken.slug];
|
|
31722
31701
|
if (!accessToken) {
|
|
31723
31702
|
throw new Error("intercom: missing required parameter: access-token");
|
|
31724
31703
|
}
|
|
31725
|
-
const url = `${BASE_URL47}${
|
|
31704
|
+
const url = `${BASE_URL47}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
31726
31705
|
const headers = new Headers(init?.headers);
|
|
31727
31706
|
headers.set("Authorization", `Bearer ${accessToken}`);
|
|
31728
31707
|
headers.set("Accept", "application/json");
|
|
@@ -31743,8 +31722,8 @@ var INTERCOM_SCOPES = [
|
|
|
31743
31722
|
{ value: "articles", label: "Articles", countPath: "/articles?per_page=1" },
|
|
31744
31723
|
{ value: "teams", label: "Teams", countPath: "/teams" }
|
|
31745
31724
|
];
|
|
31746
|
-
async function fetchCount3(params,
|
|
31747
|
-
const res = await apiFetch22(params,
|
|
31725
|
+
async function fetchCount3(params, path4) {
|
|
31726
|
+
const res = await apiFetch22(params, path4);
|
|
31748
31727
|
if (!res.ok) {
|
|
31749
31728
|
return null;
|
|
31750
31729
|
}
|
|
@@ -31847,7 +31826,7 @@ Search endpoints (contacts/search, conversations/search) use POST with a query o
|
|
|
31847
31826
|
The Intercom-Version header is set to 2.11 automatically.`,
|
|
31848
31827
|
inputSchema: inputSchema73,
|
|
31849
31828
|
outputSchema: outputSchema73,
|
|
31850
|
-
async execute({ connectionId, method, path:
|
|
31829
|
+
async execute({ connectionId, method, path: path4, body }, connections) {
|
|
31851
31830
|
const connection = connections.find((c) => c.id === connectionId);
|
|
31852
31831
|
if (!connection) {
|
|
31853
31832
|
return {
|
|
@@ -31856,11 +31835,11 @@ The Intercom-Version header is set to 2.11 automatically.`,
|
|
|
31856
31835
|
};
|
|
31857
31836
|
}
|
|
31858
31837
|
console.log(
|
|
31859
|
-
`[connector-request] intercom/${connection.name}: ${method} ${
|
|
31838
|
+
`[connector-request] intercom/${connection.name}: ${method} ${path4}`
|
|
31860
31839
|
);
|
|
31861
31840
|
try {
|
|
31862
31841
|
const accessToken = parameters59.accessToken.getValue(connection);
|
|
31863
|
-
const url = `${BASE_URL48}${
|
|
31842
|
+
const url = `${BASE_URL48}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
31864
31843
|
const controller = new AbortController();
|
|
31865
31844
|
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS56);
|
|
31866
31845
|
try {
|
|
@@ -32201,7 +32180,7 @@ Use this tool for all Intercom API interactions: querying contacts, conversation
|
|
|
32201
32180
|
Search endpoints (contacts/search, conversations/search) use POST with a query object in the body.`,
|
|
32202
32181
|
inputSchema: inputSchema74,
|
|
32203
32182
|
outputSchema: outputSchema74,
|
|
32204
|
-
async execute({ connectionId, method, path:
|
|
32183
|
+
async execute({ connectionId, method, path: path4, queryParams, body }, connections, config) {
|
|
32205
32184
|
const connection = connections.find((c) => c.id === connectionId);
|
|
32206
32185
|
if (!connection) {
|
|
32207
32186
|
return {
|
|
@@ -32210,10 +32189,10 @@ Search endpoints (contacts/search, conversations/search) use POST with a query o
|
|
|
32210
32189
|
};
|
|
32211
32190
|
}
|
|
32212
32191
|
console.log(
|
|
32213
|
-
`[connector-request] intercom-oauth/${connection.name}: ${method} ${
|
|
32192
|
+
`[connector-request] intercom-oauth/${connection.name}: ${method} ${path4}`
|
|
32214
32193
|
);
|
|
32215
32194
|
try {
|
|
32216
|
-
let url = `${BASE_URL49}${
|
|
32195
|
+
let url = `${BASE_URL49}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
32217
32196
|
if (queryParams) {
|
|
32218
32197
|
const searchParams = new URLSearchParams(queryParams);
|
|
32219
32198
|
const separator = url.includes("?") ? "&" : "?";
|
|
@@ -32294,8 +32273,8 @@ var intercomOauthOnboarding = new ConnectorOnboarding({
|
|
|
32294
32273
|
// ../connectors/src/connectors/intercom-oauth/utils.ts
|
|
32295
32274
|
var BASE_URL50 = "https://api.intercom.io";
|
|
32296
32275
|
var INTERCOM_VERSION2 = "2.11";
|
|
32297
|
-
function apiFetch23(proxyFetch,
|
|
32298
|
-
const url = `${BASE_URL50}${
|
|
32276
|
+
function apiFetch23(proxyFetch, path4, init) {
|
|
32277
|
+
const url = `${BASE_URL50}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
32299
32278
|
const headers = new Headers(init?.headers);
|
|
32300
32279
|
headers.set("Accept", "application/json");
|
|
32301
32280
|
headers.set("Intercom-Version", INTERCOM_VERSION2);
|
|
@@ -32315,8 +32294,8 @@ var INTERCOM_SCOPES2 = [
|
|
|
32315
32294
|
{ value: "articles", label: "Articles", countPath: "/articles?per_page=1" },
|
|
32316
32295
|
{ value: "teams", label: "Teams", countPath: "/teams" }
|
|
32317
32296
|
];
|
|
32318
|
-
async function fetchCount4(proxyFetch,
|
|
32319
|
-
const res = await apiFetch23(proxyFetch,
|
|
32297
|
+
async function fetchCount4(proxyFetch, path4) {
|
|
32298
|
+
const res = await apiFetch23(proxyFetch, path4);
|
|
32320
32299
|
if (!res.ok) {
|
|
32321
32300
|
return null;
|
|
32322
32301
|
}
|
|
@@ -32675,7 +32654,7 @@ function getQueryBaseUrl(params) {
|
|
|
32675
32654
|
if (region === "in") return "https://in.mixpanel.com/api";
|
|
32676
32655
|
return "https://mixpanel.com/api";
|
|
32677
32656
|
}
|
|
32678
|
-
async function apiFetch24(params,
|
|
32657
|
+
async function apiFetch24(params, path4, init) {
|
|
32679
32658
|
const username = params[parameters61.serviceAccountUsername.slug];
|
|
32680
32659
|
const secret = params[parameters61.serviceAccountSecret.slug];
|
|
32681
32660
|
const projectId2 = params[parameters61.projectId.slug];
|
|
@@ -32685,7 +32664,7 @@ async function apiFetch24(params, path5, init) {
|
|
|
32685
32664
|
);
|
|
32686
32665
|
}
|
|
32687
32666
|
const base = getQueryBaseUrl(params);
|
|
32688
|
-
const url = new URL(`${base}${
|
|
32667
|
+
const url = new URL(`${base}${path4.startsWith("/") ? "" : "/"}${path4}`);
|
|
32689
32668
|
if (!url.searchParams.has("project_id")) {
|
|
32690
32669
|
url.searchParams.set("project_id", projectId2);
|
|
32691
32670
|
}
|
|
@@ -33134,14 +33113,14 @@ var parameters62 = {
|
|
|
33134
33113
|
};
|
|
33135
33114
|
|
|
33136
33115
|
// ../connectors/src/connectors/grafana/utils.ts
|
|
33137
|
-
async function apiFetch25(params,
|
|
33116
|
+
async function apiFetch25(params, path4, init) {
|
|
33138
33117
|
const apiKey = params[parameters62.apiKey.slug];
|
|
33139
33118
|
const rawUrl = params[parameters62.url.slug];
|
|
33140
33119
|
if (!apiKey || !rawUrl) {
|
|
33141
33120
|
throw new Error("grafana: missing required parameters: url and api-key");
|
|
33142
33121
|
}
|
|
33143
33122
|
const baseUrl = rawUrl.replace(/\/+$/, "");
|
|
33144
|
-
const url = `${baseUrl}${
|
|
33123
|
+
const url = `${baseUrl}${path4.startsWith("/") ? path4 : `/${path4}`}`;
|
|
33145
33124
|
const headers = new Headers(init?.headers);
|
|
33146
33125
|
headers.set("Authorization", `Bearer ${apiKey}`);
|
|
33147
33126
|
if (!headers.has("Accept")) headers.set("Accept", "application/json");
|
|
@@ -33326,7 +33305,7 @@ Use this tool to interact with Grafana resources: datasources, dashboards, alert
|
|
|
33326
33305
|
The path must start with '/' and is appended to the configured Grafana instance URL.`,
|
|
33327
33306
|
inputSchema: inputSchema76,
|
|
33328
33307
|
outputSchema: outputSchema76,
|
|
33329
|
-
async execute({ connectionId, method, path:
|
|
33308
|
+
async execute({ connectionId, method, path: path4, body }, connections) {
|
|
33330
33309
|
const connection = connections.find((c) => c.id === connectionId);
|
|
33331
33310
|
if (!connection) {
|
|
33332
33311
|
return {
|
|
@@ -33335,12 +33314,12 @@ The path must start with '/' and is appended to the configured Grafana instance
|
|
|
33335
33314
|
};
|
|
33336
33315
|
}
|
|
33337
33316
|
console.log(
|
|
33338
|
-
`[connector-request] grafana/${connection.name}: ${method} ${
|
|
33317
|
+
`[connector-request] grafana/${connection.name}: ${method} ${path4}`
|
|
33339
33318
|
);
|
|
33340
33319
|
try {
|
|
33341
33320
|
const baseUrl = parameters62.url.getValue(connection).replace(/\/+$/, "");
|
|
33342
33321
|
const apiKey = parameters62.apiKey.getValue(connection);
|
|
33343
|
-
const url = `${baseUrl}${
|
|
33322
|
+
const url = `${baseUrl}${path4}`;
|
|
33344
33323
|
const controller = new AbortController();
|
|
33345
33324
|
const timeout = setTimeout(
|
|
33346
33325
|
() => controller.abort(),
|
|
@@ -33578,7 +33557,7 @@ var parameters63 = {
|
|
|
33578
33557
|
};
|
|
33579
33558
|
|
|
33580
33559
|
// ../connectors/src/connectors/backlog/utils.ts
|
|
33581
|
-
async function apiFetch26(params,
|
|
33560
|
+
async function apiFetch26(params, path4, init) {
|
|
33582
33561
|
const spaceUrl = params[parameters63.spaceUrl.slug];
|
|
33583
33562
|
const apiKey = params[parameters63.apiKey.slug];
|
|
33584
33563
|
if (!spaceUrl) {
|
|
@@ -33587,7 +33566,7 @@ async function apiFetch26(params, path5, init) {
|
|
|
33587
33566
|
if (!apiKey) {
|
|
33588
33567
|
throw new Error("backlog: missing required parameter: api-key");
|
|
33589
33568
|
}
|
|
33590
|
-
const trimmedPath =
|
|
33569
|
+
const trimmedPath = path4.replace(/^\/+/, "");
|
|
33591
33570
|
const separator = trimmedPath.includes("?") ? "&" : "?";
|
|
33592
33571
|
const url = `${spaceUrl.replace(/\/+$/, "")}/api/v2/${trimmedPath}${separator}apiKey=${encodeURIComponent(apiKey)}`;
|
|
33593
33572
|
const headers = new Headers(init?.headers);
|
|
@@ -33740,17 +33719,17 @@ The base URL and API key are configured per connection \u2014 only specify the A
|
|
|
33740
33719
|
Do NOT include the apiKey parameter yourself; it is injected automatically.`,
|
|
33741
33720
|
inputSchema: inputSchema77,
|
|
33742
33721
|
outputSchema: outputSchema77,
|
|
33743
|
-
async execute({ connectionId, method, path:
|
|
33722
|
+
async execute({ connectionId, method, path: path4, body }, connections) {
|
|
33744
33723
|
const connection = connections.find((c) => c.id === connectionId);
|
|
33745
33724
|
if (!connection) {
|
|
33746
33725
|
return { success: false, error: `Connection ${connectionId} not found` };
|
|
33747
33726
|
}
|
|
33748
|
-
console.log(`[connector-request] backlog-api-key/${connection.name}: ${method} ${
|
|
33727
|
+
console.log(`[connector-request] backlog-api-key/${connection.name}: ${method} ${path4}`);
|
|
33749
33728
|
try {
|
|
33750
33729
|
const spaceUrl = parameters63.spaceUrl.getValue(connection);
|
|
33751
33730
|
const apiKey = parameters63.apiKey.getValue(connection);
|
|
33752
|
-
const separator =
|
|
33753
|
-
const url = `${spaceUrl.replace(/\/+$/, "")}/api/v2/${
|
|
33731
|
+
const separator = path4.includes("?") ? "&" : "?";
|
|
33732
|
+
const url = `${spaceUrl.replace(/\/+$/, "")}/api/v2/${path4}${separator}apiKey=${apiKey}`;
|
|
33754
33733
|
const controller = new AbortController();
|
|
33755
33734
|
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS60);
|
|
33756
33735
|
try {
|
|
@@ -34012,7 +33991,7 @@ var parameters64 = {
|
|
|
34012
33991
|
|
|
34013
33992
|
// ../connectors/src/connectors/gamma/utils.ts
|
|
34014
33993
|
var BASE_URL51 = "https://public-api.gamma.app/v1.0";
|
|
34015
|
-
function apiFetch27(params,
|
|
33994
|
+
function apiFetch27(params, path4, init) {
|
|
34016
33995
|
const apiKey = params[parameters64.apiKey.slug];
|
|
34017
33996
|
if (!apiKey) {
|
|
34018
33997
|
throw new Error(`gamma: missing required parameter: ${parameters64.apiKey.slug}`);
|
|
@@ -34020,7 +33999,7 @@ function apiFetch27(params, path5, init) {
|
|
|
34020
33999
|
const headers = new Headers(init?.headers);
|
|
34021
34000
|
headers.set("X-API-KEY", apiKey);
|
|
34022
34001
|
if (!headers.has("Content-Type")) headers.set("Content-Type", "application/json");
|
|
34023
|
-
const trimmedPath =
|
|
34002
|
+
const trimmedPath = path4.startsWith("/") ? path4 : `/${path4}`;
|
|
34024
34003
|
return fetch(`${BASE_URL51}${trimmedPath}`, { ...init, headers });
|
|
34025
34004
|
}
|
|
34026
34005
|
|
|
@@ -34157,7 +34136,7 @@ Use this tool for listing themes, listing folders, checking generation status, a
|
|
|
34157
34136
|
For creating presentations/documents, prefer the connector_gamma_generate tool instead.`,
|
|
34158
34137
|
inputSchema: inputSchema78,
|
|
34159
34138
|
outputSchema: outputSchema78,
|
|
34160
|
-
async execute({ connectionId, method, path:
|
|
34139
|
+
async execute({ connectionId, method, path: path4, body }, connections) {
|
|
34161
34140
|
const connection = connections.find((c) => c.id === connectionId);
|
|
34162
34141
|
if (!connection) {
|
|
34163
34142
|
return {
|
|
@@ -34166,11 +34145,11 @@ For creating presentations/documents, prefer the connector_gamma_generate tool i
|
|
|
34166
34145
|
};
|
|
34167
34146
|
}
|
|
34168
34147
|
console.log(
|
|
34169
|
-
`[connector-request] gamma/${connection.name}: ${method} ${
|
|
34148
|
+
`[connector-request] gamma/${connection.name}: ${method} ${path4}`
|
|
34170
34149
|
);
|
|
34171
34150
|
try {
|
|
34172
34151
|
const apiKey = parameters64.apiKey.getValue(connection);
|
|
34173
|
-
const url = `${BASE_URL52}${
|
|
34152
|
+
const url = `${BASE_URL52}${path4}`;
|
|
34174
34153
|
const controller = new AbortController();
|
|
34175
34154
|
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS61);
|
|
34176
34155
|
try {
|
|
@@ -34614,12 +34593,12 @@ var parameters65 = {
|
|
|
34614
34593
|
|
|
34615
34594
|
// ../connectors/src/connectors/sentry/utils.ts
|
|
34616
34595
|
var BASE_URL54 = "https://sentry.io/api/0";
|
|
34617
|
-
async function apiFetch28(params,
|
|
34596
|
+
async function apiFetch28(params, path4, init) {
|
|
34618
34597
|
const authToken = params[parameters65.authToken.slug];
|
|
34619
34598
|
if (!authToken) {
|
|
34620
34599
|
throw new Error("sentry: missing required parameter: auth-token");
|
|
34621
34600
|
}
|
|
34622
|
-
const url = `${BASE_URL54}${
|
|
34601
|
+
const url = `${BASE_URL54}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
34623
34602
|
const headers = new Headers(init?.headers);
|
|
34624
34603
|
headers.set("Authorization", `Bearer ${authToken}`);
|
|
34625
34604
|
if (!headers.has("Accept")) headers.set("Accept", "application/json");
|
|
@@ -34784,7 +34763,7 @@ Authentication is handled automatically via Bearer token.
|
|
|
34784
34763
|
{organizationSlug} in the path is automatically replaced with the configured organization slug.`,
|
|
34785
34764
|
inputSchema: inputSchema80,
|
|
34786
34765
|
outputSchema: outputSchema80,
|
|
34787
|
-
async execute({ connectionId, method, path:
|
|
34766
|
+
async execute({ connectionId, method, path: path4, body }, connections) {
|
|
34788
34767
|
const connection = connections.find((c) => c.id === connectionId);
|
|
34789
34768
|
if (!connection) {
|
|
34790
34769
|
return {
|
|
@@ -34793,12 +34772,12 @@ Authentication is handled automatically via Bearer token.
|
|
|
34793
34772
|
};
|
|
34794
34773
|
}
|
|
34795
34774
|
console.log(
|
|
34796
|
-
`[connector-request] sentry/${connection.name}: ${method} ${
|
|
34775
|
+
`[connector-request] sentry/${connection.name}: ${method} ${path4}`
|
|
34797
34776
|
);
|
|
34798
34777
|
try {
|
|
34799
34778
|
const authToken = parameters65.authToken.getValue(connection);
|
|
34800
34779
|
const organizationSlug = parameters65.organizationSlug.getValue(connection);
|
|
34801
|
-
const resolvedPath =
|
|
34780
|
+
const resolvedPath = path4.replace(
|
|
34802
34781
|
/\{organizationSlug\}/g,
|
|
34803
34782
|
organizationSlug
|
|
34804
34783
|
);
|
|
@@ -35135,9 +35114,9 @@ async function getAccessToken4(params) {
|
|
|
35135
35114
|
instanceUrl: tokenJson.instance_url ?? instanceUrl
|
|
35136
35115
|
};
|
|
35137
35116
|
}
|
|
35138
|
-
async function apiFetch29(params,
|
|
35117
|
+
async function apiFetch29(params, path4, init) {
|
|
35139
35118
|
const token = await getAccessToken4(params);
|
|
35140
|
-
const url = `${token.instanceUrl}${
|
|
35119
|
+
const url = `${token.instanceUrl}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
35141
35120
|
const headers = new Headers(init?.headers);
|
|
35142
35121
|
headers.set("Authorization", `Bearer ${token.accessToken}`);
|
|
35143
35122
|
headers.set("Accept", "application/json");
|
|
@@ -35361,7 +35340,7 @@ Use this tool for all Salesforce interactions: describing sObjects, running SOQL
|
|
|
35361
35340
|
Prefer SOQL via the /query endpoint for filtered, joined, or aggregated reads rather than paginating /sobjects/{Type} endpoints.`,
|
|
35362
35341
|
inputSchema: inputSchema81,
|
|
35363
35342
|
outputSchema: outputSchema81,
|
|
35364
|
-
async execute({ connectionId, method, path:
|
|
35343
|
+
async execute({ connectionId, method, path: path4, body }, connections) {
|
|
35365
35344
|
const connection = connections.find((c) => c.id === connectionId);
|
|
35366
35345
|
if (!connection) {
|
|
35367
35346
|
return {
|
|
@@ -35370,7 +35349,7 @@ Prefer SOQL via the /query endpoint for filtered, joined, or aggregated reads ra
|
|
|
35370
35349
|
};
|
|
35371
35350
|
}
|
|
35372
35351
|
console.log(
|
|
35373
|
-
`[connector-request] salesforce/${connection.name}: ${method} ${
|
|
35352
|
+
`[connector-request] salesforce/${connection.name}: ${method} ${path4}`
|
|
35374
35353
|
);
|
|
35375
35354
|
try {
|
|
35376
35355
|
const instanceUrlParam = parameters66.instanceUrl.getValue(connection);
|
|
@@ -35404,7 +35383,7 @@ Prefer SOQL via the /query endpoint for filtered, joined, or aggregated reads ra
|
|
|
35404
35383
|
};
|
|
35405
35384
|
}
|
|
35406
35385
|
const resolvedInstanceUrl = tokenJson.instance_url ?? instanceUrl;
|
|
35407
|
-
const url = `${resolvedInstanceUrl}${
|
|
35386
|
+
const url = `${resolvedInstanceUrl}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
35408
35387
|
const controller = new AbortController();
|
|
35409
35388
|
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS63);
|
|
35410
35389
|
try {
|
|
@@ -36050,7 +36029,7 @@ Use this tool for all InfluxDB interactions: running SQL / InfluxQL / Flux queri
|
|
|
36050
36029
|
For read-only data exploration prefer SQL (InfluxDB 3) or InfluxQL queries \u2014 they return JSON that is straightforward to parse. Flux queries return annotated CSV.`,
|
|
36051
36030
|
inputSchema: inputSchema82,
|
|
36052
36031
|
outputSchema: outputSchema82,
|
|
36053
|
-
async execute({ connectionId, method, path:
|
|
36032
|
+
async execute({ connectionId, method, path: path4, body, contentType }, connections) {
|
|
36054
36033
|
const connection = connections.find((c) => c.id === connectionId);
|
|
36055
36034
|
if (!connection) {
|
|
36056
36035
|
return {
|
|
@@ -36059,12 +36038,12 @@ For read-only data exploration prefer SQL (InfluxDB 3) or InfluxQL queries \u201
|
|
|
36059
36038
|
};
|
|
36060
36039
|
}
|
|
36061
36040
|
console.log(
|
|
36062
|
-
`[connector-request] influxdb/${connection.name}: ${method} ${
|
|
36041
|
+
`[connector-request] influxdb/${connection.name}: ${method} ${path4}`
|
|
36063
36042
|
);
|
|
36064
36043
|
try {
|
|
36065
36044
|
const url = parameters67.url.getValue(connection).replace(/\/$/, "");
|
|
36066
36045
|
const token = parameters67.token.getValue(connection);
|
|
36067
|
-
const fullUrl = `${url}${
|
|
36046
|
+
const fullUrl = `${url}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
36068
36047
|
const controller = new AbortController();
|
|
36069
36048
|
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS64);
|
|
36070
36049
|
const resolvedContentType = contentType ?? (typeof body === "string" ? "text/plain; charset=utf-8" : "application/json");
|
|
@@ -36101,7 +36080,7 @@ For read-only data exploration prefer SQL (InfluxDB 3) or InfluxQL queries \u201
|
|
|
36101
36080
|
} else if (bodyText) {
|
|
36102
36081
|
errorMessage = isHtml ? bodyText.replace(/\s+/g, " ").slice(0, 200) : bodyText;
|
|
36103
36082
|
}
|
|
36104
|
-
const hitsV3Path =
|
|
36083
|
+
const hitsV3Path = path4.includes("/api/v3/");
|
|
36105
36084
|
const looksLikeMissingV3 = hitsV3Path && (response.status === 405 || response.status === 404 || isHtml);
|
|
36106
36085
|
if (looksLikeMissingV3) {
|
|
36107
36086
|
errorMessage += " \u2014 This InfluxDB instance does not support the v3 API at this path. It is likely InfluxDB 2 (e.g. InfluxDB Cloud on '*.cloud2.influxdata.com'). Retry via Flux on '/api/v2/query?org={org}' with contentType 'application/vnd.flux'.";
|
|
@@ -37877,7 +37856,7 @@ Errors from the Standard API are returned as a plain text body starting with "ER
|
|
|
37877
37856
|
async execute({
|
|
37878
37857
|
connectionId,
|
|
37879
37858
|
method,
|
|
37880
|
-
path:
|
|
37859
|
+
path: path4,
|
|
37881
37860
|
queryParams,
|
|
37882
37861
|
body,
|
|
37883
37862
|
contentType,
|
|
@@ -37891,13 +37870,13 @@ Errors from the Standard API are returned as a plain text body starting with "ER
|
|
|
37891
37870
|
};
|
|
37892
37871
|
}
|
|
37893
37872
|
console.log(
|
|
37894
|
-
`[connector-request] semrush/${connection.name}: ${method} ${
|
|
37873
|
+
`[connector-request] semrush/${connection.name}: ${method} ${path4}`
|
|
37895
37874
|
);
|
|
37896
37875
|
try {
|
|
37897
37876
|
const apiKey = parameters70.apiKey.getValue(connection);
|
|
37898
|
-
const isAbsolute = /^https?:\/\//i.test(
|
|
37877
|
+
const isAbsolute = /^https?:\/\//i.test(path4);
|
|
37899
37878
|
if (isAbsolute) {
|
|
37900
|
-
const host = new URL(
|
|
37879
|
+
const host = new URL(path4).hostname.toLowerCase();
|
|
37901
37880
|
if (host !== "api.semrush.com" && host !== "www.semrush.com") {
|
|
37902
37881
|
return {
|
|
37903
37882
|
success: false,
|
|
@@ -37906,7 +37885,7 @@ Errors from the Standard API are returned as a plain text body starting with "ER
|
|
|
37906
37885
|
}
|
|
37907
37886
|
}
|
|
37908
37887
|
const url = new URL(
|
|
37909
|
-
isAbsolute ?
|
|
37888
|
+
isAbsolute ? path4 : `${BASE_URL58}${path4.startsWith("/") ? "" : "/"}${path4}`
|
|
37910
37889
|
);
|
|
37911
37890
|
if (queryParams) {
|
|
37912
37891
|
for (const [k, v] of Object.entries(queryParams)) {
|
|
@@ -38012,14 +37991,14 @@ var semrushOnboarding = new ConnectorOnboarding({
|
|
|
38012
37991
|
// ../connectors/src/connectors/semrush/utils.ts
|
|
38013
37992
|
var BASE_URL59 = "https://api.semrush.com";
|
|
38014
37993
|
var PROJECTS_BASE_URL = `${BASE_URL59}/management/v1`;
|
|
38015
|
-
function projectsApiFetch(params,
|
|
37994
|
+
function projectsApiFetch(params, path4, init) {
|
|
38016
37995
|
const apiKey = params[parameters70.apiKey.slug];
|
|
38017
37996
|
if (!apiKey) {
|
|
38018
37997
|
throw new Error(
|
|
38019
37998
|
`semrush: missing required parameter: ${parameters70.apiKey.slug}`
|
|
38020
37999
|
);
|
|
38021
38000
|
}
|
|
38022
|
-
const trimmedPath =
|
|
38001
|
+
const trimmedPath = path4.startsWith("/") ? path4 : `/${path4}`;
|
|
38023
38002
|
const url = new URL(`${PROJECTS_BASE_URL}${trimmedPath}`);
|
|
38024
38003
|
if (!url.searchParams.has("key")) {
|
|
38025
38004
|
url.searchParams.set("key", apiKey);
|
|
@@ -39127,7 +39106,7 @@ Authentication is handled automatically via OAuth proxy.
|
|
|
39127
39106
|
For URL Inspection API requests, use the absolute path '/v1/urlInspection/index:inspect' \u2014 the leading /webmasters/v3 prefix will be stripped if you accidentally include it.`,
|
|
39128
39107
|
inputSchema: inputSchema87,
|
|
39129
39108
|
outputSchema: outputSchema87,
|
|
39130
|
-
async execute({ connectionId, method, path:
|
|
39109
|
+
async execute({ connectionId, method, path: path4, queryParams, body }, connections, config) {
|
|
39131
39110
|
const connection = connections.find((c) => c.id === connectionId);
|
|
39132
39111
|
if (!connection) {
|
|
39133
39112
|
return {
|
|
@@ -39136,11 +39115,11 @@ For URL Inspection API requests, use the absolute path '/v1/urlInspection/index:
|
|
|
39136
39115
|
};
|
|
39137
39116
|
}
|
|
39138
39117
|
console.log(
|
|
39139
|
-
`[connector-request] google-search-console-oauth/${connection.name}: ${method} ${
|
|
39118
|
+
`[connector-request] google-search-console-oauth/${connection.name}: ${method} ${path4}`
|
|
39140
39119
|
);
|
|
39141
39120
|
try {
|
|
39142
39121
|
const siteUrl = parameters71.siteUrl.tryGetValue(connection);
|
|
39143
|
-
const resolvedPath = siteUrl ?
|
|
39122
|
+
const resolvedPath = siteUrl ? path4.replace(/\{siteUrl\}/g, encodeURIComponent(siteUrl)) : path4;
|
|
39144
39123
|
const normalizedPath = normalizeRequestPath(
|
|
39145
39124
|
resolvedPath,
|
|
39146
39125
|
BASE_PATH_SEGMENT10
|
|
@@ -39796,12 +39775,12 @@ var parameters73 = {
|
|
|
39796
39775
|
|
|
39797
39776
|
// ../connectors/src/connectors/clickup/utils.ts
|
|
39798
39777
|
var BASE_URL62 = "https://api.clickup.com/api/v2";
|
|
39799
|
-
async function apiFetch30(params,
|
|
39778
|
+
async function apiFetch30(params, path4, init) {
|
|
39800
39779
|
const token = params[parameters73.apiToken.slug];
|
|
39801
39780
|
if (!token) {
|
|
39802
39781
|
throw new Error("clickup: missing required parameter: api-token");
|
|
39803
39782
|
}
|
|
39804
|
-
const url = `${BASE_URL62}${
|
|
39783
|
+
const url = `${BASE_URL62}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
39805
39784
|
const headers = new Headers(init?.headers);
|
|
39806
39785
|
headers.set("Authorization", token);
|
|
39807
39786
|
if (!headers.has("Accept")) headers.set("Accept", "application/json");
|
|
@@ -40028,7 +40007,7 @@ Common endpoints:
|
|
|
40028
40007
|
Pagination: ClickUp uses zero-indexed \`page\` query parameter on list endpoints (page=0, page=1, ...). Each page returns up to 100 tasks; you must increment \`page\` until the response array is empty.`,
|
|
40029
40008
|
inputSchema: inputSchema89,
|
|
40030
40009
|
outputSchema: outputSchema89,
|
|
40031
|
-
async execute({ connectionId, method, path:
|
|
40010
|
+
async execute({ connectionId, method, path: path4, body }, connections) {
|
|
40032
40011
|
const connection = connections.find((c) => c.id === connectionId);
|
|
40033
40012
|
if (!connection) {
|
|
40034
40013
|
return {
|
|
@@ -40037,11 +40016,11 @@ Pagination: ClickUp uses zero-indexed \`page\` query parameter on list endpoints
|
|
|
40037
40016
|
};
|
|
40038
40017
|
}
|
|
40039
40018
|
console.log(
|
|
40040
|
-
`[connector-request] clickup/${connection.name}: ${method} ${
|
|
40019
|
+
`[connector-request] clickup/${connection.name}: ${method} ${path4}`
|
|
40041
40020
|
);
|
|
40042
40021
|
try {
|
|
40043
40022
|
const token = parameters73.apiToken.getValue(connection);
|
|
40044
|
-
const normalizedPath = normalizeRequestPath(
|
|
40023
|
+
const normalizedPath = normalizeRequestPath(path4, BASE_PATH_SEGMENT11);
|
|
40045
40024
|
const url = `${BASE_URL63}${normalizedPath}`;
|
|
40046
40025
|
const controller = new AbortController();
|
|
40047
40026
|
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS69);
|
|
@@ -41922,7 +41901,7 @@ function buildBaseUrl(domain) {
|
|
|
41922
41901
|
function basicAuthHeader2(apiKey) {
|
|
41923
41902
|
return `Basic ${Buffer.from(`${apiKey}:X`).toString("base64")}`;
|
|
41924
41903
|
}
|
|
41925
|
-
async function apiFetch31(params,
|
|
41904
|
+
async function apiFetch31(params, path4, init) {
|
|
41926
41905
|
const apiKey = params[parameters78.apiKey.slug];
|
|
41927
41906
|
const domain = params[parameters78.domain.slug];
|
|
41928
41907
|
if (!apiKey || !domain) {
|
|
@@ -41931,7 +41910,7 @@ async function apiFetch31(params, path5, init) {
|
|
|
41931
41910
|
);
|
|
41932
41911
|
}
|
|
41933
41912
|
const baseUrl = buildBaseUrl(domain);
|
|
41934
|
-
const url = `${baseUrl}${
|
|
41913
|
+
const url = `${baseUrl}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
41935
41914
|
const headers = new Headers(init?.headers);
|
|
41936
41915
|
headers.set("Authorization", basicAuthHeader2(apiKey));
|
|
41937
41916
|
headers.set("Accept", "application/json");
|
|
@@ -41992,8 +41971,8 @@ var FRESHSERVICE_ENTITIES = [
|
|
|
41992
41971
|
countPath: "/service_catalog/items?per_page=1"
|
|
41993
41972
|
}
|
|
41994
41973
|
];
|
|
41995
|
-
async function fetchEntityCount2(params,
|
|
41996
|
-
const res = await apiFetch31(params,
|
|
41974
|
+
async function fetchEntityCount2(params, path4) {
|
|
41975
|
+
const res = await apiFetch31(params, path4);
|
|
41997
41976
|
if (!res.ok) return null;
|
|
41998
41977
|
const data = await res.json();
|
|
41999
41978
|
if (typeof data["total"] === "number") return data["total"];
|
|
@@ -42126,7 +42105,7 @@ Field codes:
|
|
|
42126
42105
|
- ticket source: 1 Email, 2 Portal, 3 Phone, 4 Chat, 5 Feedback widget, 7 Yammer, 8 AwsCloudwatch, 9 Pagerduty, 10 Walkup, 11 Slack`,
|
|
42127
42106
|
inputSchema: inputSchema95,
|
|
42128
42107
|
outputSchema: outputSchema95,
|
|
42129
|
-
async execute({ connectionId, method, path:
|
|
42108
|
+
async execute({ connectionId, method, path: path4, body }, connections) {
|
|
42130
42109
|
const connection = connections.find((c) => c.id === connectionId);
|
|
42131
42110
|
if (!connection) {
|
|
42132
42111
|
return {
|
|
@@ -42135,13 +42114,13 @@ Field codes:
|
|
|
42135
42114
|
};
|
|
42136
42115
|
}
|
|
42137
42116
|
console.log(
|
|
42138
|
-
`[connector-request] freshservice/${connection.name}: ${method} ${
|
|
42117
|
+
`[connector-request] freshservice/${connection.name}: ${method} ${path4}`
|
|
42139
42118
|
);
|
|
42140
42119
|
try {
|
|
42141
42120
|
const apiKey = parameters78.apiKey.getValue(connection);
|
|
42142
42121
|
const domain = parameters78.domain.getValue(connection);
|
|
42143
42122
|
const baseUrl = buildBaseUrl2(domain);
|
|
42144
|
-
const normalizedPath = normalizeRequestPath(
|
|
42123
|
+
const normalizedPath = normalizeRequestPath(path4, BASE_PATH_SEGMENT13);
|
|
42145
42124
|
const url = `${baseUrl}${normalizedPath}`;
|
|
42146
42125
|
const controller = new AbortController();
|
|
42147
42126
|
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS70);
|
|
@@ -42434,7 +42413,7 @@ function buildBaseUrl3(domain) {
|
|
|
42434
42413
|
function basicAuthHeader4(apiKey) {
|
|
42435
42414
|
return `Basic ${Buffer.from(`${apiKey}:X`).toString("base64")}`;
|
|
42436
42415
|
}
|
|
42437
|
-
async function apiFetch32(params,
|
|
42416
|
+
async function apiFetch32(params, path4, init) {
|
|
42438
42417
|
const apiKey = params[parameters79.apiKey.slug];
|
|
42439
42418
|
const domain = params[parameters79.domain.slug];
|
|
42440
42419
|
if (!apiKey || !domain) {
|
|
@@ -42443,7 +42422,7 @@ async function apiFetch32(params, path5, init) {
|
|
|
42443
42422
|
);
|
|
42444
42423
|
}
|
|
42445
42424
|
const baseUrl = buildBaseUrl3(domain);
|
|
42446
|
-
const url = `${baseUrl}${
|
|
42425
|
+
const url = `${baseUrl}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
42447
42426
|
const headers = new Headers(init?.headers);
|
|
42448
42427
|
headers.set("Authorization", basicAuthHeader4(apiKey));
|
|
42449
42428
|
headers.set("Accept", "application/json");
|
|
@@ -42480,8 +42459,8 @@ var FRESHDESK_ENTITIES = [
|
|
|
42480
42459
|
countPath: "/groups?per_page=1"
|
|
42481
42460
|
}
|
|
42482
42461
|
];
|
|
42483
|
-
async function fetchEntityCount3(params,
|
|
42484
|
-
const res = await apiFetch32(params,
|
|
42462
|
+
async function fetchEntityCount3(params, path4, countField) {
|
|
42463
|
+
const res = await apiFetch32(params, path4);
|
|
42485
42464
|
if (!res.ok) return null;
|
|
42486
42465
|
const data = await res.json();
|
|
42487
42466
|
if (Array.isArray(data)) return null;
|
|
@@ -42693,7 +42672,7 @@ Field codes (tickets):
|
|
|
42693
42672
|
- source: 1 Email, 2 Portal, 3 Phone, 7 Chat, 9 Feedback widget, 10 Outbound email`,
|
|
42694
42673
|
inputSchema: inputSchema96,
|
|
42695
42674
|
outputSchema: outputSchema96,
|
|
42696
|
-
async execute({ connectionId, method, path:
|
|
42675
|
+
async execute({ connectionId, method, path: path4, body }, connections) {
|
|
42697
42676
|
const connection = connections.find((c) => c.id === connectionId);
|
|
42698
42677
|
if (!connection) {
|
|
42699
42678
|
return {
|
|
@@ -42702,13 +42681,13 @@ Field codes (tickets):
|
|
|
42702
42681
|
};
|
|
42703
42682
|
}
|
|
42704
42683
|
console.log(
|
|
42705
|
-
`[connector-request] freshdesk/${connection.name}: ${method} ${
|
|
42684
|
+
`[connector-request] freshdesk/${connection.name}: ${method} ${path4}`
|
|
42706
42685
|
);
|
|
42707
42686
|
try {
|
|
42708
42687
|
const apiKey = parameters79.apiKey.getValue(connection);
|
|
42709
42688
|
const domain = parameters79.domain.getValue(connection);
|
|
42710
42689
|
const baseUrl = buildBaseUrl4(domain);
|
|
42711
|
-
const normalizedPath = normalizeRequestPath(
|
|
42690
|
+
const normalizedPath = normalizeRequestPath(path4, BASE_PATH_SEGMENT15);
|
|
42712
42691
|
const url = `${baseUrl}${normalizedPath}`;
|
|
42713
42692
|
const controller = new AbortController();
|
|
42714
42693
|
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS71);
|
|
@@ -43000,7 +42979,7 @@ function buildBaseUrl5(bundleAlias) {
|
|
|
43000
42979
|
const subdomain = trimmed.split(".")[0];
|
|
43001
42980
|
return `https://${subdomain}.myfreshworks.com${BASE_PATH_SEGMENT16}`;
|
|
43002
42981
|
}
|
|
43003
|
-
async function apiFetch33(params,
|
|
42982
|
+
async function apiFetch33(params, path4, init) {
|
|
43004
42983
|
const apiKey = params[parameters80.apiKey.slug];
|
|
43005
42984
|
const bundle = params[parameters80.bundleAlias.slug];
|
|
43006
42985
|
if (!apiKey || !bundle) {
|
|
@@ -43009,7 +42988,7 @@ async function apiFetch33(params, path5, init) {
|
|
|
43009
42988
|
);
|
|
43010
42989
|
}
|
|
43011
42990
|
const baseUrl = buildBaseUrl5(bundle);
|
|
43012
|
-
const url = `${baseUrl}${
|
|
42991
|
+
const url = `${baseUrl}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
43013
42992
|
const headers = new Headers(init?.headers);
|
|
43014
42993
|
headers.set("Authorization", `Token token=${apiKey}`);
|
|
43015
42994
|
headers.set("Accept", "application/json");
|
|
@@ -43182,7 +43161,7 @@ Pagination: 1-indexed \`page\` + \`per_page\` (default 25, max 100). View endpoi
|
|
|
43182
43161
|
Includes: most GET endpoints accept \`?include=\` with a comma-separated list (\`owner\`, \`creator\`, \`deals\`, \`contacts\`, etc.) to inline related records.`,
|
|
43183
43162
|
inputSchema: inputSchema97,
|
|
43184
43163
|
outputSchema: outputSchema97,
|
|
43185
|
-
async execute({ connectionId, method, path:
|
|
43164
|
+
async execute({ connectionId, method, path: path4, body }, connections) {
|
|
43186
43165
|
const connection = connections.find((c) => c.id === connectionId);
|
|
43187
43166
|
if (!connection) {
|
|
43188
43167
|
return {
|
|
@@ -43191,13 +43170,13 @@ Includes: most GET endpoints accept \`?include=\` with a comma-separated list (\
|
|
|
43191
43170
|
};
|
|
43192
43171
|
}
|
|
43193
43172
|
console.log(
|
|
43194
|
-
`[connector-request] freshsales/${connection.name}: ${method} ${
|
|
43173
|
+
`[connector-request] freshsales/${connection.name}: ${method} ${path4}`
|
|
43195
43174
|
);
|
|
43196
43175
|
try {
|
|
43197
43176
|
const apiKey = parameters80.apiKey.getValue(connection);
|
|
43198
43177
|
const bundle = parameters80.bundleAlias.getValue(connection);
|
|
43199
43178
|
const baseUrl = buildBaseUrl6(bundle);
|
|
43200
|
-
const normalizedPath = normalizeRequestPath(
|
|
43179
|
+
const normalizedPath = normalizeRequestPath(path4, BASE_PATH_SEGMENT17);
|
|
43201
43180
|
const url = `${baseUrl}${normalizedPath}`;
|
|
43202
43181
|
const controller = new AbortController();
|
|
43203
43182
|
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS72);
|
|
@@ -43502,7 +43481,7 @@ function resolveBaseUrl(connectionBaseUrl) {
|
|
|
43502
43481
|
const trimmed = connectionBaseUrl?.trim();
|
|
43503
43482
|
return trimmed && trimmed.replace(/\/+$/, "") || DEFAULT_BASE_URL;
|
|
43504
43483
|
}
|
|
43505
|
-
async function apiFetch34(params,
|
|
43484
|
+
async function apiFetch34(params, path4, init) {
|
|
43506
43485
|
const token = params[parameters81.personalAccessToken.slug];
|
|
43507
43486
|
if (!token) {
|
|
43508
43487
|
throw new Error(
|
|
@@ -43510,7 +43489,7 @@ async function apiFetch34(params, path5, init) {
|
|
|
43510
43489
|
);
|
|
43511
43490
|
}
|
|
43512
43491
|
const baseUrl = resolveBaseUrl(params[parameters81.baseUrl.slug]);
|
|
43513
|
-
const trimmedPath =
|
|
43492
|
+
const trimmedPath = path4.replace(/^\/+/, "/");
|
|
43514
43493
|
const url = `${baseUrl}${trimmedPath.startsWith("/") ? "" : "/"}${trimmedPath}`;
|
|
43515
43494
|
const headers = new Headers(init?.headers);
|
|
43516
43495
|
headers.set("Authorization", `Bearer ${token}`);
|
|
@@ -43748,7 +43727,7 @@ Pagination: 1-indexed \`page\` + \`per_page\` (max 100). The \`Link\` response h
|
|
|
43748
43727
|
Rate limits: 5,000 req/hr on REST endpoints, 30 req/min on /search/*. Inspect \`X-RateLimit-Remaining\` to throttle.`,
|
|
43749
43728
|
inputSchema: inputSchema98,
|
|
43750
43729
|
outputSchema: outputSchema98,
|
|
43751
|
-
async execute({ connectionId, method, path:
|
|
43730
|
+
async execute({ connectionId, method, path: path4, body }, connections) {
|
|
43752
43731
|
const connection = connections.find((c) => c.id === connectionId);
|
|
43753
43732
|
if (!connection) {
|
|
43754
43733
|
return {
|
|
@@ -43757,12 +43736,12 @@ Rate limits: 5,000 req/hr on REST endpoints, 30 req/min on /search/*. Inspect \`
|
|
|
43757
43736
|
};
|
|
43758
43737
|
}
|
|
43759
43738
|
console.log(
|
|
43760
|
-
`[connector-request] github/${connection.name}: ${method} ${
|
|
43739
|
+
`[connector-request] github/${connection.name}: ${method} ${path4}`
|
|
43761
43740
|
);
|
|
43762
43741
|
try {
|
|
43763
43742
|
const token = parameters81.personalAccessToken.getValue(connection);
|
|
43764
43743
|
const baseUrl = resolveBaseUrl2(parameters81.baseUrl.tryGetValue(connection));
|
|
43765
|
-
const trimmedPath =
|
|
43744
|
+
const trimmedPath = path4.trim().replace(/^\/+/, "/");
|
|
43766
43745
|
const url = `${baseUrl}${trimmedPath.startsWith("/") ? "" : "/"}${trimmedPath}`;
|
|
43767
43746
|
const controller = new AbortController();
|
|
43768
43747
|
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS73);
|
|
@@ -44140,7 +44119,7 @@ All paths are relative to https://api.powerbi.com/v1.0/myorg. Use the executeQue
|
|
|
44140
44119
|
The signed-in user must have access to the workspace; unlike Service Principals, OAuth users can also access "My workspace" via the \`/datasets\` (without \`/groups/\`) endpoints.`,
|
|
44141
44120
|
inputSchema: inputSchema99,
|
|
44142
44121
|
outputSchema: outputSchema99,
|
|
44143
|
-
async execute({ connectionId, method, path:
|
|
44122
|
+
async execute({ connectionId, method, path: path4, queryParams, body }, connections, config) {
|
|
44144
44123
|
const connection = connections.find((c) => c.id === connectionId);
|
|
44145
44124
|
if (!connection) {
|
|
44146
44125
|
return {
|
|
@@ -44149,10 +44128,10 @@ The signed-in user must have access to the workspace; unlike Service Principals,
|
|
|
44149
44128
|
};
|
|
44150
44129
|
}
|
|
44151
44130
|
console.log(
|
|
44152
|
-
`[connector-request] powerbi-oauth/${connection.name}: ${method} ${
|
|
44131
|
+
`[connector-request] powerbi-oauth/${connection.name}: ${method} ${path4}`
|
|
44153
44132
|
);
|
|
44154
44133
|
try {
|
|
44155
|
-
const normalizedPath = normalizeRequestPath(
|
|
44134
|
+
const normalizedPath = normalizeRequestPath(path4, BASE_PATH_SEGMENT18);
|
|
44156
44135
|
let url = `${BASE_URL64}${normalizedPath}`;
|
|
44157
44136
|
if (queryParams) {
|
|
44158
44137
|
const searchParams = new URLSearchParams(queryParams);
|
|
@@ -44237,8 +44216,8 @@ var parameters82 = {};
|
|
|
44237
44216
|
|
|
44238
44217
|
// ../connectors/src/connectors/powerbi-oauth/utils.ts
|
|
44239
44218
|
var BASE_URL65 = "https://api.powerbi.com/v1.0/myorg";
|
|
44240
|
-
function apiFetch35(proxyFetch,
|
|
44241
|
-
const url = `${BASE_URL65}${
|
|
44219
|
+
function apiFetch35(proxyFetch, path4, init) {
|
|
44220
|
+
const url = `${BASE_URL65}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
44242
44221
|
return proxyFetch(url, init);
|
|
44243
44222
|
}
|
|
44244
44223
|
|
|
@@ -44263,8 +44242,8 @@ async function listGroups(proxyFetch) {
|
|
|
44263
44242
|
return data.value ?? [];
|
|
44264
44243
|
}
|
|
44265
44244
|
async function listResource(proxyFetch, groupId, resource) {
|
|
44266
|
-
const
|
|
44267
|
-
const res = await apiFetch35(proxyFetch,
|
|
44245
|
+
const path4 = groupId === MY_WORKSPACE ? `/${resource}` : `/groups/${encodeURIComponent(groupId)}/${resource}`;
|
|
44246
|
+
const res = await apiFetch35(proxyFetch, path4);
|
|
44268
44247
|
if (!res.ok) {
|
|
44269
44248
|
const body = await res.text().catch(() => res.statusText);
|
|
44270
44249
|
throw new Error(
|
|
@@ -44865,9 +44844,9 @@ function buildTableauBaseUrl(params) {
|
|
|
44865
44844
|
}
|
|
44866
44845
|
return `${serverUrl.replace(/\/$/, "")}/api/${apiVersion}`;
|
|
44867
44846
|
}
|
|
44868
|
-
async function tableauProxyApiFetch(proxyFetch, params,
|
|
44847
|
+
async function tableauProxyApiFetch(proxyFetch, params, path4, init) {
|
|
44869
44848
|
const baseUrl = buildTableauBaseUrl(params);
|
|
44870
|
-
const trimmedPath =
|
|
44849
|
+
const trimmedPath = path4.replace(/^([^/])/, "/$1");
|
|
44871
44850
|
return proxyFetch(`${baseUrl}${trimmedPath}`, init);
|
|
44872
44851
|
}
|
|
44873
44852
|
|
|
@@ -45226,7 +45205,7 @@ All paths are relative to {serverUrl}/api/{apiVersion}. Use the literal placehol
|
|
|
45226
45205
|
Accept and Content-Type headers default to application/json so list responses come back as JSON instead of Tableau's default XML.`,
|
|
45227
45206
|
inputSchema: inputSchema100,
|
|
45228
45207
|
outputSchema: outputSchema100,
|
|
45229
|
-
async execute({ connectionId, method, path:
|
|
45208
|
+
async execute({ connectionId, method, path: path4, queryParams, body }, connections, config) {
|
|
45230
45209
|
const connection = connections.find((c) => c.id === connectionId);
|
|
45231
45210
|
if (!connection) {
|
|
45232
45211
|
return {
|
|
@@ -45235,12 +45214,12 @@ Accept and Content-Type headers default to application/json so list responses co
|
|
|
45235
45214
|
};
|
|
45236
45215
|
}
|
|
45237
45216
|
console.log(
|
|
45238
|
-
`[connector-request] tableau/${connection.name}: ${method} ${
|
|
45217
|
+
`[connector-request] tableau/${connection.name}: ${method} ${path4}`
|
|
45239
45218
|
);
|
|
45240
45219
|
try {
|
|
45241
45220
|
const serverUrl = parameters83.serverUrl.getValue(connection);
|
|
45242
45221
|
const apiVersion = parameters83.apiVersion.tryGetValue(connection) || DEFAULT_API_VERSION2;
|
|
45243
|
-
const trimmedPath =
|
|
45222
|
+
const trimmedPath = path4.trim().replace(/^([^/])/, "/$1");
|
|
45244
45223
|
const baseUrl = buildBaseUrl7(serverUrl, apiVersion);
|
|
45245
45224
|
let url = `${baseUrl}${trimmedPath}`;
|
|
45246
45225
|
if (queryParams) {
|
|
@@ -45534,7 +45513,7 @@ Covers mailbox (\`/me/messages\`, \`/me/mailFolders\`), threads (\`/me/messages?
|
|
|
45534
45513
|
For full-text search use the \`$search\` query parameter (must be wrapped in double quotes); for filtering use \`$filter\` with OData syntax (e.g., \`receivedDateTime ge 2025-01-01T00:00:00Z\`).`,
|
|
45535
45514
|
inputSchema: inputSchema101,
|
|
45536
45515
|
outputSchema: outputSchema101,
|
|
45537
|
-
async execute({ connectionId, method, path:
|
|
45516
|
+
async execute({ connectionId, method, path: path4, queryParams }, connections, config) {
|
|
45538
45517
|
const connection = connections.find((c) => c.id === connectionId);
|
|
45539
45518
|
if (!connection) {
|
|
45540
45519
|
return {
|
|
@@ -45543,10 +45522,10 @@ For full-text search use the \`$search\` query parameter (must be wrapped in dou
|
|
|
45543
45522
|
};
|
|
45544
45523
|
}
|
|
45545
45524
|
console.log(
|
|
45546
|
-
`[connector-request] outlook-oauth/${connection.name}: ${method} ${
|
|
45525
|
+
`[connector-request] outlook-oauth/${connection.name}: ${method} ${path4}`
|
|
45547
45526
|
);
|
|
45548
45527
|
try {
|
|
45549
|
-
const normalizedPath = normalizeRequestPath(
|
|
45528
|
+
const normalizedPath = normalizeRequestPath(path4, BASE_PATH_SEGMENT19);
|
|
45550
45529
|
let url = `${BASE_URL66}${normalizedPath}`;
|
|
45551
45530
|
if (queryParams) {
|
|
45552
45531
|
const searchParams = new URLSearchParams(queryParams);
|
|
@@ -46115,7 +46094,7 @@ Use this tool for X API v2 reads such as looking up users, fetching posts, retri
|
|
|
46115
46094
|
X rate limits are endpoint-specific and commonly reset on fixed windows. This tool returns x-rate-limit-limit, x-rate-limit-remaining, and x-rate-limit-reset when X sends them. Before making repeated calls or adding pagination, inspect these values and keep dashboard requests small. Do not use this tool for frequent polling; if a request returns 429, wait until the reset timestamp instead of retrying immediately.`,
|
|
46116
46095
|
inputSchema: inputSchema102,
|
|
46117
46096
|
outputSchema: outputSchema102,
|
|
46118
|
-
async execute({ connectionId, method, path:
|
|
46097
|
+
async execute({ connectionId, method, path: path4, queryParams, body }, connections) {
|
|
46119
46098
|
const connection = connections.find((c) => c.id === connectionId);
|
|
46120
46099
|
if (!connection) {
|
|
46121
46100
|
return {
|
|
@@ -46123,9 +46102,9 @@ X rate limits are endpoint-specific and commonly reset on fixed windows. This to
|
|
|
46123
46102
|
error: `Connection ${connectionId} not found`
|
|
46124
46103
|
};
|
|
46125
46104
|
}
|
|
46126
|
-
console.log(`[connector-request] x/${connection.name}: ${method} ${
|
|
46105
|
+
console.log(`[connector-request] x/${connection.name}: ${method} ${path4}`);
|
|
46127
46106
|
try {
|
|
46128
|
-
if (/^https?:\/\//i.test(
|
|
46107
|
+
if (/^https?:\/\//i.test(path4)) {
|
|
46129
46108
|
return {
|
|
46130
46109
|
success: false,
|
|
46131
46110
|
error: "Absolute URLs are not allowed. Pass a path such as /2/users/me."
|
|
@@ -46133,7 +46112,7 @@ X rate limits are endpoint-specific and commonly reset on fixed windows. This to
|
|
|
46133
46112
|
}
|
|
46134
46113
|
const bearerToken = parameters85.bearerToken.getValue(connection);
|
|
46135
46114
|
const url = new URL(
|
|
46136
|
-
`${BASE_URL67}${
|
|
46115
|
+
`${BASE_URL67}${path4.startsWith("/") ? "" : "/"}${path4}`
|
|
46137
46116
|
);
|
|
46138
46117
|
if (queryParams) {
|
|
46139
46118
|
for (const [k, v] of Object.entries(queryParams)) {
|
|
@@ -46505,7 +46484,7 @@ Use this tool for normal dashboard data: top/new/best/ask/show/job story IDs, in
|
|
|
46505
46484
|
This connector does not require API credentials, but a connectionId is still required to select the Hacker News data source. Keep dashboard calls bounded: fetch list IDs first, then fetch only the small slice of item details needed for the current view. Use searchAlgolia only when keyword, tag, or historical search is necessary.`,
|
|
46506
46485
|
inputSchema: inputSchema103,
|
|
46507
46486
|
outputSchema: outputSchema103,
|
|
46508
|
-
async execute({ connectionId, path:
|
|
46487
|
+
async execute({ connectionId, path: path4, printPretty }, connections) {
|
|
46509
46488
|
const connection = connections.find((c) => c.id === connectionId);
|
|
46510
46489
|
if (!connection) {
|
|
46511
46490
|
return {
|
|
@@ -46514,17 +46493,17 @@ This connector does not require API credentials, but a connectionId is still req
|
|
|
46514
46493
|
};
|
|
46515
46494
|
}
|
|
46516
46495
|
console.log(
|
|
46517
|
-
`[connector-request] hackernews/${connection.name}: GET ${
|
|
46496
|
+
`[connector-request] hackernews/${connection.name}: GET ${path4}`
|
|
46518
46497
|
);
|
|
46519
46498
|
try {
|
|
46520
|
-
if (/^https?:\/\//i.test(
|
|
46499
|
+
if (/^https?:\/\//i.test(path4)) {
|
|
46521
46500
|
return {
|
|
46522
46501
|
success: false,
|
|
46523
46502
|
error: "Absolute URLs are not allowed. Pass a Firebase path such as /topstories.json."
|
|
46524
46503
|
};
|
|
46525
46504
|
}
|
|
46526
46505
|
const url = new URL(
|
|
46527
|
-
`${BASE_URL68}${
|
|
46506
|
+
`${BASE_URL68}${path4.startsWith("/") ? "" : "/"}${path4}`
|
|
46528
46507
|
);
|
|
46529
46508
|
if (printPretty) url.searchParams.set("print", "pretty");
|
|
46530
46509
|
const controller = new AbortController();
|
|
@@ -46611,7 +46590,7 @@ Avoid frequent repeated Algolia searches from dashboards. Keep hitsPerPage small
|
|
|
46611
46590
|
`[connector-request] hackernews/${connection.name}: Algolia ${endpoint}`
|
|
46612
46591
|
);
|
|
46613
46592
|
try {
|
|
46614
|
-
let
|
|
46593
|
+
let path4 = `/${endpoint}`;
|
|
46615
46594
|
if (endpoint === "items" || endpoint === "users") {
|
|
46616
46595
|
if (!idOrUsername) {
|
|
46617
46596
|
return {
|
|
@@ -46619,9 +46598,9 @@ Avoid frequent repeated Algolia searches from dashboards. Keep hitsPerPage small
|
|
|
46619
46598
|
error: `idOrUsername is required for endpoint ${endpoint}`
|
|
46620
46599
|
};
|
|
46621
46600
|
}
|
|
46622
|
-
|
|
46601
|
+
path4 += `/${encodeURIComponent(idOrUsername)}`;
|
|
46623
46602
|
}
|
|
46624
|
-
const url = new URL(`${BASE_URL69}${
|
|
46603
|
+
const url = new URL(`${BASE_URL69}${path4}`);
|
|
46625
46604
|
if (queryParams) {
|
|
46626
46605
|
for (const [k, v] of Object.entries(queryParams)) {
|
|
46627
46606
|
url.searchParams.set(k, v);
|
|
@@ -46883,7 +46862,7 @@ Use this tool for all Slack API interactions: listing channels, reading channel
|
|
|
46883
46862
|
Pagination is cursor-based: pass 'cursor' from 'response_metadata.next_cursor' of the previous response. Message timestamps ('ts', 'oldest', 'latest') are Unix epoch seconds as strings.`,
|
|
46884
46863
|
inputSchema: inputSchema105,
|
|
46885
46864
|
outputSchema: outputSchema105,
|
|
46886
|
-
async execute({ connectionId, method, path:
|
|
46865
|
+
async execute({ connectionId, method, path: path4, body }, connections, config) {
|
|
46887
46866
|
const connection = connections.find((c) => c.id === connectionId);
|
|
46888
46867
|
if (!connection) {
|
|
46889
46868
|
return {
|
|
@@ -46892,10 +46871,10 @@ Pagination is cursor-based: pass 'cursor' from 'response_metadata.next_cursor' o
|
|
|
46892
46871
|
};
|
|
46893
46872
|
}
|
|
46894
46873
|
console.log(
|
|
46895
|
-
`[connector-request] slack/${connection.name}: ${method} ${
|
|
46874
|
+
`[connector-request] slack/${connection.name}: ${method} ${path4}`
|
|
46896
46875
|
);
|
|
46897
46876
|
try {
|
|
46898
|
-
const url = `${BASE_URL70}${
|
|
46877
|
+
const url = `${BASE_URL70}${path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
46899
46878
|
const token = await getProxyToken35(config.oauthProxy);
|
|
46900
46879
|
const proxyUrl = `https://${config.oauthProxy.sandboxId}.${config.oauthProxy.previewBaseDomain}/_sqcore/connections/${connectionId}/request`;
|
|
46901
46880
|
const controller = new AbortController();
|
|
@@ -47427,12 +47406,7 @@ function loadEnvFile(envPath) {
|
|
|
47427
47406
|
|
|
47428
47407
|
// src/cli/runner.ts
|
|
47429
47408
|
import { pathToFileURL } from "url";
|
|
47430
|
-
import { readFile as
|
|
47431
|
-
import path3 from "path";
|
|
47432
|
-
|
|
47433
|
-
// src/registry.ts
|
|
47434
|
-
import { readdir, readFile as readFile2, mkdir } from "fs/promises";
|
|
47435
|
-
import { watch as fsWatch2 } from "fs";
|
|
47409
|
+
import { readFile as readFile2, readdir } from "fs/promises";
|
|
47436
47410
|
import path2 from "path";
|
|
47437
47411
|
|
|
47438
47412
|
// src/types/server-logic.ts
|
|
@@ -47498,21 +47472,14 @@ var anyJsonServerLogicSchema = z106.union([
|
|
|
47498
47472
|
|
|
47499
47473
|
// src/registry.ts
|
|
47500
47474
|
function applyDefaults(parameterMeta, runtimeParams) {
|
|
47501
|
-
const defaults = new Map(
|
|
47502
|
-
parameterMeta.map((p) => [p.name, p.default ?? null])
|
|
47503
|
-
);
|
|
47475
|
+
const defaults = new Map(parameterMeta.map((p) => [p.name, p.default ?? null]));
|
|
47504
47476
|
const result = {};
|
|
47505
|
-
for (const [key, value] of Object.entries(runtimeParams))
|
|
47506
|
-
result[key] = value;
|
|
47507
|
-
}
|
|
47477
|
+
for (const [key, value] of Object.entries(runtimeParams)) result[key] = value;
|
|
47508
47478
|
for (const [key, defaultVal] of defaults) {
|
|
47509
|
-
if (!(key in result))
|
|
47510
|
-
result[key] = defaultVal;
|
|
47511
|
-
}
|
|
47479
|
+
if (!(key in result)) result[key] = defaultVal;
|
|
47512
47480
|
}
|
|
47513
47481
|
return result;
|
|
47514
47482
|
}
|
|
47515
|
-
var defaultServerLogicDir = path2.join(process.cwd(), "server-logic");
|
|
47516
47483
|
|
|
47517
47484
|
// src/cli/runner.ts
|
|
47518
47485
|
function createStubContext(params) {
|
|
@@ -47602,10 +47569,10 @@ async function runTypescriptServerLogic(slug, handlerPath, params) {
|
|
|
47602
47569
|
}
|
|
47603
47570
|
}
|
|
47604
47571
|
async function runServerLogic(slug, dirPath, params, limit) {
|
|
47605
|
-
const jsonPath =
|
|
47572
|
+
const jsonPath = path2.join(dirPath, `${slug}.json`);
|
|
47606
47573
|
let def;
|
|
47607
47574
|
try {
|
|
47608
|
-
const raw = await
|
|
47575
|
+
const raw = await readFile2(jsonPath, "utf-8");
|
|
47609
47576
|
const parsed = anyJsonServerLogicSchema.safeParse(JSON.parse(raw));
|
|
47610
47577
|
if (!parsed.success) {
|
|
47611
47578
|
return {
|
|
@@ -47627,14 +47594,14 @@ async function runServerLogic(slug, dirPath, params, limit) {
|
|
|
47627
47594
|
};
|
|
47628
47595
|
}
|
|
47629
47596
|
if (def.type === "typescript") {
|
|
47630
|
-
const absolutePath =
|
|
47597
|
+
const absolutePath = path2.resolve(dirPath, def.handlerPath);
|
|
47631
47598
|
return runTypescriptServerLogic(slug, absolutePath, params);
|
|
47632
47599
|
}
|
|
47633
47600
|
return runSqlServerLogic(slug, def, params, limit);
|
|
47634
47601
|
}
|
|
47635
47602
|
async function listSlugs(dirPath) {
|
|
47636
47603
|
try {
|
|
47637
|
-
const files = await
|
|
47604
|
+
const files = await readdir(dirPath);
|
|
47638
47605
|
return files.filter((f) => f.endsWith(".json")).map((f) => f.replace(/\.json$/, ""));
|
|
47639
47606
|
} catch {
|
|
47640
47607
|
return [];
|
|
@@ -47764,8 +47731,8 @@ async function main() {
|
|
|
47764
47731
|
process.exit(0);
|
|
47765
47732
|
}
|
|
47766
47733
|
const cwd = process.cwd();
|
|
47767
|
-
const dirPath = values.dir ?
|
|
47768
|
-
const envPath = values.env ?
|
|
47734
|
+
const dirPath = values.dir ? path3.resolve(cwd, values.dir) : path3.join(cwd, "server-logic");
|
|
47735
|
+
const envPath = values.env ? path3.resolve(cwd, values.env) : path3.join(cwd, "../../.env");
|
|
47769
47736
|
const limit = parseInt(values.limit ?? "50", 10);
|
|
47770
47737
|
const format = values.format ?? "table";
|
|
47771
47738
|
loadEnvFile(envPath);
|
|
@@ -47818,10 +47785,10 @@ Total: ${results.length}, Failed: ${failed}`);
|
|
|
47818
47785
|
console.log("Cancelled.");
|
|
47819
47786
|
process.exit(0);
|
|
47820
47787
|
}
|
|
47821
|
-
const jsonPath =
|
|
47788
|
+
const jsonPath = path3.join(dirPath, `${slug}.json`);
|
|
47822
47789
|
let paramMeta = [];
|
|
47823
47790
|
try {
|
|
47824
|
-
const raw = await
|
|
47791
|
+
const raw = await readFile3(jsonPath, "utf-8");
|
|
47825
47792
|
const parsed = anyJsonServerLogicSchema.safeParse(JSON.parse(raw));
|
|
47826
47793
|
if (parsed.success) paramMeta = parsed.data.parameters ?? [];
|
|
47827
47794
|
} catch {
|