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