@microsoft/managed-apps-cli 0.13.0 → 0.16.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.
Files changed (197) hide show
  1. package/README.md +1 -1
  2. package/dist/ArgumentProvider.d.ts +1 -2
  3. package/dist/ArgumentProvider.d.ts.map +1 -1
  4. package/dist/ArgumentProvider.js.map +1 -1
  5. package/dist/Authentication/NoOpAuthenticationProvider.d.ts +25 -0
  6. package/dist/Authentication/NoOpAuthenticationProvider.d.ts.map +1 -0
  7. package/dist/Authentication/NoOpAuthenticationProvider.js +31 -0
  8. package/dist/Authentication/NoOpAuthenticationProvider.js.map +1 -0
  9. package/dist/Cli.d.ts.map +1 -1
  10. package/dist/Cli.js +14 -0
  11. package/dist/Cli.js.map +1 -1
  12. package/dist/CliSettings.d.ts.map +1 -1
  13. package/dist/CliSettings.js +2 -1
  14. package/dist/CliSettings.js.map +1 -1
  15. package/dist/Constants/CommandRegistry.d.ts.map +1 -1
  16. package/dist/Constants/CommandRegistry.js +22 -4
  17. package/dist/Constants/CommandRegistry.js.map +1 -1
  18. package/dist/Constants/HelpStrings.d.ts +21 -3
  19. package/dist/Constants/HelpStrings.d.ts.map +1 -1
  20. package/dist/Constants/HelpStrings.js +53 -18
  21. package/dist/Constants/HelpStrings.js.map +1 -1
  22. package/dist/Constants.d.ts +2 -0
  23. package/dist/Constants.d.ts.map +1 -1
  24. package/dist/Constants.js +8 -0
  25. package/dist/Constants.js.map +1 -1
  26. package/dist/HttpClient/CliHttpClient.d.ts +1 -1
  27. package/dist/HttpClient/CliHttpClient.d.ts.map +1 -1
  28. package/dist/HttpClient/CliHttpClient.js +49 -2
  29. package/dist/HttpClient/CliHttpClient.js.map +1 -1
  30. package/dist/Logger/CliLogger.d.ts +1 -1
  31. package/dist/Logger/CliLogger.d.ts.map +1 -1
  32. package/dist/Logger/CliLogger.js +23 -4
  33. package/dist/Logger/CliLogger.js.map +1 -1
  34. package/dist/Logger/ConsoleWriter.d.ts +1 -0
  35. package/dist/Logger/ConsoleWriter.d.ts.map +1 -1
  36. package/dist/Logger/ConsoleWriter.js +3 -0
  37. package/dist/Logger/ConsoleWriter.js.map +1 -1
  38. package/dist/Logger/OneDSWriter.d.ts +1 -1
  39. package/dist/Logger/OneDSWriter.d.ts.map +1 -1
  40. package/dist/Logger/OneDSWriter.js +8 -3
  41. package/dist/Logger/OneDSWriter.js.map +1 -1
  42. package/dist/Testing/MockFetch.d.ts +23 -0
  43. package/dist/Testing/MockFetch.d.ts.map +1 -0
  44. package/dist/Testing/MockFetch.js +177 -0
  45. package/dist/Testing/MockFetch.js.map +1 -0
  46. package/dist/Testing/MockRoutes.d.ts +34 -0
  47. package/dist/Testing/MockRoutes.d.ts.map +1 -0
  48. package/dist/Testing/MockRoutes.js +226 -0
  49. package/dist/Testing/MockRoutes.js.map +1 -0
  50. package/dist/Testing/fixtures/connectors/commondataserviceforapps.d.ts +6 -0
  51. package/dist/Testing/fixtures/connectors/commondataserviceforapps.d.ts.map +1 -0
  52. package/dist/Testing/fixtures/connectors/commondataserviceforapps.js +25 -0
  53. package/dist/Testing/fixtures/connectors/commondataserviceforapps.js.map +1 -0
  54. package/dist/Testing/fixtures/connectors/dataverseContactEntity.d.ts +6 -0
  55. package/dist/Testing/fixtures/connectors/dataverseContactEntity.d.ts.map +1 -0
  56. package/dist/Testing/fixtures/connectors/dataverseContactEntity.js +55 -0
  57. package/dist/Testing/fixtures/connectors/dataverseContactEntity.js.map +1 -0
  58. package/dist/Testing/fixtures/connectors/excelonlinebusiness.d.ts +6 -0
  59. package/dist/Testing/fixtures/connectors/excelonlinebusiness.d.ts.map +1 -0
  60. package/dist/Testing/fixtures/connectors/excelonlinebusiness.js +1970 -0
  61. package/dist/Testing/fixtures/connectors/excelonlinebusiness.js.map +1 -0
  62. package/dist/Testing/fixtures/connectors/kusto.d.ts +6 -0
  63. package/dist/Testing/fixtures/connectors/kusto.d.ts.map +1 -0
  64. package/dist/Testing/fixtures/connectors/kusto.js +1333 -0
  65. package/dist/Testing/fixtures/connectors/kusto.js.map +1 -0
  66. package/dist/Testing/fixtures/connectors/msnweather.d.ts +6 -0
  67. package/dist/Testing/fixtures/connectors/msnweather.d.ts.map +1 -0
  68. package/dist/Testing/fixtures/connectors/msnweather.js +917 -0
  69. package/dist/Testing/fixtures/connectors/msnweather.js.map +1 -0
  70. package/dist/Testing/fixtures/connectors/office365groups.d.ts +6 -0
  71. package/dist/Testing/fixtures/connectors/office365groups.d.ts.map +1 -0
  72. package/dist/Testing/fixtures/connectors/office365groups.js +2144 -0
  73. package/dist/Testing/fixtures/connectors/office365groups.js.map +1 -0
  74. package/dist/Testing/fixtures/connectors/office365users.d.ts +6 -0
  75. package/dist/Testing/fixtures/connectors/office365users.d.ts.map +1 -0
  76. package/dist/Testing/fixtures/connectors/office365users.js +1969 -0
  77. package/dist/Testing/fixtures/connectors/office365users.js.map +1 -0
  78. package/dist/Testing/fixtures/connectors/onedriveforbusiness.d.ts +6 -0
  79. package/dist/Testing/fixtures/connectors/onedriveforbusiness.d.ts.map +1 -0
  80. package/dist/Testing/fixtures/connectors/onedriveforbusiness.js +4873 -0
  81. package/dist/Testing/fixtures/connectors/onedriveforbusiness.js.map +1 -0
  82. package/dist/Testing/fixtures/connectors/powerappsforappmakers.d.ts +6 -0
  83. package/dist/Testing/fixtures/connectors/powerappsforappmakers.d.ts.map +1 -0
  84. package/dist/Testing/fixtures/connectors/powerappsforappmakers.js +4682 -0
  85. package/dist/Testing/fixtures/connectors/powerappsforappmakers.js.map +1 -0
  86. package/dist/Testing/fixtures/connectors/sharepointTestListMetadata.d.ts +6 -0
  87. package/dist/Testing/fixtures/connectors/sharepointTestListMetadata.d.ts.map +1 -0
  88. package/dist/Testing/fixtures/connectors/sharepointTestListMetadata.js +1078 -0
  89. package/dist/Testing/fixtures/connectors/sharepointTestListMetadata.js.map +1 -0
  90. package/dist/Testing/fixtures/connectors/sharepointonline.d.ts +6 -0
  91. package/dist/Testing/fixtures/connectors/sharepointonline.d.ts.map +1 -0
  92. package/dist/Testing/fixtures/connectors/sharepointonline.js +28 -0
  93. package/dist/Testing/fixtures/connectors/sharepointonline.js.map +1 -0
  94. package/dist/Testing/fixtures/connectors/teams.d.ts +6 -0
  95. package/dist/Testing/fixtures/connectors/teams.d.ts.map +1 -0
  96. package/dist/Testing/fixtures/connectors/teams.js +9987 -0
  97. package/dist/Testing/fixtures/connectors/teams.js.map +1 -0
  98. package/dist/Testing/fixtures/connectors/translatorv2.d.ts +6 -0
  99. package/dist/Testing/fixtures/connectors/translatorv2.d.ts.map +1 -0
  100. package/dist/Testing/fixtures/connectors/translatorv2.js +307 -0
  101. package/dist/Testing/fixtures/connectors/translatorv2.js.map +1 -0
  102. package/dist/Testing/fixtures/index.d.ts +23 -0
  103. package/dist/Testing/fixtures/index.d.ts.map +1 -0
  104. package/dist/Testing/fixtures/index.js +96 -0
  105. package/dist/Testing/fixtures/index.js.map +1 -0
  106. package/dist/Types/LoggerTypes.types.d.ts +1 -0
  107. package/dist/Types/LoggerTypes.types.d.ts.map +1 -1
  108. package/dist/Utils/CoerceCliVersion.d.ts +27 -0
  109. package/dist/Utils/CoerceCliVersion.d.ts.map +1 -0
  110. package/dist/Utils/CoerceCliVersion.js +67 -0
  111. package/dist/Utils/CoerceCliVersion.js.map +1 -0
  112. package/dist/Utils/EnvVars.d.ts +1 -1
  113. package/dist/Utils/EnvVars.d.ts.map +1 -1
  114. package/dist/Utils/EnvVars.js.map +1 -1
  115. package/dist/Utils/EnvironmentRoutingUtils.d.ts +1 -2
  116. package/dist/Utils/EnvironmentRoutingUtils.d.ts.map +1 -1
  117. package/dist/Utils/EnvironmentRoutingUtils.js.map +1 -1
  118. package/dist/Utils/MaafAppConfig.d.ts +2 -0
  119. package/dist/Utils/MaafAppConfig.d.ts.map +1 -1
  120. package/dist/Utils/MaafAppConfig.js +6 -0
  121. package/dist/Utils/MaafAppConfig.js.map +1 -1
  122. package/dist/Utils/PinCli.d.ts +18 -13
  123. package/dist/Utils/PinCli.d.ts.map +1 -1
  124. package/dist/Utils/PinCli.js +37 -18
  125. package/dist/Utils/PinCli.js.map +1 -1
  126. package/dist/Utils/RepoOption.d.ts +1 -0
  127. package/dist/Utils/RepoOption.d.ts.map +1 -1
  128. package/dist/Utils/RepoOption.js +14 -0
  129. package/dist/Utils/RepoOption.js.map +1 -1
  130. package/dist/Utils/ShareAccessRouting.d.ts +78 -0
  131. package/dist/Utils/ShareAccessRouting.d.ts.map +1 -0
  132. package/dist/Utils/ShareAccessRouting.js +93 -0
  133. package/dist/Utils/ShareAccessRouting.js.map +1 -0
  134. package/dist/Verbs/AddConnector.d.ts +6 -6
  135. package/dist/Verbs/AddConnector.d.ts.map +1 -1
  136. package/dist/Verbs/AddConnector.js +62 -36
  137. package/dist/Verbs/AddConnector.js.map +1 -1
  138. package/dist/Verbs/AddConnectorFlows.d.ts +14 -2
  139. package/dist/Verbs/AddConnectorFlows.d.ts.map +1 -1
  140. package/dist/Verbs/AddConnectorFlows.js +67 -18
  141. package/dist/Verbs/AddConnectorFlows.js.map +1 -1
  142. package/dist/Verbs/ConnectorHelpers.d.ts +79 -6
  143. package/dist/Verbs/ConnectorHelpers.d.ts.map +1 -1
  144. package/dist/Verbs/ConnectorHelpers.js +280 -32
  145. package/dist/Verbs/ConnectorHelpers.js.map +1 -1
  146. package/dist/Verbs/CreateMaafApp.d.ts +8 -16
  147. package/dist/Verbs/CreateMaafApp.d.ts.map +1 -1
  148. package/dist/Verbs/CreateMaafApp.js +224 -96
  149. package/dist/Verbs/CreateMaafApp.js.map +1 -1
  150. package/dist/Verbs/DeleteMaafApp.d.ts +13 -9
  151. package/dist/Verbs/DeleteMaafApp.d.ts.map +1 -1
  152. package/dist/Verbs/DeleteMaafApp.js +41 -21
  153. package/dist/Verbs/DeleteMaafApp.js.map +1 -1
  154. package/dist/Verbs/Dev.d.ts.map +1 -1
  155. package/dist/Verbs/Dev.js +34 -3
  156. package/dist/Verbs/Dev.js.map +1 -1
  157. package/dist/Verbs/GetMaafApp.d.ts.map +1 -1
  158. package/dist/Verbs/GetMaafApp.js +18 -6
  159. package/dist/Verbs/GetMaafApp.js.map +1 -1
  160. package/dist/Verbs/Init.d.ts.map +1 -1
  161. package/dist/Verbs/Init.js +58 -5
  162. package/dist/Verbs/Init.js.map +1 -1
  163. package/dist/Verbs/ListConnectors.d.ts.map +1 -1
  164. package/dist/Verbs/ListConnectors.js +12 -1
  165. package/dist/Verbs/ListConnectors.js.map +1 -1
  166. package/dist/Verbs/ListMaafApps.d.ts +9 -8
  167. package/dist/Verbs/ListMaafApps.d.ts.map +1 -1
  168. package/dist/Verbs/ListMaafApps.js +30 -23
  169. package/dist/Verbs/ListMaafApps.js.map +1 -1
  170. package/dist/Verbs/MaafAppPermissions.d.ts +8 -17
  171. package/dist/Verbs/MaafAppPermissions.d.ts.map +1 -1
  172. package/dist/Verbs/MaafAppPermissions.js +84 -91
  173. package/dist/Verbs/MaafAppPermissions.js.map +1 -1
  174. package/dist/Verbs/Pack.d.ts +30 -1
  175. package/dist/Verbs/Pack.d.ts.map +1 -1
  176. package/dist/Verbs/Pack.js +179 -2
  177. package/dist/Verbs/Pack.js.map +1 -1
  178. package/dist/Verbs/RefreshDataSource.d.ts +15 -0
  179. package/dist/Verbs/RefreshDataSource.d.ts.map +1 -1
  180. package/dist/Verbs/RefreshDataSource.js +41 -27
  181. package/dist/Verbs/RefreshDataSource.js.map +1 -1
  182. package/dist/Verbs/RemoveDataSource.d.ts.map +1 -1
  183. package/dist/Verbs/RemoveDataSource.js +17 -3
  184. package/dist/Verbs/RemoveDataSource.js.map +1 -1
  185. package/dist/Verbs/ShareList.d.ts +10 -0
  186. package/dist/Verbs/ShareList.d.ts.map +1 -0
  187. package/dist/Verbs/ShareList.js +254 -0
  188. package/dist/Verbs/ShareList.js.map +1 -0
  189. package/dist/Verbs/VerbConstants.d.ts +56 -3
  190. package/dist/Verbs/VerbConstants.d.ts.map +1 -1
  191. package/dist/Verbs/VerbConstants.js +40 -3
  192. package/dist/Verbs/VerbConstants.js.map +1 -1
  193. package/dist/Verbs/index.d.ts +1 -0
  194. package/dist/Verbs/index.d.ts.map +1 -1
  195. package/dist/Verbs/index.js +1 -0
  196. package/dist/Verbs/index.js.map +1 -1
  197. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentRoutingUtils.js","sourceRoot":"","sources":["../../src/Utils/EnvironmentRoutingUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAChG,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAElF,OAAO,EACL,8BAA8B,EAC9B,sBAAsB,EACtB,6BAA6B,EAC7B,2BAA2B,GAC5B,MAAM,yCAAyC,CAAC;AAIjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAExD,MAAM,CAAC,KAAK,UAAU,gCAAgC,CACpD,aAAuD,EACvD,UAAuB,EACvB,MAAe;IAEf,4FAA4F;IAC5F,gGAAgG;IAChG,4FAA4F;IAC5F,0CAA0C;IAC1C,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC;QAEnC,IAAI,MAAM,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YAC1B,uEAAuE;YACvE,sEAAsE;YACtE,0DAA0D;YAC1D,gEAAgE;YAChE,IACE,MAAM,CAAC,IAAI,CAAC,gBAAgB,KAAK,KAAK;gBACtC,MAAM,CAAC,IAAI,CAAC,gBAAgB,KAAK,KAAK;gBACtC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EACvB,CAAC;gBACD,MAAM,IAAI,sBAAsB,CAAC,GAAG,EAAE,MAAM,CAA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AM,EACN,OAAO,EAAE,kBAAkB,IAAI,YAAY,CAC5C,CAAC;IAEF,qBAAqB,CAAC,aAAa,CAAC,CAAC;IAErC,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC;QACvB,SAAS,CAAC,+BAA+B,aAAa,GAAG,CAAC,CAAC;IAC7D,CAAC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC;AAED;;;;GAIG;AACH,KAAK,UAAU,uBAAuB,CACpC,gBAAkC,EAClC,QAAgB,EAChB,MAAe,EACf,kBAA0B;IAE1B,IAAI,CAAC;QACH,OAAO,MAAM,oBAAoB,CAAC,gBAAgB,EAAE,QAAQ,EAAE,MAAM,EAAE,kBAAkB,EAAE;YACxF,sBAAsB,EAAE,KAAK;SAC9B,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,2BAA2B,CAAC,KAAK,CAAC,CAAC;QACnC,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -14,6 +14,8 @@ interface BuildMaafAppConfigOptions {
14
14
  buildEntryPoint?: string;
15
15
  repositoryId?: string;
16
16
  externalRepoUrl?: string;
17
+ iconPath?: string;
18
+ localAppUrl?: string;
17
19
  appSettings?: AppConfig['appSettings'];
18
20
  connectionReferences?: AppConfig['connectionReferences'];
19
21
  }
@@ -1 +1 @@
1
- {"version":3,"file":"MaafAppConfig.d.ts","sourceRoot":"","sources":["../../src/Utils/MaafAppConfig.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AAGjF,UAAU,yBAAyB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACvC,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,EAAE,SAAS,CAAC,OAA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,SAAS,CAuChF"}
@@ -21,6 +21,12 @@ export function buildMaafAppConfig(options) {
21
21
  if (options.externalRepoUrl) {
22
22
  appConfig.externalRepoUrl = options.externalRepoUrl;
23
23
  }
24
+ if (options.iconPath) {
25
+ appConfig.iconPath = options.iconPath;
26
+ }
27
+ if (options.localAppUrl) {
28
+ appConfig.localAppUrl = options.localAppUrl;
29
+ }
24
30
  if (options.connectionReferences !== undefined) {
25
31
  appConfig.connectionReferences = options.connectionReferences;
26
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"MaafAppConfig.js","sourceRoot":"","sources":["../../src/Utils/MaafAppConfig.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAkBhE,MAAM,UAAU,kBAAkB,CAAC,OAAkC;IACnE,MAAM,SAAS,GAAc;QAC3B,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,cAAc,EAAE,OAAO,CAAC,cAAc;QACtC,aAAa,EAAE,OAAO,CAAC,aAAa;QACpC,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,QAAQ;QACxC,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,eAAe;QACrD,eAAe,EAAE,OAAO,CAAC,eAAe,IAAI,YAAY;KACzD,CAAC;IAEF,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;QACzB,SAAS,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;IAChD,CAAC;IAED,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;QAC5B,SAAS,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IACtD,CAAC;IAED,IAAI,OAAO,CAAC,oBAAoB,KAAK,SAAS,EAAE,CAAC;QAC/C,SAAS,CAAC,oBAA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,WAAW,CAAC;IAC9C,CAAC;IAED,IAAI,OAAO,CAAC,oBAAoB,KAAK,SAAS,EAAE,CAAC;QAC/C,SAAS,CAAC,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAChE,CAAC;IAED,IAAI,OAAO,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;QACtC,SAAS,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IAC9C,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -1,28 +1,33 @@
1
1
  /*!
2
2
  * Copyright (C) Microsoft Corporation. All rights reserved.
3
3
  */
4
+ import type { IHttpClient } from '@microsoft/managed-apps-common/services';
4
5
  /**
5
- * Pins the running CLI into an app's `package.json` as a `devDependency` at the
6
- * exact version of the CLI executing the command (read from this package's own
7
- * manifest, so it always matches the running CLI).
6
+ * Pins the CLI into an app's `package.json` as a `devDependency`, so the app
7
+ * carries a project-local `ms` (resolved by `npx ms` / `pnpm exec` / `bun x` ahead
8
+ * of any globally-installed CLI) and keeps building against a compatible CLI even
9
+ * if the developer's global CLI later moves on.
10
+ *
11
+ * The version to pin comes from `coerceCliVersion` (which uses `httpClient` for the
12
+ * registry lookup on prerelease/dev builds): the exact running version for a
13
+ * published release, or a caret range of the latest published version for a
14
+ * prerelease/dev build. When it can't resolve a publishable version — an
15
+ * unparseable version, or a prerelease with the registry unreachable — the pin is
16
+ * skipped with a warning rather than writing a spec that would `ETARGET` the
17
+ * consumer's `npm install`.
8
18
  *
9
19
  * Used by `ms app create` (right after the template is scaffolded) and `ms app
10
- * init` (binding an existing project) so the app carries a project-local `ms` at
11
- * the version it was set up with — which `npx ms` / `pnpm exec` / `bun x` resolve
12
- * ahead of any globally-installed CLI. The app therefore keeps building and
13
- * deploying against the CLI it was created with, even if the developer's global
14
- * CLI later moves to an incompatible version.
20
+ * init` (binding an existing project).
15
21
  *
16
22
  * Best-effort and non-fatal — the server-side app already exists by the time this
17
23
  * runs:
18
- * - No `package.json` in `appDir` (e.g. `ms app create` with a custom
19
- * `--template` that isn't an npm project) → nothing to pin; return quietly.
20
- * - Read / parse / write failure → warn (outside `--json` mode) and continue;
21
- * the user can add the pin by hand.
24
+ * - No `package.json` in `appDir` (e.g. a custom `--template` that isn't an npm
25
+ * project) → nothing to pin; return quietly.
26
+ * - Read / parse / write failure → warn (outside `--json` mode) and continue.
22
27
  *
23
28
  * The entry overwrites any existing CLI `devDependencies` entry, and
24
29
  * `devDependencies` is re-sorted alphabetically to match the npm convention so a
25
30
  * later `install --save` won't reshuffle the file.
26
31
  */
27
- export declare function pinCliIntoAppPackageJson(appDir: string, jsonMode: boolean): void;
32
+ export declare function pinCliIntoAppPackageJson(appDir: string, jsonMode: boolean, httpClient: IHttpClient): Promise<void>;
28
33
  //# sourceMappingURL=PinCli.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PinCli.d.ts","sourceRoot":"","sources":["../../src/Utils/PinCli.ts"],"names":[],"mappings":"AAAA;;GAEG;AAQH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAiChF"}
1
+ {"version":3,"file":"PinCli.d.ts","sourceRoot":"","sources":["../../src/Utils/PinCli.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAQ3E;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,OAAO,EACjB,UAAU,EAAE,WAAW,GACtB,OAAO,CAAC,IAAI,CAAC,CAoDf"}
@@ -4,42 +4,62 @@
4
4
  import * as fs from 'fs';
5
5
  import * as path from 'path';
6
6
  import packageJson from '../../package.json' with { type: 'json' };
7
+ import { coerceCliVersion } from './CoerceCliVersion.js';
7
8
  import { printWarning } from './ConsoleOutput.js';
8
9
  /**
9
- * Pins the running CLI into an app's `package.json` as a `devDependency` at the
10
- * exact version of the CLI executing the command (read from this package's own
11
- * manifest, so it always matches the running CLI).
10
+ * Pins the CLI into an app's `package.json` as a `devDependency`, so the app
11
+ * carries a project-local `ms` (resolved by `npx ms` / `pnpm exec` / `bun x` ahead
12
+ * of any globally-installed CLI) and keeps building against a compatible CLI even
13
+ * if the developer's global CLI later moves on.
14
+ *
15
+ * The version to pin comes from `coerceCliVersion` (which uses `httpClient` for the
16
+ * registry lookup on prerelease/dev builds): the exact running version for a
17
+ * published release, or a caret range of the latest published version for a
18
+ * prerelease/dev build. When it can't resolve a publishable version — an
19
+ * unparseable version, or a prerelease with the registry unreachable — the pin is
20
+ * skipped with a warning rather than writing a spec that would `ETARGET` the
21
+ * consumer's `npm install`.
12
22
  *
13
23
  * Used by `ms app create` (right after the template is scaffolded) and `ms app
14
- * init` (binding an existing project) so the app carries a project-local `ms` at
15
- * the version it was set up with — which `npx ms` / `pnpm exec` / `bun x` resolve
16
- * ahead of any globally-installed CLI. The app therefore keeps building and
17
- * deploying against the CLI it was created with, even if the developer's global
18
- * CLI later moves to an incompatible version.
24
+ * init` (binding an existing project).
19
25
  *
20
26
  * Best-effort and non-fatal — the server-side app already exists by the time this
21
27
  * runs:
22
- * - No `package.json` in `appDir` (e.g. `ms app create` with a custom
23
- * `--template` that isn't an npm project) → nothing to pin; return quietly.
24
- * - Read / parse / write failure → warn (outside `--json` mode) and continue;
25
- * the user can add the pin by hand.
28
+ * - No `package.json` in `appDir` (e.g. a custom `--template` that isn't an npm
29
+ * project) → nothing to pin; return quietly.
30
+ * - Read / parse / write failure → warn (outside `--json` mode) and continue.
26
31
  *
27
32
  * The entry overwrites any existing CLI `devDependencies` entry, and
28
33
  * `devDependencies` is re-sorted alphabetically to match the npm convention so a
29
34
  * later `install --save` won't reshuffle the file.
30
35
  */
31
- export function pinCliIntoAppPackageJson(appDir, jsonMode) {
36
+ export async function pinCliIntoAppPackageJson(appDir, jsonMode, httpClient) {
32
37
  const packageJsonPath = path.join(appDir, 'package.json');
33
- // existsSync gate keeps the common "not an npm project" case off the warning
34
- // path below only genuine read/parse/write failures should warn.
38
+ // existsSync gate keeps the common "not an npm project" case off both the
39
+ // registry lookup and the warning paths below.
35
40
  if (!fs.existsSync(packageJsonPath)) {
36
41
  return;
37
42
  }
43
+ const pinVersion = await coerceCliVersion(httpClient);
44
+ if (!pinVersion) {
45
+ if (!jsonMode) {
46
+ printWarning(`Skipping the project-local CLI pin: '${packageJson.version}' is not a published ` +
47
+ `release and no published version could be resolved. Install '${packageJson.name}' ` +
48
+ `into the project manually if you want a project-local CLI.`);
49
+ }
50
+ return;
51
+ }
52
+ // A substituted spec (prerelease → latest published) pins a different version
53
+ // than the running CLI; surface that so it isn't a silent swap.
54
+ if (!jsonMode && pinVersion !== packageJson.version) {
55
+ printWarning(`'${packageJson.version}' is a prerelease build; pinning the latest published CLI ` +
56
+ `('${pinVersion}') into the app instead.`);
57
+ }
38
58
  try {
39
59
  const manifest = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
40
60
  manifest.devDependencies = Object.fromEntries(Object.entries({
41
61
  ...manifest.devDependencies,
42
- [packageJson.name]: packageJson.version,
62
+ [packageJson.name]: pinVersion,
43
63
  // Explicit 'en' locale keeps the sort order deterministic across hosts
44
64
  // (a bare localeCompare follows the machine's default collation).
45
65
  }).sort(([a], [b]) => a.localeCompare(b, 'en')));
@@ -50,8 +70,7 @@ export function pinCliIntoAppPackageJson(appDir, jsonMode) {
50
70
  if (!jsonMode) {
51
71
  printWarning(`Could not pin '${packageJson.name}' into ${packageJsonPath} ` +
52
72
  `(${err instanceof Error ? err.message : String(err)}). Add ` +
53
- `"${packageJson.name}": "${packageJson.version}" to devDependencies manually ` +
54
- `to get a project-local CLI.`);
73
+ `"${packageJson.name}": "${pinVersion}" to devDependencies manually.`);
55
74
  }
56
75
  }
57
76
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PinCli.js","sourceRoot":"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AACH,CAAC"}
@@ -26,6 +26,7 @@ export interface RepoSelection {
26
26
  /**
27
27
  * Maps the raw `--repo` flag value to a `(repoType, remoteUrl)` pair.
28
28
  * - omitted / empty → `native` (default GRS-backed flow)
29
+ * - `native` (case-insensitive) → `native` (explicit GRS flow; caller skips git detection)
29
30
  * - `none` (case-insensitive) → `none` (no GRS, no local setup)
30
31
  * - any other non-empty value → `github` (external GHE binding, the trimmed value
31
32
  * flows through as `remoteUrl` to the action and the eventual git clone)
@@ -1 +1 @@
1
- {"version":3,"file":"RepoOption.d.ts","sourceRoot":"","sources":["../../src/Utils/RepoOption.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AAiBtE;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa,CAS/E"}
1
+ {"version":3,"file":"RepoOption.d.ts","sourceRoot":"","sources":["../../src/Utils/RepoOption.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AA4BtE;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa,CAY/E"}
@@ -9,6 +9,16 @@
9
9
  * select this flow. Any other non-empty `--repo` value is treated as a remote URL.
10
10
  */
11
11
  const REPO_NONE_SENTINEL = 'none';
12
+ /**
13
+ * Sentinel value for `--repo` that forces the platform-managed (native / GRS) flow
14
+ * deterministically: create the server-side app record, provision a platform-managed GRS
15
+ * repo, and write `ms.config.json` with `repoType: 'native'` — **without** inspecting the
16
+ * ambient git working tree. This lets automated callers (e.g. `power-apps migrate`) opt into
17
+ * native even when the target directory happens to sit inside another git repo, where an
18
+ * omitted `--repo` would otherwise auto-bind a parent remote. Comparison is case-insensitive
19
+ * — `native`, `Native`, `NATIVE` all select this flow.
20
+ */
21
+ const REPO_NATIVE_SENTINEL = 'native';
12
22
  /**
13
23
  * Matches a GRS repository id — a GUID. Used to disambiguate a `--repo` value that is a
14
24
  * platform-managed (GRS) repository id from an external repository URL. Case-insensitive.
@@ -25,6 +35,7 @@ export function isGrsRepositoryId(value) {
25
35
  /**
26
36
  * Maps the raw `--repo` flag value to a `(repoType, remoteUrl)` pair.
27
37
  * - omitted / empty → `native` (default GRS-backed flow)
38
+ * - `native` (case-insensitive) → `native` (explicit GRS flow; caller skips git detection)
28
39
  * - `none` (case-insensitive) → `none` (no GRS, no local setup)
29
40
  * - any other non-empty value → `github` (external GHE binding, the trimmed value
30
41
  * flows through as `remoteUrl` to the action and the eventual git clone)
@@ -41,6 +52,9 @@ export function parseRepoOption(rawRepoValue) {
41
52
  return { repoType: 'native', remoteUrl: undefined };
42
53
  }
43
54
  const trimmed = rawRepoValue.trim();
55
+ if (trimmed.toLowerCase() === REPO_NATIVE_SENTINEL) {
56
+ return { repoType: 'native', remoteUrl: undefined };
57
+ }
44
58
  if (trimmed.toLowerCase() === REPO_NONE_SENTINEL) {
45
59
  return { repoType: 'none', remoteUrl: undefined };
46
60
  }
@@ -1 +1 @@
1
- {"version":3,"file":"RepoOption.js","sourceRoot":"","sources":["../../src/Utils/RepoOption.ts"],"names":[],"mappings":"AAAA;;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AC9D,IAAI,YAAY,KAAK,SAAS,IAAI,YAAY,KAAK,EAAE,EAAE,CAAC;QACtD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;IACtD,CAAC;IACD,MAAM,OAAO,GAAG,YAAY,CAAC,IAAI,EAAE,CAAC;IACpC,IAAI,OAAO,CAAC,WAAW,EAAE,KAAK,oBAAoB,EAAE,CAAC;QACnD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;IACtD,CAAC;IACD,IAAI,OAAO,CAAC,WAAW,EAAE,KAAK,kBAAkB,EAAE,CAAC;QACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;IACpD,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;AACpD,CAAC"}
@@ -0,0 +1,78 @@
1
+ /*!
2
+ * Copyright (C) Microsoft Corporation. All rights reserved.
3
+ */
4
+ import type { MaafAppDefinition } from '@microsoft/managed-apps-actions';
5
+ import type { RepoType } from '@microsoft/managed-apps-common/config';
6
+ /**
7
+ * Selects which access level the caller wants to grant/revoke/list:
8
+ *
9
+ * - `play` — read-only access to the MAAF app itself, granted at the app scope
10
+ * via PowerApps RP (`MicrosoftAppReader` role).
11
+ * - `edit` — read + write access to the app's code. The concrete scope depends
12
+ * on `repoType`: for `native` repositories the `RepositoryContributor` role
13
+ * lives at the GRS repo scope; for `none` / `github` repositories the
14
+ * `MicrosoftAppContributor` role lives at the MAAF app scope instead (since
15
+ * there is no platform-managed repository to attach a role to).
16
+ */
17
+ export type MaafAppAccessLevel = 'play' | 'edit';
18
+ export declare const noRepositoryLinkedMessage: string;
19
+ export declare const externalRepositoryWarning: string;
20
+ /**
21
+ * The all-zero GUID the platform writes as a "no repository" placeholder. A
22
+ * config or app definition carrying this value must be treated as having no
23
+ * repo-scope id (i.e. never used to address a GRS repo endpoint).
24
+ */
25
+ export declare const EmptyRepositoryId = "00000000-0000-0000-0000-000000000000";
26
+ /**
27
+ * True when a `repositoryId` is present and is a real id — i.e. non-empty and
28
+ * not the {@link EmptyRepositoryId} sentinel. Use this everywhere a
29
+ * `repositoryId` is about to drive a repo-scope read so the zero-GUID
30
+ * placeholder is consistently treated as "no repo".
31
+ */
32
+ export declare function hasMeaningfulRepositoryId(repositoryId: string | undefined): boolean;
33
+ /**
34
+ * Parses the `--access` flag value. Defaults to `'play'` when omitted so
35
+ * `share`/`unshare` keep their pre-flag behaviour for callers that haven't
36
+ * migrated. Throws a `UsageError` on any other value — Commander.js doesn't
37
+ * enforce enum membership by default and we want a precise error message.
38
+ *
39
+ * `play` and `edit` are the only externally visible levels. The role and scope
40
+ * the level resolves to are decided downstream (see {@link MaafAppAccessLevel}).
41
+ */
42
+ export declare function parseAccessLevel(raw: string | undefined): MaafAppAccessLevel;
43
+ /**
44
+ * Resolves the effective {@link RepoType} from an `AppConfig`.
45
+ *
46
+ * Hard rule: if `repoType` is missing AND the config carries a (non-empty,
47
+ * non-zero-GUID) `repositoryId`, refuse to guess - the user must re-run
48
+ * `app init` to migrate the config. When both are missing we treat it as
49
+ * `'none'`: there is no repo-scope to act on, and the app-scope fallback in
50
+ * the share/unshare/list routing handles edit correctly.
51
+ */
52
+ export declare function resolveRepoType(appConfig: {
53
+ repoType?: RepoType;
54
+ repositoryId?: string;
55
+ }): RepoType;
56
+ /**
57
+ * Fetches the app definition via the info action. Performs no `repositoryId`
58
+ * validation — use this when the caller only needs app metadata (e.g. to
59
+ * classify the {@link RepoType} for routing). Callers that require a repo-scope
60
+ * id must validate it themselves (see {@link resolveAppForEditAsync}).
61
+ */
62
+ export declare function fetchAppDefinitionAsync(args: {
63
+ tenantId: string;
64
+ environmentId: string;
65
+ appName: string;
66
+ }): Promise<MaafAppDefinition>;
67
+ /**
68
+ * Fetches the app definition and validates it carries a `repositoryId`. Used by
69
+ * the `edit` access paths that drive the GRS repo-scope endpoints; the returned
70
+ * definition is also reused to surface the post-share repository details
71
+ * (avoiding a second GET on the native path).
72
+ */
73
+ export declare function resolveAppForEditAsync(args: {
74
+ tenantId: string;
75
+ environmentId: string;
76
+ appName: string;
77
+ }): Promise<MaafAppDefinition>;
78
+ //# sourceMappingURL=ShareAccessRouting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShareAccessRouting.d.ts","sourceRoot":"","sources":["../../src/Utils/ShareAccessRouting.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEzE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AAOtE;;;;;;;;;;GAUG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEjD,eAAO,MAAM,yBAAyB,QAIkB,CAAC;AAEzD,eAAO,MAAM,yBAAyB,QAE8B,CAAC;AAErE;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,yCAAyC,CAAC;AAExE;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEnF;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,kBAAkB,CAQ5E;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE;IACzC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,QAAQ,CAYX;AAED;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAAC,IAAI,EAAE;IAClD,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAO7B;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAAC,IAAI,EAAE;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAM7B"}
@@ -0,0 +1,93 @@
1
+ /*!
2
+ * Copyright (C) Microsoft Corporation. All rights reserved.
3
+ */
4
+ import { infoAsync } from '@microsoft/managed-apps-actions';
5
+ import { AppConfigFileName } from '@microsoft/managed-apps-common/config';
6
+ import { getCliLogger } from '../CliSettings.js';
7
+ import { CLI_BINARY_NAME } from '../Constants/CliConstants.js';
8
+ import { UsageError } from '../Errors/CliError.js';
9
+ export const noRepositoryLinkedMessage = 'Cannot share source code — no repository linked.\n\n' +
10
+ "This app has no linked repository, so source code isn't stored on the platform. " +
11
+ "To collaborate on code, run 'ms app init' to create an app instance with a repo, " +
12
+ 'or share the source with your collaborator directly.';
13
+ export const externalRepositoryWarning = 'This app is not backed by a platform managed repo. ' +
14
+ 'Repository access must be configured in the external repository.';
15
+ /**
16
+ * The all-zero GUID the platform writes as a "no repository" placeholder. A
17
+ * config or app definition carrying this value must be treated as having no
18
+ * repo-scope id (i.e. never used to address a GRS repo endpoint).
19
+ */
20
+ export const EmptyRepositoryId = '00000000-0000-0000-0000-000000000000';
21
+ /**
22
+ * True when a `repositoryId` is present and is a real id — i.e. non-empty and
23
+ * not the {@link EmptyRepositoryId} sentinel. Use this everywhere a
24
+ * `repositoryId` is about to drive a repo-scope read so the zero-GUID
25
+ * placeholder is consistently treated as "no repo".
26
+ */
27
+ export function hasMeaningfulRepositoryId(repositoryId) {
28
+ return !!repositoryId && repositoryId !== EmptyRepositoryId;
29
+ }
30
+ /**
31
+ * Parses the `--access` flag value. Defaults to `'play'` when omitted so
32
+ * `share`/`unshare` keep their pre-flag behaviour for callers that haven't
33
+ * migrated. Throws a `UsageError` on any other value — Commander.js doesn't
34
+ * enforce enum membership by default and we want a precise error message.
35
+ *
36
+ * `play` and `edit` are the only externally visible levels. The role and scope
37
+ * the level resolves to are decided downstream (see {@link MaafAppAccessLevel}).
38
+ */
39
+ export function parseAccessLevel(raw) {
40
+ const value = (raw ?? 'play').trim().toLowerCase();
41
+ if (value === 'play' || value === 'edit') {
42
+ return value;
43
+ }
44
+ throw new UsageError(`Unknown --access value '${raw}'. Use 'play' (default — app access) or 'edit' (edit access).`);
45
+ }
46
+ /**
47
+ * Resolves the effective {@link RepoType} from an `AppConfig`.
48
+ *
49
+ * Hard rule: if `repoType` is missing AND the config carries a (non-empty,
50
+ * non-zero-GUID) `repositoryId`, refuse to guess - the user must re-run
51
+ * `app init` to migrate the config. When both are missing we treat it as
52
+ * `'none'`: there is no repo-scope to act on, and the app-scope fallback in
53
+ * the share/unshare/list routing handles edit correctly.
54
+ */
55
+ export function resolveRepoType(appConfig) {
56
+ if (appConfig.repoType) {
57
+ return appConfig.repoType;
58
+ }
59
+ if (hasMeaningfulRepositoryId(appConfig.repositoryId)) {
60
+ throw new UsageError(`${AppConfigFileName} is missing the 'repoType' field but has a 'repositoryId' set. ` +
61
+ `This usually means the file was written by an older CLI. ` +
62
+ `Re-run "${CLI_BINARY_NAME} app init" to migrate the config, then retry.`);
63
+ }
64
+ return 'none';
65
+ }
66
+ /**
67
+ * Fetches the app definition via the info action. Performs no `repositoryId`
68
+ * validation — use this when the caller only needs app metadata (e.g. to
69
+ * classify the {@link RepoType} for routing). Callers that require a repo-scope
70
+ * id must validate it themselves (see {@link resolveAppForEditAsync}).
71
+ */
72
+ export async function fetchAppDefinitionAsync(args) {
73
+ return infoAsync({
74
+ tenantId: args.tenantId,
75
+ environmentId: args.environmentId,
76
+ logger: getCliLogger(),
77
+ actionsParams: { appName: args.appName },
78
+ });
79
+ }
80
+ /**
81
+ * Fetches the app definition and validates it carries a `repositoryId`. Used by
82
+ * the `edit` access paths that drive the GRS repo-scope endpoints; the returned
83
+ * definition is also reused to surface the post-share repository details
84
+ * (avoiding a second GET on the native path).
85
+ */
86
+ export async function resolveAppForEditAsync(args) {
87
+ const app = await fetchAppDefinitionAsync(args);
88
+ if (!hasMeaningfulRepositoryId(app.repositoryId)) {
89
+ throw new UsageError(`App '${args.appName}' has no associated repository.`);
90
+ }
91
+ return app;
92
+ }
93
+ //# sourceMappingURL=ShareAccessRouting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShareAccessRouting.js","sourceRoot":"","sources":["../../src/Utils/ShareAccessRouting.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAE1E,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAehD,MAAM,CAAC,MAAM,yBAAyB,GACpC,sDAAsD;IACtD,kFAAkF;IAClF,mFAAmF;IACnF,sDAAsD,CAAC;AAEzD,MAAM,CAAC,MAAM,yBAAyB,GACpC,qDAAqD;IACrD,kEAAkE,CAAC;AAErE;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,sCAAsC,CAAC;AAExE;;;;;GAKG;AACH,MAAM,UAAU,yBAAyB,CAAC,YAAgC;IACxE,OAAO,CAAC,CAAC,YAAY,IAAI,YAAY,KAAK,iBAAiB,CAAC;AAC9D,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAuB;IACtD,MAAM,KAAK,GAAG,CAAC,GAAG,IAAI,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACnD,IAAI,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,MAAM,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,IAAI,UAAU,CAClB,2BAA2B,GAAG,+DAA+D,CAC9F,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAAC,SAG/B;IACC,IAAI,SAAS,CAAC,QAAQ,EAAE,CAAC;QACvB,OAAO,SAAS,CAAC,QAAQ,CAAC;IAC5B,CAAC;IACD,IAAI,yBAAyB,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,CAAC;QACtD,MAAM,IAAI,UAAU,CAClB,GAAG,iBAAiB,iEAAiE;YACnF,2DAA2D;YAC3D,WAAW,eAAe,+CAA+C,CAC5E,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,IAI7C;IACC,OAAO,SAAS,CAAC;QACf,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,MAAM,EAAE,YAAY,EAAE;QACtB,aAAa,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE;KACzC,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,IAI5C;IACC,MAAM,GAAG,GAAG,MAAM,uBAAuB,CAAC,IAAI,CAAC,CAAC;IAChD,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;QACjD,MAAM,IAAI,UAAU,CAAC,QAAQ,IAAI,CAAC,OAAO,iCAAiC,CAAC,CAAC;IAC9E,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -9,17 +9,17 @@ import type { ArgumentProvider } from '../ArgumentProvider.js';
9
9
  *
10
10
  * Decision matrix:
11
11
  * 1. Run connector-policy preflight (single source of truth for policy enforcement).
12
- * 2. Determine `isTabular` from connector capabilities.
13
- * 3. Resolve mode:
12
+ * 2. Common Data Service for Apps (Dataverse) connector → always the action flow
13
+ * with an optional Dataverse table binding. `--table` carries the entity logical
14
+ * name; `--dataverse-environment-id` is optional (defaults to the app environment);
15
+ * `--as table` requests a table binding; `--dataset` is rejected.
16
+ * 3. Otherwise determine `isTabular` from connector capabilities and resolve mode:
14
17
  * - Non-tabular + `--as table` → UsageError
15
18
  * - Non-tabular → mode = action
16
19
  * - Tabular + `--as` given → mode = flag value
17
20
  * - Tabular + interactive (no `--as`) → promptConfirm yes/no
18
21
  * - Tabular + non-interactive + no `--as` → UsageError
19
- * 4. Reject `--dataset` / `--table` if mode resolved to action, EXCEPT
20
- * for the Common Data Service for Apps connector where `--table` is
21
- * re-interpreted as the Dataverse logical name (paired with
22
- * `--dataverse-environment-id`).
22
+ * 4. Reject `--dataset` / `--table` if mode resolved to action (non-CDS).
23
23
  * 5. Delegate to the appropriate shared flow helper.
24
24
  */
25
25
  export declare function addConnectorAsync(argumentProvider: ArgumentProvider): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"AddConnector.d.ts","sourceRoot":"","sources":["../../src/Verbs/AddConnector.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAkB5D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,iBAAiB,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CA8FzF"}
1
+ {"version":3,"file":"AddConnector.d.ts","sourceRoot":"","sources":["../../src/Verbs/AddConnector.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAgB5D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,iBAAiB,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CA4HzF"}