@pnp/cli-microsoft365 7.8.0-beta.3152fc7 → 7.8.0-beta.5f64790

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/cli.js CHANGED
@@ -17,7 +17,7 @@ import { md } from '../utils/md.js';
17
17
  import { validation } from '../utils/validation.js';
18
18
  import { prompt } from '../utils/prompt.js';
19
19
  import { timings } from './timings.js';
20
- import chalk from 'chalk';
20
+ import { browserUtil } from '../utils/browserUtil.js';
21
21
  const require = createRequire(import.meta.url);
22
22
  const __dirname = fileURLToPath(new URL('.', import.meta.url));
23
23
  let _config;
@@ -35,7 +35,9 @@ let commandToExecute;
35
35
  let currentCommandName;
36
36
  let optionsFromArgs;
37
37
  const defaultHelpMode = 'options';
38
+ const defaultHelpTarget = 'console';
38
39
  const helpModes = ['options', 'examples', 'remarks', 'response', 'full'];
40
+ const helpTargets = ['console', 'web'];
39
41
  function getConfig() {
40
42
  if (!_config) {
41
43
  _config = new Configstore(config.configstoreName);
@@ -551,10 +553,17 @@ async function printHelp(helpMode, exitCode = 0) {
551
553
  const properties = {};
552
554
  if (cli.commandToExecute) {
553
555
  properties.command = cli.commandToExecute.name;
554
- printCommandHelp(helpMode);
556
+ const helpTarget = getSettingWithDefaultValue(settingsNames.helpTarget, defaultHelpTarget);
557
+ if (helpTarget === 'web') {
558
+ await openHelpInBrowser();
559
+ }
560
+ else {
561
+ printCommandHelp(helpMode);
562
+ }
555
563
  }
556
564
  else {
557
565
  if (cli.currentCommandName && !cli.commands.some(command => command.name.startsWith(cli.currentCommandName))) {
566
+ const chalk = (await import('chalk')).default;
558
567
  await cli.error(chalk.red(`Command '${cli.currentCommandName}' was not found. Below you can find the commands and command groups you can use. For detailed information on a command group, use 'm365 [command group] --help'.`));
559
568
  }
560
569
  cli.log();
@@ -567,6 +576,11 @@ async function printHelp(helpMode, exitCode = 0) {
567
576
  telemetry.trackEvent('help', properties);
568
577
  process.exit(exitCode);
569
578
  }
579
+ async function openHelpInBrowser() {
580
+ const pathChunks = cli.commandToExecute.help?.replace(/\\/g, '/').replace(/\.[^/.]+$/, '');
581
+ const onlineUrl = `https://pnp.github.io/cli-microsoft365/cmd/${pathChunks}`;
582
+ await browserUtil.open(onlineUrl);
583
+ }
570
584
  function printCommandHelp(helpMode) {
571
585
  const docsRootDir = path.join(__dirname, '..', '..', 'docs');
572
586
  const helpFilePath = path.join(docsRootDir, 'docs', 'cmd', cli.commandToExecute.help);
@@ -721,13 +735,13 @@ async function closeWithError(error, args, showHelpIfEnabled = false) {
721
735
  if (args.options.output === 'none') {
722
736
  return process.exit(exitCode);
723
737
  }
724
- const chalk = (await import('chalk')).default;
725
738
  let errorMessage = error instanceof CommandError ? error.message : error;
726
739
  if ((!args.options.output || args.options.output === 'json') &&
727
740
  !cli.getSettingWithDefaultValue(settingsNames.printErrorsAsPlainText, true)) {
728
741
  errorMessage = JSON.stringify({ error: errorMessage });
729
742
  }
730
743
  else {
744
+ const chalk = (await import('chalk')).default;
731
745
  errorMessage = chalk.red(`Error: ${errorMessage}`);
732
746
  }
733
747
  if (error instanceof CommandError && error.code) {
@@ -735,7 +749,7 @@ async function closeWithError(error, args, showHelpIfEnabled = false) {
735
749
  }
736
750
  await cli.error(errorMessage);
737
751
  if (showHelpIfEnabled &&
738
- await cli.getSettingWithDefaultValue(settingsNames.showHelpOnFailure, showHelpIfEnabled)) {
752
+ cli.getSettingWithDefaultValue(settingsNames.showHelpOnFailure, showHelpIfEnabled)) {
739
753
  await printHelp(await getHelpMode(args.options), exitCode);
740
754
  }
741
755
  else {
@@ -865,6 +879,7 @@ export const cli = {
865
879
  getSettingWithDefaultValue,
866
880
  handleMultipleResultsFound,
867
881
  helpModes,
882
+ helpTargets,
868
883
  loadAllCommandsInfo,
869
884
  loadCommandFromArgs,
870
885
  loadCommandFromFile,
package/dist/index.js CHANGED
@@ -1,17 +1,18 @@
1
1
  #!/usr/bin/env node
2
2
  import { cli } from './cli/cli.js';
3
3
  import { app } from './utils/app.js';
4
- // required to make console.log() in combination with piped output synchronous
5
- // on Windows/in PowerShell so that the output is not trimmed by calling
6
- // process.exit() after executing the command, while the output is still
7
- // being processed; https://github.com/pnp/cli-microsoft365/issues/1266
8
- if (process.stdout._handle) {
9
- process.stdout._handle.setBlocking(true);
10
- }
11
- if (!process.env.CLIMICROSOFT365_NOUPDATE) {
12
- import('update-notifier').then(updateNotifier => {
4
+ (async () => {
5
+ // required to make console.log() in combination with piped output synchronous
6
+ // on Windows/in PowerShell so that the output is not trimmed by calling
7
+ // process.exit() after executing the command, while the output is still
8
+ // being processed; https://github.com/pnp/cli-microsoft365/issues/1266
9
+ if (process.stdout._handle) {
10
+ process.stdout._handle.setBlocking(true);
11
+ }
12
+ if (!process.env.CLIMICROSOFT365_NOUPDATE) {
13
+ const updateNotifier = await import('update-notifier');
13
14
  updateNotifier.default({ pkg: app.packageJson() }).notify({ defer: false });
14
- });
15
- }
16
- cli.execute(process.argv.slice(2));
15
+ }
16
+ await cli.execute(process.argv.slice(2));
17
+ })();
17
18
  //# sourceMappingURL=index.js.map
@@ -87,6 +87,10 @@ _a = CliConfigSetCommand, _CliConfigSetCommand_instances = new WeakSet(), _CliCo
87
87
  allowedAuthTypes.indexOf(args.options.value) === -1) {
88
88
  return `${args.options.value} is not a valid value for the option ${args.options.key}. Allowed values: ${allowedAuthTypes.join(', ')}`;
89
89
  }
90
+ if (args.options.key === settingsNames.helpTarget &&
91
+ !cli.helpTargets.includes(args.options.value)) {
92
+ return `${args.options.value} is not a valid value for the option ${args.options.key}. Allowed values: ${cli.helpTargets.join(', ')}`;
93
+ }
90
94
  return true;
91
95
  });
92
96
  };
@@ -35,9 +35,9 @@ class SetupCommand extends AnonymousCommand {
35
35
  }
36
36
  else if (args.options.scripting) {
37
37
  Object.assign(settings, scriptingPreset);
38
- }
39
- if (pid.isPowerShell()) {
40
- Object.assign(settings, powerShellPreset);
38
+ if (pid.isPowerShell()) {
39
+ Object.assign(settings, powerShellPreset);
40
+ }
41
41
  }
42
42
  await this.configureSettings(settings, true, logger);
43
43
  return;
@@ -189,6 +189,7 @@ class EntraM365GroupAddCommand extends GraphCommand {
189
189
  _EntraM365GroupAddCommand_instances = new WeakSet(), _EntraM365GroupAddCommand_initTelemetry = function _EntraM365GroupAddCommand_initTelemetry() {
190
190
  this.telemetry.push((args) => {
191
191
  Object.assign(this.telemetryProperties, {
192
+ description: typeof args.options.description !== 'undefined',
192
193
  owners: typeof args.options.owners !== 'undefined',
193
194
  members: typeof args.options.members !== 'undefined',
194
195
  logoPath: typeof args.options.logoPath !== 'undefined',
@@ -202,10 +203,10 @@ _EntraM365GroupAddCommand_instances = new WeakSet(), _EntraM365GroupAddCommand_i
202
203
  }, _EntraM365GroupAddCommand_initOptions = function _EntraM365GroupAddCommand_initOptions() {
203
204
  this.options.unshift({
204
205
  option: '-n, --displayName <displayName>'
205
- }, {
206
- option: '-d, --description <description>'
207
206
  }, {
208
207
  option: '-m, --mailNickname <mailNickname>'
208
+ }, {
209
+ option: '-d, --description [description]'
209
210
  }, {
210
211
  option: '--owners [owners]'
211
212
  }, {
@@ -229,6 +230,7 @@ _EntraM365GroupAddCommand_instances = new WeakSet(), _EntraM365GroupAddCommand_i
229
230
  option: '-l, --logoPath [logoPath]'
230
231
  });
231
232
  }, _EntraM365GroupAddCommand_initTypes = function _EntraM365GroupAddCommand_initTypes() {
233
+ this.types.string.push('displayName', 'mailNickname', 'description', 'owners', 'members', 'visibility', 'logoPath');
232
234
  this.types.boolean.push('allowMembersToPost', 'hideGroupInOutlook', 'subscribeNewGroupMembers', 'welcomeEmailDisabled');
233
235
  }, _EntraM365GroupAddCommand_initValidators = function _EntraM365GroupAddCommand_initValidators() {
234
236
  this.validators.push(async (args) => {
@@ -4,6 +4,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
4
4
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
5
  };
6
6
  var _FlowRunListCommand_instances, _FlowRunListCommand_initTelemetry, _FlowRunListCommand_initOptions, _FlowRunListCommand_initValidators;
7
+ import request from '../../../../request.js';
7
8
  import { formatting } from '../../../../utils/formatting.js';
8
9
  import { odata } from '../../../../utils/odata.js';
9
10
  import { validation } from '../../../../utils/validation.js';
@@ -38,6 +39,9 @@ class FlowRunListCommand extends PowerAutomateCommand {
38
39
  }
39
40
  try {
40
41
  const items = await odata.getAllItems(url);
42
+ if (args.options.withTrigger) {
43
+ await this.retrieveTriggerInformation(items);
44
+ }
41
45
  if (args.options.output !== 'json' && items.length > 0) {
42
46
  items.forEach(i => {
43
47
  i.startTime = i.properties.startTime;
@@ -63,6 +67,21 @@ class FlowRunListCommand extends PowerAutomateCommand {
63
67
  }
64
68
  return filters;
65
69
  }
70
+ async retrieveTriggerInformation(items) {
71
+ const tasks = items.map(async (item) => {
72
+ const requestOptions = {
73
+ url: item.properties.trigger.outputsLink.uri,
74
+ headers: {
75
+ accept: 'application/json',
76
+ 'x-anonymous': true
77
+ },
78
+ responseType: 'json'
79
+ };
80
+ const response = await request.get(requestOptions);
81
+ item.triggerInformation = response.body;
82
+ });
83
+ await Promise.all(tasks);
84
+ }
66
85
  }
67
86
  _FlowRunListCommand_instances = new WeakSet(), _FlowRunListCommand_initTelemetry = function _FlowRunListCommand_initTelemetry() {
68
87
  this.telemetry.push((args) => {
@@ -70,6 +89,7 @@ _FlowRunListCommand_instances = new WeakSet(), _FlowRunListCommand_initTelemetry
70
89
  status: typeof args.options.status !== 'undefined',
71
90
  triggerStartTime: typeof args.options.triggerStartTime !== 'undefined',
72
91
  triggerEndTime: typeof args.options.triggerEndTime !== 'undefined',
92
+ withTrigger: !!args.options.withTrigger,
73
93
  asAdmin: !!args.options.asAdmin
74
94
  });
75
95
  });
@@ -85,6 +105,8 @@ _FlowRunListCommand_instances = new WeakSet(), _FlowRunListCommand_initTelemetry
85
105
  option: '--triggerStartTime [triggerStartTime]'
86
106
  }, {
87
107
  option: '--triggerEndTime [triggerEndTime]'
108
+ }, {
109
+ option: '--withTrigger'
88
110
  }, {
89
111
  option: '--asAdmin'
90
112
  });
@@ -102,6 +124,9 @@ _FlowRunListCommand_instances = new WeakSet(), _FlowRunListCommand_initTelemetry
102
124
  if (args.options.triggerEndTime && !validation.isValidISODateTime(args.options.triggerEndTime)) {
103
125
  return `'${args.options.triggerEndTime}' is not a valid datetime.`;
104
126
  }
127
+ if (args.options.output !== 'json' && args.options.withTrigger) {
128
+ return 'The --withTrigger option is only available when output is set to json';
129
+ }
105
130
  return true;
106
131
  });
107
132
  };
@@ -3,7 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
3
3
  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");
4
4
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
5
  };
6
- var _OutlookMessageListCommand_instances, _OutlookMessageListCommand_initTelemetry, _OutlookMessageListCommand_initOptions, _OutlookMessageListCommand_initOptionSets;
6
+ var _OutlookMessageListCommand_instances, _OutlookMessageListCommand_initTelemetry, _OutlookMessageListCommand_initOptions, _OutlookMessageListCommand_initValidators, _OutlookMessageListCommand_initTypes, _OutlookMessageListCommand_initOptionSets;
7
7
  import request from '../../../../request.js';
8
8
  import { formatting } from '../../../../utils/formatting.js';
9
9
  import { odata } from '../../../../utils/odata.js';
@@ -11,6 +11,9 @@ import GraphCommand from '../../../base/GraphCommand.js';
11
11
  import commands from '../../commands.js';
12
12
  import { Outlook } from '../../Outlook.js';
13
13
  import { cli } from '../../../../cli/cli.js';
14
+ import { validation } from '../../../../utils/validation.js';
15
+ import { accessToken } from '../../../../utils/accessToken.js';
16
+ import auth from '../../../../Auth.js';
14
17
  class OutlookMessageListCommand extends GraphCommand {
15
18
  get name() {
16
19
  return commands.MESSAGE_LIST;
@@ -23,6 +26,8 @@ class OutlookMessageListCommand extends GraphCommand {
23
26
  _OutlookMessageListCommand_instances.add(this);
24
27
  __classPrivateFieldGet(this, _OutlookMessageListCommand_instances, "m", _OutlookMessageListCommand_initTelemetry).call(this);
25
28
  __classPrivateFieldGet(this, _OutlookMessageListCommand_instances, "m", _OutlookMessageListCommand_initOptions).call(this);
29
+ __classPrivateFieldGet(this, _OutlookMessageListCommand_instances, "m", _OutlookMessageListCommand_initValidators).call(this);
30
+ __classPrivateFieldGet(this, _OutlookMessageListCommand_instances, "m", _OutlookMessageListCommand_initTypes).call(this);
26
31
  __classPrivateFieldGet(this, _OutlookMessageListCommand_instances, "m", _OutlookMessageListCommand_initOptionSets).call(this);
27
32
  }
28
33
  defaultProperties() {
@@ -30,27 +35,44 @@ class OutlookMessageListCommand extends GraphCommand {
30
35
  }
31
36
  async commandAction(logger, args) {
32
37
  try {
33
- const folderId = await this.getFolderId(args);
34
- const url = folderId ? `me/mailFolders/${folderId}/messages` : 'me/messages';
35
- const messages = await odata.getAllItems(`${this.resource}/v1.0/${url}?$top=50`);
38
+ if (!args.options.userId && !args.options.userName && accessToken.isAppOnlyAccessToken(auth.connection.accessTokens[auth.defaultResource].accessToken)) {
39
+ throw 'You must specify either the userId or userName option when using app-only permissions.';
40
+ }
41
+ const userUrl = args.options.userId || args.options.userName ? `users/${args.options.userId || formatting.encodeQueryParameter(args.options.userName)}` : 'me';
42
+ const folderId = await this.getFolderId(userUrl, args.options);
43
+ const folderUrl = folderId ? `/mailFolders/${folderId}` : '';
44
+ let requestUrl = `${this.resource}/v1.0/${userUrl}${folderUrl}/messages?$top=100`;
45
+ if (args.options.startTime || args.options.endTime) {
46
+ const filters = [];
47
+ if (args.options.startTime) {
48
+ filters.push(`receivedDateTime ge ${args.options.startTime}`);
49
+ }
50
+ if (args.options.endTime) {
51
+ filters.push(`receivedDateTime lt ${args.options.endTime}`);
52
+ }
53
+ if (filters.length > 0) {
54
+ requestUrl += `&$filter=${filters.join(' and ')}`;
55
+ }
56
+ }
57
+ const messages = await odata.getAllItems(requestUrl);
36
58
  await logger.log(messages);
37
59
  }
38
60
  catch (err) {
39
61
  this.handleRejectedODataJsonPromise(err);
40
62
  }
41
63
  }
42
- async getFolderId(args) {
43
- if (!args.options.folderId && !args.options.folderName) {
64
+ async getFolderId(userUrl, options) {
65
+ if (!options.folderId && !options.folderName) {
44
66
  return '';
45
67
  }
46
- if (args.options.folderId) {
47
- return args.options.folderId;
68
+ if (options.folderId) {
69
+ return options.folderId;
48
70
  }
49
- if (Outlook.wellKnownFolderNames.indexOf(args.options.folderName) > -1) {
50
- return args.options.folderName;
71
+ if (Outlook.wellKnownFolderNames.includes(options.folderName.toLowerCase())) {
72
+ return options.folderName;
51
73
  }
52
74
  const requestOptions = {
53
- url: `${this.resource}/v1.0/me/mailFolders?$filter=displayName eq '${formatting.encodeQueryParameter(args.options.folderName)}'&$select=id`,
75
+ url: `${this.resource}/v1.0/${userUrl}/mailFolders?$filter=displayName eq '${formatting.encodeQueryParameter(options.folderName)}'&$select=id`,
54
76
  headers: {
55
77
  accept: 'application/json;odata.metadata=none'
56
78
  },
@@ -58,11 +80,11 @@ class OutlookMessageListCommand extends GraphCommand {
58
80
  };
59
81
  const response = await request.get(requestOptions);
60
82
  if (response.value.length === 0) {
61
- throw `Folder with name '${args.options.folderName}' not found`;
83
+ throw `Folder with name '${options.folderName}' not found`;
62
84
  }
63
85
  if (response.value.length > 1) {
64
86
  const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', response.value);
65
- const result = await cli.handleMultipleResultsFound(`Multiple folders with name '${args.options.folderName}' found.`, resultAsKeyValuePair);
87
+ const result = await cli.handleMultipleResultsFound(`Multiple folders with name '${options.folderName}' found.`, resultAsKeyValuePair);
66
88
  return result.id;
67
89
  }
68
90
  return response.value[0].id;
@@ -72,7 +94,11 @@ _OutlookMessageListCommand_instances = new WeakSet(), _OutlookMessageListCommand
72
94
  this.telemetry.push((args) => {
73
95
  Object.assign(this.telemetryProperties, {
74
96
  folderId: typeof args.options.folderId !== 'undefined',
75
- folderName: typeof args.options.folderName !== 'undefined'
97
+ folderName: typeof args.options.folderName !== 'undefined',
98
+ startTime: typeof args.options.startTime !== 'undefined',
99
+ endTime: typeof args.options.endTime !== 'undefined',
100
+ userId: typeof args.options.userId !== 'undefined',
101
+ userName: typeof args.options.userName !== 'undefined'
76
102
  });
77
103
  });
78
104
  }, _OutlookMessageListCommand_initOptions = function _OutlookMessageListCommand_initOptions() {
@@ -80,11 +106,55 @@ _OutlookMessageListCommand_instances = new WeakSet(), _OutlookMessageListCommand
80
106
  option: '--folderName [folderName]',
81
107
  autocomplete: Outlook.wellKnownFolderNames
82
108
  }, {
83
- option: '--folderId [folderId]',
84
- autocomplete: Outlook.wellKnownFolderNames
109
+ option: '--folderId [folderId]'
110
+ }, {
111
+ option: '--startTime [startTime]'
112
+ }, {
113
+ option: '--endTime [endTime]'
114
+ }, {
115
+ option: '--userId [userId]'
116
+ }, {
117
+ option: '--userName [userName]'
85
118
  });
119
+ }, _OutlookMessageListCommand_initValidators = function _OutlookMessageListCommand_initValidators() {
120
+ this.validators.push(async (args) => {
121
+ if (args.options.startTime) {
122
+ if (!validation.isValidISODateTime(args.options.startTime)) {
123
+ return `'${args.options.startTime}' is not a valid ISO date string for option startTime.`;
124
+ }
125
+ if (new Date(args.options.startTime) > new Date()) {
126
+ return 'startTime value cannot be in the future.';
127
+ }
128
+ }
129
+ if (args.options.endTime) {
130
+ if (!validation.isValidISODateTime(args.options.endTime)) {
131
+ return `'${args.options.endTime}' is not a valid ISO date string for option endTime.`;
132
+ }
133
+ if (new Date(args.options.endTime) > new Date()) {
134
+ return 'endTime value cannot be in the future.';
135
+ }
136
+ }
137
+ if (args.options.startTime && args.options.endTime && new Date(args.options.startTime) >= new Date(args.options.endTime)) {
138
+ return 'startTime must be before endTime.';
139
+ }
140
+ if (args.options.userId && !validation.isValidGuid(args.options.userId)) {
141
+ return `${args.options.userId} is not a valid GUID for option userId.`;
142
+ }
143
+ if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) {
144
+ return `${args.options.userName} is not a valid UPN for option userName.`;
145
+ }
146
+ return true;
147
+ });
148
+ }, _OutlookMessageListCommand_initTypes = function _OutlookMessageListCommand_initTypes() {
149
+ this.types.string.push('folderName', 'folderId', 'startTime', 'endTime', 'userId', 'userName');
86
150
  }, _OutlookMessageListCommand_initOptionSets = function _OutlookMessageListCommand_initOptionSets() {
87
- this.optionSets.push({ options: ['folderId', 'folderName'] });
151
+ this.optionSets.push({
152
+ options: ['folderId', 'folderName'],
153
+ runsWhen: (args) => args.options.folderId || args.options.folderName
154
+ }, {
155
+ options: ['userId', 'userName'],
156
+ runsWhen: (args) => args.options.userId || args.options.userName
157
+ });
88
158
  };
89
159
  export default new OutlookMessageListCommand();
90
160
  //# sourceMappingURL=message-list.js.map
@@ -4,6 +4,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
4
4
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
5
  };
6
6
  var _SpoSiteAddCommand_instances, _SpoSiteAddCommand_initTelemetry, _SpoSiteAddCommand_initOptions, _SpoSiteAddCommand_initValidators;
7
+ import { setTimeout } from 'timers/promises';
7
8
  import config from '../../../../config.js';
8
9
  import request from '../../../../request.js';
9
10
  import { formatting } from '../../../../utils/formatting.js';
@@ -198,19 +199,14 @@ class SpoSiteAddCommand extends SpoCommand {
198
199
  if ((!args.options.wait && !args.options.withAppCatalog) || isComplete) {
199
200
  return args.options.url;
200
201
  }
201
- await new Promise((resolve, reject) => {
202
- setTimeout(() => {
203
- spo.waitUntilFinished({
204
- operationId: JSON.stringify(operation._ObjectIdentity_),
205
- siteUrl: this.spoAdminUrl,
206
- resolve,
207
- reject,
208
- logger,
209
- currentContext: this.context,
210
- verbose: this.verbose,
211
- debug: this.debug
212
- });
213
- }, operation.PollingInterval);
202
+ await setTimeout(operation.PollingInterval);
203
+ await spo.waitUntilFinished({
204
+ operationId: JSON.stringify(operation._ObjectIdentity_),
205
+ siteUrl: this.spoAdminUrl,
206
+ logger,
207
+ currentContext: this.context,
208
+ verbose: this.verbose,
209
+ debug: this.debug
214
210
  });
215
211
  return args.options.url;
216
212
  }
@@ -291,19 +287,14 @@ class SpoSiteAddCommand extends SpoCommand {
291
287
  if (!wait || isComplete) {
292
288
  return;
293
289
  }
294
- await new Promise((resolve, reject) => {
295
- setTimeout(() => {
296
- spo.waitUntilFinished({
297
- operationId: JSON.stringify(operation._ObjectIdentity_),
298
- siteUrl: this.spoAdminUrl,
299
- resolve,
300
- reject,
301
- logger,
302
- currentContext: this.context,
303
- verbose: this.verbose,
304
- debug: this.debug
305
- });
306
- }, operation.PollingInterval);
290
+ await setTimeout(operation.PollingInterval);
291
+ await spo.waitUntilFinished({
292
+ operationId: JSON.stringify(operation._ObjectIdentity_),
293
+ siteUrl: this.spoAdminUrl,
294
+ logger,
295
+ currentContext: this.context,
296
+ verbose: this.verbose,
297
+ debug: this.debug
307
298
  });
308
299
  }
309
300
  async addAppCatalog(url, logger) {