@pnp/cli-microsoft365 7.0.0-beta.9229cf8 → 7.0.0-beta.99e75a7

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 (135) hide show
  1. package/.eslintrc.cjs +1 -1
  2. package/dist/Auth.js +2 -1
  3. package/dist/Command.js +1 -1
  4. package/dist/m365/aad/commands/{o365group/o365group-add.js → m365group/m365group-add.js} +17 -17
  5. package/dist/m365/aad/commands/{o365group/o365group-conversation-list.js → m365group/m365group-conversation-list.js} +10 -10
  6. package/dist/m365/aad/commands/{o365group/o365group-conversation-post-list.js → m365group/m365group-conversation-post-list.js} +14 -14
  7. package/dist/m365/aad/commands/{o365group/o365group-get.js → m365group/m365group-get.js} +13 -10
  8. package/dist/m365/aad/commands/{o365group/o365group-list.js → m365group/m365group-list.js} +13 -28
  9. package/dist/m365/aad/commands/{o365group/o365group-recyclebinitem-clear.js → m365group/m365group-recyclebinitem-clear.js} +15 -15
  10. package/dist/m365/aad/commands/{o365group/o365group-recyclebinitem-list.js → m365group/m365group-recyclebinitem-list.js} +10 -10
  11. package/dist/m365/aad/commands/{o365group/o365group-recyclebinitem-remove.js → m365group/m365group-recyclebinitem-remove.js} +14 -14
  12. package/dist/m365/aad/commands/{o365group/o365group-recyclebinitem-restore.js → m365group/m365group-recyclebinitem-restore.js} +14 -14
  13. package/dist/m365/aad/commands/{o365group/o365group-remove.js → m365group/m365group-remove.js} +12 -12
  14. package/dist/m365/aad/commands/{o365group/o365group-renew.js → m365group/m365group-renew.js} +10 -10
  15. package/dist/m365/aad/commands/{o365group/o365group-report-activitycounts.js → m365group/m365group-report-activitycounts.js} +4 -4
  16. package/dist/m365/aad/commands/{o365group/o365group-report-activitydetail.js → m365group/m365group-report-activitydetail.js} +4 -4
  17. package/dist/m365/aad/commands/{o365group/o365group-report-activityfilecounts.js → m365group/m365group-report-activityfilecounts.js} +4 -4
  18. package/dist/m365/aad/commands/{o365group/o365group-report-activitygroupcounts.js → m365group/m365group-report-activitygroupcounts.js} +4 -4
  19. package/dist/m365/aad/commands/{o365group/o365group-report-activitystorage.js → m365group/m365group-report-activitystorage.js} +4 -4
  20. package/dist/m365/aad/commands/{o365group/o365group-set.js → m365group/m365group-set.js} +17 -17
  21. package/dist/m365/aad/commands/{o365group/o365group-teamify.js → m365group/m365group-teamify.js} +14 -14
  22. package/dist/m365/aad/commands/{o365group/o365group-user-add.js → m365group/m365group-user-add.js} +14 -14
  23. package/dist/m365/aad/commands/{o365group/o365group-user-list.js → m365group/m365group-user-list.js} +12 -12
  24. package/dist/m365/aad/commands/{o365group/o365group-user-remove.js → m365group/m365group-user-remove.js} +14 -14
  25. package/dist/m365/aad/commands/{o365group/o365group-user-set.js → m365group/m365group-user-set.js} +15 -15
  26. package/dist/m365/aad/commands.js +22 -22
  27. package/dist/m365/pa/commands/app/app-permission-ensure.js +162 -0
  28. package/dist/m365/pa/commands/app/app-permission-list.js +2 -2
  29. package/dist/m365/pa/commands/app/app-permission-remove.js +153 -0
  30. package/dist/m365/pa/commands.js +2 -0
  31. package/dist/m365/spfx/commands/project/project-externalize/rules/PnPJsRule.js +2 -2
  32. package/dist/m365/spfx/commands/spfx-doctor.js +73 -103
  33. package/dist/m365/spo/commands/file/file-add.js +13 -13
  34. package/dist/m365/spo/commands/file/file-checkin.js +1 -1
  35. package/dist/m365/spo/commands/file/file-checkout.js +1 -1
  36. package/dist/m365/spo/commands/file/file-copy.js +36 -4
  37. package/dist/m365/spo/commands/file/file-list.js +4 -4
  38. package/dist/m365/spo/commands/file/file-move.js +2 -2
  39. package/dist/m365/spo/commands/file/file-remove.js +6 -6
  40. package/dist/m365/spo/commands/file/file-rename.js +2 -2
  41. package/dist/m365/spo/commands/file/file-retentionlabel-ensure.js +1 -1
  42. package/dist/m365/spo/commands/file/file-retentionlabel-remove.js +1 -1
  43. package/dist/m365/spo/commands/file/file-roleassignment-add.js +1 -1
  44. package/dist/m365/spo/commands/file/file-roleassignment-remove.js +1 -1
  45. package/dist/m365/spo/commands/file/file-roleinheritance-break.js +1 -1
  46. package/dist/m365/spo/commands/file/file-roleinheritance-reset.js +1 -1
  47. package/dist/m365/spo/commands/file/file-version-clear.js +1 -1
  48. package/dist/m365/spo/commands/file/file-version-get.js +1 -1
  49. package/dist/m365/spo/commands/file/file-version-list.js +1 -1
  50. package/dist/m365/spo/commands/file/file-version-remove.js +1 -1
  51. package/dist/m365/spo/commands/file/file-version-restore.js +1 -1
  52. package/dist/m365/spo/commands/folder/folder-add.js +2 -4
  53. package/dist/m365/spo/commands/folder/folder-get.js +1 -1
  54. package/dist/m365/spo/commands/folder/folder-list.js +2 -2
  55. package/dist/m365/spo/commands/folder/folder-remove.js +7 -4
  56. package/dist/m365/spo/commands/folder/folder-rename.js +13 -17
  57. package/dist/m365/spo/commands/folder/folder-retentionlabel-ensure.js +1 -1
  58. package/dist/m365/spo/commands/folder/folder-retentionlabel-remove.js +1 -1
  59. package/dist/m365/spo/commands/folder/folder-roleassignment-add.js +1 -1
  60. package/dist/m365/spo/commands/folder/folder-roleassignment-remove.js +1 -1
  61. package/dist/m365/spo/commands/folder/folder-roleinheritance-break.js +1 -1
  62. package/dist/m365/spo/commands/folder/folder-roleinheritance-reset.js +1 -1
  63. package/dist/m365/spo/commands/group/group-list.js +0 -1
  64. package/dist/m365/spo/commands/site/site-set.js +2 -2
  65. package/dist/m365/spo/commands/theme/theme-list.js +1 -9
  66. package/dist/utils/spo.js +1 -1
  67. package/docs/docs/cmd/aad/{o365group/o365group-add.mdx → m365group/m365group-add.mdx} +13 -13
  68. package/docs/docs/cmd/aad/{o365group/o365group-conversation-list.mdx → m365group/m365group-conversation-list.mdx} +4 -4
  69. package/docs/docs/cmd/aad/{o365group/o365group-conversation-post-list.mdx → m365group/m365group-conversation-post-list.mdx} +8 -8
  70. package/docs/docs/cmd/aad/{o365group/o365group-get.mdx → m365group/m365group-get.mdx} +6 -6
  71. package/docs/docs/cmd/aad/{o365group/o365group-list.mdx → m365group/m365group-list.mdx} +12 -29
  72. package/docs/docs/cmd/aad/{o365group/o365group-recyclebinitem-clear.mdx → m365group/m365group-recyclebinitem-clear.mdx} +5 -5
  73. package/docs/docs/cmd/aad/{o365group/o365group-recyclebinitem-list.mdx → m365group/m365group-recyclebinitem-list.mdx} +8 -8
  74. package/docs/docs/cmd/aad/{o365group/o365group-recyclebinitem-remove.mdx → m365group/m365group-recyclebinitem-remove.mdx} +6 -6
  75. package/docs/docs/cmd/aad/{o365group/o365group-recyclebinitem-restore.mdx → m365group/m365group-recyclebinitem-restore.mdx} +6 -6
  76. package/docs/docs/cmd/aad/{o365group/o365group-remove.mdx → m365group/m365group-remove.mdx} +6 -6
  77. package/docs/docs/cmd/aad/{o365group/o365group-renew.mdx → m365group/m365group-renew.mdx} +4 -4
  78. package/docs/docs/cmd/aad/{o365group/o365group-report-activitycounts.mdx → m365group/m365group-report-activitycounts.mdx} +6 -6
  79. package/docs/docs/cmd/aad/{o365group/o365group-report-activitydetail.mdx → m365group/m365group-report-activitydetail.mdx} +7 -7
  80. package/docs/docs/cmd/aad/{o365group/o365group-report-activityfilecounts.mdx → m365group/m365group-report-activityfilecounts.mdx} +6 -6
  81. package/docs/docs/cmd/aad/{o365group/o365group-report-activitygroupcounts.mdx → m365group/m365group-report-activitygroupcounts.mdx} +6 -6
  82. package/docs/docs/cmd/aad/{o365group/o365group-report-activitystorage.mdx → m365group/m365group-report-activitystorage.mdx} +6 -6
  83. package/docs/docs/cmd/aad/{o365group/o365group-set.mdx → m365group/m365group-set.mdx} +8 -8
  84. package/docs/docs/cmd/aad/{o365group/o365group-teamify.mdx → m365group/m365group-teamify.mdx} +5 -5
  85. package/docs/docs/cmd/aad/{o365group/o365group-user-add.mdx → m365group/m365group-user-add.mdx} +5 -5
  86. package/docs/docs/cmd/aad/{o365group/o365group-user-list.mdx → m365group/m365group-user-list.mdx} +7 -7
  87. package/docs/docs/cmd/aad/{o365group/o365group-user-remove.mdx → m365group/m365group-user-remove.mdx} +5 -5
  88. package/docs/docs/cmd/aad/{o365group/o365group-user-set.mdx → m365group/m365group-user-set.mdx} +5 -5
  89. package/docs/docs/cmd/pa/app/app-permission-ensure.mdx +85 -0
  90. package/docs/docs/cmd/pa/app/app-permission-remove.mdx +74 -0
  91. package/docs/docs/cmd/planner/plan/plan-add.mdx +1 -1
  92. package/docs/docs/cmd/spo/file/file-add.mdx +1 -1
  93. package/docs/docs/cmd/spo/file/file-checkin.mdx +1 -1
  94. package/docs/docs/cmd/spo/file/file-checkout-undo.mdx +1 -9
  95. package/docs/docs/cmd/spo/file/file-checkout.mdx +1 -1
  96. package/docs/docs/cmd/spo/file/file-copy.mdx +20 -16
  97. package/docs/docs/cmd/spo/file/file-get.mdx +1 -1
  98. package/docs/docs/cmd/spo/file/file-list.mdx +2 -2
  99. package/docs/docs/cmd/spo/file/file-move.mdx +2 -2
  100. package/docs/docs/cmd/spo/file/file-remove.mdx +8 -8
  101. package/docs/docs/cmd/spo/file/file-rename.mdx +3 -3
  102. package/docs/docs/cmd/spo/file/file-retentionlabel-ensure.mdx +2 -2
  103. package/docs/docs/cmd/spo/file/file-retentionlabel-remove.mdx +3 -3
  104. package/docs/docs/cmd/spo/file/file-roleassignment-add.mdx +1 -1
  105. package/docs/docs/cmd/spo/file/file-roleassignment-remove.mdx +1 -1
  106. package/docs/docs/cmd/spo/file/file-roleinheritance-break.mdx +1 -1
  107. package/docs/docs/cmd/spo/file/file-roleinheritance-reset.mdx +1 -1
  108. package/docs/docs/cmd/spo/file/file-sharinginfo-get.mdx +1 -1
  109. package/docs/docs/cmd/spo/file/file-sharinglink-add.mdx +1 -1
  110. package/docs/docs/cmd/spo/file/file-sharinglink-clear.mdx +1 -1
  111. package/docs/docs/cmd/spo/file/file-sharinglink-get.mdx +1 -1
  112. package/docs/docs/cmd/spo/file/file-sharinglink-list.mdx +1 -1
  113. package/docs/docs/cmd/spo/file/file-sharinglink-remove.mdx +1 -1
  114. package/docs/docs/cmd/spo/file/file-sharinglink-set.mdx +1 -1
  115. package/docs/docs/cmd/spo/file/file-version-clear.mdx +1 -1
  116. package/docs/docs/cmd/spo/file/file-version-get.mdx +1 -1
  117. package/docs/docs/cmd/spo/file/file-version-list.mdx +1 -1
  118. package/docs/docs/cmd/spo/file/file-version-remove.mdx +1 -1
  119. package/docs/docs/cmd/spo/file/file-version-restore.mdx +1 -1
  120. package/docs/docs/cmd/spo/folder/folder-add.mdx +76 -1
  121. package/docs/docs/cmd/spo/folder/folder-get.mdx +1 -1
  122. package/docs/docs/cmd/spo/folder/folder-list.mdx +1 -1
  123. package/docs/docs/cmd/spo/folder/folder-remove.mdx +1 -1
  124. package/docs/docs/cmd/spo/folder/folder-rename.mdx +5 -1
  125. package/docs/docs/cmd/spo/folder/folder-retentionlabel-ensure.mdx +1 -1
  126. package/docs/docs/cmd/spo/folder/folder-retentionlabel-remove.mdx +1 -1
  127. package/docs/docs/cmd/spo/folder/folder-roleassignment-add.mdx +2 -2
  128. package/docs/docs/cmd/spo/folder/folder-roleassignment-remove.mdx +1 -1
  129. package/docs/docs/cmd/spo/folder/folder-roleinheritance-break.mdx +1 -1
  130. package/docs/docs/cmd/spo/folder/folder-roleinheritance-reset.mdx +1 -1
  131. package/docs/docs/cmd/spo/site/site-add.mdx +1 -1
  132. package/docs/docs/cmd/teams/team/team-add.mdx +1 -1
  133. package/npm-shrinkwrap.json +142 -88
  134. package/package.json +13 -13
  135. /package/dist/m365/aad/commands/{o365group → m365group}/GroupExtended.js +0 -0
@@ -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 _AadO365GroupUserRemoveCommand_instances, _AadO365GroupUserRemoveCommand_initTelemetry, _AadO365GroupUserRemoveCommand_initOptions, _AadO365GroupUserRemoveCommand_initValidators, _AadO365GroupUserRemoveCommand_initOptionSets;
6
+ var _AadM365GroupUserRemoveCommand_instances, _AadM365GroupUserRemoveCommand_initTelemetry, _AadM365GroupUserRemoveCommand_initOptions, _AadM365GroupUserRemoveCommand_initValidators, _AadM365GroupUserRemoveCommand_initOptionSets;
7
7
  import { Cli } from '../../../../cli/Cli.js';
8
8
  import request from '../../../../request.js';
9
9
  import { formatting } from '../../../../utils/formatting.js';
@@ -11,9 +11,9 @@ import { validation } from '../../../../utils/validation.js';
11
11
  import GraphCommand from '../../../base/GraphCommand.js';
12
12
  import teamsCommands from '../../../teams/commands.js';
13
13
  import commands from '../../commands.js';
14
- class AadO365GroupUserRemoveCommand extends GraphCommand {
14
+ class AadM365GroupUserRemoveCommand extends GraphCommand {
15
15
  get name() {
16
- return commands.O365GROUP_USER_REMOVE;
16
+ return commands.M365GROUP_USER_REMOVE;
17
17
  }
18
18
  get description() {
19
19
  return 'Removes the specified user from specified Microsoft 365 Group or Microsoft Teams team';
@@ -23,11 +23,11 @@ class AadO365GroupUserRemoveCommand extends GraphCommand {
23
23
  }
24
24
  constructor() {
25
25
  super();
26
- _AadO365GroupUserRemoveCommand_instances.add(this);
27
- __classPrivateFieldGet(this, _AadO365GroupUserRemoveCommand_instances, "m", _AadO365GroupUserRemoveCommand_initTelemetry).call(this);
28
- __classPrivateFieldGet(this, _AadO365GroupUserRemoveCommand_instances, "m", _AadO365GroupUserRemoveCommand_initOptions).call(this);
29
- __classPrivateFieldGet(this, _AadO365GroupUserRemoveCommand_instances, "m", _AadO365GroupUserRemoveCommand_initValidators).call(this);
30
- __classPrivateFieldGet(this, _AadO365GroupUserRemoveCommand_instances, "m", _AadO365GroupUserRemoveCommand_initOptionSets).call(this);
26
+ _AadM365GroupUserRemoveCommand_instances.add(this);
27
+ __classPrivateFieldGet(this, _AadM365GroupUserRemoveCommand_instances, "m", _AadM365GroupUserRemoveCommand_initTelemetry).call(this);
28
+ __classPrivateFieldGet(this, _AadM365GroupUserRemoveCommand_instances, "m", _AadM365GroupUserRemoveCommand_initOptions).call(this);
29
+ __classPrivateFieldGet(this, _AadM365GroupUserRemoveCommand_instances, "m", _AadM365GroupUserRemoveCommand_initValidators).call(this);
30
+ __classPrivateFieldGet(this, _AadM365GroupUserRemoveCommand_instances, "m", _AadM365GroupUserRemoveCommand_initOptionSets).call(this);
31
31
  }
32
32
  async commandAction(logger, args) {
33
33
  const groupId = (typeof args.options.groupId !== 'undefined') ? args.options.groupId : args.options.teamId;
@@ -99,7 +99,7 @@ class AadO365GroupUserRemoveCommand extends GraphCommand {
99
99
  }
100
100
  }
101
101
  }
102
- _AadO365GroupUserRemoveCommand_instances = new WeakSet(), _AadO365GroupUserRemoveCommand_initTelemetry = function _AadO365GroupUserRemoveCommand_initTelemetry() {
102
+ _AadM365GroupUserRemoveCommand_instances = new WeakSet(), _AadM365GroupUserRemoveCommand_initTelemetry = function _AadM365GroupUserRemoveCommand_initTelemetry() {
103
103
  this.telemetry.push((args) => {
104
104
  Object.assign(this.telemetryProperties, {
105
105
  force: (!(!args.options.force)).toString(),
@@ -107,7 +107,7 @@ _AadO365GroupUserRemoveCommand_instances = new WeakSet(), _AadO365GroupUserRemov
107
107
  groupId: typeof args.options.groupId !== 'undefined'
108
108
  });
109
109
  });
110
- }, _AadO365GroupUserRemoveCommand_initOptions = function _AadO365GroupUserRemoveCommand_initOptions() {
110
+ }, _AadM365GroupUserRemoveCommand_initOptions = function _AadM365GroupUserRemoveCommand_initOptions() {
111
111
  this.options.unshift({
112
112
  option: "-i, --groupId [groupId]"
113
113
  }, {
@@ -117,7 +117,7 @@ _AadO365GroupUserRemoveCommand_instances = new WeakSet(), _AadO365GroupUserRemov
117
117
  }, {
118
118
  option: '-f, --force'
119
119
  });
120
- }, _AadO365GroupUserRemoveCommand_initValidators = function _AadO365GroupUserRemoveCommand_initValidators() {
120
+ }, _AadM365GroupUserRemoveCommand_initValidators = function _AadM365GroupUserRemoveCommand_initValidators() {
121
121
  this.validators.push(async (args) => {
122
122
  if (args.options.teamId && !validation.isValidGuid(args.options.teamId)) {
123
123
  return `${args.options.teamId} is not a valid GUID`;
@@ -127,8 +127,8 @@ _AadO365GroupUserRemoveCommand_instances = new WeakSet(), _AadO365GroupUserRemov
127
127
  }
128
128
  return true;
129
129
  });
130
- }, _AadO365GroupUserRemoveCommand_initOptionSets = function _AadO365GroupUserRemoveCommand_initOptionSets() {
130
+ }, _AadM365GroupUserRemoveCommand_initOptionSets = function _AadM365GroupUserRemoveCommand_initOptionSets() {
131
131
  this.optionSets.push({ options: ['groupId', 'teamId'] });
132
132
  };
133
- export default new AadO365GroupUserRemoveCommand();
134
- //# sourceMappingURL=o365group-user-remove.js.map
133
+ export default new AadM365GroupUserRemoveCommand();
134
+ //# sourceMappingURL=m365group-user-remove.js.map
@@ -3,16 +3,16 @@ 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 _AadO365GroupUserSetCommand_instances, _AadO365GroupUserSetCommand_initTelemetry, _AadO365GroupUserSetCommand_initOptions, _AadO365GroupUserSetCommand_initValidators, _AadO365GroupUserSetCommand_initOptionSets;
6
+ var _AadM365GroupUserSetCommand_instances, _AadM365GroupUserSetCommand_initTelemetry, _AadM365GroupUserSetCommand_initOptions, _AadM365GroupUserSetCommand_initValidators, _AadM365GroupUserSetCommand_initOptionSets;
7
7
  import request from '../../../../request.js';
8
8
  import { odata } from '../../../../utils/odata.js';
9
9
  import { validation } from '../../../../utils/validation.js';
10
10
  import GraphCommand from '../../../base/GraphCommand.js';
11
11
  import teamsCommands from '../../../teams/commands.js';
12
12
  import commands from '../../commands.js';
13
- class AadO365GroupUserSetCommand extends GraphCommand {
13
+ class AadM365GroupUserSetCommand extends GraphCommand {
14
14
  get name() {
15
- return commands.O365GROUP_USER_SET;
15
+ return commands.M365GROUP_USER_SET;
16
16
  }
17
17
  get description() {
18
18
  return 'Updates role of the specified user in the specified Microsoft 365 Group or Microsoft Teams team';
@@ -22,11 +22,11 @@ class AadO365GroupUserSetCommand extends GraphCommand {
22
22
  }
23
23
  constructor() {
24
24
  super();
25
- _AadO365GroupUserSetCommand_instances.add(this);
26
- __classPrivateFieldGet(this, _AadO365GroupUserSetCommand_instances, "m", _AadO365GroupUserSetCommand_initTelemetry).call(this);
27
- __classPrivateFieldGet(this, _AadO365GroupUserSetCommand_instances, "m", _AadO365GroupUserSetCommand_initOptions).call(this);
28
- __classPrivateFieldGet(this, _AadO365GroupUserSetCommand_instances, "m", _AadO365GroupUserSetCommand_initValidators).call(this);
29
- __classPrivateFieldGet(this, _AadO365GroupUserSetCommand_instances, "m", _AadO365GroupUserSetCommand_initOptionSets).call(this);
25
+ _AadM365GroupUserSetCommand_instances.add(this);
26
+ __classPrivateFieldGet(this, _AadM365GroupUserSetCommand_instances, "m", _AadM365GroupUserSetCommand_initTelemetry).call(this);
27
+ __classPrivateFieldGet(this, _AadM365GroupUserSetCommand_instances, "m", _AadM365GroupUserSetCommand_initOptions).call(this);
28
+ __classPrivateFieldGet(this, _AadM365GroupUserSetCommand_instances, "m", _AadM365GroupUserSetCommand_initValidators).call(this);
29
+ __classPrivateFieldGet(this, _AadM365GroupUserSetCommand_instances, "m", _AadM365GroupUserSetCommand_initOptionSets).call(this);
30
30
  }
31
31
  async commandAction(logger, args) {
32
32
  try {
@@ -43,7 +43,7 @@ class AadO365GroupUserSetCommand extends GraphCommand {
43
43
  }
44
44
  if (users.filter(i => args.options.userName.toUpperCase() === i.userPrincipalName.toUpperCase()).length <= 0) {
45
45
  const userNotInGroup = (typeof args.options.groupId !== 'undefined') ?
46
- 'The specified user does not belong to the given Microsoft 365 Group. Please use the \'o365group user add\' command to add new users.' :
46
+ 'The specified user does not belong to the given Microsoft 365 Group. Please use the \'m365group user add\' command to add new users.' :
47
47
  'The specified user does not belong to the given Microsoft Teams team. Please use the \'graph teams user add\' command to add new users.';
48
48
  throw new Error(userNotInGroup);
49
49
  }
@@ -113,7 +113,7 @@ class AadO365GroupUserSetCommand extends GraphCommand {
113
113
  return await odata.getAllItems(endpoint);
114
114
  }
115
115
  }
116
- _AadO365GroupUserSetCommand_instances = new WeakSet(), _AadO365GroupUserSetCommand_initTelemetry = function _AadO365GroupUserSetCommand_initTelemetry() {
116
+ _AadM365GroupUserSetCommand_instances = new WeakSet(), _AadM365GroupUserSetCommand_initTelemetry = function _AadM365GroupUserSetCommand_initTelemetry() {
117
117
  this.telemetry.push((args) => {
118
118
  Object.assign(this.telemetryProperties, {
119
119
  teamId: typeof args.options.teamId !== 'undefined',
@@ -121,7 +121,7 @@ _AadO365GroupUserSetCommand_instances = new WeakSet(), _AadO365GroupUserSetComma
121
121
  role: args.options.role
122
122
  });
123
123
  });
124
- }, _AadO365GroupUserSetCommand_initOptions = function _AadO365GroupUserSetCommand_initOptions() {
124
+ }, _AadM365GroupUserSetCommand_initOptions = function _AadM365GroupUserSetCommand_initOptions() {
125
125
  this.options.unshift({
126
126
  option: "-i, --groupId [groupId]"
127
127
  }, {
@@ -132,7 +132,7 @@ _AadO365GroupUserSetCommand_instances = new WeakSet(), _AadO365GroupUserSetComma
132
132
  option: '-r, --role <role>',
133
133
  autocomplete: ['Owner', 'Member']
134
134
  });
135
- }, _AadO365GroupUserSetCommand_initValidators = function _AadO365GroupUserSetCommand_initValidators() {
135
+ }, _AadM365GroupUserSetCommand_initValidators = function _AadM365GroupUserSetCommand_initValidators() {
136
136
  this.validators.push(async (args) => {
137
137
  if (args.options.teamId && !validation.isValidGuid(args.options.teamId)) {
138
138
  return `${args.options.teamId} is not a valid GUID`;
@@ -145,8 +145,8 @@ _AadO365GroupUserSetCommand_instances = new WeakSet(), _AadO365GroupUserSetComma
145
145
  }
146
146
  return true;
147
147
  });
148
- }, _AadO365GroupUserSetCommand_initOptionSets = function _AadO365GroupUserSetCommand_initOptionSets() {
148
+ }, _AadM365GroupUserSetCommand_initOptionSets = function _AadM365GroupUserSetCommand_initOptionSets() {
149
149
  this.optionSets.push({ options: ['groupId', 'teamId'] });
150
150
  };
151
- export default new AadO365GroupUserSetCommand();
152
- //# sourceMappingURL=o365group-user-set.js.map
151
+ export default new AadM365GroupUserSetCommand();
152
+ //# sourceMappingURL=m365group-user-set.js.map
@@ -21,28 +21,28 @@ export default {
21
21
  GROUPSETTINGTEMPLATE_GET: `${prefix} groupsettingtemplate get`,
22
22
  GROUPSETTINGTEMPLATE_LIST: `${prefix} groupsettingtemplate list`,
23
23
  LICENSE_LIST: `${prefix} license list`,
24
- O365GROUP_ADD: `${prefix} o365group add`,
25
- O365GROUP_GET: `${prefix} o365group get`,
26
- O365GROUP_LIST: `${prefix} o365group list`,
27
- O365GROUP_CONVERSATION_LIST: `${prefix} o365group conversation list`,
28
- O365GROUP_CONVERSATION_POST_LIST: `${prefix} o365group conversation post list`,
29
- O365GROUP_RECYCLEBINITEM_CLEAR: `${prefix} o365group recyclebinitem clear`,
30
- O365GROUP_RECYCLEBINITEM_LIST: `${prefix} o365group recyclebinitem list`,
31
- O365GROUP_RECYCLEBINITEM_REMOVE: `${prefix} o365group recyclebinitem remove`,
32
- O365GROUP_RECYCLEBINITEM_RESTORE: `${prefix} o365group recyclebinitem restore`,
33
- O365GROUP_SET: `${prefix} o365group set`,
34
- O365GROUP_TEAMIFY: `${prefix} o365group teamify`,
35
- O365GROUP_REMOVE: `${prefix} o365group remove`,
36
- O365GROUP_RENEW: `${prefix} o365group renew`,
37
- O365GROUP_REPORT_ACTIVITYCOUNTS: `${prefix} o365group report activitycounts`,
38
- O365GROUP_REPORT_ACTIVITYDETAIL: `${prefix} o365group report activitydetail`,
39
- O365GROUP_REPORT_ACTIVITYFILECOUNTS: `${prefix} o365group report activityfilecounts`,
40
- O365GROUP_REPORT_ACTIVITYGROUPCOUNTS: `${prefix} o365group report activitygroupcounts`,
41
- O365GROUP_REPORT_ACTIVITYSTORAGE: `${prefix} o365group report activitystorage`,
42
- O365GROUP_USER_ADD: `${prefix} o365group user add`,
43
- O365GROUP_USER_LIST: `${prefix} o365group user list`,
44
- O365GROUP_USER_REMOVE: `${prefix} o365group user remove`,
45
- O365GROUP_USER_SET: `${prefix} o365group user set`,
24
+ M365GROUP_ADD: `${prefix} m365group add`,
25
+ M365GROUP_GET: `${prefix} m365group get`,
26
+ M365GROUP_LIST: `${prefix} m365group list`,
27
+ M365GROUP_CONVERSATION_LIST: `${prefix} m365group conversation list`,
28
+ M365GROUP_CONVERSATION_POST_LIST: `${prefix} m365group conversation post list`,
29
+ M365GROUP_RECYCLEBINITEM_CLEAR: `${prefix} m365group recyclebinitem clear`,
30
+ M365GROUP_RECYCLEBINITEM_LIST: `${prefix} m365group recyclebinitem list`,
31
+ M365GROUP_RECYCLEBINITEM_REMOVE: `${prefix} m365group recyclebinitem remove`,
32
+ M365GROUP_RECYCLEBINITEM_RESTORE: `${prefix} m365group recyclebinitem restore`,
33
+ M365GROUP_SET: `${prefix} m365group set`,
34
+ M365GROUP_TEAMIFY: `${prefix} m365group teamify`,
35
+ M365GROUP_REMOVE: `${prefix} m365group remove`,
36
+ M365GROUP_RENEW: `${prefix} m365group renew`,
37
+ M365GROUP_REPORT_ACTIVITYCOUNTS: `${prefix} m365group report activitycounts`,
38
+ M365GROUP_REPORT_ACTIVITYDETAIL: `${prefix} m365group report activitydetail`,
39
+ M365GROUP_REPORT_ACTIVITYFILECOUNTS: `${prefix} m365group report activityfilecounts`,
40
+ M365GROUP_REPORT_ACTIVITYGROUPCOUNTS: `${prefix} m365group report activitygroupcounts`,
41
+ M365GROUP_REPORT_ACTIVITYSTORAGE: `${prefix} m365group report activitystorage`,
42
+ M365GROUP_USER_ADD: `${prefix} m365group user add`,
43
+ M365GROUP_USER_LIST: `${prefix} m365group user list`,
44
+ M365GROUP_USER_REMOVE: `${prefix} m365group user remove`,
45
+ M365GROUP_USER_SET: `${prefix} m365group user set`,
46
46
  OAUTH2GRANT_ADD: `${prefix} oauth2grant add`,
47
47
  OAUTH2GRANT_LIST: `${prefix} oauth2grant list`,
48
48
  OAUTH2GRANT_REMOVE: `${prefix} oauth2grant remove`,
@@ -0,0 +1,162 @@
1
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
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
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
+ };
6
+ var _PaAppPermissionEnsureCommand_instances, _PaAppPermissionEnsureCommand_initTelemetry, _PaAppPermissionEnsureCommand_initOptions, _PaAppPermissionEnsureCommand_initValidators, _PaAppPermissionEnsureCommand_initOptionSets, _PaAppPermissionEnsureCommand_initTypes;
7
+ import Auth from '../../../../Auth.js';
8
+ import request from '../../../../request.js';
9
+ import { aadGroup } from '../../../../utils/aadGroup.js';
10
+ import { aadUser } from '../../../../utils/aadUser.js';
11
+ import { accessToken } from '../../../../utils/accessToken.js';
12
+ import { validation } from '../../../../utils/validation.js';
13
+ import PowerAppsCommand from '../../../base/PowerAppsCommand.js';
14
+ import commands from '../../commands.js';
15
+ class PaAppPermissionEnsureCommand extends PowerAppsCommand {
16
+ get name() {
17
+ return commands.APP_PERMISSION_ENSURE;
18
+ }
19
+ get description() {
20
+ return 'Assigns/updates permissions to a Power Apps app';
21
+ }
22
+ constructor() {
23
+ super();
24
+ _PaAppPermissionEnsureCommand_instances.add(this);
25
+ __classPrivateFieldGet(this, _PaAppPermissionEnsureCommand_instances, "m", _PaAppPermissionEnsureCommand_initTelemetry).call(this);
26
+ __classPrivateFieldGet(this, _PaAppPermissionEnsureCommand_instances, "m", _PaAppPermissionEnsureCommand_initOptions).call(this);
27
+ __classPrivateFieldGet(this, _PaAppPermissionEnsureCommand_instances, "m", _PaAppPermissionEnsureCommand_initValidators).call(this);
28
+ __classPrivateFieldGet(this, _PaAppPermissionEnsureCommand_instances, "m", _PaAppPermissionEnsureCommand_initOptionSets).call(this);
29
+ __classPrivateFieldGet(this, _PaAppPermissionEnsureCommand_instances, "m", _PaAppPermissionEnsureCommand_initTypes).call(this);
30
+ }
31
+ async commandAction(logger, args) {
32
+ if (this.verbose) {
33
+ await logger.logToStderr(`Assigning/updating permissions for '${args.options.userId || args.options.userName || args.options.groupId || args.options.groupName || (args.options.tenant && 'everyone')}' to the Power Apps app '${args.options.appName}'...`);
34
+ }
35
+ try {
36
+ const principalId = await this.getPrincipalId(args.options);
37
+ const requestOptions = {
38
+ url: `${this.resource}/providers/Microsoft.PowerApps/${args.options.asAdmin ? `scopes/admin/environments/${args.options.environmentName}/` : ''}apps/${args.options.appName}/modifyPermissions?api-version=2022-11-01`,
39
+ headers: {
40
+ accept: 'application/json'
41
+ },
42
+ data: {
43
+ put: [
44
+ {
45
+ properties: {
46
+ principal: {
47
+ id: principalId,
48
+ type: this.getPrincipalType(args.options)
49
+ },
50
+ NotifyShareTargetOption: args.options.sendInvitationMail ? 'Notify' : 'DoNotNotify',
51
+ roleName: args.options.roleName
52
+ }
53
+ }
54
+ ]
55
+ },
56
+ responseType: 'json'
57
+ };
58
+ await request.post(requestOptions);
59
+ }
60
+ catch (err) {
61
+ this.handleRejectedODataJsonPromise(err);
62
+ }
63
+ }
64
+ getPrincipalType(options) {
65
+ if (options.userId || options.userName) {
66
+ return 'User';
67
+ }
68
+ if (options.groupId || options.groupName) {
69
+ return 'Group';
70
+ }
71
+ return 'Tenant';
72
+ }
73
+ async getPrincipalId(options) {
74
+ if (options.groupId) {
75
+ return options.groupId;
76
+ }
77
+ if (options.userId) {
78
+ return options.userId;
79
+ }
80
+ if (options.groupName) {
81
+ const group = await aadGroup.getGroupByDisplayName(options.groupName);
82
+ return group.id;
83
+ }
84
+ if (options.userName) {
85
+ const userId = await aadUser.getUserIdByUpn(options.userName);
86
+ return userId;
87
+ }
88
+ return accessToken.getTenantIdFromAccessToken(Auth.service.accessTokens[Auth.defaultResource].accessToken);
89
+ }
90
+ }
91
+ _PaAppPermissionEnsureCommand_instances = new WeakSet(), _PaAppPermissionEnsureCommand_initTelemetry = function _PaAppPermissionEnsureCommand_initTelemetry() {
92
+ this.telemetry.push((args) => {
93
+ Object.assign(this.telemetryProperties, {
94
+ userId: typeof args.options.userId !== 'undefined',
95
+ userName: typeof args.options.userName !== 'undefined',
96
+ groupId: typeof args.options.groupId !== 'undefined',
97
+ groupName: typeof args.options.groupName !== 'undefined',
98
+ tenant: !!args.options.tenant,
99
+ sendInvitationMail: !!args.options.sendInvitationMail,
100
+ environmentName: typeof args.options.environmentName !== 'undefined',
101
+ asAdmin: !!args.options.asAdmin
102
+ });
103
+ });
104
+ }, _PaAppPermissionEnsureCommand_initOptions = function _PaAppPermissionEnsureCommand_initOptions() {
105
+ this.options.unshift({
106
+ option: '--appName <appName>'
107
+ }, {
108
+ option: '--roleName <roleName>',
109
+ autocomplete: PaAppPermissionEnsureCommand.roleNames
110
+ }, {
111
+ option: '--userId [userId]'
112
+ }, {
113
+ option: '--userName [userName]'
114
+ }, {
115
+ option: '--groupId [groupId]'
116
+ }, {
117
+ option: '--groupName [groupName]'
118
+ }, {
119
+ option: '--tenant'
120
+ }, {
121
+ option: '-e, --environmentName [environmentName]'
122
+ }, {
123
+ option: '--sendInvitationMail'
124
+ }, {
125
+ option: '--asAdmin'
126
+ });
127
+ }, _PaAppPermissionEnsureCommand_initValidators = function _PaAppPermissionEnsureCommand_initValidators() {
128
+ this.validators.push(async (args) => {
129
+ if (!validation.isValidGuid(args.options.appName)) {
130
+ return `${args.options.appName} is not a valid GUID for appName.`;
131
+ }
132
+ if (args.options.userId && !validation.isValidGuid(args.options.userId)) {
133
+ return `${args.options.userId} is not a valid GUID for userId.`;
134
+ }
135
+ if (args.options.groupId && !validation.isValidGuid(args.options.groupId)) {
136
+ return `${args.options.groupId} is not a valid GUID for groupId.`;
137
+ }
138
+ if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) {
139
+ return `${args.options.userName} is not a valid user principal name (UPN) for userName.`;
140
+ }
141
+ if (PaAppPermissionEnsureCommand.roleNames.indexOf(args.options.roleName) < 0) {
142
+ return `${args.options.roleName} is not a valid roleName. Allowed values are: ${PaAppPermissionEnsureCommand.roleNames.join(', ')}.`;
143
+ }
144
+ if (args.options.environmentName && !args.options.asAdmin) {
145
+ return 'Specifying environmentName is only allowed when using asAdmin.';
146
+ }
147
+ if (args.options.asAdmin && !args.options.environmentName) {
148
+ return 'Specifying asAdmin is only allowed when using environmentName.';
149
+ }
150
+ if (args.options.tenant && args.options.roleName !== 'CanView') {
151
+ return 'Sharing with the entire tenant is only supported with CanView role.';
152
+ }
153
+ return true;
154
+ });
155
+ }, _PaAppPermissionEnsureCommand_initOptionSets = function _PaAppPermissionEnsureCommand_initOptionSets() {
156
+ this.optionSets.push({ options: ['userId', 'userName', 'groupId', 'groupName', 'tenant'] });
157
+ }, _PaAppPermissionEnsureCommand_initTypes = function _PaAppPermissionEnsureCommand_initTypes() {
158
+ this.types.string.push('appName', 'roleName', 'userId', 'userName', 'groupId', 'groupName', 'environmentName');
159
+ };
160
+ PaAppPermissionEnsureCommand.roleNames = ['CanEdit', 'CanView'];
161
+ export default new PaAppPermissionEnsureCommand();
162
+ //# sourceMappingURL=app-permission-ensure.js.map
@@ -29,7 +29,7 @@ class PaAppPermissionListCommand extends PowerAppsCommand {
29
29
  }
30
30
  async commandAction(logger, args) {
31
31
  if (this.verbose) {
32
- logger.logToStderr(`Retrieving permissions for app ${args.options.appName}${args.options.roleName !== undefined ? ` with role name ${args.options.roleName}` : ''}`);
32
+ await logger.logToStderr(`Retrieving permissions for app ${args.options.appName}${args.options.roleName !== undefined ? ` with role name ${args.options.roleName}` : ''}`);
33
33
  }
34
34
  const url = `${this.resource}/providers/Microsoft.PowerApps${args.options.asAdmin ? '/scopes/admin' : ''}${args.options.environmentName ? '/environments/' + formatting.encodeQueryParameter(args.options.environmentName) : ''}/apps/${args.options.appName}/permissions?api-version=2022-11-01`;
35
35
  try {
@@ -44,7 +44,7 @@ class PaAppPermissionListCommand extends PowerAppsCommand {
44
44
  permission.principalType = permission.properties.principal.type;
45
45
  });
46
46
  }
47
- logger.log(permissions);
47
+ await logger.log(permissions);
48
48
  }
49
49
  catch (err) {
50
50
  this.handleRejectedODataJsonPromise(err);
@@ -0,0 +1,153 @@
1
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
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
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
+ };
6
+ var _PaAppPermissionRemoveCommand_instances, _PaAppPermissionRemoveCommand_initTelemetry, _PaAppPermissionRemoveCommand_initOptions, _PaAppPermissionRemoveCommand_initValidators, _PaAppPermissionRemoveCommand_initOptionSets, _PaAppPermissionRemoveCommand_initTypes;
7
+ import Auth from '../../../../Auth.js';
8
+ import { Cli } from '../../../../cli/Cli.js';
9
+ import request from '../../../../request.js';
10
+ import { aadGroup } from '../../../../utils/aadGroup.js';
11
+ import { aadUser } from '../../../../utils/aadUser.js';
12
+ import { accessToken } from '../../../../utils/accessToken.js';
13
+ import { validation } from '../../../../utils/validation.js';
14
+ import PowerAppsCommand from '../../../base/PowerAppsCommand.js';
15
+ import commands from '../../commands.js';
16
+ class PaAppPermissionRemoveCommand extends PowerAppsCommand {
17
+ get name() {
18
+ return commands.APP_PERMISSION_REMOVE;
19
+ }
20
+ get description() {
21
+ return 'Removes permissions to a Power Apps app';
22
+ }
23
+ constructor() {
24
+ super();
25
+ _PaAppPermissionRemoveCommand_instances.add(this);
26
+ __classPrivateFieldGet(this, _PaAppPermissionRemoveCommand_instances, "m", _PaAppPermissionRemoveCommand_initTelemetry).call(this);
27
+ __classPrivateFieldGet(this, _PaAppPermissionRemoveCommand_instances, "m", _PaAppPermissionRemoveCommand_initOptions).call(this);
28
+ __classPrivateFieldGet(this, _PaAppPermissionRemoveCommand_instances, "m", _PaAppPermissionRemoveCommand_initValidators).call(this);
29
+ __classPrivateFieldGet(this, _PaAppPermissionRemoveCommand_instances, "m", _PaAppPermissionRemoveCommand_initOptionSets).call(this);
30
+ __classPrivateFieldGet(this, _PaAppPermissionRemoveCommand_instances, "m", _PaAppPermissionRemoveCommand_initTypes).call(this);
31
+ }
32
+ async commandAction(logger, args) {
33
+ try {
34
+ if (args.options.force) {
35
+ await this.removeAppPermission(logger, args.options);
36
+ }
37
+ else {
38
+ const result = await Cli.prompt({
39
+ type: 'confirm',
40
+ name: 'continue',
41
+ default: false,
42
+ message: `Are you sure you want to remove the permissions of '${args.options.userId || args.options.userName || args.options.groupId || args.options.groupName || (args.options.tenant && 'everyone')}' from the Power App '${args.options.appName}'?`
43
+ });
44
+ if (result.continue) {
45
+ await this.removeAppPermission(logger, args.options);
46
+ }
47
+ }
48
+ }
49
+ catch (err) {
50
+ this.handleRejectedODataJsonPromise(err);
51
+ }
52
+ }
53
+ async removeAppPermission(logger, options) {
54
+ if (this.verbose) {
55
+ await logger.logToStderr(`Removing permissions for '${options.userId || options.userName || options.groupId || options.groupName || (options.tenant && 'everyone')}' for the Power Apps app ${options.appName}...`);
56
+ }
57
+ const principalId = await this.getPrincipalId(options);
58
+ const requestOptions = {
59
+ url: `${this.resource}/providers/Microsoft.PowerApps/${options.asAdmin ? `scopes/admin/environments/${options.environmentName}/` : ''}apps/${options.appName}/modifyPermissions?api-version=2022-11-01`,
60
+ headers: {
61
+ accept: 'application/json'
62
+ },
63
+ data: {
64
+ delete: [
65
+ {
66
+ id: principalId
67
+ }
68
+ ]
69
+ },
70
+ responseType: 'json'
71
+ };
72
+ await request.post(requestOptions);
73
+ }
74
+ async getPrincipalId(options) {
75
+ if (options.groupId) {
76
+ return options.groupId;
77
+ }
78
+ if (options.userId) {
79
+ return options.userId;
80
+ }
81
+ if (options.groupName) {
82
+ const group = await aadGroup.getGroupByDisplayName(options.groupName);
83
+ return group.id;
84
+ }
85
+ if (options.userName) {
86
+ const userId = await aadUser.getUserIdByUpn(options.userName);
87
+ return userId;
88
+ }
89
+ return `tenant-${accessToken.getTenantIdFromAccessToken(Auth.service.accessTokens[Auth.defaultResource].accessToken)}`;
90
+ }
91
+ }
92
+ _PaAppPermissionRemoveCommand_instances = new WeakSet(), _PaAppPermissionRemoveCommand_initTelemetry = function _PaAppPermissionRemoveCommand_initTelemetry() {
93
+ this.telemetry.push((args) => {
94
+ Object.assign(this.telemetryProperties, {
95
+ userId: typeof args.options.userId !== 'undefined',
96
+ userName: typeof args.options.userName !== 'undefined',
97
+ groupId: typeof args.options.groupId !== 'undefined',
98
+ groupName: typeof args.options.groupName !== 'undefined',
99
+ tenant: !!args.options.tenant,
100
+ asAdmin: !!args.options.asAdmin,
101
+ environmentName: typeof args.options.environmentName !== 'undefined',
102
+ force: !!args.options.force
103
+ });
104
+ });
105
+ }, _PaAppPermissionRemoveCommand_initOptions = function _PaAppPermissionRemoveCommand_initOptions() {
106
+ this.options.unshift({
107
+ option: '--appName <appName>'
108
+ }, {
109
+ option: '--userId [userId]'
110
+ }, {
111
+ option: '--userName [userName]'
112
+ }, {
113
+ option: '--groupId [groupId]'
114
+ }, {
115
+ option: '--groupName [groupName]'
116
+ }, {
117
+ option: '--tenant'
118
+ }, {
119
+ option: '--asAdmin'
120
+ }, {
121
+ option: '-e, --environmentName [environmentName]'
122
+ }, {
123
+ option: '-f, --force'
124
+ });
125
+ }, _PaAppPermissionRemoveCommand_initValidators = function _PaAppPermissionRemoveCommand_initValidators() {
126
+ this.validators.push(async (args) => {
127
+ if (!validation.isValidGuid(args.options.appName)) {
128
+ return `${args.options.appName} is not a valid GUID for appName.`;
129
+ }
130
+ if (args.options.userId && !validation.isValidGuid(args.options.userId)) {
131
+ return `${args.options.userId} is not a valid GUID for userId.`;
132
+ }
133
+ if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) {
134
+ return `${args.options.userName} is not a valid user principal name (UPN) for userName.`;
135
+ }
136
+ if (args.options.groupId && !validation.isValidGuid(args.options.groupId)) {
137
+ return `${args.options.groupId} is not a valid GUID for groupId.`;
138
+ }
139
+ if (args.options.environmentName && !args.options.asAdmin) {
140
+ return 'Specifying environmentName is only allowed when using asAdmin';
141
+ }
142
+ if (args.options.asAdmin && !args.options.environmentName) {
143
+ return 'Specifying asAdmin is only allowed when using environmentName';
144
+ }
145
+ return true;
146
+ });
147
+ }, _PaAppPermissionRemoveCommand_initOptionSets = function _PaAppPermissionRemoveCommand_initOptionSets() {
148
+ this.optionSets.push({ options: ['userId', 'userName', 'groupId', 'groupName', 'tenant'] });
149
+ }, _PaAppPermissionRemoveCommand_initTypes = function _PaAppPermissionRemoveCommand_initTypes() {
150
+ this.types.string.push('appName', 'userId', 'userName', 'groupId', 'groupName', 'environmentName');
151
+ };
152
+ export default new PaAppPermissionRemoveCommand();
153
+ //# sourceMappingURL=app-permission-remove.js.map
@@ -6,7 +6,9 @@ export default {
6
6
  APP_REMOVE: `${prefix} app remove`,
7
7
  APP_CONSENT_SET: `${prefix} app consent set`,
8
8
  APP_OWNER_SET: `${prefix} app owner set`,
9
+ APP_PERMISSION_ENSURE: `${prefix} app permission ensure`,
9
10
  APP_PERMISSION_LIST: `${prefix} app permission list`,
11
+ APP_PERMISSION_REMOVE: `${prefix} app permission remove`,
10
12
  CONNECTOR_EXPORT: `${prefix} connector export`,
11
13
  CONNECTOR_LIST: `${prefix} connector list`,
12
14
  ENVIRONMENT_GET: `${prefix} environment get`,
@@ -42,7 +42,7 @@ export class PnPJsRule extends BasicDependencyRule {
42
42
  }
43
43
  ];
44
44
  }
45
- visit(project) {
45
+ async visit(project) {
46
46
  const findings = this.pnpModules
47
47
  .map(x => this.getModuleAndParents(project, x.key))
48
48
  .reduce((x, y) => [...x, ...y]);
@@ -67,7 +67,7 @@ export class PnPJsRule extends BasicDependencyRule {
67
67
  targetValue: 'require(\"tslib\");'
68
68
  })));
69
69
  }
70
- return Promise.resolve({ entries: findings, suggestions: fileEdits });
70
+ return { entries: findings, suggestions: fileEdits };
71
71
  }
72
72
  getEntryFilesList(project) {
73
73
  return project && project.manifests ? project.manifests.map(x => x.path.replace('.manifest.json', '.ts')) : [];