@microsoft/power-apps-common
v1.1.0
Published
Shared types, utilities, and services for Power Platform Managed Host packages
Readme
@microsoft/power-apps-common
Shared types, utilities, and services for Power Platform Managed Host packages.
Note: This package is published internally via Azure Artifacts. It is subject to frequent breaking changes and is not intended for standalone production use outside of the Power Platform Managed Host ecosystem.
Exports
Types
AppMetadata,App,AppProperties,Environment- App metadata typesPowerConfig- Power Platform configurationClusterCategory- Cluster environment enum (Production, Test, Dev)ConnectionReference,RpConnection- Connection reference typesHostError,HostErrorCode- Structured error typesConnectionInstance,ConnectionUsage- Connection domain types (shared with host)UserConsent,AuthResource- Consent domain types (shared with host)AppConnectionContext- Context passed to connection loadingCdsDatabaseReference,DatasetReference,DataSourceInfo- Data source typesApi,NestedAction,ParameterHint,ListAppPackageOperationDetails- API metadata types
Plugin Definitions
PluginMap- Central type mapping action keys to typed function signaturesPluginKey,PluginParams<K>,PluginResponse<K>,PluginHandler<K>- Utility types for typed plugin handlersPluginAction- Action name constants (derived from definition keys)PluginDefinition- Generic mapped type for defining plugin entriesGetContextKey,GetCdsKey,GetAppConnectionsKey,HttpSendKey,MessagingGetVersionInfoKey,MessagingSendKey- Dot-namespaced action key constantsPluginAliases- Legacy wire-format key to canonical key mapIContext- Response type forAppLifecycle.getContextSendHttpRequest,SendHttpResponse- Types forHttp.send
HTTP
HttpClient- Fetch wrapper with interceptors, base URL, and default headersHttpClientOptions- Configuration for HttpClientHttpError- Error class for non-OK HTTP responsesHttpRequestConfig,HttpResponse- Request/response typesRequestInterceptor,ResponseInterceptor- Interceptor types
Telemetry
TelemetryLogger- Logger for telemetry eventsLogLevel- Enum for log severity levelsTelemetryEvent- Interface for telemetry event data
Utilities
parseQueryParams(url)- Parse query parameters from a URL stringbuildUrl(base, params)- Build a URL with query parameters
Scripts
| Script | Description |
| ------------- | ----------------------------- |
| build | Compile TypeScript to dist/ |
| dev | Watch mode compilation |
| check-types | Type-check without emitting |
| lint | Run ESLint on src/ |
| test | Run Bun tests (src/) |
| clean | Remove dist/ and .turbo/ |
Test Utilities
Shared mock factories live in src/__tests__/testUtils/:
createMockConnection(overrides?)— returns aConnectionInstancewith sensible defaults
Import from the barrel: import { createMockConnection } from '../../__tests__/testUtils';
