@pnp/cli-microsoft365 11.9.0-beta.93bd508 → 11.9.0-beta.9bd71dd

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 (86) hide show
  1. package/.devcontainer/Dockerfile +2 -2
  2. package/.devproxy/api-specs/sharepoint.yaml +84 -0
  3. package/allCommands.json +1 -1
  4. package/allCommandsFull.json +1 -1
  5. package/dist/m365/entra/commands/approleassignment/approleassignment-add.js +23 -48
  6. package/dist/m365/entra/commands/approleassignment/approleassignment-list.js +20 -43
  7. package/dist/m365/entra/commands/approleassignment/approleassignment-remove.js +24 -51
  8. package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-add.js +20 -43
  9. package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-get.js +20 -43
  10. package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-list.js +9 -25
  11. package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-remove.js +21 -50
  12. package/dist/m365/entra/commands/groupsetting/groupsetting-add.js +9 -25
  13. package/dist/m365/entra/commands/groupsetting/groupsetting-get.js +8 -24
  14. package/dist/m365/entra/commands/groupsetting/groupsetting-list.js +6 -0
  15. package/dist/m365/entra/commands/groupsetting/groupsetting-remove.js +9 -33
  16. package/dist/m365/entra/commands/groupsetting/groupsetting-set.js +8 -24
  17. package/dist/m365/entra/commands/groupsettingtemplate/groupsettingtemplate-get.js +19 -38
  18. package/dist/m365/entra/commands/groupsettingtemplate/groupsettingtemplate-list.js +6 -0
  19. package/dist/m365/entra/commands/pim/pim-role-assignment-add.js +68 -114
  20. package/dist/m365/entra/commands/pim/pim-role-assignment-eligibility-list.js +28 -55
  21. package/dist/m365/entra/commands/pim/pim-role-assignment-list.js +30 -57
  22. package/dist/m365/entra/commands/pim/pim-role-assignment-remove.js +50 -90
  23. package/dist/m365/entra/commands/pim/pim-role-request-list.js +36 -69
  24. package/dist/m365/entra/commands/policy/policy-list.js +13 -56
  25. package/dist/m365/entra/commands/user/user-add.js +39 -118
  26. package/dist/m365/entra/commands/user/user-get.js +24 -49
  27. package/dist/m365/entra/commands/user/user-groupmembership-list.js +25 -48
  28. package/dist/m365/entra/commands/user/user-guest-add.js +14 -39
  29. package/dist/m365/entra/commands/user/user-hibp.js +12 -34
  30. package/dist/m365/entra/commands/user/user-license-add.js +23 -42
  31. package/dist/m365/entra/commands/user/user-license-list.js +21 -42
  32. package/dist/m365/entra/commands/user/user-license-remove.js +25 -47
  33. package/dist/m365/entra/commands/user/user-list.js +12 -39
  34. package/dist/m365/entra/commands/user/user-password-validate.js +8 -15
  35. package/dist/m365/entra/commands/user/user-recyclebinitem-clear.js +8 -22
  36. package/dist/m365/entra/commands/user/user-recyclebinitem-remove.js +9 -33
  37. package/dist/m365/entra/commands/user/user-recyclebinitem-restore.js +8 -24
  38. package/dist/m365/entra/commands/user/user-registrationdetails-list.js +43 -113
  39. package/dist/m365/entra/commands/user/user-remove.js +22 -42
  40. package/dist/m365/entra/commands/user/user-set.js +69 -149
  41. package/dist/m365/entra/commands/user/user-signin-list.js +22 -51
  42. package/dist/m365/external/commands/connection/connection-add.js +40 -65
  43. package/dist/m365/external/commands/connection/connection-doctor.js +14 -30
  44. package/dist/m365/external/commands/connection/connection-get.js +19 -28
  45. package/dist/m365/external/commands/connection/connection-remove.js +20 -25
  46. package/dist/m365/external/commands/connection/connection-schema-add.js +53 -42
  47. package/dist/m365/external/commands/connection/connection-urltoitemresolver-add.js +12 -23
  48. package/dist/m365/external/commands/item/item-add.js +37 -60
  49. package/dist/m365/file/commands/convert/convert-pdf.js +18 -33
  50. package/dist/m365/file/commands/file-add.js +28 -34
  51. package/dist/m365/file/commands/file-copy.js +18 -34
  52. package/dist/m365/file/commands/file-list.js +18 -24
  53. package/dist/m365/file/commands/file-move.js +22 -35
  54. package/dist/m365/flow/commands/flow-disable.js +10 -26
  55. package/dist/m365/flow/commands/flow-enable.js +10 -26
  56. package/dist/m365/flow/commands/flow-export.js +45 -71
  57. package/dist/m365/flow/commands/flow-get.js +10 -26
  58. package/dist/m365/flow/commands/flow-list.js +17 -48
  59. package/dist/m365/flow/commands/flow-remove.js +11 -38
  60. package/dist/m365/flow/commands/owner/owner-ensure.js +30 -65
  61. package/dist/m365/flow/commands/owner/owner-list.js +10 -35
  62. package/dist/m365/flow/commands/owner/owner-remove.js +30 -61
  63. package/dist/m365/flow/commands/run/run-cancel.js +11 -37
  64. package/dist/m365/flow/commands/run/run-get.js +12 -43
  65. package/dist/m365/flow/commands/run/run-list.js +29 -61
  66. package/dist/m365/flow/commands/run/run-resubmit.js +11 -37
  67. package/dist/m365/graph/commands/changelog/changelog-list.js +68 -67
  68. package/dist/m365/graph/commands/schemaextension/schemaextension-add.js +25 -31
  69. package/dist/m365/graph/commands/schemaextension/schemaextension-get.js +8 -15
  70. package/dist/m365/graph/commands/schemaextension/schemaextension-list.js +26 -50
  71. package/dist/m365/graph/commands/schemaextension/schemaextension-remove.js +9 -24
  72. package/dist/m365/graph/commands/schemaextension/schemaextension-set.js +32 -53
  73. package/dist/m365/graph/commands/subscription/subscription-add.js +63 -89
  74. package/dist/m365/outlook/commands/calendar/calendar-list.js +64 -0
  75. package/dist/m365/outlook/commands/mail/mail-send.js +55 -84
  76. package/dist/m365/outlook/commands/message/message-get.js +27 -27
  77. package/dist/m365/outlook/commands/message/message-list.js +53 -80
  78. package/dist/m365/outlook/commands/message/message-move.js +43 -40
  79. package/dist/m365/outlook/commands/message/message-remove.js +17 -45
  80. package/dist/m365/outlook/commands.js +1 -0
  81. package/dist/m365/spo/commands/list/list-sensitivitylabel-remove.js +83 -0
  82. package/dist/m365/spo/commands.js +1 -0
  83. package/docs/docs/cmd/outlook/calendar/calendar-list.mdx +155 -0
  84. package/docs/docs/cmd/spo/list/list-sensitivitylabel-remove.mdx +77 -0
  85. package/npm-shrinkwrap.json +7 -0
  86. package/package.json +1 -1
@@ -1,16 +1,20 @@
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 _EntraAppRoleAssignmentAddCommand_instances, _EntraAppRoleAssignmentAddCommand_initTelemetry, _EntraAppRoleAssignmentAddCommand_initOptions, _EntraAppRoleAssignmentAddCommand_initValidators, _EntraAppRoleAssignmentAddCommand_initOptionSets;
7
1
  import os from 'os';
2
+ import { z } from 'zod';
3
+ import { globalOptionsZod } from '../../../../Command.js';
8
4
  import request from '../../../../request.js';
9
5
  import { formatting } from '../../../../utils/formatting.js';
10
6
  import { validation } from '../../../../utils/validation.js';
11
7
  import GraphCommand from '../../../base/GraphCommand.js';
12
8
  import commands from '../../commands.js';
13
9
  import { cli } from '../../../../cli/cli.js';
10
+ export const options = z.strictObject({
11
+ ...globalOptionsZod.shape,
12
+ appId: z.uuid().optional(),
13
+ appObjectId: z.uuid().optional(),
14
+ appDisplayName: z.string().optional(),
15
+ resource: z.string().alias('r'),
16
+ scopes: z.string().transform((value) => value.split(',').map(String)).alias('s')
17
+ });
14
18
  class EntraAppRoleAssignmentAddCommand extends GraphCommand {
15
19
  get name() {
16
20
  return commands.APPROLEASSIGNMENT_ADD;
@@ -18,13 +22,18 @@ class EntraAppRoleAssignmentAddCommand extends GraphCommand {
18
22
  get description() {
19
23
  return 'Adds service principal permissions also known as scopes and app role assignments for specified Microsoft Entra application registration';
20
24
  }
21
- constructor() {
22
- super();
23
- _EntraAppRoleAssignmentAddCommand_instances.add(this);
24
- __classPrivateFieldGet(this, _EntraAppRoleAssignmentAddCommand_instances, "m", _EntraAppRoleAssignmentAddCommand_initTelemetry).call(this);
25
- __classPrivateFieldGet(this, _EntraAppRoleAssignmentAddCommand_instances, "m", _EntraAppRoleAssignmentAddCommand_initOptions).call(this);
26
- __classPrivateFieldGet(this, _EntraAppRoleAssignmentAddCommand_instances, "m", _EntraAppRoleAssignmentAddCommand_initValidators).call(this);
27
- __classPrivateFieldGet(this, _EntraAppRoleAssignmentAddCommand_instances, "m", _EntraAppRoleAssignmentAddCommand_initOptionSets).call(this);
25
+ get schema() {
26
+ return options;
27
+ }
28
+ getRefinedSchema(schema) {
29
+ return schema
30
+ .refine(options => [options.appId, options.appObjectId, options.appDisplayName].filter(o => o !== undefined).length === 1, {
31
+ error: 'Specify either appId, appObjectId, or appDisplayName',
32
+ params: {
33
+ customCode: 'optionSet',
34
+ options: ['appId', 'appObjectId', 'appDisplayName']
35
+ }
36
+ });
28
37
  }
29
38
  async commandAction(logger, args) {
30
39
  let objectId;
@@ -100,7 +109,7 @@ class EntraAppRoleAssignmentAddCommand extends GraphCommand {
100
109
  throw `The resource '${args.options.resource}' does not have any application permissions available.`;
101
110
  }
102
111
  // search for match between the found app roles and the specified scopes option value
103
- for (const scope of args.options.scopes.split(',')) {
112
+ for (const scope of args.options.scopes) {
104
113
  const existingRoles = appRolesFound.filter((role) => {
105
114
  return role.value.toLocaleLowerCase() === scope.toLocaleLowerCase().trim();
106
115
  });
@@ -149,39 +158,5 @@ class EntraAppRoleAssignmentAddCommand extends GraphCommand {
149
158
  return request.post(requestOptions);
150
159
  }
151
160
  }
152
- _EntraAppRoleAssignmentAddCommand_instances = new WeakSet(), _EntraAppRoleAssignmentAddCommand_initTelemetry = function _EntraAppRoleAssignmentAddCommand_initTelemetry() {
153
- this.telemetry.push((args) => {
154
- Object.assign(this.telemetryProperties, {
155
- appId: typeof args.options.appId !== 'undefined',
156
- appObjectId: typeof args.options.appObjectId !== 'undefined',
157
- appDisplayName: typeof args.options.appDisplayName !== 'undefined'
158
- });
159
- });
160
- }, _EntraAppRoleAssignmentAddCommand_initOptions = function _EntraAppRoleAssignmentAddCommand_initOptions() {
161
- this.options.unshift({
162
- option: '--appId [appId]'
163
- }, {
164
- option: '--appObjectId [appObjectId]'
165
- }, {
166
- option: '--appDisplayName [appDisplayName]'
167
- }, {
168
- option: '-r, --resource <resource>',
169
- autocomplete: ['Microsoft Graph', 'SharePoint', 'OneNote', 'Exchange', 'Microsoft Forms', 'Azure Active Directory Graph', 'Skype for Business']
170
- }, {
171
- option: '-s, --scopes <scopes>'
172
- });
173
- }, _EntraAppRoleAssignmentAddCommand_initValidators = function _EntraAppRoleAssignmentAddCommand_initValidators() {
174
- this.validators.push(async (args) => {
175
- if (args.options.appId && !validation.isValidGuid(args.options.appId)) {
176
- return `${args.options.appId} is not a valid GUID`;
177
- }
178
- if (args.options.appObjectId && !validation.isValidGuid(args.options.appObjectId)) {
179
- return `${args.options.appObjectId} is not a valid GUID`;
180
- }
181
- return true;
182
- });
183
- }, _EntraAppRoleAssignmentAddCommand_initOptionSets = function _EntraAppRoleAssignmentAddCommand_initOptionSets() {
184
- this.optionSets.push({ options: ['appId', 'appObjectId', 'appDisplayName'] });
185
- };
186
161
  export default new EntraAppRoleAssignmentAddCommand();
187
162
  //# sourceMappingURL=approleassignment-add.js.map
@@ -1,14 +1,15 @@
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 _EntraAppRoleAssignmentListCommand_instances, _EntraAppRoleAssignmentListCommand_initTelemetry, _EntraAppRoleAssignmentListCommand_initOptions, _EntraAppRoleAssignmentListCommand_initValidators, _EntraAppRoleAssignmentListCommand_initOptionSets;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import request from '../../../../request.js';
8
4
  import { formatting } from '../../../../utils/formatting.js';
9
- import { validation } from '../../../../utils/validation.js';
10
5
  import GraphCommand from '../../../base/GraphCommand.js';
11
6
  import commands from '../../commands.js';
7
+ export const options = z.strictObject({
8
+ ...globalOptionsZod.shape,
9
+ appId: z.uuid().optional().alias('i'),
10
+ appDisplayName: z.string().optional().alias('n'),
11
+ appObjectId: z.uuid().optional()
12
+ });
12
13
  class EntraAppRoleAssignmentListCommand extends GraphCommand {
13
14
  get name() {
14
15
  return commands.APPROLEASSIGNMENT_LIST;
@@ -16,13 +17,18 @@ class EntraAppRoleAssignmentListCommand extends GraphCommand {
16
17
  get description() {
17
18
  return 'Lists app role assignments for the specified application registration';
18
19
  }
19
- constructor() {
20
- super();
21
- _EntraAppRoleAssignmentListCommand_instances.add(this);
22
- __classPrivateFieldGet(this, _EntraAppRoleAssignmentListCommand_instances, "m", _EntraAppRoleAssignmentListCommand_initTelemetry).call(this);
23
- __classPrivateFieldGet(this, _EntraAppRoleAssignmentListCommand_instances, "m", _EntraAppRoleAssignmentListCommand_initOptions).call(this);
24
- __classPrivateFieldGet(this, _EntraAppRoleAssignmentListCommand_instances, "m", _EntraAppRoleAssignmentListCommand_initValidators).call(this);
25
- __classPrivateFieldGet(this, _EntraAppRoleAssignmentListCommand_instances, "m", _EntraAppRoleAssignmentListCommand_initOptionSets).call(this);
20
+ get schema() {
21
+ return options;
22
+ }
23
+ getRefinedSchema(schema) {
24
+ return schema
25
+ .refine(options => [options.appId, options.appObjectId, options.appDisplayName].filter(o => o !== undefined).length === 1, {
26
+ error: 'Specify either appId, appObjectId, or appDisplayName',
27
+ params: {
28
+ customCode: 'optionSet',
29
+ options: ['appId', 'appObjectId', 'appDisplayName']
30
+ }
31
+ });
26
32
  }
27
33
  defaultProperties() {
28
34
  return ['resourceDisplayName', 'roleName'];
@@ -115,34 +121,5 @@ class EntraAppRoleAssignmentListCommand extends GraphCommand {
115
121
  return request.get(spRequestOptions);
116
122
  }
117
123
  }
118
- _EntraAppRoleAssignmentListCommand_instances = new WeakSet(), _EntraAppRoleAssignmentListCommand_initTelemetry = function _EntraAppRoleAssignmentListCommand_initTelemetry() {
119
- this.telemetry.push((args) => {
120
- Object.assign(this.telemetryProperties, {
121
- appId: typeof args.options.appId !== 'undefined',
122
- appDisplayName: typeof args.options.appDisplayName !== 'undefined',
123
- appObjectId: typeof args.options.appObjectId !== 'undefined'
124
- });
125
- });
126
- }, _EntraAppRoleAssignmentListCommand_initOptions = function _EntraAppRoleAssignmentListCommand_initOptions() {
127
- this.options.unshift({
128
- option: '-i, --appId [appId]'
129
- }, {
130
- option: '-n, --appDisplayName [appDisplayName]'
131
- }, {
132
- option: '--appObjectId [appObjectId]'
133
- });
134
- }, _EntraAppRoleAssignmentListCommand_initValidators = function _EntraAppRoleAssignmentListCommand_initValidators() {
135
- this.validators.push(async (args) => {
136
- if (args.options.appId && !validation.isValidGuid(args.options.appId)) {
137
- return `${args.options.appId} is not a valid GUID`;
138
- }
139
- if (args.options.appObjectId && !validation.isValidGuid(args.options.appObjectId)) {
140
- return `${args.options.appObjectId} is not a valid GUID`;
141
- }
142
- return true;
143
- });
144
- }, _EntraAppRoleAssignmentListCommand_initOptionSets = function _EntraAppRoleAssignmentListCommand_initOptionSets() {
145
- this.optionSets.push({ options: ['appId', 'appObjectId', 'appDisplayName'] });
146
- };
147
124
  export default new EntraAppRoleAssignmentListCommand();
148
125
  //# sourceMappingURL=approleassignment-list.js.map
@@ -1,16 +1,21 @@
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 _EntraAppRoleAssignmentRemoveCommand_instances, _EntraAppRoleAssignmentRemoveCommand_initTelemetry, _EntraAppRoleAssignmentRemoveCommand_initOptions, _EntraAppRoleAssignmentRemoveCommand_initValidators, _EntraAppRoleAssignmentRemoveCommand_initOptionSets;
7
1
  import os from 'os';
2
+ import { z } from 'zod';
8
3
  import { cli } from '../../../../cli/cli.js';
4
+ import { globalOptionsZod } from '../../../../Command.js';
9
5
  import request from '../../../../request.js';
10
6
  import { formatting } from '../../../../utils/formatting.js';
11
7
  import { validation } from '../../../../utils/validation.js';
12
8
  import GraphCommand from '../../../base/GraphCommand.js';
13
9
  import commands from '../../commands.js';
10
+ export const options = z.strictObject({
11
+ ...globalOptionsZod.shape,
12
+ appId: z.uuid().optional(),
13
+ appObjectId: z.uuid().optional(),
14
+ appDisplayName: z.string().optional(),
15
+ resource: z.string().alias('r'),
16
+ scopes: z.string().transform((value) => value.split(',').map(String)).alias('s'),
17
+ force: z.boolean().optional().alias('f')
18
+ });
14
19
  class EntraAppRoleAssignmentRemoveCommand extends GraphCommand {
15
20
  get name() {
16
21
  return commands.APPROLEASSIGNMENT_REMOVE;
@@ -18,13 +23,18 @@ class EntraAppRoleAssignmentRemoveCommand extends GraphCommand {
18
23
  get description() {
19
24
  return 'Deletes an app role assignment for the specified Entra Application Registration';
20
25
  }
21
- constructor() {
22
- super();
23
- _EntraAppRoleAssignmentRemoveCommand_instances.add(this);
24
- __classPrivateFieldGet(this, _EntraAppRoleAssignmentRemoveCommand_instances, "m", _EntraAppRoleAssignmentRemoveCommand_initTelemetry).call(this);
25
- __classPrivateFieldGet(this, _EntraAppRoleAssignmentRemoveCommand_instances, "m", _EntraAppRoleAssignmentRemoveCommand_initOptions).call(this);
26
- __classPrivateFieldGet(this, _EntraAppRoleAssignmentRemoveCommand_instances, "m", _EntraAppRoleAssignmentRemoveCommand_initValidators).call(this);
27
- __classPrivateFieldGet(this, _EntraAppRoleAssignmentRemoveCommand_instances, "m", _EntraAppRoleAssignmentRemoveCommand_initOptionSets).call(this);
26
+ get schema() {
27
+ return options;
28
+ }
29
+ getRefinedSchema(schema) {
30
+ return schema
31
+ .refine(options => [options.appId, options.appObjectId, options.appDisplayName].filter(o => o !== undefined).length === 1, {
32
+ error: 'Specify either appId, appObjectId, or appDisplayName',
33
+ params: {
34
+ customCode: 'optionSet',
35
+ options: ['appId', 'appObjectId', 'appDisplayName']
36
+ }
37
+ });
28
38
  }
29
39
  async commandAction(logger, args) {
30
40
  const removeAppRoleAssignment = async () => {
@@ -80,7 +90,7 @@ class EntraAppRoleAssignmentRemoveCommand extends GraphCommand {
80
90
  if (!appRolesFound.length) {
81
91
  throw `The resource '${args.options.resource}' does not have any application permissions available.`;
82
92
  }
83
- for (const scope of args.options.scopes.split(',')) {
93
+ for (const scope of args.options.scopes) {
84
94
  const existingRoles = appRolesFound.filter((role) => {
85
95
  return role.value.toLocaleLowerCase() === scope.toLocaleLowerCase().trim();
86
96
  });
@@ -138,42 +148,5 @@ class EntraAppRoleAssignmentRemoveCommand extends GraphCommand {
138
148
  return request.delete(spRequestOptions);
139
149
  }
140
150
  }
141
- _EntraAppRoleAssignmentRemoveCommand_instances = new WeakSet(), _EntraAppRoleAssignmentRemoveCommand_initTelemetry = function _EntraAppRoleAssignmentRemoveCommand_initTelemetry() {
142
- this.telemetry.push((args) => {
143
- Object.assign(this.telemetryProperties, {
144
- appId: typeof args.options.appId !== 'undefined',
145
- appDisplayName: typeof args.options.appDisplayName !== 'undefined',
146
- appObjectId: typeof args.options.appObjectId !== 'undefined',
147
- force: (!!args.options.force).toString()
148
- });
149
- });
150
- }, _EntraAppRoleAssignmentRemoveCommand_initOptions = function _EntraAppRoleAssignmentRemoveCommand_initOptions() {
151
- this.options.unshift({
152
- option: '--appId [appId]'
153
- }, {
154
- option: '--appObjectId [appObjectId]'
155
- }, {
156
- option: '--appDisplayName [appDisplayName]'
157
- }, {
158
- option: '-r, --resource <resource>',
159
- autocomplete: ['Microsoft Graph', 'SharePoint', 'OneNote', 'Exchange', 'Microsoft Forms', 'Azure Active Directory Graph', 'Skype for Business']
160
- }, {
161
- option: '-s, --scopes <scopes>'
162
- }, {
163
- option: '-f, --force'
164
- });
165
- }, _EntraAppRoleAssignmentRemoveCommand_initValidators = function _EntraAppRoleAssignmentRemoveCommand_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
- return true;
174
- });
175
- }, _EntraAppRoleAssignmentRemoveCommand_initOptionSets = function _EntraAppRoleAssignmentRemoveCommand_initOptionSets() {
176
- this.optionSets.push({ options: ['appId', 'appObjectId', 'appDisplayName'] });
177
- };
178
151
  export default new EntraAppRoleAssignmentRemoveCommand();
179
152
  //# sourceMappingURL=approleassignment-remove.js.map
@@ -1,15 +1,16 @@
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 _EntraEnterpriseAppAddCommand_instances, _EntraEnterpriseAppAddCommand_initTelemetry, _EntraEnterpriseAppAddCommand_initOptions, _EntraEnterpriseAppAddCommand_initValidators, _EntraEnterpriseAppAddCommand_initOptionSets;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import request from '../../../../request.js';
8
4
  import { formatting } from '../../../../utils/formatting.js';
9
- import { validation } from '../../../../utils/validation.js';
10
5
  import GraphCommand from '../../../base/GraphCommand.js';
11
6
  import commands from '../../commands.js';
12
7
  import { cli } from '../../../../cli/cli.js';
8
+ export const options = z.strictObject({
9
+ ...globalOptionsZod.shape,
10
+ id: z.uuid().optional().alias('i'),
11
+ displayName: z.string().optional().alias('n'),
12
+ objectId: z.uuid().optional()
13
+ });
13
14
  class EntraEnterpriseAppAddCommand extends GraphCommand {
14
15
  get name() {
15
16
  return commands.ENTERPRISEAPP_ADD;
@@ -20,13 +21,18 @@ class EntraEnterpriseAppAddCommand extends GraphCommand {
20
21
  alias() {
21
22
  return [commands.SP_ADD];
22
23
  }
23
- constructor() {
24
- super();
25
- _EntraEnterpriseAppAddCommand_instances.add(this);
26
- __classPrivateFieldGet(this, _EntraEnterpriseAppAddCommand_instances, "m", _EntraEnterpriseAppAddCommand_initTelemetry).call(this);
27
- __classPrivateFieldGet(this, _EntraEnterpriseAppAddCommand_instances, "m", _EntraEnterpriseAppAddCommand_initOptions).call(this);
28
- __classPrivateFieldGet(this, _EntraEnterpriseAppAddCommand_instances, "m", _EntraEnterpriseAppAddCommand_initValidators).call(this);
29
- __classPrivateFieldGet(this, _EntraEnterpriseAppAddCommand_instances, "m", _EntraEnterpriseAppAddCommand_initOptionSets).call(this);
24
+ get schema() {
25
+ return options;
26
+ }
27
+ getRefinedSchema(schema) {
28
+ return schema
29
+ .refine(options => [options.id, options.displayName, options.objectId].filter(o => o !== undefined).length === 1, {
30
+ error: 'Specify either id, displayName, or objectId',
31
+ params: {
32
+ customCode: 'optionSet',
33
+ options: ['id', 'displayName', 'objectId']
34
+ }
35
+ });
30
36
  }
31
37
  async getAppId(args) {
32
38
  if (args.options.id) {
@@ -80,34 +86,5 @@ class EntraEnterpriseAppAddCommand extends GraphCommand {
80
86
  }
81
87
  }
82
88
  }
83
- _EntraEnterpriseAppAddCommand_instances = new WeakSet(), _EntraEnterpriseAppAddCommand_initTelemetry = function _EntraEnterpriseAppAddCommand_initTelemetry() {
84
- this.telemetry.push((args) => {
85
- Object.assign(this.telemetryProperties, {
86
- id: (!(!args.options.id)).toString(),
87
- displayName: (!(!args.options.displayName)).toString(),
88
- objectId: (!(!args.options.objectId)).toString()
89
- });
90
- });
91
- }, _EntraEnterpriseAppAddCommand_initOptions = function _EntraEnterpriseAppAddCommand_initOptions() {
92
- this.options.unshift({
93
- option: '-i, --id [id]'
94
- }, {
95
- option: '-n, --displayName [displayName]'
96
- }, {
97
- option: '--objectId [objectId]'
98
- });
99
- }, _EntraEnterpriseAppAddCommand_initValidators = function _EntraEnterpriseAppAddCommand_initValidators() {
100
- this.validators.push(async (args) => {
101
- if (args.options.id && !validation.isValidGuid(args.options.id)) {
102
- return `${args.options.id} is not a valid GUID`;
103
- }
104
- if (args.options.objectId && !validation.isValidGuid(args.options.objectId)) {
105
- return `${args.options.objectId} is not a valid GUID`;
106
- }
107
- return true;
108
- });
109
- }, _EntraEnterpriseAppAddCommand_initOptionSets = function _EntraEnterpriseAppAddCommand_initOptionSets() {
110
- this.optionSets.push({ options: ['id', 'displayName', 'objectId'] });
111
- };
112
89
  export default new EntraEnterpriseAppAddCommand();
113
90
  //# sourceMappingURL=enterpriseapp-add.js.map
@@ -1,15 +1,16 @@
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 _EntraEnterpriseAppGetCommand_instances, _EntraEnterpriseAppGetCommand_initTelemetry, _EntraEnterpriseAppGetCommand_initOptions, _EntraEnterpriseAppGetCommand_initValidators, _EntraEnterpriseAppGetCommand_initOptionSets;
1
+ import { z } from 'zod';
7
2
  import { cli } from '../../../../cli/cli.js';
3
+ import { globalOptionsZod } from '../../../../Command.js';
8
4
  import request from '../../../../request.js';
9
5
  import { formatting } from '../../../../utils/formatting.js';
10
- import { validation } from '../../../../utils/validation.js';
11
6
  import GraphCommand from '../../../base/GraphCommand.js';
12
7
  import commands from '../../commands.js';
8
+ export const options = z.strictObject({
9
+ ...globalOptionsZod.shape,
10
+ id: z.uuid().optional().alias('i'),
11
+ displayName: z.string().optional().alias('n'),
12
+ objectId: z.uuid().optional()
13
+ });
13
14
  class EntraEnterpriseAppGetCommand extends GraphCommand {
14
15
  get name() {
15
16
  return commands.ENTERPRISEAPP_GET;
@@ -20,13 +21,18 @@ class EntraEnterpriseAppGetCommand extends GraphCommand {
20
21
  alias() {
21
22
  return [commands.SP_GET];
22
23
  }
23
- constructor() {
24
- super();
25
- _EntraEnterpriseAppGetCommand_instances.add(this);
26
- __classPrivateFieldGet(this, _EntraEnterpriseAppGetCommand_instances, "m", _EntraEnterpriseAppGetCommand_initTelemetry).call(this);
27
- __classPrivateFieldGet(this, _EntraEnterpriseAppGetCommand_instances, "m", _EntraEnterpriseAppGetCommand_initOptions).call(this);
28
- __classPrivateFieldGet(this, _EntraEnterpriseAppGetCommand_instances, "m", _EntraEnterpriseAppGetCommand_initValidators).call(this);
29
- __classPrivateFieldGet(this, _EntraEnterpriseAppGetCommand_instances, "m", _EntraEnterpriseAppGetCommand_initOptionSets).call(this);
24
+ get schema() {
25
+ return options;
26
+ }
27
+ getRefinedSchema(schema) {
28
+ return schema
29
+ .refine(options => [options.id, options.displayName, options.objectId].filter(o => o !== undefined).length === 1, {
30
+ error: 'Specify either id, displayName, or objectId',
31
+ params: {
32
+ customCode: 'optionSet',
33
+ options: ['id', 'displayName', 'objectId']
34
+ }
35
+ });
30
36
  }
31
37
  async getSpId(args) {
32
38
  if (args.options.objectId) {
@@ -80,34 +86,5 @@ class EntraEnterpriseAppGetCommand extends GraphCommand {
80
86
  }
81
87
  }
82
88
  }
83
- _EntraEnterpriseAppGetCommand_instances = new WeakSet(), _EntraEnterpriseAppGetCommand_initTelemetry = function _EntraEnterpriseAppGetCommand_initTelemetry() {
84
- this.telemetry.push((args) => {
85
- Object.assign(this.telemetryProperties, {
86
- id: (!(!args.options.id)).toString(),
87
- displayName: (!(!args.options.displayName)).toString(),
88
- objectId: (!(!args.options.objectId)).toString()
89
- });
90
- });
91
- }, _EntraEnterpriseAppGetCommand_initOptions = function _EntraEnterpriseAppGetCommand_initOptions() {
92
- this.options.unshift({
93
- option: '-i, --id [id]'
94
- }, {
95
- option: '-n, --displayName [displayName]'
96
- }, {
97
- option: '--objectId [objectId]'
98
- });
99
- }, _EntraEnterpriseAppGetCommand_initValidators = function _EntraEnterpriseAppGetCommand_initValidators() {
100
- this.validators.push(async (args) => {
101
- if (args.options.id && !validation.isValidGuid(args.options.id)) {
102
- return `${args.options.id} is not a valid GUID`;
103
- }
104
- if (args.options.objectId && !validation.isValidGuid(args.options.objectId)) {
105
- return `${args.options.objectId} is not a valid GUID`;
106
- }
107
- return true;
108
- });
109
- }, _EntraEnterpriseAppGetCommand_initOptionSets = function _EntraEnterpriseAppGetCommand_initOptionSets() {
110
- this.optionSets.push({ options: ['id', 'displayName', 'objectId'] });
111
- };
112
89
  export default new EntraEnterpriseAppGetCommand();
113
90
  //# sourceMappingURL=enterpriseapp-get.js.map
@@ -1,12 +1,13 @@
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 _EntraEnterpriseAppListCommand_instances, _EntraEnterpriseAppListCommand_initTelemetry, _EntraEnterpriseAppListCommand_initOptions;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import { odata } from '../../../../utils/odata.js';
8
4
  import GraphCommand from '../../../base/GraphCommand.js';
9
5
  import commands from '../../commands.js';
6
+ export const options = z.strictObject({
7
+ ...globalOptionsZod.shape,
8
+ displayName: z.string().optional().alias('n'),
9
+ tag: z.string().optional()
10
+ });
10
11
  class EntraEnterpriseAppListCommand extends GraphCommand {
11
12
  get name() {
12
13
  return commands.ENTERPRISEAPP_LIST;
@@ -20,11 +21,8 @@ class EntraEnterpriseAppListCommand extends GraphCommand {
20
21
  alias() {
21
22
  return [commands.SP_LIST];
22
23
  }
23
- constructor() {
24
- super();
25
- _EntraEnterpriseAppListCommand_instances.add(this);
26
- __classPrivateFieldGet(this, _EntraEnterpriseAppListCommand_instances, "m", _EntraEnterpriseAppListCommand_initTelemetry).call(this);
27
- __classPrivateFieldGet(this, _EntraEnterpriseAppListCommand_instances, "m", _EntraEnterpriseAppListCommand_initOptions).call(this);
24
+ get schema() {
25
+ return options;
28
26
  }
29
27
  async commandAction(logger, args) {
30
28
  if (this.verbose) {
@@ -50,19 +48,5 @@ class EntraEnterpriseAppListCommand extends GraphCommand {
50
48
  }
51
49
  }
52
50
  }
53
- _EntraEnterpriseAppListCommand_instances = new WeakSet(), _EntraEnterpriseAppListCommand_initTelemetry = function _EntraEnterpriseAppListCommand_initTelemetry() {
54
- this.telemetry.push((args) => {
55
- Object.assign(this.telemetryProperties, {
56
- displayName: typeof args.options.displayName !== 'undefined',
57
- tag: typeof args.options.tag !== 'undefined'
58
- });
59
- });
60
- }, _EntraEnterpriseAppListCommand_initOptions = function _EntraEnterpriseAppListCommand_initOptions() {
61
- this.options.unshift({
62
- option: '-n, --displayName [displayName]'
63
- }, {
64
- option: '--tag [tag]'
65
- });
66
- };
67
51
  export default new EntraEnterpriseAppListCommand();
68
52
  //# sourceMappingURL=enterpriseapp-list.js.map
@@ -1,16 +1,18 @@
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 _EntraEnterpriseAppRemoveCommand_instances, _EntraEnterpriseAppRemoveCommand_initTelemetry, _EntraEnterpriseAppRemoveCommand_initOptions, _EntraEnterpriseAppRemoveCommand_initValidators, _EntraEnterpriseAppRemoveCommand_initOptionSets, _EntraEnterpriseAppRemoveCommand_initTypes;
1
+ import { z } from 'zod';
7
2
  import { cli } from '../../../../cli/cli.js';
3
+ import { globalOptionsZod } from '../../../../Command.js';
8
4
  import request from '../../../../request.js';
9
5
  import { odata } from '../../../../utils/odata.js';
10
6
  import { formatting } from '../../../../utils/formatting.js';
11
- import { validation } from '../../../../utils/validation.js';
12
7
  import GraphCommand from '../../../base/GraphCommand.js';
13
8
  import commands from '../../commands.js';
9
+ export const options = z.strictObject({
10
+ ...globalOptionsZod.shape,
11
+ id: z.uuid().optional().alias('i'),
12
+ displayName: z.string().optional().alias('n'),
13
+ objectId: z.uuid().optional(),
14
+ force: z.boolean().optional().alias('f')
15
+ });
14
16
  class EntraEnterpriseAppRemoveCommand extends GraphCommand {
15
17
  get name() {
16
18
  return commands.ENTERPRISEAPP_REMOVE;
@@ -21,14 +23,18 @@ class EntraEnterpriseAppRemoveCommand extends GraphCommand {
21
23
  alias() {
22
24
  return [commands.SP_REMOVE];
23
25
  }
24
- constructor() {
25
- super();
26
- _EntraEnterpriseAppRemoveCommand_instances.add(this);
27
- __classPrivateFieldGet(this, _EntraEnterpriseAppRemoveCommand_instances, "m", _EntraEnterpriseAppRemoveCommand_initTelemetry).call(this);
28
- __classPrivateFieldGet(this, _EntraEnterpriseAppRemoveCommand_instances, "m", _EntraEnterpriseAppRemoveCommand_initOptions).call(this);
29
- __classPrivateFieldGet(this, _EntraEnterpriseAppRemoveCommand_instances, "m", _EntraEnterpriseAppRemoveCommand_initValidators).call(this);
30
- __classPrivateFieldGet(this, _EntraEnterpriseAppRemoveCommand_instances, "m", _EntraEnterpriseAppRemoveCommand_initOptionSets).call(this);
31
- __classPrivateFieldGet(this, _EntraEnterpriseAppRemoveCommand_instances, "m", _EntraEnterpriseAppRemoveCommand_initTypes).call(this);
26
+ get schema() {
27
+ return options;
28
+ }
29
+ getRefinedSchema(schema) {
30
+ return schema
31
+ .refine(options => [options.id, options.displayName, options.objectId].filter(o => o !== undefined).length === 1, {
32
+ error: 'Specify either id, displayName, or objectId',
33
+ params: {
34
+ customCode: 'optionSet',
35
+ options: ['id', 'displayName', 'objectId']
36
+ }
37
+ });
32
38
  }
33
39
  async commandAction(logger, args) {
34
40
  const removeEnterpriseApplication = async () => {
@@ -84,40 +90,5 @@ class EntraEnterpriseAppRemoveCommand extends GraphCommand {
84
90
  return spItem.id;
85
91
  }
86
92
  }
87
- _EntraEnterpriseAppRemoveCommand_instances = new WeakSet(), _EntraEnterpriseAppRemoveCommand_initTelemetry = function _EntraEnterpriseAppRemoveCommand_initTelemetry() {
88
- this.telemetry.push((args) => {
89
- Object.assign(this.telemetryProperties, {
90
- id: typeof args.options.id !== 'undefined',
91
- displayName: typeof args.options.displayName !== 'undefined',
92
- objectId: typeof args.options.objectId !== 'undefined',
93
- force: !!args.options.force
94
- });
95
- });
96
- }, _EntraEnterpriseAppRemoveCommand_initOptions = function _EntraEnterpriseAppRemoveCommand_initOptions() {
97
- this.options.unshift({
98
- option: '-i, --id [id]'
99
- }, {
100
- option: '-n, --displayName [displayName]'
101
- }, {
102
- option: '--objectId [objectId]'
103
- }, {
104
- option: '-f, --force'
105
- });
106
- }, _EntraEnterpriseAppRemoveCommand_initValidators = function _EntraEnterpriseAppRemoveCommand_initValidators() {
107
- this.validators.push(async (args) => {
108
- if (args.options.id && !validation.isValidGuid(args.options.id)) {
109
- return `The option 'id' with value '${args.options.id}' is not a valid GUID.`;
110
- }
111
- if (args.options.objectId && !validation.isValidGuid(args.options.objectId)) {
112
- return `The option 'objectId' with value '${args.options.objectId}' is not a valid GUID.`;
113
- }
114
- return true;
115
- });
116
- }, _EntraEnterpriseAppRemoveCommand_initOptionSets = function _EntraEnterpriseAppRemoveCommand_initOptionSets() {
117
- this.optionSets.push({ options: ['id', 'displayName', 'objectId'] });
118
- }, _EntraEnterpriseAppRemoveCommand_initTypes = function _EntraEnterpriseAppRemoveCommand_initTypes() {
119
- this.types.string.push('id', 'displayName', 'objectId');
120
- this.types.boolean.push('force');
121
- };
122
93
  export default new EntraEnterpriseAppRemoveCommand();
123
94
  //# sourceMappingURL=enterpriseapp-remove.js.map