@pnp/cli-microsoft365 11.1.0-beta.8311bbf → 11.1.0-beta.871ff4d

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 (190) hide show
  1. package/.devproxy/api-specs/sharepoint.yaml +41 -0
  2. package/allCommands.json +1 -1
  3. package/allCommandsFull.json +1 -1
  4. package/dist/Auth.js +10 -7
  5. package/dist/Command.js +2 -2
  6. package/dist/auth/msalCachePlugin.js +6 -2
  7. package/dist/autocomplete.js +6 -2
  8. package/dist/chili/chili.js +2 -1
  9. package/dist/cli/cli.js +4 -2
  10. package/dist/config.js +0 -1
  11. package/dist/m365/adaptivecard/commands/adaptivecard-send.js +2 -2
  12. package/dist/m365/app/commands/permission/permission-list.js +4 -2
  13. package/dist/m365/commands/setup.js +6 -3
  14. package/dist/m365/entra/commands/app/app-role-add.js +1 -1
  15. package/dist/m365/entra/commands/group/group-add.js +1 -1
  16. package/dist/m365/entra/commands/group/group-set.js +1 -1
  17. package/dist/m365/entra/commands/license/license-list.js +5 -0
  18. package/dist/m365/entra/commands/m365group/m365group-add.js +0 -1
  19. package/dist/m365/file/commands/convert/convert-pdf.js +1 -6
  20. package/dist/m365/flow/commands/flow-export.js +8 -5
  21. package/dist/m365/flow/commands/run/run-get.js +3 -3
  22. package/dist/m365/graph/commands/schemaextension/schemaextension-set.js +1 -1
  23. package/dist/m365/pa/commands/app/app-export.js +1 -1
  24. package/dist/m365/pa/commands/app/app-get.js +1 -1
  25. package/dist/m365/planner/commands/tenant/tenant-settings-list.js +5 -0
  26. package/dist/m365/pp/commands/solution/solution-publisher-get.js +1 -1
  27. package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-list.js +5 -0
  28. package/dist/m365/purview/commands/retentionlabel/retentionlabel-list.js +5 -0
  29. package/dist/m365/spfx/commands/package/package-generate.js +3 -1
  30. package/dist/m365/spfx/commands/project/base-project-command.js +13 -5
  31. package/dist/m365/spfx/commands/project/project-doctor/rules/FN021007_PKG_only_one_rush_stack_compiler_installed.js +1 -1
  32. package/dist/m365/spfx/commands/project/project-externalize/rules/PnPJsRule.js +6 -4
  33. package/dist/m365/spfx/commands/project/project-model/ScssFile.js +3 -1
  34. package/dist/m365/spfx/commands/project/project-model/TsFile.js +6 -2
  35. package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.15.2.js +1 -1
  36. package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.16.0.js +2 -0
  37. package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.17.0.js +2 -0
  38. package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.18.0.js +2 -0
  39. package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.19.0.js +2 -0
  40. package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.20.0.js +2 -0
  41. package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.21.0.js +2 -0
  42. package/dist/m365/spfx/commands/spfx-doctor.js +5 -5
  43. package/dist/m365/spo/commands/file/file-add.js +4 -2
  44. package/dist/m365/spo/commands/file/file-rename.js +3 -4
  45. package/dist/m365/spo/commands/hubsite/hubsite-list.js +1 -1
  46. package/dist/m365/spo/commands/listitem/listitem-attachment-add.js +1 -1
  47. package/dist/m365/spo/commands/listitem/listitem-batch-set.js +9 -5
  48. package/dist/m365/spo/commands/page/clientsidepages.js +12 -12
  49. package/dist/m365/spo/commands/page/page-add.js +4 -2
  50. package/dist/m365/spo/commands/page/page-clientsidewebpart-add.js +1 -0
  51. package/dist/m365/spo/commands/page/page-set.js +4 -2
  52. package/dist/m365/spo/commands/page/page-text-add.js +1 -0
  53. package/dist/m365/spo/commands/propertybag/propertybag-base.js +34 -54
  54. package/dist/m365/spo/commands/theme/theme-apply.js +1 -1
  55. package/dist/m365/spo/commands/web/web-alert-list.js +107 -0
  56. package/dist/m365/spo/commands/web/web-alert-remove.js +59 -0
  57. package/dist/m365/spo/commands/web/web-reindex.js +17 -27
  58. package/dist/m365/spo/commands.js +2 -0
  59. package/dist/m365/teams/commands/tab/tab-add.js +9 -3
  60. package/dist/m365/viva/commands/connections/connections-app-create.js +1 -1
  61. package/dist/m365/viva/commands/engage/engage-community-user-add.js +1 -1
  62. package/dist/m365/viva/commands/engage/engage-community-user-remove.js +1 -1
  63. package/dist/telemetry.js +3 -1
  64. package/dist/utils/accessToken.js +4 -0
  65. package/dist/utils/cache.js +3 -2
  66. package/dist/utils/customAppScope.js +1 -1
  67. package/dist/utils/directoryExtension.js +1 -1
  68. package/dist/utils/entraAdministrativeUnit.js +1 -1
  69. package/dist/utils/entraApp.js +2 -2
  70. package/dist/utils/entraDevice.js +1 -1
  71. package/dist/utils/entraServicePrincipal.js +2 -2
  72. package/dist/utils/formatting.js +1 -1
  73. package/dist/utils/md.js +2 -2
  74. package/dist/utils/odata.js +2 -0
  75. package/dist/utils/planner.js +1 -1
  76. package/dist/utils/powerPlatform.js +2 -2
  77. package/dist/utils/roleDefinition.js +2 -2
  78. package/dist/utils/spo.js +10 -11
  79. package/dist/utils/urlUtil.js +1 -1
  80. package/dist/utils/validation.js +1 -1
  81. package/dist/utils/vivaEngage.js +3 -3
  82. package/docs/docs/cmd/booking/business/business-get.mdx +18 -1
  83. package/docs/docs/cmd/booking/business/business-list.mdx +18 -1
  84. package/docs/docs/cmd/entra/administrativeunit/administrativeunit-add.mdx +19 -0
  85. package/docs/docs/cmd/entra/administrativeunit/administrativeunit-get.mdx +19 -0
  86. package/docs/docs/cmd/entra/administrativeunit/administrativeunit-list.mdx +19 -0
  87. package/docs/docs/cmd/entra/administrativeunit/administrativeunit-member-add.mdx +21 -0
  88. package/docs/docs/cmd/entra/administrativeunit/administrativeunit-member-get.mdx +19 -0
  89. package/docs/docs/cmd/entra/administrativeunit/administrativeunit-member-list.mdx +19 -0
  90. package/docs/docs/cmd/entra/administrativeunit/administrativeunit-member-remove.mdx +21 -0
  91. package/docs/docs/cmd/entra/administrativeunit/administrativeunit-remove.mdx +21 -0
  92. package/docs/docs/cmd/entra/administrativeunit/administrativeunit-roleassignment-add.mdx +19 -0
  93. package/docs/docs/cmd/entra/app/app-add.mdx +18 -0
  94. package/docs/docs/cmd/entra/app/app-get.mdx +19 -1
  95. package/docs/docs/cmd/entra/app/app-list.mdx +18 -1
  96. package/docs/docs/cmd/entra/app/app-remove.mdx +20 -0
  97. package/docs/docs/cmd/entra/app/app-set.mdx +20 -0
  98. package/docs/docs/cmd/entra/approleassignment/approleassignment-add.mdx +18 -0
  99. package/docs/docs/cmd/entra/approleassignment/approleassignment-list.mdx +18 -0
  100. package/docs/docs/cmd/entra/approleassignment/approleassignment-remove.mdx +20 -0
  101. package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-add.mdx +14 -0
  102. package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-get.mdx +15 -0
  103. package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-list.mdx +14 -0
  104. package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-remove.mdx +14 -0
  105. package/docs/docs/cmd/entra/group/group-add.mdx +18 -0
  106. package/docs/docs/cmd/entra/group/group-get.mdx +18 -0
  107. package/docs/docs/cmd/entra/group/group-list.mdx +18 -0
  108. package/docs/docs/cmd/entra/group/group-member-add.mdx +20 -0
  109. package/docs/docs/cmd/entra/group/group-member-list.mdx +18 -0
  110. package/docs/docs/cmd/entra/group/group-member-remove.mdx +20 -0
  111. package/docs/docs/cmd/entra/group/group-member-set.mdx +20 -0
  112. package/docs/docs/cmd/entra/group/group-remove.mdx +20 -0
  113. package/docs/docs/cmd/entra/group/group-set.mdx +20 -0
  114. package/docs/docs/cmd/entra/groupsetting/groupsetting-add.mdx +19 -0
  115. package/docs/docs/cmd/entra/groupsetting/groupsetting-get.mdx +19 -0
  116. package/docs/docs/cmd/entra/groupsetting/groupsetting-list.mdx +19 -0
  117. package/docs/docs/cmd/entra/groupsetting/groupsetting-remove.mdx +21 -0
  118. package/docs/docs/cmd/entra/groupsetting/groupsetting-set.mdx +21 -0
  119. package/docs/docs/cmd/entra/m365group/m365group-add.mdx +19 -0
  120. package/docs/docs/cmd/entra/m365group/m365group-get.mdx +19 -0
  121. package/docs/docs/cmd/entra/m365group/m365group-list.mdx +19 -0
  122. package/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-clear.mdx +14 -0
  123. package/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-list.mdx +19 -0
  124. package/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-remove.mdx +14 -0
  125. package/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-restore.mdx +21 -0
  126. package/docs/docs/cmd/entra/m365group/m365group-remove.mdx +21 -0
  127. package/docs/docs/cmd/entra/m365group/m365group-renew.mdx +21 -0
  128. package/docs/docs/cmd/entra/m365group/m365group-report-activitycounts.mdx +18 -0
  129. package/docs/docs/cmd/entra/m365group/m365group-report-activitydetail.mdx +18 -0
  130. package/docs/docs/cmd/entra/m365group/m365group-report-activityfilecounts.mdx +18 -0
  131. package/docs/docs/cmd/entra/m365group/m365group-report-activitygroupcounts.mdx +18 -0
  132. package/docs/docs/cmd/entra/m365group/m365group-report-activitystorage.mdx +18 -0
  133. package/docs/docs/cmd/entra/m365group/m365group-set.mdx +21 -0
  134. package/docs/docs/cmd/entra/m365group/m365group-teamify.mdx +19 -0
  135. package/docs/docs/cmd/entra/multitenant/multitenant-add.mdx +18 -0
  136. package/docs/docs/cmd/entra/multitenant/multitenant-get.mdx +18 -1
  137. package/docs/docs/cmd/entra/multitenant/multitenant-remove.mdx +20 -0
  138. package/docs/docs/cmd/entra/multitenant/multitenant-set.mdx +20 -0
  139. package/docs/docs/cmd/entra/oauth2grant/oauth2grant-add.mdx +20 -0
  140. package/docs/docs/cmd/entra/oauth2grant/oauth2grant-list.mdx +17 -0
  141. package/docs/docs/cmd/entra/oauth2grant/oauth2grant-remove.mdx +20 -0
  142. package/docs/docs/cmd/entra/oauth2grant/oauth2grant-set.mdx +20 -0
  143. package/docs/docs/cmd/entra/organization/organization-list.mdx +19 -2
  144. package/docs/docs/cmd/entra/pim/pim-role-assignment-add.mdx +18 -0
  145. package/docs/docs/cmd/entra/pim/pim-role-assignment-eligibility-list.mdx +18 -0
  146. package/docs/docs/cmd/entra/pim/pim-role-assignment-list.mdx +18 -0
  147. package/docs/docs/cmd/entra/pim/pim-role-assignment-remove.mdx +18 -0
  148. package/docs/docs/cmd/entra/pim/pim-role-request-list.mdx +18 -0
  149. package/docs/docs/cmd/graph/directoryextension/directoryextension-add.mdx +18 -0
  150. package/docs/docs/cmd/graph/directoryextension/directoryextension-get.mdx +18 -0
  151. package/docs/docs/cmd/graph/directoryextension/directoryextension-list.mdx +18 -0
  152. package/docs/docs/cmd/graph/directoryextension/directoryextension-remove.mdx +20 -0
  153. package/docs/docs/cmd/graph/schemaextension/schemaextension-add.mdx +18 -1
  154. package/docs/docs/cmd/graph/schemaextension/schemaextension-get.mdx +18 -1
  155. package/docs/docs/cmd/graph/schemaextension/schemaextension-list.mdx +19 -1
  156. package/docs/docs/cmd/graph/schemaextension/schemaextension-remove.mdx +20 -0
  157. package/docs/docs/cmd/graph/schemaextension/schemaextension-set.mdx +23 -3
  158. package/docs/docs/cmd/graph/subscription/subscription-add.mdx +27 -6
  159. package/docs/docs/cmd/outlook/mail/mail-send.mdx +21 -0
  160. package/docs/docs/cmd/outlook/mailbox/mailbox-settings-get.mdx +20 -1
  161. package/docs/docs/cmd/outlook/mailbox/mailbox-settings-set.mdx +20 -1
  162. package/docs/docs/cmd/outlook/room/room-list.mdx +19 -0
  163. package/docs/docs/cmd/outlook/roomlist/roomlist-list.mdx +19 -0
  164. package/docs/docs/cmd/purview/retentionevent/retentionevent-add.mdx +18 -0
  165. package/docs/docs/cmd/purview/retentionevent/retentionevent-get.mdx +18 -0
  166. package/docs/docs/cmd/purview/retentionevent/retentionevent-list.mdx +18 -0
  167. package/docs/docs/cmd/purview/retentionevent/retentionevent-remove.mdx +20 -0
  168. package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-add.mdx +18 -0
  169. package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-get.mdx +18 -0
  170. package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-list.mdx +18 -0
  171. package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-remove.mdx +21 -1
  172. package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-set.mdx +21 -1
  173. package/docs/docs/cmd/purview/retentionlabel/retentionlabel-add.mdx +11 -0
  174. package/docs/docs/cmd/purview/retentionlabel/retentionlabel-get.mdx +12 -1
  175. package/docs/docs/cmd/purview/retentionlabel/retentionlabel-list.mdx +12 -1
  176. package/docs/docs/cmd/purview/retentionlabel/retentionlabel-remove.mdx +14 -1
  177. package/docs/docs/cmd/purview/retentionlabel/retentionlabel-set.mdx +13 -0
  178. package/docs/docs/cmd/purview/sensitivitylabel/sensitivitylabel-get.mdx +18 -0
  179. package/docs/docs/cmd/purview/sensitivitylabel/sensitivitylabel-list.mdx +18 -0
  180. package/docs/docs/cmd/purview/sensitivitylabel/sensitivitylabel-policysettings-list.mdx +18 -0
  181. package/docs/docs/cmd/purview/threatassessment/threatassessment-add.mdx +12 -0
  182. package/docs/docs/cmd/purview/threatassessment/threatassessment-get.mdx +19 -0
  183. package/docs/docs/cmd/purview/threatassessment/threatassessment-list.mdx +19 -0
  184. package/docs/docs/cmd/spo/web/web-alert-list.mdx +187 -0
  185. package/docs/docs/cmd/spo/web/web-alert-remove.mdx +65 -0
  186. package/eslint-rules/lib/rules/correct-command-class-name.js +18 -2
  187. package/eslint.config.mjs +270 -0
  188. package/npm-shrinkwrap.json +562 -445
  189. package/package.json +9 -7
  190. package/.eslintrc.cjs +0 -289
package/dist/Auth.js CHANGED
@@ -122,6 +122,7 @@ export class Auth {
122
122
  this._connection = Object.assign(this._connection, connection);
123
123
  }
124
124
  catch {
125
+ // Do nothing
125
126
  }
126
127
  }
127
128
  async ensureAccessToken(resource, logger, debug = false, fetchNew = false) {
@@ -296,15 +297,17 @@ export class Auth {
296
297
  return new ConfidentialClientApplication(await this.getAuthClientConfiguration(logger, debug, certificateThumbprint, certificatePrivateKey, clientSecret));
297
298
  }
298
299
  retrieveAuthCodeWithBrowser(resource, logger, debug) {
299
- return new Promise(async (resolve, reject) => {
300
+ return new Promise((resolve, reject) => {
300
301
  // _authServer is never set before hitting this line, but this check
301
302
  // is implemented so that we can support lazy loading
302
303
  // but also stub it for testing
303
- /* c8 ignore next 3 */
304
- if (!this._authServer) {
305
- this._authServer = (await import('./AuthServer.js')).default;
306
- }
307
- this._authServer.initializeServer(this.connection, resource, resolve, reject, logger, debug);
304
+ (async () => {
305
+ /* c8 ignore next 3 */
306
+ if (!this._authServer) {
307
+ this._authServer = (await import('./AuthServer.js')).default;
308
+ }
309
+ this._authServer.initializeServer(this.connection, resource, resolve, reject, logger, debug);
310
+ })().catch(reject);
308
311
  });
309
312
  }
310
313
  async ensureAccessTokenWithBrowser(resource, logger, debug) {
@@ -404,7 +407,7 @@ export class Auth {
404
407
  this.connection.thumbprint = await this.calculateThumbprint(pemCert);
405
408
  }
406
409
  }
407
- catch (e) {
410
+ catch {
408
411
  this.connection.certificateType = CertificateType.Binary;
409
412
  }
410
413
  }
package/dist/Command.js CHANGED
@@ -243,7 +243,7 @@ class Command {
243
243
  /* c8 ignore next 4 */
244
244
  if (this.debug && typeof global.it === 'undefined') {
245
245
  const error = new Error();
246
- cli.error(error.stack).then(() => { }).catch(() => { });
246
+ cli.error(error.stack).catch(() => undefined);
247
247
  }
248
248
  if (res.error) {
249
249
  try {
@@ -284,7 +284,7 @@ class Command {
284
284
  /* c8 ignore next 4 */
285
285
  if (this.debug && typeof global.it === 'undefined') {
286
286
  const error = new Error();
287
- cli.error(error.stack).then(() => { }).catch(() => { });
287
+ cli.error(error.stack).catch(() => undefined);
288
288
  }
289
289
  if (response.error &&
290
290
  response.error['odata.error'] &&
@@ -8,7 +8,9 @@ class MsalCachePlugin {
8
8
  const data = await this.fileTokenStorage.get();
9
9
  tokenCacheContext.tokenCache.deserialize(data);
10
10
  }
11
- catch { }
11
+ catch {
12
+ // Do nothing
13
+ }
12
14
  }
13
15
  async afterCacheAccess(tokenCacheContext) {
14
16
  if (!tokenCacheContext.cacheHasChanged) {
@@ -17,7 +19,9 @@ class MsalCachePlugin {
17
19
  try {
18
20
  await this.fileTokenStorage.set(tokenCacheContext.tokenCache.serialize());
19
21
  }
20
- catch { }
22
+ catch {
23
+ // Do nothing
24
+ }
21
25
  }
22
26
  }
23
27
  const msalCachePlugin = new MsalCachePlugin();
@@ -17,7 +17,9 @@ class Autocomplete {
17
17
  const data = fs.readFileSync(Autocomplete.autocompleteFilePath, 'utf-8');
18
18
  this.commands = JSON.parse(data);
19
19
  }
20
- catch { }
20
+ catch {
21
+ // Do nothing
22
+ }
21
23
  }
22
24
  this.omelette = omelette('m365_comp|m365|microsoft365');
23
25
  this.omelette.on('complete', this.handleAutocomplete.bind(this));
@@ -58,7 +60,9 @@ class Autocomplete {
58
60
  replies = Object.keys(replies);
59
61
  }
60
62
  }
61
- catch { }
63
+ catch {
64
+ // Do nothing
65
+ }
62
66
  }
63
67
  if (!replies) {
64
68
  replies = [];
@@ -97,10 +97,11 @@ async function runConversationTurn(conversationId, question) {
97
97
  ];
98
98
  const result = await prompt.forSelection({ message: 'What would you like to do next?', choices });
99
99
  switch (result) {
100
- case 'ask':
100
+ case 'ask': {
101
101
  const prompt = await promptForPrompt();
102
102
  await runConversationTurn(conversationId, prompt);
103
103
  break;
104
+ }
104
105
  case 'end':
105
106
  await endConversation(conversationId);
106
107
  console.log('');
package/dist/cli/cli.js CHANGED
@@ -360,7 +360,7 @@ async function loadOptionsFromContext(commandOptions, debug) {
360
360
  m365rc = JSON.parse(fileContents);
361
361
  }
362
362
  }
363
- catch (e) {
363
+ catch {
364
364
  await cli.closeWithError(`Error parsing ${filePath}`, { options: {} });
365
365
  /* c8 ignore next */
366
366
  }
@@ -403,7 +403,9 @@ async function loadCommandFromFile(commandFileUrl) {
403
403
  cli.commandToExecute = cli.getCommandInfo(command.default, commandFileUrl, commandInfo?.help);
404
404
  }
405
405
  }
406
- catch { }
406
+ catch {
407
+ // Do nothing
408
+ }
407
409
  }
408
410
  function getCommandInfo(command, filePath = '', helpFilePath = '') {
409
411
  const options = command.schema ? zod.schemaToOptionInfo(command.schema) : getCommandOptions(command);
package/dist/config.js CHANGED
@@ -64,7 +64,6 @@ export default {
64
64
  'https://microsoft.sharepoint-df.com/User.ReadWrite.All'
65
65
  ],
66
66
  applicationName: `CLI for Microsoft 365 v${app.packageJson().version}`,
67
- delimiter: 'm365\$',
68
67
  configstoreName: 'cli-m365-config',
69
68
  minimalScopes: [
70
69
  'https://graph.microsoft.com/User.Read'
@@ -38,7 +38,7 @@ class AdaptiveCardSendCommand extends AnonymousCommand {
38
38
  JSON.parse(options.card);
39
39
  return true;
40
40
  }
41
- catch (e) {
41
+ catch {
42
42
  return false;
43
43
  }
44
44
  }
@@ -53,7 +53,7 @@ class AdaptiveCardSendCommand extends AnonymousCommand {
53
53
  JSON.parse(options.cardData);
54
54
  return true;
55
55
  }
56
- catch (e) {
56
+ catch {
57
57
  return false;
58
58
  }
59
59
  }
@@ -60,7 +60,7 @@ class AppPermissionListCommand extends AppCommand {
60
60
  }
61
61
  const permissionsPromises = [];
62
62
  switch (mode) {
63
- case GetServicePrincipal.withPermissions:
63
+ case GetServicePrincipal.withPermissions: {
64
64
  const appRoleAssignmentsRequestOptions = {
65
65
  url: `${this.resource}/v1.0/servicePrincipals/${servicePrincipal.id}/appRoleAssignments`,
66
66
  headers: {
@@ -80,7 +80,8 @@ class AppPermissionListCommand extends AppCommand {
80
80
  request.get(oauth2PermissionGrantsRequestOptions)
81
81
  ]);
82
82
  break;
83
- case GetServicePrincipal.withPermissionDefinitions:
83
+ }
84
+ case GetServicePrincipal.withPermissionDefinitions: {
84
85
  const oauth2PermissionScopesRequestOptions = {
85
86
  url: `${this.resource}/v1.0/servicePrincipals/${servicePrincipal.id}/oauth2PermissionScopes`,
86
87
  headers: {
@@ -100,6 +101,7 @@ class AppPermissionListCommand extends AppCommand {
100
101
  request.get(appRolesRequestOptions)
101
102
  ]);
102
103
  break;
104
+ }
103
105
  }
104
106
  const permissions = await Promise.all(permissionsPromises);
105
107
  switch (mode) {
@@ -90,7 +90,7 @@ class SetupCommand extends AnonymousCommand {
90
90
  };
91
91
  preferences.entraApp = await cli.promptForSelection(entraAppConfig);
92
92
  switch (preferences.entraApp) {
93
- case EntraAppConfig.Create:
93
+ case EntraAppConfig.Create: {
94
94
  const newEntraAppScopesConfig = {
95
95
  message: 'What scopes should the new app registration have?',
96
96
  choices: [
@@ -100,10 +100,12 @@ class SetupCommand extends AnonymousCommand {
100
100
  };
101
101
  preferences.newEntraAppScopes = await cli.promptForSelection(newEntraAppScopesConfig);
102
102
  break;
103
- case EntraAppConfig.UseExisting:
103
+ }
104
+ case EntraAppConfig.UseExisting: {
104
105
  const existingApp = await this.configureExistingEntraApp(logger);
105
106
  Object.assign(preferences, existingApp);
106
107
  break;
108
+ }
107
109
  }
108
110
  }
109
111
  else {
@@ -318,7 +320,7 @@ class SetupCommand extends AnonymousCommand {
318
320
  }
319
321
  async configureSettings({ preferences, settings, silent, logger }) {
320
322
  switch (preferences.entraApp) {
321
- case EntraAppConfig.Create:
323
+ case EntraAppConfig.Create: {
322
324
  if (this.verbose) {
323
325
  await logger.logToStderr('Creating a new Entra app...');
324
326
  }
@@ -332,6 +334,7 @@ class SetupCommand extends AnonymousCommand {
332
334
  cli.getConfig().delete(settingsNames.clientCertificateBase64Encoded);
333
335
  cli.getConfig().delete(settingsNames.clientCertificatePassword);
334
336
  break;
337
+ }
335
338
  case EntraAppConfig.UseExisting:
336
339
  Object.assign(settings, {
337
340
  clientId: preferences.clientId,
@@ -104,7 +104,7 @@ _a = EntraAppRoleAddCommand, _EntraAppRoleAddCommand_instances = new WeakSet(),
104
104
  if (claim.startsWith('.')) {
105
105
  return 'Claim must not begin with .';
106
106
  }
107
- if (!/^[\w:!#$%&'()*+,-.\/:;<=>?@\[\]^+_`{|}~]+$/.test(claim)) {
107
+ if (!/^[\w:!#$%&'()*+,-./:;<=>?@[\]^+_`{|}~]+$/.test(claim)) {
108
108
  return `Claim can contain only the following characters a-z, A-Z, 0-9, :!#$%&'()*+,-./:;<=>?@[]^+_\`{|}~]+`;
109
109
  }
110
110
  return true;
@@ -158,7 +158,7 @@ _EntraGroupAddCommand_instances = new WeakSet(), _EntraGroupAddCommand_initOptio
158
158
  }
159
159
  if (args.options.mailNickname) {
160
160
  if (!validation.isValidMailNickname(args.options.mailNickname)) {
161
- return `Value for option 'mailNickname' must contain only characters in the ASCII character set 0-127 except the following: @ () \ [] " ; : <> , SPACE.`;
161
+ return `Value for option 'mailNickname' must contain only characters in the ASCII character set 0-127 except the following: @ () \\ [] " ; : <> , SPACE.`;
162
162
  }
163
163
  if (args.options.mailNickname.length > 64) {
164
164
  return `The maximum amount of characters for 'mailNickname' is 64.`;
@@ -207,7 +207,7 @@ _EntraGroupSetCommand_instances = new WeakSet(), _EntraGroupSetCommand_initTelem
207
207
  }
208
208
  if (args.options.mailNickname) {
209
209
  if (!validation.isValidMailNickname(args.options.mailNickname)) {
210
- return `Value '${args.options.mailNickname}' for option 'mailNickname' must contain only characters in the ASCII character set 0-127 except the following: @ () \ [] " ; : <> , SPACE.`;
210
+ return `Value '${args.options.mailNickname}' for option 'mailNickname' must contain only characters in the ASCII character set 0-127 except the following: @ () \\ [] " ; : <> , SPACE.`;
211
211
  }
212
212
  if (args.options.mailNickname.length > 64) {
213
213
  return `The maximum amount of characters for 'mailNickname' is 64.`;
@@ -1,6 +1,8 @@
1
1
  import { odata } from '../../../../utils/odata.js';
2
2
  import GraphCommand from '../../../base/GraphCommand.js';
3
3
  import commands from '../../commands.js';
4
+ import { globalOptionsZod } from '../../../../Command.js';
5
+ const options = globalOptionsZod.strict();
4
6
  class EntraLicenseListCommand extends GraphCommand {
5
7
  get name() {
6
8
  return commands.LICENSE_LIST;
@@ -8,6 +10,9 @@ class EntraLicenseListCommand extends GraphCommand {
8
10
  get description() {
9
11
  return 'Lists commercial subscriptions that an organization has acquired';
10
12
  }
13
+ get schema() {
14
+ return options;
15
+ }
11
16
  defaultProperties() {
12
17
  return ['id', 'skuId', 'skuPartNumber'];
13
18
  }
@@ -134,7 +134,6 @@ class EntraM365GroupAddCommand extends GraphCommand {
134
134
  const userArr = users.split(',').map(o => o.trim());
135
135
  let promises = [];
136
136
  let userIds = [];
137
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
138
137
  promises = userArr.map(user => {
139
138
  const requestOptions = {
140
139
  url: `${this.resource}/v1.0/users?$filter=userPrincipalName eq '${formatting.encodeQueryParameter(user)}'&$select=id,userPrincipalName`,
@@ -69,12 +69,7 @@ class FileConvertPdfCommand extends GraphCommand {
69
69
  if (this.verbose) {
70
70
  await logger.logToStderr(`Deleting the temporary PDF file at ${localTargetFilePath}...`);
71
71
  }
72
- try {
73
- fs.unlinkSync(localTargetFilePath);
74
- }
75
- catch (e) {
76
- throw e;
77
- }
72
+ fs.unlinkSync(localTargetFilePath);
78
73
  }
79
74
  else {
80
75
  if (this.debug) {
@@ -73,9 +73,12 @@ class FlowExportCommand extends PowerPlatformCommand {
73
73
  // adds suggestedCreationType property to all resources
74
74
  // see https://github.com/pnp/cli-microsoft365/issues/1845
75
75
  Object.keys(res.resources).forEach((key) => {
76
- res.resources[key].type === 'Microsoft.Flow/flows'
77
- ? res.resources[key].suggestedCreationType = 'Update'
78
- : res.resources[key].suggestedCreationType = 'Existing';
76
+ if (res.resources[key].type === 'Microsoft.Flow/flows') {
77
+ res.resources[key].suggestedCreationType = 'Update';
78
+ }
79
+ else {
80
+ res.resources[key].suggestedCreationType = 'Existing';
81
+ }
79
82
  });
80
83
  requestOptions.data = {
81
84
  includedResourceIds: [
@@ -95,10 +98,10 @@ class FlowExportCommand extends PowerPlatformCommand {
95
98
  await logger.logToStderr(`Getting file for Microsoft Flow ${args.options.name}...`);
96
99
  }
97
100
  const downloadFileUrl = formatArgument === 'json' ? '' : res.packageLink.value;
98
- const filenameRegEx = /([^\/]+\.zip)/i;
101
+ const filenameRegEx = /([^/]+\.zip)/i;
99
102
  filenameFromApi = formatArgument === 'json' ? `${res.properties.displayName}.json` : (filenameRegEx.exec(downloadFileUrl) || ['output.zip'])[0];
100
103
  // Replace all illegal characters from the file name
101
- const illegalCharsRegEx = /[\\\/:*?"<>|]/g;
104
+ const illegalCharsRegEx = /[\\/:*?"<>|]/g;
102
105
  filenameFromApi = filenameFromApi.replace(illegalCharsRegEx, '_');
103
106
  if (this.verbose) {
104
107
  await logger.logToStderr(`Filename from PowerApps API: ${filenameFromApi}.`);
@@ -44,7 +44,7 @@ class FlowRunGetCommand extends PowerAutomateCommand {
44
44
  if (args.options.withTrigger && res.properties.trigger.outputsLink) {
45
45
  res.triggerInformation = await this.getTriggerInformation(res);
46
46
  }
47
- if (!!args.options.withActions) {
47
+ if (args.options.withActions) {
48
48
  res.actions = await this.getActionsInformation(res, args.options.withActions);
49
49
  }
50
50
  await logger.log(res);
@@ -64,10 +64,10 @@ class FlowRunGetCommand extends PowerAutomateCommand {
64
64
  continue;
65
65
  }
66
66
  actionsResult[action] = res.properties.actions[action];
67
- if (!!res.properties.actions[action].inputsLink?.uri) {
67
+ if (res.properties.actions[action].inputsLink?.uri) {
68
68
  actionsResult[action].input = await this.requestAdditionalInformation(res.properties.actions[action].inputsLink?.uri);
69
69
  }
70
- if (!!res.properties.actions[action].outputsLink?.uri) {
70
+ if (res.properties.actions[action].outputsLink?.uri) {
71
71
  actionsResult[action].output = await this.requestAdditionalInformation(res.properties.actions[action].outputsLink?.uri);
72
72
  }
73
73
  }
@@ -88,7 +88,7 @@ class GraphSchemaExtensionSetCommand extends GraphCommand {
88
88
  try {
89
89
  properties = JSON.parse(propertiesString);
90
90
  }
91
- catch (e) {
91
+ catch {
92
92
  return 'The specified properties is not a valid JSON string';
93
93
  }
94
94
  // If the properties object is not an array
@@ -35,7 +35,7 @@ class PaAppExportCommand extends PowerPlatformCommand {
35
35
  let filename = args.options.name;
36
36
  if (args.options.packageDisplayName) {
37
37
  //Replace all illegal characters from the file name
38
- const illegalCharsRegEx = /[\\\/:*?"<>|]/g;
38
+ const illegalCharsRegEx = /[\\/:*?"<>|]/g;
39
39
  filename = args.options.packageDisplayName.replace(illegalCharsRegEx, '_');
40
40
  }
41
41
  const requestOptions = {
@@ -57,7 +57,7 @@ class PaAppGetCommand extends PowerAppsCommand {
57
57
  const app = allApps.find((a) => {
58
58
  return a.properties.displayName.toLowerCase() === `${args.options.displayName}`.toLowerCase();
59
59
  });
60
- if (!!app) {
60
+ if (app) {
61
61
  await logger.log(this.setProperties(app));
62
62
  }
63
63
  else {
@@ -1,6 +1,8 @@
1
+ import { globalOptionsZod } from '../../../../Command.js';
1
2
  import request from '../../../../request.js';
2
3
  import PlannerCommand from '../../../base/PlannerCommand.js';
3
4
  import commands from '../../commands.js';
5
+ const options = globalOptionsZod.strict();
4
6
  class PlannerTenantSettingsListCommand extends PlannerCommand {
5
7
  get name() {
6
8
  return commands.TENANT_SETTINGS_LIST;
@@ -8,6 +10,9 @@ class PlannerTenantSettingsListCommand extends PlannerCommand {
8
10
  get description() {
9
11
  return 'Lists the Microsoft Planner configuration of the tenant';
10
12
  }
13
+ get schema() {
14
+ return options;
15
+ }
11
16
  async commandAction(logger) {
12
17
  const requestOptions = {
13
18
  url: `${this.resource}/taskAPI/tenantAdminSettings/Settings`,
@@ -45,7 +45,7 @@ class PpSolutionPublisherGetCommand extends PowerPlatformCommand {
45
45
  const result = await request.get(requestOptions);
46
46
  return result;
47
47
  }
48
- requestOptions.url = `${dynamicsApiUrl}/api/data/v9.0/publishers?$filter=friendlyname eq \'${args.options.name}\'&$select=publisherid,uniquename,friendlyname,versionnumber,isreadonly,description,customizationprefix,customizationoptionvalueprefix&api-version=9.1`;
48
+ requestOptions.url = `${dynamicsApiUrl}/api/data/v9.0/publishers?$filter=friendlyname eq '${args.options.name}'&$select=publisherid,uniquename,friendlyname,versionnumber,isreadonly,description,customizationprefix,customizationoptionvalueprefix&api-version=9.1`;
49
49
  const result = await request.get(requestOptions);
50
50
  if (result.value.length === 0) {
51
51
  throw `The specified publisher '${args.options.name}' does not exist.`;
@@ -1,6 +1,8 @@
1
+ import { globalOptionsZod } from '../../../../Command.js';
1
2
  import { odata } from '../../../../utils/odata.js';
2
3
  import GraphCommand from '../../../base/GraphCommand.js';
3
4
  import commands from '../../commands.js';
5
+ const options = globalOptionsZod.strict();
4
6
  class PurviewRetentionEventTypeListCommand extends GraphCommand {
5
7
  get name() {
6
8
  return commands.RETENTIONEVENTTYPE_LIST;
@@ -8,6 +10,9 @@ class PurviewRetentionEventTypeListCommand extends GraphCommand {
8
10
  get description() {
9
11
  return 'Get a list of retention event types';
10
12
  }
13
+ get schema() {
14
+ return options;
15
+ }
11
16
  defaultProperties() {
12
17
  return ['id', 'displayName', 'createdDateTime'];
13
18
  }
@@ -1,6 +1,8 @@
1
+ import { globalOptionsZod } from '../../../../Command.js';
1
2
  import { odata } from '../../../../utils/odata.js';
2
3
  import GraphCommand from '../../../base/GraphCommand.js';
3
4
  import commands from '../../commands.js';
5
+ const options = globalOptionsZod.strict();
4
6
  class PurviewRetentionLabelListCommand extends GraphCommand {
5
7
  get name() {
6
8
  return commands.RETENTIONLABEL_LIST;
@@ -8,6 +10,9 @@ class PurviewRetentionLabelListCommand extends GraphCommand {
8
10
  get description() {
9
11
  return 'Get a list of retention labels';
10
12
  }
13
+ get schema() {
14
+ return options;
15
+ }
11
16
  defaultProperties() {
12
17
  return ['id', 'displayName', 'isInUse'];
13
18
  }
@@ -128,6 +128,7 @@ class SpfxPackageGenerateCommand extends AnonymousCommand {
128
128
  error = err.message;
129
129
  }
130
130
  finally {
131
+ /* eslint-disable no-unsafe-finally */
131
132
  try {
132
133
  if (tmpDir) {
133
134
  if (this.verbose) {
@@ -145,10 +146,11 @@ class SpfxPackageGenerateCommand extends AnonymousCommand {
145
146
  }
146
147
  throw `An error has occurred while removing the temp folder at ${tmpDir}. Please remove it manually.`;
147
148
  }
149
+ /* eslint-enable no-unsafe-finally */
148
150
  }
149
151
  }
150
152
  static replaceTokens(s, tokens) {
151
- return s.replace(/\$([^\$]+)\$/g, (substring, token) => {
153
+ return s.replace(/\$([^$]+)\$/g, (substring, token) => {
152
154
  if (tokens[token]) {
153
155
  return tokens[token];
154
156
  }
@@ -21,7 +21,9 @@ export class BaseProjectCommand extends AnonymousCommand {
21
21
  source: fs.readFileSync(gitignorePath, 'utf-8')
22
22
  };
23
23
  }
24
- catch { }
24
+ catch {
25
+ // Do nothing
26
+ }
25
27
  }
26
28
  const npmignorePath = path.join(projectRootPath, '.npmignore');
27
29
  if (fs.existsSync(npmignorePath)) {
@@ -30,7 +32,9 @@ export class BaseProjectCommand extends AnonymousCommand {
30
32
  source: fs.readFileSync(npmignorePath, 'utf-8')
31
33
  };
32
34
  }
33
- catch { }
35
+ catch {
36
+ // Do nothing
37
+ }
34
38
  }
35
39
  this.readAndParseJsonFile(path.join(projectRootPath, 'config', 'config.json'), project, 'configJson');
36
40
  this.readAndParseJsonFile(path.join(projectRootPath, 'config', 'copy-assets.json'), project, 'copyAssetsJson');
@@ -108,7 +112,9 @@ export class BaseProjectCommand extends AnonymousCommand {
108
112
  }
109
113
  }
110
114
  }
111
- catch { }
115
+ catch {
116
+ // Do nothing
117
+ }
112
118
  }
113
119
  const packageJsonPath = path.resolve(this.projectRootPath, 'package.json');
114
120
  try {
@@ -117,10 +123,12 @@ export class BaseProjectCommand extends AnonymousCommand {
117
123
  packageJson.dependencies &&
118
124
  packageJson.dependencies['@microsoft/sp-core-library']) {
119
125
  const coreLibVersion = packageJson.dependencies['@microsoft/sp-core-library'];
120
- return coreLibVersion.replace(/[^0-9\.]/g, '');
126
+ return coreLibVersion.replace(/[^0-9.]/g, '');
121
127
  }
122
128
  }
123
- catch { }
129
+ catch {
130
+ // Do nothing
131
+ }
124
132
  return undefined;
125
133
  }
126
134
  readAndParseJsonFile(filePath, project, keyPath) {
@@ -54,7 +54,7 @@ export class FN021007_PKG_only_one_rush_stack_compiler_installed extends JsonRul
54
54
  if (!tsConfigExtends) {
55
55
  return;
56
56
  }
57
- const match = /@microsoft\/rush-stack-compiler[^\/]+/.exec(tsConfigExtends);
57
+ const match = /@microsoft\/rush-stack-compiler[^/]+/.exec(tsConfigExtends);
58
58
  if (!match) {
59
59
  return;
60
60
  }
@@ -64,7 +64,7 @@ export class PnPJsRule extends BasicDependencyRule {
64
64
  fileEdits.push(...files.map(x => ({
65
65
  action: "add",
66
66
  path: x,
67
- targetValue: 'require(\"tslib\");'
67
+ targetValue: 'require("tslib");'
68
68
  })));
69
69
  }
70
70
  return { entries: findings, suggestions: fileEdits };
@@ -82,9 +82,11 @@ export class PnPJsRule extends BasicDependencyRule {
82
82
  ...moduleConfiguration,
83
83
  path: `https://unpkg.com/${moduleConfiguration.key}@${version}/dist/${moduleName.replace('@pnp/', '')}.es5.umd${moduleName === '@pnp/common' || moduleName === ' @pnp/pnpjs' ? '.bundle' : ''}.min.js`
84
84
  });
85
- moduleConfiguration.globalDependencies && moduleConfiguration.globalDependencies.forEach(dependency => {
86
- result.push(...this.getModuleAndParents(project, `@${dependency.replace('/', '.')}`));
87
- });
85
+ if (moduleConfiguration.globalDependencies) {
86
+ moduleConfiguration.globalDependencies.forEach(dependency => {
87
+ result.push(...this.getModuleAndParents(project, `@${dependency.replace('/', '.')}`));
88
+ });
89
+ }
88
90
  }
89
91
  }
90
92
  return result;
@@ -5,7 +5,9 @@ export class ScssFile {
5
5
  try {
6
6
  this._source = fs.readFileSync(this.path, 'utf-8');
7
7
  }
8
- catch { }
8
+ catch {
9
+ // Do nothing
10
+ }
9
11
  }
10
12
  return this._source;
11
13
  }
@@ -11,7 +11,9 @@ export class TsFile {
11
11
  try {
12
12
  this._sourceFile = tsUtil.createSourceFile(path.basename(this.path), this.source, ts.ScriptTarget.Latest, true);
13
13
  }
14
- catch { }
14
+ catch {
15
+ // Do nothing
16
+ }
15
17
  }
16
18
  return this._sourceFile;
17
19
  }
@@ -29,7 +31,9 @@ export class TsFile {
29
31
  try {
30
32
  this._source = fs.readFileSync(this.path, 'utf-8');
31
33
  }
32
- catch { }
34
+ catch {
35
+ // Do nothing
36
+ }
33
37
  }
34
38
  return this._source;
35
39
  }
@@ -352,7 +352,7 @@ export default [
352
352
  // STANDARDIZED BY: eslint\\conf\\eslint-recommended.js
353
353
  'no-with': 2,
354
354
  // RATIONALE: Makes logic easier to understand, since constants always have a known value
355
- // @typescript-eslint\eslint-plugin\dist\configs\eslint-recommended.js
355
+ // @typescript-eslint\\eslint-plugin\\dist\\configs\\eslint-recommended.js
356
356
  'prefer-const': 1,
357
357
  // RATIONALE: Catches a common coding mistake where "resolve" and "reject" are confused.
358
358
  'promise/param-names': 2,
@@ -25,6 +25,7 @@ import { FN002001_DEVDEP_microsoft_sp_build_web } from "./rules/FN002001_DEVDEP_
25
25
  import { FN002002_DEVDEP_microsoft_sp_module_interfaces } from "./rules/FN002002_DEVDEP_microsoft_sp_module_interfaces.js";
26
26
  import { FN002015_DEVDEP_types_react } from "./rules/FN002015_DEVDEP_types_react.js";
27
27
  import { FN002016_DEVDEP_types_react_dom } from "./rules/FN002016_DEVDEP_types_react_dom.js";
28
+ import { FN002019_DEVDEP_spfx_fast_serve_helpers } from "./rules/FN002019_DEVDEP_spfx_fast_serve_helpers.js";
28
29
  import { FN002022_DEVDEP_microsoft_eslint_plugin_spfx } from "./rules/FN002022_DEVDEP_microsoft_eslint_plugin_spfx.js";
29
30
  import { FN002023_DEVDEP_microsoft_eslint_config_spfx } from "./rules/FN002023_DEVDEP_microsoft_eslint_config_spfx.js";
30
31
  import { FN010001_YORC_version } from "./rules/FN010001_YORC_version.js";
@@ -64,6 +65,7 @@ export default [
64
65
  new FN002002_DEVDEP_microsoft_sp_module_interfaces('1.16.0'),
65
66
  new FN002015_DEVDEP_types_react('17.0.45'),
66
67
  new FN002016_DEVDEP_types_react_dom('17.0.17'),
68
+ new FN002019_DEVDEP_spfx_fast_serve_helpers('1.16.6'),
67
69
  new FN010001_YORC_version('1.16.0'),
68
70
  new FN010008_YORC_nodeVersion(),
69
71
  new FN010009_YORC_sdkVersions_microsoft_graph_client('3.0.2'),