@microsoft/managed-apps-cli 0.22.0 → 0.23.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 (87) hide show
  1. package/README.md +3 -1
  2. package/dist/AddConfig-GZO2UMFR.js +12 -0
  3. package/dist/AddConnector-HJCCENAM.js +23 -0
  4. package/dist/{AuthStatus-6DMK7O6W.js → AuthStatus-WCICFN6O.js} +2 -2
  5. package/dist/{AuthSwitch-NUQIIRCG.js → AuthSwitch-5PKHCTM2.js} +2 -2
  6. package/dist/Bin.js +1 -1
  7. package/dist/BuildMaafApp-Q74EFM3Q.js +11 -0
  8. package/dist/Cli-7EVTIORX.js +54 -0
  9. package/dist/CloneMaafApp-EKHHLMWD.js +11 -0
  10. package/dist/CreateMaafApp-L3XX2UVT.js +20 -0
  11. package/dist/DeleteMaafApp-YCDKWFRG.js +11 -0
  12. package/dist/DeployMaafApp-HF67BQRZ.js +14 -0
  13. package/dist/{Dev-ICCA5DEJ.js → Dev-BTJUJGP5.js} +2 -2
  14. package/dist/{EnvironmentVariableAuthenticationProvider-LYCQ5D47.js → EnvironmentVariableAuthenticationProvider-VNN4AG2E.js} +2 -2
  15. package/dist/GetMaafBuildStatus-7B6ZNSEA.js +11 -0
  16. package/dist/{GetSettings-ZI2IBKV5.js → GetSettings-GJWIPK2T.js} +2 -2
  17. package/dist/{InfoMaafApp-FL5PICDD.js → InfoMaafApp-WGNDYYGN.js} +2 -2
  18. package/dist/Init-TJOSV5DE.js +11 -0
  19. package/dist/ListConnectorActions-HTD6YSCY.js +11 -0
  20. package/dist/ListConnectors-OET7STMW.js +11 -0
  21. package/dist/{ListMaafApps-3W6W6UYP.js → ListMaafApps-KRXJMAEU.js} +2 -2
  22. package/dist/{Login-7RW6OEST.js → Login-5TFNB24B.js} +2 -2
  23. package/dist/{Logout-IXK2TMRL.js → Logout-35U4J627.js} +2 -2
  24. package/dist/{MockFetch-THQJ4KFB.js → MockFetch-XSZECQYX.js} +2 -2
  25. package/dist/{NodeMsalAuthenticationProvider-VVQ6CCZ5.js → NodeMsalAuthenticationProvider-OUL57BVL.js} +2 -2
  26. package/dist/Pack-S7P4MIT6.js +8 -0
  27. package/dist/{PlayMaafApp-5H3DCJ2C.js → PlayMaafApp-D4KLJKLT.js} +2 -2
  28. package/dist/RefreshDataSource-N5CEH23S.js +11 -0
  29. package/dist/{RefreshGitAuth-IQBAFR37.js → RefreshGitAuth-2VL6VBLU.js} +2 -2
  30. package/dist/{RemoveDataSource-PGPLMJUX.js → RemoveDataSource-XR5Q4O3F.js} +2 -2
  31. package/dist/{ServicePrincipalAuthenticationProvider-IZZRJFZQ.js → ServicePrincipalAuthenticationProvider-H3PTPXYY.js} +2 -2
  32. package/dist/{SetSetting-SEWDA4TF.js → SetSetting-HXY4YSKC.js} +2 -2
  33. package/dist/{ShareLinkCreate-T5FN47J2.js → ShareLinkCreate-YG3DACP2.js} +2 -2
  34. package/dist/{ShareLinkList-6JCVEYNC.js → ShareLinkList-XF6BIB3M.js} +2 -2
  35. package/dist/ShareLinkRevoke-4USAQKLB.js +11 -0
  36. package/dist/ShareList-6QI7ZAMZ.js +11 -0
  37. package/dist/{ShareMaafApp-6MKZ33HW.js → ShareMaafApp-PZI5MCBA.js} +2 -2
  38. package/dist/{TelemetrySettings-RXPPIEVO.js → TelemetrySettings-WWVPRF7T.js} +2 -2
  39. package/dist/{UnshareMaafApp-OSE2TOBJ.js → UnshareMaafApp-MHBIV5OR.js} +2 -2
  40. package/dist/chunk-2FNWZUPW.js +15 -0
  41. package/dist/chunk-2HSJ2XAQ.js +13 -0
  42. package/dist/{chunk-PPW4XUZO.js → chunk-3FP37TPE.js} +9 -9
  43. package/dist/chunk-5XRK3F43.js +11 -0
  44. package/dist/{chunk-6RSE3J4X.js → chunk-7PH2NK5K.js} +2 -2
  45. package/dist/chunk-DAG6RPOF.js +11 -0
  46. package/dist/{chunk-SNWTSI75.js → chunk-DD7E4ADI.js} +2 -2
  47. package/dist/{chunk-6LKH5WE7.js → chunk-F3HGM3IU.js} +23 -21
  48. package/dist/chunk-FMJDKXNM.js +12 -0
  49. package/dist/chunk-HCPTQP7J.js +11 -0
  50. package/dist/chunk-I22E6YZT.js +11 -0
  51. package/dist/chunk-LDP2SHPJ.js +11 -0
  52. package/dist/{chunk-KYL2Y5G4.js → chunk-PKDXP7CL.js} +2 -2
  53. package/dist/chunk-SBVJ4SMO.js +20 -0
  54. package/dist/chunk-SCJXITCN.js +12 -0
  55. package/dist/chunk-TZRZFNLH.js +38 -0
  56. package/dist/{chunk-4LIR3ZYP.js → chunk-UIW77LMA.js} +251 -251
  57. package/dist/chunk-WQKDXHGX.js +11 -0
  58. package/dist/{chunk-4VBFOKV6.js → chunk-X5O77GZS.js} +2 -2
  59. package/dist/{chunk-EX6IKPAO.js → chunk-Y7TZZLPW.js} +2 -2
  60. package/dist/chunk-ZIONKKAV.js +44 -0
  61. package/package.json +4 -4
  62. package/dist/AddConnector-5DUBFLEK.js +0 -41
  63. package/dist/BuildMaafApp-A4IUU6LI.js +0 -11
  64. package/dist/Cli-LYSWG64H.js +0 -54
  65. package/dist/CloneMaafApp-B672N7T5.js +0 -11
  66. package/dist/CreateMaafApp-RWL7FXSP.js +0 -20
  67. package/dist/DeleteMaafApp-GT4CEFAE.js +0 -11
  68. package/dist/DeployMaafApp-E4TQU6RO.js +0 -14
  69. package/dist/GetMaafBuildStatus-UGAHVANE.js +0 -11
  70. package/dist/Init-XCSK3WQM.js +0 -11
  71. package/dist/ListConnectorActions-B2YD24RX.js +0 -11
  72. package/dist/ListConnectors-MYUEVJPT.js +0 -11
  73. package/dist/Pack-IWU3PFQL.js +0 -8
  74. package/dist/RefreshDataSource-XQT7LVMO.js +0 -11
  75. package/dist/ShareLinkRevoke-OH5DZDHR.js +0 -11
  76. package/dist/ShareList-QCEL7QNJ.js +0 -11
  77. package/dist/chunk-23T63QIT.js +0 -15
  78. package/dist/chunk-3JIZGVCA.js +0 -11
  79. package/dist/chunk-47LJLFDF.js +0 -11
  80. package/dist/chunk-7BRIEYGR.js +0 -20
  81. package/dist/chunk-7GGFN2IW.js +0 -11
  82. package/dist/chunk-AQLFVAFU.js +0 -38
  83. package/dist/chunk-EQCYKUEU.js +0 -12
  84. package/dist/chunk-IQGMFWXB.js +0 -12
  85. package/dist/chunk-LQ65CHNN.js +0 -13
  86. package/dist/chunk-UNJJUCSA.js +0 -11
  87. package/dist/chunk-VMSJG53Y.js +0 -11
@@ -0,0 +1,11 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __pathDirname } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as t}from"./chunk-3FP37TPE.js";var n={global:{programDescription:"CLI for Microsoft managed apps.",cloud:"Cloud environment to target. Valid values include: public, usgov, usgovhigh, usgovdod, china. Defaults to public."},auth:{login:{description:"Sign in to Microsoft Entra ID.",examples:[`${"ms"} auth login`,`${"ms"} auth login --account user@contoso.com`,`${"ms"} auth login --device-code`],options:{account:"Username (email) to pre-fill in the browser sign-in prompt. This is a hint passed to the identity provider, not validated against cached accounts \u2014 use `auth switch --account` to choose between cached accounts.",deviceCode:"Sign in using the device code flow instead of opening a browser. Prints a URL and a code to enter on another device \u2014 use this on headless machines or over SSH where no browser is available."}},logout:{description:"Clear all cached credentials. Removes every cached account and the active-account pointer. Use `auth switch` to change which cached account is active without logging out.",examples:[`${"ms"} auth logout`]},status:{description:"Show cached accounts. The active account (used by other CLI commands) is marked.",examples:[`${"ms"} auth status`,`${"ms"} auth status --json`]},switch:{description:"Choose which cached account other CLI commands run as. When more than one account is cached and --account is omitted, prompts interactively; in non-interactive mode --account is required.",examples:[`${"ms"} auth switch`,`${"ms"} auth switch --account user@contoso.com`],options:{account:"Username (email) or home account ID of the account to make active."}}},app:{clone:{description:"Clone an existing app with a platform-managed repository into an empty target directory and configure Git Credential Manager. Apps bound to external repositories or without source control are not supported.",options:{app:"App ID (GUID) of the app to clone.",environmentId:"Environment ID containing the app (optional)."},examples:[`${"ms"} app clone --app <app-id>`,`${"ms"} app clone ./my-app --app <app-id>`]},create:{description:`Create a new managed app and scaffold the app template into an empty target directory, which defaults to the app display name. Provisions a platform-managed git repo by default; see --repo to bind an external GitHub repo or skip git scaffolding. To use the current directory, specify '.'. To bind an existing project instead, use '${"ms"} app init'.`,options:{environmentId:"Target environment ID for the new managed app (optional).",displayName:"Display name for the managed app.",description:"Optional description for the managed app.",repositoryId:"Repository ID to associate with the managed app for source control.",projectId:"Existing managed project ID to associate with the app. Skips managed project and repository creation.",template:"GitHub repository or subpath to scaffold the managed app from (e.g. github:owner/repo/subdir). Defaults to github:microsoft/Managed-Apps/templates/vite8. Applies to all --repo modes (native, --repo <url>, and --repo none).",buildPath:"Path to the build output directory. Defaults to ./dist.",buildCommand:'Full shell command used to build the app. Defaults to "npm run build".',buildEntryPoint:"Entry point HTML file for the app. Defaults to index.html.",repo:"Source-control binding for the new app. Omit to use the default platform-managed flow. Pass a repository URL \u2014 for example a GitHub Enterprise Cloud tenant URL (e.g. https://myorg.ghe.com/contoso/expense-tracker) or github.com (e.g. https://github.com/contoso/expense-tracker) \u2014 to bind to an external repo; the repo must already exist and must be empty, and the CLI clones it into [directory] and overlays the template. The server is the authority on which hosts/schemes are accepted. Pass '--repo none' to skip all git binding: the CLI scaffolds the template and writes ms.config.json into [directory] but does not init a local git repo or bind to a remote. The target directory must be empty in every mode \u2014 to bind an existing project to a new app, use 'ms app init' instead. Cannot be combined with --repository-id.",openBrowser:"Launch the browser to complete the GitHub device code flow during inline GitHub authentication. Default: do not launch. Has no effect when `--json` is set (JSON mode never launches a browser).",forceReauth:"Bypass the stored GitHub authentication mapping and force re-authentication via device code flow, as if the mapping had expired. Has no effect on apps not bound to an external GitHub repository."},examples:[`${"ms"} app create --display-name "My App" --repository-id <id>`,`${"ms"} app create ./my-app --display-name "My App" --repository-id <id>`,`${"ms"} app create ./my-app --display-name "My App" --repository-id <id> --description "A description"`,`${"ms"} app create ./my-app --display-name "My App" --repo https://myorg.ghe.com/contoso/expense-tracker`,`${"ms"} app create ./my-app --display-name "My App" --repo none`]},init:{description:"Convert an existing project into a managed app.",options:{environmentId:"Target environment ID for the new managed app (optional).",cloud:"Cloud environment to target. Valid values include: public, usgov, usgovhigh, usgovdod, china. Defaults to public.",displayName:"Display name for the managed app.",description:"Optional description for the managed app.",buildPath:"Path to the build output directory. Defaults to ./dist.",buildCommand:'Full shell command used to build the app. Defaults to "npm run build".',fileEntryPoint:"Entry point HTML file for the app. Defaults to index.html.",appUrl:"Local development URL for the app. Defaults to http://localhost:3000.",buildEntryPoint:"Entry point HTML file for the app. Defaults to index.html.",repo:"Repository behavior for init. Pass '--repo native' to force a platform-managed repo without inspecting the current git setup. Pass '--repo none' to use BYO build flow (no platform-managed repo). Pass '--repo <repo-url>' to bind to an existing GitHub repo (current directory must already contain the cloned repo). Omit to auto-detect current git setup and prompt in interactive mode.",iconPath:"Optional path to a .png or .jpg app icon, written to ms.config.json as iconPath.",localAppUrl:"Optional local development URL for the app, written to ms.config.json as localAppUrl.",openBrowser:"Launch the browser to complete the GitHub device code flow during inline GitHub authentication. Default: do not launch. Has no effect when `--json` is set (JSON mode never launches a browser).",forceReauth:"Bypass the stored GitHub authentication mapping and force re-authentication via device code flow, as if the mapping had expired. Has no effect on apps not bound to an external GitHub repository."},examples:[`${"ms"} app init --display-name "My App" --environment-id <id>`,`${"ms"} app init --display-name "My App" --environment-id <id> --description "A description"`,`${"ms"} app init --display-name "My App" --environment-id <id> --build-path ./out`,`${"ms"} app init --display-name "My App" --repo none`,`${"ms"} app init --display-name "My App" --repo https://myorg.ghe.com/contoso/expense-tracker`]},list:{description:"List all apps you have access to with play URLs. Interactive text output shows edit access; non-interactive and JSON output include clone URL details when available for edit access. By default returns both edit and play access apps across the tenant; pass --environment-id to filter to a single environment.",options:{environmentId:"Optional environment ID to scope the listing to. When omitted, all apps the user can access across the tenant are returned.",permission:"Optional permission filter. Use `edit` for apps the user can contribute to, or `play` for apps the user can play/view. Omit to return both. Case-insensitive."},examples:[`${"ms"} app list`,`${"ms"} app list --json`,`${"ms"} app list --environment-id <id>`,`${"ms"} app list --permission play`]},info:{description:"Show an app's configuration and bound resources.",options:{app:`The app identifier to retrieve (logical name or app ID GUID). Defaults to the current app in ${t}.`,environmentId:`Override the environment ID. Defaults to environmentId in ${t}; when neither is set, the environment is resolved automatically from the app identifier.`},examples:[`${"ms"} app info --app my-app`,`${"ms"} app info --app <guid>`,`${"ms"} app info --app my-app --json`]},show:{deprecation:`(deprecated) '${"ms"} app show' is deprecated. Use '${"ms"} app info' instead.`,examples:[`${"ms"} app show`,`${"ms"} app show --json`]},delete:{description:"Delete an app. Soft-deletes the app and cleans up related metadata.",options:{app:`The app name to delete. Defaults to the current app in ${t}.`,environmentId:"Override the environment ID. When omitted, the environment is resolved automatically from the app. Useful for deleting an app from outside its scaffolded directory.",force:"Skip the confirmation prompt."},examples:[`${"ms"} app delete`,`${"ms"} app delete --app my-app`,`${"ms"} app delete --app my-app --environment-id <id> --force`,`${"ms"} app delete --json --force`]},share:{description:"Share an app with users, groups, or service principals. Provide a comma-separated list of user or group email addresses or Entra object IDs. Service principals must be specified by object ID, not application (client) ID. Use --access play (default) to grant play access, --access edit to grant edit access, or --access test to grant test operator access. To distribute access via a tenant-wide link instead of named principals, use `ms app share link create` (run `ms app share link --help` for the full link surface).",options:{app:`The app name to share. Defaults to the current app in ${t}.`,access:'Access level to grant: "play" (default), "edit", or "test" (test operator access).'},examples:[`${"ms"} app share alice@contoso.com,bob@contoso.com`,`${"ms"} app share --app my-app <aad-id>`,`${"ms"} app share <service-principal-object-id>`,`${"ms"} app share alice@contoso.com --access edit`,`${"ms"} app share alice@contoso.com --json`,`${"ms"} app share link create`],list:{description:"List the users, groups, and service principals an app is shared with at a given access level.",options:{app:`The app name. Defaults to the current app in ${t}.`,environmentId:`Override the environment ID. Defaults to environmentId in ${t}.`,access:'Access level to list (required): "play", "edit", or "test" (test operator access).'},examples:[`${"ms"} app share list --access play`,`${"ms"} app share list --access edit`,`${"ms"} app share list --access edit --app my-app`,`${"ms"} app share list --access play --json`]}},unshare:{description:"Unshare an app from users, groups, or service principals. Provide a comma-separated list of user or group email addresses or Entra object IDs. Service principals must be specified by object ID, not application (client) ID. Use --access play (default) to revoke play access, --access edit to revoke edit access, or --access test to revoke test operator access. Each invocation only touches the requested access level.",options:{app:`The app name to unshare. Defaults to the current app in ${t}.`,access:'Access level to revoke: "play" (default), "edit", or "test" (test operator access).'},examples:[`${"ms"} app unshare alice@contoso.com,bob@contoso.com`,`${"ms"} app unshare --app my-app <aad-id>`,`${"ms"} app unshare alice@contoso.com --access edit`,`${"ms"} app unshare alice@contoso.com --json`]},shareLink:{description:"Manage tenant-wide share links for a managed app. A share link is a JIT-redemption URL: the first time a recipient opens it, they are granted the configured role at the app scope. Links can be listed and revoked at any time.",create:{description:'Create a share link for a managed app. The link grants the "Microsoft App Reader" role at the app scope on redemption. Only this role is supported today; the enum is open server-side for future expansion.',options:{app:`The app name to share. Defaults to the current app in ${t}.`,environmentId:`Override the environment ID. Defaults to environmentId in ${t}.`},examples:[`${"ms"} app share link create`,`${"ms"} app share link create --app my-app`,`${"ms"} app share link create --json`]},list:{description:"List all share links currently issued for a managed app.",options:{app:`The app name. Defaults to the current app in ${t}.`,environmentId:`Override the environment ID. Defaults to environmentId in ${t}.`},examples:[`${"ms"} app share link list`,`${"ms"} app share link list --app my-app`,`${"ms"} app share link list --json`]},revoke:{description:"Revoke a share link by ID. The server attempts to remove the role assignment for every prior redeemer before tearing down the link record; new recipients can no longer redeem the link.",options:{app:`The app name. Defaults to the current app in ${t}.`,environmentId:`Override the environment ID. Defaults to environmentId in ${t}.`,linkId:"The share link ID (4-char lowercase hex) returned at creation time.",force:"Skip the confirmation prompt."},examples:[`${"ms"} app share link revoke --link-id a3f1`,`${"ms"} app share link revoke --link-id a3f1 --force`,`${"ms"} app share link revoke --link-id a3f1 --app my-app --json`]}},build:{description:"Initiate a build for an app. By default the CLI waits for build-status to reach a terminal state; pass --no-wait to return immediately after submission.",options:{appName:"The app name to build.",commitSha:"The commit ID to build from.",openBrowser:"Launch the browser to complete the GitHub device code flow during inline GitHub authentication. Default: do not launch. Has no effect when `--json` is set (JSON mode never launches a browser). Only relevant for apps bound to an external GitHub repository.",noWait:"Return immediately after submitting the build and print a build-status hint.",forceReauth:"Bypass the stored GitHub authentication mapping and force re-authentication via device code flow, as if the mapping had expired. Has no effect on apps not bound to an external GitHub repository."},examples:[`${"ms"} app build --app my-app --commit abc1234`,`${"ms"} app build --app my-app --commit abc1234 --no-wait`,`${"ms"} app build --app my-app --commit abc1234 --json`]},buildStatus:{description:"Check the status of a build.",options:{appName:"The app name.",commitSha:"The commit ID for which a build was initiated by app build.",showLog:"Fetch and print the build log when available."},examples:[`${"ms"} app build-status --app my-app --commit <sha>`,`${"ms"} app build-status --app my-app --commit <sha> --show-log`,`${"ms"} app build-status --app my-app --commit <sha> --json`]},deploy:{description:`Build and deploy an app to live. Behavior depends on the app's repoType in ${t}: git-backed apps (native/github) deploy a commit (default HEAD; override with --commit). External-artifact apps (repoType: 'none') pack and upload locally, or upload a pre-built .zip when --artifact is supplied. By default the CLI waits for deployment to finish; set MS_CLI_MAAF_DEPLOY_VIA_MANAGED_DEVOPS to 2 or 3 and pass --no-wait to return after submission.`,options:{app:`The app name to deploy. Defaults to the current app in ${t}.`,commit:"The commit ID to deploy (git-backed apps only). Defaults to the commit at HEAD.",artifact:"Path to a local .zip build artifact to upload and deploy. Only valid for apps created with repoType: 'none'; rejected on git-backed apps. Mutually exclusive with --commit.",deployment:"Named deployment to deploy into, e.g. 'test'. Must already be registered with `ms app add config --deployment <name>`. Defaults to the app's production deployment.",force:"Deploy even when the working tree has uncommitted changes or local main is ahead of origin/main. Skips the confirmation prompt in interactive mode and the validation error in non-interactive mode.",noWait:"With MS_CLI_MAAF_DEPLOY_VIA_MANAGED_DEVOPS set to 2 or 3, return after deployment submission and print the operation ID instead of polling to completion.",openBrowser:"Launch the browser to complete the GitHub device code flow during inline GitHub authentication. Default: do not launch. Has no effect when `--json` is set (JSON mode never launches a browser). Only relevant for apps bound to an external GitHub repository.",forceReauth:"Bypass the stored GitHub authentication mapping and force re-authentication via device code flow, as if the mapping had expired. Has no effect on apps not bound to an external GitHub repository."},examples:[`${"ms"} app deploy`,`${"ms"} app deploy --app my-app --commit abc1234`,`${"ms"} app deploy --force`,`${"ms"} app deploy --no-wait`,`${"ms"} app deploy --artifact ./build.zip`,`${"ms"} app deploy --deployment test`,`${"ms"} app deploy --app my-app --commit abc1234 --json`]},pack:{description:"Build the app and copy the output to .ms/packed/apps/<appId>/client/ for local inspection.",examples:[`${"ms"} app pack`]},play:{description:"Open a managed app in the browser. Use --mode live (default) to launch the deployed version, or --mode preview to preview the app on the main branch, a provided branch, or a provided commit ID.",options:{app:`The app name to play. Defaults to the current app in ${t}.`,mode:"Which app to open: 'live' (default \u2014 the deployed version) or 'preview'.",commit:"Preview mode only. The commit ID to open. Cannot be combined with --branch.",branch:"Preview mode only. The branch to open. Defaults to main and cannot be combined with --commit.",noBrowser:"Print the URL but do not open a browser window."},examples:[`${"ms"} app play`,`${"ms"} app play --mode preview`,`${"ms"} app play --mode preview --branch feature/my-change`,`${"ms"} app play --mode preview --commit abc1234`,`${"ms"} app play --app my-app --no-browser`,`${"ms"} app play --json`]},dev:{description:"Start local development.",options:{port:"Port number for the local config server.",localAppUrl:"Local URL where the app is running.",configOnly:"Start only the config server without running the dev script. Use this if you want to manage your dev server separately."},examples:[`${"ms"} app dev`,`${"ms"} app dev --port 8080 --local-app-url http://localhost:3000`,`${"ms"} app dev --local-app-url http://localhost:3000 --config-only`]},refresh:{description:"Refresh data sources in an app.",dataSource:{description:"Re-fetch data source metadata from the service and regenerate TypeScript.",options:{offline:"Regenerate TypeScript from the local schemas in '.ms/schemas' without contacting the service (no network or authentication). Omit to re-fetch metadata from the service and regenerate.",name:"Name of a specific data source to refresh. Omit to refresh all."},examples:[`${"ms"} app refresh data-source`,`${"ms"} app refresh data-source --name teams`,`${"ms"} app refresh data-source --offline`]}},add:{config:{description:"Register a deployment with the current app project and create its local deployment configuration overlay.",options:{deployment:"Deployment name. 1-64 lowercase letters, numbers, or hyphens, starting with a letter or number. Names starting with 'prod' or 'dev' are reserved, except 'prod' itself. Defaults to 'prod'."},examples:[`${"ms"} app add config --deployment prod`,`${"ms"} app add config --deployment test`]},connector:{description:"Add a data source (a connector table or action) to the app.",options:{connector:'Connector ID (e.g. office365, sql) or display name (e.g. "Office 365 Users"). Run `ms connector list` to browse connectors.',connectionId:"Connection ID to use. If omitted: interactive mode prompts you to pick or create one; non-interactive mode reuses your only connection, silently creates one for connectors whose sole authentication type is single sign-on when none exist, or errors when the choice is ambiguous. Pass --use-sso to reuse an existing SSO connection (or silently create one) for any SSO-capable connector, not just SSO-only ones.",dataset:"Dataset name (only used when adding as a table). If omitted in table mode, you will be prompted.",table:"Table name. In table mode this is the table name within the dataset. With --connector commondataserviceforapps it is the Dataverse table logical name (e.g. account). If omitted, you will be prompted.",deployment:"Deployment whose existing config overlay receives the binding. Preview; requires MS_CLI_ALM=true.",for:"Existing logical name of the tabular data source to bind for the deployment.",as:'Force the dispatch to "table" or "action". Required in non-interactive mode when the connector supports tables.',dataverseEnvironmentId:"Dataverse environment ID (GUID). Only used with --connector shared_commondataserviceforapps to bind to a specific table.",useSso:"Prefer a single sign-on (Entra ID) connection: reuse the first existing SSO connection when one exists, otherwise silently create one. Works even when the connector offers other authentication types. Errors if the connector is not SSO-capable. Ignored when --connection-id is supplied.",skipCodegen:"Skip TypeScript code generation after adding the data source."},examples:[`${"ms"} app add data-source --connector office365`,`${"ms"} app add data-source --connector "Office 365 Users"`,`${"ms"} app add data-source --connector sql --as table --connection-id <id> --dataset <db> --table <tbl>`,`${"ms"} app add data-source --connector "SQL Server" --as table --connection-id <id> --dataset <db> --table <tbl>`,`${"ms"} app add data-source --connector sharepointonline --as action`,`${"ms"} app add data-source --connector "SharePoint" --as action`,`${"ms"} app add data-source --connector office365 --as action --use-sso`,`${"ms"} app add data-source --connector sql --as table --skip-codegen`,`${"ms"} app add data-source --connector commondataserviceforapps --as action --connection-id <id> --dataverse-environment-id <env-guid> --table account`,`${"ms"} app add data-source --deployment prod --for <name> --table <id>`],deprecation:`(deprecated) '${"ms"} app add connector' is deprecated. Use '${"ms"} app add data-source' instead.`,deprecatedExamples:[`${"ms"} app add connector --connector office365`,`${"ms"} app add connector --connector sql --as table --connection-id <id> --dataset <db> --table <tbl>`,`${"ms"} app add connector --connector sharepointonline --as action`,`${"ms"} app add connector --connector sql --as table --skip-codegen`,`${"ms"} app add connector --connector commondataserviceforapps --as action --connection-id <id> --dataverse-environment-id <env-guid> --table account`]}},remove:{description:"Remove a data source (table or action) from the app.",options:{dataSourceName:"Name of the data source to remove.",force:"Skip confirmation prompt."},examples:[`${"ms"} app remove data-source`,`${"ms"} app remove data-source --name documents`,`${"ms"} app remove data-source --name orders --force`],deprecation:`(deprecated) '${"ms"} app remove connector' is deprecated. Use '${"ms"} app remove data-source' instead.`,deprecatedExamples:[`${"ms"} app remove connector`,`${"ms"} app remove connector --name documents`,`${"ms"} app remove connector --name orders --force`]},"get-settings":{description:"View all app settings.",examples:[`${"ms"} app get-settings`,`${"ms"} app get-settings --json`]},"set-setting":{description:`Update app settings. Changes are written to ${t} and take effect the next time you run '${"ms"} app dev' or '${"ms"} app deploy'.`,options:{"show-header":"Show or hide the app header bar (true or false)."},examples:[`${"ms"} app set-setting --show-header false`]}},connector:{list:{description:"List connectors available in the environment. By default all connectors are shown, including those blocked by tenant policy; pass --only-allowed to list only connectors allowed by tenant policy.",hint:'Use the value in the "Connector" column as the ID (e.g. office365), or pass the display name directly (e.g. "Office 365 Users") to add commands.',options:{environmentId:"Environment ID (optional).",search:"Filter connectors by display name or connector ID (case-insensitive).",onlyAllowed:"List only connectors allowed by tenant policy. By default all connectors are listed, including blocked ones."},examples:[`${"ms"} connector list`,`${"ms"} connector list --search "sql"`,`${"ms"} connector list --only-allowed`,`${"ms"} connector list --environment-id <env-id>`,`${"ms"} connector list --json`]},"list-actions":{description:"List actions available on a connector with their policy behavior.",options:{connector:"Connector identifier (e.g. office365).",environmentId:"Environment ID (optional).",search:"Filter actions by summary or action ID (case-insensitive)."},examples:[`${"ms"} connector list-actions --connector office365`,`${"ms"} connector list-actions --connector sql --search "execute"`,`${"ms"} connector list-actions --connector office365 --environment-id <env-id>`,`${"ms"} connector list-actions --connector office365 --json`]}},telemetry:{enable:{description:"Enable telemetry collection. Defaults to --remote if no target is specified.",options:{remote:"Enable sending telemetry to the cloud service (default).",console:"Enable outputting telemetry to the local console."},examples:[`${"ms"} telemetry enable`,`${"ms"} telemetry enable --console`,`${"ms"} telemetry enable --remote --console`]},disable:{description:"Disable telemetry collection. Defaults to --remote if no target is specified.",options:{remote:"Disable sending telemetry to the cloud service (default).",console:"Disable outputting telemetry to the local console."},examples:[`${"ms"} telemetry disable`,`${"ms"} telemetry disable --console`,`${"ms"} telemetry disable --remote --console`]},status:{description:"Show the current telemetry settings.",examples:[`${"ms"} telemetry status`,`${"ms"} telemetry status --json`]}},git:{auth:{refresh:{description:"Authenticate against a GitHub repository so subsequent app create / deploy / preview / build commands targeting that repo know your GitHub identity. Runs the GitHub device code flow via the Managed Apps GitHub App; no GitHub token is stored locally.",options:{repo:"GitHub repository URL (e.g. https://contoso.ghe.com/contoso/my-app or https://github.com/contoso/my-app). The Managed Apps GitHub App is the only supported provider; the server enforces which hosts/tenants are accepted.",openBrowser:"Launch the browser to complete the GitHub device code flow. Default: do not launch."},examples:[`${"ms"} git auth refresh --repo https://contoso.ghe.com/contoso/my-app`,`${"ms"} git auth refresh -r https://contoso.ghe.com/contoso/my-app --open-browser`,`${"ms"} git auth refresh --repo https://contoso.ghe.com/contoso/my-app --json`]}}}};export{n as a};
8
+ /*!
9
+ * Copyright (C) Microsoft Corporation. All rights reserved.
10
+ */
11
+ //# sourceMappingURL=chunk-WQKDXHGX.js.map
@@ -4,8 +4,8 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __pathDirname(__filename);
7
- import{d as s}from"./chunk-EX6IKPAO.js";import{e as a,h as i}from"./chunk-PVAIJSAI.js";import{spawn as f}from"node:child_process";var g={showUserCode({userCode:t,verificationUri:e,expiresIn:r}){i(""),i("First copy your one-time code:"),i(""),i(` ${t}`),i(""),i("Then visit this URL to sign in to GitHub:"),i(""),i(` ${e}`),i(""),i(`(Code expires in ${Math.round(r/60)} minutes.)`)},showWaiting(){i("Waiting for authentication...")},openVerificationUri(t){return l(t,{skip:!1})}},p=class{showUserCode(e){this._emit({phase:"github-auth-initiated",sessionId:e.sessionId,userCode:e.userCode,verificationUri:e.verificationUri,expiresIn:e.expiresIn,pollIntervalSeconds:e.pollIntervalSeconds})}showWaiting(){}showPollIteration(){this._emit({phase:"github-auth-pending"})}showComplete(e){this._emit({phase:"github-auth-complete",githubLogin:e.githubLogin,mappingExpiresAt:e.mappingExpiresAt})}_emit(e){a(e)}};function l(t,e){if(e.skip||process.stdin.isTTY===!1||s("MS_NO_BROWSER")==="1"||s("CI")==="true")return!1;let r;try{r=new URL(t)}catch{return!1}if(r.protocol!=="https:")return!1;try{let n=c(t,process.platform);if(!n)return!1;let o=f(n.file,n.args,{shell:!1,detached:!0,stdio:"ignore"});return o.on("error",()=>{}),o.unref(),!0}catch{return!1}}function c(t,e){switch(e){case"win32":return{file:"cmd.exe",args:["/c","start","",t]};case"darwin":return{file:"open",args:[t]};case"linux":return{file:"xdg-open",args:[t]};default:return}}export{g as a,p as b};
7
+ import{d as s}from"./chunk-Y7TZZLPW.js";import{e as a,h as i}from"./chunk-PVAIJSAI.js";import{spawn as f}from"node:child_process";var g={showUserCode({userCode:t,verificationUri:e,expiresIn:r}){i(""),i("First copy your one-time code:"),i(""),i(` ${t}`),i(""),i("Then visit this URL to sign in to GitHub:"),i(""),i(` ${e}`),i(""),i(`(Code expires in ${Math.round(r/60)} minutes.)`)},showWaiting(){i("Waiting for authentication...")},openVerificationUri(t){return l(t,{skip:!1})}},p=class{showUserCode(e){this._emit({phase:"github-auth-initiated",sessionId:e.sessionId,userCode:e.userCode,verificationUri:e.verificationUri,expiresIn:e.expiresIn,pollIntervalSeconds:e.pollIntervalSeconds})}showWaiting(){}showPollIteration(){this._emit({phase:"github-auth-pending"})}showComplete(e){this._emit({phase:"github-auth-complete",githubLogin:e.githubLogin,mappingExpiresAt:e.mappingExpiresAt})}_emit(e){a(e)}};function l(t,e){if(e.skip||process.stdin.isTTY===!1||s("MS_NO_BROWSER")==="1"||s("CI")==="true")return!1;let r;try{r=new URL(t)}catch{return!1}if(r.protocol!=="https:")return!1;try{let n=c(t,process.platform);if(!n)return!1;let o=f(n.file,n.args,{shell:!1,detached:!0,stdio:"ignore"});return o.on("error",()=>{}),o.unref(),!0}catch{return!1}}function c(t,e){switch(e){case"win32":return{file:"cmd.exe",args:["/c","start","",t]};case"darwin":return{file:"open",args:[t]};case"linux":return{file:"xdg-open",args:[t]};default:return}}export{g as a,p as b};
8
8
  /*!
9
9
  * Copyright (C) Microsoft Corporation. All rights reserved.
10
10
  */
11
- //# sourceMappingURL=chunk-4VBFOKV6.js.map
11
+ //# sourceMappingURL=chunk-X5O77GZS.js.map
@@ -4,8 +4,8 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __pathDirname(__filename);
7
- var N=`${"ms".toUpperCase()}_CLI_`;function O(E){return`${N}${E}`}function e(E){return process.env[O(E)]}function R(E){return e(E)==="true"}function n(E){return process.env[E]}function I(E,_){process.env[E]=_}export{O as a,e as b,R as c,n as d,I as e};
7
+ var N=`${"ms".toUpperCase()}_CLI_`;function e(E){return`${N}${E}`}function O(E){return process.env[e(E)]}function n(E){return O(E)==="true"}function I(E){return process.env[E]}function C(E,_){process.env[E]=_}function R(){return{...process.env}}export{e as a,O as b,n as c,I as d,C as e,R as f};
8
8
  /*!
9
9
  * Copyright (C) Microsoft Corporation. All rights reserved.
10
10
  */
11
- //# sourceMappingURL=chunk-EX6IKPAO.js.map
11
+ //# sourceMappingURL=chunk-Y7TZZLPW.js.map
@@ -0,0 +1,44 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __pathDirname } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{c as G}from"./chunk-DD7E4ADI.js";import{B as U,C as q,D,E as j,F as T,G as E,Ga as S,H as R,Ha as V,I as H,Y as F,g as M,j as k,u as P}from"./chunk-UIW77LMA.js";import{a as B,b as m,f as W}from"./chunk-RBG2H562.js";import{c as Y}from"./chunk-Y7TZZLPW.js";import{a as _,c as N,h as p,i as w}from"./chunk-PVAIJSAI.js";import*as K from"http";import X from"open";var J={defaultBehavior:"Allow",allowedConnectors:[]},I="Reason: The connector service rejected the automatic connection request.";function O(r,t){S().trackErrorEvent("Connection.AutoCreateFailed",{apiId:r,error:t instanceof Error?t.message:String(t)})}async function me(r,t,o){if(r.toLowerCase().startsWith("shared_"))return r;let n=await D(void 0,t??void 0),i=r.toLowerCase(),l=n.find(e=>e.name.toLowerCase()===`shared_${i}`);if(l)return l.name;let d=n.filter(e=>e.properties.displayName.toLowerCase()===i),a=d.length===0,c=a?n.filter(e=>e.properties.displayName.toLowerCase().includes(i)):d;if(c.length===0)return r;if(c.length===1)return a&&!o?.jsonMode&&p(`Resolved '${r}' \u2192 '${c[0].properties.displayName}' (${c[0].name})`),c[0].name;let C=c.map(e=>` ${e.name} (${e.properties.displayName})`).join(`
8
+ `);throw new m(`Multiple connectors match '${r}'. Specify the connector ID directly:
9
+ ${C}`)}var z="__create__",Z=600*1e3,x="1";async function fe(r,t){let o=S(),n=await r.getTenantIdAsync();n||(o.trackErrorEvent("DlpSkippedNoTenantId",{apiId:t}),w(`Could not resolve tenant ID; skipping connector policy check. Sign in with '${"ms"} auth login' for full enforcement.`));let[i,l]=await Promise.all([U(t,o),n?H(o,n).catch(()=>(w("Could not verify connector policy; proceeding without enforcement."),J)):Promise.resolve(J)]);if(!i)throw new W(`Connector '${t}' not found. Run '${"ms"} connector list' to see available connector IDs.`);let d=(i.name??t).toLowerCase(),a=new Map(l.allowedConnectors.map(e=>[e.connectorId.toLowerCase(),e])),c=new Set((l.blockedConnectors??[]).map(e=>e.connectorId.toLowerCase()));if(l.defaultBehavior==="Block"?!a.has(d):c.has(d))throw new m(`Connector '${i.properties.displayName??t}' is blocked by your organization's connector policy.`);return{connector:i,tenantId:n,policy:l}}async function pe(r){let t=V(),{argumentProvider:o,apiId:n,connector:i,useSso:l,interactive:d=t.interactive,quiet:a=!1,nonInteractiveReason:c="cli-mode"}=r,C=S(),e=P(),s=await q(n,C);if(!d)return ee({argumentProvider:o,apiId:n,connector:i,connections:s??[],useSso:l,quiet:a,nonInteractiveReason:c});if(l){if(!E(i))throw new m(`--use-sso was set but '${i.properties.displayName??n}' does not support single sign-on (SSO) authentication.
10
+ To fix: Re-run without --use-sso to create a connection interactively.`);let f=(s??[]).filter(u=>R(u,i));if(f.length>0){let[u]=f;return p(`Using existing SSO connection '${u.properties.displayName}' (${u.name}).`),f.length>1&&w(`Multiple SSO connections found for '${i.properties.displayName??n}'. Re-run with --connection-id <id> or -c <id> to use a specific one.`),{connectionId:u.name,autoSelected:!0}}let y=await A(o,n);return N(`Created a new connection '${y.properties.displayName}' (${y.name}).`),{connectionId:y.name,autoSelected:!1}}let g=[...s.map(f=>({value:f.name,label:f.properties.displayName,hint:f.name})),{value:z,label:"(Create a new connection)"}],h=await G({message:"Select a connection:",options:g});if(h===z){if(T(i))try{return{connectionId:(await A(o,n)).name,autoSelected:!1}}catch(v){O(n,v),w("Silent connection creation failed."),p(`Falling back to browser-based connection creation...
11
+ `)}else p(`This connector requires manual interaction. Opening browser for connection creation...
12
+ `);let f=n.startsWith("shared_")?n:`shared_${n}`,y=o.getEnvironmentId();if(!y)throw new m("Missing required information. Make sure you are running this command in a Managed Apps directory.");let u=await oe({connectorName:f,region:e.region,environmentId:y});if(u.status==="created"&&u.connectionName)return N("Connection created successfully!"),u.displayName&&p(` Display Name: ${u.displayName}`),p(` Connection ID: ${u.connectionName}`),{connectionId:u.connectionName,autoSelected:!1};throw u.status==="error"?new B(u.errorMessage??"Connection creation failed in the browser."):new m("Connection creation was cancelled.")}return{connectionId:h,autoSelected:!1}}async function ee(r){let{argumentProvider:t,apiId:o,connector:n,connections:i,useSso:l,quiet:d=!1,nonInteractiveReason:a}=r,c=n.properties.displayName??o;if(l){if(!E(n))throw a==="json-mode"?new m(`--use-sso was set but '${c}' does not support single sign-on (SSO) authentication.
13
+ To fix: Re-run without --use-sso and provide --connection-id <id> or -c <id>.`):new m(`--use-sso was set but '${c}' does not support single sign-on (SSO) authentication.
14
+ To fix: Re-run without both --use-sso and --non-interactive to create a connection interactively.`);let e=i.filter(s=>R(s,n));if(e.length>0){let[s]=e;return d||p(`Using existing SSO connection '${s.properties.displayName}' (${s.name}).`),!d&&e.length>1&&w(`Multiple SSO connections found for '${c}'. Re-run with --connection-id <id> or -c <id> to use a specific one.`),{connectionId:s.name,autoSelected:!0}}try{let s=await A(t,o);return d||N(`Created a new connection '${s.properties.displayName}' (${s.name}).`),{connectionId:s.name,autoSelected:!1}}catch(s){throw O(o,s),a==="json-mode"?new m(`No SSO connection exists for '${c}' and automatic connection creation failed.
15
+ ${I}
16
+ To fix: Create a connection, then re-run with --connection-id <id> or -c <id>.`):new m(`No SSO connection exists for '${c}' and automatic connection creation failed.
17
+ ${I}
18
+ To fix: Create one interactively (re-run without --non-interactive),
19
+ then re-run with --connection-id <id> or -c <id>.`)}}if(i.length===1){let[e]=i;return d||p(`Using existing connection '${e.properties.displayName}' (${e.name}).`),{connectionId:e.name,autoSelected:!0}}if(i.length===0&&T(n))try{let e=await A(t,o);return d||N(`Created a new connection '${e.properties.displayName}' (${e.name}).`),{connectionId:e.name,autoSelected:!1}}catch(e){throw O(o,e),a==="json-mode"?new m(`No connection exists for '${c}' and automatic connection creation failed.
20
+ ${I}
21
+ To fix: Create a connection, then re-run with --connection-id <id> or -c <id>.`):new m(`No connection exists for '${c}' and automatic connection creation failed.
22
+ ${I}
23
+ To fix: Create one interactively (re-run without --non-interactive),
24
+ then re-run with --connection-id <id> or -c <id>.`)}throw i.length>1?(d||_({title:`Available connections for ${c}`,columns:[{header:"Display Name",maxWidth:40},{header:"Connection ID"}],rows:i.map(e=>[e.properties.displayName,e.name]),totalLabel:"connection(s) found"}),a==="json-mode"?new m(`Multiple connections exist for '${c}', so one cannot be selected automatically.
25
+ To fix: Re-run with --connection-id <id> or -c <id> to choose one.`):new m(`Multiple connections exist for '${c}', so one cannot be selected automatically.
26
+ To fix: Re-run with --connection-id <id> or -c <id> to choose one,
27
+ or re-run without --non-interactive to select one interactively.`)):a==="json-mode"?new m(`'${c}' requires a connection that cannot be created automatically in JSON mode.
28
+ To fix: Create a connection, then re-run with --connection-id <id> or -c <id>.
29
+ Tip: Run '${"ms"} connector list' to browse available connectors.`):new m(`'${c}' requires a connection that cannot be created automatically in non-interactive mode.
30
+ To fix: Create one interactively (re-run without --non-interactive),
31
+ then re-run with --connection-id <id> or -c <id>.
32
+ Tip: Run '${"ms"} connector list' to browse available connectors.`)}async function A(r,t){let o=S(),n=P();return F({authProvider:r.getAuthenticationProvider(),region:n.region,environmentName:n.environmentName,actionsParams:{connectorId:t},logger:o})}function ne(r,t){return`Note: connection '${r}' was auto-selected for connector '${t}' because no --connection-id was provided. For tabular connectors, the connection needs to have access to the target resource, so this failure may not clearly indicate the root cause:
33
+ - If the connection is broken or expired, re-authenticate it and re-run.
34
+ - If the connection is valid but targets the wrong resource, re-run with an explicit --connection-id <id> for the intended resource.`}async function he(r,t){try{return await r()}catch(o){throw t.autoSelected&&o instanceof Error&&!(o instanceof m)&&(o.message=`${o.message}
35
+
36
+ ${ne(t.connectionId,t.connectorLabel)}`),o}}async function ge(r){if(!Y("ENABLE_CONNECTOR_USER_CONSENT"))return;let{apiId:t,connectionId:o}=r,n=r.impact??"The data source was added, but later calls",i=S(),l=i.trackScenario("ConnectorUserConsent",{apiId:t,connectionId:o}),d=a=>(r.defer||w(a),a);try{await j(t,o,i),l.complete();return}catch(a){return l.failure(a),a instanceof M&&a.status===403?d(`Could not request user consent on connection '${o}' (HTTP 403). ${n} against this connection may fail until your tenant admin grants the calling application the 'Connectivity.Connections.UserConsent' delegated permission.`):d(`Could not request user consent on connection '${o}'. ${n} against this connection may fail.`)}}async function oe(r){let{connectorName:t,region:o,environmentId:n}=r,i=crypto.randomUUID();return new Promise((l,d)=>{let a=K.createServer((s,g)=>{let h=new URL(s.url??"/","http://localhost");if(h.pathname==="/callback"&&s.method==="GET"){if(h.searchParams.get("nonce")!==i){g.writeHead(403,{"Content-Type":"text/html; charset=utf-8"}),g.end("<html><body><h2>Connection request verification failed. Please run the CLI command again.</h2></body></html>"),e(),l({status:"cancelled"});return}let y=h.searchParams.get("v");y!==x&&w(`Warning: callback protocol version mismatch (expected ${x}, got ${y??"none"}). Update the CLI to the latest version.`);let u=h.searchParams.get("status"),v=h.searchParams.get("message")??void 0;g.writeHead(200,{"Content-Type":"text/html; charset=utf-8"});let b;if(u==="created")b="<html><body><h2>Connection created! You can close this tab.</h2></body></html>";else if(u==="error"){let L=v?v.replace(/[&<>"']/g,Q=>`&#${Q.charCodeAt(0)};`):"";b=L?`<html><body><h2>Connection creation failed. You can close this tab.</h2><p>${L}</p></body></html>`:"<html><body><h2>Connection creation failed. You can close this tab.</h2></body></html>"}else b="<html><body><h2>Connection creation cancelled. You can close this tab.</h2></body></html>";g.end(b),e(),l(u==="created"?{status:"created",connectionId:h.searchParams.get("connectionId")??void 0,connectionName:h.searchParams.get("connectionName")??void 0,displayName:h.searchParams.get("displayName")??void 0}:u==="error"?{status:"error",errorMessage:v}:{status:"cancelled"});return}g.writeHead(404),g.end("Not found")});a.listen(0,"localhost",async()=>{let s=a.address(),h=`http://localhost:${typeof s=="object"&&s?s.port:0}/callback`,f=k(o,{connector:t,callbackUrl:h,nonce:i,protocolVersion:x,environmentId:n});p(`Opening browser at ${f}`);try{await X(f,{wait:!1})}catch{p(`Could not open browser automatically. Please navigate to:
37
+ ${f}`)}p(`Waiting for connection creation... (press Ctrl+C to cancel)
38
+ `)}),a.on("error",s=>{e(),d(s)});let c=setTimeout(()=>{p(`
39
+ Connection creation timed out after 10 minutes.`),e(),l({status:"cancelled"})},Z),C=()=>{p(`
40
+ Cancelling...`),e(),l({status:"cancelled"})};function e(){clearTimeout(c),process.off("SIGINT",C),a.close()}process.on("SIGINT",C)})}export{me as a,fe as b,pe as c,he as d,ge as e};
41
+ /*!
42
+ * Copyright (C) Microsoft Corporation. All rights reserved.
43
+ */
44
+ //# sourceMappingURL=chunk-ZIONKKAV.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/managed-apps-cli",
3
- "version": "0.22.0",
3
+ "version": "0.23.0",
4
4
  "type": "module",
5
5
  "description": "Command-line interface for building and managing Microsoft Managed Apps",
6
6
  "license": "MIT",
@@ -35,9 +35,9 @@
35
35
  "git": ">=2.27.0"
36
36
  },
37
37
  "devDependencies": {
38
- "@microsoft/managed-apps-actions": "0.16.0",
39
- "@microsoft/managed-apps-codegen": "0.3.0",
40
- "@microsoft/managed-apps-common": "0.20.0",
38
+ "@microsoft/managed-apps-actions": "0.17.0",
39
+ "@microsoft/managed-apps-codegen": "0.3.1",
40
+ "@microsoft/managed-apps-common": "0.21.0",
41
41
  "@azure/msal-node": "5.2.2",
42
42
  "@clack/prompts": "1.4.0",
43
43
  "@microsoft/1ds-core-js": "4.3.11",
@@ -1,41 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __pathDirname } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __pathDirname(__filename);
7
- import{a as ve,b as B,c as Ce,d as J,e as ye,g as we}from"./chunk-SNWTSI75.js";import{A as z,B as se,C as ce,D as le,M as j,N as me,O as ue,T as fe,U as ge,e as ee,f as ne,i as te,q as U,u as oe,ua as $,v as ae,va as x,w as ie,x as re,y as G,z as Y}from"./chunk-4LIR3ZYP.js";import{a as de,b as u,f as pe}from"./chunk-RBG2H562.js";import"./chunk-UNJJUCSA.js";import"./chunk-6RSE3J4X.js";import{c as he}from"./chunk-EX6IKPAO.js";import{b as P,c as b}from"./chunk-3JIZGVCA.js";import{a as V,c as T,h,i as I}from"./chunk-PVAIJSAI.js";import{a as w}from"./chunk-47LJLFDF.js";import"./chunk-PPW4XUZO.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";var De=["shared_commondataserviceforapps","commondataserviceforapps"];function H(e){let t=e.toLowerCase();return De.some(n=>t===n||t.endsWith(`/${n}`))}import*as Ie from"http";import xe from"open";var be={defaultBehavior:"Allow",allowedConnectors:[]};async function Se(e,t){if(e.toLowerCase().startsWith("shared_"))return e;let n=await ie(void 0,t??void 0),o=e.toLowerCase(),r=n.filter(a=>a.properties.displayName.toLowerCase()===o),i=r.length===0,c=i?n.filter(a=>a.properties.displayName.toLowerCase().includes(o)):r;if(c.length===0)return e;if(c.length===1)return i&&h(`Resolved '${e}' \u2192 '${c[0].properties.displayName}' (${c[0].name})`),c[0].name;let f=c.map(a=>` ${a.name} (${a.properties.displayName})`).join(`
8
- `);throw new u(`Multiple connectors match '${e}'. Specify the connector ID directly:
9
- ${f}`)}var Ae="__create__",ke=600*1e3,K="1";async function Ne(e,t){let n=$(),o=await e.getTenantIdAsync();o||(n.trackErrorEvent("DlpSkippedNoTenantId",{apiId:t}),I(`Could not resolve tenant ID; skipping connector policy check. Sign in with '${"ms"} auth login' for full enforcement.`));let[r,i]=await Promise.all([oe(t,n),o?se(n,o).catch(()=>(I("Could not verify connector policy; proceeding without enforcement."),be)):Promise.resolve(be)]);if(!r)throw new pe(`Connector '${t}' not found. Run '${"ms"} connector list' to see available connector IDs.`);let c=(r.name??t).toLowerCase(),f=new Map(i.allowedConnectors.map(p=>[p.connectorId.toLowerCase(),p])),a=new Set((i.blockedConnectors??[]).map(p=>p.connectorId.toLowerCase()));if(i.defaultBehavior==="Block"?!f.has(c):a.has(c))throw new u(`Connector '${r.properties.displayName??t}' is blocked by your organization's connector policy.`);return{connector:r,tenantId:o,policy:i}}async function Q(e){let{argumentProvider:t,apiId:n,connector:o,useSso:r}=e,i=x(),c=$(),f=U(),a=await ae(n,c);if(!i.interactive)return Le({argumentProvider:t,apiId:n,connector:o,connections:a??[],useSso:r});if(r){if(!Y(o))throw new u(`--use-sso was set but '${o.properties.displayName??n}' does not support single sign-on (SSO) authentication.
10
- To fix: Re-run without --use-sso to create a connection interactively.`);let l=(a??[]).filter(s=>z(s,o));if(l.length>0){let[s]=l;return h(`Using existing SSO connection '${s.properties.displayName}' (${s.name}).`),l.length>1&&I(`Multiple SSO connections found for '${o.properties.displayName??n}'. Re-run with --connection-id <id> or -c <id> to use a specific one.`),{connectionId:s.name,autoSelected:!0}}let m=await W(t,n);return T(`Created a new connection '${m.properties.displayName}' (${m.name}).`),{connectionId:m.name,autoSelected:!1}}let d=[...a.map(l=>({value:l.name,label:l.properties.displayName,hint:l.name})),{value:Ae,label:"(Create a new connection)"}],p=await Ce({message:"Select a connection:",options:d});if(p===Ae){if(G(o))try{return{connectionId:(await W(t,n)).name,autoSelected:!1}}catch(y){I(`Silent connection creation failed: ${y instanceof Error?y.message:String(y)}`),h(`Falling back to browser-based connection creation...
11
- `)}else h(`This connector requires manual interaction. Opening browser for connection creation...
12
- `);let l=n.startsWith("shared_")?n:`shared_${n}`,m=t.getEnvironmentId();if(!m)throw new u("Missing required information. Make sure you are running this command in a Managed Apps directory.");let s=await Fe({connectorName:l,region:f.region,environmentId:m});if(s.status==="created"&&s.connectionName)return T("Connection created successfully!"),s.displayName&&h(` Display Name: ${s.displayName}`),h(` Connection ID: ${s.connectionName}`),{connectionId:s.connectionName,autoSelected:!1};throw s.status==="error"?new de(s.errorMessage??"Connection creation failed in the browser."):new u("Connection creation was cancelled.")}return{connectionId:p,autoSelected:!1}}async function Le(e){let{argumentProvider:t,apiId:n,connector:o,connections:r,useSso:i}=e,c=o.properties.displayName??n;if(i){if(!Y(o))throw new u(`--use-sso was set but '${c}' does not support single sign-on (SSO) authentication.
13
- To fix: Re-run without both --use-sso and --non-interactive to create a connection interactively.`);let a=r.filter(d=>z(d,o));if(a.length>0){let[d]=a;return h(`Using existing SSO connection '${d.properties.displayName}' (${d.name}).`),a.length>1&&I(`Multiple SSO connections found for '${c}'. Re-run with --connection-id <id> or -c <id> to use a specific one.`),{connectionId:d.name,autoSelected:!0}}try{let d=await W(t,n);return T(`Created a new connection '${d.properties.displayName}' (${d.name}).`),{connectionId:d.name,autoSelected:!1}}catch(d){let p=d instanceof Error?d.message:String(d);throw new u(`No SSO connection exists for '${c}' and automatic connection creation failed.
14
- Reason: ${p}
15
- To fix: Create one interactively (re-run without --non-interactive),
16
- then re-run with --connection-id <id> or -c <id>.`)}}if(r.length===1){let[a]=r;return h(`Using existing connection '${a.properties.displayName}' (${a.name}).`),{connectionId:a.name,autoSelected:!0}}if(r.length===0&&G(o))try{let a=await W(t,n);return T(`Created a new connection '${a.properties.displayName}' (${a.name}).`),{connectionId:a.name,autoSelected:!1}}catch(a){let d=a instanceof Error?a.message:String(a);throw new u(`No connection exists for '${c}' and automatic connection creation failed.
17
- Reason: ${d}
18
- To fix: Create one interactively (re-run without --non-interactive),
19
- then re-run with --connection-id <id> or -c <id>.`)}throw r.length>1?(V({title:`Available connections for ${c}`,columns:[{header:"Display Name",maxWidth:40},{header:"Connection ID"}],rows:r.map(a=>[a.properties.displayName,a.name]),totalLabel:"connection(s) found"}),new u(`Multiple connections exist for '${c}', so one cannot be selected automatically.
20
- To fix: Re-run with --connection-id <id> or -c <id> to choose one,
21
- or re-run without --non-interactive to select one interactively.`)):new u(`'${c}' requires a connection that cannot be created automatically in non-interactive mode.
22
- To fix: Create one interactively (re-run without --non-interactive),
23
- then re-run with --connection-id <id> or -c <id>.
24
- Tip: Run '${"ms"} connector list' to browse available connectors.`)}async function W(e,t){let n=$(),o=U();return ue({authProvider:e.getAuthenticationProvider(),region:o.region,environmentName:o.environmentName,actionsParams:{connectorId:t},logger:n})}function Oe(e,t){return`Note: connection '${e}' was auto-selected for connector '${t}' because no --connection-id was provided. For tabular connectors, the connection needs to have access to the target resource, so this failure may not clearly indicate the root cause:
25
- - If the connection is broken or expired, re-authenticate it and re-run.
26
- - If the connection is valid but targets the wrong resource, re-run with an explicit --connection-id <id> for the intended resource.`}async function q(e,t){try{return await e()}catch(n){throw t.autoSelected&&n instanceof Error&&!(n instanceof u)&&(n.message=`${n.message}
27
-
28
- ${Oe(t.connectionId,t.connectorLabel)}`),n}}async function X(e){if(!he("ENABLE_CONNECTOR_USER_CONSENT"))return;let{apiId:t,connectionId:n}=e,o=$(),r=o.trackScenario("ConnectorUserConsent",{apiId:t,connectionId:n});try{await re(t,n,o),r.complete()}catch(i){if(i instanceof ne&&i.status===403){r.failure(i),I(`Could not request user consent on connection '${n}' (HTTP 403). The data source was added, but later calls against this connection may fail until your tenant admin grants the calling application the 'Connectivity.Connections.UserConsent' delegated permission.`);return}r.failure(i);let c=i instanceof Error?i.message:String(i);I(`Could not request user consent on connection '${n}': ${c}. The data source was added, but later calls against this connection may fail.`)}}async function Fe(e){let{connectorName:t,region:n,environmentId:o}=e,r=crypto.randomUUID();return new Promise((i,c)=>{let f=Ie.createServer((l,m)=>{let s=new URL(l.url??"/","http://localhost");if(s.pathname==="/callback"&&l.method==="GET"){if(s.searchParams.get("nonce")!==r){m.writeHead(403,{"Content-Type":"text/html; charset=utf-8"}),m.end("<html><body><h2>Connection request verification failed. Please run the CLI command again.</h2></body></html>"),p(),i({status:"cancelled"});return}let E=s.searchParams.get("v");E!==K&&I(`Warning: callback protocol version mismatch (expected ${K}, got ${E??"none"}). Update the CLI to the latest version.`);let D=s.searchParams.get("status"),A=s.searchParams.get("message")??void 0;m.writeHead(200,{"Content-Type":"text/html; charset=utf-8"});let g;if(D==="created")g="<html><body><h2>Connection created! You can close this tab.</h2></body></html>";else if(D==="error"){let v=A?A.replace(/[&<>"']/g,R=>`&#${R.charCodeAt(0)};`):"";g=v?`<html><body><h2>Connection creation failed. You can close this tab.</h2><p>${v}</p></body></html>`:"<html><body><h2>Connection creation failed. You can close this tab.</h2></body></html>"}else g="<html><body><h2>Connection creation cancelled. You can close this tab.</h2></body></html>";m.end(g),p(),i(D==="created"?{status:"created",connectionId:s.searchParams.get("connectionId")??void 0,connectionName:s.searchParams.get("connectionName")??void 0,displayName:s.searchParams.get("displayName")??void 0}:D==="error"?{status:"error",errorMessage:A}:{status:"cancelled"});return}m.writeHead(404),m.end("Not found")});f.listen(0,"localhost",async()=>{let l=f.address(),s=`http://localhost:${typeof l=="object"&&l?l.port:0}/callback`,y=te(n,{connector:t,callbackUrl:s,nonce:r,protocolVersion:K,environmentId:o});h(`Opening browser at ${y}`);try{await xe(y,{wait:!1})}catch{h(`Could not open browser automatically. Please navigate to:
29
- ${y}`)}h(`Waiting for connection creation... (press Ctrl+C to cancel)
30
- `)}),f.on("error",l=>{p(),c(l)});let a=setTimeout(()=>{h(`
31
- Connection creation timed out after 10 minutes.`),p(),i({status:"cancelled"})},ke),d=()=>{h(`
32
- Cancelling...`),p(),i({status:"cancelled"})};function p(){clearTimeout(a),process.off("SIGINT",d),f.close()}process.on("SIGINT",d)})}function Te(e){e.length!==0&&I(`The following connector operations are blocked by your organization's policy and were not generated.
33
- Ask your admin to allow them on 'Microsoft Dataverse' to restore the missing service methods:
34
- `+e.map(({operationId:t,methodName:n})=>` \u2022 ${t} (generates ${n}())`).join(`
35
- `))}async function Pe(e){let{argumentProvider:t,connector:n,apiId:o,connectionIdFlag:r,datasetFlag:i,tableFlag:c,skipCodegen:f,useV1Codegen:a,useSso:d}=e,p=x(),{fileConfig:l,cliFs:m}=p,s=U(),y=t.getAuthenticationProvider(),E=$(),D={appConfigPath:l.appConfigPath,schemaPath:l.schemaPath,codeGenPath:l.codeGenPath},A={vfs:m,authProvider:y,httpClient:t.getHttpClient(),region:s.region,environmentName:s.environmentName,localFilePaths:D,logger:E},g=n.properties.displayName??o,v=r,R=!1;if(!v){let L=await Q({argumentProvider:t,apiId:o,connector:n,useSso:d});v=L.connectionId,R=L.autoSelected}let M={autoSelected:R,connectionId:v,connectorLabel:g};await X({apiId:o,connectionId:v});let S=i;if(!S){let L={...A,actionsParams:{apiId:o,connectionId:v}},{value:_}=await q(()=>fe(L),M);if(!p.interactive)throw V({title:`Available datasets for ${g}`,columns:[{header:"Display Name",maxWidth:40},{header:"Dataset Name"}],rows:_.map(C=>[C.DisplayName||C.Name,C.Name]),emptyMessage:"No datasets found for this connection.",totalLabel:"dataset(s) found"}),new u("Re-run with --dataset <name> or -d <name>.");S=await J({message:"Select a dataset:",options:_.map(C=>({value:C.Name,label:C.DisplayName||C.Name,hint:C.Name})),manualPromptMessage:"Enter dataset name:"})}let F=c;if(!F){let L={...A,actionsParams:{apiId:o,connectionId:v,dataset:S}},{value:_}=await q(()=>ge(L),M);if(!p.interactive)throw V({title:`Available tables in dataset '${S}'`,columns:[{header:"Display Name",maxWidth:40},{header:"Table Name"}],rows:_.map(C=>[C.DisplayName||C.Name,C.Name]),emptyMessage:"No tables found in this dataset.",totalLabel:"table(s) found"}),new u("Re-run with --table <name> or -t <name>.");F=await J({message:"Select a table:",options:_.map(C=>({value:C.Name,label:C.DisplayName||C.Name,hint:C.Name})),manualPromptMessage:"Enter table name:"})}let k={...A,actionsParams:{apiId:o,connectionId:v,dataset:S,tableName:F,skipCodegen:f,useV1Codegen:a}},N=await q(()=>me(k),M);T(`Data source '${N}' added successfully (table '${F}' from connector '${g}').`),h(`Hint: Run '${"ms"} app dev' to test locally, or '${"ms"} app deploy' to deploy.`)}async function Z(e){let{argumentProvider:t,connector:n,apiId:o,connectionIdFlag:r,skipCodegen:i,useV1Codegen:c,useSso:f,policy:a,dataverseEnvironmentId:d,dataverseTable:p,forceTableBinding:l}=e,m=x(),{fileConfig:s,cliFs:y}=m,E=U(),D=t.getAuthenticationProvider(),A=$(),g=(n.properties.connectionParameterSets?.values?.length??0)>1,v=r;g&&!v&&(v=(await Q({argumentProvider:t,apiId:o,connector:n,useSso:f})).connectionId),g&&v&&await X({apiId:o,connectionId:v});let R=a?le(a,n.name??o):void 0,M=H(o),S=await Re({isCommonDataServiceForApps:M,forceTableBinding:!!l,dataverseEnvironmentId:d,dataverseTable:p}),F=N=>({vfs:y,authProvider:D,httpClient:t.getHttpClient(),region:E.region,environmentName:E.environmentName,actionsParams:{apiId:o,connectionId:v,skipCodegen:i,useV1Codegen:c,actionPolicy:R,...N},localFilePaths:{appConfigPath:s.appConfigPath,schemaPath:s.schemaPath,codeGenPath:s.codeGenPath},logger:A}),k;try{k=await j(F(S))}catch(N){throw N instanceof ce||N instanceof ee?new u(N.message):N}if(k.filteredCount>0&&h(`Skipped ${k.filteredCount} of ${k.totalCount} actions due to your organization's connector policy.`),Te(k.skippedDataverseMethods),T(`Data source '${k.dataSourceName}' added successfully (connector '${n.properties.displayName??o}').`),S?.dataverseTable&&T(`Dataverse table '${S.dataverseTable}' bound successfully.`),M&&m.interactive&&!S&&await B({message:"Connect this to a specific Dataverse table?",initialValue:!0})){let L=await j(F(await $e({})));T("Dataverse table binding added successfully."),Te(L.skippedDataverseMethods)}h(`Hint: Run '${"ms"} app dev' to test locally, or '${"ms"} app deploy' to deploy.`)}async function Re(e){if(!e.isCommonDataServiceForApps)return;let t=x(),n=!!e.dataverseTable;if(!t.interactive)return n?{dataverseEnvironmentId:e.dataverseEnvironmentId,dataverseTable:e.dataverseTable}:void 0;if(!(!n&&!e.forceTableBinding))return $e({dataverseEnvironmentId:e.dataverseEnvironmentId,dataverseTable:e.dataverseTable})}async function $e(e){let t=e.dataverseTable??await ve({message:"Dataverse table logical name:"});return{dataverseEnvironmentId:e.dataverseEnvironmentId,dataverseTable:t}}function Ee(e){return e.properties.capabilities?.some(t=>t.toLowerCase()==="tabular")??!1}async function fn(e){Ue(e),await e.runVerb(),we();let t=await e.getOption("connector"),n=await e.getOption("connectionId",!0),o=await e.getOption("dataset",!0),r=await e.getOption("table",!0),i=await e.getOption("as",!0),c=await e.getOption("dataverseEnvironmentId",!0),f=!!await e.getOption("skipCodegen",!0),a=!!await e.getOption("useV1Codegen",!0),d=!!await e.getOption("useSso",!0),p;if(i!==void 0&&i!==""){let g=i.toLowerCase();if(g!=="table"&&g!=="action")throw new u(`Invalid value for --as: '${i}'. Expected 'table' or 'action'.`);p=g}let l=await Se(t,$()),{connector:m,policy:s}=await Ne(e,l),y=m.properties.displayName??l,E=Ee(m);if(H(l)){if(o)throw new u("--dataset is not used with the Common Data Service for Apps connector. Use --table to specify a Dataverse logical name.");let g=p==="table";if(!x().interactive&&(g||c)&&!r)throw new u("Adding a Dataverse table requires --table <logical-name> for the Common Data Service for Apps connector. --dataverse-environment-id is optional and defaults to the app environment.");await Z({argumentProvider:e,connector:m,apiId:l,connectionIdFlag:n,skipCodegen:f,useV1Codegen:a,useSso:d,policy:s,dataverseEnvironmentId:c,dataverseTable:r,forceTableBinding:g});return}if(c)throw new u("--dataverse-environment-id can only be used with the Common Data Service for Apps connector (--connector shared_commondataserviceforapps or --connector commondataserviceforapps).");let A=await Me({isTabular:E,asFlag:p,connectorLabel:y});if(A==="action"&&(o||r))throw new u("--dataset and --table cannot be used with --as action. Re-run with --as table, or omit those flags.");A==="table"?await Pe({argumentProvider:e,connector:m,apiId:l,connectionIdFlag:n,datasetFlag:o,tableFlag:r,skipCodegen:f,useV1Codegen:a,useSso:d}):await Z({argumentProvider:e,connector:m,apiId:l,connectionIdFlag:n,skipCodegen:f,useV1Codegen:a,useSso:d,policy:s})}async function Me(e){let{isTabular:t,asFlag:n,connectorLabel:o}=e,r=x();if(!t){if(n==="table")throw new u(`Connector '${o}' does not support tabular data sources. Re-run without --as table, or with --as action.`);return"action"}if(n)return n;if(!r.interactive)throw new u(`Connector '${o}' supports both tables and actions. Specify --as table or --as action.`);return await B({message:`Connector '${o}' supports tables. Add a table? (No \u2192 add actions instead)`,initialValue:!0})?"table":"action"}function Ue(e){e.getResolvedCommand()?.path.at(-1)==="connector"?(e.setDescription(`${w.app.add.connector.deprecation}
36
-
37
- ${w.app.add.connector.description}`),e.addExamples(w.app.add.connector.deprecatedExamples)):(e.setDescription(w.app.add.connector.description),e.addExamples(w.app.add.connector.examples)),e.addOptions([ye({flags:{key:P.Connector.name},env:P.Connector.envVar,message:P.Connector.promptMessage,description:w.app.add.connector.options.connector}),{flags:{key:P.ConnectionId.name,alias:P.ConnectionId.alias},env:P.ConnectionId.envVar,description:w.app.add.connector.options.connectionId,optionalInNonInteractive:!0},{flags:{key:P.Dataset.name,alias:P.Dataset.alias},env:P.Dataset.envVar,description:w.app.add.connector.options.dataset,optionalInNonInteractive:!0},{flags:{key:b.Table.name,alias:b.Table.alias},env:b.Table.envVar,description:w.app.add.connector.options.table,optionalInNonInteractive:!0},{flags:{key:b.As.name},env:b.As.envVar,description:w.app.add.connector.options.as,optionalInNonInteractive:!0},{flags:{key:b.DataverseEnvironmentId.name},env:b.DataverseEnvironmentId.envVar,description:w.app.add.connector.options.dataverseEnvironmentId,optionalInNonInteractive:!0}]),e.addSwitch({flags:{key:b.SkipCodegen.name},env:b.SkipCodegen.env,description:w.app.add.connector.options.skipCodegen}),e.addSwitch({flags:{key:b.UseSso.name},env:b.UseSso.env,description:w.app.add.connector.options.useSso}),e.addSwitch({flags:{key:b.UseV1Codegen.name},env:b.UseV1Codegen.env,description:"Use V1 (legacy) code generation instead of V2.",hidden:!0})}export{fn as addConnectorAsync};
38
- /*!
39
- * Copyright (C) Microsoft Corporation. All rights reserved.
40
- */
41
- //# sourceMappingURL=AddConnector-5DUBFLEK.js.map
@@ -1,11 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __pathDirname } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __pathDirname(__filename);
7
- import{b as $}from"./chunk-VMSJG53Y.js";import"./chunk-OL6CTXQR.js";import{a as R}from"./chunk-KYL2Y5G4.js";import"./chunk-7GGFN2IW.js";import"./chunk-4VBFOKV6.js";import{d as I}from"./chunk-7BRIEYGR.js";import{h as B}from"./chunk-SNWTSI75.js";import{X as S,ua as M,va as N}from"./chunk-4LIR3ZYP.js";import{b as c}from"./chunk-RBG2H562.js";import"./chunk-UNJJUCSA.js";import"./chunk-6RSE3J4X.js";import"./chunk-EX6IKPAO.js";import{n as e}from"./chunk-3JIZGVCA.js";import{c as p,d as r,e as A,h as b}from"./chunk-PVAIJSAI.js";import{a as i}from"./chunk-47LJLFDF.js";import{a as h}from"./chunk-PPW4XUZO.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function Q(t){if(D(t),await t.runVerb(),!t.getEnvironmentId())throw new c(`\`ms app build-app\` is deprecated and the \`--environment-id\` flag has been removed. The replacement flow is \`ms app create\` (scaffolds the app and writes ${h}) followed by \`ms app deploy\`. To run this deprecated command, invoke it from a directory with a ${h} (created by \`ms app create\`).`);let a=await t.getTenantIdAsync();if(!a)throw new c("Unable to determine tenant ID. Ensure you are logged in.");let l=await B(t),v=await t.getOption(e.NoWait.camelName)===!1,o=await t.getOption("commit",!0),m,y=!1;if(!o){let n=I();if(!n)throw new c("Could not determine the latest commit ID. Use --commit or -c to specify it.");o=n.commitSha,m=n.detached?void 0:n.branch,y=!0}let d=t.isJsonMode();y&&!d&&b(m?`Using branch '${m}' at commit ${o}.`:`Detached HEAD at commit ${o}.`);let w=N().appConfig,u=w?.repoType,C=w?.externalRepoUrl,F=await t.getOption(e.OpenBrowser.camelName,!0)??!1,k=await t.getOption(e.ForceReauth.camelName,!0)??!1;d&&u==="github"&&A({phase:"build-validation"});let g=await R(({isRetry:n})=>S({logger:M(),actionsParams:{appName:l,commitSha:o,...k&&!n&&u==="github"&&{forceReauth:!0}}}),{repoType:u,externalRepoUrl:C,tenantId:a,jsonMode:d,openBrowser:F,verb:"app build"});if(g===null){O(t.isJsonMode(),o);return}if(v){J(t.isJsonMode(),l,o);return}let f=await $({appName:l,commitSha:o,initialWaitMs:g.retryAfterMs??1e3,isJsonMode:t.isJsonMode()});t.isJsonMode()?r(f):(p(`Build status: ${f.status}`),f.status==="Succeeded"&&b(`Run \`ms app dev\` to run your app locally, or \`ms app deploy --commit ${o}\` to make this app live.`))}function D(t){t.setDescription(i.app.build.description),t.addExamples(i.app.build.examples),t.addOptions([{flags:{key:e.AppName.name},env:e.AppName.envVar,description:i.app.build.options.appName,optionalInNonInteractive:!0},{flags:{key:e.CommitSha.name,alias:e.CommitSha.alias},env:e.CommitSha.envVar,description:i.app.build.options.commitSha,optionalInNonInteractive:!0}]),t.addSwitch({flags:{key:e.NoWait.name},description:i.app.build.options.noWait}),t.addSwitch({flags:{key:e.OpenBrowser.name},description:i.app.build.options.openBrowser}),t.addSwitch({flags:{key:e.ForceReauth.name},description:i.app.build.options.forceReauth})}function J(t,s,a){if(t){r({commitSha:a,buildStatusCommand:`ms app build-status --app ${s} --commit ${a}`});return}p(`Build started for commit ${a}. Run \`ms app build-status --app ${s} --commit ${a}\` to check status.`)}function O(t,s){if(t){r({cached:!0,commitSha:s});return}p("Build already up to date for this commit.")}export{Q as buildMaafAppAsync};
8
- /*!
9
- * Copyright (C) Microsoft Corporation. All rights reserved.
10
- */
11
- //# sourceMappingURL=BuildMaafApp-A4IUU6LI.js.map