@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,14 +1,17 @@
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 _EntraUserLicenseListCommand_instances, _EntraUserLicenseListCommand_initTelemetry, _EntraUserLicenseListCommand_initOptions, _EntraUserLicenseListCommand_initValidators, _EntraUserLicenseListCommand_initOptionSets;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import { odata } from '../../../../utils/odata.js';
8
4
  import { formatting } from '../../../../utils/formatting.js';
9
5
  import { validation } from '../../../../utils/validation.js';
10
6
  import commands from '../../commands.js';
11
7
  import GraphDelegatedCommand from '../../../base/GraphDelegatedCommand.js';
8
+ export const options = z.strictObject({
9
+ ...globalOptionsZod.shape,
10
+ userId: z.uuid().optional(),
11
+ userName: z.string().refine(name => validation.isValidUserPrincipalName(name), {
12
+ error: e => `'${e.input}' is not a valid user principal name (UPN).`
13
+ }).optional()
14
+ });
12
15
  class EntraUserLicenseListCommand extends GraphDelegatedCommand {
13
16
  get name() {
14
17
  return commands.USER_LICENSE_LIST;
@@ -19,13 +22,18 @@ class EntraUserLicenseListCommand extends GraphDelegatedCommand {
19
22
  defaultProperties() {
20
23
  return ['id', 'skuId', 'skuPartNumber'];
21
24
  }
22
- constructor() {
23
- super();
24
- _EntraUserLicenseListCommand_instances.add(this);
25
- __classPrivateFieldGet(this, _EntraUserLicenseListCommand_instances, "m", _EntraUserLicenseListCommand_initTelemetry).call(this);
26
- __classPrivateFieldGet(this, _EntraUserLicenseListCommand_instances, "m", _EntraUserLicenseListCommand_initOptions).call(this);
27
- __classPrivateFieldGet(this, _EntraUserLicenseListCommand_instances, "m", _EntraUserLicenseListCommand_initValidators).call(this);
28
- __classPrivateFieldGet(this, _EntraUserLicenseListCommand_instances, "m", _EntraUserLicenseListCommand_initOptionSets).call(this);
25
+ get schema() {
26
+ return options;
27
+ }
28
+ getRefinedSchema(schema) {
29
+ return schema
30
+ .refine(options => !options.userId || !options.userName, {
31
+ error: `Specify either 'userId' or 'userName', but not both.`,
32
+ params: {
33
+ customCode: 'optionSet',
34
+ options: ['userId', 'userName']
35
+ }
36
+ });
29
37
  }
30
38
  async commandAction(logger, args) {
31
39
  if (this.verbose) {
@@ -48,34 +56,5 @@ class EntraUserLicenseListCommand extends GraphDelegatedCommand {
48
56
  }
49
57
  }
50
58
  }
51
- _EntraUserLicenseListCommand_instances = new WeakSet(), _EntraUserLicenseListCommand_initTelemetry = function _EntraUserLicenseListCommand_initTelemetry() {
52
- this.telemetry.push((args) => {
53
- Object.assign(this.telemetryProperties, {
54
- userId: typeof args.options.userId !== 'undefined',
55
- userName: typeof args.options.userName !== 'undefined'
56
- });
57
- });
58
- }, _EntraUserLicenseListCommand_initOptions = function _EntraUserLicenseListCommand_initOptions() {
59
- this.options.unshift({
60
- option: '--userId [userId]'
61
- }, {
62
- option: '--userName [userName]'
63
- });
64
- }, _EntraUserLicenseListCommand_initValidators = function _EntraUserLicenseListCommand_initValidators() {
65
- this.validators.push(async (args) => {
66
- if (args.options.userId && !validation.isValidGuid(args.options.userId)) {
67
- return `${args.options.userId} is not a valid GUID`;
68
- }
69
- if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) {
70
- return `${args.options.userName} is not a valid user principal name (UPN)`;
71
- }
72
- return true;
73
- });
74
- }, _EntraUserLicenseListCommand_initOptionSets = function _EntraUserLicenseListCommand_initOptionSets() {
75
- this.optionSets.push({
76
- options: ['userId', 'userName'],
77
- runsWhen: (args) => args.options.userId || args.options.userName
78
- });
79
- };
80
59
  export default new EntraUserLicenseListCommand();
81
60
  //# sourceMappingURL=user-license-list.js.map
@@ -1,15 +1,22 @@
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 _EntraUserLicenseRemoveCommand_instances, _EntraUserLicenseRemoveCommand_initTelemetry, _EntraUserLicenseRemoveCommand_initOptions, _EntraUserLicenseRemoveCommand_initOptionSets, _EntraUserLicenseRemoveCommand_initValidators;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import commands from '../../commands.js';
8
4
  import request from '../../../../request.js';
9
5
  import { validation } from '../../../../utils/validation.js';
10
6
  import { formatting } from '../../../../utils/formatting.js';
11
7
  import { cli } from '../../../../cli/cli.js';
12
8
  import GraphCommand from '../../../base/GraphCommand.js';
9
+ export const options = z.strictObject({
10
+ ...globalOptionsZod.shape,
11
+ userId: z.uuid().optional(),
12
+ userName: z.string().refine(name => validation.isValidUserPrincipalName(name), {
13
+ error: e => `'${e.input}' is not a valid user principal name (UPN).`
14
+ }).optional(),
15
+ ids: z.string().refine(ids => !ids.split(',').some(e => !validation.isValidGuid(e)), {
16
+ error: e => `'${e.input}' contains one or more invalid GUIDs.`
17
+ }),
18
+ force: z.boolean().optional().alias('f')
19
+ });
13
20
  class EntraUserLicenseRemoveCommand extends GraphCommand {
14
21
  get name() {
15
22
  return commands.USER_LICENSE_REMOVE;
@@ -17,13 +24,18 @@ class EntraUserLicenseRemoveCommand extends GraphCommand {
17
24
  get description() {
18
25
  return 'Removes a license from a user';
19
26
  }
20
- constructor() {
21
- super();
22
- _EntraUserLicenseRemoveCommand_instances.add(this);
23
- __classPrivateFieldGet(this, _EntraUserLicenseRemoveCommand_instances, "m", _EntraUserLicenseRemoveCommand_initTelemetry).call(this);
24
- __classPrivateFieldGet(this, _EntraUserLicenseRemoveCommand_instances, "m", _EntraUserLicenseRemoveCommand_initOptions).call(this);
25
- __classPrivateFieldGet(this, _EntraUserLicenseRemoveCommand_instances, "m", _EntraUserLicenseRemoveCommand_initValidators).call(this);
26
- __classPrivateFieldGet(this, _EntraUserLicenseRemoveCommand_instances, "m", _EntraUserLicenseRemoveCommand_initOptionSets).call(this);
27
+ get schema() {
28
+ return options;
29
+ }
30
+ getRefinedSchema(schema) {
31
+ return schema
32
+ .refine(options => [options.userId, options.userName].filter(o => o !== undefined).length === 1, {
33
+ error: `Specify either 'userId' or 'userName'.`,
34
+ params: {
35
+ customCode: 'optionSet',
36
+ options: ['userId', 'userName']
37
+ }
38
+ });
27
39
  }
28
40
  async commandAction(logger, args) {
29
41
  if (this.verbose) {
@@ -58,39 +70,5 @@ class EntraUserLicenseRemoveCommand extends GraphCommand {
58
70
  }
59
71
  }
60
72
  }
61
- _EntraUserLicenseRemoveCommand_instances = new WeakSet(), _EntraUserLicenseRemoveCommand_initTelemetry = function _EntraUserLicenseRemoveCommand_initTelemetry() {
62
- this.telemetry.push((args) => {
63
- Object.assign(this.telemetryProperties, {
64
- userId: typeof args.options.userId !== 'undefined',
65
- userName: typeof args.options.userName !== 'undefined',
66
- force: !!args.options.force
67
- });
68
- });
69
- }, _EntraUserLicenseRemoveCommand_initOptions = function _EntraUserLicenseRemoveCommand_initOptions() {
70
- this.options.unshift({
71
- option: '--userId [userId]'
72
- }, {
73
- option: '--userName [userName]'
74
- }, {
75
- option: '--ids <ids>'
76
- }, {
77
- option: '-f, --force'
78
- });
79
- }, _EntraUserLicenseRemoveCommand_initOptionSets = function _EntraUserLicenseRemoveCommand_initOptionSets() {
80
- this.optionSets.push({ options: ['userId', 'userName'] });
81
- }, _EntraUserLicenseRemoveCommand_initValidators = function _EntraUserLicenseRemoveCommand_initValidators() {
82
- this.validators.push(async (args) => {
83
- if (args.options.userId && !validation.isValidGuid(args.options.userId)) {
84
- return `${args.options.userId} is not a valid GUID`;
85
- }
86
- if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) {
87
- return `${args.options.userName} is not a valid user principal name (UPN)`;
88
- }
89
- if (args.options.ids && args.options.ids.split(',').some(e => !validation.isValidGuid(e))) {
90
- return `${args.options.ids} contains one or more invalid GUIDs`;
91
- }
92
- return true;
93
- });
94
- };
95
73
  export default new EntraUserLicenseRemoveCommand();
96
74
  //# sourceMappingURL=user-license-remove.js.map
@@ -1,14 +1,17 @@
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 _EntraUserListCommand_instances, _a, _EntraUserListCommand_initTelemetry, _EntraUserListCommand_initOptions, _EntraUserListCommand_initValidators, _EntraUserListCommand_initTypes;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import { formatting } from '../../../../utils/formatting.js';
8
4
  import { odata } from '../../../../utils/odata.js';
9
5
  import GraphCommand from '../../../base/GraphCommand.js';
10
6
  import commands from '../../commands.js';
11
7
  import { optionsUtils } from '../../../../utils/optionsUtils.js';
8
+ import { zod } from '../../../../utils/zod.js';
9
+ const allowedTypes = { Member: 'Member', Guest: 'Guest' };
10
+ export const options = z.looseObject({
11
+ ...globalOptionsZod.shape,
12
+ type: zod.coercedEnum(allowedTypes).optional(),
13
+ properties: z.string().optional().alias('p')
14
+ });
12
15
  class EntraUserListCommand extends GraphCommand {
13
16
  get name() {
14
17
  return commands.USER_LIST;
@@ -22,13 +25,8 @@ class EntraUserListCommand extends GraphCommand {
22
25
  defaultProperties() {
23
26
  return ['id', 'displayName', 'mail', 'userPrincipalName'];
24
27
  }
25
- constructor() {
26
- super();
27
- _EntraUserListCommand_instances.add(this);
28
- __classPrivateFieldGet(this, _EntraUserListCommand_instances, "m", _EntraUserListCommand_initTelemetry).call(this);
29
- __classPrivateFieldGet(this, _EntraUserListCommand_instances, "m", _EntraUserListCommand_initOptions).call(this);
30
- __classPrivateFieldGet(this, _EntraUserListCommand_instances, "m", _EntraUserListCommand_initValidators).call(this);
31
- __classPrivateFieldGet(this, _EntraUserListCommand_instances, "m", _EntraUserListCommand_initTypes).call(this);
28
+ get schema() {
29
+ return options;
32
30
  }
33
31
  async commandAction(logger, args) {
34
32
  try {
@@ -57,7 +55,7 @@ class EntraUserListCommand extends GraphCommand {
57
55
  }
58
56
  getFilter(options) {
59
57
  const filters = [];
60
- const unknownOptions = optionsUtils.getUnknownOptions(options, this.options);
58
+ const unknownOptions = optionsUtils.getUnknownOptions(options, zod.schemaToOptions(this.schema));
61
59
  Object.keys(unknownOptions).forEach(key => {
62
60
  if (typeof options[key] === 'boolean') {
63
61
  throw `Specify value for the ${key} property`;
@@ -73,30 +71,5 @@ class EntraUserListCommand extends GraphCommand {
73
71
  return null;
74
72
  }
75
73
  }
76
- _a = EntraUserListCommand, _EntraUserListCommand_instances = new WeakSet(), _EntraUserListCommand_initTelemetry = function _EntraUserListCommand_initTelemetry() {
77
- this.telemetry.push((args) => {
78
- Object.assign(this.telemetryProperties, {
79
- type: typeof args.options.type !== 'undefined',
80
- properties: typeof args.options.properties !== 'undefined'
81
- });
82
- });
83
- }, _EntraUserListCommand_initOptions = function _EntraUserListCommand_initOptions() {
84
- this.options.unshift({
85
- option: '--type [type]',
86
- autocomplete: _a.allowedTypes
87
- }, {
88
- option: '-p, --properties [properties]'
89
- });
90
- }, _EntraUserListCommand_initValidators = function _EntraUserListCommand_initValidators() {
91
- this.validators.push(async (args) => {
92
- if (args.options.type && !_a.allowedTypes.some(t => t.toLowerCase() === args.options.type.toLowerCase())) {
93
- return `'${args.options.type}' is not a valid value for option 'type'. Allowed values are: ${_a.allowedTypes.join(', ')}.`;
94
- }
95
- return true;
96
- });
97
- }, _EntraUserListCommand_initTypes = function _EntraUserListCommand_initTypes() {
98
- this.types.string.push('type', 'properties');
99
- };
100
- EntraUserListCommand.allowedTypes = ['Member', 'Guest'];
101
74
  export default new EntraUserListCommand();
102
75
  //# sourceMappingURL=user-list.js.map
@@ -1,12 +1,12 @@
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 _EntraUserPasswordValidateCommand_instances, _EntraUserPasswordValidateCommand_initOptions;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import request from '../../../../request.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
+ password: z.string().alias('p')
9
+ });
10
10
  class EntraUserPasswordValidateCommand extends GraphCommand {
11
11
  get name() {
12
12
  return commands.USER_PASSWORD_VALIDATE;
@@ -14,10 +14,8 @@ class EntraUserPasswordValidateCommand extends GraphCommand {
14
14
  get description() {
15
15
  return "Check a user's password against the organization's password validation policy";
16
16
  }
17
- constructor() {
18
- super();
19
- _EntraUserPasswordValidateCommand_instances.add(this);
20
- __classPrivateFieldGet(this, _EntraUserPasswordValidateCommand_instances, "m", _EntraUserPasswordValidateCommand_initOptions).call(this);
17
+ get schema() {
18
+ return options;
21
19
  }
22
20
  async commandAction(logger, args) {
23
21
  try {
@@ -39,10 +37,5 @@ class EntraUserPasswordValidateCommand extends GraphCommand {
39
37
  }
40
38
  }
41
39
  }
42
- _EntraUserPasswordValidateCommand_instances = new WeakSet(), _EntraUserPasswordValidateCommand_initOptions = function _EntraUserPasswordValidateCommand_initOptions() {
43
- this.options.unshift({
44
- option: '-p, --password <password>'
45
- });
46
- };
47
40
  export default new EntraUserPasswordValidateCommand();
48
41
  //# sourceMappingURL=user-password-validate.js.map
@@ -1,14 +1,14 @@
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 _EntraUserRecycleBinItemClearCommand_instances, _EntraUserRecycleBinItemClearCommand_initTelemetry, _EntraUserRecycleBinItemClearCommand_initOptions;
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 GraphCommand from '../../../base/GraphCommand.js';
11
7
  import commands from '../../commands.js';
8
+ export const options = z.strictObject({
9
+ ...globalOptionsZod.shape,
10
+ force: z.boolean().optional().alias('f')
11
+ });
12
12
  class EntraUserRecycleBinItemClearCommand extends GraphCommand {
13
13
  get name() {
14
14
  return commands.USER_RECYCLEBINITEM_CLEAR;
@@ -16,11 +16,8 @@ class EntraUserRecycleBinItemClearCommand extends GraphCommand {
16
16
  get description() {
17
17
  return 'Removes all users from the tenant recycle bin';
18
18
  }
19
- constructor() {
20
- super();
21
- _EntraUserRecycleBinItemClearCommand_instances.add(this);
22
- __classPrivateFieldGet(this, _EntraUserRecycleBinItemClearCommand_instances, "m", _EntraUserRecycleBinItemClearCommand_initTelemetry).call(this);
23
- __classPrivateFieldGet(this, _EntraUserRecycleBinItemClearCommand_instances, "m", _EntraUserRecycleBinItemClearCommand_initOptions).call(this);
19
+ get schema() {
20
+ return options;
24
21
  }
25
22
  async commandAction(logger, args) {
26
23
  const clearRecycleBinUsers = async () => {
@@ -70,16 +67,5 @@ class EntraUserRecycleBinItemClearCommand extends GraphCommand {
70
67
  }
71
68
  }
72
69
  }
73
- _EntraUserRecycleBinItemClearCommand_instances = new WeakSet(), _EntraUserRecycleBinItemClearCommand_initTelemetry = function _EntraUserRecycleBinItemClearCommand_initTelemetry() {
74
- this.telemetry.push((args) => {
75
- Object.assign(this.telemetryProperties, {
76
- force: !!args.options.force
77
- });
78
- });
79
- }, _EntraUserRecycleBinItemClearCommand_initOptions = function _EntraUserRecycleBinItemClearCommand_initOptions() {
80
- this.options.unshift({
81
- option: '-f, --force'
82
- });
83
- };
84
70
  export default new EntraUserRecycleBinItemClearCommand();
85
71
  //# sourceMappingURL=user-recyclebinitem-clear.js.map
@@ -1,14 +1,14 @@
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 _EntraUserRecycleBinItemRemoveCommand_instances, _EntraUserRecycleBinItemRemoveCommand_initTelemetry, _EntraUserRecycleBinItemRemoveCommand_initOptions, _EntraUserRecycleBinItemRemoveCommand_initValidators;
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
- 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
+ id: z.uuid(),
10
+ force: z.boolean().optional().alias('f')
11
+ });
12
12
  class EntraUserRecycleBinItemRemoveCommand extends GraphCommand {
13
13
  get name() {
14
14
  return commands.USER_RECYCLEBINITEM_REMOVE;
@@ -16,12 +16,8 @@ class EntraUserRecycleBinItemRemoveCommand extends GraphCommand {
16
16
  get description() {
17
17
  return 'Removes a user from the recycle bin in the current tenant';
18
18
  }
19
- constructor() {
20
- super();
21
- _EntraUserRecycleBinItemRemoveCommand_instances.add(this);
22
- __classPrivateFieldGet(this, _EntraUserRecycleBinItemRemoveCommand_instances, "m", _EntraUserRecycleBinItemRemoveCommand_initTelemetry).call(this);
23
- __classPrivateFieldGet(this, _EntraUserRecycleBinItemRemoveCommand_instances, "m", _EntraUserRecycleBinItemRemoveCommand_initOptions).call(this);
24
- __classPrivateFieldGet(this, _EntraUserRecycleBinItemRemoveCommand_instances, "m", _EntraUserRecycleBinItemRemoveCommand_initValidators).call(this);
19
+ get schema() {
20
+ return options;
25
21
  }
26
22
  async commandAction(logger, args) {
27
23
  const clearRecycleBinItem = async () => {
@@ -50,25 +46,5 @@ class EntraUserRecycleBinItemRemoveCommand extends GraphCommand {
50
46
  }
51
47
  }
52
48
  }
53
- _EntraUserRecycleBinItemRemoveCommand_instances = new WeakSet(), _EntraUserRecycleBinItemRemoveCommand_initTelemetry = function _EntraUserRecycleBinItemRemoveCommand_initTelemetry() {
54
- this.telemetry.push((args) => {
55
- Object.assign(this.telemetryProperties, {
56
- force: !!args.options.force
57
- });
58
- });
59
- }, _EntraUserRecycleBinItemRemoveCommand_initOptions = function _EntraUserRecycleBinItemRemoveCommand_initOptions() {
60
- this.options.unshift({
61
- option: '--id <id>'
62
- }, {
63
- option: '-f, --force'
64
- });
65
- }, _EntraUserRecycleBinItemRemoveCommand_initValidators = function _EntraUserRecycleBinItemRemoveCommand_initValidators() {
66
- this.validators.push(async (args) => {
67
- if (args.options.id && !validation.isValidGuid(args.options.id)) {
68
- return `${args.options.id} is not a valid GUID`;
69
- }
70
- return true;
71
- });
72
- };
73
49
  export default new EntraUserRecycleBinItemRemoveCommand();
74
50
  //# sourceMappingURL=user-recyclebinitem-remove.js.map
@@ -1,13 +1,12 @@
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 _EntraUserRecycleBinItemRestoreCommand_instances, _EntraUserRecycleBinItemRestoreCommand_initOptions, _EntraUserRecycleBinItemRestoreCommand_initValidators;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import request from '../../../../request.js';
8
- import { validation } from '../../../../utils/validation.js';
9
4
  import GraphCommand from '../../../base/GraphCommand.js';
10
5
  import commands from '../../commands.js';
6
+ export const options = z.strictObject({
7
+ ...globalOptionsZod.shape,
8
+ id: z.uuid()
9
+ });
11
10
  class EntraUserRecycleBinItemRestoreCommand extends GraphCommand {
12
11
  get name() {
13
12
  return commands.USER_RECYCLEBINITEM_RESTORE;
@@ -15,11 +14,8 @@ class EntraUserRecycleBinItemRestoreCommand extends GraphCommand {
15
14
  get description() {
16
15
  return 'Restores a user from the tenant recycle bin';
17
16
  }
18
- constructor() {
19
- super();
20
- _EntraUserRecycleBinItemRestoreCommand_instances.add(this);
21
- __classPrivateFieldGet(this, _EntraUserRecycleBinItemRestoreCommand_instances, "m", _EntraUserRecycleBinItemRestoreCommand_initOptions).call(this);
22
- __classPrivateFieldGet(this, _EntraUserRecycleBinItemRestoreCommand_instances, "m", _EntraUserRecycleBinItemRestoreCommand_initValidators).call(this);
17
+ get schema() {
18
+ return options;
23
19
  }
24
20
  async commandAction(logger, args) {
25
21
  if (this.verbose) {
@@ -41,17 +37,5 @@ class EntraUserRecycleBinItemRestoreCommand extends GraphCommand {
41
37
  }
42
38
  }
43
39
  }
44
- _EntraUserRecycleBinItemRestoreCommand_instances = new WeakSet(), _EntraUserRecycleBinItemRestoreCommand_initOptions = function _EntraUserRecycleBinItemRestoreCommand_initOptions() {
45
- this.options.unshift({
46
- option: '--id <id>'
47
- });
48
- }, _EntraUserRecycleBinItemRestoreCommand_initValidators = function _EntraUserRecycleBinItemRestoreCommand_initValidators() {
49
- this.validators.push(async (args) => {
50
- if (args.options.id && !validation.isValidGuid(args.options.id)) {
51
- return `${args.options.id} is not a valid GUID`;
52
- }
53
- return true;
54
- });
55
- };
56
40
  export default new EntraUserRecycleBinItemRestoreCommand();
57
41
  //# sourceMappingURL=user-recyclebinitem-restore.js.map
@@ -1,17 +1,50 @@
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 _EntraUserRegistrationDetailsListCommand_instances, _EntraUserRegistrationDetailsListCommand_initTelemetry, _EntraUserRegistrationDetailsListCommand_initOptions, _EntraUserRegistrationDetailsListCommand_initValidators;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import GraphCommand from '../../../base/GraphCommand.js';
8
4
  import commands from '../../commands.js';
9
5
  import { odata } from '../../../../utils/odata.js';
10
6
  import { entraUser } from '../../../../utils/entraUser.js';
11
7
  import { validation } from '../../../../utils/validation.js';
12
8
  import { formatting } from '../../../../utils/formatting.js';
13
- const authenticationMethods = ['push', 'oath', 'voiceMobile', 'voiceAlternateMobile', 'voiceOffice', 'sms', 'none'];
14
- const methodsRegistered = ['mobilePhone', 'email', 'fido2', 'microsoftAuthenticatorPush', 'softwareOneTimePasscode'];
9
+ const authenticationMethodValues = ['push', 'oath', 'voiceMobile', 'voiceAlternateMobile', 'voiceOffice', 'sms', 'none'];
10
+ const methodsRegisteredValues = ['mobilePhone', 'email', 'fido2', 'microsoftAuthenticatorPush', 'softwareOneTimePasscode'];
11
+ export const options = z.strictObject({
12
+ ...globalOptionsZod.shape,
13
+ isAdmin: z.boolean().optional(),
14
+ userType: z.enum(['member', 'guest']).optional(),
15
+ userPreferredMethodForSecondaryAuthentication: z.string().refine(val => {
16
+ const methods = val.split(',').map(m => m.trim());
17
+ return methods.every(m => authenticationMethodValues.includes(m));
18
+ }, {
19
+ error: e => `'${e.input}' is not a valid userPreferredMethodForSecondaryAuthentication value. Allowed values ${authenticationMethodValues.join(', ')}.`
20
+ }).optional(),
21
+ systemPreferredAuthenticationMethods: z.string().refine(val => {
22
+ const methods = val.split(',').map(m => m.trim());
23
+ return methods.every(m => authenticationMethodValues.includes(m));
24
+ }, {
25
+ error: e => `'${e.input}' is not a valid systemPreferredAuthenticationMethods value. Allowed values ${authenticationMethodValues.join(', ')}.`
26
+ }).optional(),
27
+ isSelfServicePasswordResetRegistered: z.boolean().optional(),
28
+ isSelfServicePasswordResetEnabled: z.boolean().optional(),
29
+ isSelfServicePasswordResetCapable: z.boolean().optional(),
30
+ isMfaRegistered: z.boolean().optional(),
31
+ isMfaCapable: z.boolean().optional(),
32
+ isPasswordlessCapable: z.boolean().optional(),
33
+ isSystemPreferredAuthenticationMethodEnabled: z.boolean().optional(),
34
+ methodsRegistered: z.string().refine(val => {
35
+ const methods = val.split(',').map(m => m.trim());
36
+ return methods.every(m => methodsRegisteredValues.includes(m));
37
+ }, {
38
+ error: e => `'${e.input}' is not a valid methodsRegistered value. Allowed values ${methodsRegisteredValues.join(', ')}.`
39
+ }).optional(),
40
+ userIds: z.string().refine(val => validation.isValidGuidArray(val) === true, {
41
+ error: e => `The following GUIDs are invalid for the option 'userIds': ${validation.isValidGuidArray(e.input)}.`
42
+ }).optional(),
43
+ userPrincipalNames: z.string().refine(val => validation.isValidUserPrincipalNameArray(val) === true, {
44
+ error: e => `The following user principal names are invalid for the option 'userPrincipalNames': ${validation.isValidUserPrincipalNameArray(e.input)}.`
45
+ }).optional(),
46
+ properties: z.string().optional().alias('p')
47
+ });
15
48
  class EntraUserRegistrationDetailsListCommand extends GraphCommand {
16
49
  get name() {
17
50
  return commands.USER_REGISTRATIONDETAILS_LIST;
@@ -22,12 +55,8 @@ class EntraUserRegistrationDetailsListCommand extends GraphCommand {
22
55
  defaultProperties() {
23
56
  return ['userPrincipalName', 'methodsRegistered', 'lastUpdatedDateTime'];
24
57
  }
25
- constructor() {
26
- super();
27
- _EntraUserRegistrationDetailsListCommand_instances.add(this);
28
- __classPrivateFieldGet(this, _EntraUserRegistrationDetailsListCommand_instances, "m", _EntraUserRegistrationDetailsListCommand_initTelemetry).call(this);
29
- __classPrivateFieldGet(this, _EntraUserRegistrationDetailsListCommand_instances, "m", _EntraUserRegistrationDetailsListCommand_initOptions).call(this);
30
- __classPrivateFieldGet(this, _EntraUserRegistrationDetailsListCommand_instances, "m", _EntraUserRegistrationDetailsListCommand_initValidators).call(this);
58
+ get schema() {
59
+ return options;
31
60
  }
32
61
  async commandAction(logger, args) {
33
62
  try {
@@ -116,104 +145,5 @@ class EntraUserRegistrationDetailsListCommand extends GraphCommand {
116
145
  return `${this.resource}/v1.0/reports/authenticationMethods/userRegistrationDetails${queryString}`;
117
146
  }
118
147
  }
119
- _EntraUserRegistrationDetailsListCommand_instances = new WeakSet(), _EntraUserRegistrationDetailsListCommand_initTelemetry = function _EntraUserRegistrationDetailsListCommand_initTelemetry() {
120
- this.telemetry.push((args) => {
121
- Object.assign(this.telemetryProperties, {
122
- isAdmin: !!args.options.isAdmin,
123
- userType: typeof args.options.userType !== 'undefined',
124
- userPreferredMethodForSecondaryAuthentication: typeof args.options.userPreferredMethodForSecondaryAuthentication !== 'undefined',
125
- systemPreferredAuthenticationMethods: typeof args.options.systemPreferredAuthenticationMethods !== 'undefined',
126
- isSelfServicePasswordResetRegistered: !!args.options.isSelfServicePasswordResetRegistered,
127
- isSelfServicePasswordResetEnabled: !!args.options.isSelfServicePasswordResetEnabled,
128
- isSelfServicePasswordResetCapable: !!args.options.isSelfServicePasswordResetCapable,
129
- isMfaRegistered: !!args.options.isMfaRegistered,
130
- isMfaCapable: !!args.options.isMfaCapable,
131
- isPasswordlessCapable: !!args.options.isPasswordlessCapable,
132
- isSystemPreferredAuthenticationMethodEnabled: !!args.options.isSystemPreferredAuthenticationMethodEnabled,
133
- methodsRegistered: typeof args.options.methodsRegistered !== 'undefined',
134
- userIds: typeof args.options.userIds !== 'undefined',
135
- userPrincipalNames: typeof args.options.userPrincipalNames !== 'undefined',
136
- properties: typeof args.options.properties !== 'undefined'
137
- });
138
- });
139
- }, _EntraUserRegistrationDetailsListCommand_initOptions = function _EntraUserRegistrationDetailsListCommand_initOptions() {
140
- this.options.unshift({
141
- option: '--isAdmin [isAdmin]'
142
- }, {
143
- option: '--userType [userType]',
144
- autocomplete: ['member', 'guest']
145
- }, {
146
- option: '--userPreferredMethodForSecondaryAuthentication [userPreferredMethodForSecondaryAuthentication ]',
147
- autocomplete: authenticationMethods
148
- }, {
149
- option: '--systemPreferredAuthenticationMethods [systemPreferredAuthenticationMethods ]',
150
- autocomplete: authenticationMethods
151
- }, {
152
- option: '--isSelfServicePasswordResetRegistered [isSelfServicePasswordResetRegistered]'
153
- }, {
154
- option: '--isSelfServicePasswordResetEnabled [isSelfServicePasswordResetEnabled]'
155
- }, {
156
- option: '--isSelfServicePasswordResetCapable [isSelfServicePasswordResetCapable]'
157
- }, {
158
- option: '--isMfaRegistered [isMfaRegistered]'
159
- }, {
160
- option: '--isMfaCapable [isMfaCapable]'
161
- }, {
162
- option: '--isPasswordlessCapable [isPasswordlessCapable]'
163
- }, {
164
- option: '--isSystemPreferredAuthenticationMethodEnabled [isSystemPreferredAuthenticationMethodEnabled]'
165
- }, {
166
- option: '--methodsRegistered [methodsRegistered]',
167
- autocomplete: methodsRegistered
168
- }, {
169
- option: '--userIds [userIds]'
170
- }, {
171
- option: '--userPrincipalNames [userPrincipalNames]'
172
- }, {
173
- option: '-p, --properties [properties]'
174
- });
175
- }, _EntraUserRegistrationDetailsListCommand_initValidators = function _EntraUserRegistrationDetailsListCommand_initValidators() {
176
- this.validators.push(async (args) => {
177
- if (args.options.userType) {
178
- if (['member', 'guest'].every(type => type !== args.options.userType)) {
179
- return `'${args.options.userType}' is not a valid userType value. Allowed values member, guest`;
180
- }
181
- }
182
- if (args.options.userPreferredMethodForSecondaryAuthentication) {
183
- const methods = args.options.userPreferredMethodForSecondaryAuthentication.split(',').map(m => m.trim());
184
- const invalidMethods = methods.filter(m => !authenticationMethods.includes(m));
185
- if (invalidMethods.length > 0) {
186
- return `'${args.options.userPreferredMethodForSecondaryAuthentication}' is not a valid userPreferredMethodForSecondaryAuthentication value. Invalid values: ${invalidMethods.join(',')}. Allowed values ${authenticationMethods.join(', ')}`;
187
- }
188
- }
189
- if (args.options.systemPreferredAuthenticationMethods) {
190
- const methods = args.options.systemPreferredAuthenticationMethods.split(',').map(m => m.trim());
191
- const invalidMethods = methods.filter(m => !authenticationMethods.includes(m));
192
- if (invalidMethods.length > 0) {
193
- return `'${args.options.systemPreferredAuthenticationMethods}' is not a valid systemPreferredAuthenticationMethods value. Invalid values: ${invalidMethods.join(',')}. Allowed values ${authenticationMethods.join(', ')}`;
194
- }
195
- }
196
- if (args.options.methodsRegistered) {
197
- const methods = args.options.methodsRegistered.split(',').map(m => m.trim());
198
- const invalidMethods = methods.filter(m => !methodsRegistered.includes(m));
199
- if (invalidMethods.length > 0) {
200
- return `'${args.options.methodsRegistered}' is not a valid methodsRegistered value. Invalid values: ${invalidMethods.join(',')}. Allowed values ${methodsRegistered.join(', ')}`;
201
- }
202
- }
203
- if (args.options.userIds) {
204
- const isValidGUIDArrayResult = validation.isValidGuidArray(args.options.userIds);
205
- if (isValidGUIDArrayResult !== true) {
206
- return `The following GUIDs are invalid for the option 'userIds': ${isValidGUIDArrayResult}.`;
207
- }
208
- }
209
- if (args.options.userPrincipalNames) {
210
- const isValidUPNArrayResult = validation.isValidUserPrincipalNameArray(args.options.userPrincipalNames);
211
- if (isValidUPNArrayResult !== true) {
212
- return `The following user principal names are invalid for the option 'userPrincipalNames': ${isValidUPNArrayResult}.`;
213
- }
214
- }
215
- return true;
216
- });
217
- };
218
148
  export default new EntraUserRegistrationDetailsListCommand();
219
149
  //# sourceMappingURL=user-registrationdetails-list.js.map