@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/index.js CHANGED
@@ -27550,399 +27550,12 @@ export default async function handler(c: Context) {
27550
27550
  tools: tools79
27551
27551
  });
27552
27552
 
27553
- // ../connectors/src/connectors/powerbi/setup.ts
27554
- var powerbiOnboarding = new ConnectorOnboarding({
27555
- connectionSetupInstructions: {
27556
- en: `Follow these steps to verify the Power BI Service Principal connection.
27557
-
27558
- 1. Call \`powerbi_request\` with \`method: "GET"\` and \`path: "/groups"\` to list workspaces the Service Principal can access
27559
- 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
27560
-
27561
- #### Constraints
27562
- - **Do NOT execute DAX queries or refresh datasets during setup**. Only the workspace listing above is allowed
27563
- - Service Principals cannot access "My workspace" \u2014 always work through workspace (group) IDs`,
27564
- 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
27565
-
27566
- 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
27567
- 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
27568
-
27569
- #### \u5236\u7D04
27570
- - **\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
27571
- - 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`
27572
- },
27573
- dataOverviewInstructions: {
27574
- en: `1. Call powerbi_request with GET /groups to list accessible workspaces
27575
- 2. For a target workspace, call powerbi_request with GET /groups/{groupId}/datasets to list datasets
27576
- 3. Call powerbi_request with GET /groups/{groupId}/reports to list reports
27577
- 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)`,
27578
- 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
27579
- 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
27580
- 3. powerbi_request \u3067 GET /groups/{groupId}/reports \u3092\u547C\u3073\u51FA\u3057\u3001\u30EC\u30DD\u30FC\u30C8\u4E00\u89A7\u3092\u53D6\u5F97
27581
- 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`
27582
- }
27583
- });
27584
-
27585
- // ../connectors/src/connectors/powerbi/parameters.ts
27586
- var parameters80 = {
27587
- tenantId: new ParameterDefinition({
27588
- slug: "tenant-id",
27589
- name: "Azure Tenant ID",
27590
- description: "The Microsoft Entra ID (Azure AD) tenant ID that owns the Service Principal. Found in Azure Portal > Microsoft Entra ID > Overview > Tenant ID.",
27591
- envVarBaseKey: "POWERBI_TENANT_ID",
27592
- type: "text",
27593
- secret: false,
27594
- required: true
27595
- }),
27596
- clientId: new ParameterDefinition({
27597
- slug: "client-id",
27598
- name: "Application (Client) ID",
27599
- 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.",
27600
- envVarBaseKey: "POWERBI_CLIENT_ID",
27601
- type: "text",
27602
- secret: false,
27603
- required: true
27604
- }),
27605
- clientSecret: new ParameterDefinition({
27606
- slug: "client-secret",
27607
- name: "Client Secret",
27608
- 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.",
27609
- envVarBaseKey: "POWERBI_CLIENT_SECRET",
27610
- type: "text",
27611
- secret: true,
27612
- required: true
27613
- })
27614
- };
27615
-
27616
- // ../connectors/src/connectors/powerbi/tools/request.ts
27553
+ // ../connectors/src/connectors/powerbi-oauth/tools/request.ts
27617
27554
  import { z as z97 } from "zod";
27618
27555
  var BASE_HOST12 = "https://api.powerbi.com";
27619
27556
  var BASE_PATH_SEGMENT15 = "/v1.0/myorg";
27620
27557
  var BASE_URL41 = `${BASE_HOST12}${BASE_PATH_SEGMENT15}`;
27621
- var TOKEN_SCOPE = "https://analysis.windows.net/powerbi/api/.default";
27622
27558
  var REQUEST_TIMEOUT_MS74 = 6e4;
27623
- var tokenCache = /* @__PURE__ */ new Map();
27624
- async function getAccessToken(tenantId, clientId, clientSecret) {
27625
- const cacheKey = `${tenantId}:${clientId}`;
27626
- const cached = tokenCache.get(cacheKey);
27627
- if (cached && cached.expiresAt > Date.now() + 6e4) {
27628
- return cached.token;
27629
- }
27630
- const tokenUrl = `https://login.microsoftonline.com/${encodeURIComponent(tenantId)}/oauth2/v2.0/token`;
27631
- const body = new URLSearchParams({
27632
- grant_type: "client_credentials",
27633
- client_id: clientId,
27634
- client_secret: clientSecret,
27635
- scope: TOKEN_SCOPE
27636
- });
27637
- const res = await fetch(tokenUrl, {
27638
- method: "POST",
27639
- headers: { "Content-Type": "application/x-www-form-urlencoded" },
27640
- body: body.toString()
27641
- });
27642
- if (!res.ok) {
27643
- const errorText = await res.text().catch(() => res.statusText);
27644
- throw new Error(
27645
- `Power BI token request failed: HTTP ${res.status} ${errorText}`
27646
- );
27647
- }
27648
- const data = await res.json();
27649
- tokenCache.set(cacheKey, {
27650
- token: data.access_token,
27651
- expiresAt: Date.now() + data.expires_in * 1e3
27652
- });
27653
- return data.access_token;
27654
- }
27655
- var inputSchema97 = z97.object({
27656
- toolUseIntent: z97.string().optional().describe(
27657
- "Brief description of what you intend to accomplish with this tool call"
27658
- ),
27659
- connectionId: z97.string().describe("ID of the Power BI connection to use"),
27660
- method: z97.enum(["GET", "POST", "PATCH", "PUT", "DELETE"]).describe(
27661
- "HTTP method. Use GET for reading workspaces/datasets/reports, POST for execute queries / refresh, PATCH/PUT for updates, DELETE for removal."
27662
- ),
27663
- path: z97.string().describe(
27664
- "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."
27665
- ),
27666
- queryParams: z97.record(z97.string(), z97.string()).optional().describe(
27667
- `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.`
27668
- ),
27669
- body: z97.record(z97.string(), z97.unknown()).optional().describe(
27670
- "JSON request body for POST/PATCH/PUT/DELETE. Example: executeQueries body { queries: [{ query: 'EVALUATE TOPN(10, Sales)' }], serializerSettings: { includeNulls: true } }."
27671
- )
27672
- });
27673
- var outputSchema97 = z97.discriminatedUnion("success", [
27674
- z97.object({
27675
- success: z97.literal(true),
27676
- status: z97.number(),
27677
- data: z97.unknown()
27678
- }),
27679
- z97.object({
27680
- success: z97.literal(false),
27681
- error: z97.string()
27682
- })
27683
- ]);
27684
- var requestTool56 = new ConnectorTool({
27685
- name: "request",
27686
- description: `Send authenticated requests to the Power BI REST API v1.0.
27687
- Authentication uses a Microsoft Entra Service Principal (client_credentials) \u2014 the token is acquired and cached automatically.
27688
- 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.
27689
- Use the executeQueries endpoint (POST /groups/{groupId}/datasets/{datasetId}/executeQueries) to run DAX against a dataset.`,
27690
- inputSchema: inputSchema97,
27691
- outputSchema: outputSchema97,
27692
- async execute({ connectionId, method, path: path5, queryParams, body }, connections) {
27693
- const connection2 = connections.find((c) => c.id === connectionId);
27694
- if (!connection2) {
27695
- return {
27696
- success: false,
27697
- error: `Connection ${connectionId} not found`
27698
- };
27699
- }
27700
- console.log(
27701
- `[connector-request] powerbi/${connection2.name}: ${method} ${path5}`
27702
- );
27703
- try {
27704
- const tenantId = parameters80.tenantId.getValue(connection2);
27705
- const clientId = parameters80.clientId.getValue(connection2);
27706
- const clientSecret = parameters80.clientSecret.getValue(connection2);
27707
- const normalizedPath = normalizeRequestPath(path5, BASE_PATH_SEGMENT15);
27708
- let url = `${BASE_URL41}${normalizedPath}`;
27709
- if (queryParams) {
27710
- const searchParams = new URLSearchParams(queryParams);
27711
- url += `?${searchParams.toString()}`;
27712
- }
27713
- const token = await getAccessToken(tenantId, clientId, clientSecret);
27714
- const controller = new AbortController();
27715
- const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS74);
27716
- try {
27717
- const init = {
27718
- method,
27719
- headers: {
27720
- Authorization: `Bearer ${token}`,
27721
- "Content-Type": "application/json",
27722
- Accept: "application/json"
27723
- },
27724
- signal: controller.signal
27725
- };
27726
- if (body !== void 0) {
27727
- init.body = JSON.stringify(body);
27728
- }
27729
- const response = await fetch(url, init);
27730
- const text = await response.text();
27731
- const data = text ? (() => {
27732
- try {
27733
- return JSON.parse(text);
27734
- } catch {
27735
- return text;
27736
- }
27737
- })() : null;
27738
- if (!response.ok) {
27739
- const errorMessage = data && typeof data === "object" && "error" in data ? JSON.stringify(data.error) : typeof data === "string" && data ? data : `HTTP ${response.status} ${response.statusText}`;
27740
- return { success: false, error: errorMessage };
27741
- }
27742
- return { success: true, status: response.status, data };
27743
- } finally {
27744
- clearTimeout(timeout);
27745
- }
27746
- } catch (err) {
27747
- const msg = err instanceof Error ? err.message : String(err);
27748
- return { success: false, error: msg };
27749
- }
27750
- }
27751
- });
27752
-
27753
- // ../connectors/src/connectors/powerbi/index.ts
27754
- var tools80 = { request: requestTool56 };
27755
- var powerbiConnector = new ConnectorPlugin({
27756
- slug: "powerbi",
27757
- authType: AUTH_TYPES.API_KEY,
27758
- name: "Power BI",
27759
- 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.",
27760
- iconUrl: "https://upload.wikimedia.org/wikipedia/commons/c/cf/New_Power_BI_Logo.svg",
27761
- parameters: parameters80,
27762
- releaseFlag: { dev1: true, dev2: false, prod: false },
27763
- categories: ["other"],
27764
- onboarding: powerbiOnboarding,
27765
- systemPrompt: {
27766
- en: `### Tools
27767
-
27768
- - \`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.
27769
-
27770
- ### Business Logic
27771
-
27772
- The business logic type for this connector is "typescript". Use the connector SDK in your handler. Do NOT read credentials from environment variables.
27773
-
27774
- SDK methods (client created via \`connection(connectionId)\`):
27775
- - \`client.request(path, init?)\` \u2014 low-level authenticated fetch (path appended to \`https://api.powerbi.com/v1.0/myorg\`)
27776
- - \`client.listGroups(options?)\` \u2014 list workspaces (\`$top\`, \`$skip\`, \`$filter\`)
27777
- - \`client.listDatasets(groupId)\` / \`client.listReports(groupId)\` \u2014 list datasets / reports in a workspace
27778
- - \`client.getDataset(groupId, datasetId)\` \u2014 fetch a single dataset
27779
- - \`client.executeQueries(groupId, datasetId, queries, options?)\` \u2014 run DAX queries against a dataset
27780
- - \`client.refreshDataset(groupId, datasetId, options?)\` \u2014 trigger an async refresh
27781
-
27782
- \`\`\`ts
27783
- import type { Context } from "hono";
27784
- import { connection } from "@squadbase/vite-server/connectors/powerbi";
27785
-
27786
- const powerbi = connection("<connectionId>");
27787
-
27788
- export default async function handler(c: Context) {
27789
- const { groupId, datasetId, dax } = await c.req.json<{
27790
- groupId: string;
27791
- datasetId: string;
27792
- dax: string;
27793
- }>();
27794
-
27795
- const result = await powerbi.executeQueries(groupId, datasetId, [dax]);
27796
- const rows = result.results[0]?.tables[0]?.rows ?? [];
27797
- return c.json({ rows });
27798
- }
27799
- \`\`\`
27800
-
27801
- ### Power BI REST API Reference
27802
-
27803
- - Base URL: \`https://api.powerbi.com/v1.0/myorg\`
27804
- - 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)
27805
- - Service Principals cannot access "My workspace"; the SP must be added as Member/Admin to each workspace
27806
- - The tenant admin must enable "Allow service principals to use Power BI APIs" in the Power BI admin portal
27807
-
27808
- #### Common Endpoints
27809
- - GET \`/groups\` \u2014 List workspaces accessible to the Service Principal
27810
- - GET \`/groups/{groupId}/datasets\` \u2014 List datasets in a workspace
27811
- - GET \`/groups/{groupId}/datasets/{datasetId}\` \u2014 Get dataset metadata
27812
- - GET \`/groups/{groupId}/datasets/{datasetId}/tables\` \u2014 List tables (requires XMLA / metadata reads enabled)
27813
- - GET \`/groups/{groupId}/reports\` \u2014 List reports
27814
- - GET \`/groups/{groupId}/dashboards\` \u2014 List dashboards
27815
- - POST \`/groups/{groupId}/datasets/{datasetId}/executeQueries\` \u2014 Run DAX (body: \`{ queries: [{ query: "EVALUATE ..." }], serializerSettings: { includeNulls: true } }\`)
27816
- - POST \`/groups/{groupId}/datasets/{datasetId}/refreshes\` \u2014 Trigger a dataset refresh
27817
- - GET \`/groups/{groupId}/datasets/{datasetId}/refreshes\` \u2014 List recent refresh history
27818
-
27819
- #### DAX Tips
27820
- - \`EVALUATE TOPN(10, 'TableName')\` \u2014 sample 10 rows from a table
27821
- - \`EVALUATE SUMMARIZECOLUMNS('Date'[Year], "Sales", SUM('Sales'[Amount]))\` \u2014 aggregate
27822
- - 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)`,
27823
- ja: `### \u30C4\u30FC\u30EB
27824
-
27825
- - \`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
27826
-
27827
- ### Business Logic
27828
-
27829
- \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
27830
-
27831
- SDK\u30E1\u30BD\u30C3\u30C9 (\`connection(connectionId)\` \u3067\u4F5C\u6210\u3057\u305F\u30AF\u30E9\u30A4\u30A2\u30F3\u30C8):
27832
- - \`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)
27833
- - \`client.listGroups(options?)\` \u2014 \u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u4E00\u89A7 (\`$top\`, \`$skip\`, \`$filter\`)
27834
- - \`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
27835
- - \`client.getDataset(groupId, datasetId)\` \u2014 \u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u5358\u4F53\u53D6\u5F97
27836
- - \`client.executeQueries(groupId, datasetId, queries, options?)\` \u2014 DAX \u30AF\u30A8\u30EA\u5B9F\u884C
27837
- - \`client.refreshDataset(groupId, datasetId, options?)\` \u2014 \u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u66F4\u65B0\u3092\u975E\u540C\u671F\u30C8\u30EA\u30AC\u30FC
27838
-
27839
- \`\`\`ts
27840
- import type { Context } from "hono";
27841
- import { connection } from "@squadbase/vite-server/connectors/powerbi";
27842
-
27843
- const powerbi = connection("<connectionId>");
27844
-
27845
- export default async function handler(c: Context) {
27846
- const { groupId, datasetId, dax } = await c.req.json<{
27847
- groupId: string;
27848
- datasetId: string;
27849
- dax: string;
27850
- }>();
27851
-
27852
- const result = await powerbi.executeQueries(groupId, datasetId, [dax]);
27853
- const rows = result.results[0]?.tables[0]?.rows ?? [];
27854
- return c.json({ rows });
27855
- }
27856
- \`\`\`
27857
-
27858
- ### Power BI REST API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
27859
-
27860
- - \u30D9\u30FC\u30B9 URL: \`https://api.powerbi.com/v1.0/myorg\`
27861
- - \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)
27862
- - 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
27863
- - \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
27864
-
27865
- #### \u4E3B\u8981\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8
27866
- - GET \`/groups\` \u2014 Service Principal \u304C\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u4E00\u89A7
27867
- - GET \`/groups/{groupId}/datasets\` \u2014 \u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u5185\u306E\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u4E00\u89A7
27868
- - GET \`/groups/{groupId}/datasets/{datasetId}\` \u2014 \u30C7\u30FC\u30BF\u30BB\u30C3\u30C8 \u30E1\u30BF\u30C7\u30FC\u30BF
27869
- - 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)
27870
- - GET \`/groups/{groupId}/reports\` \u2014 \u30EC\u30DD\u30FC\u30C8\u4E00\u89A7
27871
- - GET \`/groups/{groupId}/dashboards\` \u2014 \u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u4E00\u89A7
27872
- - POST \`/groups/{groupId}/datasets/{datasetId}/executeQueries\` \u2014 DAX \u5B9F\u884C (body: \`{ queries: [{ query: "EVALUATE ..." }], serializerSettings: { includeNulls: true } }\`)
27873
- - POST \`/groups/{groupId}/datasets/{datasetId}/refreshes\` \u2014 \u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u66F4\u65B0\u30C8\u30EA\u30AC\u30FC
27874
- - GET \`/groups/{groupId}/datasets/{datasetId}/refreshes\` \u2014 \u76F4\u8FD1\u306E\u66F4\u65B0\u5C65\u6B74
27875
-
27876
- #### DAX Tips
27877
- - \`EVALUATE TOPN(10, 'TableName')\` \u2014 \u30C6\u30FC\u30D6\u30EB\u304B\u3089 10 \u884C\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0
27878
- - \`EVALUATE SUMMARIZECOLUMNS('Date'[Year], "Sales", SUM('Sales'[Amount]))\` \u2014 \u96C6\u8A08
27879
- - \`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`
27880
- },
27881
- tools: tools80,
27882
- async checkConnection(params) {
27883
- const tenantId = params[parameters80.tenantId.slug];
27884
- const clientId = params[parameters80.clientId.slug];
27885
- const clientSecret = params[parameters80.clientSecret.slug];
27886
- if (!tenantId || !clientId || !clientSecret) {
27887
- return {
27888
- success: false,
27889
- error: "Missing required parameters: tenant-id, client-id, client-secret"
27890
- };
27891
- }
27892
- try {
27893
- const tokenUrl = `https://login.microsoftonline.com/${encodeURIComponent(tenantId)}/oauth2/v2.0/token`;
27894
- const body = new URLSearchParams({
27895
- grant_type: "client_credentials",
27896
- client_id: clientId,
27897
- client_secret: clientSecret,
27898
- scope: "https://analysis.windows.net/powerbi/api/.default"
27899
- });
27900
- const tokenRes = await fetch(tokenUrl, {
27901
- method: "POST",
27902
- headers: { "Content-Type": "application/x-www-form-urlencoded" },
27903
- body: body.toString()
27904
- });
27905
- if (!tokenRes.ok) {
27906
- const errorText = await tokenRes.text().catch(() => tokenRes.statusText);
27907
- return {
27908
- success: false,
27909
- error: `Power BI token request failed: HTTP ${tokenRes.status} ${errorText}`
27910
- };
27911
- }
27912
- const { access_token } = await tokenRes.json();
27913
- const apiRes = await fetch(
27914
- "https://api.powerbi.com/v1.0/myorg/groups?$top=1",
27915
- {
27916
- method: "GET",
27917
- headers: {
27918
- Authorization: `Bearer ${access_token}`,
27919
- Accept: "application/json"
27920
- }
27921
- }
27922
- );
27923
- if (!apiRes.ok) {
27924
- const errorText = await apiRes.text().catch(() => apiRes.statusText);
27925
- return {
27926
- success: false,
27927
- error: `Power BI API failed: HTTP ${apiRes.status} ${errorText}`
27928
- };
27929
- }
27930
- return { success: true };
27931
- } catch (error) {
27932
- return {
27933
- success: false,
27934
- error: error instanceof Error ? error.message : String(error)
27935
- };
27936
- }
27937
- }
27938
- });
27939
-
27940
- // ../connectors/src/connectors/powerbi-oauth/tools/request.ts
27941
- import { z as z98 } from "zod";
27942
- var BASE_HOST13 = "https://api.powerbi.com";
27943
- var BASE_PATH_SEGMENT16 = "/v1.0/myorg";
27944
- var BASE_URL42 = `${BASE_HOST13}${BASE_PATH_SEGMENT16}`;
27945
- var REQUEST_TIMEOUT_MS75 = 6e4;
27946
27559
  var cachedToken32 = null;
27947
27560
  async function getProxyToken32(config) {
27948
27561
  if (cachedToken32 && cachedToken32.expiresAt > Date.now() + 6e4) {
@@ -27974,42 +27587,42 @@ async function getProxyToken32(config) {
27974
27587
  };
27975
27588
  return data.token;
27976
27589
  }
27977
- var inputSchema98 = z98.object({
27978
- toolUseIntent: z98.string().optional().describe(
27590
+ var inputSchema97 = z97.object({
27591
+ toolUseIntent: z97.string().optional().describe(
27979
27592
  "Brief description of what you intend to accomplish with this tool call"
27980
27593
  ),
27981
- connectionId: z98.string().describe("ID of the Power BI OAuth connection to use"),
27982
- method: z98.enum(["GET", "POST", "PATCH", "PUT", "DELETE"]).describe(
27594
+ connectionId: z97.string().describe("ID of the Power BI OAuth connection to use"),
27595
+ method: z97.enum(["GET", "POST", "PATCH", "PUT", "DELETE"]).describe(
27983
27596
  "HTTP method. GET for reading workspaces/datasets/reports, POST for executeQueries / refresh, PATCH/PUT for updates, DELETE for removal."
27984
27597
  ),
27985
- path: z98.string().describe(
27598
+ path: z97.string().describe(
27986
27599
  "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."
27987
27600
  ),
27988
- queryParams: z98.record(z98.string(), z98.string()).optional().describe(
27601
+ queryParams: z97.record(z97.string(), z97.string()).optional().describe(
27989
27602
  `Query parameters to append (e.g., { $top: '50', $filter: "name eq 'Sales'" }).`
27990
27603
  ),
27991
- body: z98.record(z98.string(), z98.unknown()).optional().describe(
27604
+ body: z97.record(z97.string(), z97.unknown()).optional().describe(
27992
27605
  "JSON request body for POST/PATCH/PUT/DELETE. Example executeQueries body: { queries: [{ query: 'EVALUATE TOPN(10, Sales)' }], serializerSettings: { includeNulls: true } }."
27993
27606
  )
27994
27607
  });
27995
- var outputSchema98 = z98.discriminatedUnion("success", [
27996
- z98.object({
27997
- success: z98.literal(true),
27998
- status: z98.number(),
27999
- data: z98.unknown()
27608
+ var outputSchema97 = z97.discriminatedUnion("success", [
27609
+ z97.object({
27610
+ success: z97.literal(true),
27611
+ status: z97.number(),
27612
+ data: z97.unknown()
28000
27613
  }),
28001
- z98.object({
28002
- success: z98.literal(false),
28003
- error: z98.string()
27614
+ z97.object({
27615
+ success: z97.literal(false),
27616
+ error: z97.string()
28004
27617
  })
28005
27618
  ]);
28006
- var requestTool57 = new ConnectorTool({
27619
+ var requestTool56 = new ConnectorTool({
28007
27620
  name: "request",
28008
27621
  description: `Send authenticated requests to the Power BI REST API v1.0 using the user's Microsoft Entra OAuth token (proxied automatically).
28009
27622
  All paths are relative to https://api.powerbi.com/v1.0/myorg. Use the executeQueries endpoint to run DAX against a dataset.
28010
27623
  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.`,
28011
- inputSchema: inputSchema98,
28012
- outputSchema: outputSchema98,
27624
+ inputSchema: inputSchema97,
27625
+ outputSchema: outputSchema97,
28013
27626
  async execute({ connectionId, method, path: path5, queryParams, body }, connections, config) {
28014
27627
  const connection2 = connections.find((c) => c.id === connectionId);
28015
27628
  if (!connection2) {
@@ -28022,8 +27635,8 @@ The signed-in user must have access to the workspace; unlike Service Principals,
28022
27635
  `[connector-request] powerbi-oauth/${connection2.name}: ${method} ${path5}`
28023
27636
  );
28024
27637
  try {
28025
- const normalizedPath = normalizeRequestPath(path5, BASE_PATH_SEGMENT16);
28026
- let url = `${BASE_URL42}${normalizedPath}`;
27638
+ const normalizedPath = normalizeRequestPath(path5, BASE_PATH_SEGMENT15);
27639
+ let url = `${BASE_URL41}${normalizedPath}`;
28027
27640
  if (queryParams) {
28028
27641
  const searchParams = new URLSearchParams(queryParams);
28029
27642
  url += `?${searchParams.toString()}`;
@@ -28031,7 +27644,7 @@ The signed-in user must have access to the workspace; unlike Service Principals,
28031
27644
  const token = await getProxyToken32(config.oauthProxy);
28032
27645
  const proxyUrl = `https://${config.oauthProxy.sandboxId}.${config.oauthProxy.previewBaseDomain}/_sqcore/connections/${connectionId}/request`;
28033
27646
  const controller = new AbortController();
28034
- const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS75);
27647
+ const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS74);
28035
27648
  try {
28036
27649
  const response = await fetch(proxyUrl, {
28037
27650
  method: "POST",
@@ -28070,7 +27683,7 @@ The signed-in user must have access to the workspace; unlike Service Principals,
28070
27683
  });
28071
27684
 
28072
27685
  // ../connectors/src/connectors/powerbi-oauth/setup.ts
28073
- var requestToolName13 = `powerbi-oauth_${requestTool57.name}`;
27686
+ var requestToolName13 = `powerbi-oauth_${requestTool56.name}`;
28074
27687
  var powerbiOauthOnboarding = new ConnectorOnboarding({
28075
27688
  connectionSetupInstructions: {
28076
27689
  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
@@ -28103,19 +27716,19 @@ var powerbiOauthOnboarding = new ConnectorOnboarding({
28103
27716
  });
28104
27717
 
28105
27718
  // ../connectors/src/connectors/powerbi-oauth/parameters.ts
28106
- var parameters81 = {};
27719
+ var parameters80 = {};
28107
27720
 
28108
27721
  // ../connectors/src/connectors/powerbi-oauth/index.ts
28109
- var tools81 = { request: requestTool57 };
27722
+ var tools80 = { request: requestTool56 };
28110
27723
  var powerbiOauthConnector = new ConnectorPlugin({
28111
27724
  slug: "powerbi",
28112
27725
  authType: AUTH_TYPES.OAUTH,
28113
27726
  name: "Power BI",
28114
27727
  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.",
28115
- iconUrl: "https://upload.wikimedia.org/wikipedia/commons/c/cf/New_Power_BI_Logo.svg",
28116
- parameters: parameters81,
27728
+ iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/2vXQCKGpMJ9kGSaqkZl9IS/cc5669c267fc5d11e7b1f8c01723e461/power-bi-icon.png",
27729
+ parameters: parameters80,
28117
27730
  releaseFlag: { dev1: true, dev2: false, prod: false },
28118
- categories: ["other"],
27731
+ categories: ["bi"],
28119
27732
  onboarding: powerbiOauthOnboarding,
28120
27733
  proxyPolicy: {
28121
27734
  allowlist: [
@@ -28239,7 +27852,7 @@ export default async function handler(c: Context) {
28239
27852
  - \`EVALUATE SUMMARIZECOLUMNS('Date'[Year], "Sales", SUM('Sales'[Amount]))\` \u2014 \u96C6\u8A08
28240
27853
  - \`executeQueries\` \u306F\u73FE\u72B6 1 \u30EA\u30AF\u30A8\u30B9\u30C8\u306B\u3064\u304D 1 \u30AF\u30A8\u30EA\u306E\u307F`
28241
27854
  },
28242
- tools: tools81,
27855
+ tools: tools80,
28243
27856
  async checkConnection(_params, config) {
28244
27857
  const { proxyFetch } = config;
28245
27858
  const url = "https://api.powerbi.com/v1.0/myorg/groups?$top=1";
@@ -28295,7 +27908,7 @@ var tableauOnboarding = new ConnectorOnboarding({
28295
27908
  });
28296
27909
 
28297
27910
  // ../connectors/src/connectors/tableau/parameters.ts
28298
- var parameters82 = {
27911
+ var parameters81 = {
28299
27912
  serverUrl: new ParameterDefinition({
28300
27913
  slug: "server-url",
28301
27914
  name: "Tableau Server URL",
@@ -28344,9 +27957,9 @@ var parameters82 = {
28344
27957
  };
28345
27958
 
28346
27959
  // ../connectors/src/connectors/tableau/tools/request.ts
28347
- import { z as z99 } from "zod";
27960
+ import { z as z98 } from "zod";
28348
27961
  var DEFAULT_API_VERSION = "3.28";
28349
- var REQUEST_TIMEOUT_MS76 = 6e4;
27962
+ var REQUEST_TIMEOUT_MS75 = 6e4;
28350
27963
  var sessionCache = /* @__PURE__ */ new Map();
28351
27964
  function buildBaseUrl4(serverUrl, apiVersion) {
28352
27965
  return `${serverUrl.replace(/\/$/, "")}/api/${apiVersion}`;
@@ -28398,43 +28011,43 @@ async function getSession(serverUrl, apiVersion, siteContentUrl, patName, patSec
28398
28011
  sessionCache.set(cacheKey, session);
28399
28012
  return session;
28400
28013
  }
28401
- var inputSchema99 = z99.object({
28402
- toolUseIntent: z99.string().optional().describe(
28014
+ var inputSchema98 = z98.object({
28015
+ toolUseIntent: z98.string().optional().describe(
28403
28016
  "Brief description of what you intend to accomplish with this tool call"
28404
28017
  ),
28405
- connectionId: z99.string().describe("ID of the Tableau connection to use"),
28406
- method: z99.enum(["GET", "POST", "PUT", "DELETE"]).describe(
28018
+ connectionId: z98.string().describe("ID of the Tableau connection to use"),
28019
+ method: z98.enum(["GET", "POST", "PUT", "DELETE"]).describe(
28407
28020
  "HTTP method. GET for listing/reading, POST for creating, PUT for updates, DELETE for removal."
28408
28021
  ),
28409
- path: z99.string().describe(
28022
+ path: z98.string().describe(
28410
28023
  "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."
28411
28024
  ),
28412
- queryParams: z99.record(z99.string(), z99.string()).optional().describe(
28025
+ queryParams: z98.record(z98.string(), z98.string()).optional().describe(
28413
28026
  "Query parameters to append (e.g., { pageSize: '100', filter: 'name:eq:Sales' }). Tableau supports field filtering via 'fields' and sorting via 'sort'."
28414
28027
  ),
28415
- body: z99.record(z99.string(), z99.unknown()).optional().describe(
28028
+ body: z98.record(z98.string(), z98.unknown()).optional().describe(
28416
28029
  "JSON request body for POST/PUT (Tableau also accepts XML, but JSON is recommended with Accept: application/json)."
28417
28030
  )
28418
28031
  });
28419
- var outputSchema99 = z99.discriminatedUnion("success", [
28420
- z99.object({
28421
- success: z99.literal(true),
28422
- status: z99.number(),
28423
- data: z99.unknown()
28032
+ var outputSchema98 = z98.discriminatedUnion("success", [
28033
+ z98.object({
28034
+ success: z98.literal(true),
28035
+ status: z98.number(),
28036
+ data: z98.unknown()
28424
28037
  }),
28425
- z99.object({
28426
- success: z99.literal(false),
28427
- error: z99.string()
28038
+ z98.object({
28039
+ success: z98.literal(false),
28040
+ error: z98.string()
28428
28041
  })
28429
28042
  ]);
28430
- var requestTool58 = new ConnectorTool({
28043
+ var requestTool57 = new ConnectorTool({
28431
28044
  name: "request",
28432
28045
  description: `Send authenticated requests to the Tableau REST API.
28433
28046
  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.
28434
28047
  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.
28435
28048
  Accept and Content-Type headers default to application/json so list responses come back as JSON instead of Tableau's default XML.`,
28436
- inputSchema: inputSchema99,
28437
- outputSchema: outputSchema99,
28049
+ inputSchema: inputSchema98,
28050
+ outputSchema: outputSchema98,
28438
28051
  async execute({ connectionId, method, path: path5, queryParams, body }, connections) {
28439
28052
  const connection2 = connections.find((c) => c.id === connectionId);
28440
28053
  if (!connection2) {
@@ -28447,11 +28060,11 @@ Accept and Content-Type headers default to application/json so list responses co
28447
28060
  `[connector-request] tableau/${connection2.name}: ${method} ${path5}`
28448
28061
  );
28449
28062
  try {
28450
- const serverUrl = parameters82.serverUrl.getValue(connection2);
28451
- const siteContentUrl = parameters82.siteContentUrl.getValue(connection2);
28452
- const patName = parameters82.patName.getValue(connection2);
28453
- const patSecret = parameters82.patSecret.getValue(connection2);
28454
- const apiVersion = parameters82.apiVersion.tryGetValue(connection2) || DEFAULT_API_VERSION;
28063
+ const serverUrl = parameters81.serverUrl.getValue(connection2);
28064
+ const siteContentUrl = parameters81.siteContentUrl.getValue(connection2);
28065
+ const patName = parameters81.patName.getValue(connection2);
28066
+ const patSecret = parameters81.patSecret.getValue(connection2);
28067
+ const apiVersion = parameters81.apiVersion.tryGetValue(connection2) || DEFAULT_API_VERSION;
28455
28068
  const session = await getSession(
28456
28069
  serverUrl,
28457
28070
  apiVersion,
@@ -28466,7 +28079,7 @@ Accept and Content-Type headers default to application/json so list responses co
28466
28079
  url += `?${searchParams.toString()}`;
28467
28080
  }
28468
28081
  const controller = new AbortController();
28469
- const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS76);
28082
+ const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS75);
28470
28083
  try {
28471
28084
  const init = {
28472
28085
  method,
@@ -28505,16 +28118,16 @@ Accept and Content-Type headers default to application/json so list responses co
28505
28118
  });
28506
28119
 
28507
28120
  // ../connectors/src/connectors/tableau/index.ts
28508
- var tools82 = { request: requestTool58 };
28121
+ var tools81 = { request: requestTool57 };
28509
28122
  var tableauConnector = new ConnectorPlugin({
28510
28123
  slug: "tableau",
28511
28124
  authType: AUTH_TYPES.PAT,
28512
28125
  name: "Tableau",
28513
28126
  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.",
28514
- iconUrl: "https://upload.wikimedia.org/wikipedia/commons/4/4b/Tableau_Logo.png",
28515
- parameters: parameters82,
28127
+ iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/3ejrZvfw7zCDa3FPbUNQx9/d810e117b3a86c45dd96205453bf67a0/tableau-icon.svg",
28128
+ parameters: parameters81,
28516
28129
  releaseFlag: { dev1: true, dev2: false, prod: false },
28517
- categories: ["other"],
28130
+ categories: ["bi"],
28518
28131
  onboarding: tableauOnboarding,
28519
28132
  systemPrompt: {
28520
28133
  en: `### Tools
@@ -28632,13 +28245,13 @@ export default async function handler(c: Context) {
28632
28245
  - \`filter=updatedAt:gte:2024-01-01T00:00:00Z\` \u2014 \u6BD4\u8F03\u6F14\u7B97\u5B50 (gt/gte/lt/lte)
28633
28246
  - \u7D44\u307F\u5408\u308F\u305B: \`filter=ownerName:eq:alice,tags:in:[finance]\``
28634
28247
  },
28635
- tools: tools82,
28248
+ tools: tools81,
28636
28249
  async checkConnection(params) {
28637
- const serverUrl = params[parameters82.serverUrl.slug];
28638
- const siteContentUrl = params[parameters82.siteContentUrl.slug];
28639
- const patName = params[parameters82.patName.slug];
28640
- const patSecret = params[parameters82.patSecret.slug];
28641
- const apiVersion = params[parameters82.apiVersion.slug] || "3.28";
28250
+ const serverUrl = params[parameters81.serverUrl.slug];
28251
+ const siteContentUrl = params[parameters81.siteContentUrl.slug];
28252
+ const patName = params[parameters81.patName.slug];
28253
+ const patSecret = params[parameters81.patSecret.slug];
28254
+ const apiVersion = params[parameters81.apiVersion.slug] || "3.28";
28642
28255
  if (!serverUrl || siteContentUrl == null || !patName || !patSecret) {
28643
28256
  return {
28644
28257
  success: false,
@@ -28681,11 +28294,11 @@ export default async function handler(c: Context) {
28681
28294
  });
28682
28295
 
28683
28296
  // ../connectors/src/connectors/outlook-oauth/tools/request.ts
28684
- import { z as z100 } from "zod";
28685
- var BASE_HOST14 = "https://graph.microsoft.com";
28686
- var BASE_PATH_SEGMENT17 = "/v1.0";
28687
- var BASE_URL43 = `${BASE_HOST14}${BASE_PATH_SEGMENT17}`;
28688
- var REQUEST_TIMEOUT_MS77 = 6e4;
28297
+ import { z as z99 } from "zod";
28298
+ var BASE_HOST13 = "https://graph.microsoft.com";
28299
+ var BASE_PATH_SEGMENT16 = "/v1.0";
28300
+ var BASE_URL42 = `${BASE_HOST13}${BASE_PATH_SEGMENT16}`;
28301
+ var REQUEST_TIMEOUT_MS76 = 6e4;
28689
28302
  var cachedToken33 = null;
28690
28303
  async function getProxyToken33(config) {
28691
28304
  if (cachedToken33 && cachedToken33.expiresAt > Date.now() + 6e4) {
@@ -28717,39 +28330,39 @@ async function getProxyToken33(config) {
28717
28330
  };
28718
28331
  return data.token;
28719
28332
  }
28720
- var inputSchema100 = z100.object({
28721
- toolUseIntent: z100.string().optional().describe(
28333
+ var inputSchema99 = z99.object({
28334
+ toolUseIntent: z99.string().optional().describe(
28722
28335
  "Brief description of what you intend to accomplish with this tool call"
28723
28336
  ),
28724
- connectionId: z100.string().describe("ID of the Outlook OAuth connection to use"),
28725
- method: z100.enum(["GET"]).describe("HTTP method (read-only, GET only)"),
28726
- path: z100.string().describe(
28337
+ connectionId: z99.string().describe("ID of the Outlook OAuth connection to use"),
28338
+ method: z99.enum(["GET"]).describe("HTTP method (read-only, GET only)"),
28339
+ path: z99.string().describe(
28727
28340
  "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."
28728
28341
  ),
28729
- queryParams: z100.record(z100.string(), z100.string()).optional().describe(
28342
+ queryParams: z99.record(z99.string(), z99.string()).optional().describe(
28730
28343
  `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.`
28731
28344
  )
28732
28345
  });
28733
- var outputSchema100 = z100.discriminatedUnion("success", [
28734
- z100.object({
28735
- success: z100.literal(true),
28736
- status: z100.number(),
28737
- data: z100.record(z100.string(), z100.unknown())
28346
+ var outputSchema99 = z99.discriminatedUnion("success", [
28347
+ z99.object({
28348
+ success: z99.literal(true),
28349
+ status: z99.number(),
28350
+ data: z99.record(z99.string(), z99.unknown())
28738
28351
  }),
28739
- z100.object({
28740
- success: z100.literal(false),
28741
- error: z100.string()
28352
+ z99.object({
28353
+ success: z99.literal(false),
28354
+ error: z99.string()
28742
28355
  })
28743
28356
  ]);
28744
- var requestTool59 = new ConnectorTool({
28357
+ var requestTool58 = new ConnectorTool({
28745
28358
  name: "request",
28746
28359
  description: `Send authenticated GET requests to Microsoft Graph for Outlook Mail and Calendar.
28747
28360
  Authentication is handled automatically via OAuth proxy (Microsoft Entra ID).
28748
28361
  All paths are relative to https://graph.microsoft.com/v1.0. Use '/me' as the user prefix.
28749
28362
  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).
28750
28363
  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\`).`,
28751
- inputSchema: inputSchema100,
28752
- outputSchema: outputSchema100,
28364
+ inputSchema: inputSchema99,
28365
+ outputSchema: outputSchema99,
28753
28366
  async execute({ connectionId, method, path: path5, queryParams }, connections, config) {
28754
28367
  const connection2 = connections.find((c) => c.id === connectionId);
28755
28368
  if (!connection2) {
@@ -28762,8 +28375,8 @@ For full-text search use the \`$search\` query parameter (must be wrapped in dou
28762
28375
  `[connector-request] outlook-oauth/${connection2.name}: ${method} ${path5}`
28763
28376
  );
28764
28377
  try {
28765
- const normalizedPath = normalizeRequestPath(path5, BASE_PATH_SEGMENT17);
28766
- let url = `${BASE_URL43}${normalizedPath}`;
28378
+ const normalizedPath = normalizeRequestPath(path5, BASE_PATH_SEGMENT16);
28379
+ let url = `${BASE_URL42}${normalizedPath}`;
28767
28380
  if (queryParams) {
28768
28381
  const searchParams = new URLSearchParams(queryParams);
28769
28382
  url += `?${searchParams.toString()}`;
@@ -28771,7 +28384,7 @@ For full-text search use the \`$search\` query parameter (must be wrapped in dou
28771
28384
  const token = await getProxyToken33(config.oauthProxy);
28772
28385
  const proxyUrl = `https://${config.oauthProxy.sandboxId}.${config.oauthProxy.previewBaseDomain}/_sqcore/connections/${connectionId}/request`;
28773
28386
  const controller = new AbortController();
28774
- const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS77);
28387
+ const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS76);
28775
28388
  try {
28776
28389
  const response = await fetch(proxyUrl, {
28777
28390
  method: "POST",
@@ -28802,7 +28415,7 @@ For full-text search use the \`$search\` query parameter (must be wrapped in dou
28802
28415
  });
28803
28416
 
28804
28417
  // ../connectors/src/connectors/outlook-oauth/setup.ts
28805
- var requestToolName14 = `outlook-oauth_${requestTool59.name}`;
28418
+ var requestToolName14 = `outlook-oauth_${requestTool58.name}`;
28806
28419
  var outlookOnboarding = new ConnectorOnboarding({
28807
28420
  connectionSetupInstructions: {
28808
28421
  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
@@ -28859,17 +28472,17 @@ Calendar
28859
28472
  });
28860
28473
 
28861
28474
  // ../connectors/src/connectors/outlook-oauth/parameters.ts
28862
- var parameters83 = {};
28475
+ var parameters82 = {};
28863
28476
 
28864
28477
  // ../connectors/src/connectors/outlook-oauth/index.ts
28865
- var tools83 = { request: requestTool59 };
28478
+ var tools82 = { request: requestTool58 };
28866
28479
  var outlookOauthConnector = new ConnectorPlugin({
28867
28480
  slug: "outlook",
28868
28481
  authType: AUTH_TYPES.OAUTH,
28869
28482
  name: "Outlook",
28870
28483
  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.",
28871
- iconUrl: "https://upload.wikimedia.org/wikipedia/commons/d/df/Microsoft_Office_Outlook_%282018%E2%80%93present%29.svg",
28872
- parameters: parameters83,
28484
+ iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/1J1FrRTYJjOh3CcSIqsz3I/6a467b4d926075ff99dc60820e0ae4b1/Microsoft_Outlook_Icon__2025%C3%A2__present_.svg",
28485
+ parameters: parameters82,
28873
28486
  releaseFlag: { dev1: true, dev2: false, prod: false },
28874
28487
  categories: ["productivity"],
28875
28488
  onboarding: outlookOnboarding,
@@ -29149,7 +28762,7 @@ const events = await outlook.listCalendarView(
29149
28762
  events.value.forEach(e => console.log(e.start.dateTime, e.subject));
29150
28763
  \`\`\``
29151
28764
  },
29152
- tools: tools83,
28765
+ tools: tools82,
29153
28766
  async checkConnection(_params, config) {
29154
28767
  const { proxyFetch } = config;
29155
28768
  const url = "https://graph.microsoft.com/v1.0/me";
@@ -29253,7 +28866,6 @@ var plugins = {
29253
28866
  freshdesk: freshdeskConnector,
29254
28867
  freshsales: freshsalesConnector,
29255
28868
  github: githubConnector,
29256
- powerbi: powerbiConnector,
29257
28869
  powerbiOauth: powerbiOauthConnector,
29258
28870
  tableau: tableauConnector,
29259
28871
  outlookOauth: outlookOauthConnector
@@ -29729,62 +29341,62 @@ function createDbtClient(entry, slug) {
29729
29341
  var { getQuery, loadConnections, reloadEnvFile, watchConnectionsFile } = createConnectorRegistry();
29730
29342
 
29731
29343
  // src/types/server-logic.ts
29732
- import { z as z101 } from "zod";
29733
- var parameterMetaSchema = z101.object({
29734
- name: z101.string(),
29735
- type: z101.enum(["string", "number", "boolean"]),
29736
- description: z101.string(),
29737
- required: z101.boolean().optional(),
29738
- default: z101.union([z101.string(), z101.number(), z101.boolean()]).optional()
29739
- });
29740
- var serverLogicCacheConfigSchema = z101.object({
29741
- ttl: z101.number(),
29742
- staleWhileRevalidate: z101.boolean().optional()
29743
- });
29744
- var serverLogicSchemaObjectSchema = z101.lazy(
29745
- () => z101.object({
29746
- type: z101.enum(["string", "number", "integer", "boolean", "object", "array", "null"]).optional(),
29747
- format: z101.string().optional(),
29748
- description: z101.string().optional(),
29749
- nullable: z101.boolean().optional(),
29750
- enum: z101.array(z101.union([z101.string(), z101.number(), z101.boolean(), z101.null()])).optional(),
29344
+ import { z as z100 } from "zod";
29345
+ var parameterMetaSchema = z100.object({
29346
+ name: z100.string(),
29347
+ type: z100.enum(["string", "number", "boolean"]),
29348
+ description: z100.string(),
29349
+ required: z100.boolean().optional(),
29350
+ default: z100.union([z100.string(), z100.number(), z100.boolean()]).optional()
29351
+ });
29352
+ var serverLogicCacheConfigSchema = z100.object({
29353
+ ttl: z100.number(),
29354
+ staleWhileRevalidate: z100.boolean().optional()
29355
+ });
29356
+ var serverLogicSchemaObjectSchema = z100.lazy(
29357
+ () => z100.object({
29358
+ type: z100.enum(["string", "number", "integer", "boolean", "object", "array", "null"]).optional(),
29359
+ format: z100.string().optional(),
29360
+ description: z100.string().optional(),
29361
+ nullable: z100.boolean().optional(),
29362
+ enum: z100.array(z100.union([z100.string(), z100.number(), z100.boolean(), z100.null()])).optional(),
29751
29363
  items: serverLogicSchemaObjectSchema.optional(),
29752
- properties: z101.record(z101.string(), serverLogicSchemaObjectSchema).optional(),
29753
- required: z101.array(z101.string()).optional(),
29754
- additionalProperties: z101.union([z101.boolean(), serverLogicSchemaObjectSchema]).optional(),
29755
- minimum: z101.number().optional(),
29756
- maximum: z101.number().optional(),
29757
- minLength: z101.number().optional(),
29758
- maxLength: z101.number().optional(),
29759
- pattern: z101.string().optional()
29364
+ properties: z100.record(z100.string(), serverLogicSchemaObjectSchema).optional(),
29365
+ required: z100.array(z100.string()).optional(),
29366
+ additionalProperties: z100.union([z100.boolean(), serverLogicSchemaObjectSchema]).optional(),
29367
+ minimum: z100.number().optional(),
29368
+ maximum: z100.number().optional(),
29369
+ minLength: z100.number().optional(),
29370
+ maxLength: z100.number().optional(),
29371
+ pattern: z100.string().optional()
29760
29372
  })
29761
29373
  );
29762
- var serverLogicMediaTypeSchema = z101.object({
29374
+ var serverLogicMediaTypeSchema = z100.object({
29763
29375
  schema: serverLogicSchemaObjectSchema.optional(),
29764
- example: z101.unknown().optional()
29376
+ example: z100.unknown().optional()
29765
29377
  });
29766
- var serverLogicResponseSchema = z101.object({
29767
- description: z101.string().optional(),
29768
- content: z101.record(z101.string(), serverLogicMediaTypeSchema).optional()
29378
+ var serverLogicResponseSchema = z100.object({
29379
+ description: z100.string().optional(),
29380
+ content: z100.record(z100.string(), serverLogicMediaTypeSchema).optional()
29769
29381
  });
29770
29382
  var jsonBaseFields = {
29771
- description: z101.string(),
29772
- parameters: z101.array(parameterMetaSchema).optional(),
29383
+ description: z100.string(),
29384
+ parameters: z100.array(parameterMetaSchema).optional(),
29773
29385
  response: serverLogicResponseSchema.optional(),
29774
29386
  cache: serverLogicCacheConfigSchema.optional()
29775
29387
  };
29776
- var jsonSqlServerLogicSchema = z101.object({
29388
+ var jsonSqlServerLogicSchema = z100.object({
29777
29389
  ...jsonBaseFields,
29778
- type: z101.literal("sql").optional(),
29779
- query: z101.string(),
29780
- connectionId: z101.string()
29390
+ type: z100.literal("sql").optional(),
29391
+ query: z100.string(),
29392
+ connectionId: z100.string()
29781
29393
  });
29782
- var jsonTypeScriptServerLogicSchema = z101.object({
29394
+ var jsonTypeScriptServerLogicSchema = z100.object({
29783
29395
  ...jsonBaseFields,
29784
- type: z101.literal("typescript"),
29785
- handlerPath: z101.string()
29396
+ type: z100.literal("typescript"),
29397
+ handlerPath: z100.string()
29786
29398
  });
29787
- var anyJsonServerLogicSchema = z101.union([
29399
+ var anyJsonServerLogicSchema = z100.union([
29788
29400
  jsonTypeScriptServerLogicSchema,
29789
29401
  jsonSqlServerLogicSchema
29790
29402
  ]);