@squadbase/vite-server 0.1.12-dev.8860f37 → 0.1.12-dev.a9ac647
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +139 -527
- package/dist/connectors/outlook-oauth.js +1 -1
- package/dist/connectors/powerbi-oauth.js +2 -2
- package/dist/connectors/tableau.js +2 -2
- package/dist/index.js +139 -527
- package/dist/main.js +139 -527
- package/dist/vite-plugin.js +139 -527
- package/package.json +1 -5
- package/dist/connectors/powerbi.d.ts +0 -5
- package/dist/connectors/powerbi.js +0 -869
package/dist/cli/index.js
CHANGED
|
@@ -27625,399 +27625,12 @@ export default async function handler(c: Context) {
|
|
|
27625
27625
|
tools: tools79
|
|
27626
27626
|
});
|
|
27627
27627
|
|
|
27628
|
-
// ../connectors/src/connectors/powerbi/
|
|
27629
|
-
var powerbiOnboarding = new ConnectorOnboarding({
|
|
27630
|
-
connectionSetupInstructions: {
|
|
27631
|
-
en: `Follow these steps to verify the Power BI Service Principal connection.
|
|
27632
|
-
|
|
27633
|
-
1. Call \`powerbi_request\` with \`method: "GET"\` and \`path: "/groups"\` to list workspaces the Service Principal can access
|
|
27634
|
-
2. If the response is an empty \`value\` array, ask the user to add the Service Principal as Member/Admin to at least one workspace (Power BI Service > Workspace > Access). The 'Allow service principals to use Power BI APIs' tenant setting must also be enabled
|
|
27635
|
-
|
|
27636
|
-
#### Constraints
|
|
27637
|
-
- **Do NOT execute DAX queries or refresh datasets during setup**. Only the workspace listing above is allowed
|
|
27638
|
-
- Service Principals cannot access "My workspace" \u2014 always work through workspace (group) IDs`,
|
|
27639
|
-
ja: `Power BI Service Principal \u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u306F\u4EE5\u4E0B\u306E\u624B\u9806\u3067\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002
|
|
27640
|
-
|
|
27641
|
-
1. \`powerbi_request\` \u3092 \`method: "GET"\`\u3001\`path: "/groups"\` \u3067\u547C\u3073\u51FA\u3057\u3001Service Principal \u304C\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u4E00\u89A7\u3092\u53D6\u5F97\u3059\u308B
|
|
27642
|
-
2. \`value\` \u304C\u7A7A\u914D\u5217\u3067\u8FD4\u3063\u3066\u304D\u305F\u5834\u5408\u306F\u3001Power BI Service > \u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9 > \u30A2\u30AF\u30BB\u30B9 \u304B\u3089\u8A72\u5F53\u306E Service Principal \u3092 Member/Admin \u3068\u3057\u3066\u8FFD\u52A0\u3059\u308B\u3088\u3046\u30E6\u30FC\u30B6\u30FC\u306B\u4F1D\u3048\u308B\u3002\u30C6\u30CA\u30F3\u30C8\u7BA1\u7406\u8A2D\u5B9A\u3067\u300C\u30B5\u30FC\u30D3\u30B9 \u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306B Power BI API \u306E\u4F7F\u7528\u3092\u8A31\u53EF\u3059\u308B\u300D\u3082\u6709\u52B9\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308B
|
|
27643
|
-
|
|
27644
|
-
#### \u5236\u7D04
|
|
27645
|
-
- **\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u4E2D\u306B DAX \u30AF\u30A8\u30EA\u306E\u5B9F\u884C\u3084\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306E\u66F4\u65B0\u3092\u884C\u308F\u306A\u3044\u3053\u3068**\u3002\u4E0A\u8A18\u306E\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u4E00\u89A7\u53D6\u5F97\u306E\u307F\u8A31\u53EF
|
|
27646
|
-
- Service Principal \u306F\u300C\u30DE\u30A4 \u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u300D\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u306A\u3044 \u2014 \u5FC5\u305A\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9 (group) ID \u7D4C\u7531\u3067\u64CD\u4F5C\u3059\u308B\u3053\u3068`
|
|
27647
|
-
},
|
|
27648
|
-
dataOverviewInstructions: {
|
|
27649
|
-
en: `1. Call powerbi_request with GET /groups to list accessible workspaces
|
|
27650
|
-
2. For a target workspace, call powerbi_request with GET /groups/{groupId}/datasets to list datasets
|
|
27651
|
-
3. Call powerbi_request with GET /groups/{groupId}/reports to list reports
|
|
27652
|
-
4. For each interesting dataset call powerbi_request with GET /groups/{groupId}/datasets/{datasetId}/tables to inspect tables (requires the dataset to allow XMLA / metadata reads)`,
|
|
27653
|
-
ja: `1. powerbi_request \u3067 GET /groups \u3092\u547C\u3073\u51FA\u3057\u3001\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u4E00\u89A7\u3092\u53D6\u5F97
|
|
27654
|
-
2. \u5BFE\u8C61\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u306B\u5BFE\u3057\u3066 powerbi_request \u3067 GET /groups/{groupId}/datasets \u3092\u547C\u3073\u51FA\u3057\u3001\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u4E00\u89A7\u3092\u53D6\u5F97
|
|
27655
|
-
3. powerbi_request \u3067 GET /groups/{groupId}/reports \u3092\u547C\u3073\u51FA\u3057\u3001\u30EC\u30DD\u30FC\u30C8\u4E00\u89A7\u3092\u53D6\u5F97
|
|
27656
|
-
4. \u8208\u5473\u306E\u3042\u308B\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306B\u3064\u3044\u3066 powerbi_request \u3067 GET /groups/{groupId}/datasets/{datasetId}/tables \u3092\u547C\u3073\u51FA\u3057\u3001\u30C6\u30FC\u30D6\u30EB\u69CB\u9020\u3092\u78BA\u8A8D\uFF08XMLA / \u30E1\u30BF\u30C7\u30FC\u30BF\u8AAD\u307F\u53D6\u308A\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u308B\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306B\u9650\u308B\uFF09`
|
|
27657
|
-
}
|
|
27658
|
-
});
|
|
27659
|
-
|
|
27660
|
-
// ../connectors/src/connectors/powerbi/parameters.ts
|
|
27661
|
-
var parameters80 = {
|
|
27662
|
-
tenantId: new ParameterDefinition({
|
|
27663
|
-
slug: "tenant-id",
|
|
27664
|
-
name: "Azure Tenant ID",
|
|
27665
|
-
description: "The Microsoft Entra ID (Azure AD) tenant ID that owns the Service Principal. Found in Azure Portal > Microsoft Entra ID > Overview > Tenant ID.",
|
|
27666
|
-
envVarBaseKey: "POWERBI_TENANT_ID",
|
|
27667
|
-
type: "text",
|
|
27668
|
-
secret: false,
|
|
27669
|
-
required: true
|
|
27670
|
-
}),
|
|
27671
|
-
clientId: new ParameterDefinition({
|
|
27672
|
-
slug: "client-id",
|
|
27673
|
-
name: "Application (Client) ID",
|
|
27674
|
-
description: "The Application (client) ID of the Microsoft Entra app registration used as the Power BI Service Principal. Found in Azure Portal > App registrations > Overview.",
|
|
27675
|
-
envVarBaseKey: "POWERBI_CLIENT_ID",
|
|
27676
|
-
type: "text",
|
|
27677
|
-
secret: false,
|
|
27678
|
-
required: true
|
|
27679
|
-
}),
|
|
27680
|
-
clientSecret: new ParameterDefinition({
|
|
27681
|
-
slug: "client-secret",
|
|
27682
|
-
name: "Client Secret",
|
|
27683
|
-
description: "A client secret value for the app registration. Generated under App registrations > Certificates & secrets > Client secrets. The Service Principal must be granted Power BI tenant access (via 'Allow service principals to use Power BI APIs' admin setting) and added to each workspace as a Member/Admin.",
|
|
27684
|
-
envVarBaseKey: "POWERBI_CLIENT_SECRET",
|
|
27685
|
-
type: "text",
|
|
27686
|
-
secret: true,
|
|
27687
|
-
required: true
|
|
27688
|
-
})
|
|
27689
|
-
};
|
|
27690
|
-
|
|
27691
|
-
// ../connectors/src/connectors/powerbi/tools/request.ts
|
|
27628
|
+
// ../connectors/src/connectors/powerbi-oauth/tools/request.ts
|
|
27692
27629
|
import { z as z97 } from "zod";
|
|
27693
27630
|
var BASE_HOST12 = "https://api.powerbi.com";
|
|
27694
27631
|
var BASE_PATH_SEGMENT15 = "/v1.0/myorg";
|
|
27695
27632
|
var BASE_URL41 = `${BASE_HOST12}${BASE_PATH_SEGMENT15}`;
|
|
27696
|
-
var TOKEN_SCOPE = "https://analysis.windows.net/powerbi/api/.default";
|
|
27697
27633
|
var REQUEST_TIMEOUT_MS74 = 6e4;
|
|
27698
|
-
var tokenCache = /* @__PURE__ */ new Map();
|
|
27699
|
-
async function getAccessToken(tenantId, clientId, clientSecret) {
|
|
27700
|
-
const cacheKey = `${tenantId}:${clientId}`;
|
|
27701
|
-
const cached = tokenCache.get(cacheKey);
|
|
27702
|
-
if (cached && cached.expiresAt > Date.now() + 6e4) {
|
|
27703
|
-
return cached.token;
|
|
27704
|
-
}
|
|
27705
|
-
const tokenUrl = `https://login.microsoftonline.com/${encodeURIComponent(tenantId)}/oauth2/v2.0/token`;
|
|
27706
|
-
const body = new URLSearchParams({
|
|
27707
|
-
grant_type: "client_credentials",
|
|
27708
|
-
client_id: clientId,
|
|
27709
|
-
client_secret: clientSecret,
|
|
27710
|
-
scope: TOKEN_SCOPE
|
|
27711
|
-
});
|
|
27712
|
-
const res = await fetch(tokenUrl, {
|
|
27713
|
-
method: "POST",
|
|
27714
|
-
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
27715
|
-
body: body.toString()
|
|
27716
|
-
});
|
|
27717
|
-
if (!res.ok) {
|
|
27718
|
-
const errorText = await res.text().catch(() => res.statusText);
|
|
27719
|
-
throw new Error(
|
|
27720
|
-
`Power BI token request failed: HTTP ${res.status} ${errorText}`
|
|
27721
|
-
);
|
|
27722
|
-
}
|
|
27723
|
-
const data = await res.json();
|
|
27724
|
-
tokenCache.set(cacheKey, {
|
|
27725
|
-
token: data.access_token,
|
|
27726
|
-
expiresAt: Date.now() + data.expires_in * 1e3
|
|
27727
|
-
});
|
|
27728
|
-
return data.access_token;
|
|
27729
|
-
}
|
|
27730
|
-
var inputSchema97 = z97.object({
|
|
27731
|
-
toolUseIntent: z97.string().optional().describe(
|
|
27732
|
-
"Brief description of what you intend to accomplish with this tool call"
|
|
27733
|
-
),
|
|
27734
|
-
connectionId: z97.string().describe("ID of the Power BI connection to use"),
|
|
27735
|
-
method: z97.enum(["GET", "POST", "PATCH", "PUT", "DELETE"]).describe(
|
|
27736
|
-
"HTTP method. Use GET for reading workspaces/datasets/reports, POST for execute queries / refresh, PATCH/PUT for updates, DELETE for removal."
|
|
27737
|
-
),
|
|
27738
|
-
path: z97.string().describe(
|
|
27739
|
-
"API path appended to https://api.powerbi.com/v1.0/myorg (e.g., '/groups', '/groups/{groupId}/datasets', '/groups/{groupId}/reports/{reportId}'). Service Principal cannot access 'My workspace' \u2014 always work through workspace (group) IDs."
|
|
27740
|
-
),
|
|
27741
|
-
queryParams: z97.record(z97.string(), z97.string()).optional().describe(
|
|
27742
|
-
`Query parameters to append to the URL (e.g., { $top: '50', $filter: "name eq 'Sales'" }). OData operators ($filter, $top, $skip, $expand) are supported on many list endpoints.`
|
|
27743
|
-
),
|
|
27744
|
-
body: z97.record(z97.string(), z97.unknown()).optional().describe(
|
|
27745
|
-
"JSON request body for POST/PATCH/PUT/DELETE. Example: executeQueries body { queries: [{ query: 'EVALUATE TOPN(10, Sales)' }], serializerSettings: { includeNulls: true } }."
|
|
27746
|
-
)
|
|
27747
|
-
});
|
|
27748
|
-
var outputSchema97 = z97.discriminatedUnion("success", [
|
|
27749
|
-
z97.object({
|
|
27750
|
-
success: z97.literal(true),
|
|
27751
|
-
status: z97.number(),
|
|
27752
|
-
data: z97.unknown()
|
|
27753
|
-
}),
|
|
27754
|
-
z97.object({
|
|
27755
|
-
success: z97.literal(false),
|
|
27756
|
-
error: z97.string()
|
|
27757
|
-
})
|
|
27758
|
-
]);
|
|
27759
|
-
var requestTool56 = new ConnectorTool({
|
|
27760
|
-
name: "request",
|
|
27761
|
-
description: `Send authenticated requests to the Power BI REST API v1.0.
|
|
27762
|
-
Authentication uses a Microsoft Entra Service Principal (client_credentials) \u2014 the token is acquired and cached automatically.
|
|
27763
|
-
All paths are relative to https://api.powerbi.com/v1.0/myorg. Service Principals cannot access 'My workspace'; always operate on workspaces ('groups') the SP has been added to.
|
|
27764
|
-
Use the executeQueries endpoint (POST /groups/{groupId}/datasets/{datasetId}/executeQueries) to run DAX against a dataset.`,
|
|
27765
|
-
inputSchema: inputSchema97,
|
|
27766
|
-
outputSchema: outputSchema97,
|
|
27767
|
-
async execute({ connectionId, method, path: path5, queryParams, body }, connections) {
|
|
27768
|
-
const connection = connections.find((c) => c.id === connectionId);
|
|
27769
|
-
if (!connection) {
|
|
27770
|
-
return {
|
|
27771
|
-
success: false,
|
|
27772
|
-
error: `Connection ${connectionId} not found`
|
|
27773
|
-
};
|
|
27774
|
-
}
|
|
27775
|
-
console.log(
|
|
27776
|
-
`[connector-request] powerbi/${connection.name}: ${method} ${path5}`
|
|
27777
|
-
);
|
|
27778
|
-
try {
|
|
27779
|
-
const tenantId = parameters80.tenantId.getValue(connection);
|
|
27780
|
-
const clientId = parameters80.clientId.getValue(connection);
|
|
27781
|
-
const clientSecret = parameters80.clientSecret.getValue(connection);
|
|
27782
|
-
const normalizedPath = normalizeRequestPath(path5, BASE_PATH_SEGMENT15);
|
|
27783
|
-
let url = `${BASE_URL41}${normalizedPath}`;
|
|
27784
|
-
if (queryParams) {
|
|
27785
|
-
const searchParams = new URLSearchParams(queryParams);
|
|
27786
|
-
url += `?${searchParams.toString()}`;
|
|
27787
|
-
}
|
|
27788
|
-
const token = await getAccessToken(tenantId, clientId, clientSecret);
|
|
27789
|
-
const controller = new AbortController();
|
|
27790
|
-
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS74);
|
|
27791
|
-
try {
|
|
27792
|
-
const init = {
|
|
27793
|
-
method,
|
|
27794
|
-
headers: {
|
|
27795
|
-
Authorization: `Bearer ${token}`,
|
|
27796
|
-
"Content-Type": "application/json",
|
|
27797
|
-
Accept: "application/json"
|
|
27798
|
-
},
|
|
27799
|
-
signal: controller.signal
|
|
27800
|
-
};
|
|
27801
|
-
if (body !== void 0) {
|
|
27802
|
-
init.body = JSON.stringify(body);
|
|
27803
|
-
}
|
|
27804
|
-
const response = await fetch(url, init);
|
|
27805
|
-
const text = await response.text();
|
|
27806
|
-
const data = text ? (() => {
|
|
27807
|
-
try {
|
|
27808
|
-
return JSON.parse(text);
|
|
27809
|
-
} catch {
|
|
27810
|
-
return text;
|
|
27811
|
-
}
|
|
27812
|
-
})() : null;
|
|
27813
|
-
if (!response.ok) {
|
|
27814
|
-
const errorMessage = data && typeof data === "object" && "error" in data ? JSON.stringify(data.error) : typeof data === "string" && data ? data : `HTTP ${response.status} ${response.statusText}`;
|
|
27815
|
-
return { success: false, error: errorMessage };
|
|
27816
|
-
}
|
|
27817
|
-
return { success: true, status: response.status, data };
|
|
27818
|
-
} finally {
|
|
27819
|
-
clearTimeout(timeout);
|
|
27820
|
-
}
|
|
27821
|
-
} catch (err) {
|
|
27822
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
27823
|
-
return { success: false, error: msg };
|
|
27824
|
-
}
|
|
27825
|
-
}
|
|
27826
|
-
});
|
|
27827
|
-
|
|
27828
|
-
// ../connectors/src/connectors/powerbi/index.ts
|
|
27829
|
-
var tools80 = { request: requestTool56 };
|
|
27830
|
-
var powerbiConnector = new ConnectorPlugin({
|
|
27831
|
-
slug: "powerbi",
|
|
27832
|
-
authType: AUTH_TYPES.API_KEY,
|
|
27833
|
-
name: "Power BI",
|
|
27834
|
-
description: "Connect to Microsoft Power BI via a Service Principal (Microsoft Entra ID app + tenant ID / client ID / client secret). Use it to enumerate workspaces, datasets, and reports, and to run DAX queries.",
|
|
27835
|
-
iconUrl: "https://upload.wikimedia.org/wikipedia/commons/c/cf/New_Power_BI_Logo.svg",
|
|
27836
|
-
parameters: parameters80,
|
|
27837
|
-
releaseFlag: { dev1: true, dev2: false, prod: false },
|
|
27838
|
-
categories: ["other"],
|
|
27839
|
-
onboarding: powerbiOnboarding,
|
|
27840
|
-
systemPrompt: {
|
|
27841
|
-
en: `### Tools
|
|
27842
|
-
|
|
27843
|
-
- \`powerbi_request\`: The only way to call the Power BI REST API v1.0. Use it to list workspaces (\`/groups\`), datasets, reports, dashboards, and to run DAX via the \`executeQueries\` endpoint. Service Principal authentication (\`client_credentials\`) is handled automatically and the bearer token is cached.
|
|
27844
|
-
|
|
27845
|
-
### Business Logic
|
|
27846
|
-
|
|
27847
|
-
The business logic type for this connector is "typescript". Use the connector SDK in your handler. Do NOT read credentials from environment variables.
|
|
27848
|
-
|
|
27849
|
-
SDK methods (client created via \`connection(connectionId)\`):
|
|
27850
|
-
- \`client.request(path, init?)\` \u2014 low-level authenticated fetch (path appended to \`https://api.powerbi.com/v1.0/myorg\`)
|
|
27851
|
-
- \`client.listGroups(options?)\` \u2014 list workspaces (\`$top\`, \`$skip\`, \`$filter\`)
|
|
27852
|
-
- \`client.listDatasets(groupId)\` / \`client.listReports(groupId)\` \u2014 list datasets / reports in a workspace
|
|
27853
|
-
- \`client.getDataset(groupId, datasetId)\` \u2014 fetch a single dataset
|
|
27854
|
-
- \`client.executeQueries(groupId, datasetId, queries, options?)\` \u2014 run DAX queries against a dataset
|
|
27855
|
-
- \`client.refreshDataset(groupId, datasetId, options?)\` \u2014 trigger an async refresh
|
|
27856
|
-
|
|
27857
|
-
\`\`\`ts
|
|
27858
|
-
import type { Context } from "hono";
|
|
27859
|
-
import { connection } from "@squadbase/vite-server/connectors/powerbi";
|
|
27860
|
-
|
|
27861
|
-
const powerbi = connection("<connectionId>");
|
|
27862
|
-
|
|
27863
|
-
export default async function handler(c: Context) {
|
|
27864
|
-
const { groupId, datasetId, dax } = await c.req.json<{
|
|
27865
|
-
groupId: string;
|
|
27866
|
-
datasetId: string;
|
|
27867
|
-
dax: string;
|
|
27868
|
-
}>();
|
|
27869
|
-
|
|
27870
|
-
const result = await powerbi.executeQueries(groupId, datasetId, [dax]);
|
|
27871
|
-
const rows = result.results[0]?.tables[0]?.rows ?? [];
|
|
27872
|
-
return c.json({ rows });
|
|
27873
|
-
}
|
|
27874
|
-
\`\`\`
|
|
27875
|
-
|
|
27876
|
-
### Power BI REST API Reference
|
|
27877
|
-
|
|
27878
|
-
- Base URL: \`https://api.powerbi.com/v1.0/myorg\`
|
|
27879
|
-
- Authentication: Microsoft Entra Service Principal via OAuth2 \`client_credentials\` grant against \`https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token\` with scope \`https://analysis.windows.net/powerbi/api/.default\` (handled automatically)
|
|
27880
|
-
- Service Principals cannot access "My workspace"; the SP must be added as Member/Admin to each workspace
|
|
27881
|
-
- The tenant admin must enable "Allow service principals to use Power BI APIs" in the Power BI admin portal
|
|
27882
|
-
|
|
27883
|
-
#### Common Endpoints
|
|
27884
|
-
- GET \`/groups\` \u2014 List workspaces accessible to the Service Principal
|
|
27885
|
-
- GET \`/groups/{groupId}/datasets\` \u2014 List datasets in a workspace
|
|
27886
|
-
- GET \`/groups/{groupId}/datasets/{datasetId}\` \u2014 Get dataset metadata
|
|
27887
|
-
- GET \`/groups/{groupId}/datasets/{datasetId}/tables\` \u2014 List tables (requires XMLA / metadata reads enabled)
|
|
27888
|
-
- GET \`/groups/{groupId}/reports\` \u2014 List reports
|
|
27889
|
-
- GET \`/groups/{groupId}/dashboards\` \u2014 List dashboards
|
|
27890
|
-
- POST \`/groups/{groupId}/datasets/{datasetId}/executeQueries\` \u2014 Run DAX (body: \`{ queries: [{ query: "EVALUATE ..." }], serializerSettings: { includeNulls: true } }\`)
|
|
27891
|
-
- POST \`/groups/{groupId}/datasets/{datasetId}/refreshes\` \u2014 Trigger a dataset refresh
|
|
27892
|
-
- GET \`/groups/{groupId}/datasets/{datasetId}/refreshes\` \u2014 List recent refresh history
|
|
27893
|
-
|
|
27894
|
-
#### DAX Tips
|
|
27895
|
-
- \`EVALUATE TOPN(10, 'TableName')\` \u2014 sample 10 rows from a table
|
|
27896
|
-
- \`EVALUATE SUMMARIZECOLUMNS('Date'[Year], "Sales", SUM('Sales'[Amount]))\` \u2014 aggregate
|
|
27897
|
-
- Each \`executeQueries\` call accepts one query in the \`queries\` array (per current Power BI API limits); large result sets are truncated server-side (100k rows max)`,
|
|
27898
|
-
ja: `### \u30C4\u30FC\u30EB
|
|
27899
|
-
|
|
27900
|
-
- \`powerbi_request\`: Power BI REST API v1.0 \u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9 (\`/groups\`)\u3001\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3001\u30EC\u30DD\u30FC\u30C8\u3001\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u306E\u4E00\u89A7\u53D6\u5F97\u3084\u3001\`executeQueries\` \u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\u306B\u3088\u308B DAX \u306E\u5B9F\u884C\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002Service Principal \u8A8D\u8A3C (\`client_credentials\`) \u306F\u81EA\u52D5\u3067\u51E6\u7406\u3055\u308C\u3001Bearer \u30C8\u30FC\u30AF\u30F3\u306F\u30AD\u30E3\u30C3\u30B7\u30E5\u3055\u308C\u307E\u3059\u3002
|
|
27901
|
-
|
|
27902
|
-
### Business Logic
|
|
27903
|
-
|
|
27904
|
-
\u3053\u306E\u30B3\u30CD\u30AF\u30BF\u306E\u30D3\u30B8\u30CD\u30B9\u30ED\u30B8\u30C3\u30AF\u30BF\u30A4\u30D7\u306F "typescript" \u3067\u3059\u3002\u30CF\u30F3\u30C9\u30E9\u5185\u3067\u306F\u30B3\u30CD\u30AF\u30BF SDK \u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u74B0\u5883\u5909\u6570\u304B\u3089\u8A8D\u8A3C\u60C5\u5831\u3092\u8AAD\u307F\u53D6\u3089\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002
|
|
27905
|
-
|
|
27906
|
-
SDK\u30E1\u30BD\u30C3\u30C9 (\`connection(connectionId)\` \u3067\u4F5C\u6210\u3057\u305F\u30AF\u30E9\u30A4\u30A2\u30F3\u30C8):
|
|
27907
|
-
- \`client.request(path, init?)\` \u2014 \u4F4E\u30EC\u30D9\u30EB\u8A8D\u8A3C\u4ED8\u304D fetch (path \u306F \`https://api.powerbi.com/v1.0/myorg\` \u306B\u8FFD\u52A0\u3055\u308C\u307E\u3059)
|
|
27908
|
-
- \`client.listGroups(options?)\` \u2014 \u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u4E00\u89A7 (\`$top\`, \`$skip\`, \`$filter\`)
|
|
27909
|
-
- \`client.listDatasets(groupId)\` / \`client.listReports(groupId)\` \u2014 \u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u5185\u306E\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8/\u30EC\u30DD\u30FC\u30C8\u4E00\u89A7
|
|
27910
|
-
- \`client.getDataset(groupId, datasetId)\` \u2014 \u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u5358\u4F53\u53D6\u5F97
|
|
27911
|
-
- \`client.executeQueries(groupId, datasetId, queries, options?)\` \u2014 DAX \u30AF\u30A8\u30EA\u5B9F\u884C
|
|
27912
|
-
- \`client.refreshDataset(groupId, datasetId, options?)\` \u2014 \u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u66F4\u65B0\u3092\u975E\u540C\u671F\u30C8\u30EA\u30AC\u30FC
|
|
27913
|
-
|
|
27914
|
-
\`\`\`ts
|
|
27915
|
-
import type { Context } from "hono";
|
|
27916
|
-
import { connection } from "@squadbase/vite-server/connectors/powerbi";
|
|
27917
|
-
|
|
27918
|
-
const powerbi = connection("<connectionId>");
|
|
27919
|
-
|
|
27920
|
-
export default async function handler(c: Context) {
|
|
27921
|
-
const { groupId, datasetId, dax } = await c.req.json<{
|
|
27922
|
-
groupId: string;
|
|
27923
|
-
datasetId: string;
|
|
27924
|
-
dax: string;
|
|
27925
|
-
}>();
|
|
27926
|
-
|
|
27927
|
-
const result = await powerbi.executeQueries(groupId, datasetId, [dax]);
|
|
27928
|
-
const rows = result.results[0]?.tables[0]?.rows ?? [];
|
|
27929
|
-
return c.json({ rows });
|
|
27930
|
-
}
|
|
27931
|
-
\`\`\`
|
|
27932
|
-
|
|
27933
|
-
### Power BI REST API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
|
|
27934
|
-
|
|
27935
|
-
- \u30D9\u30FC\u30B9 URL: \`https://api.powerbi.com/v1.0/myorg\`
|
|
27936
|
-
- \u8A8D\u8A3C: Microsoft Entra Service Principal \u306B\u3088\u308B OAuth2 \`client_credentials\` \u30B0\u30E9\u30F3\u30C8\u3002\`https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token\` \u306B\u5BFE\u3057\u30B9\u30B3\u30FC\u30D7 \`https://analysis.windows.net/powerbi/api/.default\` \u3067\u30C8\u30FC\u30AF\u30F3\u53D6\u5F97 (\u81EA\u52D5)
|
|
27937
|
-
- Service Principal \u306F\u300C\u30DE\u30A4 \u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u300D\u306B\u30A2\u30AF\u30BB\u30B9\u4E0D\u53EF\u3002\u5404\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u306B Member/Admin \u3068\u3057\u3066\u8FFD\u52A0\u304C\u5FC5\u8981
|
|
27938
|
-
- \u30C6\u30CA\u30F3\u30C8\u7BA1\u7406\u8005\u304C Power BI \u7BA1\u7406\u30DD\u30FC\u30BF\u30EB\u3067\u300C\u30B5\u30FC\u30D3\u30B9 \u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306B Power BI API \u306E\u4F7F\u7528\u3092\u8A31\u53EF\u3059\u308B\u300D\u3092\u6709\u52B9\u306B\u3057\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
|
|
27939
|
-
|
|
27940
|
-
#### \u4E3B\u8981\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8
|
|
27941
|
-
- GET \`/groups\` \u2014 Service Principal \u304C\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u4E00\u89A7
|
|
27942
|
-
- GET \`/groups/{groupId}/datasets\` \u2014 \u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u5185\u306E\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u4E00\u89A7
|
|
27943
|
-
- GET \`/groups/{groupId}/datasets/{datasetId}\` \u2014 \u30C7\u30FC\u30BF\u30BB\u30C3\u30C8 \u30E1\u30BF\u30C7\u30FC\u30BF
|
|
27944
|
-
- GET \`/groups/{groupId}/datasets/{datasetId}/tables\` \u2014 \u30C6\u30FC\u30D6\u30EB\u4E00\u89A7 (XMLA / \u30E1\u30BF\u30C7\u30FC\u30BF\u8AAD\u307F\u53D6\u308A\u304C\u6709\u52B9\u3067\u3042\u308B\u5FC5\u8981\u3042\u308A)
|
|
27945
|
-
- GET \`/groups/{groupId}/reports\` \u2014 \u30EC\u30DD\u30FC\u30C8\u4E00\u89A7
|
|
27946
|
-
- GET \`/groups/{groupId}/dashboards\` \u2014 \u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u4E00\u89A7
|
|
27947
|
-
- POST \`/groups/{groupId}/datasets/{datasetId}/executeQueries\` \u2014 DAX \u5B9F\u884C (body: \`{ queries: [{ query: "EVALUATE ..." }], serializerSettings: { includeNulls: true } }\`)
|
|
27948
|
-
- POST \`/groups/{groupId}/datasets/{datasetId}/refreshes\` \u2014 \u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u66F4\u65B0\u30C8\u30EA\u30AC\u30FC
|
|
27949
|
-
- GET \`/groups/{groupId}/datasets/{datasetId}/refreshes\` \u2014 \u76F4\u8FD1\u306E\u66F4\u65B0\u5C65\u6B74
|
|
27950
|
-
|
|
27951
|
-
#### DAX Tips
|
|
27952
|
-
- \`EVALUATE TOPN(10, 'TableName')\` \u2014 \u30C6\u30FC\u30D6\u30EB\u304B\u3089 10 \u884C\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0
|
|
27953
|
-
- \`EVALUATE SUMMARIZECOLUMNS('Date'[Year], "Sales", SUM('Sales'[Amount]))\` \u2014 \u96C6\u8A08
|
|
27954
|
-
- \`executeQueries\` \u306F\u73FE\u72B6 1 \u30EA\u30AF\u30A8\u30B9\u30C8\u306B\u3064\u304D 1 \u30AF\u30A8\u30EA\u306E\u307F\u3002\u7D50\u679C\u306F\u6700\u5927 10 \u4E07\u884C\u307E\u3067\u30B5\u30FC\u30D0\u30FC\u5074\u3067\u5207\u308A\u8A70\u3081\u3089\u308C\u307E\u3059`
|
|
27955
|
-
},
|
|
27956
|
-
tools: tools80,
|
|
27957
|
-
async checkConnection(params) {
|
|
27958
|
-
const tenantId = params[parameters80.tenantId.slug];
|
|
27959
|
-
const clientId = params[parameters80.clientId.slug];
|
|
27960
|
-
const clientSecret = params[parameters80.clientSecret.slug];
|
|
27961
|
-
if (!tenantId || !clientId || !clientSecret) {
|
|
27962
|
-
return {
|
|
27963
|
-
success: false,
|
|
27964
|
-
error: "Missing required parameters: tenant-id, client-id, client-secret"
|
|
27965
|
-
};
|
|
27966
|
-
}
|
|
27967
|
-
try {
|
|
27968
|
-
const tokenUrl = `https://login.microsoftonline.com/${encodeURIComponent(tenantId)}/oauth2/v2.0/token`;
|
|
27969
|
-
const body = new URLSearchParams({
|
|
27970
|
-
grant_type: "client_credentials",
|
|
27971
|
-
client_id: clientId,
|
|
27972
|
-
client_secret: clientSecret,
|
|
27973
|
-
scope: "https://analysis.windows.net/powerbi/api/.default"
|
|
27974
|
-
});
|
|
27975
|
-
const tokenRes = await fetch(tokenUrl, {
|
|
27976
|
-
method: "POST",
|
|
27977
|
-
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
27978
|
-
body: body.toString()
|
|
27979
|
-
});
|
|
27980
|
-
if (!tokenRes.ok) {
|
|
27981
|
-
const errorText = await tokenRes.text().catch(() => tokenRes.statusText);
|
|
27982
|
-
return {
|
|
27983
|
-
success: false,
|
|
27984
|
-
error: `Power BI token request failed: HTTP ${tokenRes.status} ${errorText}`
|
|
27985
|
-
};
|
|
27986
|
-
}
|
|
27987
|
-
const { access_token } = await tokenRes.json();
|
|
27988
|
-
const apiRes = await fetch(
|
|
27989
|
-
"https://api.powerbi.com/v1.0/myorg/groups?$top=1",
|
|
27990
|
-
{
|
|
27991
|
-
method: "GET",
|
|
27992
|
-
headers: {
|
|
27993
|
-
Authorization: `Bearer ${access_token}`,
|
|
27994
|
-
Accept: "application/json"
|
|
27995
|
-
}
|
|
27996
|
-
}
|
|
27997
|
-
);
|
|
27998
|
-
if (!apiRes.ok) {
|
|
27999
|
-
const errorText = await apiRes.text().catch(() => apiRes.statusText);
|
|
28000
|
-
return {
|
|
28001
|
-
success: false,
|
|
28002
|
-
error: `Power BI API failed: HTTP ${apiRes.status} ${errorText}`
|
|
28003
|
-
};
|
|
28004
|
-
}
|
|
28005
|
-
return { success: true };
|
|
28006
|
-
} catch (error) {
|
|
28007
|
-
return {
|
|
28008
|
-
success: false,
|
|
28009
|
-
error: error instanceof Error ? error.message : String(error)
|
|
28010
|
-
};
|
|
28011
|
-
}
|
|
28012
|
-
}
|
|
28013
|
-
});
|
|
28014
|
-
|
|
28015
|
-
// ../connectors/src/connectors/powerbi-oauth/tools/request.ts
|
|
28016
|
-
import { z as z98 } from "zod";
|
|
28017
|
-
var BASE_HOST13 = "https://api.powerbi.com";
|
|
28018
|
-
var BASE_PATH_SEGMENT16 = "/v1.0/myorg";
|
|
28019
|
-
var BASE_URL42 = `${BASE_HOST13}${BASE_PATH_SEGMENT16}`;
|
|
28020
|
-
var REQUEST_TIMEOUT_MS75 = 6e4;
|
|
28021
27634
|
var cachedToken32 = null;
|
|
28022
27635
|
async function getProxyToken32(config) {
|
|
28023
27636
|
if (cachedToken32 && cachedToken32.expiresAt > Date.now() + 6e4) {
|
|
@@ -28049,42 +27662,42 @@ async function getProxyToken32(config) {
|
|
|
28049
27662
|
};
|
|
28050
27663
|
return data.token;
|
|
28051
27664
|
}
|
|
28052
|
-
var
|
|
28053
|
-
toolUseIntent:
|
|
27665
|
+
var inputSchema97 = z97.object({
|
|
27666
|
+
toolUseIntent: z97.string().optional().describe(
|
|
28054
27667
|
"Brief description of what you intend to accomplish with this tool call"
|
|
28055
27668
|
),
|
|
28056
|
-
connectionId:
|
|
28057
|
-
method:
|
|
27669
|
+
connectionId: z97.string().describe("ID of the Power BI OAuth connection to use"),
|
|
27670
|
+
method: z97.enum(["GET", "POST", "PATCH", "PUT", "DELETE"]).describe(
|
|
28058
27671
|
"HTTP method. GET for reading workspaces/datasets/reports, POST for executeQueries / refresh, PATCH/PUT for updates, DELETE for removal."
|
|
28059
27672
|
),
|
|
28060
|
-
path:
|
|
27673
|
+
path: z97.string().describe(
|
|
28061
27674
|
"API path appended to https://api.powerbi.com/v1.0/myorg (e.g., '/groups', '/groups/{groupId}/datasets'). The authenticated user must have access to the workspace."
|
|
28062
27675
|
),
|
|
28063
|
-
queryParams:
|
|
27676
|
+
queryParams: z97.record(z97.string(), z97.string()).optional().describe(
|
|
28064
27677
|
`Query parameters to append (e.g., { $top: '50', $filter: "name eq 'Sales'" }).`
|
|
28065
27678
|
),
|
|
28066
|
-
body:
|
|
27679
|
+
body: z97.record(z97.string(), z97.unknown()).optional().describe(
|
|
28067
27680
|
"JSON request body for POST/PATCH/PUT/DELETE. Example executeQueries body: { queries: [{ query: 'EVALUATE TOPN(10, Sales)' }], serializerSettings: { includeNulls: true } }."
|
|
28068
27681
|
)
|
|
28069
27682
|
});
|
|
28070
|
-
var
|
|
28071
|
-
|
|
28072
|
-
success:
|
|
28073
|
-
status:
|
|
28074
|
-
data:
|
|
27683
|
+
var outputSchema97 = z97.discriminatedUnion("success", [
|
|
27684
|
+
z97.object({
|
|
27685
|
+
success: z97.literal(true),
|
|
27686
|
+
status: z97.number(),
|
|
27687
|
+
data: z97.unknown()
|
|
28075
27688
|
}),
|
|
28076
|
-
|
|
28077
|
-
success:
|
|
28078
|
-
error:
|
|
27689
|
+
z97.object({
|
|
27690
|
+
success: z97.literal(false),
|
|
27691
|
+
error: z97.string()
|
|
28079
27692
|
})
|
|
28080
27693
|
]);
|
|
28081
|
-
var
|
|
27694
|
+
var requestTool56 = new ConnectorTool({
|
|
28082
27695
|
name: "request",
|
|
28083
27696
|
description: `Send authenticated requests to the Power BI REST API v1.0 using the user's Microsoft Entra OAuth token (proxied automatically).
|
|
28084
27697
|
All paths are relative to https://api.powerbi.com/v1.0/myorg. Use the executeQueries endpoint to run DAX against a dataset.
|
|
28085
27698
|
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.`,
|
|
28086
|
-
inputSchema:
|
|
28087
|
-
outputSchema:
|
|
27699
|
+
inputSchema: inputSchema97,
|
|
27700
|
+
outputSchema: outputSchema97,
|
|
28088
27701
|
async execute({ connectionId, method, path: path5, queryParams, body }, connections, config) {
|
|
28089
27702
|
const connection = connections.find((c) => c.id === connectionId);
|
|
28090
27703
|
if (!connection) {
|
|
@@ -28097,8 +27710,8 @@ The signed-in user must have access to the workspace; unlike Service Principals,
|
|
|
28097
27710
|
`[connector-request] powerbi-oauth/${connection.name}: ${method} ${path5}`
|
|
28098
27711
|
);
|
|
28099
27712
|
try {
|
|
28100
|
-
const normalizedPath = normalizeRequestPath(path5,
|
|
28101
|
-
let url = `${
|
|
27713
|
+
const normalizedPath = normalizeRequestPath(path5, BASE_PATH_SEGMENT15);
|
|
27714
|
+
let url = `${BASE_URL41}${normalizedPath}`;
|
|
28102
27715
|
if (queryParams) {
|
|
28103
27716
|
const searchParams = new URLSearchParams(queryParams);
|
|
28104
27717
|
url += `?${searchParams.toString()}`;
|
|
@@ -28106,7 +27719,7 @@ The signed-in user must have access to the workspace; unlike Service Principals,
|
|
|
28106
27719
|
const token = await getProxyToken32(config.oauthProxy);
|
|
28107
27720
|
const proxyUrl = `https://${config.oauthProxy.sandboxId}.${config.oauthProxy.previewBaseDomain}/_sqcore/connections/${connectionId}/request`;
|
|
28108
27721
|
const controller = new AbortController();
|
|
28109
|
-
const timeout = setTimeout(() => controller.abort(),
|
|
27722
|
+
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS74);
|
|
28110
27723
|
try {
|
|
28111
27724
|
const response = await fetch(proxyUrl, {
|
|
28112
27725
|
method: "POST",
|
|
@@ -28145,7 +27758,7 @@ The signed-in user must have access to the workspace; unlike Service Principals,
|
|
|
28145
27758
|
});
|
|
28146
27759
|
|
|
28147
27760
|
// ../connectors/src/connectors/powerbi-oauth/setup.ts
|
|
28148
|
-
var requestToolName13 = `powerbi-oauth_${
|
|
27761
|
+
var requestToolName13 = `powerbi-oauth_${requestTool56.name}`;
|
|
28149
27762
|
var powerbiOauthOnboarding = new ConnectorOnboarding({
|
|
28150
27763
|
connectionSetupInstructions: {
|
|
28151
27764
|
ja: `Power BI OAuth \u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u306F\u4EE5\u4E0B\u306E\u624B\u9806\u3067\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002
|
|
@@ -28178,19 +27791,19 @@ var powerbiOauthOnboarding = new ConnectorOnboarding({
|
|
|
28178
27791
|
});
|
|
28179
27792
|
|
|
28180
27793
|
// ../connectors/src/connectors/powerbi-oauth/parameters.ts
|
|
28181
|
-
var
|
|
27794
|
+
var parameters80 = {};
|
|
28182
27795
|
|
|
28183
27796
|
// ../connectors/src/connectors/powerbi-oauth/index.ts
|
|
28184
|
-
var
|
|
27797
|
+
var tools80 = { request: requestTool56 };
|
|
28185
27798
|
var powerbiOauthConnector = new ConnectorPlugin({
|
|
28186
27799
|
slug: "powerbi",
|
|
28187
27800
|
authType: AUTH_TYPES.OAUTH,
|
|
28188
27801
|
name: "Power BI",
|
|
28189
27802
|
description: "Connect to Microsoft Power BI using OAuth (Microsoft Entra ID). Use it to enumerate workspaces, datasets, and reports the signed-in user has access to, and to run DAX queries.",
|
|
28190
|
-
iconUrl: "https://
|
|
28191
|
-
parameters:
|
|
27803
|
+
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/2vXQCKGpMJ9kGSaqkZl9IS/cc5669c267fc5d11e7b1f8c01723e461/power-bi-icon.png",
|
|
27804
|
+
parameters: parameters80,
|
|
28192
27805
|
releaseFlag: { dev1: true, dev2: false, prod: false },
|
|
28193
|
-
categories: ["
|
|
27806
|
+
categories: ["bi"],
|
|
28194
27807
|
onboarding: powerbiOauthOnboarding,
|
|
28195
27808
|
proxyPolicy: {
|
|
28196
27809
|
allowlist: [
|
|
@@ -28314,7 +27927,7 @@ export default async function handler(c: Context) {
|
|
|
28314
27927
|
- \`EVALUATE SUMMARIZECOLUMNS('Date'[Year], "Sales", SUM('Sales'[Amount]))\` \u2014 \u96C6\u8A08
|
|
28315
27928
|
- \`executeQueries\` \u306F\u73FE\u72B6 1 \u30EA\u30AF\u30A8\u30B9\u30C8\u306B\u3064\u304D 1 \u30AF\u30A8\u30EA\u306E\u307F`
|
|
28316
27929
|
},
|
|
28317
|
-
tools:
|
|
27930
|
+
tools: tools80,
|
|
28318
27931
|
async checkConnection(_params, config) {
|
|
28319
27932
|
const { proxyFetch } = config;
|
|
28320
27933
|
const url = "https://api.powerbi.com/v1.0/myorg/groups?$top=1";
|
|
@@ -28370,7 +27983,7 @@ var tableauOnboarding = new ConnectorOnboarding({
|
|
|
28370
27983
|
});
|
|
28371
27984
|
|
|
28372
27985
|
// ../connectors/src/connectors/tableau/parameters.ts
|
|
28373
|
-
var
|
|
27986
|
+
var parameters81 = {
|
|
28374
27987
|
serverUrl: new ParameterDefinition({
|
|
28375
27988
|
slug: "server-url",
|
|
28376
27989
|
name: "Tableau Server URL",
|
|
@@ -28419,9 +28032,9 @@ var parameters82 = {
|
|
|
28419
28032
|
};
|
|
28420
28033
|
|
|
28421
28034
|
// ../connectors/src/connectors/tableau/tools/request.ts
|
|
28422
|
-
import { z as
|
|
28035
|
+
import { z as z98 } from "zod";
|
|
28423
28036
|
var DEFAULT_API_VERSION = "3.28";
|
|
28424
|
-
var
|
|
28037
|
+
var REQUEST_TIMEOUT_MS75 = 6e4;
|
|
28425
28038
|
var sessionCache = /* @__PURE__ */ new Map();
|
|
28426
28039
|
function buildBaseUrl4(serverUrl, apiVersion) {
|
|
28427
28040
|
return `${serverUrl.replace(/\/$/, "")}/api/${apiVersion}`;
|
|
@@ -28473,43 +28086,43 @@ async function getSession(serverUrl, apiVersion, siteContentUrl, patName, patSec
|
|
|
28473
28086
|
sessionCache.set(cacheKey, session);
|
|
28474
28087
|
return session;
|
|
28475
28088
|
}
|
|
28476
|
-
var
|
|
28477
|
-
toolUseIntent:
|
|
28089
|
+
var inputSchema98 = z98.object({
|
|
28090
|
+
toolUseIntent: z98.string().optional().describe(
|
|
28478
28091
|
"Brief description of what you intend to accomplish with this tool call"
|
|
28479
28092
|
),
|
|
28480
|
-
connectionId:
|
|
28481
|
-
method:
|
|
28093
|
+
connectionId: z98.string().describe("ID of the Tableau connection to use"),
|
|
28094
|
+
method: z98.enum(["GET", "POST", "PUT", "DELETE"]).describe(
|
|
28482
28095
|
"HTTP method. GET for listing/reading, POST for creating, PUT for updates, DELETE for removal."
|
|
28483
28096
|
),
|
|
28484
|
-
path:
|
|
28097
|
+
path: z98.string().describe(
|
|
28485
28098
|
"API path appended to {serverUrl}/api/{apiVersion} (e.g., '/sites/{siteId}/projects', '/sites/{siteId}/workbooks/{workbookId}', '/sites/{siteId}/views/{viewId}/data'). The {siteId} placeholder is automatically replaced with the signed-in site ID."
|
|
28486
28099
|
),
|
|
28487
|
-
queryParams:
|
|
28100
|
+
queryParams: z98.record(z98.string(), z98.string()).optional().describe(
|
|
28488
28101
|
"Query parameters to append (e.g., { pageSize: '100', filter: 'name:eq:Sales' }). Tableau supports field filtering via 'fields' and sorting via 'sort'."
|
|
28489
28102
|
),
|
|
28490
|
-
body:
|
|
28103
|
+
body: z98.record(z98.string(), z98.unknown()).optional().describe(
|
|
28491
28104
|
"JSON request body for POST/PUT (Tableau also accepts XML, but JSON is recommended with Accept: application/json)."
|
|
28492
28105
|
)
|
|
28493
28106
|
});
|
|
28494
|
-
var
|
|
28495
|
-
|
|
28496
|
-
success:
|
|
28497
|
-
status:
|
|
28498
|
-
data:
|
|
28107
|
+
var outputSchema98 = z98.discriminatedUnion("success", [
|
|
28108
|
+
z98.object({
|
|
28109
|
+
success: z98.literal(true),
|
|
28110
|
+
status: z98.number(),
|
|
28111
|
+
data: z98.unknown()
|
|
28499
28112
|
}),
|
|
28500
|
-
|
|
28501
|
-
success:
|
|
28502
|
-
error:
|
|
28113
|
+
z98.object({
|
|
28114
|
+
success: z98.literal(false),
|
|
28115
|
+
error: z98.string()
|
|
28503
28116
|
})
|
|
28504
28117
|
]);
|
|
28505
|
-
var
|
|
28118
|
+
var requestTool57 = new ConnectorTool({
|
|
28506
28119
|
name: "request",
|
|
28507
28120
|
description: `Send authenticated requests to the Tableau REST API.
|
|
28508
28121
|
The tool signs in once with the configured Personal Access Token (PAT) to obtain an X-Tableau-Auth token (cached per connection), then forwards the request with the token attached.
|
|
28509
28122
|
All paths are relative to {serverUrl}/api/{apiVersion}. Use the literal placeholder \`{siteId}\` in the path \u2014 it is automatically substituted with the site ID returned from sign-in.
|
|
28510
28123
|
Accept and Content-Type headers default to application/json so list responses come back as JSON instead of Tableau's default XML.`,
|
|
28511
|
-
inputSchema:
|
|
28512
|
-
outputSchema:
|
|
28124
|
+
inputSchema: inputSchema98,
|
|
28125
|
+
outputSchema: outputSchema98,
|
|
28513
28126
|
async execute({ connectionId, method, path: path5, queryParams, body }, connections) {
|
|
28514
28127
|
const connection = connections.find((c) => c.id === connectionId);
|
|
28515
28128
|
if (!connection) {
|
|
@@ -28522,11 +28135,11 @@ Accept and Content-Type headers default to application/json so list responses co
|
|
|
28522
28135
|
`[connector-request] tableau/${connection.name}: ${method} ${path5}`
|
|
28523
28136
|
);
|
|
28524
28137
|
try {
|
|
28525
|
-
const serverUrl =
|
|
28526
|
-
const siteContentUrl =
|
|
28527
|
-
const patName =
|
|
28528
|
-
const patSecret =
|
|
28529
|
-
const apiVersion =
|
|
28138
|
+
const serverUrl = parameters81.serverUrl.getValue(connection);
|
|
28139
|
+
const siteContentUrl = parameters81.siteContentUrl.getValue(connection);
|
|
28140
|
+
const patName = parameters81.patName.getValue(connection);
|
|
28141
|
+
const patSecret = parameters81.patSecret.getValue(connection);
|
|
28142
|
+
const apiVersion = parameters81.apiVersion.tryGetValue(connection) || DEFAULT_API_VERSION;
|
|
28530
28143
|
const session = await getSession(
|
|
28531
28144
|
serverUrl,
|
|
28532
28145
|
apiVersion,
|
|
@@ -28541,7 +28154,7 @@ Accept and Content-Type headers default to application/json so list responses co
|
|
|
28541
28154
|
url += `?${searchParams.toString()}`;
|
|
28542
28155
|
}
|
|
28543
28156
|
const controller = new AbortController();
|
|
28544
|
-
const timeout = setTimeout(() => controller.abort(),
|
|
28157
|
+
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS75);
|
|
28545
28158
|
try {
|
|
28546
28159
|
const init = {
|
|
28547
28160
|
method,
|
|
@@ -28580,16 +28193,16 @@ Accept and Content-Type headers default to application/json so list responses co
|
|
|
28580
28193
|
});
|
|
28581
28194
|
|
|
28582
28195
|
// ../connectors/src/connectors/tableau/index.ts
|
|
28583
|
-
var
|
|
28196
|
+
var tools81 = { request: requestTool57 };
|
|
28584
28197
|
var tableauConnector = new ConnectorPlugin({
|
|
28585
28198
|
slug: "tableau",
|
|
28586
28199
|
authType: AUTH_TYPES.PAT,
|
|
28587
28200
|
name: "Tableau",
|
|
28588
28201
|
description: "Connect to Tableau Cloud or Tableau Server via a Personal Access Token (PAT). Use it to enumerate projects, workbooks, views, and data sources, and to pull view data.",
|
|
28589
|
-
iconUrl: "https://
|
|
28590
|
-
parameters:
|
|
28202
|
+
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/3ejrZvfw7zCDa3FPbUNQx9/d810e117b3a86c45dd96205453bf67a0/tableau-icon.svg",
|
|
28203
|
+
parameters: parameters81,
|
|
28591
28204
|
releaseFlag: { dev1: true, dev2: false, prod: false },
|
|
28592
|
-
categories: ["
|
|
28205
|
+
categories: ["bi"],
|
|
28593
28206
|
onboarding: tableauOnboarding,
|
|
28594
28207
|
systemPrompt: {
|
|
28595
28208
|
en: `### Tools
|
|
@@ -28707,13 +28320,13 @@ export default async function handler(c: Context) {
|
|
|
28707
28320
|
- \`filter=updatedAt:gte:2024-01-01T00:00:00Z\` \u2014 \u6BD4\u8F03\u6F14\u7B97\u5B50 (gt/gte/lt/lte)
|
|
28708
28321
|
- \u7D44\u307F\u5408\u308F\u305B: \`filter=ownerName:eq:alice,tags:in:[finance]\``
|
|
28709
28322
|
},
|
|
28710
|
-
tools:
|
|
28323
|
+
tools: tools81,
|
|
28711
28324
|
async checkConnection(params) {
|
|
28712
|
-
const serverUrl = params[
|
|
28713
|
-
const siteContentUrl = params[
|
|
28714
|
-
const patName = params[
|
|
28715
|
-
const patSecret = params[
|
|
28716
|
-
const apiVersion = params[
|
|
28325
|
+
const serverUrl = params[parameters81.serverUrl.slug];
|
|
28326
|
+
const siteContentUrl = params[parameters81.siteContentUrl.slug];
|
|
28327
|
+
const patName = params[parameters81.patName.slug];
|
|
28328
|
+
const patSecret = params[parameters81.patSecret.slug];
|
|
28329
|
+
const apiVersion = params[parameters81.apiVersion.slug] || "3.28";
|
|
28717
28330
|
if (!serverUrl || siteContentUrl == null || !patName || !patSecret) {
|
|
28718
28331
|
return {
|
|
28719
28332
|
success: false,
|
|
@@ -28756,11 +28369,11 @@ export default async function handler(c: Context) {
|
|
|
28756
28369
|
});
|
|
28757
28370
|
|
|
28758
28371
|
// ../connectors/src/connectors/outlook-oauth/tools/request.ts
|
|
28759
|
-
import { z as
|
|
28760
|
-
var
|
|
28761
|
-
var
|
|
28762
|
-
var
|
|
28763
|
-
var
|
|
28372
|
+
import { z as z99 } from "zod";
|
|
28373
|
+
var BASE_HOST13 = "https://graph.microsoft.com";
|
|
28374
|
+
var BASE_PATH_SEGMENT16 = "/v1.0";
|
|
28375
|
+
var BASE_URL42 = `${BASE_HOST13}${BASE_PATH_SEGMENT16}`;
|
|
28376
|
+
var REQUEST_TIMEOUT_MS76 = 6e4;
|
|
28764
28377
|
var cachedToken33 = null;
|
|
28765
28378
|
async function getProxyToken33(config) {
|
|
28766
28379
|
if (cachedToken33 && cachedToken33.expiresAt > Date.now() + 6e4) {
|
|
@@ -28792,39 +28405,39 @@ async function getProxyToken33(config) {
|
|
|
28792
28405
|
};
|
|
28793
28406
|
return data.token;
|
|
28794
28407
|
}
|
|
28795
|
-
var
|
|
28796
|
-
toolUseIntent:
|
|
28408
|
+
var inputSchema99 = z99.object({
|
|
28409
|
+
toolUseIntent: z99.string().optional().describe(
|
|
28797
28410
|
"Brief description of what you intend to accomplish with this tool call"
|
|
28798
28411
|
),
|
|
28799
|
-
connectionId:
|
|
28800
|
-
method:
|
|
28801
|
-
path:
|
|
28412
|
+
connectionId: z99.string().describe("ID of the Outlook OAuth connection to use"),
|
|
28413
|
+
method: z99.enum(["GET"]).describe("HTTP method (read-only, GET only)"),
|
|
28414
|
+
path: z99.string().describe(
|
|
28802
28415
|
"Microsoft Graph path appended to https://graph.microsoft.com/v1.0. Covers Outlook Mail (e.g. '/me', '/me/messages', '/me/messages/{id}', '/me/mailFolders', '/me/messages/{id}/attachments') and Outlook Calendar (e.g. '/me/calendars', '/me/events', '/me/events/{id}', '/me/calendarView'). Use '/me' as the user prefix."
|
|
28803
28416
|
),
|
|
28804
|
-
queryParams:
|
|
28417
|
+
queryParams: z99.record(z99.string(), z99.string()).optional().describe(
|
|
28805
28418
|
`Query parameters to append. Microsoft Graph supports OData operators ($filter, $orderby, $top, $skip, $select, $expand, $search). Examples: { $top: '10', $select: 'subject,from,receivedDateTime' } for mail; { $filter: "conversationId eq '<id>'", $orderby: 'receivedDateTime asc' } for a thread; { startDateTime: '2025-01-15T00:00:00Z', endDateTime: '2025-01-16T00:00:00Z', $orderby: 'start/dateTime' } for calendarView.`
|
|
28806
28419
|
)
|
|
28807
28420
|
});
|
|
28808
|
-
var
|
|
28809
|
-
|
|
28810
|
-
success:
|
|
28811
|
-
status:
|
|
28812
|
-
data:
|
|
28421
|
+
var outputSchema99 = z99.discriminatedUnion("success", [
|
|
28422
|
+
z99.object({
|
|
28423
|
+
success: z99.literal(true),
|
|
28424
|
+
status: z99.number(),
|
|
28425
|
+
data: z99.record(z99.string(), z99.unknown())
|
|
28813
28426
|
}),
|
|
28814
|
-
|
|
28815
|
-
success:
|
|
28816
|
-
error:
|
|
28427
|
+
z99.object({
|
|
28428
|
+
success: z99.literal(false),
|
|
28429
|
+
error: z99.string()
|
|
28817
28430
|
})
|
|
28818
28431
|
]);
|
|
28819
|
-
var
|
|
28432
|
+
var requestTool58 = new ConnectorTool({
|
|
28820
28433
|
name: "request",
|
|
28821
28434
|
description: `Send authenticated GET requests to Microsoft Graph for Outlook Mail and Calendar.
|
|
28822
28435
|
Authentication is handled automatically via OAuth proxy (Microsoft Entra ID).
|
|
28823
28436
|
All paths are relative to https://graph.microsoft.com/v1.0. Use '/me' as the user prefix.
|
|
28824
28437
|
Covers mailbox (\`/me/messages\`, \`/me/mailFolders\`), threads (\`/me/messages?$filter=conversationId eq '<id>'\`), attachments (\`/me/messages/{id}/attachments\`), calendars (\`/me/calendars\`), and events (\`/me/events\`, \`/me/calendarView\` for expanded occurrences).
|
|
28825
28438
|
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\`).`,
|
|
28826
|
-
inputSchema:
|
|
28827
|
-
outputSchema:
|
|
28439
|
+
inputSchema: inputSchema99,
|
|
28440
|
+
outputSchema: outputSchema99,
|
|
28828
28441
|
async execute({ connectionId, method, path: path5, queryParams }, connections, config) {
|
|
28829
28442
|
const connection = connections.find((c) => c.id === connectionId);
|
|
28830
28443
|
if (!connection) {
|
|
@@ -28837,8 +28450,8 @@ For full-text search use the \`$search\` query parameter (must be wrapped in dou
|
|
|
28837
28450
|
`[connector-request] outlook-oauth/${connection.name}: ${method} ${path5}`
|
|
28838
28451
|
);
|
|
28839
28452
|
try {
|
|
28840
|
-
const normalizedPath = normalizeRequestPath(path5,
|
|
28841
|
-
let url = `${
|
|
28453
|
+
const normalizedPath = normalizeRequestPath(path5, BASE_PATH_SEGMENT16);
|
|
28454
|
+
let url = `${BASE_URL42}${normalizedPath}`;
|
|
28842
28455
|
if (queryParams) {
|
|
28843
28456
|
const searchParams = new URLSearchParams(queryParams);
|
|
28844
28457
|
url += `?${searchParams.toString()}`;
|
|
@@ -28846,7 +28459,7 @@ For full-text search use the \`$search\` query parameter (must be wrapped in dou
|
|
|
28846
28459
|
const token = await getProxyToken33(config.oauthProxy);
|
|
28847
28460
|
const proxyUrl = `https://${config.oauthProxy.sandboxId}.${config.oauthProxy.previewBaseDomain}/_sqcore/connections/${connectionId}/request`;
|
|
28848
28461
|
const controller = new AbortController();
|
|
28849
|
-
const timeout = setTimeout(() => controller.abort(),
|
|
28462
|
+
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS76);
|
|
28850
28463
|
try {
|
|
28851
28464
|
const response = await fetch(proxyUrl, {
|
|
28852
28465
|
method: "POST",
|
|
@@ -28877,7 +28490,7 @@ For full-text search use the \`$search\` query parameter (must be wrapped in dou
|
|
|
28877
28490
|
});
|
|
28878
28491
|
|
|
28879
28492
|
// ../connectors/src/connectors/outlook-oauth/setup.ts
|
|
28880
|
-
var requestToolName14 = `outlook-oauth_${
|
|
28493
|
+
var requestToolName14 = `outlook-oauth_${requestTool58.name}`;
|
|
28881
28494
|
var outlookOnboarding = new ConnectorOnboarding({
|
|
28882
28495
|
connectionSetupInstructions: {
|
|
28883
28496
|
ja: `\u4EE5\u4E0B\u306E\u624B\u9806\u3067 Outlook \u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002
|
|
@@ -28934,17 +28547,17 @@ Calendar
|
|
|
28934
28547
|
});
|
|
28935
28548
|
|
|
28936
28549
|
// ../connectors/src/connectors/outlook-oauth/parameters.ts
|
|
28937
|
-
var
|
|
28550
|
+
var parameters82 = {};
|
|
28938
28551
|
|
|
28939
28552
|
// ../connectors/src/connectors/outlook-oauth/index.ts
|
|
28940
|
-
var
|
|
28553
|
+
var tools82 = { request: requestTool58 };
|
|
28941
28554
|
var outlookOauthConnector = new ConnectorPlugin({
|
|
28942
28555
|
slug: "outlook",
|
|
28943
28556
|
authType: AUTH_TYPES.OAUTH,
|
|
28944
28557
|
name: "Outlook",
|
|
28945
28558
|
description: "Connect to Microsoft Outlook (Mail + Calendar) via Microsoft Graph using OAuth. Read-only access to the user's mailbox, mail folders, messages, attachments, calendars, and events.",
|
|
28946
|
-
iconUrl: "https://
|
|
28947
|
-
parameters:
|
|
28559
|
+
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/1J1FrRTYJjOh3CcSIqsz3I/6a467b4d926075ff99dc60820e0ae4b1/Microsoft_Outlook_Icon__2025%C3%A2__present_.svg",
|
|
28560
|
+
parameters: parameters82,
|
|
28948
28561
|
releaseFlag: { dev1: true, dev2: false, prod: false },
|
|
28949
28562
|
categories: ["productivity"],
|
|
28950
28563
|
onboarding: outlookOnboarding,
|
|
@@ -29224,7 +28837,7 @@ const events = await outlook.listCalendarView(
|
|
|
29224
28837
|
events.value.forEach(e => console.log(e.start.dateTime, e.subject));
|
|
29225
28838
|
\`\`\``
|
|
29226
28839
|
},
|
|
29227
|
-
tools:
|
|
28840
|
+
tools: tools82,
|
|
29228
28841
|
async checkConnection(_params, config) {
|
|
29229
28842
|
const { proxyFetch } = config;
|
|
29230
28843
|
const url = "https://graph.microsoft.com/v1.0/me";
|
|
@@ -29328,7 +28941,6 @@ var plugins = {
|
|
|
29328
28941
|
freshdesk: freshdeskConnector,
|
|
29329
28942
|
freshsales: freshsalesConnector,
|
|
29330
28943
|
github: githubConnector,
|
|
29331
|
-
powerbi: powerbiConnector,
|
|
29332
28944
|
powerbiOauth: powerbiOauthConnector,
|
|
29333
28945
|
tableau: tableauConnector,
|
|
29334
28946
|
outlookOauth: outlookOauthConnector
|
|
@@ -29558,62 +29170,62 @@ import { watch as fsWatch2 } from "fs";
|
|
|
29558
29170
|
import path2 from "path";
|
|
29559
29171
|
|
|
29560
29172
|
// src/types/server-logic.ts
|
|
29561
|
-
import { z as
|
|
29562
|
-
var parameterMetaSchema =
|
|
29563
|
-
name:
|
|
29564
|
-
type:
|
|
29565
|
-
description:
|
|
29566
|
-
required:
|
|
29567
|
-
default:
|
|
29568
|
-
});
|
|
29569
|
-
var serverLogicCacheConfigSchema =
|
|
29570
|
-
ttl:
|
|
29571
|
-
staleWhileRevalidate:
|
|
29572
|
-
});
|
|
29573
|
-
var serverLogicSchemaObjectSchema =
|
|
29574
|
-
() =>
|
|
29575
|
-
type:
|
|
29576
|
-
format:
|
|
29577
|
-
description:
|
|
29578
|
-
nullable:
|
|
29579
|
-
enum:
|
|
29173
|
+
import { z as z100 } from "zod";
|
|
29174
|
+
var parameterMetaSchema = z100.object({
|
|
29175
|
+
name: z100.string(),
|
|
29176
|
+
type: z100.enum(["string", "number", "boolean"]),
|
|
29177
|
+
description: z100.string(),
|
|
29178
|
+
required: z100.boolean().optional(),
|
|
29179
|
+
default: z100.union([z100.string(), z100.number(), z100.boolean()]).optional()
|
|
29180
|
+
});
|
|
29181
|
+
var serverLogicCacheConfigSchema = z100.object({
|
|
29182
|
+
ttl: z100.number(),
|
|
29183
|
+
staleWhileRevalidate: z100.boolean().optional()
|
|
29184
|
+
});
|
|
29185
|
+
var serverLogicSchemaObjectSchema = z100.lazy(
|
|
29186
|
+
() => z100.object({
|
|
29187
|
+
type: z100.enum(["string", "number", "integer", "boolean", "object", "array", "null"]).optional(),
|
|
29188
|
+
format: z100.string().optional(),
|
|
29189
|
+
description: z100.string().optional(),
|
|
29190
|
+
nullable: z100.boolean().optional(),
|
|
29191
|
+
enum: z100.array(z100.union([z100.string(), z100.number(), z100.boolean(), z100.null()])).optional(),
|
|
29580
29192
|
items: serverLogicSchemaObjectSchema.optional(),
|
|
29581
|
-
properties:
|
|
29582
|
-
required:
|
|
29583
|
-
additionalProperties:
|
|
29584
|
-
minimum:
|
|
29585
|
-
maximum:
|
|
29586
|
-
minLength:
|
|
29587
|
-
maxLength:
|
|
29588
|
-
pattern:
|
|
29193
|
+
properties: z100.record(z100.string(), serverLogicSchemaObjectSchema).optional(),
|
|
29194
|
+
required: z100.array(z100.string()).optional(),
|
|
29195
|
+
additionalProperties: z100.union([z100.boolean(), serverLogicSchemaObjectSchema]).optional(),
|
|
29196
|
+
minimum: z100.number().optional(),
|
|
29197
|
+
maximum: z100.number().optional(),
|
|
29198
|
+
minLength: z100.number().optional(),
|
|
29199
|
+
maxLength: z100.number().optional(),
|
|
29200
|
+
pattern: z100.string().optional()
|
|
29589
29201
|
})
|
|
29590
29202
|
);
|
|
29591
|
-
var serverLogicMediaTypeSchema =
|
|
29203
|
+
var serverLogicMediaTypeSchema = z100.object({
|
|
29592
29204
|
schema: serverLogicSchemaObjectSchema.optional(),
|
|
29593
|
-
example:
|
|
29205
|
+
example: z100.unknown().optional()
|
|
29594
29206
|
});
|
|
29595
|
-
var serverLogicResponseSchema =
|
|
29596
|
-
description:
|
|
29597
|
-
content:
|
|
29207
|
+
var serverLogicResponseSchema = z100.object({
|
|
29208
|
+
description: z100.string().optional(),
|
|
29209
|
+
content: z100.record(z100.string(), serverLogicMediaTypeSchema).optional()
|
|
29598
29210
|
});
|
|
29599
29211
|
var jsonBaseFields = {
|
|
29600
|
-
description:
|
|
29601
|
-
parameters:
|
|
29212
|
+
description: z100.string(),
|
|
29213
|
+
parameters: z100.array(parameterMetaSchema).optional(),
|
|
29602
29214
|
response: serverLogicResponseSchema.optional(),
|
|
29603
29215
|
cache: serverLogicCacheConfigSchema.optional()
|
|
29604
29216
|
};
|
|
29605
|
-
var jsonSqlServerLogicSchema =
|
|
29217
|
+
var jsonSqlServerLogicSchema = z100.object({
|
|
29606
29218
|
...jsonBaseFields,
|
|
29607
|
-
type:
|
|
29608
|
-
query:
|
|
29609
|
-
connectionId:
|
|
29219
|
+
type: z100.literal("sql").optional(),
|
|
29220
|
+
query: z100.string(),
|
|
29221
|
+
connectionId: z100.string()
|
|
29610
29222
|
});
|
|
29611
|
-
var jsonTypeScriptServerLogicSchema =
|
|
29223
|
+
var jsonTypeScriptServerLogicSchema = z100.object({
|
|
29612
29224
|
...jsonBaseFields,
|
|
29613
|
-
type:
|
|
29614
|
-
handlerPath:
|
|
29225
|
+
type: z100.literal("typescript"),
|
|
29226
|
+
handlerPath: z100.string()
|
|
29615
29227
|
});
|
|
29616
|
-
var anyJsonServerLogicSchema =
|
|
29228
|
+
var anyJsonServerLogicSchema = z100.union([
|
|
29617
29229
|
jsonTypeScriptServerLogicSchema,
|
|
29618
29230
|
jsonSqlServerLogicSchema
|
|
29619
29231
|
]);
|