powerautomate-mcp 0.7.0 → 0.7.1
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 +25 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -259,7 +259,7 @@ function createChildLogger(bindings) {
|
|
|
259
259
|
}
|
|
260
260
|
|
|
261
261
|
// src/utils/constants.ts
|
|
262
|
-
var POWER_PLATFORM_API_BASE = "https://api.
|
|
262
|
+
var POWER_PLATFORM_API_BASE = "https://api.bap.microsoft.com";
|
|
263
263
|
var FLOW_API_BASE = "https://api.flow.microsoft.com";
|
|
264
264
|
var POWERAPPS_API_BASE = "https://api.powerapps.com";
|
|
265
265
|
var POWER_PLATFORM_API_VERSION = "2022-03-01-preview";
|
|
@@ -283,7 +283,9 @@ var ALLOWED_TOKEN_DOMAINS = [
|
|
|
283
283
|
"sharepoint.com",
|
|
284
284
|
"office.com",
|
|
285
285
|
"azure.com",
|
|
286
|
-
"windows.net"
|
|
286
|
+
"windows.net",
|
|
287
|
+
"powerplatform.com",
|
|
288
|
+
"powerapps.com"
|
|
287
289
|
];
|
|
288
290
|
function isAllowedTokenDomain(hostname) {
|
|
289
291
|
const lower = hostname.toLowerCase().replace(/\.+$/, "");
|
|
@@ -1974,7 +1976,7 @@ var ConnectorMetadataApi = class {
|
|
|
1974
1976
|
var RESOURCES = {
|
|
1975
1977
|
FLOW_SERVICE: "https://service.flow.microsoft.com",
|
|
1976
1978
|
POWERAPPS_SERVICE: "https://service.powerapps.com",
|
|
1977
|
-
POWER_PLATFORM: "https://api.
|
|
1979
|
+
POWER_PLATFORM: "https://api.bap.microsoft.com",
|
|
1978
1980
|
GRAPH: "https://graph.microsoft.com"
|
|
1979
1981
|
};
|
|
1980
1982
|
|
|
@@ -2749,7 +2751,14 @@ var PowerPlatformAdminApi = class {
|
|
|
2749
2751
|
};
|
|
2750
2752
|
}
|
|
2751
2753
|
buildUrl(path, queryParams) {
|
|
2752
|
-
|
|
2754
|
+
let resolvedPath = path;
|
|
2755
|
+
if (path.startsWith("/providers/") && !path.includes("/scopes/admin/")) {
|
|
2756
|
+
resolvedPath = path.replace(
|
|
2757
|
+
"/providers/Microsoft.BusinessAppPlatform/",
|
|
2758
|
+
"/providers/Microsoft.BusinessAppPlatform/scopes/admin/"
|
|
2759
|
+
);
|
|
2760
|
+
}
|
|
2761
|
+
const base = `${POWER_PLATFORM_API_BASE}${resolvedPath}`;
|
|
2753
2762
|
const params = new URLSearchParams();
|
|
2754
2763
|
params.set("api-version", POWER_PLATFORM_API_VERSION);
|
|
2755
2764
|
if (queryParams) {
|
|
@@ -15237,6 +15246,18 @@ async function runSetupWizard() {
|
|
|
15237
15246
|
} else {
|
|
15238
15247
|
print(` ${icons.check} ${c.green}Signed in${c.reset}`);
|
|
15239
15248
|
}
|
|
15249
|
+
const additionalResources = [
|
|
15250
|
+
"https://api.bap.microsoft.com",
|
|
15251
|
+
"https://service.powerapps.com"
|
|
15252
|
+
];
|
|
15253
|
+
for (const resource of additionalResources) {
|
|
15254
|
+
try {
|
|
15255
|
+
await authProvider.getTokenForResource(resource);
|
|
15256
|
+
print(` ${icons.check} ${c.dim}Authorized ${resource.replace("https://", "")}${c.reset}`);
|
|
15257
|
+
} catch {
|
|
15258
|
+
print(` ${c.dim}${icons.warn} Could not authorize ${resource.replace("https://", "")} (admin tools may be limited)${c.reset}`);
|
|
15259
|
+
}
|
|
15260
|
+
}
|
|
15240
15261
|
} catch (error) {
|
|
15241
15262
|
const message = error instanceof Error ? error.message : String(error);
|
|
15242
15263
|
print(` ${icons.cross} ${c.red}Sign-in failed:${c.reset} ${message}`);
|