@pnp/cli-microsoft365 6.9.0-beta.d8f63d2 → 6.9.0-beta.ef7c408

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.
@@ -1,4 +1,4 @@
1
- FROM mcr.microsoft.com/powershell:7.1.0-ubuntu-focal
1
+ FROM mcr.microsoft.com/powershell:alpine-3.17
2
2
 
3
3
  LABEL name="CLI for Microsoft 365 Development" \
4
4
  description="Development container for contributing to CLI for Microsoft 365" \
@@ -17,22 +17,15 @@ LABEL name="CLI for Microsoft 365 Development" \
17
17
  ENV NPM_CONFIG_PREFIX=/home/cli-microsoft365-dev/.npm-global \
18
18
  PATH=$PATH:/home/cli-microsoft365-dev/.npm-global/bin
19
19
 
20
- RUN apt-get update && apt-get install -y \
20
+ RUN apk add --no-cache \
21
21
  git \
22
22
  curl \
23
23
  sudo \
24
+ shadow \
24
25
  zsh \
25
26
  jq \
26
- vim \
27
- python3.8 \
28
- python3-pip \
29
- && curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash - \
30
- && apt-get install nodejs -y \
31
- && rm -rf /var/lib/apt/lists/*
32
-
33
- COPY ../docs/pip_requirements.txt .
34
-
35
- RUN pip install -r pip_requirements.txt
27
+ nodejs \
28
+ npm
36
29
 
37
30
  RUN useradd \
38
31
  --user-group \
@@ -45,15 +38,15 @@ USER cli-microsoft365-dev
45
38
 
46
39
  WORKDIR /home/cli-microsoft365
47
40
 
48
- RUN zsh -c "$(curl https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" --unattended \
49
- && git clone https://github.com/denysdovhan/spaceship-prompt.git "$HOME/.oh-my-zsh/custom/themes/spaceship-prompt" --depth=1 \
50
- && ln -s "$HOME/.oh-my-zsh/custom/themes/spaceship-prompt/spaceship.zsh-theme" "$HOME/.oh-my-zsh/custom/themes/spaceship.zsh-theme" \
51
- && cp "$HOME/.oh-my-zsh/templates/zshrc.zsh-template" $HOME/.zshrc \
52
- && git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting \
53
- && git clone https://github.com/zsh-users/zsh-autosuggestions $HOME/.oh-my-zsh/custom/plugins/zsh-autosuggestions \
41
+ RUN git clone https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh \
42
+ && cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc \
43
+ && git clone https://github.com/denysdovhan/spaceship-prompt.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/themes/spaceship-prompt --depth=1 \
44
+ && ln -s ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/themes/spaceship-prompt/spaceship.zsh-theme ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/themes/spaceship.zsh-theme \
54
45
  && sed -i "11s/ZSH_THEME=\"robbyrussell\"/ZSH_THEME=\"spaceship\"/" ~/.zshrc \
55
- && sed -i "27s/# DISABLE_AUTO_UPDATE=\"true\"/DISABLE_AUTO_UPDATE=\"true\"/" ~/.zshrc \
46
+ && git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting \
47
+ && git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions \
56
48
  && sed -i "73s/plugins=(git)/plugins=(git zsh-autosuggestions zsh-syntax-highlighting)/" ~/.zshrc \
49
+ && sed -i "27s/# DISABLE_AUTO_UPDATE=\"true\"/DISABLE_AUTO_UPDATE=\"true\"/" ~/.zshrc \
57
50
  && sed -i "50s/# COMPLETION_WAITING_DOTS/COMPLETION_WAITING_DOTS/" ~/.zshrc
58
51
 
59
52
  CMD [ "/bin/zsh", "-l" ]
@@ -2,22 +2,29 @@
2
2
  "name": "CLI for Microsoft 365",
3
3
  "dockerFile": "Dockerfile",
4
4
  "context": "..",
5
- "settings": {
6
- "terminal.integrated.profiles.linux": {
7
- "zsh": {
8
- "path": "/bin/zsh",
9
- "args": [
10
- "-l"
11
- ]
12
- }
13
- },
14
- "terminal.integrated.defaultProfile.linux": "zsh"
5
+ "postCreateCommand": {
6
+ "cli": "npm i && npm run clean && npm run build && npm link",
7
+ "docs": "cd docs && npm i"
15
8
  },
16
- "postCreateCommand": "npm i && npm run clean && npm run build && npm link",
17
- "extensions": [
18
- "dbaeumer.vscode-eslint",
19
- "hbenl.vscode-test-explorer",
20
- "hbenl.vscode-mocha-test-adapter",
21
- "eamodio.gitlens"
22
- ]
9
+ "customizations": {
10
+ "vscode": {
11
+ "extensions": [
12
+ "dbaeumer.vscode-eslint",
13
+ "hbenl.vscode-test-explorer",
14
+ "hbenl.vscode-mocha-test-adapter",
15
+ "eamodio.gitlens"
16
+ ],
17
+ "settings": {
18
+ "terminal.integrated.profiles.linux": {
19
+ "zsh": {
20
+ "path": "/bin/zsh",
21
+ "args": [
22
+ "-l"
23
+ ]
24
+ }
25
+ },
26
+ "terminal.integrated.defaultProfile.linux": "zsh"
27
+ }
28
+ }
29
+ }
23
30
  }
package/Dockerfile CHANGED
@@ -43,10 +43,12 @@ RUN bash -c 'echo "export PATH=$PATH:/home/cli-microsoft365/.npm-global/bin:/hom
43
43
  && bash -c 'echo "export CLIMICROSOFT365_ENV=\"docker\"" >> ~/.bash_profile' \
44
44
  && bash -c 'npm i -g @pnp/cli-microsoft365@${CLI_VERSION} --production --quiet --no-progress' \
45
45
  && bash -c 'echo "source /etc/profile.d/bash_completion.sh" >> ~/.bash_profile' \
46
+ && bash -c 'echo "alias \"m365?\"=\"m365_chili\"" >> ~/.bash_profile' \
46
47
  && bash -c 'echo ". .bashrc" >> ~/.bash_profile' \
47
48
  && bash -c 'npm cache clean --force' \
48
49
  && bash -c 'm365 cli completion sh setup' \
49
- && pwsh -c 'm365 cli completion pwsh setup --profile $profile'
50
+ && pwsh -c 'm365 cli completion pwsh setup --profile $profile' \
51
+ && pwsh -c 'Add-Content -Path $PROFILE -Value "`r`Set-Alias -Name m365? -Value m365_chili"'
50
52
 
51
53
  RUN pip install setuptools==58
52
54
  RUN pip install jmespath-terminal
package/dist/Auth.js CHANGED
@@ -18,6 +18,7 @@ const Command_1 = require("./Command");
18
18
  const config_1 = require("./config");
19
19
  const request_1 = require("./request");
20
20
  const settingsNames_1 = require("./settingsNames");
21
+ const browserUtil_1 = require("./utils/browserUtil");
21
22
  var CloudType;
22
23
  (function (CloudType) {
23
24
  CloudType[CloudType["Public"] = 0] = "Public";
@@ -361,14 +362,7 @@ class Auth {
361
362
  }
362
363
  logger.log(response.message);
363
364
  if (Cli_1.Cli.getInstance().getSettingWithDefaultValue(settingsNames_1.settingsNames.autoOpenLinksInBrowser, false)) {
364
- // _open is never set before hitting this line, but this check
365
- // is implemented so that we can support lazy loading
366
- // but also stub it for testing
367
- /* c8 ignore next 3 */
368
- if (!this._open) {
369
- this._open = require('open');
370
- }
371
- this._open(response.verificationUri);
365
+ browserUtil_1.browserUtil.open(response.verificationUri);
372
366
  }
373
367
  if (Cli_1.Cli.getInstance().getSettingWithDefaultValue(settingsNames_1.settingsNames.copyDeviceCodeToClipboard, false)) {
374
368
  // _clipboardy is never set before hitting this line, but this check
@@ -2,12 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AuthServer = void 0;
4
4
  const http = require("http");
5
- const open = require("open");
6
5
  const url = require("url");
7
6
  const Auth_1 = require("./Auth");
7
+ const browserUtil_1 = require("./utils/browserUtil");
8
8
  class AuthServer {
9
9
  constructor() {
10
- this.open = open;
11
10
  this.debug = false;
12
11
  this.resource = "";
13
12
  this.generatedServerUrl = "";
@@ -85,8 +84,7 @@ class AuthServer {
85
84
  return this.httpServer;
86
85
  }
87
86
  openUrl(url) {
88
- this
89
- .open(url)
87
+ browserUtil_1.browserUtil.open(url)
90
88
  .then(_ => {
91
89
  this.logger.logToStderr("To sign in, use the web browser that just has been opened. Please sign-in there.");
92
90
  })
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
12
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
13
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
14
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
15
+ };
16
+ var _AadSpListCommand_instances, _AadSpListCommand_initTelemetry, _AadSpListCommand_initOptions;
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const odata_1 = require("../../../../utils/odata");
19
+ const GraphCommand_1 = require("../../../base/GraphCommand");
20
+ const commands_1 = require("../../commands");
21
+ class AadSpListCommand extends GraphCommand_1.default {
22
+ get name() {
23
+ return commands_1.default.SP_LIST;
24
+ }
25
+ defaultProperties() {
26
+ return ['appId', 'displayName', 'tag'];
27
+ }
28
+ get description() {
29
+ return 'Lists the service principals in the directory';
30
+ }
31
+ constructor() {
32
+ super();
33
+ _AadSpListCommand_instances.add(this);
34
+ __classPrivateFieldGet(this, _AadSpListCommand_instances, "m", _AadSpListCommand_initTelemetry).call(this);
35
+ __classPrivateFieldGet(this, _AadSpListCommand_instances, "m", _AadSpListCommand_initOptions).call(this);
36
+ }
37
+ commandAction(logger, args) {
38
+ return __awaiter(this, void 0, void 0, function* () {
39
+ if (this.verbose) {
40
+ logger.logToStderr(`Retrieving service principal information...`);
41
+ }
42
+ try {
43
+ let requestUrl = `${this.resource}/v1.0/servicePrincipals`;
44
+ const filter = [];
45
+ if (args.options.tag) {
46
+ filter.push(`(tags/any(t:t eq '${args.options.tag}'))`);
47
+ }
48
+ if (args.options.displayName) {
49
+ filter.push(`(displayName eq '${args.options.displayName}')`);
50
+ }
51
+ if (filter.length > 0) {
52
+ requestUrl += `?$filter=${filter.join(' and ')}`;
53
+ }
54
+ const res = yield odata_1.odata.getAllItems(requestUrl);
55
+ logger.log(res);
56
+ }
57
+ catch (err) {
58
+ this.handleRejectedODataJsonPromise(err);
59
+ }
60
+ });
61
+ }
62
+ }
63
+ _AadSpListCommand_instances = new WeakSet(), _AadSpListCommand_initTelemetry = function _AadSpListCommand_initTelemetry() {
64
+ this.telemetry.push((args) => {
65
+ Object.assign(this.telemetryProperties, {
66
+ displayName: typeof args.options.displayName !== 'undefined',
67
+ tag: typeof args.options.tag !== 'undefined'
68
+ });
69
+ });
70
+ }, _AadSpListCommand_initOptions = function _AadSpListCommand_initOptions() {
71
+ this.options.unshift({
72
+ option: '--displayName [displayName]'
73
+ }, {
74
+ option: '--tag [tag]'
75
+ });
76
+ };
77
+ module.exports = new AadSpListCommand();
78
+ //# sourceMappingURL=sp-list.js.map
@@ -56,6 +56,7 @@ exports.default = {
56
56
  SITECLASSIFICATION_SET: `${prefix} siteclassification set`,
57
57
  SP_ADD: `${prefix} sp add`,
58
58
  SP_GET: `${prefix} sp get`,
59
+ SP_LIST: `${prefix} sp list`,
59
60
  USER_ADD: `${prefix} user add`,
60
61
  USER_GET: `${prefix} user get`,
61
62
  USER_GUEST_ADD: `${prefix} user guest add`,
@@ -17,6 +17,7 @@ var _AppOpenCommand_instances, _AppOpenCommand_initTelemetry, _AppOpenCommand_in
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  const Cli_1 = require("../../../cli/Cli");
19
19
  const settingsNames_1 = require("../../../settingsNames");
20
+ const browserUtil_1 = require("../../../utils/browserUtil");
20
21
  const AppCommand_1 = require("../../base/AppCommand");
21
22
  const commands_1 = require("../commands");
22
23
  class AppOpenCommand extends AppCommand_1.default {
@@ -43,26 +44,15 @@ class AppOpenCommand extends AppCommand_1.default {
43
44
  });
44
45
  }
45
46
  logOrOpenUrl(args, logger) {
46
- return new Promise((resolve, reject) => {
47
+ return __awaiter(this, void 0, void 0, function* () {
47
48
  const previewPrefix = args.options.preview === true ? "preview." : "";
48
49
  const url = `https://${previewPrefix}portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationMenuBlade/Overview/appId/${this.appId}/isMSAApp/`;
49
50
  if (Cli_1.Cli.getInstance().getSettingWithDefaultValue(settingsNames_1.settingsNames.autoOpenLinksInBrowser, false) === false) {
50
51
  logger.log(`Use a web browser to open the page ${url}`);
51
- return resolve();
52
+ return;
52
53
  }
53
54
  logger.log(`Opening the following page in your browser: ${url}`);
54
- // 'open' is required here so we can lazy load the dependency.
55
- // _open is never set before hitting this line, but this check
56
- // is implemented so that we can stub it when testing.
57
- /* c8 ignore next 3 */
58
- if (!this._open) {
59
- this._open = require('open');
60
- }
61
- this._open(url).then(() => {
62
- resolve();
63
- }, (error) => {
64
- reject(error);
65
- });
55
+ yield browserUtil_1.browserUtil.open(url);
66
56
  });
67
57
  }
68
58
  }
@@ -15,9 +15,9 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
15
15
  };
16
16
  var _CliIssueCommand_instances, _CliIssueCommand_initTelemetry, _CliIssueCommand_initOptions, _CliIssueCommand_initValidators;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- const open = require("open");
19
18
  const AnonymousCommand_1 = require("../../base/AnonymousCommand");
20
19
  const commands_1 = require("../commands");
20
+ const browserUtil_1 = require("../../../utils/browserUtil");
21
21
  class CliIssueCommand extends AnonymousCommand_1.default {
22
22
  get name() {
23
23
  return commands_1.default.ISSUE;
@@ -25,9 +25,8 @@ class CliIssueCommand extends AnonymousCommand_1.default {
25
25
  get description() {
26
26
  return 'Returns, or opens a URL that takes the user to the right place in the CLI GitHub repo to create a new issue reporting bug, feedback, ideas, etc.';
27
27
  }
28
- constructor(open) {
28
+ constructor() {
29
29
  super();
30
- this.open = open;
31
30
  _CliIssueCommand_instances.add(this);
32
31
  __classPrivateFieldGet(this, _CliIssueCommand_instances, "m", _CliIssueCommand_initTelemetry).call(this);
33
32
  __classPrivateFieldGet(this, _CliIssueCommand_instances, "m", _CliIssueCommand_initOptions).call(this);
@@ -47,15 +46,10 @@ class CliIssueCommand extends AnonymousCommand_1.default {
47
46
  issueLink = 'https://aka.ms/cli-m365/new-sample-script';
48
47
  break;
49
48
  }
50
- yield this.openBrowser(issueLink);
49
+ yield browserUtil_1.browserUtil.open(issueLink);
51
50
  logger.log(issueLink);
52
51
  });
53
52
  }
54
- openBrowser(issueLink) {
55
- return __awaiter(this, void 0, void 0, function* () {
56
- return this.open(issueLink, { wait: false });
57
- });
58
- }
59
53
  }
60
54
  _CliIssueCommand_instances = new WeakSet(), _CliIssueCommand_initTelemetry = function _CliIssueCommand_initTelemetry() {
61
55
  this.telemetry.push((args) => {
@@ -81,5 +75,5 @@ CliIssueCommand.issueType = [
81
75
  'command',
82
76
  'sample'
83
77
  ];
84
- module.exports = new CliIssueCommand(open);
78
+ module.exports = new CliIssueCommand();
85
79
  //# sourceMappingURL=cli-issue.js.map
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  const Cli_1 = require("../../../cli/Cli");
13
13
  const config_1 = require("../../../config");
14
14
  const settingsNames_1 = require("../../../settingsNames");
15
+ const browserUtil_1 = require("../../../utils/browserUtil");
15
16
  const AnonymousCommand_1 = require("../../base/AnonymousCommand");
16
17
  const commands_1 = require("../commands");
17
18
  class CliReconsentCommand extends AnonymousCommand_1.default {
@@ -29,15 +30,8 @@ class CliReconsentCommand extends AnonymousCommand_1.default {
29
30
  return;
30
31
  }
31
32
  logger.log(`Opening the following page in your browser: ${url}`);
32
- // _open is never set before hitting this line, but this check
33
- // is implemented so that we can support lazy loading
34
- // but also stub it for testing
35
- /* c8 ignore next 3 */
36
- if (!this._open) {
37
- this._open = require('open');
38
- }
39
33
  try {
40
- yield this._open(url);
34
+ yield browserUtil_1.browserUtil.open(url);
41
35
  }
42
36
  catch (err) {
43
37
  this.handleRejectedODataJsonPromise(err);
@@ -13,6 +13,7 @@ const AnonymousCommand_1 = require("../base/AnonymousCommand");
13
13
  const Cli_1 = require("../../cli/Cli");
14
14
  const commands_1 = require("./commands");
15
15
  const settingsNames_1 = require("../../settingsNames");
16
+ const browserUtil_1 = require("../../utils/browserUtil");
16
17
  const packageJSON = require('../../../package.json');
17
18
  class DocsCommand extends AnonymousCommand_1.default {
18
19
  get name() {
@@ -27,14 +28,7 @@ class DocsCommand extends AnonymousCommand_1.default {
27
28
  if (Cli_1.Cli.getInstance().getSettingWithDefaultValue(settingsNames_1.settingsNames.autoOpenLinksInBrowser, false) === false) {
28
29
  return;
29
30
  }
30
- // _open is never set before hitting this line, but this check
31
- // is implemented so that we can support lazy loading
32
- // but also stub it for testing
33
- /* c8 ignore next 3 */
34
- if (!this._open) {
35
- this._open = require('open');
36
- }
37
- yield this._open(packageJSON.homepage);
31
+ yield browserUtil_1.browserUtil.open(packageJSON.homepage);
38
32
  });
39
33
  }
40
34
  }
@@ -4,6 +4,7 @@ exports.powerShellPreset = exports.scriptingPreset = exports.interactivePreset =
4
4
  exports.interactivePreset = {
5
5
  autoOpenLinksInBrowser: true,
6
6
  copyDeviceCodeToClipboard: true,
7
+ interactive: true,
7
8
  output: 'text',
8
9
  printErrorsAsPlainText: true,
9
10
  prompt: true,
@@ -13,6 +14,7 @@ exports.interactivePreset = {
13
14
  exports.scriptingPreset = {
14
15
  autoOpenLinksInBrowser: false,
15
16
  copyDeviceCodeToClipboard: false,
17
+ interactive: false,
16
18
  output: 'json',
17
19
  printErrorsAsPlainText: false,
18
20
  prompt: false,
@@ -38,21 +38,28 @@ class FlowListCommand extends AzmgmtItemsListCommand_1.AzmgmtItemsListCommand {
38
38
  }
39
39
  commandAction(logger, args) {
40
40
  return __awaiter(this, void 0, void 0, function* () {
41
- const url = `${this.resource}providers/Microsoft.ProcessSimple${args.options.asAdmin ? '/scopes/admin' : ''}/environments/${formatting_1.formatting.encodeQueryParameter(args.options.environmentName)}/flows?api-version=2016-11-01`;
42
41
  try {
43
- if (args.options.asAdmin || !args.options.sharingStatus || args.options.sharingStatus === 'ownedByMe') {
42
+ const { environmentName, asAdmin, sharingStatus, includeSolutions } = args.options;
43
+ if (sharingStatus === 'personal') {
44
+ const url = this.getApiUrl(environmentName, asAdmin, includeSolutions, 'personal');
44
45
  yield this.getAllItems(url, logger, true);
45
46
  }
46
- else if (args.options.sharingStatus === 'personal') {
47
- yield this.getFilteredItems(url, logger, 'personal', true);
47
+ else if (sharingStatus === 'sharedWithMe') {
48
+ const url = this.getApiUrl(environmentName, asAdmin, includeSolutions, 'team');
49
+ yield this.getAllItems(url, logger, true);
48
50
  }
49
- else if (args.options.sharingStatus === 'sharedWithMe') {
50
- yield this.getFilteredItems(url, logger, 'team', true);
51
+ else if (sharingStatus === 'all') {
52
+ let url = this.getApiUrl(environmentName, asAdmin, includeSolutions, 'personal');
53
+ yield this.getAllItems(url, logger, true);
54
+ url = this.getApiUrl(environmentName, asAdmin, includeSolutions, 'team');
55
+ yield this.getAllItems(url, logger, false);
51
56
  }
52
57
  else {
53
- yield this.getFilteredItems(url, logger, 'personal', true);
54
- yield this.getFilteredItems(url, logger, 'team', false);
58
+ const url = this.getApiUrl(environmentName, asAdmin, includeSolutions);
59
+ yield this.getAllItems(url, logger, true);
55
60
  }
61
+ // Remove duplicates
62
+ this.items = this.items.filter((flow, index, self) => index === self.findIndex(f => f.id === flow.id));
56
63
  if (this.items.length > 0) {
57
64
  this.items.forEach(i => {
58
65
  i.displayName = i.properties.displayName;
@@ -70,16 +77,25 @@ class FlowListCommand extends AzmgmtItemsListCommand_1.AzmgmtItemsListCommand {
70
77
  }
71
78
  });
72
79
  }
73
- getFilteredItems(url, logger, filter, firstRun) {
74
- return __awaiter(this, void 0, void 0, function* () {
75
- yield this.getAllItems(`${url}&$filter=search('${filter}')`, logger, firstRun);
76
- });
80
+ getApiUrl(environmentName, asAdmin, includeSolutionFlows, filter) {
81
+ let url = `${this.resource}providers/Microsoft.ProcessSimple${asAdmin ? '/scopes/admin' : ''}/environments/${formatting_1.formatting.encodeQueryParameter(environmentName)}/flows?api-version=2016-11-01`;
82
+ if (filter === 'personal') {
83
+ url += `&$filter=search('personal')`;
84
+ }
85
+ else if (filter === 'team') {
86
+ url += `&$filter=search('team')`;
87
+ }
88
+ if (includeSolutionFlows) {
89
+ url += '&include=includeSolutionCloudFlows';
90
+ }
91
+ return url;
77
92
  }
78
93
  }
79
94
  _FlowListCommand_instances = new WeakSet(), _FlowListCommand_initTelemetry = function _FlowListCommand_initTelemetry() {
80
95
  this.telemetry.push((args) => {
81
96
  Object.assign(this.telemetryProperties, {
82
97
  sharingStatus: typeof args.options.sharingStatus !== 'undefined',
98
+ includeSolutions: !!args.options.includeSolutions,
83
99
  asAdmin: !!args.options.asAdmin
84
100
  });
85
101
  });
@@ -89,6 +105,8 @@ _FlowListCommand_instances = new WeakSet(), _FlowListCommand_initTelemetry = fun
89
105
  }, {
90
106
  option: '--sharingStatus [sharingStatus]',
91
107
  autocomplete: this.allowedSharingStatuses
108
+ }, {
109
+ option: '--includeSolutions'
92
110
  }, {
93
111
  option: '--asAdmin'
94
112
  });
@@ -56,31 +56,30 @@ class PpManagementAppAddCommand extends PowerPlatformCommand_1.default {
56
56
  });
57
57
  }
58
58
  getAppId(args) {
59
- if (args.options.appId) {
60
- return Promise.resolve(args.options.appId);
61
- }
62
- const { objectId, name } = args.options;
63
- const filter = objectId ?
64
- `id eq '${formatting_1.formatting.encodeQueryParameter(objectId)}'` :
65
- `displayName eq '${formatting_1.formatting.encodeQueryParameter(name)}'`;
66
- const requestOptions = {
67
- url: `https://graph.microsoft.com/v1.0/myorganization/applications?$filter=${filter}&$select=appId`,
68
- headers: {
69
- accept: 'application/json;odata.metadata=none'
70
- },
71
- responseType: 'json'
72
- };
73
- return request_1.default
74
- .get((requestOptions))
75
- .then((aadApps) => {
59
+ return __awaiter(this, void 0, void 0, function* () {
60
+ if (args.options.appId) {
61
+ return args.options.appId;
62
+ }
63
+ const { objectId, name } = args.options;
64
+ const filter = objectId ?
65
+ `id eq '${formatting_1.formatting.encodeQueryParameter(objectId)}'` :
66
+ `displayName eq '${formatting_1.formatting.encodeQueryParameter(name)}'`;
67
+ const requestOptions = {
68
+ url: `https://graph.microsoft.com/v1.0/myorganization/applications?$filter=${filter}&$select=appId`,
69
+ headers: {
70
+ accept: 'application/json;odata.metadata=none'
71
+ },
72
+ responseType: 'json'
73
+ };
74
+ const aadApps = yield request_1.default.get((requestOptions));
76
75
  if (aadApps.value.length === 0) {
77
76
  const applicationIdentifier = objectId ? `ID ${objectId}` : `name ${name}`;
78
- return Promise.reject(`No Azure AD application registration with ${applicationIdentifier} found`);
77
+ throw `No Azure AD application registration with ${applicationIdentifier} found`;
79
78
  }
80
79
  if (aadApps.value.length === 1 && aadApps.value[0].appId) {
81
- return Promise.resolve(aadApps.value[0].appId);
80
+ return aadApps.value[0].appId;
82
81
  }
83
- return Promise.reject(`Multiple Azure AD application registration with name ${name} found. Please disambiguate (app IDs): ${aadApps.value.map(a => a.appId).join(', ')}`);
82
+ throw `Multiple Azure AD application registration with name ${name} found. Please disambiguate (app IDs): ${aadApps.value.map(a => a.appId).join(', ')}`;
84
83
  });
85
84
  }
86
85
  }
@@ -582,7 +582,7 @@ _SpoListAddCommand_instances = new WeakSet(), _SpoListAddCommand_initTelemetry =
582
582
  return true;
583
583
  }));
584
584
  }, _SpoListAddCommand_initTypes = function _SpoListAddCommand_initTypes() {
585
- this.types.string.push('baseTemplate', 'webUrl', 'templateFeatureId', 'defaultContentApprovalWorkflowId', 'draftVersionVisibility', 'listExperienceOptions');
585
+ this.types.string.push('title', 'baseTemplate', 'webUrl', 'templateFeatureId', 'defaultContentApprovalWorkflowId', 'draftVersionVisibility', 'listExperienceOptions');
586
586
  this.types.boolean.push(...SpoListAddCommand.booleanOptions);
587
587
  };
588
588
  SpoListAddCommand.booleanOptions = [
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.browserUtil = void 0;
13
+ exports.browserUtil = {
14
+ /* c8 ignore next 5 */
15
+ open(url) {
16
+ return __awaiter(this, void 0, void 0, function* () {
17
+ const _open = require('open');
18
+ const runningOnWindows = process.platform === 'win32';
19
+ yield _open(url, { wait: runningOnWindows });
20
+ });
21
+ }
22
+ };
23
+ //# sourceMappingURL=browserUtil.js.map