@microsoft/power-apps-native-host 0.2.22

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.
Files changed (104) hide show
  1. package/LICENSE +112 -0
  2. package/README.md +59 -0
  3. package/app.plugin.js +4 -0
  4. package/lib/NOTICE.txt +1659 -0
  5. package/lib/commonjs/ErrorBoundary.js +128 -0
  6. package/lib/commonjs/auth/AuthContext.js +281 -0
  7. package/lib/commonjs/bridge/NativePowerAppsBridge.js +279 -0
  8. package/lib/commonjs/bridge/setupNativeHost.js +65 -0
  9. package/lib/commonjs/connections/ConnectionSetupScreen.js +531 -0
  10. package/lib/commonjs/connections/disambiguate.js +88 -0
  11. package/lib/commonjs/connections/types.js +58 -0
  12. package/lib/commonjs/connections/useConnectionSetup.js +236 -0
  13. package/lib/commonjs/controls/FilePicker.js +183 -0
  14. package/lib/commonjs/controls/ImagePicker.js +236 -0
  15. package/lib/commonjs/index.js +246 -0
  16. package/lib/commonjs/logger.js +27 -0
  17. package/lib/commonjs/package.json +1 -0
  18. package/lib/commonjs/platform/PowerPlatformConnectionApi.js +606 -0
  19. package/lib/commonjs/platform/PowerPlatformEnvironmentApi.js +194 -0
  20. package/lib/commonjs/platform/resolveConnections.js +264 -0
  21. package/lib/commonjs/platform/useConnectionRefs.js +270 -0
  22. package/lib/commonjs/provider/PowerAppsHostProvider.js +336 -0
  23. package/lib/commonjs/provider/PowerAppsProvider.js +351 -0
  24. package/lib/commonjs/telemetry/index.js +70 -0
  25. package/lib/commonjs/theme/ThemeProvider.js +80 -0
  26. package/lib/commonjs/theme/tokens.js +50 -0
  27. package/lib/commonjs/utils/dataverseUtils.js +98 -0
  28. package/lib/commonjs/utils/isDevPlayer.js +27 -0
  29. package/lib/module/ErrorBoundary.js +122 -0
  30. package/lib/module/auth/AuthContext.js +276 -0
  31. package/lib/module/bridge/NativePowerAppsBridge.js +273 -0
  32. package/lib/module/bridge/setupNativeHost.js +62 -0
  33. package/lib/module/connections/ConnectionSetupScreen.js +526 -0
  34. package/lib/module/connections/disambiguate.js +83 -0
  35. package/lib/module/connections/types.js +60 -0
  36. package/lib/module/connections/useConnectionSetup.js +233 -0
  37. package/lib/module/controls/FilePicker.js +178 -0
  38. package/lib/module/controls/ImagePicker.js +231 -0
  39. package/lib/module/index.js +41 -0
  40. package/lib/module/logger.js +22 -0
  41. package/lib/module/package.json +1 -0
  42. package/lib/module/platform/PowerPlatformConnectionApi.js +595 -0
  43. package/lib/module/platform/PowerPlatformEnvironmentApi.js +186 -0
  44. package/lib/module/platform/resolveConnections.js +259 -0
  45. package/lib/module/platform/useConnectionRefs.js +267 -0
  46. package/lib/module/provider/PowerAppsHostProvider.js +332 -0
  47. package/lib/module/provider/PowerAppsProvider.js +345 -0
  48. package/lib/module/telemetry/index.js +55 -0
  49. package/lib/module/theme/ThemeProvider.js +63 -0
  50. package/lib/module/theme/tokens.js +46 -0
  51. package/lib/module/utils/dataverseUtils.js +90 -0
  52. package/lib/module/utils/isDevPlayer.js +23 -0
  53. package/lib/typescript/commonjs/ErrorBoundary.d.ts +30 -0
  54. package/lib/typescript/commonjs/auth/AuthContext.d.ts +57 -0
  55. package/lib/typescript/commonjs/bridge/NativePowerAppsBridge.d.ts +112 -0
  56. package/lib/typescript/commonjs/bridge/setupNativeHost.d.ts +39 -0
  57. package/lib/typescript/commonjs/connections/ConnectionSetupScreen.d.ts +107 -0
  58. package/lib/typescript/commonjs/connections/disambiguate.d.ts +43 -0
  59. package/lib/typescript/commonjs/connections/types.d.ts +91 -0
  60. package/lib/typescript/commonjs/connections/useConnectionSetup.d.ts +96 -0
  61. package/lib/typescript/commonjs/controls/FilePicker.d.ts +65 -0
  62. package/lib/typescript/commonjs/controls/ImagePicker.d.ts +76 -0
  63. package/lib/typescript/commonjs/index.d.ts +42 -0
  64. package/lib/typescript/commonjs/logger.d.ts +11 -0
  65. package/lib/typescript/commonjs/package.json +1 -0
  66. package/lib/typescript/commonjs/platform/PowerPlatformConnectionApi.d.ts +205 -0
  67. package/lib/typescript/commonjs/platform/PowerPlatformEnvironmentApi.d.ts +108 -0
  68. package/lib/typescript/commonjs/platform/resolveConnections.d.ts +86 -0
  69. package/lib/typescript/commonjs/platform/useConnectionRefs.d.ts +126 -0
  70. package/lib/typescript/commonjs/provider/PowerAppsHostProvider.d.ts +123 -0
  71. package/lib/typescript/commonjs/provider/PowerAppsProvider.d.ts +148 -0
  72. package/lib/typescript/commonjs/telemetry/index.d.ts +48 -0
  73. package/lib/typescript/commonjs/theme/ThemeProvider.d.ts +30 -0
  74. package/lib/typescript/commonjs/theme/tokens.d.ts +27 -0
  75. package/lib/typescript/commonjs/utils/dataverseUtils.d.ts +39 -0
  76. package/lib/typescript/commonjs/utils/isDevPlayer.d.ts +19 -0
  77. package/lib/typescript/module/ErrorBoundary.d.ts +30 -0
  78. package/lib/typescript/module/auth/AuthContext.d.ts +57 -0
  79. package/lib/typescript/module/bridge/NativePowerAppsBridge.d.ts +112 -0
  80. package/lib/typescript/module/bridge/setupNativeHost.d.ts +39 -0
  81. package/lib/typescript/module/connections/ConnectionSetupScreen.d.ts +107 -0
  82. package/lib/typescript/module/connections/disambiguate.d.ts +43 -0
  83. package/lib/typescript/module/connections/types.d.ts +91 -0
  84. package/lib/typescript/module/connections/useConnectionSetup.d.ts +96 -0
  85. package/lib/typescript/module/controls/FilePicker.d.ts +65 -0
  86. package/lib/typescript/module/controls/ImagePicker.d.ts +76 -0
  87. package/lib/typescript/module/index.d.ts +42 -0
  88. package/lib/typescript/module/logger.d.ts +11 -0
  89. package/lib/typescript/module/package.json +1 -0
  90. package/lib/typescript/module/platform/PowerPlatformConnectionApi.d.ts +205 -0
  91. package/lib/typescript/module/platform/PowerPlatformEnvironmentApi.d.ts +108 -0
  92. package/lib/typescript/module/platform/resolveConnections.d.ts +86 -0
  93. package/lib/typescript/module/platform/useConnectionRefs.d.ts +126 -0
  94. package/lib/typescript/module/provider/PowerAppsHostProvider.d.ts +123 -0
  95. package/lib/typescript/module/provider/PowerAppsProvider.d.ts +148 -0
  96. package/lib/typescript/module/telemetry/index.d.ts +48 -0
  97. package/lib/typescript/module/theme/ThemeProvider.d.ts +30 -0
  98. package/lib/typescript/module/theme/tokens.d.ts +27 -0
  99. package/lib/typescript/module/utils/dataverseUtils.d.ts +39 -0
  100. package/lib/typescript/module/utils/isDevPlayer.d.ts +19 -0
  101. package/package.json +119 -0
  102. package/scripts/build-ios-base.js +96 -0
  103. package/scripts/bundle.js +95 -0
  104. package/scripts/generate-connector-schemas.js +75 -0
package/LICENSE ADDED
@@ -0,0 +1,112 @@
1
+ MICROSOFT SOFTWARE LICENSE TERMS
2
+ Power App Native Libraries
3
+
4
+ June 2026
5
+ These license terms are an agreement between you and Microsoft Corporation (or based
6
+ on where you live, one of its affiliates). They apply to the software named above. The terms
7
+ also apply to any Microsoft services or updates for the software, except to the extent those
8
+ have different terms.
9
+
10
+ IF YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE RIGHTS BELOW.
11
+ 1. INSTALLATION AND USE RIGHTS.
12
+ a. This software is licensed as a supplement to Microsoft Power Platform (the “Product”).
13
+ Use of the software requires a valid license for the Product.
14
+ b. You may install and use any number of copies of the software to develop and test your
15
+ applications. It will be used as components to be leveraged by AI agents for creating
16
+ applications.
17
+ 2. Third Party Components. The software may include third party components with
18
+ separate legal notices or governed by other agreements, as may be described in the
19
+ notices file(s) accompanying the software.
20
+ 3. DATA.
21
+ a. Data Collection. The software may collect information about you and your use of the
22
+ software and send that to Microsoft. Microsoft may use this information to provide services
23
+ and improve our products and services. There are also some features in the software that
24
+ may enable you and Microsoft to collect data from users of your applications. If you use
25
+ these features, you must comply with applicable law, including providing appropriate
26
+ notices to users of your applications together with a copy of Microsoft’s privacy statement.
27
+ Our privacy statement is located at https://aka.ms/privacy. You can learn more about data
28
+ collection and its use from the software documentation and our privacy statement. Your
29
+ use of the software operates as your consent to these practices.
30
+ b. Processing of Personal Data. To the extent Microsoft is a processor or sub processor of
31
+ personal data in connection with the software, Microsoft makes the commitments in the
32
+ European Union General Data Protection Regulation Terms of the Microsoft Products and
33
+ Services Data Protection Addendum to all customers effective May 25, 2018, at
34
+ https://docs.microsoft.com/legal/gdpr.
35
+ 4. SCOPE OF LICENSE. The software is licensed, not sold. These license terms only give
36
+ you some rights to use the software. Microsoft reserves all other rights. Unless applicable
37
+ law gives you more rights despite this limitation, you may use the software only as
38
+ expressly permitted in these license terms. In doing so, you must comply with any
39
+ technical limitations in the software that only allow you to use it in certain ways. In
40
+ addition, you may not:
41
+ • work around any technical limitations in the software;
42
+ • use it for any other purpose, other than designated in this license;
43
+ • reverse engineer, decompile or disassemble the software, or otherwise attempt to
44
+ derive the source code for the software, except and only to the extent required by
45
+ third party licensing terms governing use of certain open source components that
46
+ may be included with the software;
47
+ • remove, minimize, block or modify any notices of Microsoft or its suppliers in the
48
+ software;
49
+ • use the software in any way that is against the law;
50
+ • share, publish, rent, or lease the software; or
51
+ • provide the software as a stand-alone offering or combine it with any of your
52
+ applications for others to use, or transfer the software or this agreement to any third
53
+ party.
54
+ 5. FEEDBACK. If you give feedback about the software to Microsoft, you give to Microsoft,
55
+ without charge, the right to use, share, and commercialize your feedback in any way and for
56
+ any purpose. You will not give feedback that is subject to a license that requires Microsoft
57
+ to license its software or documentation to third parties because we include your feedback
58
+ in them. These rights survive this agreement.
59
+ 6. SUPPORT SERVICES. Because this software is “as is”, we may not provide support
60
+ services for it.
61
+ 7. ENTIRE AGREEMENT. This agreement, and the terms for supplements, updates,
62
+ Internet-based services and support services, are the entire agreement for the software
63
+ and support services.
64
+ 8. EXPORT RESTRICTIONS. You must comply with all domestic and international export
65
+ laws and regulations that apply to the software, which include restrictions on destinations,
66
+ end users, and end use. For further information on export restrictions, visit
67
+ https://www.microsoft.com/exporting.
68
+ 9. APPLICABLE LAW. If you acquired the software in the United States, Washington state
69
+ law applies to interpretation of, and claims for breach of this agreement, and the laws of
70
+ the state where you live apply to all other claims. If you acquired the software in any other
71
+ country, its laws apply.
72
+ 10. CONSUMER RIGHTS; REGIONAL VARIATIONS. These license terms describe certain
73
+ legal rights. You may have other rights, including consumer rights, under the laws of your
74
+ state or country. You may also have rights with respect to the party from which you
75
+ acquired the software. This agreement does not change those other rights if the laws of
76
+ your state or country do not permit it to do so. For example, if you acquired the software in
77
+ one of the below regions, or mandatory country law applies, then the following provisions
78
+ apply to you:
79
+ a. Australia. You have statutory guarantees under the Australian Consumer Law and
80
+ nothing in this agreement is intended to affect those rights.
81
+ b. Canada. You may stop receiving updates on your device by turning off Internet access. If
82
+ and when you re-connect to the Internet, the software will resume checking for and
83
+ installing updates.
84
+ c. Germany and Austria.
85
+ (i) Warranty. The properly licensed software will perform substantially as described in any
86
+ Microsoft materials that accompany the software. However, Microsoft gives no contractual
87
+ guarantee in relation to the licensed software.
88
+ (ii) Limitation of Liability. In case of intentional conduct, gross negligence, claims based
89
+ on the Product Liability Act, as well as, in the case of death or personal or physical injury,
90
+ Microsoft is liable according to the statutory law.
91
+ Subject to the preceding sentence (ii), Microsoft will only be liable for slight negligence if
92
+ Microsoft is in breach of such material contractual obligations, the fulfillment of which
93
+ facilitate the due performance of this agreement, the breach of which would endanger the
94
+ purpose of this agreement and the compliance with which a party may constantly trust in
95
+ (so-called "cardinal obligations"). In other cases of slight negligence, Microsoft will not be
96
+ liable for slight negligence.
97
+ 11. DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED “AS-IS”. YOU BEAR THE
98
+ RISK OF USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES OR
99
+ CONDITIONS. TO THE EXTENT PERMITTED UNDER YOUR LOCAL LAWS, MICROSOFT
100
+ EXCLUDES THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
101
+ PARTICULAR PURPOSE AND NON-INFRINGEMENT.
102
+ 12. LIMITATION ON AND EXCLUSION OF DAMAGES. YOU CAN RECOVER FROM
103
+ MICROSOFT AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP TO U.S. $5.00. YOU
104
+ CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL, LOST
105
+ PROFITS, SPECIAL, INDIRECT OR INCIDENTAL DAMAGES.
106
+ This limitation applies to (a) anything related to the software, services, content (including
107
+ code) on third party Internet sites, or third party applications; and (b) claims for breach of
108
+ contract, breach of warranty, guarantee or condition, strict liability, negligence, or other tort
109
+ to the extent permitted by applicable law.
110
+ It also applies even if Microsoft knew or should have known about the possibility of the
111
+ damages. The above limitation or exclusion may not apply to you because your country
112
+ may not allow the exclusion or limitation of incidental, consequential or other damages.
package/README.md ADDED
@@ -0,0 +1,59 @@
1
+ # @microsoft/power-apps-native-host
2
+
3
+ React Native host integration for `@microsoft/power-apps`. Provides the
4
+ provider tree, authentication context, connection setup UI, and platform
5
+ bridges required to embed Power Apps in a React Native / Expo application.
6
+
7
+ ## Build a Mobile App with Power Platform
8
+
9
+ Start from the Power Platform mobile app template, then use the mobile-app
10
+ skill to generate the app plan, data model, screens, native capabilities, and
11
+ connector wiring.
12
+
13
+ ```sh
14
+ npx degit microsoft/power-platform-skills/plugins/mobile-apps/template#main my-mobile-app
15
+ cd my-mobile-app
16
+ npm install
17
+ ```
18
+
19
+ Install the mobile-app skill from the Power Platform skills plugin:
20
+
21
+ ```text
22
+ https://github.com/microsoft/power-platform-skills/tree/main/plugins/mobile-apps/plugin.json
23
+ ```
24
+
25
+ Then open the template folder in VS Code and run the skill from Copilot Chat:
26
+
27
+ ```text
28
+ /create-mobile-app
29
+ ```
30
+
31
+ The template includes this host package and the required Expo / React Native
32
+ runtime dependencies. The skill updates the app in place as it designs and
33
+ generates the mobile experience.
34
+
35
+
36
+ ## Usage
37
+
38
+ ```tsx
39
+ import { PowerAppsProvider, useAuth } from '@microsoft/power-apps-native-host';
40
+
41
+ export default function App() {
42
+ return (
43
+ <PowerAppsProvider>
44
+ <YourApp />
45
+ </PowerAppsProvider>
46
+ );
47
+ }
48
+ ```
49
+
50
+ See `src/index.ts` for the full exported API.
51
+
52
+ ## Bundled CLI scripts
53
+
54
+ This package exposes three CLI scripts via the `bin` field:
55
+
56
+ - `generate-connector-schemas` — generates TypeScript schemas from connector definitions
57
+ - `js-bundle` — packages the JS bundle for embedding
58
+ - `build-ios-base` — builds the iOS base framework
59
+
package/app.plugin.js ADDED
@@ -0,0 +1,4 @@
1
+ // Expo config plugin entry point for the Power Apps native host package.
2
+ // Keep app templates on a single public dependency while delegating native
3
+ // auth/MAM build configuration to the auth package version pinned here.
4
+ module.exports = require('@microsoft/power-apps-native-auth/app.plugin.js');