@pnp/cli-microsoft365 11.10.0-beta.6b0583b → 11.10.0-beta.df8d498

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 (113) hide show
  1. package/.devcontainer/Dockerfile +1 -1
  2. package/.devproxy/api-specs/sharepoint-admin.yaml +50 -0
  3. package/Dockerfile +1 -1
  4. package/allCommands.json +1 -1
  5. package/allCommandsFull.json +1 -1
  6. package/dist/Auth.js +4 -2
  7. package/dist/m365/outlook/commands/event/event-get.js +77 -0
  8. package/dist/m365/outlook/commands.js +1 -0
  9. package/dist/m365/planner/commands/roster/roster-add.js +5 -0
  10. package/dist/m365/planner/commands/roster/roster-get.js +8 -18
  11. package/dist/m365/planner/commands/roster/roster-member-add.js +29 -45
  12. package/dist/m365/planner/commands/roster/roster-member-get.js +28 -44
  13. package/dist/m365/planner/commands/roster/roster-member-list.js +8 -18
  14. package/dist/m365/planner/commands/roster/roster-member-remove.js +30 -48
  15. package/dist/m365/planner/commands/roster/roster-plan-list.js +28 -46
  16. package/dist/m365/planner/commands/roster/roster-remove.js +9 -27
  17. package/dist/m365/planner/commands/task/task-add.js +97 -111
  18. package/dist/m365/planner/commands/task/task-checklistitem-add.js +10 -23
  19. package/dist/m365/planner/commands/task/task-checklistitem-list.js +16 -26
  20. package/dist/m365/planner/commands/task/task-checklistitem-remove.js +10 -23
  21. package/dist/m365/planner/commands/task/task-get.js +46 -69
  22. package/dist/m365/planner/commands/task/task-list.js +33 -69
  23. package/dist/m365/planner/commands/task/task-reference-add.js +15 -35
  24. package/dist/m365/planner/commands/task/task-reference-list.js +8 -18
  25. package/dist/m365/planner/commands/task/task-reference-remove.js +26 -36
  26. package/dist/m365/planner/commands/task/task-remove.js +47 -71
  27. package/dist/m365/planner/commands/task/task-set.js +92 -113
  28. package/dist/m365/pp/commands/website/Webrole.js +2 -0
  29. package/dist/m365/pp/commands/website/website-remove.js +80 -0
  30. package/dist/m365/pp/commands/website/website-webrole-list.js +61 -0
  31. package/dist/m365/pp/commands.js +3 -1
  32. package/dist/m365/purview/commands/auditlog/auditlog-list.js +36 -60
  33. package/dist/m365/purview/commands/retentionevent/retentionevent-add.js +34 -53
  34. package/dist/m365/purview/commands/retentionevent/retentionevent-get.js +10 -23
  35. package/dist/m365/purview/commands/retentionevent/retentionevent-remove.js +11 -32
  36. package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-add.js +9 -24
  37. package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-get.js +10 -23
  38. package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-remove.js +11 -32
  39. package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-set.js +21 -35
  40. package/dist/m365/purview/commands/retentionlabel/retentionlabel-add.js +40 -82
  41. package/dist/m365/purview/commands/retentionlabel/retentionlabel-get.js +10 -23
  42. package/dist/m365/purview/commands/retentionlabel/retentionlabel-remove.js +11 -32
  43. package/dist/m365/purview/commands/retentionlabel/retentionlabel-set.js +35 -78
  44. package/dist/m365/purview/commands/sensitivitylabel/sensitivitylabel-get.js +19 -44
  45. package/dist/m365/purview/commands/sensitivitylabel/sensitivitylabel-list.js +16 -39
  46. package/dist/m365/purview/commands/sensitivitylabel/sensitivitylabel-policysettings-list.js +16 -39
  47. package/dist/m365/purview/commands/threatassessment/threatassessment-add.js +44 -67
  48. package/dist/m365/purview/commands/threatassessment/threatassessment-get.js +11 -33
  49. package/dist/m365/purview/commands/threatassessment/threatassessment-list.js +10 -33
  50. package/dist/m365/spfx/commands/SpfxCompatibilityMatrix.js +15 -0
  51. package/dist/m365/spfx/commands/project/project-doctor/doctor-1.23.2.js +19 -0
  52. package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
  53. package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.23.2.js +55 -0
  54. package/dist/m365/spfx/commands/project/project-upgrade.js +2 -1
  55. package/dist/m365/spo/commands/homesite/homesite-remove.js +1 -1
  56. package/dist/m365/spo/commands/web/{web-alert-list.js → web-rule-list.js} +7 -4
  57. package/dist/m365/spo/commands/web/{web-alert-remove.js → web-rule-remove.js} +7 -4
  58. package/dist/m365/spo/commands.js +2 -0
  59. package/dist/utils/powerPlatform.js +20 -0
  60. package/docs/docs/cmd/outlook/event/event-get.mdx +280 -0
  61. package/docs/docs/cmd/pp/website/website-remove.mdx +89 -0
  62. package/docs/docs/cmd/pp/website/website-webrole-list.mdx +139 -0
  63. package/docs/docs/cmd/spfx/project/project-upgrade.mdx +1 -1
  64. package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-add.mdx +21 -0
  65. package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-get.mdx +19 -0
  66. package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-list.mdx +19 -0
  67. package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-remove.mdx +21 -0
  68. package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-set.mdx +21 -0
  69. package/docs/docs/cmd/spo/cdn/cdn-get.mdx +19 -0
  70. package/docs/docs/cmd/spo/cdn/cdn-origin-add.mdx +21 -0
  71. package/docs/docs/cmd/spo/cdn/cdn-origin-list.mdx +19 -0
  72. package/docs/docs/cmd/spo/cdn/cdn-origin-remove.mdx +21 -0
  73. package/docs/docs/cmd/spo/cdn/cdn-policy-list.mdx +19 -0
  74. package/docs/docs/cmd/spo/cdn/cdn-policy-set.mdx +21 -0
  75. package/docs/docs/cmd/spo/cdn/cdn-set.mdx +21 -0
  76. package/docs/docs/cmd/spo/contenttype/contenttype-add.mdx +19 -0
  77. package/docs/docs/cmd/spo/contenttype/contenttype-get.mdx +19 -0
  78. package/docs/docs/cmd/spo/contenttype/contenttype-list.mdx +19 -0
  79. package/docs/docs/cmd/spo/contenttype/contenttype-remove.mdx +21 -0
  80. package/docs/docs/cmd/spo/contenttype/contenttype-set.mdx +21 -0
  81. package/docs/docs/cmd/spo/contenttype/contenttype-sync.mdx +19 -0
  82. package/docs/docs/cmd/spo/field/field-add.mdx +19 -0
  83. package/docs/docs/cmd/spo/field/field-get.mdx +19 -0
  84. package/docs/docs/cmd/spo/field/field-list.mdx +19 -0
  85. package/docs/docs/cmd/spo/field/field-remove.mdx +21 -0
  86. package/docs/docs/cmd/spo/field/field-set.mdx +21 -0
  87. package/docs/docs/cmd/spo/file/file-checkout-undo.mdx +21 -0
  88. package/docs/docs/cmd/spo/file/file-retentionlabel-ensure.mdx +21 -0
  89. package/docs/docs/cmd/spo/file/file-retentionlabel-remove.mdx +21 -0
  90. package/docs/docs/cmd/spo/file/file-roleassignment-add.mdx +21 -0
  91. package/docs/docs/cmd/spo/file/file-roleassignment-remove.mdx +21 -0
  92. package/docs/docs/cmd/spo/file/file-roleinheritance-break.mdx +21 -0
  93. package/docs/docs/cmd/spo/file/file-roleinheritance-reset.mdx +21 -0
  94. package/docs/docs/cmd/spo/file/file-sharinginfo-get.mdx +19 -0
  95. package/docs/docs/cmd/spo/homesite/homesite-add.mdx +21 -2
  96. package/docs/docs/cmd/spo/homesite/homesite-get.mdx +19 -0
  97. package/docs/docs/cmd/spo/homesite/homesite-list.mdx +19 -0
  98. package/docs/docs/cmd/spo/homesite/homesite-remove.mdx +24 -3
  99. package/docs/docs/cmd/spo/homesite/homesite-set.mdx +21 -2
  100. package/docs/docs/cmd/spo/hubsite/hubsite-connect.mdx +21 -0
  101. package/docs/docs/cmd/spo/hubsite/hubsite-data-get.mdx +19 -0
  102. package/docs/docs/cmd/spo/hubsite/hubsite-disconnect.mdx +21 -0
  103. package/docs/docs/cmd/spo/hubsite/hubsite-get.mdx +19 -0
  104. package/docs/docs/cmd/spo/hubsite/hubsite-list.mdx +19 -0
  105. package/docs/docs/cmd/spo/hubsite/hubsite-register.mdx +19 -0
  106. package/docs/docs/cmd/spo/hubsite/hubsite-rights-grant.mdx +21 -0
  107. package/docs/docs/cmd/spo/hubsite/hubsite-rights-revoke.mdx +21 -0
  108. package/docs/docs/cmd/spo/hubsite/hubsite-set.mdx +19 -0
  109. package/docs/docs/cmd/spo/hubsite/hubsite-unregister.mdx +21 -0
  110. package/docs/docs/cmd/spo/web/{web-alert-list.mdx → web-rule-list.mdx} +13 -7
  111. package/docs/docs/cmd/spo/web/{web-alert-remove.mdx → web-rule-remove.mdx} +10 -4
  112. package/npm-shrinkwrap.json +1361 -648
  113. package/package.json +15 -15
@@ -1,9 +1,5 @@
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 _PlannerTaskListCommand_instances, _PlannerTaskListCommand_initTelemetry, _PlannerTaskListCommand_initOptions, _PlannerTaskListCommand_initValidators, _PlannerTaskListCommand_initOptionSets, _PlannerTaskListCommand_initTypes;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import { entraGroup } from '../../../../utils/entraGroup.js';
8
4
  import { formatting } from '../../../../utils/formatting.js';
9
5
  import { odata } from '../../../../utils/odata.js';
@@ -11,6 +7,20 @@ import { planner } from '../../../../utils/planner.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
+ bucketId: z.string().optional(),
13
+ bucketName: z.string().optional(),
14
+ planId: z.string().optional(),
15
+ planTitle: z.string().optional(),
16
+ rosterId: z.string().optional(),
17
+ ownerGroupId: z.string()
18
+ .refine(val => validation.isValidGuid(val), {
19
+ message: 'The value is not a valid GUID.'
20
+ })
21
+ .optional(),
22
+ ownerGroupName: z.string().optional()
23
+ });
14
24
  class PlannerTaskListCommand extends GraphCommand {
15
25
  get name() {
16
26
  return commands.TASK_LIST;
@@ -18,17 +28,26 @@ class PlannerTaskListCommand extends GraphCommand {
18
28
  get description() {
19
29
  return 'Lists planner tasks in a bucket, plan, or tasks for the currently logged in user';
20
30
  }
31
+ get schema() {
32
+ return options;
33
+ }
21
34
  defaultProperties() {
22
35
  return ['id', 'title', 'startDateTime', 'dueDateTime', 'completedDateTime'];
23
36
  }
24
- constructor() {
25
- super();
26
- _PlannerTaskListCommand_instances.add(this);
27
- __classPrivateFieldGet(this, _PlannerTaskListCommand_instances, "m", _PlannerTaskListCommand_initTelemetry).call(this);
28
- __classPrivateFieldGet(this, _PlannerTaskListCommand_instances, "m", _PlannerTaskListCommand_initOptions).call(this);
29
- __classPrivateFieldGet(this, _PlannerTaskListCommand_instances, "m", _PlannerTaskListCommand_initValidators).call(this);
30
- __classPrivateFieldGet(this, _PlannerTaskListCommand_instances, "m", _PlannerTaskListCommand_initOptionSets).call(this);
31
- __classPrivateFieldGet(this, _PlannerTaskListCommand_instances, "m", _PlannerTaskListCommand_initTypes).call(this);
37
+ getRefinedSchema(schema) {
38
+ return schema
39
+ .refine(opts => !(opts.bucketId && opts.bucketName), {
40
+ message: `Specify either 'bucketId' or 'bucketName', but not both.`,
41
+ params: { customCode: 'optionSet', options: ['bucketId', 'bucketName'] }
42
+ })
43
+ .refine(opts => !(opts.bucketName && !opts.rosterId) || [opts.planId, opts.planTitle].filter(x => x !== undefined).length === 1, {
44
+ message: `Specify exactly one of the following options: 'planId' or 'planTitle'.`,
45
+ params: { customCode: 'optionSet', options: ['planId', 'planTitle'] }
46
+ })
47
+ .refine(opts => !opts.planTitle || [opts.ownerGroupId, opts.ownerGroupName].filter(x => x !== undefined).length === 1, {
48
+ message: `Specify exactly one of the following options: 'ownerGroupId' or 'ownerGroupName'.`,
49
+ params: { customCode: 'optionSet', options: ['ownerGroupId', 'ownerGroupName'] }
50
+ });
32
51
  }
33
52
  async commandAction(logger, args) {
34
53
  const bucketName = args.options.bucketName;
@@ -96,60 +115,5 @@ class PlannerTaskListCommand extends GraphCommand {
96
115
  return taskItems;
97
116
  }
98
117
  }
99
- _PlannerTaskListCommand_instances = new WeakSet(), _PlannerTaskListCommand_initTelemetry = function _PlannerTaskListCommand_initTelemetry() {
100
- this.telemetry.push((args) => {
101
- Object.assign(this.telemetryProperties, {
102
- bucketId: typeof args.options.bucketId !== 'undefined',
103
- bucketName: typeof args.options.bucketName !== 'undefined',
104
- planId: typeof args.options.planId !== 'undefined',
105
- planTitle: typeof args.options.planTitle !== 'undefined',
106
- rosterId: typeof args.options.rosterId !== 'undefined',
107
- ownerGroupId: typeof args.options.ownerGroupId !== 'undefined',
108
- ownerGroupName: typeof args.options.ownerGroupName !== 'undefined'
109
- });
110
- });
111
- }, _PlannerTaskListCommand_initOptions = function _PlannerTaskListCommand_initOptions() {
112
- this.options.unshift({
113
- option: '--bucketId [bucketId]'
114
- }, {
115
- option: '--bucketName [bucketName]'
116
- }, {
117
- option: '--planId [planId]'
118
- }, {
119
- option: '--planTitle [planTitle]'
120
- }, {
121
- option: '--rosterId [rosterId]'
122
- }, {
123
- option: '--ownerGroupId [ownerGroupId]'
124
- }, {
125
- option: '--ownerGroupName [ownerGroupName]'
126
- });
127
- }, _PlannerTaskListCommand_initValidators = function _PlannerTaskListCommand_initValidators() {
128
- this.validators.push(async (args) => {
129
- if (args.options.ownerGroupId && !validation.isValidGuid(args.options.ownerGroupId)) {
130
- return `${args.options.ownerGroupId} is not a valid GUID`;
131
- }
132
- return true;
133
- });
134
- }, _PlannerTaskListCommand_initOptionSets = function _PlannerTaskListCommand_initOptionSets() {
135
- this.optionSets.push({
136
- options: ['bucketId', 'bucketName'],
137
- runsWhen: (args) => {
138
- return args.options.bucketId !== undefined || args.options.bucketName !== undefined;
139
- }
140
- }, {
141
- options: ['planId', 'planTitle'],
142
- runsWhen: (args) => {
143
- return args.options.bucketName !== undefined && args.options.rosterId === undefined;
144
- }
145
- }, {
146
- options: ['ownerGroupId', 'ownerGroupName'],
147
- runsWhen: (args) => {
148
- return args.options.planTitle !== undefined;
149
- }
150
- });
151
- }, _PlannerTaskListCommand_initTypes = function _PlannerTaskListCommand_initTypes() {
152
- this.types.string.push('planId', 'planTitle', 'ownerGroupId', 'ownerGroupName', 'bucketId', 'bucketName', 'rosterId');
153
- };
154
118
  export default new PlannerTaskListCommand();
155
119
  //# sourceMappingURL=task-list.js.map
@@ -1,13 +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 _PlannerTaskReferenceAddCommand_instances, _PlannerTaskReferenceAddCommand_initTelemetry, _PlannerTaskReferenceAddCommand_initOptions, _PlannerTaskReferenceAddCommand_initValidators, _PlannerTaskReferenceAddCommand_initTypes;
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
5
  import GraphCommand from '../../../base/GraphCommand.js';
10
6
  import commands from '../../commands.js';
7
+ export const options = z.strictObject({
8
+ ...globalOptionsZod.shape,
9
+ taskId: z.string().alias('i'),
10
+ url: z.string().alias('u'),
11
+ alias: z.string().optional(),
12
+ type: z.string()
13
+ .refine(val => ['powerpoint', 'word', 'excel', 'other'].includes(val.toLocaleLowerCase()), {
14
+ message: 'The type must be one of the following: PowerPoint, Word, Excel, Other.'
15
+ })
16
+ .optional()
17
+ });
11
18
  class PlannerTaskReferenceAddCommand extends GraphCommand {
12
19
  get name() {
13
20
  return commands.TASK_REFERENCE_ADD;
@@ -15,13 +22,8 @@ class PlannerTaskReferenceAddCommand extends GraphCommand {
15
22
  get description() {
16
23
  return 'Adds a new reference to a Planner task';
17
24
  }
18
- constructor() {
19
- super();
20
- _PlannerTaskReferenceAddCommand_instances.add(this);
21
- __classPrivateFieldGet(this, _PlannerTaskReferenceAddCommand_instances, "m", _PlannerTaskReferenceAddCommand_initTelemetry).call(this);
22
- __classPrivateFieldGet(this, _PlannerTaskReferenceAddCommand_instances, "m", _PlannerTaskReferenceAddCommand_initOptions).call(this);
23
- __classPrivateFieldGet(this, _PlannerTaskReferenceAddCommand_instances, "m", _PlannerTaskReferenceAddCommand_initValidators).call(this);
24
- __classPrivateFieldGet(this, _PlannerTaskReferenceAddCommand_instances, "m", _PlannerTaskReferenceAddCommand_initTypes).call(this);
25
+ get schema() {
26
+ return options;
25
27
  }
26
28
  async commandAction(logger, args) {
27
29
  try {
@@ -64,27 +66,5 @@ class PlannerTaskReferenceAddCommand extends GraphCommand {
64
66
  return response['@odata.etag'];
65
67
  }
66
68
  }
67
- _PlannerTaskReferenceAddCommand_instances = new WeakSet(), _PlannerTaskReferenceAddCommand_initTelemetry = function _PlannerTaskReferenceAddCommand_initTelemetry() {
68
- this.telemetry.push((args) => {
69
- Object.assign(this.telemetryProperties, {
70
- alias: typeof args.options.alias !== 'undefined',
71
- type: args.options.type
72
- });
73
- });
74
- }, _PlannerTaskReferenceAddCommand_initOptions = function _PlannerTaskReferenceAddCommand_initOptions() {
75
- this.options.unshift({ option: '-i, --taskId <taskId>' }, { option: '-u, --url <url>' }, { option: '--alias [alias]' }, {
76
- option: '--type [type]',
77
- autocomplete: ['PowerPoint', 'Word', 'Excel', 'Other']
78
- });
79
- }, _PlannerTaskReferenceAddCommand_initValidators = function _PlannerTaskReferenceAddCommand_initValidators() {
80
- this.validators.push(async (args) => {
81
- if (args.options.type && ['powerpoint', 'word', 'excel', 'other'].indexOf(args.options.type.toLocaleLowerCase()) === -1) {
82
- return `${args.options.type} is not a valid type value. Allowed values PowerPoint|Word|Excel|Other`;
83
- }
84
- return true;
85
- });
86
- }, _PlannerTaskReferenceAddCommand_initTypes = function _PlannerTaskReferenceAddCommand_initTypes() {
87
- this.types.string.push('taskId', 'url', 'alias', 'type');
88
- };
89
69
  export default new PlannerTaskReferenceAddCommand();
90
70
  //# sourceMappingURL=task-reference-add.js.map
@@ -1,13 +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 _PlannerTaskReferenceListCommand_instances, _PlannerTaskReferenceListCommand_initOptions, _PlannerTaskReferenceListCommand_initTypes;
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
5
  import GraphCommand from '../../../base/GraphCommand.js';
10
6
  import commands from '../../commands.js';
7
+ export const options = z.strictObject({
8
+ ...globalOptionsZod.shape,
9
+ taskId: z.string().alias('i')
10
+ });
11
11
  class PlannerTaskReferenceListCommand extends GraphCommand {
12
12
  get name() {
13
13
  return commands.TASK_REFERENCE_LIST;
@@ -15,11 +15,8 @@ class PlannerTaskReferenceListCommand extends GraphCommand {
15
15
  get description() {
16
16
  return 'Retrieves the references associated to a Planner task';
17
17
  }
18
- constructor() {
19
- super();
20
- _PlannerTaskReferenceListCommand_instances.add(this);
21
- __classPrivateFieldGet(this, _PlannerTaskReferenceListCommand_instances, "m", _PlannerTaskReferenceListCommand_initOptions).call(this);
22
- __classPrivateFieldGet(this, _PlannerTaskReferenceListCommand_instances, "m", _PlannerTaskReferenceListCommand_initTypes).call(this);
18
+ get schema() {
19
+ return options;
23
20
  }
24
21
  async commandAction(logger, args) {
25
22
  const requestOptions = {
@@ -38,12 +35,5 @@ class PlannerTaskReferenceListCommand extends GraphCommand {
38
35
  }
39
36
  }
40
37
  }
41
- _PlannerTaskReferenceListCommand_instances = new WeakSet(), _PlannerTaskReferenceListCommand_initOptions = function _PlannerTaskReferenceListCommand_initOptions() {
42
- this.options.unshift({
43
- option: '-i, --taskId <taskId>'
44
- });
45
- }, _PlannerTaskReferenceListCommand_initTypes = function _PlannerTaskReferenceListCommand_initTypes() {
46
- this.types.string.push('taskId');
47
- };
48
38
  export default new PlannerTaskReferenceListCommand();
49
39
  //# sourceMappingURL=task-reference-list.js.map
@@ -1,14 +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 _PlannerTaskReferenceRemoveCommand_instances, _PlannerTaskReferenceRemoveCommand_initTelemetry, _PlannerTaskReferenceRemoveCommand_initOptions, _PlannerTaskReferenceRemoveCommand_initValidators, _PlannerTaskReferenceRemoveCommand_initOptionSets, _PlannerTaskReferenceRemoveCommand_initTypes;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import { cli } from '../../../../cli/cli.js';
8
4
  import request from '../../../../request.js';
9
5
  import { formatting } from '../../../../utils/formatting.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
+ url: z.string()
11
+ .refine(val => val.indexOf('https://') === 0 || val.indexOf('http://') === 0, {
12
+ message: 'The url option should contain a valid URL. A valid URL starts with http(s)://'
13
+ })
14
+ .optional()
15
+ .alias('u'),
16
+ alias: z.string().optional(),
17
+ taskId: z.string().alias('i'),
18
+ force: z.boolean().optional().alias('f')
19
+ });
12
20
  class PlannerTaskReferenceRemoveCommand extends GraphCommand {
13
21
  get name() {
14
22
  return commands.TASK_REFERENCE_REMOVE;
@@ -16,14 +24,18 @@ class PlannerTaskReferenceRemoveCommand extends GraphCommand {
16
24
  get description() {
17
25
  return 'Removes the reference from the Planner task';
18
26
  }
19
- constructor() {
20
- super();
21
- _PlannerTaskReferenceRemoveCommand_instances.add(this);
22
- __classPrivateFieldGet(this, _PlannerTaskReferenceRemoveCommand_instances, "m", _PlannerTaskReferenceRemoveCommand_initTelemetry).call(this);
23
- __classPrivateFieldGet(this, _PlannerTaskReferenceRemoveCommand_instances, "m", _PlannerTaskReferenceRemoveCommand_initOptions).call(this);
24
- __classPrivateFieldGet(this, _PlannerTaskReferenceRemoveCommand_instances, "m", _PlannerTaskReferenceRemoveCommand_initValidators).call(this);
25
- __classPrivateFieldGet(this, _PlannerTaskReferenceRemoveCommand_instances, "m", _PlannerTaskReferenceRemoveCommand_initOptionSets).call(this);
26
- __classPrivateFieldGet(this, _PlannerTaskReferenceRemoveCommand_instances, "m", _PlannerTaskReferenceRemoveCommand_initTypes).call(this);
27
+ get schema() {
28
+ return options;
29
+ }
30
+ getRefinedSchema(schema) {
31
+ return schema
32
+ .refine(opts => [opts.url, opts.alias].filter(x => x !== undefined).length === 1, {
33
+ message: `Specify exactly one of the following options: 'url' or 'alias'.`,
34
+ params: {
35
+ customCode: 'optionSet',
36
+ options: ['url', 'alias']
37
+ }
38
+ });
27
39
  }
28
40
  async commandAction(logger, args) {
29
41
  if (args.options.force) {
@@ -89,27 +101,5 @@ class PlannerTaskReferenceRemoveCommand extends GraphCommand {
89
101
  return { etag: taskDetails['@odata.etag'], url };
90
102
  }
91
103
  }
92
- _PlannerTaskReferenceRemoveCommand_instances = new WeakSet(), _PlannerTaskReferenceRemoveCommand_initTelemetry = function _PlannerTaskReferenceRemoveCommand_initTelemetry() {
93
- this.telemetry.push((args) => {
94
- Object.assign(this.telemetryProperties, {
95
- url: typeof args.options.url !== 'undefined',
96
- alias: typeof args.options.alias !== 'undefined',
97
- force: !!args.options.force
98
- });
99
- });
100
- }, _PlannerTaskReferenceRemoveCommand_initOptions = function _PlannerTaskReferenceRemoveCommand_initOptions() {
101
- this.options.unshift({ option: '-u, --url [url]' }, { option: '--alias [alias]' }, { option: '-i, --taskId <taskId>' }, { option: '-f, --force' });
102
- }, _PlannerTaskReferenceRemoveCommand_initValidators = function _PlannerTaskReferenceRemoveCommand_initValidators() {
103
- this.validators.push(async (args) => {
104
- if (args.options.url && args.options.url.indexOf('https://') !== 0 && args.options.url.indexOf('http://') !== 0) {
105
- return 'The url option should contain a valid URL. A valid URL starts with http(s)://';
106
- }
107
- return true;
108
- });
109
- }, _PlannerTaskReferenceRemoveCommand_initOptionSets = function _PlannerTaskReferenceRemoveCommand_initOptionSets() {
110
- this.optionSets.push({ options: ['url', 'alias'] });
111
- }, _PlannerTaskReferenceRemoveCommand_initTypes = function _PlannerTaskReferenceRemoveCommand_initTypes() {
112
- this.types.string.push('url', 'taskId', 'alias');
113
- };
114
104
  export default new PlannerTaskReferenceRemoveCommand();
115
105
  //# sourceMappingURL=task-reference-remove.js.map
@@ -1,9 +1,5 @@
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 _PlannerTaskRemoveCommand_instances, _PlannerTaskRemoveCommand_initTelemetry, _PlannerTaskRemoveCommand_initOptions, _PlannerTaskRemoveCommand_initValidators, _PlannerTaskRemoveCommand_initOptionSets, _PlannerTaskRemoveCommand_initTypes;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import { cli } from '../../../../cli/cli.js';
8
4
  import request from '../../../../request.js';
9
5
  import { entraGroup } from '../../../../utils/entraGroup.js';
@@ -13,6 +9,23 @@ import { validation } from '../../../../utils/validation.js';
13
9
  import GraphCommand from '../../../base/GraphCommand.js';
14
10
  import commands from '../../commands.js';
15
11
  import { formatting } from '../../../../utils/formatting.js';
12
+ export const options = z.strictObject({
13
+ ...globalOptionsZod.shape,
14
+ id: z.string().optional().alias('i'),
15
+ title: z.string().optional().alias('t'),
16
+ bucketId: z.string().optional(),
17
+ bucketName: z.string().optional(),
18
+ planId: z.string().optional(),
19
+ planTitle: z.string().optional(),
20
+ rosterId: z.string().optional(),
21
+ ownerGroupId: z.string()
22
+ .refine(val => validation.isValidGuid(val), {
23
+ message: 'The value is not a valid GUID.'
24
+ })
25
+ .optional(),
26
+ ownerGroupName: z.string().optional(),
27
+ force: z.boolean().optional().alias('f')
28
+ });
16
29
  class PlannerTaskRemoveCommand extends GraphCommand {
17
30
  get name() {
18
31
  return commands.TASK_REMOVE;
@@ -20,14 +33,34 @@ class PlannerTaskRemoveCommand extends GraphCommand {
20
33
  get description() {
21
34
  return 'Removes the Microsoft Planner task from a plan';
22
35
  }
23
- constructor() {
24
- super();
25
- _PlannerTaskRemoveCommand_instances.add(this);
26
- __classPrivateFieldGet(this, _PlannerTaskRemoveCommand_instances, "m", _PlannerTaskRemoveCommand_initTelemetry).call(this);
27
- __classPrivateFieldGet(this, _PlannerTaskRemoveCommand_instances, "m", _PlannerTaskRemoveCommand_initOptions).call(this);
28
- __classPrivateFieldGet(this, _PlannerTaskRemoveCommand_instances, "m", _PlannerTaskRemoveCommand_initValidators).call(this);
29
- __classPrivateFieldGet(this, _PlannerTaskRemoveCommand_instances, "m", _PlannerTaskRemoveCommand_initOptionSets).call(this);
30
- __classPrivateFieldGet(this, _PlannerTaskRemoveCommand_instances, "m", _PlannerTaskRemoveCommand_initTypes).call(this);
36
+ get schema() {
37
+ return options;
38
+ }
39
+ getRefinedSchema(schema) {
40
+ return schema
41
+ .refine(opts => [opts.id, opts.title].filter(x => x !== undefined).length === 1, {
42
+ message: `Specify exactly one of the following options: 'id' or 'title'.`,
43
+ params: { customCode: 'optionSet', options: ['id', 'title'] }
44
+ })
45
+ .refine(opts => opts.id !== undefined || opts.bucketId !== undefined || [opts.planId, opts.planTitle, opts.rosterId].filter(x => x !== undefined).length === 1, {
46
+ message: `Specify exactly one of the following options: 'planId', 'planTitle' or 'rosterId'.`,
47
+ params: { customCode: 'optionSet', options: ['planId', 'planTitle', 'rosterId'] }
48
+ })
49
+ .refine(opts => opts.id !== undefined || [opts.bucketId, opts.bucketName].filter(x => x !== undefined).length === 1, {
50
+ message: `Specify exactly one of the following options: 'bucketId' or 'bucketName'.`,
51
+ params: { customCode: 'optionSet', options: ['bucketId', 'bucketName'] }
52
+ })
53
+ .refine(opts => !(opts.bucketName && !opts.rosterId) || [opts.planId, opts.planTitle].filter(x => x !== undefined).length === 1, {
54
+ message: `Specify exactly one of the following options: 'planId' or 'planTitle'.`,
55
+ params: { customCode: 'optionSet', options: ['planId', 'planTitle'] }
56
+ })
57
+ .refine(opts => !opts.planTitle || [opts.ownerGroupId, opts.ownerGroupName].filter(x => x !== undefined).length === 1, {
58
+ message: `Specify exactly one of the following options: 'ownerGroupId' or 'ownerGroupName'.`,
59
+ params: { customCode: 'optionSet', options: ['ownerGroupId', 'ownerGroupName'] }
60
+ })
61
+ .refine(opts => !opts.id || !(opts.bucketId || opts.bucketName || opts.planId || opts.planTitle || opts.rosterId || opts.ownerGroupId || opts.ownerGroupName), {
62
+ message: `Don't specify bucketId, bucketName, planId, planTitle, rosterId, ownerGroupId or ownerGroupName when using id.`
63
+ });
31
64
  }
32
65
  async commandAction(logger, args) {
33
66
  const removeTask = async () => {
@@ -73,7 +106,6 @@ class PlannerTaskRemoveCommand extends GraphCommand {
73
106
  return await request.get(requestOptions);
74
107
  }
75
108
  const bucketId = await this.getBucketId(options);
76
- // $filter is not working on the buckets/{bucketId}/tasks endpoint, hence it is not being used.
77
109
  const tasks = await odata.getAllItems(`${this.resource}/v1.0/planner/buckets/${bucketId}/tasks?$select=title,id`, 'minimal');
78
110
  const filteredTasks = tasks.filter(b => title.toLocaleLowerCase() === b.title.toLocaleLowerCase());
79
111
  if (filteredTasks.length === 0) {
@@ -114,61 +146,5 @@ class PlannerTaskRemoveCommand extends GraphCommand {
114
146
  return entraGroup.getGroupIdByDisplayName(ownerGroupName);
115
147
  }
116
148
  }
117
- _PlannerTaskRemoveCommand_instances = new WeakSet(), _PlannerTaskRemoveCommand_initTelemetry = function _PlannerTaskRemoveCommand_initTelemetry() {
118
- this.telemetry.push((args) => {
119
- Object.assign(this.telemetryProperties, {
120
- id: typeof args.options.id !== 'undefined',
121
- title: typeof args.options.title !== 'undefined',
122
- bucketId: typeof args.options.bucketId !== 'undefined',
123
- bucketName: typeof args.options.bucketName !== 'undefined',
124
- planId: typeof args.options.planId !== 'undefined',
125
- planTitle: typeof args.options.planTitle !== 'undefined',
126
- rosterId: typeof args.options.rosterId !== 'undefined',
127
- ownerGroupId: typeof args.options.ownerGroupId !== 'undefined',
128
- ownerGroupName: typeof args.options.ownerGroupName !== 'undefined',
129
- force: !!args.options.force
130
- });
131
- });
132
- }, _PlannerTaskRemoveCommand_initOptions = function _PlannerTaskRemoveCommand_initOptions() {
133
- this.options.unshift({ option: '-i, --id [id]' }, { option: '-t, --title [title]' }, { option: '--bucketId [bucketId]' }, { option: '--bucketName [bucketName]' }, { option: '--planId [planId]' }, { option: '--planTitle [planTitle]' }, { option: '--rosterId [rosterId]' }, { option: '--ownerGroupId [ownerGroupId]' }, { option: '--ownerGroupName [ownerGroupName]' }, { option: '-f, --force' });
134
- }, _PlannerTaskRemoveCommand_initValidators = function _PlannerTaskRemoveCommand_initValidators() {
135
- this.validators.push(async (args) => {
136
- if (args.options.id) {
137
- if (args.options.bucketId || args.options.bucketName ||
138
- args.options.planId || args.options.planTitle || args.options.rosterId ||
139
- args.options.ownerGroupId || args.options.ownerGroupName) {
140
- return 'Don\'t specify bucketId,bucketName, planId, planTitle, rosterId, ownerGroupId, or ownerGroupName when using id';
141
- }
142
- }
143
- if (args.options.ownerGroupId && !validation.isValidGuid(args.options.ownerGroupId)) {
144
- return `${args.options.ownerGroupId} is not a valid GUID`;
145
- }
146
- return true;
147
- });
148
- }, _PlannerTaskRemoveCommand_initOptionSets = function _PlannerTaskRemoveCommand_initOptionSets() {
149
- this.optionSets.push({ options: ['id', 'title'] }, {
150
- options: ['planId', 'planTitle', 'rosterId'],
151
- runsWhen: (args) => {
152
- return args.options.id === undefined;
153
- }
154
- }, {
155
- options: ['bucketId', 'bucketName'],
156
- runsWhen: (args) => {
157
- return args.options.title !== undefined;
158
- }
159
- }, {
160
- options: ['planId', 'planTitle'],
161
- runsWhen: (args) => {
162
- return args.options.bucketName !== undefined && args.options.rosterId === undefined;
163
- }
164
- }, {
165
- options: ['ownerGroupId', 'ownerGroupName'],
166
- runsWhen: (args) => {
167
- return args.options.planTitle !== undefined;
168
- }
169
- });
170
- }, _PlannerTaskRemoveCommand_initTypes = function _PlannerTaskRemoveCommand_initTypes() {
171
- this.types.string.push('id', 'title', 'planId', 'planTitle', 'ownerGroupId', 'ownerGroupName', 'bucketId', 'bucketName', 'rosterId');
172
- };
173
149
  export default new PlannerTaskRemoveCommand();
174
150
  //# sourceMappingURL=task-remove.js.map