@pnp/cli-microsoft365 7.5.0-beta.d4d820f → 7.6.0-beta.443bfd8

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 (191) hide show
  1. package/.devcontainer/Dockerfile +2 -2
  2. package/.eslintrc.cjs +9 -2
  3. package/.mocharc.json +3 -5
  4. package/Dockerfile +2 -5
  5. package/README.md +2 -2
  6. package/allCommands.json +1 -1
  7. package/allCommandsFull.json +1 -1
  8. package/dist/Auth.js +181 -77
  9. package/dist/AuthServer.js +3 -3
  10. package/dist/Command.js +8 -5
  11. package/dist/auth/FileTokenStorage.js +4 -1
  12. package/dist/cli/cli.js +1 -1
  13. package/dist/m365/base/AppCommand.js +2 -2
  14. package/dist/m365/base/PowerAppsCommand.js +2 -2
  15. package/dist/m365/base/PowerAutomateCommand.js +2 -2
  16. package/dist/m365/base/PowerPlatformCommand.js +2 -2
  17. package/dist/m365/base/SpoCommand.js +3 -3
  18. package/dist/m365/base/{YammerCommand.js → VivaEngageCommand.js} +2 -2
  19. package/dist/m365/cli/commands/cli-consent.js +5 -3
  20. package/dist/m365/cli/commands/cli-doctor.js +5 -5
  21. package/dist/m365/commands/ConnectionDetails.js +2 -0
  22. package/dist/m365/commands/login.js +26 -48
  23. package/dist/m365/commands/logout.js +2 -2
  24. package/dist/m365/commands/request.js +2 -2
  25. package/dist/m365/commands/status.js +15 -23
  26. package/dist/m365/connection/commands/connection-list.js +47 -0
  27. package/dist/m365/connection/commands/connection-remove.js +67 -0
  28. package/dist/m365/connection/commands/connection-set.js +56 -0
  29. package/dist/m365/connection/commands/connection-use.js +51 -0
  30. package/dist/m365/connection/commands.js +8 -0
  31. package/dist/m365/entra/aadCommands.js +3 -0
  32. package/dist/m365/entra/commands/administrativeunit/administrativeunit-member-remove.js +153 -0
  33. package/dist/m365/entra/commands/app/app-add.js +2 -2
  34. package/dist/m365/entra/commands/app/app-get.js +1 -1
  35. package/dist/m365/entra/commands/app/app-list.js +1 -1
  36. package/dist/m365/entra/commands/app/app-permission-add.js +1 -1
  37. package/dist/m365/entra/commands/app/app-permission-list.js +182 -0
  38. package/dist/m365/entra/commands/app/app-remove.js +1 -1
  39. package/dist/m365/entra/commands/app/app-role-add.js +1 -1
  40. package/dist/m365/entra/commands/app/app-role-list.js +1 -1
  41. package/dist/m365/entra/commands/app/app-role-remove.js +1 -1
  42. package/dist/m365/entra/commands/app/app-set.js +1 -1
  43. package/dist/m365/entra/commands/{sp/sp-add.js → enterpriseapp/enterpriseapp-add.js} +18 -18
  44. package/dist/m365/entra/commands/{sp/sp-get.js → enterpriseapp/enterpriseapp-get.js} +19 -19
  45. package/dist/m365/entra/commands/{sp/sp-list.js → enterpriseapp/enterpriseapp-list.js} +13 -13
  46. package/dist/m365/entra/commands/group/group-add.js +224 -0
  47. package/dist/m365/entra/commands/group/group-user-add.js +145 -0
  48. package/dist/m365/entra/commands/m365group/m365group-report-activitygroupcounts.js +1 -1
  49. package/dist/m365/entra/commands/user/user-get.js +38 -38
  50. package/dist/m365/entra/commands/user/user-license-list.js +1 -1
  51. package/dist/m365/entra/commands/user/user-registrationdetails-list.js +224 -0
  52. package/dist/m365/entra/commands/user/user-set.js +2 -2
  53. package/dist/m365/entra/commands.js +17 -0
  54. package/dist/m365/external/commands/connection/connection-doctor.js +2 -1
  55. package/dist/m365/file/commands/convert/convert-pdf.js +1 -1
  56. package/dist/m365/file/commands/file-copy.js +151 -0
  57. package/dist/m365/file/commands.js +1 -0
  58. package/dist/m365/outlook/commands/mail/mail-send.js +1 -1
  59. package/dist/m365/outlook/commands/message/message-get.js +1 -1
  60. package/dist/m365/pa/commands/app/app-permission-ensure.js +1 -1
  61. package/dist/m365/pa/commands/app/app-permission-remove.js +1 -1
  62. package/dist/m365/planner/commands/roster/roster-plan-list.js +1 -1
  63. package/dist/m365/purview/commands/auditlog/auditlog-list.js +1 -1
  64. package/dist/m365/purview/commands/sensitivitylabel/sensitivitylabel-get.js +1 -1
  65. package/dist/m365/purview/commands/sensitivitylabel/sensitivitylabel-list.js +1 -1
  66. package/dist/m365/purview/commands/sensitivitylabel/sensitivitylabel-policysettings-list.js +1 -1
  67. package/dist/m365/purview/commands/threatassessment/threatassessment-add.js +123 -0
  68. package/dist/m365/purview/commands/threatassessment/threatassessment-list.js +104 -0
  69. package/dist/m365/purview/commands.js +3 -1
  70. package/dist/m365/spfx/commands/project/DeployWorkflow.js +115 -3
  71. package/dist/m365/spfx/commands/project/project-azuredevops-pipeline-add.js +183 -0
  72. package/dist/m365/spfx/commands/project/project-azuredevops-pipeline-model.js +2 -0
  73. package/dist/m365/spfx/commands/project/project-github-workflow-add.js +3 -4
  74. package/dist/m365/spfx/commands.js +1 -0
  75. package/dist/m365/spo/commands/spo-get.js +1 -1
  76. package/dist/m365/spo/commands/spo-search.js +52 -22
  77. package/dist/m365/spo/commands/spo-set.js +1 -1
  78. package/dist/m365/spo/commands/user/user-remove.js +93 -16
  79. package/dist/m365/teams/commands/chat/chat-get.js +1 -1
  80. package/dist/m365/teams/commands/chat/chat-list.js +1 -1
  81. package/dist/m365/teams/commands/chat/chat-message-send.js +1 -1
  82. package/dist/m365/teams/commands/meeting/meeting-add.js +1 -1
  83. package/dist/m365/teams/commands/meeting/meeting-attendancereport-list.js +1 -1
  84. package/dist/m365/teams/commands/meeting/meeting-get.js +1 -1
  85. package/dist/m365/teams/commands/meeting/meeting-list.js +2 -2
  86. package/dist/m365/teams/commands/meeting/meeting-transcript-list.js +1 -1
  87. package/dist/m365/tenant/commands/id/id-get.js +1 -1
  88. package/dist/m365/tenant/commands/info/info-get.js +1 -1
  89. package/dist/m365/util/commands/accesstoken/accesstoken-get.js +3 -3
  90. package/dist/m365/{yammer/commands/group/group-list.js → viva/commands/engage/engage-group-list.js} +19 -14
  91. package/dist/m365/{yammer/commands/group/group-user-add.js → viva/commands/engage/engage-group-user-add.js} +19 -14
  92. package/dist/m365/{yammer/commands/group/group-user-remove.js → viva/commands/engage/engage-group-user-remove.js} +19 -14
  93. package/dist/m365/{yammer/commands/message/message-add.js → viva/commands/engage/engage-message-add.js} +19 -14
  94. package/dist/m365/{yammer/commands/message/message-get.js → viva/commands/engage/engage-message-get.js} +17 -12
  95. package/dist/m365/{yammer/commands/message/message-like-set.js → viva/commands/engage/engage-message-like-set.js} +21 -16
  96. package/dist/m365/{yammer/commands/message/message-list.js → viva/commands/engage/engage-message-list.js} +21 -16
  97. package/dist/m365/{yammer/commands/message/message-remove.js → viva/commands/engage/engage-message-remove.js} +20 -15
  98. package/dist/m365/{yammer/commands/network/network-list.js → viva/commands/engage/engage-network-list.js} +16 -11
  99. package/dist/m365/viva/commands/engage/engage-report-activitycounts.js +23 -0
  100. package/dist/m365/viva/commands/engage/engage-report-activityusercounts.js +23 -0
  101. package/dist/m365/viva/commands/engage/engage-report-activityuserdetail.js +23 -0
  102. package/dist/m365/viva/commands/engage/engage-report-deviceusagedistributionusercounts.js +23 -0
  103. package/dist/m365/viva/commands/engage/engage-report-deviceusageusercounts.js +23 -0
  104. package/dist/m365/viva/commands/engage/engage-report-deviceusageuserdetail.js +23 -0
  105. package/dist/m365/viva/commands/engage/engage-report-groupsactivitycounts.js +23 -0
  106. package/dist/m365/viva/commands/engage/engage-report-groupsactivitydetail.js +23 -0
  107. package/dist/m365/viva/commands/engage/engage-report-groupsactivitygroupcounts.js +23 -0
  108. package/dist/m365/{yammer/commands/yammer-search.js → viva/commands/engage/engage-search.js} +23 -18
  109. package/dist/m365/{yammer/commands/user/user-get.js → viva/commands/engage/engage-user-get.js} +18 -13
  110. package/dist/m365/{yammer/commands/user/user-list.js → viva/commands/engage/engage-user-list.js} +18 -13
  111. package/dist/m365/{yammer/commands.js → viva/commands/engage/yammerCommands.js} +1 -1
  112. package/dist/m365/viva/commands.js +22 -1
  113. package/dist/request.js +1 -1
  114. package/dist/utils/entraUser.js +36 -0
  115. package/dist/utils/spo.js +36 -14
  116. package/dist/utils/urlUtil.js +31 -0
  117. package/dist/utils/validation.js +8 -0
  118. package/docs/docs/cmd/cli/cli-consent.mdx +9 -9
  119. package/docs/docs/cmd/connection/connection-list.mdx +100 -0
  120. package/docs/docs/cmd/connection/connection-remove.mdx +45 -0
  121. package/docs/docs/cmd/connection/connection-set.mdx +39 -0
  122. package/docs/docs/cmd/connection/connection-use.mdx +98 -0
  123. package/docs/docs/cmd/entra/administrativeunit/administrativeunit-member-add.mdx +5 -3
  124. package/docs/docs/cmd/entra/administrativeunit/administrativeunit-member-remove.mdx +107 -0
  125. package/docs/docs/cmd/entra/app/app-add.mdx +2 -1
  126. package/docs/docs/cmd/entra/app/app-get.mdx +1 -0
  127. package/docs/docs/cmd/entra/app/app-list.mdx +1 -0
  128. package/docs/docs/cmd/entra/app/app-permission-add.mdx +1 -0
  129. package/docs/docs/cmd/entra/app/app-permission-list.mdx +105 -0
  130. package/docs/docs/cmd/entra/app/app-remove.mdx +1 -0
  131. package/docs/docs/cmd/entra/app/app-role-add.mdx +1 -0
  132. package/docs/docs/cmd/entra/app/app-role-list.mdx +1 -0
  133. package/docs/docs/cmd/entra/app/app-role-remove.mdx +1 -0
  134. package/docs/docs/cmd/entra/app/app-set.mdx +1 -0
  135. package/docs/docs/cmd/entra/{sp/sp-add.mdx → enterpriseapp/enterpriseapp-add.mdx} +16 -15
  136. package/docs/docs/cmd/entra/{sp/sp-get.mdx → enterpriseapp/enterpriseapp-get.mdx} +15 -14
  137. package/docs/docs/cmd/entra/{sp/sp-list.mdx → enterpriseapp/enterpriseapp-list.mdx} +22 -21
  138. package/docs/docs/cmd/entra/group/group-add.mdx +231 -0
  139. package/docs/docs/cmd/entra/group/group-user-add.mdx +62 -0
  140. package/docs/docs/cmd/entra/m365group/m365group-report-activitygroupcounts.mdx +1 -1
  141. package/docs/docs/cmd/entra/oauth2grant/oauth2grant-add.mdx +3 -3
  142. package/docs/docs/cmd/entra/oauth2grant/oauth2grant-list.mdx +1 -1
  143. package/docs/docs/cmd/entra/user/user-registrationdetails-list.mdx +246 -0
  144. package/docs/docs/cmd/external/item/item-add.mdx +1 -1
  145. package/docs/docs/cmd/file/convert/convert-pdf.mdx +4 -0
  146. package/docs/docs/cmd/file/file-add.mdx +4 -0
  147. package/docs/docs/cmd/file/file-copy.mdx +68 -0
  148. package/docs/docs/cmd/file/file-list.mdx +100 -0
  149. package/docs/docs/cmd/login.mdx +15 -0
  150. package/docs/docs/cmd/purview/threatassessment/threatassessment-add.mdx +131 -0
  151. package/docs/docs/cmd/purview/threatassessment/threatassessment-list.mdx +110 -0
  152. package/docs/docs/cmd/setup.mdx +4 -0
  153. package/docs/docs/cmd/spfx/project/project-azuredevops-pipeline-add.mdx +87 -0
  154. package/docs/docs/cmd/spo/list/list-webhook-set.mdx +1 -1
  155. package/docs/docs/cmd/spo/spo-search.mdx +6 -2
  156. package/docs/docs/cmd/spo/theme/theme-set.mdx +14 -2
  157. package/docs/docs/cmd/spo/user/user-remove.mdx +40 -9
  158. package/docs/docs/cmd/{yammer/group/group-list.mdx → viva/engage/engage-group-list.mdx} +13 -13
  159. package/docs/docs/cmd/{yammer/group/group-user-add.mdx → viva/engage/engage-group-user-add.mdx} +7 -7
  160. package/docs/docs/cmd/{yammer/group/group-user-remove.mdx → viva/engage/engage-group-user-remove.mdx} +10 -10
  161. package/docs/docs/cmd/{yammer/message/message-add.mdx → viva/engage/engage-message-add.mdx} +12 -13
  162. package/docs/docs/cmd/{yammer/message/message-get.mdx → viva/engage/engage-message-get.mdx} +10 -10
  163. package/docs/docs/cmd/{yammer/message/message-like-set.mdx → viva/engage/engage-message-like-set.mdx} +10 -10
  164. package/docs/docs/cmd/{yammer/message/message-list.mdx → viva/engage/engage-message-list.mdx} +21 -21
  165. package/docs/docs/cmd/{yammer/message/message-remove.mdx → viva/engage/engage-message-remove.mdx} +10 -10
  166. package/docs/docs/cmd/{yammer/network/network-list.mdx → viva/engage/engage-network-list.mdx} +6 -6
  167. package/docs/docs/cmd/{yammer/report/report-activitycounts.mdx → viva/engage/engage-report-activitycounts.mdx} +9 -9
  168. package/docs/docs/cmd/{yammer/report/report-activityusercounts.mdx → viva/engage/engage-report-activityusercounts.mdx} +9 -9
  169. package/docs/docs/cmd/{yammer/report/report-activityuserdetail.mdx → viva/engage/engage-report-activityuserdetail.mdx} +11 -12
  170. package/docs/docs/cmd/{yammer/report/report-deviceusagedistributionusercounts.mdx → viva/engage/engage-report-deviceusagedistributionusercounts.mdx} +5 -5
  171. package/docs/docs/cmd/{yammer/report/report-deviceusageusercounts.mdx → viva/engage/engage-report-deviceusageusercounts.mdx} +5 -5
  172. package/docs/docs/cmd/{yammer/report/report-deviceusageuserdetail.mdx → viva/engage/engage-report-deviceusageuserdetail.mdx} +11 -11
  173. package/docs/docs/cmd/{yammer/report/report-groupsactivitycounts.mdx → viva/engage/engage-report-groupsactivitycounts.mdx} +9 -9
  174. package/docs/docs/cmd/{yammer/report/report-groupsactivitydetail.mdx → viva/engage/engage-report-groupsactivitydetail.mdx} +11 -11
  175. package/docs/docs/cmd/{yammer/report/report-groupsactivitygroupcounts.mdx → viva/engage/engage-report-groupsactivitygroupcounts.mdx} +5 -5
  176. package/docs/docs/cmd/{yammer/yammer-search.mdx → viva/engage/engage-search.mdx} +10 -10
  177. package/docs/docs/cmd/{yammer/user/user-get.mdx → viva/engage/engage-user-get.mdx} +8 -8
  178. package/docs/docs/cmd/{yammer/user/user-list.mdx → viva/engage/engage-user-list.mdx} +11 -11
  179. package/npm-shrinkwrap.json +230 -168
  180. package/package.json +20 -19
  181. package/dist/m365/base/AzmgmtCommand.js +0 -18
  182. package/dist/m365/base/AzmgmtItemsListCommand.js +0 -41
  183. package/dist/m365/yammer/commands/report/report-activitycounts.js +0 -15
  184. package/dist/m365/yammer/commands/report/report-activityusercounts.js +0 -15
  185. package/dist/m365/yammer/commands/report/report-activityuserdetail.js +0 -15
  186. package/dist/m365/yammer/commands/report/report-deviceusagedistributionusercounts.js +0 -15
  187. package/dist/m365/yammer/commands/report/report-deviceusageusercounts.js +0 -15
  188. package/dist/m365/yammer/commands/report/report-deviceusageuserdetail.js +0 -15
  189. package/dist/m365/yammer/commands/report/report-groupsactivitycounts.js +0 -15
  190. package/dist/m365/yammer/commands/report/report-groupsactivitydetail.js +0 -15
  191. package/dist/m365/yammer/commands/report/report-groupsactivitygroupcounts.js +0 -15
@@ -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 _EntraAdministrativeUnitMemberRemoveCommand_instances, _EntraAdministrativeUnitMemberRemoveCommand_initTelemetry, _EntraAdministrativeUnitMemberRemoveCommand_initOptions, _EntraAdministrativeUnitMemberRemoveCommand_initValidators, _EntraAdministrativeUnitMemberRemoveCommand_initOptionSets;
7
+ import { entraAdministrativeUnit } from '../../../../utils/entraAdministrativeUnit.js';
8
+ import { entraDevice } from '../../../../utils/entraDevice.js';
9
+ import { entraGroup } from '../../../../utils/entraGroup.js';
10
+ import { entraUser } from '../../../../utils/entraUser.js';
11
+ import { validation } from '../../../../utils/validation.js';
12
+ import GraphCommand from '../../../base/GraphCommand.js';
13
+ import commands from '../../commands.js';
14
+ import request from '../../../../request.js';
15
+ import { cli } from '../../../../cli/cli.js';
16
+ class EntraAdministrativeUnitMemberRemoveCommand extends GraphCommand {
17
+ get name() {
18
+ return commands.ADMINISTRATIVEUNIT_MEMBER_REMOVE;
19
+ }
20
+ get description() {
21
+ return 'Remove a specific member (user, group, or device) from an administrative unit';
22
+ }
23
+ constructor() {
24
+ super();
25
+ _EntraAdministrativeUnitMemberRemoveCommand_instances.add(this);
26
+ __classPrivateFieldGet(this, _EntraAdministrativeUnitMemberRemoveCommand_instances, "m", _EntraAdministrativeUnitMemberRemoveCommand_initOptions).call(this);
27
+ __classPrivateFieldGet(this, _EntraAdministrativeUnitMemberRemoveCommand_instances, "m", _EntraAdministrativeUnitMemberRemoveCommand_initValidators).call(this);
28
+ __classPrivateFieldGet(this, _EntraAdministrativeUnitMemberRemoveCommand_instances, "m", _EntraAdministrativeUnitMemberRemoveCommand_initOptionSets).call(this);
29
+ __classPrivateFieldGet(this, _EntraAdministrativeUnitMemberRemoveCommand_instances, "m", _EntraAdministrativeUnitMemberRemoveCommand_initTelemetry).call(this);
30
+ }
31
+ async commandAction(logger, args) {
32
+ const removeAdministrativeUnitMember = async () => {
33
+ let administrativeUnitId = args.options.administrativeUnitId;
34
+ let memberId = args.options.id;
35
+ try {
36
+ if (args.options.administrativeUnitName) {
37
+ if (this.verbose) {
38
+ await logger.logToStderr(`Retrieving Administrative Unit Id...`);
39
+ }
40
+ administrativeUnitId = (await entraAdministrativeUnit.getAdministrativeUnitByDisplayName(args.options.administrativeUnitName)).id;
41
+ }
42
+ if (args.options.userId || args.options.userName) {
43
+ memberId = args.options.userId;
44
+ if (args.options.userName) {
45
+ if (this.verbose) {
46
+ await logger.logToStderr(`Retrieving User Id...`);
47
+ }
48
+ memberId = await entraUser.getUserIdByUpn(args.options.userName);
49
+ }
50
+ }
51
+ else if (args.options.groupId || args.options.groupName) {
52
+ memberId = args.options.groupId;
53
+ if (args.options.groupName) {
54
+ if (this.verbose) {
55
+ await logger.logToStderr(`Retrieving Group Id...`);
56
+ }
57
+ memberId = await entraGroup.getGroupIdByDisplayName(args.options.groupName);
58
+ }
59
+ }
60
+ else if (args.options.deviceId || args.options.deviceName) {
61
+ memberId = args.options.deviceId;
62
+ if (args.options.deviceName) {
63
+ if (this.verbose) {
64
+ await logger.logToStderr(`Retrieving Device Id`);
65
+ }
66
+ memberId = (await entraDevice.getDeviceByDisplayName(args.options.deviceName)).id;
67
+ }
68
+ }
69
+ const requestOptions = {
70
+ url: `${this.resource}/v1.0/directory/administrativeUnits/${administrativeUnitId}/members/${memberId}/$ref`,
71
+ headers: {
72
+ accept: 'application/json;odata.metadata=none'
73
+ }
74
+ };
75
+ await request.delete(requestOptions);
76
+ }
77
+ catch (err) {
78
+ this.handleRejectedODataJsonPromise(err);
79
+ }
80
+ };
81
+ if (args.options.force) {
82
+ await removeAdministrativeUnitMember();
83
+ }
84
+ else {
85
+ const result = await cli.promptForConfirmation({ message: `Are you sure you want to remove member '${args.options.id || args.options.userName || args.options.groupName || args.options.deviceName}' from administrative unit '${args.options.administrativeUnitId || args.options.administrativeUnitName}'?` });
86
+ if (result) {
87
+ await removeAdministrativeUnitMember();
88
+ }
89
+ }
90
+ }
91
+ }
92
+ _EntraAdministrativeUnitMemberRemoveCommand_instances = new WeakSet(), _EntraAdministrativeUnitMemberRemoveCommand_initTelemetry = function _EntraAdministrativeUnitMemberRemoveCommand_initTelemetry() {
93
+ this.telemetry.push((args) => {
94
+ Object.assign(this.telemetryProperties, {
95
+ id: typeof args.options.id !== 'undefined',
96
+ userId: typeof args.options.userId !== 'undefined',
97
+ userName: typeof args.options.userName !== 'undefined',
98
+ groupId: typeof args.options.groupId !== 'undefined',
99
+ groupName: typeof args.options.groupName !== 'undefined',
100
+ deviceId: typeof args.options.deviceId !== 'undefined',
101
+ deviceName: typeof args.options.deviceName !== 'undefined',
102
+ administrativeUnitId: typeof args.options.administrativeUnitId !== 'undefined',
103
+ administrativeUnitName: typeof args.options.administrativeUnitName !== 'undefined',
104
+ force: !!args.options.force
105
+ });
106
+ });
107
+ }, _EntraAdministrativeUnitMemberRemoveCommand_initOptions = function _EntraAdministrativeUnitMemberRemoveCommand_initOptions() {
108
+ this.options.unshift({
109
+ option: '-i, --id [id]'
110
+ }, {
111
+ option: "--userId [userId]"
112
+ }, {
113
+ option: "--userName [userName]"
114
+ }, {
115
+ option: "--groupId [groupId]"
116
+ }, {
117
+ option: "--groupName [groupName]"
118
+ }, {
119
+ option: "--deviceId [deviceId]"
120
+ }, {
121
+ option: "--deviceName [deviceName]"
122
+ }, {
123
+ option: '--administrativeUnitId [administrativeUnitId]'
124
+ }, {
125
+ option: '--administrativeUnitName [administrativeUnitName]'
126
+ }, {
127
+ option: '-f, --force'
128
+ });
129
+ }, _EntraAdministrativeUnitMemberRemoveCommand_initValidators = function _EntraAdministrativeUnitMemberRemoveCommand_initValidators() {
130
+ this.validators.push(async (args) => {
131
+ if (args.options.administrativeUnitId && !validation.isValidGuid(args.options.administrativeUnitId)) {
132
+ return `${args.options.administrativeUnitId} is not a valid GUID`;
133
+ }
134
+ if (args.options.id && !validation.isValidGuid(args.options.id)) {
135
+ return `${args.options.id} is not a valid GUID`;
136
+ }
137
+ if (args.options.userId && !validation.isValidGuid(args.options.userId)) {
138
+ return `${args.options.userId} is not a valid GUID`;
139
+ }
140
+ if (args.options.groupId && !validation.isValidGuid(args.options.groupId)) {
141
+ return `${args.options.groupId} is not a valid GUID`;
142
+ }
143
+ if (args.options.deviceId && !validation.isValidGuid(args.options.deviceId)) {
144
+ return `${args.options.deviceId} is not a valid GUID`;
145
+ }
146
+ return true;
147
+ });
148
+ }, _EntraAdministrativeUnitMemberRemoveCommand_initOptionSets = function _EntraAdministrativeUnitMemberRemoveCommand_initOptionSets() {
149
+ this.optionSets.push({ options: ['administrativeUnitId', 'administrativeUnitName'] });
150
+ this.optionSets.push({ options: ['id', 'userId', 'userName', 'groupId', 'groupName', 'deviceId', 'deviceName'] });
151
+ };
152
+ export default new EntraAdministrativeUnitMemberRemoveCommand();
153
+ //# sourceMappingURL=administrativeunit-member-remove.js.map
@@ -21,7 +21,7 @@ class EntraAppAddCommand extends GraphCommand {
21
21
  return 'Creates new Entra app registration';
22
22
  }
23
23
  alias() {
24
- return [aadCommands.APP_ADD];
24
+ return [aadCommands.APP_ADD, commands.APPREGISTRATION_ADD];
25
25
  }
26
26
  constructor() {
27
27
  super();
@@ -41,7 +41,7 @@ class EntraAppAddCommand extends GraphCommand {
41
41
  // directory. If we in the future extend the command with allowing
42
42
  // users to create AAD app in a different directory, we'll need to
43
43
  // adjust this
44
- appInfo.tenantId = accessToken.getTenantIdFromAccessToken(auth.service.accessTokens[auth.defaultResource].accessToken);
44
+ appInfo.tenantId = accessToken.getTenantIdFromAccessToken(auth.connection.accessTokens[auth.defaultResource].accessToken);
45
45
  appInfo = await this.updateAppFromManifest(args, appInfo);
46
46
  appInfo = await this.grantAdminConsent(appInfo, args.options.grantAdminConsent, logger);
47
47
  appInfo = await this.configureUri(args, appInfo, logger);
@@ -20,7 +20,7 @@ class EntraAppGetCommand extends GraphCommand {
20
20
  return 'Gets an Entra app registration';
21
21
  }
22
22
  alias() {
23
- return [aadCommands.APP_GET];
23
+ return [aadCommands.APP_GET, commands.APPREGISTRATION_GET];
24
24
  }
25
25
  constructor() {
26
26
  super();
@@ -10,7 +10,7 @@ class EntraAppListCommand extends GraphCommand {
10
10
  return 'Retrieves a list of Entra app registrations';
11
11
  }
12
12
  alias() {
13
- return [aadCommands.APP_LIST];
13
+ return [aadCommands.APP_LIST, commands.APPREGISTRATION_LIST];
14
14
  }
15
15
  defaultProperties() {
16
16
  return ['appId', 'id', 'displayName', "signInAudience"];
@@ -23,7 +23,7 @@ class EntraAppPermissionAddCommand extends GraphCommand {
23
23
  return 'Adds the specified application and/or delegated permissions to a specified Entra ID (Azure AD) app';
24
24
  }
25
25
  alias() {
26
- return [aadCommands.APP_PERMISSION_ADD];
26
+ return [aadCommands.APP_PERMISSION_ADD, commands.APPREGISTRATION_PERMISSION_ADD];
27
27
  }
28
28
  constructor() {
29
29
  super();
@@ -0,0 +1,182 @@
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 _EntraAppPermissionListCommand_instances, _EntraAppPermissionListCommand_initTelemetry, _EntraAppPermissionListCommand_initOptions, _EntraAppPermissionListCommand_initValidators, _EntraAppPermissionListCommand_initOptionSets;
7
+ import GraphCommand from "../../../base/GraphCommand.js";
8
+ import commands from "../../commands.js";
9
+ import request from "../../../../request.js";
10
+ import { validation } from "../../../../utils/validation.js";
11
+ import { formatting } from "../../../../utils/formatting.js";
12
+ class EntraAppPermissionListCommand extends GraphCommand {
13
+ get name() {
14
+ return commands.APP_PERMISSION_LIST;
15
+ }
16
+ get description() {
17
+ return 'Lists the application and delegated permissions for a specified Entra Application Registration';
18
+ }
19
+ constructor() {
20
+ super();
21
+ _EntraAppPermissionListCommand_instances.add(this);
22
+ this.allowedTypes = ['delegated', 'application', 'all'];
23
+ __classPrivateFieldGet(this, _EntraAppPermissionListCommand_instances, "m", _EntraAppPermissionListCommand_initTelemetry).call(this);
24
+ __classPrivateFieldGet(this, _EntraAppPermissionListCommand_instances, "m", _EntraAppPermissionListCommand_initOptions).call(this);
25
+ __classPrivateFieldGet(this, _EntraAppPermissionListCommand_instances, "m", _EntraAppPermissionListCommand_initValidators).call(this);
26
+ __classPrivateFieldGet(this, _EntraAppPermissionListCommand_instances, "m", _EntraAppPermissionListCommand_initOptionSets).call(this);
27
+ }
28
+ async commandAction(logger, args) {
29
+ try {
30
+ const appObjectId = await this.getAppObjectId(args.options);
31
+ const type = args.options.type ?? 'all';
32
+ const permissions = await this.getAppRegPermissions(appObjectId, type, logger);
33
+ await logger.log(permissions);
34
+ }
35
+ catch (err) {
36
+ this.handleRejectedODataJsonPromise(err);
37
+ }
38
+ }
39
+ async getAppObjectId(options) {
40
+ if (options.appObjectId) {
41
+ return options.appObjectId;
42
+ }
43
+ const requestOptions = {
44
+ url: `${this.resource}/v1.0/myorganization/applications?$filter=appId eq '${formatting.encodeQueryParameter(options.appId)}'&$select=id`,
45
+ headers: {
46
+ accept: 'application/json;odata.metadata=none'
47
+ },
48
+ responseType: 'json'
49
+ };
50
+ const res = await request.get(requestOptions);
51
+ if (res.value.length === 0) {
52
+ throw `No Azure AD application registration with ID ${options.appId} found`;
53
+ }
54
+ return res.value[0].id;
55
+ }
56
+ async getAppRegPermissions(appObjectId, permissionType, logger) {
57
+ const requestOptions = {
58
+ url: `${this.resource}/v1.0/myorganization/applications/${appObjectId}`,
59
+ headers: {
60
+ accept: 'application/json;odata.metadata=none'
61
+ },
62
+ responseType: 'json'
63
+ };
64
+ const application = await request.get(requestOptions);
65
+ const requiredResourceAccess = application.requiredResourceAccess;
66
+ if (requiredResourceAccess.length === 0) {
67
+ return [];
68
+ }
69
+ const servicePrincipalsToResolve = requiredResourceAccess.map(resourceAccess => {
70
+ return {
71
+ appId: resourceAccess.resourceAppId
72
+ };
73
+ });
74
+ const servicePrincipals = await Promise
75
+ .all(servicePrincipalsToResolve.map(servicePrincipalInfo => this.getServicePrincipal(servicePrincipalInfo, permissionType, logger)));
76
+ const apiPermissions = [];
77
+ requiredResourceAccess.forEach(requiredResourceAccess => {
78
+ const servicePrincipal = servicePrincipals
79
+ .find(servicePrincipal => servicePrincipal?.appId === requiredResourceAccess.resourceAppId);
80
+ const resourceName = servicePrincipal?.displayName ?? requiredResourceAccess.resourceAppId;
81
+ requiredResourceAccess.resourceAccess.forEach(permission => {
82
+ if (permissionType === 'application' && permission.type === 'Scope') {
83
+ return;
84
+ }
85
+ if (permissionType === 'delegated' && permission.type === 'Role') {
86
+ return;
87
+ }
88
+ apiPermissions.push({
89
+ resource: resourceName,
90
+ resourceId: requiredResourceAccess.resourceAppId,
91
+ permission: this.getPermissionName(permission.id, permission.type, servicePrincipal),
92
+ type: permission.type === 'Role' ? 'Application' : 'Delegated'
93
+ });
94
+ });
95
+ });
96
+ return apiPermissions;
97
+ }
98
+ getPermissionName(permissionId, permissionType, servicePrincipal) {
99
+ if (!servicePrincipal) {
100
+ return permissionId;
101
+ }
102
+ if (permissionType === 'Role') {
103
+ return servicePrincipal.appRoles
104
+ .find(appRole => appRole.id === permissionId)?.value ?? permissionId;
105
+ }
106
+ // permissionType === 'Scope'
107
+ return servicePrincipal.oauth2PermissionScopes
108
+ .find(permissionScope => permissionScope.id === permissionId)?.value ?? permissionId;
109
+ }
110
+ async getServicePrincipal(servicePrincipalInfo, permissionType, logger) {
111
+ if (this.verbose) {
112
+ await logger.logToStderr(`Retrieving service principal ${servicePrincipalInfo.appId}`);
113
+ }
114
+ const requestOptions = {
115
+ url: `${this.resource}/v1.0/servicePrincipals?$filter=appId eq '${servicePrincipalInfo.appId}'&$select=appId,id,displayName`,
116
+ headers: {
117
+ accept: 'application/json;odata.metadata=none'
118
+ },
119
+ responseType: 'json'
120
+ };
121
+ const response = await request.get(requestOptions);
122
+ if (servicePrincipalInfo.appId && response.value.length === 0) {
123
+ return null;
124
+ }
125
+ const servicePrincipal = response.value[0];
126
+ if (this.verbose) {
127
+ await logger.logToStderr(`Retrieving permissions for service principal ${servicePrincipal.id}...`);
128
+ }
129
+ const oauth2PermissionScopesRequestOptions = {
130
+ url: `${this.resource}/v1.0/servicePrincipals/${servicePrincipal.id}/oauth2PermissionScopes`,
131
+ headers: {
132
+ accept: 'application/json;odata.metadata=none'
133
+ },
134
+ responseType: 'json'
135
+ };
136
+ const appRolesRequestOptions = {
137
+ url: `${this.resource}/v1.0/servicePrincipals/${servicePrincipal.id}/appRoles`,
138
+ headers: {
139
+ accept: 'application/json;odata.metadata=none'
140
+ },
141
+ responseType: 'json'
142
+ };
143
+ let permissions;
144
+ if (permissionType === 'all' || permissionType === 'delegated') {
145
+ permissions = await request.get(oauth2PermissionScopesRequestOptions);
146
+ servicePrincipal.oauth2PermissionScopes = permissions.value;
147
+ }
148
+ if (permissionType === 'all' || permissionType === 'application') {
149
+ permissions = await request.get(appRolesRequestOptions);
150
+ servicePrincipal.appRoles = permissions.value;
151
+ }
152
+ return servicePrincipal;
153
+ }
154
+ }
155
+ _EntraAppPermissionListCommand_instances = new WeakSet(), _EntraAppPermissionListCommand_initTelemetry = function _EntraAppPermissionListCommand_initTelemetry() {
156
+ this.telemetry.push((args) => {
157
+ Object.assign(this.telemetryProperties, {
158
+ appId: typeof args.options.appId !== 'undefined',
159
+ appObjectId: typeof args.options.appObjectId !== 'undefined',
160
+ type: typeof args.options.type !== 'undefined'
161
+ });
162
+ });
163
+ }, _EntraAppPermissionListCommand_initOptions = function _EntraAppPermissionListCommand_initOptions() {
164
+ this.options.unshift({ option: '-i, --appId [appId]' }, { option: '--appObjectId [appObjectId]' }, { option: '--type [type]', autocomplete: this.allowedTypes });
165
+ }, _EntraAppPermissionListCommand_initValidators = function _EntraAppPermissionListCommand_initValidators() {
166
+ this.validators.push(async (args) => {
167
+ if (args.options.appId && !validation.isValidGuid(args.options.appId)) {
168
+ return `${args.options.appId} is not a valid GUID`;
169
+ }
170
+ if (args.options.appObjectId && !validation.isValidGuid(args.options.appObjectId)) {
171
+ return `${args.options.appObjectId} is not a valid GUID`;
172
+ }
173
+ if (args.options.type && this.allowedTypes.indexOf(args.options.type.toLowerCase()) === -1) {
174
+ return `${args.options.type} is not a valid type. Allowed types are ${this.allowedTypes.join(', ')}`;
175
+ }
176
+ return true;
177
+ });
178
+ }, _EntraAppPermissionListCommand_initOptionSets = function _EntraAppPermissionListCommand_initOptionSets() {
179
+ this.optionSets.push({ options: ['appId', 'appObjectId'] });
180
+ };
181
+ export default new EntraAppPermissionListCommand();
182
+ //# sourceMappingURL=app-permission-list.js.map
@@ -19,7 +19,7 @@ class EntraAppRemoveCommand extends GraphCommand {
19
19
  return 'Removes an Entra app registration';
20
20
  }
21
21
  alias() {
22
- return [aadCommands.APP_REMOVE];
22
+ return [aadCommands.APP_REMOVE, commands.APPREGISTRATION_REMOVE];
23
23
  }
24
24
  constructor() {
25
25
  super();
@@ -19,7 +19,7 @@ class EntraAppRoleAddCommand extends GraphCommand {
19
19
  return 'Adds role to the specified Entra app registration';
20
20
  }
21
21
  alias() {
22
- return [aadCommands.APP_ROLE_ADD];
22
+ return [aadCommands.APP_ROLE_ADD, commands.APPREGISTRATION_ROLE_ADD];
23
23
  }
24
24
  constructor() {
25
25
  super();
@@ -19,7 +19,7 @@ class EntraAppRoleListCommand extends GraphCommand {
19
19
  return 'Gets Entra app registration roles';
20
20
  }
21
21
  alias() {
22
- return [aadCommands.APP_ROLE_LIST];
22
+ return [aadCommands.APP_ROLE_LIST, commands.APPREGISTRATION_ROLE_LIST];
23
23
  }
24
24
  constructor() {
25
25
  super();
@@ -19,7 +19,7 @@ class EntraAppRoleRemoveCommand extends GraphCommand {
19
19
  return 'Removes role from the specified Entra app registration';
20
20
  }
21
21
  alias() {
22
- return [aadCommands.APP_ROLE_REMOVE];
22
+ return [aadCommands.APP_ROLE_REMOVE, commands.APPREGISTRATION_ROLE_REMOVE];
23
23
  }
24
24
  constructor() {
25
25
  super();
@@ -19,7 +19,7 @@ class EntraAppSetCommand extends GraphCommand {
19
19
  return 'Updates Entra app registration';
20
20
  }
21
21
  alias() {
22
- return [aadCommands.APP_SET];
22
+ return [aadCommands.APP_SET, commands.APPREGISTRATION_SET];
23
23
  }
24
24
  constructor() {
25
25
  super();
@@ -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 _EntraSpAddCommand_instances, _EntraSpAddCommand_initTelemetry, _EntraSpAddCommand_initOptions, _EntraSpAddCommand_initValidators, _EntraSpAddCommand_initOptionSets;
6
+ var _EntraEnterpriseAppAddCommand_instances, _EntraEnterpriseAppAddCommand_initTelemetry, _EntraEnterpriseAppAddCommand_initOptions, _EntraEnterpriseAppAddCommand_initValidators, _EntraEnterpriseAppAddCommand_initOptionSets;
7
7
  import request from '../../../../request.js';
8
8
  import { formatting } from '../../../../utils/formatting.js';
9
9
  import { validation } from '../../../../utils/validation.js';
@@ -11,23 +11,23 @@ import GraphCommand from '../../../base/GraphCommand.js';
11
11
  import commands from '../../commands.js';
12
12
  import { cli } from '../../../../cli/cli.js';
13
13
  import aadCommands from '../../aadCommands.js';
14
- class EntraSpAddCommand extends GraphCommand {
14
+ class EntraEnterpriseAppAddCommand extends GraphCommand {
15
15
  get name() {
16
- return commands.SP_ADD;
16
+ return commands.ENTERPRISEAPP_ADD;
17
17
  }
18
18
  get description() {
19
- return 'Adds a service principal to a registered Entra app';
19
+ return 'Creates an enterprise application (or service principal) for a registered Entra app';
20
20
  }
21
21
  alias() {
22
- return [aadCommands.SP_ADD];
22
+ return [aadCommands.SP_ADD, commands.SP_ADD];
23
23
  }
24
24
  constructor() {
25
25
  super();
26
- _EntraSpAddCommand_instances.add(this);
27
- __classPrivateFieldGet(this, _EntraSpAddCommand_instances, "m", _EntraSpAddCommand_initTelemetry).call(this);
28
- __classPrivateFieldGet(this, _EntraSpAddCommand_instances, "m", _EntraSpAddCommand_initOptions).call(this);
29
- __classPrivateFieldGet(this, _EntraSpAddCommand_instances, "m", _EntraSpAddCommand_initValidators).call(this);
30
- __classPrivateFieldGet(this, _EntraSpAddCommand_instances, "m", _EntraSpAddCommand_initOptionSets).call(this);
26
+ _EntraEnterpriseAppAddCommand_instances.add(this);
27
+ __classPrivateFieldGet(this, _EntraEnterpriseAppAddCommand_instances, "m", _EntraEnterpriseAppAddCommand_initTelemetry).call(this);
28
+ __classPrivateFieldGet(this, _EntraEnterpriseAppAddCommand_instances, "m", _EntraEnterpriseAppAddCommand_initOptions).call(this);
29
+ __classPrivateFieldGet(this, _EntraEnterpriseAppAddCommand_instances, "m", _EntraEnterpriseAppAddCommand_initValidators).call(this);
30
+ __classPrivateFieldGet(this, _EntraEnterpriseAppAddCommand_instances, "m", _EntraEnterpriseAppAddCommand_initOptionSets).call(this);
31
31
  }
32
32
  async getAppId(args) {
33
33
  if (args.options.appId) {
@@ -50,11 +50,11 @@ class EntraSpAddCommand extends GraphCommand {
50
50
  const response = await request.get(appIdRequestOptions);
51
51
  const spItem = response.value[0];
52
52
  if (!spItem) {
53
- throw `The specified Azure AD app doesn't exist`;
53
+ throw `The specified Entra app doesn't exist`;
54
54
  }
55
55
  if (response.value.length > 1) {
56
56
  const resultAsKeyValuePair = formatting.convertArrayToHashTable('appId', response.value);
57
- const result = await cli.handleMultipleResultsFound(`Multiple Azure AD apps with name '${args.options.appName}' found.`, resultAsKeyValuePair);
57
+ const result = await cli.handleMultipleResultsFound(`Multiple Entra apps with name '${args.options.appName}' found.`, resultAsKeyValuePair);
58
58
  return result.appId;
59
59
  }
60
60
  return spItem.appId;
@@ -81,7 +81,7 @@ class EntraSpAddCommand extends GraphCommand {
81
81
  }
82
82
  }
83
83
  }
84
- _EntraSpAddCommand_instances = new WeakSet(), _EntraSpAddCommand_initTelemetry = function _EntraSpAddCommand_initTelemetry() {
84
+ _EntraEnterpriseAppAddCommand_instances = new WeakSet(), _EntraEnterpriseAppAddCommand_initTelemetry = function _EntraEnterpriseAppAddCommand_initTelemetry() {
85
85
  this.telemetry.push((args) => {
86
86
  Object.assign(this.telemetryProperties, {
87
87
  appId: (!(!args.options.appId)).toString(),
@@ -89,7 +89,7 @@ _EntraSpAddCommand_instances = new WeakSet(), _EntraSpAddCommand_initTelemetry =
89
89
  objectId: (!(!args.options.objectId)).toString()
90
90
  });
91
91
  });
92
- }, _EntraSpAddCommand_initOptions = function _EntraSpAddCommand_initOptions() {
92
+ }, _EntraEnterpriseAppAddCommand_initOptions = function _EntraEnterpriseAppAddCommand_initOptions() {
93
93
  this.options.unshift({
94
94
  option: '--appId [appId]'
95
95
  }, {
@@ -97,7 +97,7 @@ _EntraSpAddCommand_instances = new WeakSet(), _EntraSpAddCommand_initTelemetry =
97
97
  }, {
98
98
  option: '--objectId [objectId]'
99
99
  });
100
- }, _EntraSpAddCommand_initValidators = function _EntraSpAddCommand_initValidators() {
100
+ }, _EntraEnterpriseAppAddCommand_initValidators = function _EntraEnterpriseAppAddCommand_initValidators() {
101
101
  this.validators.push(async (args) => {
102
102
  if (args.options.appId && !validation.isValidGuid(args.options.appId)) {
103
103
  return `${args.options.appId} is not a valid appId GUID`;
@@ -107,8 +107,8 @@ _EntraSpAddCommand_instances = new WeakSet(), _EntraSpAddCommand_initTelemetry =
107
107
  }
108
108
  return true;
109
109
  });
110
- }, _EntraSpAddCommand_initOptionSets = function _EntraSpAddCommand_initOptionSets() {
110
+ }, _EntraEnterpriseAppAddCommand_initOptionSets = function _EntraEnterpriseAppAddCommand_initOptionSets() {
111
111
  this.optionSets.push({ options: ['appId', 'appName', 'objectId'] });
112
112
  };
113
- export default new EntraSpAddCommand();
114
- //# sourceMappingURL=sp-add.js.map
113
+ export default new EntraEnterpriseAppAddCommand();
114
+ //# sourceMappingURL=enterpriseapp-add.js.map
@@ -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 _EntraSpGetCommand_instances, _EntraSpGetCommand_initTelemetry, _EntraSpGetCommand_initOptions, _EntraSpGetCommand_initValidators, _EntraSpGetCommand_initOptionSets;
6
+ var _EntraEnterpriseAppGetCommand_instances, _EntraEnterpriseAppGetCommand_initTelemetry, _EntraEnterpriseAppGetCommand_initOptions, _EntraEnterpriseAppGetCommand_initValidators, _EntraEnterpriseAppGetCommand_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,23 +11,23 @@ import { validation } from '../../../../utils/validation.js';
11
11
  import GraphCommand from '../../../base/GraphCommand.js';
12
12
  import aadCommands from '../../aadCommands.js';
13
13
  import commands from '../../commands.js';
14
- class EntraSpGetCommand extends GraphCommand {
14
+ class EntraEnterpriseAppGetCommand extends GraphCommand {
15
15
  get name() {
16
- return commands.SP_GET;
16
+ return commands.ENTERPRISEAPP_GET;
17
17
  }
18
18
  get description() {
19
- return 'Gets information about the specific service principal';
19
+ return 'Gets information about an Enterprise Application';
20
20
  }
21
21
  alias() {
22
- return [aadCommands.SP_GET];
22
+ return [aadCommands.SP_GET, commands.SP_GET];
23
23
  }
24
24
  constructor() {
25
25
  super();
26
- _EntraSpGetCommand_instances.add(this);
27
- __classPrivateFieldGet(this, _EntraSpGetCommand_instances, "m", _EntraSpGetCommand_initTelemetry).call(this);
28
- __classPrivateFieldGet(this, _EntraSpGetCommand_instances, "m", _EntraSpGetCommand_initOptions).call(this);
29
- __classPrivateFieldGet(this, _EntraSpGetCommand_instances, "m", _EntraSpGetCommand_initValidators).call(this);
30
- __classPrivateFieldGet(this, _EntraSpGetCommand_instances, "m", _EntraSpGetCommand_initOptionSets).call(this);
26
+ _EntraEnterpriseAppGetCommand_instances.add(this);
27
+ __classPrivateFieldGet(this, _EntraEnterpriseAppGetCommand_instances, "m", _EntraEnterpriseAppGetCommand_initTelemetry).call(this);
28
+ __classPrivateFieldGet(this, _EntraEnterpriseAppGetCommand_instances, "m", _EntraEnterpriseAppGetCommand_initOptions).call(this);
29
+ __classPrivateFieldGet(this, _EntraEnterpriseAppGetCommand_instances, "m", _EntraEnterpriseAppGetCommand_initValidators).call(this);
30
+ __classPrivateFieldGet(this, _EntraEnterpriseAppGetCommand_instances, "m", _EntraEnterpriseAppGetCommand_initOptionSets).call(this);
31
31
  }
32
32
  async getSpId(args) {
33
33
  if (args.options.appObjectId) {
@@ -50,18 +50,18 @@ class EntraSpGetCommand extends GraphCommand {
50
50
  const response = await request.get(idRequestOptions);
51
51
  const spItem = response.value[0];
52
52
  if (!spItem) {
53
- throw `The specified Azure AD app does not exist`;
53
+ throw `The specified Entra app does not exist`;
54
54
  }
55
55
  if (response.value.length > 1) {
56
56
  const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', response.value);
57
- const result = await cli.handleMultipleResultsFound(`Multiple Azure AD apps with name '${args.options.appDisplayName}' found.`, resultAsKeyValuePair);
57
+ const result = await cli.handleMultipleResultsFound(`Multiple Entra apps with name '${args.options.appDisplayName}' found.`, resultAsKeyValuePair);
58
58
  return result.id;
59
59
  }
60
60
  return spItem.id;
61
61
  }
62
62
  async commandAction(logger, args) {
63
63
  if (this.verbose) {
64
- await logger.logToStderr(`Retrieving service principal information...`);
64
+ await logger.logToStderr(`Retrieving enterprise application information...`);
65
65
  }
66
66
  try {
67
67
  const id = await this.getSpId(args);
@@ -81,7 +81,7 @@ class EntraSpGetCommand extends GraphCommand {
81
81
  }
82
82
  }
83
83
  }
84
- _EntraSpGetCommand_instances = new WeakSet(), _EntraSpGetCommand_initTelemetry = function _EntraSpGetCommand_initTelemetry() {
84
+ _EntraEnterpriseAppGetCommand_instances = new WeakSet(), _EntraEnterpriseAppGetCommand_initTelemetry = function _EntraEnterpriseAppGetCommand_initTelemetry() {
85
85
  this.telemetry.push((args) => {
86
86
  Object.assign(this.telemetryProperties, {
87
87
  appId: (!(!args.options.appId)).toString(),
@@ -89,7 +89,7 @@ _EntraSpGetCommand_instances = new WeakSet(), _EntraSpGetCommand_initTelemetry =
89
89
  appObjectId: (!(!args.options.appObjectId)).toString()
90
90
  });
91
91
  });
92
- }, _EntraSpGetCommand_initOptions = function _EntraSpGetCommand_initOptions() {
92
+ }, _EntraEnterpriseAppGetCommand_initOptions = function _EntraEnterpriseAppGetCommand_initOptions() {
93
93
  this.options.unshift({
94
94
  option: '-i, --appId [appId]'
95
95
  }, {
@@ -97,7 +97,7 @@ _EntraSpGetCommand_instances = new WeakSet(), _EntraSpGetCommand_initTelemetry =
97
97
  }, {
98
98
  option: '--appObjectId [appObjectId]'
99
99
  });
100
- }, _EntraSpGetCommand_initValidators = function _EntraSpGetCommand_initValidators() {
100
+ }, _EntraEnterpriseAppGetCommand_initValidators = function _EntraEnterpriseAppGetCommand_initValidators() {
101
101
  this.validators.push(async (args) => {
102
102
  if (args.options.appId && !validation.isValidGuid(args.options.appId)) {
103
103
  return `${args.options.appId} is not a valid appId GUID`;
@@ -107,8 +107,8 @@ _EntraSpGetCommand_instances = new WeakSet(), _EntraSpGetCommand_initTelemetry =
107
107
  }
108
108
  return true;
109
109
  });
110
- }, _EntraSpGetCommand_initOptionSets = function _EntraSpGetCommand_initOptionSets() {
110
+ }, _EntraEnterpriseAppGetCommand_initOptionSets = function _EntraEnterpriseAppGetCommand_initOptionSets() {
111
111
  this.optionSets.push({ options: ['appId', 'appDisplayName', 'appObjectId'] });
112
112
  };
113
- export default new EntraSpGetCommand();
114
- //# sourceMappingURL=sp-get.js.map
113
+ export default new EntraEnterpriseAppGetCommand();
114
+ //# sourceMappingURL=enterpriseapp-get.js.map