push neon reactor

This commit is contained in:
2026-07-12 15:11:38 +02:00
parent 172e72dbcd
commit aeab5f7820
9597 changed files with 2407488 additions and 0 deletions
@@ -0,0 +1,25 @@
/*!
* Copyright (C) Microsoft Corporation. All rights reserved.
*/
import type { AppMetadata, ConnectionReference, Environment, ParameterHint } from '../types/AppMetadata.js';
import type { ConnectionInstance } from '../types/ConnectionTypes.js';
import type { UserConsent } from '../types/ConsentTypes.js';
import type { ConnectorsApi } from './api/ConnectorsApi.js';
import type { IConnectionService } from './IConnectionService.js';
/** Default connection service that delegates HTTP calls to ConnectorsApi. */
export declare class ConnectionService implements IConnectionService {
private readonly api;
constructor(api: ConnectorsApi);
saveUserConsents(appName: string, consents: UserConsent[]): Promise<void>;
getConnectionConsent(connection: ConnectionInstance, options?: {
disableManualLogin?: boolean;
}): Promise<void>;
isSsoAuthValid(connection: ConnectionInstance): boolean;
getConnectionById(connectionId: string, _bypassCache?: boolean): Promise<ConnectionInstance | null>;
testConnection(connection: ConnectionInstance): Promise<void>;
getConnection(connectionName: string, _apiId: string): Promise<ConnectionInstance>;
createCompositeConnection(apiId: string, environment: Environment, dependencyTable: Record<string, string>, parameterHints: Record<string, ParameterHint>, connectionName?: string): Promise<string | ConnectionInstance>;
saveConnectionUsage(apiShortName: string, connectionName: string, environmentName: string, reference: string, resourceId: string, appActions: string[]): Promise<void>;
runDisambiguationRules(missingConnections: Record<string, ConnectionReference>, _appMetadata: AppMetadata, _appName?: string): Promise<Record<string, ConnectionReference>>;
}
//# sourceMappingURL=ConnectionService.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"ConnectionService.d.ts","sourceRoot":"","sources":["../../src/services/ConnectionService.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,mBAAmB,EACnB,WAAW,EACX,aAAa,EACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,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,UAAU,EAAE,MAAM,EAAE,GACnB,OAAO,CAAC,IAAI,CAAC;IAQV,sBAAsB,CAC1B,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,EACvD,YAAY,EAAE,WAAW,EACzB,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;CAIhD"}
@@ -0,0 +1,55 @@
/*!
* Copyright (C) Microsoft Corporation. All rights reserved.
*/
/** Default connection service that delegates HTTP calls to ConnectorsApi. */
export class ConnectionService {
api;
constructor(api) {
this.api = api;
}
async saveUserConsents(appName, consents) {
await this.api.saveUserConsents(appName, consents);
}
async getConnectionConsent(connection, options) {
await this.api.requestConnectionConsent(connection.name, {
disableManualLogin: options?.disableManualLogin,
});
}
isSsoAuthValid(connection) {
return connection.isOAuthConnection === true && !connection.isAuthenticated;
}
async getConnectionById(connectionId, _bypassCache) {
try {
return await this.api.getConnectionById(connectionId);
}
catch {
return null;
}
}
async testConnection(connection) {
await this.api.testConnection(connection.name);
}
async getConnection(connectionName, _apiId) {
return this.api.getConnection(connectionName);
}
async createCompositeConnection(apiId, environment, dependencyTable, parameterHints, connectionName) {
return this.api.createCompositeConnection(apiId, {
environment: environment.name,
dependencyTable,
parameterHints,
connectionName,
});
}
async saveConnectionUsage(apiShortName, connectionName, environmentName, reference, resourceId, appActions) {
await this.api.saveConnectionUsage(apiShortName, connectionName, environmentName, {
reference,
resourceId,
appActions,
});
}
async runDisambiguationRules(missingConnections, _appMetadata, _appName) {
// Default: return missing connections as-is (no auto-mapping).
return missingConnections;
}
}
//# sourceMappingURL=ConnectionService.js.map
@@ -0,0 +1 @@
{"version":3,"file":"ConnectionService.js","sourceRoot":"","sources":["../../src/services/ConnectionService.ts"],"names":[],"mappings":"AAAA;;GAEG;AAaH,6EAA6E;AAC7E,MAAM,OAAO,iBAAiB;IACC;IAA7B,YAA6B,GAAkB;QAAlB,QAAG,GAAH,GAAG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AmB,CACvB,YAAoB,EACpB,cAAsB,EACtB,eAAuB,EACvB,SAAiB,EACjB,UAAkB,EAClB,UAAoB;QAEpB,MAAM,IAAI,CAAC,GAAG,CAAC,mBAAmB,CAAC,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE;YAChF,SAAS;YACT,UAAU;YACV,UAAU;SACX,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,sBAAsB,CAC1B,kBAAuD,EACvD,YAAyB,EACzB,QAAiB;QAEjB,+DAA+D;QAC/D,OAAO,kBAAkB,CAAC;IAC5B,CAAC;CACF"}
@@ -0,0 +1,30 @@
/*!
* Copyright (C) Microsoft Corporation. All rights reserved.
*/
import type { AppMetadata, ConnectionReference, Environment, ParameterHint } from '../types/AppMetadata.js';
import type { ConnectionInstance } from '../types/ConnectionTypes.js';
import type { UserConsent } from '../types/ConsentTypes.js';
/** Abstracts RP connection operations. */
export interface IConnectionService {
/** Save user consents for an app to RP. */
saveUserConsents(appName: string, consents: UserConsent[]): Promise<void>;
/** Attempt SSO consent for a connection (silent auth). */
getConnectionConsent(connection: ConnectionInstance, options?: {
disableManualLogin?: boolean;
}): Promise<void>;
/** Check if SSO auth is valid for a connection. */
isSsoAuthValid(connection: ConnectionInstance): boolean;
/** Get a connection by ID, optionally bypassing cache. */
getConnectionById(connectionId: string, bypassCache?: boolean): Promise<ConnectionInstance | null>;
/** Test a connection via wrapper API. */
testConnection(connection: ConnectionInstance): Promise<void>;
/** Get a connection by name and API ID. */
getConnection(connectionName: string, apiId: string): Promise<ConnectionInstance>;
/** Create or update a composite connection (for flows). */
createCompositeConnection(apiId: string, environment: Environment, dependencyTable: Record<string, string>, parameterHints: Record<string, ParameterHint>, connectionName?: string): Promise<string | ConnectionInstance>;
/** Save a connection usage (bind a connection to an app reference). */
saveConnectionUsage(apiShortName: string, connectionName: string, environmentName: string, reference: string, resourceId: string, appActions: string[]): Promise<void>;
/** Run disambiguation rules to auto-map connections. */
runDisambiguationRules(missingConnections: Record<string, ConnectionReference>, appMetadata: AppMetadata, appName?: string): Promise<Record<string, ConnectionReference>>;
}
//# sourceMappingURL=IConnectionService.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"IConnectionService.d.ts","sourceRoot":"","sources":["../../src/services/IConnectionService.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,mBAAmB,EACnB,WAAW,EACX,aAAa,EACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,0CAA0C;AAC1C,MAAM,WAAW,kBAAkB;IACjC,2CAA2C;IAC3C,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1E,0DAA0D;IAC1D,oBAAoB,CAClB,UAAU,EAAE,kBAAkB,EAC9B,OAAO,CAAC,EAAE;QAAE,kBAAkB,CAAC,EAAE,OAAO,CAAA;KAAE,GACzC,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB,mDAAmD;IACnD,cAAc,CAAC,UAAU,EAAE,kBAAkB,GAAG,OAAO,CAAC;IAExD,0DAA0D;IAC1D,iBAAiB,CACf,YAAY,EAAE,MAAM,EACpB,WAAW,CAAC,EAAE,OAAO,GACpB,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;IAEtC,yCAAyC;IACzC,cAAc,CAAC,UAAU,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9D,2CAA2C;IAC3C,aAAa,CAAC,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAElF,2DAA2D;IAC3D,yBAAyB,CACvB,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACvC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,EAC7C,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,MAAM,GAAG,kBAAkB,CAAC,CAAC;IAExC,uEAAuE;IACvE,mBAAmB,CACjB,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,MAAM,EACtB,eAAe,EAAE,MAAM,EACvB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAAE,GACnB,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB,wDAAwD;IACxD,sBAAsB,CACpB,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,EACvD,WAAW,EAAE,WAAW,EACxB,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC;CACjD"}
@@ -0,0 +1,5 @@
/*!
* Copyright (C) Microsoft Corporation. All rights reserved.
*/
export {};
//# sourceMappingURL=IConnectionService.js.map
@@ -0,0 +1 @@
{"version":3,"file":"IConnectionService.js","sourceRoot":"","sources":["../../src/services/IConnectionService.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -0,0 +1,31 @@
/*!
* Copyright (C) Microsoft Corporation. All rights reserved.
*/
import type { Region } from './Regions.js';
/**
* Map a Power Platform region to the corresponding web player base URL.
* Falls back to the prod URL when the region is undefined or unrecognised.
*
* NOTE: The 'local' region is mapped to the prod URL so local development can
* still launch flows that target a production-shape player (the player itself
* does not have a "local" build).
*/
export declare function getMaafPlayerBaseUrl(region: Region | undefined): string;
export interface MaafConnectionUrlOptions {
/** The connector name (e.g. `shared_sql`). */
connector: string;
/** The localhost callback URL the page will redirect to after completion. */
callbackUrl: string;
/** One-time nonce for CSRF verification. */
nonce: string;
/** Protocol version for drift detection between CLI and player. */
protocolVersion: string;
}
/**
* Build the URL that opens the connection creation dialog in the
* Microsoft Apps web player.
*
* Shape: `${baseUrl}/appframework/e/${environmentId}/connections/new?connector=...&callbackUrl=...&nonce=...&v=...`
*/
export declare function createMaafConnectionUrl(region: Region | undefined, environmentId: string, options: MaafConnectionUrlOptions): string;
//# sourceMappingURL=MaafPlayerUrls.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"MaafPlayerUrls.d.ts","sourceRoot":"","sources":["../../src/services/MaafPlayerUrls.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CA2BvE;AAED,MAAM,WAAW,wBAAwB;IACvC,8CAA8C;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,6EAA6E;IAC7E,WAAW,EAAE,MAAM,CAAC;IACpB,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,wBAAwB,GAChC,MAAM,CAUR"}
@@ -0,0 +1,54 @@
/*!
* Copyright (C) Microsoft Corporation. All rights reserved.
*/
/**
* Map a Power Platform region to the corresponding web player base URL.
* Falls back to the prod URL when the region is undefined or unrecognised.
*
* NOTE: The 'local' region is mapped to the prod URL so local development can
* still launch flows that target a production-shape player (the player itself
* does not have a "local" build).
*/
export function getMaafPlayerBaseUrl(region) {
switch (region) {
case 'dev':
return 'https://apps.dev.powerapps.com';
case 'test':
return 'https://apps.test.powerapps.com';
case 'preprod':
return 'https://apps.preprod.powerapps.com';
case 'preview':
return 'https://apps.preview.powerapps.com';
case 'gccmoderate':
return 'https://apps.gov.powerapps.us';
case 'gcchigh':
return 'https://apps.high.powerapps.us';
case 'dod':
return 'https://play.apps.appsplatform.us';
case 'mooncake':
return 'https://apps.powerapps.cn';
case 'ex':
return 'https://apps.powerapps.eaglex.ic.gov';
case 'rx':
return 'https://apps.powerapps.microsoft.scloud';
case 'local':
case 'prod':
default:
return 'https://apps.powerapps.com';
}
}
/**
* Build the URL that opens the connection creation dialog in the
* Microsoft Apps web player.
*
* Shape: `${baseUrl}/appframework/e/${environmentId}/connections/new?connector=...&callbackUrl=...&nonce=...&v=...`
*/
export function createMaafConnectionUrl(region, environmentId, options) {
const url = new URL(`/appframework/e/${environmentId}/connections/new`, getMaafPlayerBaseUrl(region));
url.searchParams.set('connector', options.connector);
url.searchParams.set('callbackUrl', options.callbackUrl);
url.searchParams.set('nonce', options.nonce);
url.searchParams.set('v', options.protocolVersion);
return url.toString();
}
//# sourceMappingURL=MaafPlayerUrls.js.map
@@ -0,0 +1 @@
{"version":3,"file":"MaafPlayerUrls.js","sourceRoot":"","sources":["../../src/services/MaafPlayerUrls.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAA0B;IAC7D,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,KAAK;YACR,OAAO,gCAAgC,CAAC;QAC1C,KAAK,MAAM;YACT,OAAO,iCAAiC,CAAC;QAC3C,KAAK,SAAS;YACZ,OAAO,oCAAoC,CAAC;QAC9C,KAAK,SAAS;YACZ,OAAO,oCAAoC,CAAC;QAC9C,KAAK,aAAa;YAChB,OAAO,+BAA+B,CAAC;QACzC,KAAK,SAAS;YACZ,OAAO,gCAAgC,CAAC;QAC1C,KAAK,KAAK;YACR,OAAO,mCAAmC,CAAC;QAC7C,KAAK,UAAU;YACb,OAAO,2BAA2B,CAAC;QACrC,KAAK,IAAI;YACP,OAAO,sCAAsC,CAAC;QAChD,KAAK,IAAI;YACP,OAAO,yCAAyC,CAAC;QACnD,KAAK,OAAO,CAAC;QACb,KAAK,MAAM,CAAC;QACZ;YACE,OAAO,4BAA4B,CAAC;IACxC,CAAC;AACH,CAAC;AAaD;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CACrC,MAA0B,EAC1B,aAAqB,EACrB,OAAiC;IAEjC,MAAM,GAAG,GAAG,IAAI,GAAG,CACjB,mBAAmB,aAAa,kBAAkB,EAClD,oBAAoB,CAAC,MAAM,CAAC,CAC7B,CAAC;IACF,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IACrD,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IACzD,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IAC7C,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IACnD,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;AACxB,CAAC"}
@@ -0,0 +1,34 @@
/*!
* Copyright (C) Microsoft Corporation. All rights reserved.
*/
/**
* DO NOT MODIFY — This file mirrors the Power Platform API discovery logic
* from the platform service. Changes must be validated against the original
* source before being applied.
*/
import type { ClusterCategory } from '../types/ClusterCategory.js';
/**
* Resolves Power Platform API endpoints for tenant- and environment-scoped URLs.
*
* Each cluster category maps to a hostname suffix (e.g. `api.powerplatform.com` for prod).
* Tenant/environment endpoints encode the identifier into the hostname using hex-encoding
* conventions defined by the Power Platform API infrastructure.
*/
export declare class PowerPlatformApiDiscovery {
readonly clusterCategory: ClusterCategory;
constructor(clusterCategory: ClusterCategory);
/** Token audience for the Power Platform API in this cluster. */
getTokenAudience(): string;
/** Token endpoint host for the Power Platform API in this cluster. */
getTokenEndpointHost(): string;
/** Resolve a tenant-scoped endpoint URL. */
getTenantEndpoint(tenantId: string): string;
/** Resolve a tenant island-cluster endpoint URL. */
getTenantIslandClusterEndpoint(tenantId: string): string;
/** Resolve an environment-scoped endpoint URL. */
getEnvironmentEndpoint(environmentName: string): string;
private generateDomain;
private getHexApiSuffixLength;
private getHostNameSuffix;
}
//# sourceMappingURL=PowerPlatformApiDiscovery.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"PowerPlatformApiDiscovery.d.ts","sourceRoot":"","sources":["../../src/services/PowerPlatformApiDiscovery.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEhE;;;;;;GAMG;AACH,qBAAa,yBAAyB;IACpC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;gBAE9B,eAAe,EAAE,eAAe;IAI5C,iEAAiE;IACjE,gBAAgB,IAAI,MAAM;IAI1B,sEAAsE;IACtE,oBAAoB,IAAI,MAAM;IAI9B,4CAA4C;IAC5C,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAI3C,oDAAoD;IACpD,8BAA8B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAIxD,kDAAkD;IAClD,sBAAsB,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM;IAQvD,OAAO,CAAC,cAAc;IA6BtB,OAAO,CAAC,qBAAqB;IAU7B,OAAO,CAAC,iBAAiB;CA2B1B"}
@@ -0,0 +1,90 @@
/*!
* Copyright (C) Microsoft Corporation. All rights reserved.
*/
/**
* Resolves Power Platform API endpoints for tenant- and environment-scoped URLs.
*
* Each cluster category maps to a hostname suffix (e.g. `api.powerplatform.com` for prod).
* Tenant/environment endpoints encode the identifier into the hostname using hex-encoding
* conventions defined by the Power Platform API infrastructure.
*/
export class PowerPlatformApiDiscovery {
clusterCategory;
constructor(clusterCategory) {
this.clusterCategory = clusterCategory;
}
/** Token audience for the Power Platform API in this cluster. */
getTokenAudience() {
return `https://${this.getHostNameSuffix()}`;
}
/** Token endpoint host for the Power Platform API in this cluster. */
getTokenEndpointHost() {
return this.getHostNameSuffix();
}
/** Resolve a tenant-scoped endpoint URL. */
getTenantEndpoint(tenantId) {
return this.generateDomain(tenantId, 'tenant');
}
/** Resolve a tenant island-cluster endpoint URL. */
getTenantIslandClusterEndpoint(tenantId) {
return this.generateDomain(tenantId, 'tenant', 'il-');
}
/** Resolve an environment-scoped endpoint URL. */
getEnvironmentEndpoint(environmentName) {
return this.generateDomain(environmentName, 'environment');
}
// ---------------------------------------------------------------------------
// Private helpers
// ---------------------------------------------------------------------------
generateDomain(hostNameIdentifier, hostNameInfix, hostNamePrefix = '') {
if (!/^[a-zA-Z0-9-]+$/g.test(hostNameIdentifier)) {
throw new Error(`Cannot generate Power Platform API endpoint because the ${hostNameInfix} identifier contains invalid host name characters, only alphanumeric and dash characters are expected: ${hostNameIdentifier}`);
}
const hexNameSuffixLength = this.getHexApiSuffixLength();
const hexName = hostNameIdentifier.toLowerCase().replace(/-/g, '');
if (hexNameSuffixLength >= hexName.length) {
throw new Error(`Cannot generate Power Platform API endpoint because the normalized ${hostNameInfix} identifier must be at least ${hexNameSuffixLength + 1} characters in length: ${hexName}`);
}
const hexNameSuffix = hexName.substring(hexName.length - hexNameSuffixLength);
const hexNamePrefix = hexName.substring(0, hexName.length - hexNameSuffixLength);
const hostNameSuffix = this.getHostNameSuffix();
return `${hostNamePrefix}${hexNamePrefix}.${hexNameSuffix}.${hostNameInfix}.${hostNameSuffix}`;
}
getHexApiSuffixLength() {
switch (this.clusterCategory) {
case 'firstrelease':
case 'prod':
return 2;
default:
return 1;
}
}
getHostNameSuffix() {
switch (this.clusterCategory) {
case 'local':
return 'api.powerplatform.localhost';
case 'dev':
return 'api.dev.powerplatform.com';
case 'test':
return 'api.test.powerplatform.com';
case 'preprod':
return 'api.preprod.powerplatform.com';
case 'firstrelease':
case 'prod':
return 'api.powerplatform.com';
case 'gov':
return 'api.gov.powerplatform.microsoft.us';
case 'high':
return 'api.high.powerplatform.microsoft.us';
case 'dod':
return 'api.appsplatform.us';
case 'mooncake':
return 'api.powerplatform.partner.microsoftonline.cn';
case 'ex':
return 'api.powerplatform.eaglex.ic.gov';
case 'rx':
return 'api.powerplatform.microsoft.scloud';
}
}
}
//# sourceMappingURL=PowerPlatformApiDiscovery.js.map
@@ -0,0 +1 @@
{"version":3,"file":"PowerPlatformApiDiscovery.js","sourceRoot":"","sources":["../../src/services/PowerPlatformApiDiscovery.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH;;;;;;GAMG;AACH,MAAM,OAAO,yBAAyB;IAC3B,eAAe,CAAkB;IAE1C,YAAY,eAAgC;QAC1C,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;IACzC,CAAC;IAED,iEAAiE;IACjE,gBAAgB;QACd,OAAO,WAAW,IAAI,CAAC,iBAAiB,EAAE,EAAE,CAAC;IAC/C,CAAC;IAED,sEAAsE;IACtE,oBAAoB;QAClB,OAAO,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAClC,CAAC;IAED,4CAA4C;IAC5C,iBAAiB,CAAC,QAAgB;QAChC,OAAO,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACjD,CAAC;IAED,oDAAoD;IACpD,8BAA8B,CAAC,QAAgB;QAC7C,OAAO,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;IACxD,CAAC;IAED,kDAAkD;IAClD,sBAAsB,CAAC,eAAuB;QAC5C,OAAO,IAAI,CAAC,cAAc,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC;IAC7D,CAAC;IAED,8EAA8E;IAC9E,kBAAkB;IAClB,8EAA8E;IAEtE,cAAc,CACpB,kBAA0B,EAC1B,aAAuC,EACvC,iBAAyB,EAAE;QAE3B,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC;YACjD,MAAM,IAAI,KAAK,CACb,2DAA2D,aAAa,0GAA0G,kBAAkB,EAAE,CACvM,CAAC;QAC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,MAAM;gBACT,OAAO,qCAAqC,CAAC;YAC/C,KAAK,KAAK;gBACR,OAAO,qBAAqB,CAAC;YAC/B,KAAK,UAAU;gBACb,OAAO,8CAA8C,CAAC;YACxD,KAAK,IAAI;gBACP,OAAO,iCAAiC,CAAC;YAC3C,KAAK,IAAI;gBACP,OAAO,oCAAoC,CAAC;QAChD,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,7 @@
/*!
* Copyright (C) Microsoft Corporation. All rights reserved.
*/
export declare const Regions: readonly ["local", "dev", "test", "preprod", "preview", "prod", "gccmoderate", "gcchigh", "dod", "mooncake", "ex", "rx"];
export type Region = (typeof Regions)[number];
export type NonLocalRegion = Exclude<Region, 'local' | 'dev'>;
//# sourceMappingURL=Regions.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"Regions.d.ts","sourceRoot":"","sources":["../../src/services/Regions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,OAAO,0HAaV,CAAC;AAEX,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAC9C,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,EAAE,OAAO,GAAG,KAAK,CAAC,CAAC"}
@@ -0,0 +1,18 @@
/*!
* Copyright (C) Microsoft Corporation. All rights reserved.
*/
export const Regions = [
'local',
'dev',
'test',
'preprod',
'preview',
'prod',
'gccmoderate',
'gcchigh',
'dod',
'mooncake',
'ex',
'rx',
];
//# sourceMappingURL=Regions.js.map
@@ -0,0 +1 @@
{"version":3,"file":"Regions.js","sourceRoot":"","sources":["../../src/services/Regions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,OAAO;IACP,KAAK;IACL,MAAM;IACN,SAAS;IACT,SAAS;IACT,MAAM;IACN,aAAa;IACb,SAAS;IACT,KAAK;IACL,UAAU;IACV,IAAI;IACJ,IAAI;CACI,CAAC"}
@@ -0,0 +1,28 @@
/*!
* Copyright (C) Microsoft Corporation. All rights reserved.
*/
import type { HttpRequestConfig } from '../http/HttpTypes.js';
/**
* Header value: a static string or a function called per-request to produce a value.
*
* Use a function for values that must be unique per request (e.g. `() => crypto.randomUUID()`
* for correlation IDs). The resolved values are sent with the request and logged in telemetry.
*/
export type HeaderValue = string | (() => string);
/** Describes a service endpoint for creating pre-authenticated HTTP clients. */
export interface ServiceEndpoint {
/** Base URL prepended to all requests (e.g. 'https://api.powerapps.com'). */
baseUrl: string;
/** Token resource identifier (e.g. 'https://service.powerapps.com'). */
resource: string;
/**
* Headers included in every request to this endpoint. Values can be static strings or
* functions called per-request (e.g. `() => crypto.randomUUID()` for correlation IDs).
* Resolved values are logged as telemetry properties alongside the request event.
* Per-request headers from `HttpRequestConfig.headers` take precedence over these.
*/
headers?: Record<string, HeaderValue>;
/** Derive telemetry properties from the request config (e.g. parse apiId from URL). */
extractTelemetryProperties?: (config: HttpRequestConfig) => Record<string, unknown>;
}
//# sourceMappingURL=ServiceEndpoint.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"ServiceEndpoint.d.ts","sourceRoot":"","sources":["../../src/services/ServiceEndpoint.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,CAAC;AAElD,gFAAgF;AAChF,MAAM,WAAW,eAAe;IAC9B,6EAA6E;IAC7E,OAAO,EAAE,MAAM,CAAC;IAChB,wEAAwE;IACxE,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACtC,uFAAuF;IACvF,0BAA0B,CAAC,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrF"}
@@ -0,0 +1,5 @@
/*!
* Copyright (C) Microsoft Corporation. All rights reserved.
*/
export {};
//# sourceMappingURL=ServiceEndpoint.js.map
@@ -0,0 +1 @@
{"version":3,"file":"ServiceEndpoint.js","sourceRoot":"","sources":["../../src/services/ServiceEndpoint.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -0,0 +1,10 @@
/*!
* Copyright (C) Microsoft Corporation. All rights reserved.
*/
import type { ClusterCategory } from '../types/ClusterCategory.js';
import type { ServiceEndpoint } from './ServiceEndpoint.js';
/** Create a ServiceEndpoint for an environment-scoped Power Platform API URL. */
export declare function createPowerPlatformApiEnvironmentEndpoint(environmentName: string, cluster: ClusterCategory): ServiceEndpoint;
/** Create a Dataverse endpoint for a specific instance URL. */
export declare function createDataverseEndpoint(instanceUrl: string): ServiceEndpoint;
//# sourceMappingURL=ServiceEndpoints.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"ServiceEndpoints.d.ts","sourceRoot":"","sources":["../../src/services/ServiceEndpoints.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,iFAAiF;AACjF,wBAAgB,yCAAyC,CACvD,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,eAAe,GACvB,eAAe,CAMjB;AAED,+DAA+D;AAC/D,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,MAAM,GAAG,eAAe,CAM5E"}
@@ -0,0 +1,21 @@
/*!
* Copyright (C) Microsoft Corporation. All rights reserved.
*/
import { PowerPlatformApiDiscovery } from './PowerPlatformApiDiscovery.js';
/** Create a ServiceEndpoint for an environment-scoped Power Platform API URL. */
export function createPowerPlatformApiEnvironmentEndpoint(environmentName, cluster) {
const discovery = new PowerPlatformApiDiscovery(cluster);
return {
baseUrl: `https://${discovery.getEnvironmentEndpoint(environmentName)}`,
resource: discovery.getTokenAudience(),
};
}
/** Create a Dataverse endpoint for a specific instance URL. */
export function createDataverseEndpoint(instanceUrl) {
const normalized = instanceUrl.replace(/\/$/, '');
return {
baseUrl: `${normalized}/api/data/v9.2`,
resource: normalized,
};
}
//# sourceMappingURL=ServiceEndpoints.js.map
@@ -0,0 +1 @@
{"version":3,"file":"ServiceEndpoints.js","sourceRoot":"","sources":["../../src/services/ServiceEndpoints.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAGxE,iFAAiF;AACjF,MAAM,UAAU,yCAAyC,CACvD,eAAuB,EACvB,OAAwB;IAExB,MAAM,SAAS,GAAG,IAAI,yBAAyB,CAAC,OAAO,CAAC,CAAC;IACzD,OAAO;QACL,OAAO,EAAE,WAAW,SAAS,CAAC,sBAAsB,CAAC,eAAe,CAAC,EAAE;QACvE,QAAQ,EAAE,SAAS,CAAC,gBAAgB,EAAE;KACvC,CAAC;AACJ,CAAC;AAED,+DAA+D;AAC/D,MAAM,UAAU,uBAAuB,CAAC,WAAmB;IACzD,MAAM,UAAU,GAAG,WAAW,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAClD,OAAO;QACL,OAAO,EAAE,GAAG,UAAU,gBAAgB;QACtC,QAAQ,EAAE,UAAU;KACrB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,42 @@
/*!
* Copyright (C) Microsoft Corporation. All rights reserved.
*/
import type { HttpClient } from '../../http/HttpClient.js';
import type { RpConnection } from '../../types/AppMetadata.js';
import type { ClusterCategory } from '../../types/ClusterCategory.js';
import type { ConnectionInstance } from '../../types/ConnectionTypes.js';
import type { UserConsent } from '../../types/ConsentTypes.js';
/** Typed API client for Power Platform connector/connection endpoints. No business logic. */
export declare class ConnectorsApi {
private readonly httpClient;
private readonly env;
constructor(httpClient: HttpClient, clusterCategory: ClusterCategory, environmentName: string);
/** Fetch all connections in the environment (with expanded API metadata). */
getConnections(): Promise<RpConnection[]>;
/** Get a connection by name. */
getConnection(connectionName: string): Promise<ConnectionInstance>;
/** Get a connection by its ID. */
getConnectionById(connectionId: string): Promise<ConnectionInstance>;
/** Test a connection via the wrapper API. */
testConnection(connectionName: string): Promise<void>;
/** Save user consents for an app. */
saveUserConsents(appName: string, consents: UserConsent[]): Promise<void>;
/** Request SSO consent for a connection. */
requestConnectionConsent(connectionName: string, body: {
disableManualLogin?: boolean;
}): Promise<void>;
/** Save a connection usage (bind a connection to an app reference). */
saveConnectionUsage(apiShortName: string, connectionName: string, environmentName: string, body: {
reference: string;
resourceId: string;
appActions: string[];
}): Promise<void>;
/** Create or update a composite connection. */
createCompositeConnection(apiId: string, body: {
environment: string;
dependencyTable: Record<string, string>;
parameterHints: Record<string, unknown>;
connectionName?: string;
}): Promise<ConnectionInstance>;
}
//# sourceMappingURL=ConnectorsApi.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"ConnectorsApi.d.ts","sourceRoot":"","sources":["../../../src/services/api/ConnectorsApi.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAK5D,6FAA6F;AAC7F,qBAAa,aAAa;IAItB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAH7B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;gBAGV,UAAU,EAAE,UAAU,EACvC,eAAe,EAAE,eAAe,EAChC,eAAe,EAAE,MAAM;IAQzB,6EAA6E;IACvE,cAAc,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAO/C,gCAAgC;IAC1B,aAAa,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAOxE,kCAAkC;IAC5B,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAO1E,6CAA6C;IACvC,cAAc,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAM3D,qCAAqC;IAC/B,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAO/E,4CAA4C;IACtC,wBAAwB,CAC5B,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE;QAAE,kBAAkB,CAAC,EAAE,OAAO,CAAA;KAAE,GACrC,OAAO,CAAC,IAAI,CAAC;IAOhB,uEAAuE;IACjE,mBAAmB,CACvB,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,MAAM,EACtB,eAAe,EAAE,MAAM,EACvB,IAAI,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,EAAE,CAAA;KAAE,GACpE,OAAO,CAAC,IAAI,CAAC;IAOhB,+CAA+C;IACzC,yBAAyB,CAC7B,KAAK,EAAE,MAAM,EACb,IAAI,EAAE;QACJ,WAAW,EAAE,MAAM,CAAC;QACpB,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACxC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACxC,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,GACA,OAAO,CAAC,kBAAkB,CAAC;CAO/B"}
@@ -0,0 +1,51 @@
/*!
* Copyright (C) Microsoft Corporation. All rights reserved.
*/
import { createPowerPlatformApiEnvironmentEndpoint } from '../ServiceEndpoints.js';
const enc = encodeURIComponent;
/** Typed API client for Power Platform connector/connection endpoints. No business logic. */
export class ConnectorsApi {
httpClient;
env;
constructor(httpClient, clusterCategory, environmentName) {
this.httpClient = httpClient;
this.env = httpClient.registerEndpoint('connectors:env', createPowerPlatformApiEnvironmentEndpoint(environmentName, clusterCategory));
}
/** Fetch all connections in the environment (with expanded API metadata). */
async getConnections() {
const response = await this.httpClient.get(`${this.env}/connectivity/connections?api-version=1&%24expand=api`);
return response.data.value;
}
/** Get a connection by name. */
async getConnection(connectionName) {
const response = await this.httpClient.get(`${this.env}/providers/Microsoft.PowerApps/connections/${enc(connectionName)}`);
return response.data;
}
/** Get a connection by its ID. */
async getConnectionById(connectionId) {
const response = await this.httpClient.get(`${this.env}/providers/Microsoft.PowerApps/connections/${enc(connectionId)}`);
return response.data;
}
/** Test a connection via the wrapper API. */
async testConnection(connectionName) {
await this.httpClient.post(`${this.env}/providers/Microsoft.PowerApps/connections/${enc(connectionName)}/test`);
}
/** Save user consents for an app. */
async saveUserConsents(appName, consents) {
await this.httpClient.post(`${this.env}/providers/Microsoft.PowerApps/apps/${enc(appName)}/saveUserConsents`, { consents });
}
/** Request SSO consent for a connection. */
async requestConnectionConsent(connectionName, body) {
await this.httpClient.post(`${this.env}/providers/Microsoft.PowerApps/connections/${enc(connectionName)}/consent`, body);
}
/** Save a connection usage (bind a connection to an app reference). */
async saveConnectionUsage(apiShortName, connectionName, environmentName, body) {
await this.httpClient.post(`${this.env}/powerapps/apis/${enc(apiShortName)}/connections/${enc(connectionName)}/usages?api-version=1&%24filter=environment+eq+%27${enc(environmentName)}%27`, { properties: body });
}
/** Create or update a composite connection. */
async createCompositeConnection(apiId, body) {
const response = await this.httpClient.post(`${this.env}/providers/Microsoft.PowerApps/apis/${enc(apiId)}/connections`, body);
return response.data;
}
}
//# sourceMappingURL=ConnectorsApi.js.map
@@ -0,0 +1 @@
{"version":3,"file":"ConnectorsApi.js","sourceRoot":"","sources":["../../../src/services/api/ConnectorsApi.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH,OAAO,EAAE,yCAAyC,EAA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CAAqC;IACrC,KAAK,CAAC,gBAAgB,CAAC,OAAe,EAAE,QAAuB;QAC7D,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CACxB,GAAG,IAAI,CAAC,GAAG,uCAAuC,GAAG,CAAC,OAAO,CAAC,mBAAmB,EACjF,EAAE,QAAQ,EAAE,CACb,CAAC;IACJ,CAAC;IAED,4CAA4C;IAC5C,KAAK,CAAC,wBAAwB,CAC5B,cAAsB,EACtB,IAAsC;QAEtC,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CACxB,GAAG,IAAI,CAAC,GAAG,8CAA8C,GAAG,CAAC,cAAc,CAAC,UAAU,EACtF,IAAI,CACL,CAAC;IACJ,CAAC;IAED,uEAAuE;IACvE,KAAK,CAAC,mBAAmB,CACvB,YAAoB,EACpB,cAAsB,EACtB,eAAuB,EACvB,IAAqE;QAErE,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CACxB,GAAG,IAAI,CAAC,GAAG,mBAAmB,GAAG,CAAC,YAAY,CAAC,gBAAgB,GAAG,CAAC,cAAc,CAAC,qDAAqD,GAAG,CAAC,eAAe,CAAC,KAAK,EAChK,EAAE,UAAU,EAAE,IAAI,EAAE,CACrB,CAAC;IACJ,CAAC;IAED,+CAA+C;IAC/C,KAAK,CAAC,yBAAyB,CAC7B,KAAa,EACb,IAKC;QAED,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CACzC,GAAG,IAAI,CAAC,GAAG,uCAAuC,GAAG,CAAC,KAAK,CAAC,cAAc,EAC1E,IAAI,CACL,CAAC;QACF,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;CACF"}
@@ -0,0 +1,22 @@
/*!
* Copyright (C) Microsoft Corporation. All rights reserved.
*/
import type { HttpClient } from '../../http/HttpClient.js';
import type { App, AppMetadata, DlpEvaluationResult, Environment } from '../../types/AppMetadata.js';
import type { ClusterCategory } from '../../types/ClusterCategory.js';
/** Typed API client for Power Apps endpoints. No business logic. */
export declare class PowerAppsApi {
private readonly httpClient;
private readonly env;
constructor(httpClient: HttpClient, clusterCategory: ClusterCategory, environmentName: string);
/** Launch an app via the environment-scoped Power Platform API. */
launchApp(appName: string, options?: {
bypassCache?: boolean;
record?: boolean;
}): Promise<AppMetadata>;
/** Fetch environment metadata by name. */
getEnvironment(environmentName: string): Promise<Environment>;
/** Evaluate DLP policies for an app. */
evaluateDlpPolicies(app: App): Promise<DlpEvaluationResult>;
}
//# sourceMappingURL=PowerAppsApi.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"PowerAppsApi.d.ts","sourceRoot":"","sources":["../../../src/services/api/PowerAppsApi.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAClG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAKnE,oEAAoE;AACpE,qBAAa,YAAY;IAIrB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAH7B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;gBAGV,UAAU,EAAE,UAAU,EACvC,eAAe,EAAE,eAAe,EAChC,eAAe,EAAE,MAAM;IAQzB,mEAAmE;IAC7D,SAAS,CACb,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,GACpD,OAAO,CAAC,WAAW,CAAC;IAavB,0CAA0C;IACpC,cAAc,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAOnE,wCAAwC;IAClC,mBAAmB,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAOlE"}
@@ -0,0 +1,38 @@
/*!
* Copyright (C) Microsoft Corporation. All rights reserved.
*/
import { createPowerPlatformApiEnvironmentEndpoint } from '../ServiceEndpoints.js';
const enc = encodeURIComponent;
/** Typed API client for Power Apps endpoints. No business logic. */
export class PowerAppsApi {
httpClient;
env;
constructor(httpClient, clusterCategory, environmentName) {
this.httpClient = httpClient;
this.env = httpClient.registerEndpoint('powerapps:env', createPowerPlatformApiEnvironmentEndpoint(environmentName, clusterCategory));
}
/** Launch an app via the environment-scoped Power Platform API. */
async launchApp(appName, options) {
const bypassCache = options?.bypassCache ?? true;
let url = `${this.env}/powerapps/apps/${enc(appName)}/launch?api-version=2`;
if (bypassCache) {
url += '&bypass-cache=true';
}
if (options?.record) {
url += '&record=true';
}
const response = await this.httpClient.post(url);
return response.data;
}
/** Fetch environment metadata by name. */
async getEnvironment(environmentName) {
const response = await this.httpClient.get(`${this.env}/powerapps/environment?api-version=1&%24filter=name+eq+%27${enc(environmentName)}%27`);
return response.data;
}
/** Evaluate DLP policies for an app. */
async evaluateDlpPolicies(app) {
const response = await this.httpClient.post(`${this.env}/powerapps/evaluateDlpPoliciesForApp?api-version=1`, app);
return response.data;
}
}
//# sourceMappingURL=PowerAppsApi.js.map
@@ -0,0 +1 @@
{"version":3,"file":"PowerAppsApi.js","sourceRoot":"","sources":["../../../src/services/api/PowerAppsApi.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EAAE,yCAAyC,EAAE,MAAM,qBAAqB,CAAC;AAEhF,MAAM,GAAG,GAAG,kBAAkB,CAAC;AAE/B,oEAAoE;AACpE,MAAM,OAAO,YAAY;IAIJ;IAHF,GAAG,CAAS;IAE7B,YACmB,UAAsB,EACvC,eAAgC,EAChC,eAAuB;QAFN,eAAU,GAAV,UAAU,CAAY;QAIvC,IAAI,CAAC,GAAG,GAAG,UAAU,CAAC,gBAAgB,CACpC,eAAe,EACf,yCAAyC,CAAC,eAAe,EAAE,eAAe,CAAC,CAC5E,CAAC;IACJ,CAAC;IAED,mEAAmE;IACnE,KAAK,CAAC,SAAS,CACb,OAAe,EACf,OAAqD;QAErD,MAAM,WAAW,GAAG,OAAO,EAAE,WAAW,IAAI,IAAI,CAAC;QACjD,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC,GAAG,mBAAmB,GAAG,CAAC,OAAO,CAAC,uBAAuB,CAAC;QAC5E,IAAI,WAAW,EAAE,CAAC;YAChB,GAAG,IAAI,oBAAoB,CAAC;QAC9B,CAAC;QACD,IAAI,OAAO,EAAE,MAAM,EAAE,CAAC;YACpB,GAAG,IAAI,cAAc,CAAC;QACxB,CAAC;QACD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAc,GAAG,CAAC,CAAC;QAC9D,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAED,0CAA0C;IAC1C,KAAK,CAAC,cAAc,CAAC,eAAuB;QAC1C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CACxC,GAAG,IAAI,CAAC,GAAG,6DAA6D,GAAG,CAAC,eAAe,CAAC,KAAK,CAClG,CAAC;QACF,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAED,wCAAwC;IACxC,KAAK,CAAC,mBAAmB,CAAC,GAAQ;QAChC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CACzC,GAAG,IAAI,CAAC,GAAG,oDAAoD,EAC/D,GAAG,CACJ,CAAC;QACF,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;CACF"}
@@ -0,0 +1,6 @@
/*!
* Copyright (C) Microsoft Corporation. All rights reserved.
*/
export { ConnectorsApi } from './ConnectorsApi.js';
export { PowerAppsApi } from './PowerAppsApi.js';
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/api/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,6 @@
/*!
* Copyright (C) Microsoft Corporation. All rights reserved.
*/
export { ConnectorsApi } from './ConnectorsApi.js';
export { PowerAppsApi } from './PowerAppsApi.js';
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/api/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,12 @@
/*!
* Copyright (C) Microsoft Corporation. All rights reserved.
*/
export { ConnectorsApi, PowerAppsApi } from './api/index.js';
export { ConnectionService } from './ConnectionService.js';
export type { IConnectionService } from './IConnectionService.js';
export { createMaafConnectionUrl, getMaafPlayerBaseUrl, type MaafConnectionUrlOptions, } from './MaafPlayerUrls.js';
export { PowerPlatformApiDiscovery } from './PowerPlatformApiDiscovery.js';
export { type NonLocalRegion, type Region, Regions } from './Regions.js';
export type { HeaderValue, ServiceEndpoint } from './ServiceEndpoint.js';
export { createDataverseEndpoint, createPowerPlatformApiEnvironmentEndpoint, } from './ServiceEndpoints.js';
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,KAAK,wBAAwB,GAC9B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,MAAM,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACtE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EACL,uBAAuB,EACvB,yCAAyC,GAC1C,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,10 @@
/*!
* Copyright (C) Microsoft Corporation. All rights reserved.
*/
export { ConnectorsApi, PowerAppsApi } from './api/index.js';
export { ConnectionService } from './ConnectionService.js';
export { createMaafConnectionUrl, getMaafPlayerBaseUrl, } from './MaafPlayerUrls.js';
export { PowerPlatformApiDiscovery } from './PowerPlatformApiDiscovery.js';
export { Regions } from './Regions.js';
export { createDataverseEndpoint, createPowerPlatformApiEnvironmentEndpoint, } from './ServiceEndpoints.js';
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EACL,uBAAuB,EACvB,oBAAoB,GAErB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAoC,OAAO,EAAE,MAAM,WAAW,CAAC;AAEtE,OAAO,EACL,uBAAuB,EACvB,yCAAyC,GAC1C,MAAM,oBAAoB,CAAC"}