@microsoft/power-apps-native-host 0.2.22 → 0.3.0
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/README.md +162 -26
- package/compatibility/current.json +87 -0
- package/lib/NOTICE.txt +140 -1226
- package/lib/commonjs/auth/AuthContext.js +74 -18
- package/lib/commonjs/auth/AuthContext.web.js +32 -0
- package/lib/commonjs/auth/completePowerAppsAuthSession.js +16 -0
- package/lib/commonjs/bridge/NativePowerAppsBridge.js +20 -17
- package/lib/commonjs/bridge/PowerPagesBridge.js +157 -0
- package/lib/commonjs/bridge/bridgeState.js +40 -0
- package/lib/commonjs/connections/ConnectionSetupScreen.js +459 -80
- package/lib/commonjs/connections/PowerPlatformConnectionApi.js +946 -0
- package/lib/commonjs/connections/connectionMetadata.js +127 -0
- package/lib/commonjs/connections/connectionState.js +96 -0
- package/lib/commonjs/connections/disambiguate.js +19 -11
- package/lib/commonjs/connections/resolveConnections.js +347 -0
- package/lib/commonjs/connections/types.js +106 -0
- package/lib/commonjs/{platform → connections}/useConnectionRefs.js +128 -65
- package/lib/commonjs/connections/useConnectionSetup.js +111 -52
- package/lib/commonjs/controls/FilePicker.js +6 -0
- package/lib/commonjs/controls/ImagePicker.js +8 -0
- package/lib/commonjs/index.js +188 -6
- package/lib/commonjs/logger.js +9 -6
- package/lib/commonjs/offline/createOfflineHostActivationCallbacks.js +61 -0
- package/lib/commonjs/offline/useOfflineIntegration.js +12 -0
- package/lib/commonjs/offline/useOfflineIntegration.web.js +11 -0
- package/lib/commonjs/offline/useOfflineIntegrationWithStartupGate.js +46 -0
- package/lib/commonjs/offline/useOfflineIntegrationWithStartupGate.web.js +13 -0
- package/lib/commonjs/platform/DataverseDataSources.js +14 -0
- package/lib/commonjs/platform/DataverseGlobalDiscoveryApi.js +49 -0
- package/lib/commonjs/platform/GlobalDiscovery.js +51 -0
- package/lib/commonjs/platform/PowerPlatformEnvironmentApi.js +6 -106
- package/lib/commonjs/provider/PowerAppsHostProvider.js +156 -25
- package/lib/commonjs/provider/PowerAppsHostProvider.web.js +41 -0
- package/lib/commonjs/provider/PowerAppsProvider.js +229 -133
- package/lib/commonjs/provider/SessionDetailsGesture.js +216 -0
- package/lib/commonjs/telemetry/OfflineSdkTelemetry.js +95 -0
- package/lib/commonjs/telemetry/OfflineSdkTelemetry.web.js +9 -0
- package/lib/commonjs/telemetry/index.js +22 -3
- package/lib/module/auth/AuthContext.js +74 -18
- package/lib/module/auth/AuthContext.web.js +26 -0
- package/lib/module/auth/completePowerAppsAuthSession.js +11 -0
- package/lib/module/bridge/NativePowerAppsBridge.js +21 -18
- package/lib/module/bridge/PowerPagesBridge.js +151 -0
- package/lib/module/bridge/bridgeState.js +34 -0
- package/lib/module/connections/ConnectionSetupScreen.js +460 -81
- package/lib/module/connections/PowerPlatformConnectionApi.js +932 -0
- package/lib/module/connections/connectionMetadata.js +112 -0
- package/lib/module/connections/connectionState.js +82 -0
- package/lib/module/connections/disambiguate.js +19 -12
- package/lib/module/connections/resolveConnections.js +342 -0
- package/lib/module/connections/types.js +91 -0
- package/lib/module/{platform → connections}/useConnectionRefs.js +129 -66
- package/lib/module/connections/useConnectionSetup.js +113 -54
- package/lib/module/controls/FilePicker.js +6 -0
- package/lib/module/controls/ImagePicker.js +8 -0
- package/lib/module/index.js +14 -6
- package/lib/module/logger.js +8 -6
- package/lib/module/offline/createOfflineHostActivationCallbacks.js +55 -0
- package/lib/module/offline/useOfflineIntegration.js +3 -0
- package/lib/module/offline/useOfflineIntegration.web.js +7 -0
- package/lib/module/offline/useOfflineIntegrationWithStartupGate.js +42 -0
- package/lib/module/offline/useOfflineIntegrationWithStartupGate.web.js +9 -0
- package/lib/module/platform/DataverseDataSources.js +10 -0
- package/lib/module/platform/DataverseGlobalDiscoveryApi.js +45 -0
- package/lib/module/platform/GlobalDiscovery.js +45 -0
- package/lib/module/platform/PowerPlatformEnvironmentApi.js +5 -104
- package/lib/module/provider/PowerAppsHostProvider.js +159 -28
- package/lib/module/provider/PowerAppsHostProvider.web.js +36 -0
- package/lib/module/provider/PowerAppsProvider.js +233 -137
- package/lib/module/provider/SessionDetailsGesture.js +211 -0
- package/lib/module/telemetry/OfflineSdkTelemetry.js +91 -0
- package/lib/module/telemetry/OfflineSdkTelemetry.web.js +5 -0
- package/lib/module/telemetry/index.js +15 -4
- package/lib/typescript/commonjs/auth/AuthContext.d.ts +3 -1
- package/lib/typescript/commonjs/auth/AuthContext.web.d.ts +21 -0
- package/lib/typescript/commonjs/auth/completePowerAppsAuthSession.d.ts +8 -0
- package/lib/typescript/commonjs/bridge/PowerPagesBridge.d.ts +18 -0
- package/lib/typescript/commonjs/bridge/bridgeState.d.ts +5 -0
- package/lib/typescript/commonjs/connections/ConnectionSetupScreen.d.ts +28 -7
- package/lib/typescript/commonjs/{platform → connections}/PowerPlatformConnectionApi.d.ts +52 -43
- package/lib/typescript/commonjs/connections/connectionMetadata.d.ts +66 -0
- package/lib/typescript/commonjs/connections/connectionState.d.ts +16 -0
- package/lib/typescript/commonjs/connections/disambiguate.d.ts +4 -2
- package/lib/typescript/commonjs/{platform → connections}/resolveConnections.d.ts +19 -19
- package/lib/typescript/commonjs/connections/types.d.ts +129 -1
- package/lib/typescript/commonjs/{platform → connections}/useConnectionRefs.d.ts +33 -24
- package/lib/typescript/commonjs/connections/useConnectionSetup.d.ts +12 -8
- package/lib/typescript/commonjs/controls/FilePicker.d.ts +7 -1
- package/lib/typescript/commonjs/controls/ImagePicker.d.ts +9 -1
- package/lib/typescript/commonjs/index.d.ts +20 -10
- package/lib/typescript/commonjs/logger.d.ts +4 -4
- package/lib/typescript/commonjs/offline/createOfflineHostActivationCallbacks.d.ts +12 -0
- package/lib/typescript/commonjs/offline/useOfflineIntegration.d.ts +2 -0
- package/lib/typescript/commonjs/offline/useOfflineIntegration.web.d.ts +4 -0
- package/lib/typescript/commonjs/offline/useOfflineIntegrationWithStartupGate.d.ts +15 -0
- package/lib/typescript/commonjs/offline/useOfflineIntegrationWithStartupGate.web.d.ts +6 -0
- package/lib/typescript/commonjs/platform/DataverseDataSources.d.ts +27 -0
- package/lib/typescript/commonjs/platform/DataverseGlobalDiscoveryApi.d.ts +3 -0
- package/lib/typescript/commonjs/platform/GlobalDiscovery.d.ts +4 -0
- package/lib/typescript/commonjs/platform/PowerPlatformEnvironmentApi.d.ts +3 -74
- package/lib/typescript/commonjs/provider/PowerAppsHostProvider.d.ts +29 -18
- package/lib/typescript/commonjs/provider/PowerAppsHostProvider.web.d.ts +5 -0
- package/lib/typescript/commonjs/provider/PowerAppsProvider.d.ts +32 -10
- package/lib/typescript/commonjs/provider/SessionDetailsGesture.d.ts +13 -0
- package/lib/typescript/commonjs/telemetry/OfflineSdkTelemetry.d.ts +15 -0
- package/lib/typescript/commonjs/telemetry/OfflineSdkTelemetry.web.d.ts +2 -0
- package/lib/typescript/commonjs/telemetry/index.d.ts +13 -1
- package/lib/typescript/module/auth/AuthContext.d.ts +3 -1
- package/lib/typescript/module/auth/AuthContext.web.d.ts +21 -0
- package/lib/typescript/module/auth/completePowerAppsAuthSession.d.ts +8 -0
- package/lib/typescript/module/bridge/PowerPagesBridge.d.ts +18 -0
- package/lib/typescript/module/bridge/bridgeState.d.ts +5 -0
- package/lib/typescript/module/connections/ConnectionSetupScreen.d.ts +28 -7
- package/lib/typescript/module/{platform → connections}/PowerPlatformConnectionApi.d.ts +52 -43
- package/lib/typescript/module/connections/connectionMetadata.d.ts +66 -0
- package/lib/typescript/module/connections/connectionState.d.ts +16 -0
- package/lib/typescript/module/connections/disambiguate.d.ts +4 -2
- package/lib/typescript/module/{platform → connections}/resolveConnections.d.ts +19 -19
- package/lib/typescript/module/connections/types.d.ts +129 -1
- package/lib/typescript/module/{platform → connections}/useConnectionRefs.d.ts +33 -24
- package/lib/typescript/module/connections/useConnectionSetup.d.ts +12 -8
- package/lib/typescript/module/controls/FilePicker.d.ts +7 -1
- package/lib/typescript/module/controls/ImagePicker.d.ts +9 -1
- package/lib/typescript/module/index.d.ts +24 -14
- package/lib/typescript/module/logger.d.ts +4 -4
- package/lib/typescript/module/offline/createOfflineHostActivationCallbacks.d.ts +12 -0
- package/lib/typescript/module/offline/useOfflineIntegration.d.ts +2 -0
- package/lib/typescript/module/offline/useOfflineIntegration.web.d.ts +4 -0
- package/lib/typescript/module/offline/useOfflineIntegrationWithStartupGate.d.ts +15 -0
- package/lib/typescript/module/offline/useOfflineIntegrationWithStartupGate.web.d.ts +6 -0
- package/lib/typescript/module/platform/DataverseDataSources.d.ts +27 -0
- package/lib/typescript/module/platform/DataverseGlobalDiscoveryApi.d.ts +3 -0
- package/lib/typescript/module/platform/GlobalDiscovery.d.ts +4 -0
- package/lib/typescript/module/platform/PowerPlatformEnvironmentApi.d.ts +3 -74
- package/lib/typescript/module/provider/PowerAppsHostProvider.d.ts +29 -18
- package/lib/typescript/module/provider/PowerAppsHostProvider.web.d.ts +5 -0
- package/lib/typescript/module/provider/PowerAppsProvider.d.ts +34 -12
- package/lib/typescript/module/provider/SessionDetailsGesture.d.ts +13 -0
- package/lib/typescript/module/telemetry/OfflineSdkTelemetry.d.ts +15 -0
- package/lib/typescript/module/telemetry/OfflineSdkTelemetry.web.d.ts +2 -0
- package/lib/typescript/module/telemetry/index.d.ts +13 -1
- package/package.json +43 -18
- package/scripts/build-ios-base.js +66 -27
- package/scripts/bundle.js +212 -5
- package/scripts/generate-connector-schemas.js +8 -6
- package/scripts/metro-logger.js +213 -0
- package/scripts/start-web.mjs +137 -0
- package/scripts/upgrade/runtime.js +463 -0
- package/scripts/upgrade/system.js +244 -0
- package/scripts/upgrade-authoring.js +534 -0
- package/scripts/upgrade.js +188 -0
- package/scripts/wrap.js +536 -0
- package/lib/commonjs/platform/PowerPlatformConnectionApi.js +0 -606
- package/lib/commonjs/platform/resolveConnections.js +0 -264
- package/lib/module/platform/PowerPlatformConnectionApi.js +0 -595
- package/lib/module/platform/resolveConnections.js +0 -259
|
@@ -27,9 +27,10 @@
|
|
|
27
27
|
* </PowerAppsHostProvider>
|
|
28
28
|
*/
|
|
29
29
|
import React from 'react';
|
|
30
|
-
import type { ConnectorSchema } from '../
|
|
31
|
-
import type { DatabaseReference } from '../platform/
|
|
30
|
+
import type { ConnectorSchema } from '../connections/useConnectionRefs.js';
|
|
31
|
+
import type { DatabaseReference } from '../platform/DataverseDataSources.js';
|
|
32
32
|
import type { OnDisambiguationNeeded } from '../connections/types.js';
|
|
33
|
+
import type { ConnectionReferenceConfig, ConnectionUsageInput, ResourceConsentRequirement } from '../connections/types.js';
|
|
33
34
|
export interface PowerAppsHostProviderProps {
|
|
34
35
|
/**
|
|
35
36
|
* Callback to acquire an access token for the given scopes.
|
|
@@ -41,12 +42,12 @@ export interface PowerAppsHostProviderProps {
|
|
|
41
42
|
* Connection resolution only runs when this is true.
|
|
42
43
|
*/
|
|
43
44
|
isSignedIn: boolean;
|
|
45
|
+
/** Sign out the active account. Shown on blocking connection error screens. */
|
|
46
|
+
onSignOut?: () => void | Promise<void>;
|
|
44
47
|
/**
|
|
45
48
|
* PowerApps app GUID (from power.config.json `appId`).
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
* `connectionReferences` prop. Leave undefined during local development
|
|
49
|
-
* to fall back to the static `connectionReferences`.
|
|
49
|
+
* Outside Dev Player, app and connection metadata is fetched exclusively
|
|
50
|
+
* from the PowerApps RP `/apps/{appId}/launch` API.
|
|
50
51
|
*/
|
|
51
52
|
appId?: string;
|
|
52
53
|
/** Power Platform environment GUID (from power.config.json). */
|
|
@@ -58,6 +59,7 @@ export interface PowerAppsHostProviderProps {
|
|
|
58
59
|
region?: string;
|
|
59
60
|
/**
|
|
60
61
|
* The connectionReferences map from power.config.json.
|
|
62
|
+
* Used only in Dev Player for unpublished local apps.
|
|
61
63
|
* Shape: { [refId]: { id: string; dataSources: string[] } }
|
|
62
64
|
*
|
|
63
65
|
* NOTE: This prop must be referentially stable across renders (memoize it in
|
|
@@ -65,18 +67,16 @@ export interface PowerAppsHostProviderProps {
|
|
|
65
67
|
* so passing a fresh object literal every render forces continuous
|
|
66
68
|
* re-registration.
|
|
67
69
|
*/
|
|
68
|
-
connectionReferences: Record<string,
|
|
69
|
-
id: string;
|
|
70
|
-
dataSources: string[];
|
|
71
|
-
}>;
|
|
70
|
+
connectionReferences: Record<string, ConnectionReferenceConfig>;
|
|
72
71
|
/**
|
|
73
72
|
* Connector schema map keyed by data source name.
|
|
73
|
+
* Used only in Dev Player for unpublished local apps.
|
|
74
74
|
* Generated automatically by generate-connector-schemas.
|
|
75
75
|
*/
|
|
76
76
|
schemaMap: Record<string, ConnectorSchema>;
|
|
77
77
|
/**
|
|
78
78
|
* The databaseReferences map from power.config.json.
|
|
79
|
-
|
|
79
|
+
* Used only in Dev Player. Production database references come from RP.
|
|
80
80
|
*
|
|
81
81
|
* NOTE: Like `connectionReferences`, pass a referentially stable value; an
|
|
82
82
|
* unstable identity each render triggers redundant bridge re-registration.
|
|
@@ -84,8 +84,8 @@ export interface PowerAppsHostProviderProps {
|
|
|
84
84
|
databaseReferences?: Record<string, DatabaseReference>;
|
|
85
85
|
/**
|
|
86
86
|
* Optional custom renderer for the OAuth consent WebView shown during
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
* connection creation. If not provided, the system authentication browser
|
|
88
|
+
* is used. Pass the final redirect URL to onDone when the custom view captures it.
|
|
89
89
|
*
|
|
90
90
|
* @example
|
|
91
91
|
* // Using react-native-webview:
|
|
@@ -96,20 +96,31 @@ export interface PowerAppsHostProviderProps {
|
|
|
96
96
|
* </Modal>
|
|
97
97
|
* )}
|
|
98
98
|
*/
|
|
99
|
-
renderOAuthWebView?: (url: string, onDone: () => void) => React.ReactNode;
|
|
99
|
+
renderOAuthWebView?: (url: string, onDone: (redirectUrl?: string) => void) => React.ReactNode;
|
|
100
100
|
/**
|
|
101
101
|
* The ISV/wrap-app AAD client ID (from auth.config.json `msal.clientId`).
|
|
102
102
|
* When provided, the ISV's service principal is granted CanView access on
|
|
103
103
|
* each newly created connection, allowing APIM to accept tokens with this
|
|
104
104
|
* appid at runtime (prevents 403 "missing connection ACL" for third-party tokens).
|
|
105
105
|
*/
|
|
106
|
-
isvClientId
|
|
106
|
+
isvClientId: string;
|
|
107
107
|
/**
|
|
108
108
|
* Called when multiple Connected connections exist for the same connector.
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
* Present a native picker UI and return the chosen connectionId, or null to
|
|
110
|
+
* leave the reference unresolved.
|
|
111
111
|
*/
|
|
112
112
|
onDisambiguationNeeded?: OnDisambiguationNeeded;
|
|
113
|
+
/**
|
|
114
|
+
* Called after the user selects Allow and before the player launches.
|
|
115
|
+
* Use this to persist app-to-connection usage through an approved public RP endpoint.
|
|
116
|
+
* Rejecting keeps the app gated and shows the error in the consent screen.
|
|
117
|
+
* Not invoked in Power Apps Dev Player; local testing is intentionally non-persistent.
|
|
118
|
+
*/
|
|
119
|
+
onConnectionConsent?: (usages: ConnectionUsageInput[]) => void | Promise<void>;
|
|
120
|
+
/** Persist protected resource approval in production. Not invoked in Dev Player. */
|
|
121
|
+
onResourceConsent?: (resources: ResourceConsentRequirement[]) => void | Promise<void>;
|
|
122
|
+
/** Called when the user selects Do not allow. */
|
|
123
|
+
onConnectionConsentDeclined?: () => void | Promise<void>;
|
|
113
124
|
children: React.ReactNode;
|
|
114
125
|
}
|
|
115
126
|
/**
|
|
@@ -119,5 +130,5 @@ export interface PowerAppsHostProviderProps {
|
|
|
119
130
|
*
|
|
120
131
|
* Children are never rendered until all required connections are resolved.
|
|
121
132
|
*/
|
|
122
|
-
export declare function PowerAppsHostProvider({ acquireToken, isSignedIn, appId, environmentId, region, connectionReferences, schemaMap, databaseReferences, renderOAuthWebView, isvClientId, onDisambiguationNeeded, children, }: PowerAppsHostProviderProps): React.JSX.Element;
|
|
133
|
+
export declare function PowerAppsHostProvider({ acquireToken, isSignedIn, onSignOut, appId, environmentId, region, connectionReferences, schemaMap, databaseReferences, renderOAuthWebView, isvClientId, onDisambiguationNeeded, onConnectionConsent, onResourceConsent, onConnectionConsentDeclined, children, }: PowerAppsHostProviderProps): React.JSX.Element;
|
|
123
134
|
//# sourceMappingURL=PowerAppsHostProvider.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PowerAppsHostProviderProps } from './PowerAppsHostProvider';
|
|
3
|
+
export type { PowerAppsHostProviderProps } from './PowerAppsHostProvider';
|
|
4
|
+
export declare function PowerAppsHostProvider({ connectionReferences, databaseReferences, children, }: PowerAppsHostProviderProps): React.JSX.Element;
|
|
5
|
+
//# sourceMappingURL=PowerAppsHostProvider.web.d.ts.map
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Power Apps canvas app inside an Expo shell:
|
|
6
6
|
*
|
|
7
7
|
* GestureHandlerRootView
|
|
8
|
-
* └── TamaguiProvider (defaults to @tamagui/config/
|
|
8
|
+
* └── TamaguiProvider (defaults to @tamagui/config/v5)
|
|
9
9
|
* └── PortalProvider (required by ToastViewport)
|
|
10
10
|
* └── ToastProvider + ToastViewport
|
|
11
11
|
* └── QueryClientProvider (own QueryClient, wired to NetInfo + AppState)
|
|
@@ -26,13 +26,14 @@
|
|
|
26
26
|
*/
|
|
27
27
|
import React from 'react';
|
|
28
28
|
import { createTamagui } from '@tamagui/core';
|
|
29
|
-
import type { AuthProviderProps } from '../auth/AuthContext
|
|
30
|
-
import type { PowerAppsHostProviderProps } from './PowerAppsHostProvider
|
|
31
|
-
import type { ConnectorSchema } from '../
|
|
32
|
-
import type { DatabaseReference } from '../platform/
|
|
33
|
-
import type { OnDisambiguationNeeded } from '../connections/types.js';
|
|
29
|
+
import type { AuthProviderProps } from '../auth/AuthContext';
|
|
30
|
+
import type { PowerAppsHostProviderProps } from './PowerAppsHostProvider';
|
|
31
|
+
import type { ConnectorSchema } from '../connections/useConnectionRefs.js';
|
|
32
|
+
import type { DatabaseReference } from '../platform/DataverseDataSources.js';
|
|
33
|
+
import type { ConnectionReferenceConfig, OnDisambiguationNeeded } from '../connections/types.js';
|
|
34
34
|
import type { ThemeTokens } from '../theme/tokens.js';
|
|
35
35
|
import type { ILogger } from '@microsoft/power-apps-native-common';
|
|
36
|
+
import type { ApplicationInsightsTelemetryProviderConfig } from '@microsoft/power-apps-native-common';
|
|
36
37
|
/** Shape of power.config.json consumed by the provider. */
|
|
37
38
|
export interface PowerConfig {
|
|
38
39
|
/**
|
|
@@ -53,10 +54,7 @@ export interface PowerConfig {
|
|
|
53
54
|
* Omit for the default global collector.
|
|
54
55
|
*/
|
|
55
56
|
geoRegion?: string;
|
|
56
|
-
connectionReferences?: Record<string,
|
|
57
|
-
id: string;
|
|
58
|
-
dataSources: string[];
|
|
59
|
-
}>;
|
|
57
|
+
connectionReferences?: Record<string, ConnectionReferenceConfig>;
|
|
60
58
|
databaseReferences?: Record<string, DatabaseReference>;
|
|
61
59
|
/**
|
|
62
60
|
* Allow additional keys — the offline SDK reads arbitrary fields from
|
|
@@ -67,6 +65,10 @@ export interface PowerConfig {
|
|
|
67
65
|
[key: string]: unknown;
|
|
68
66
|
}
|
|
69
67
|
type TamaguiConfig = ReturnType<typeof createTamagui>;
|
|
68
|
+
export interface AppInsightsConfig extends Omit<ApplicationInsightsTelemetryProviderConfig, 'deviceId' | 'sessionId'> {
|
|
69
|
+
/** Explicit opt-in. Application Insights telemetry is disabled unless this is true. */
|
|
70
|
+
enabled: boolean;
|
|
71
|
+
}
|
|
70
72
|
export interface PowerAppsProviderProps {
|
|
71
73
|
/** MSAL configuration from auth.config.json (msal section). */
|
|
72
74
|
msalConfig: AuthProviderProps['msalConfig'];
|
|
@@ -81,7 +83,7 @@ export interface PowerAppsProviderProps {
|
|
|
81
83
|
schemaMap: Record<string, ConnectorSchema>;
|
|
82
84
|
/**
|
|
83
85
|
* Tamagui design-system config.
|
|
84
|
-
|
|
86
|
+
* Defaults to the standard @tamagui/config/v5 preset.
|
|
85
87
|
*/
|
|
86
88
|
tamaguiConfig?: TamaguiConfig;
|
|
87
89
|
/** Tamagui default colour theme. @default 'light' */
|
|
@@ -106,6 +108,12 @@ export interface PowerAppsProviderProps {
|
|
|
106
108
|
renderOAuthWebView?: PowerAppsHostProviderProps['renderOAuthWebView'];
|
|
107
109
|
/** See PowerAppsHostProviderProps.onDisambiguationNeeded. */
|
|
108
110
|
onDisambiguationNeeded?: OnDisambiguationNeeded;
|
|
111
|
+
/** See PowerAppsHostProviderProps.onConnectionConsent. */
|
|
112
|
+
onConnectionConsent?: PowerAppsHostProviderProps['onConnectionConsent'];
|
|
113
|
+
/** See PowerAppsHostProviderProps.onResourceConsent. */
|
|
114
|
+
onResourceConsent?: PowerAppsHostProviderProps['onResourceConsent'];
|
|
115
|
+
/** See PowerAppsHostProviderProps.onConnectionConsentDeclined. */
|
|
116
|
+
onConnectionConsentDeclined?: PowerAppsHostProviderProps['onConnectionConsentDeclined'];
|
|
109
117
|
/**
|
|
110
118
|
* App name used as `clientType` in the auto-wired 1DS telemetry provider.
|
|
111
119
|
* Appears in Kusto as the `clientType` column — use a stable
|
|
@@ -125,6 +133,20 @@ export interface PowerAppsProviderProps {
|
|
|
125
133
|
* logger becomes a no-op regardless of build variant.
|
|
126
134
|
*/
|
|
127
135
|
logger?: ILogger | null;
|
|
136
|
+
/**
|
|
137
|
+
* Show app and telemetry session details after a three-finger downward swipe.
|
|
138
|
+
* Available in both development and published native apps. @default true
|
|
139
|
+
*/
|
|
140
|
+
showSessionDetailsOnSwipe?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Optional customer-owned Application Insights destination.
|
|
143
|
+
*
|
|
144
|
+
* Events are sent directly to the selected C1-owned Application Insights
|
|
145
|
+
* resource and fan out alongside the default Microsoft OneDS provider.
|
|
146
|
+
* Defaults to `expo.extra.appInsightsConfig` from app.json.
|
|
147
|
+
* Ignored when `logger` is provided or `null`.
|
|
148
|
+
*/
|
|
149
|
+
appInsightsConfig?: AppInsightsConfig;
|
|
128
150
|
/**
|
|
129
151
|
* Offline profile JSON — optional override.
|
|
130
152
|
* Primary source: SDK config plugin embeds offline-profile.json into the app
|
|
@@ -143,6 +165,6 @@ export interface PowerAppsProviderProps {
|
|
|
143
165
|
* root layout.
|
|
144
166
|
*/
|
|
145
167
|
export declare function PowerAppsProvider({ msalConfig, intuneConfig, powerConfig, schemaMap, tamaguiConfig, // override with app's tamagui.config.ts
|
|
146
|
-
defaultTheme, theme, darkTheme, followSystemTheme, renderOAuthWebView, onDisambiguationNeeded, appName, logger: loggerProp, offlineProfile, children, }: PowerAppsProviderProps): React.JSX.Element;
|
|
168
|
+
defaultTheme, theme, darkTheme, followSystemTheme, renderOAuthWebView, onDisambiguationNeeded, onConnectionConsent, onResourceConsent, onConnectionConsentDeclined, appName, logger: loggerProp, showSessionDetailsOnSwipe, appInsightsConfig, offlineProfile, children, }: PowerAppsProviderProps): React.JSX.Element;
|
|
147
169
|
export {};
|
|
148
170
|
//# sourceMappingURL=PowerAppsProvider.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface SessionDetailsGestureProps {
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
appName: string;
|
|
5
|
+
appId?: string;
|
|
6
|
+
environmentId?: string;
|
|
7
|
+
region: string;
|
|
8
|
+
appVersion?: string;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare function SessionDetailsGesture({ enabled, appName, appId, environmentId, region, appVersion, children, }: SessionDetailsGestureProps): React.JSX.Element;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=SessionDetailsGesture.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Forwards the privacy-safe Offline SDK transport through the host's existing
|
|
3
|
+
* app logger so offline events carry the same session, device, and user data.
|
|
4
|
+
*
|
|
5
|
+
* The host owns exactly one thing here: binding the SDK transport to this
|
|
6
|
+
* host's logger. Buffering and teardown semantics live in the SDK.
|
|
7
|
+
*
|
|
8
|
+
* Setup and teardown are fail-open but not silent. This runs from an effect in
|
|
9
|
+
* the provider that roots the app, so an unguarded throw would take down the
|
|
10
|
+
* whole tree — telemetry is never worth an app that will not start. An
|
|
11
|
+
* unexpected failure is therefore downgraded to a logged diagnostic rather than
|
|
12
|
+
* swallowed, so broken wiring stays observable.
|
|
13
|
+
*/
|
|
14
|
+
export declare function configureOfflineSdkTelemetry(forwardEvents: boolean): () => void;
|
|
15
|
+
//# sourceMappingURL=OfflineSdkTelemetry.d.ts.map
|
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
* (`getAppLogger` / `configureAppLogger`). This module re-exports those
|
|
8
8
|
* alongside the canonical host operation-name constants.
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
import { HttpClient } from '@microsoft/power-apps-native-common/http';
|
|
11
|
+
export { getAppLogger, configureAppLogger, getCustomerTelemetryLogger } from '@microsoft/power-apps-native-common';
|
|
12
|
+
export type { ICustomerTelemetryLogger } from '@microsoft/power-apps-native-common';
|
|
11
13
|
/**
|
|
12
14
|
* Canonical operation names for host package telemetry.
|
|
13
15
|
* Follow the `PowerAppsHost.<Subsystem>.<Action>` convention so events are
|
|
@@ -34,15 +36,25 @@ export declare const HostOperationNames: {
|
|
|
34
36
|
readonly BridgeTokenAcquireFailed: "PowerAppsHost.Bridge.TokenAcquire.Failed";
|
|
35
37
|
/** Top-level React error boundary caught an unhandled JS error. */
|
|
36
38
|
readonly RuntimeUnhandledJsError: "PowerAppsHost.Runtime.UnhandledJsError";
|
|
39
|
+
/** Power Platform RP HTTP request, including backend correlation IDs. */
|
|
40
|
+
readonly PlatformHttpRequest: "PowerAppsHost.Platform.HttpRequest";
|
|
37
41
|
/** Resolve Dataverse instanceUrl from Power Platform environment API. */
|
|
38
42
|
readonly PlatformFetchInstanceUrl: "PowerAppsHost.Platform.FetchInstanceUrl";
|
|
39
43
|
/** useConnectionRefs failed to resolve connections (recoverable). Recorded only on failure. */
|
|
40
44
|
readonly PlatformLoadConnectionsFailed: "PowerAppsHost.Platform.LoadConnections.Failed";
|
|
41
45
|
/** Create a new Power Platform connection. */
|
|
42
46
|
readonly PlatformCreateConnection: "PowerAppsHost.Platform.CreateConnection";
|
|
47
|
+
/** Repair an existing Power Platform connection. */
|
|
48
|
+
readonly PlatformRepairConnection: "PowerAppsHost.Platform.RepairConnection";
|
|
49
|
+
/** Poll a connection until it becomes active. */
|
|
50
|
+
readonly PlatformPollConnectionStatus: "PowerAppsHost.Platform.PollConnectionStatus";
|
|
43
51
|
/** Resolve app connection references for the current launch. */
|
|
44
52
|
readonly PlatformResolveConnectionRefs: "PowerAppsHost.Platform.ResolveConnectionRefs";
|
|
45
53
|
/** Grant this app access to a Power Platform connection ACL. */
|
|
46
54
|
readonly PlatformConnectionAclGrant: "PowerAppsHost.Platform.ConnectionAclGrant";
|
|
55
|
+
/** Installed Offline SDK predates the SDK-owned routing contract. */
|
|
56
|
+
readonly OfflineRoutingContractUnsupported: "PowerAppsHost.Offline.RoutingContract.Unsupported";
|
|
47
57
|
};
|
|
58
|
+
export declare const bridgeHttpClient: HttpClient;
|
|
59
|
+
export declare const platformHttpClient: HttpClient;
|
|
48
60
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/power-apps-native-host",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "React Native host integration for @microsoft/power-apps",
|
|
5
5
|
"author": "Microsoft Corporation",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
7
7
|
"bugs": {
|
|
8
8
|
"email": "pawrap-team@microsoft.com"
|
|
9
9
|
},
|
|
10
|
+
"engines": {
|
|
11
|
+
"node": "^20.17.0 || >=22.9.0"
|
|
12
|
+
},
|
|
10
13
|
"main": "./lib/commonjs/index.js",
|
|
11
14
|
"module": "./lib/module/index.js",
|
|
12
15
|
"types": "./lib/typescript/commonjs/index.d.ts",
|
|
13
16
|
"exports": {
|
|
14
17
|
".": {
|
|
18
|
+
"browser": {
|
|
19
|
+
"types": "./lib/typescript/commonjs/index.d.ts",
|
|
20
|
+
"default": "./lib/commonjs/index.js"
|
|
21
|
+
},
|
|
15
22
|
"import": {
|
|
16
23
|
"types": "./lib/typescript/module/index.d.ts",
|
|
17
24
|
"default": "./lib/module/index.js"
|
|
@@ -22,43 +29,57 @@
|
|
|
22
29
|
}
|
|
23
30
|
},
|
|
24
31
|
"./package.json": "./package.json",
|
|
32
|
+
"./metro-logger": "./scripts/metro-logger.js",
|
|
25
33
|
"./app.plugin.js": "./app.plugin.js"
|
|
26
34
|
},
|
|
27
35
|
"bin": {
|
|
28
36
|
"generate-connector-schemas": "scripts/generate-connector-schemas.js",
|
|
29
37
|
"js-bundle": "scripts/bundle.js",
|
|
30
|
-
"build-ios-base": "scripts/build-ios-base.js"
|
|
38
|
+
"build-ios-base": "scripts/build-ios-base.js",
|
|
39
|
+
"power-apps-web": "scripts/start-web.mjs",
|
|
40
|
+
"wrap": "scripts/wrap.js",
|
|
41
|
+
"upgrade-template": "scripts/upgrade.js"
|
|
31
42
|
},
|
|
32
43
|
"files": [
|
|
33
44
|
"lib/",
|
|
34
45
|
"!lib/**/*.map",
|
|
35
46
|
"app.plugin.js",
|
|
36
|
-
"scripts/"
|
|
47
|
+
"scripts/",
|
|
48
|
+
"compatibility/"
|
|
37
49
|
],
|
|
38
50
|
"scripts": {
|
|
39
|
-
"prepack": "
|
|
51
|
+
"prepack": "npm run build && npm test",
|
|
40
52
|
"build": "bob build && node ../../scripts/notices.js",
|
|
41
|
-
"type-check": "tsc --noEmit"
|
|
53
|
+
"type-check": "tsc --noEmit",
|
|
54
|
+
"test": "node --test test/*.test.js",
|
|
55
|
+
"test:upgrade": "node --test test/upgrade.test.js",
|
|
56
|
+
"test:offline-compatibility": "bob build && node --test test/OfflineSdkCompatibility.test.js"
|
|
42
57
|
},
|
|
43
58
|
"dependencies": {
|
|
44
|
-
"@microsoft/power-apps-native-auth": "^0.3.
|
|
45
|
-
"@microsoft/power-apps-native-common": "^0.
|
|
46
|
-
"@
|
|
47
|
-
"@tamagui/
|
|
48
|
-
"@tamagui/
|
|
49
|
-
"@tamagui/
|
|
50
|
-
"@
|
|
59
|
+
"@microsoft/power-apps-native-auth": "^0.3.6",
|
|
60
|
+
"@microsoft/power-apps-native-common": "^0.2.0",
|
|
61
|
+
"@ster5/global-mutex": "3.3.0",
|
|
62
|
+
"@tamagui/config": "2.4.5",
|
|
63
|
+
"@tamagui/core": "2.4.5",
|
|
64
|
+
"@tamagui/portal": "2.4.5",
|
|
65
|
+
"@tamagui/toast": "2.4.5",
|
|
66
|
+
"@tanstack/react-query": "5.62.0",
|
|
67
|
+
"diff": "9.0.0",
|
|
68
|
+
"resolve-workspace-root": "2.0.1",
|
|
69
|
+
"write-file-atomic": "7.0.1"
|
|
51
70
|
},
|
|
52
71
|
"peerDependencies": {
|
|
53
72
|
"@microsoft/power-apps": "*",
|
|
54
|
-
"@microsoft/power-apps-native-offline": ">=0.1.
|
|
73
|
+
"@microsoft/power-apps-native-offline": ">=0.1.32",
|
|
55
74
|
"@react-native-community/netinfo": ">=11.0.0",
|
|
56
75
|
"burnt": ">=0.12.2",
|
|
57
|
-
"expo-constants": ">=55.0.0",
|
|
58
|
-
"expo-
|
|
59
|
-
"expo-
|
|
60
|
-
"
|
|
61
|
-
"react
|
|
76
|
+
"expo-constants": ">=55.0.0 <56",
|
|
77
|
+
"expo-clipboard": ">=55.0.0 <56",
|
|
78
|
+
"expo-linking": ">=55.0.14 <56",
|
|
79
|
+
"expo-web-browser": ">=55.0.14 <56",
|
|
80
|
+
"react": ">=19.2.0 <20",
|
|
81
|
+
"react-dom": ">=19.2.0 <19.3.0",
|
|
82
|
+
"react-native": ">=0.83.4 <0.84",
|
|
62
83
|
"react-native-gesture-handler": ">=2.0.0",
|
|
63
84
|
"react-native-safe-area-context": ">=5.6.2"
|
|
64
85
|
},
|
|
@@ -76,8 +97,12 @@
|
|
|
76
97
|
"devDependencies": {
|
|
77
98
|
"@types/react": "19.2.14",
|
|
78
99
|
"cross-env": "7.0.3",
|
|
100
|
+
"expo-clipboard": "55.0.13",
|
|
79
101
|
"expo-constants": "55.0.16",
|
|
80
102
|
"expo-web-browser": "55.0.15",
|
|
103
|
+
"react": "19.2.0",
|
|
104
|
+
"react-dom": "19.2.0",
|
|
105
|
+
"react-native": "0.83.6",
|
|
81
106
|
"react-native-safe-area-context": "5.6.2",
|
|
82
107
|
"typescript": "5.9.3"
|
|
83
108
|
},
|
|
@@ -56,8 +56,13 @@ if (!xcworkspace) {
|
|
|
56
56
|
// Derive scheme name from workspace name (strip .xcworkspace).
|
|
57
57
|
const scheme = xcworkspace.replace('.xcworkspace', '');
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
// --simulator: build for iOS Simulator instead of a physical device.
|
|
60
|
+
// Use this for local testing; the default (device) build is for App Store / wrap pipeline.
|
|
61
|
+
const isSimulator = process.argv.includes('--simulator');
|
|
62
|
+
|
|
63
|
+
const archivePath = path.join(os.tmpdir(), 'pawrap-base.xcarchive');
|
|
64
|
+
const simDerivedPath = path.join(os.tmpdir(), 'pawrap-sim-derived');
|
|
65
|
+
const ipaDir = path.join(os.tmpdir(), 'pawrap-base-ipa');
|
|
61
66
|
const payloadDir = path.join(ipaDir, 'Payload');
|
|
62
67
|
const ipaPath = path.join(os.tmpdir(), 'pawrap-base.ipa');
|
|
63
68
|
|
|
@@ -66,31 +71,65 @@ function run(cmd, args, opts = {}) {
|
|
|
66
71
|
execFileSync(cmd, args, { stdio: 'inherit', ...opts });
|
|
67
72
|
}
|
|
68
73
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
'
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
74
|
+
if (isSimulator) {
|
|
75
|
+
// ── Simulator build ──────────────────────────────────────────────────────
|
|
76
|
+
// Uses xcodebuild build (not archive) targeting iOS Simulator so the Mach-O
|
|
77
|
+
// platform is IOSSIMULATOR and xcrun simctl can launch it.
|
|
78
|
+
run('xcodebuild', [
|
|
79
|
+
'-workspace', path.join(iosDir, xcworkspace),
|
|
80
|
+
'-scheme', scheme,
|
|
81
|
+
'-configuration', 'Release',
|
|
82
|
+
'build',
|
|
83
|
+
'-destination', 'generic/platform=iOS Simulator',
|
|
84
|
+
'-derivedDataPath', simDerivedPath,
|
|
85
|
+
'CODE_SIGNING_REQUIRED=NO',
|
|
86
|
+
'CODE_SIGN_IDENTITY=',
|
|
87
|
+
'CODE_SIGNING_ALLOWED=NO',
|
|
88
|
+
]);
|
|
89
|
+
|
|
90
|
+
const simProductsDir = path.join(simDerivedPath, 'Build', 'Products', 'Release-iphonesimulator');
|
|
91
|
+
const appBundle = fs.readdirSync(simProductsDir).find(f => f.endsWith('.app'));
|
|
92
|
+
if (!appBundle) {
|
|
93
|
+
console.error('build-ios-base: no .app found in simulator build output');
|
|
94
|
+
process.exit(1);
|
|
90
95
|
}
|
|
91
|
-
}
|
|
92
96
|
|
|
93
|
-
|
|
94
|
-
|
|
97
|
+
// Package as IPA so the output format matches the device build.
|
|
98
|
+
// xcrun simctl install accepts simulator-built IPAs.
|
|
99
|
+
fs.rmSync(ipaDir, { recursive: true, force: true });
|
|
100
|
+
fs.mkdirSync(payloadDir, { recursive: true });
|
|
101
|
+
fs.cpSync(path.join(simProductsDir, appBundle), path.join(payloadDir, appBundle), { recursive: true });
|
|
102
|
+
fs.rmSync(ipaPath, { force: true });
|
|
103
|
+
run('zip', ['-r', ipaPath, '.'], { cwd: ipaDir });
|
|
104
|
+
console.log(`\n✓ Base IPA (simulator) ready: ${ipaPath}`);
|
|
105
|
+
|
|
106
|
+
} else {
|
|
107
|
+
// ── Device build (default) ───────────────────────────────────────────────
|
|
108
|
+
// Archives without code signing so the wrap pipeline can re-sign with the
|
|
109
|
+
// customer's provisioning profile.
|
|
110
|
+
run('xcodebuild', [
|
|
111
|
+
'-workspace', path.join(iosDir, xcworkspace),
|
|
112
|
+
'-scheme', scheme,
|
|
113
|
+
'-configuration', 'Release',
|
|
114
|
+
'archive',
|
|
115
|
+
'-archivePath', archivePath,
|
|
116
|
+
'-destination', 'generic/platform=iOS',
|
|
117
|
+
'CODE_SIGNING_REQUIRED=NO',
|
|
118
|
+
'CODE_SIGN_IDENTITY=',
|
|
119
|
+
'CODE_SIGNING_ALLOWED=NO',
|
|
120
|
+
]);
|
|
95
121
|
|
|
96
|
-
|
|
122
|
+
fs.rmSync(ipaDir, { recursive: true, force: true });
|
|
123
|
+
fs.mkdirSync(payloadDir, { recursive: true });
|
|
124
|
+
|
|
125
|
+
const appsGlob = path.join(archivePath, 'Products', 'Applications');
|
|
126
|
+
for (const app of fs.readdirSync(appsGlob)) {
|
|
127
|
+
if (app.endsWith('.app')) {
|
|
128
|
+
fs.cpSync(path.join(appsGlob, app), path.join(payloadDir, app), { recursive: true });
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
fs.rmSync(ipaPath, { force: true });
|
|
133
|
+
run('zip', ['-r', ipaPath, '.'], { cwd: ipaDir });
|
|
134
|
+
console.log(`\n✓ Base IPA ready: ${ipaPath}`);
|
|
135
|
+
}
|