@pnp/cli-microsoft365 11.9.0 → 11.10.0-beta.49639f3
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.
- package/.devcontainer/Dockerfile +1 -1
- package/Dockerfile +1 -1
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/Auth.js +4 -2
- package/dist/m365/outlook/commands/event/event-get.js +77 -0
- package/dist/m365/outlook/commands.js +1 -0
- package/dist/m365/planner/commands/roster/roster-add.js +5 -0
- package/dist/m365/planner/commands/roster/roster-get.js +8 -18
- package/dist/m365/planner/commands/roster/roster-member-add.js +29 -45
- package/dist/m365/planner/commands/roster/roster-member-get.js +28 -44
- package/dist/m365/planner/commands/roster/roster-member-list.js +8 -18
- package/dist/m365/planner/commands/roster/roster-member-remove.js +30 -48
- package/dist/m365/planner/commands/roster/roster-plan-list.js +28 -46
- package/dist/m365/planner/commands/roster/roster-remove.js +9 -27
- package/dist/m365/planner/commands/task/task-add.js +97 -111
- package/dist/m365/planner/commands/task/task-checklistitem-add.js +10 -23
- package/dist/m365/planner/commands/task/task-checklistitem-list.js +16 -26
- package/dist/m365/planner/commands/task/task-checklistitem-remove.js +10 -23
- package/dist/m365/planner/commands/task/task-get.js +46 -69
- package/dist/m365/planner/commands/task/task-list.js +33 -69
- package/dist/m365/planner/commands/task/task-reference-add.js +15 -35
- package/dist/m365/planner/commands/task/task-reference-list.js +8 -18
- package/dist/m365/planner/commands/task/task-reference-remove.js +26 -36
- package/dist/m365/planner/commands/task/task-remove.js +47 -71
- package/dist/m365/planner/commands/task/task-set.js +92 -113
- package/dist/m365/pp/commands/website/Webrole.js +2 -0
- package/dist/m365/pp/commands/website/website-remove.js +80 -0
- package/dist/m365/pp/commands/website/website-webrole-list.js +61 -0
- package/dist/m365/pp/commands.js +3 -1
- package/dist/m365/purview/commands/auditlog/auditlog-list.js +36 -60
- package/dist/m365/purview/commands/retentionevent/retentionevent-add.js +34 -53
- package/dist/m365/purview/commands/retentionevent/retentionevent-get.js +10 -23
- package/dist/m365/purview/commands/retentionevent/retentionevent-remove.js +11 -32
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-add.js +9 -24
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-get.js +10 -23
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-remove.js +11 -32
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-set.js +21 -35
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-add.js +40 -82
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-get.js +10 -23
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-remove.js +11 -32
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-set.js +35 -78
- package/dist/m365/purview/commands/sensitivitylabel/sensitivitylabel-get.js +19 -44
- package/dist/m365/purview/commands/sensitivitylabel/sensitivitylabel-list.js +16 -39
- package/dist/m365/purview/commands/sensitivitylabel/sensitivitylabel-policysettings-list.js +16 -39
- package/dist/m365/purview/commands/threatassessment/threatassessment-add.js +44 -67
- package/dist/m365/purview/commands/threatassessment/threatassessment-get.js +11 -33
- package/dist/m365/purview/commands/threatassessment/threatassessment-list.js +10 -33
- package/dist/m365/spo/commands/web/{web-alert-list.js → web-rule-list.js} +7 -4
- package/dist/m365/spo/commands/web/{web-alert-remove.js → web-rule-remove.js} +7 -4
- package/dist/m365/spo/commands.js +2 -0
- package/dist/utils/powerPlatform.js +20 -0
- package/docs/docs/cmd/outlook/event/event-get.mdx +280 -0
- package/docs/docs/cmd/pp/website/website-remove.mdx +89 -0
- package/docs/docs/cmd/pp/website/website-webrole-list.mdx +139 -0
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-add.mdx +21 -0
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-get.mdx +19 -0
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-list.mdx +19 -0
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-remove.mdx +21 -0
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-set.mdx +21 -0
- package/docs/docs/cmd/spo/cdn/cdn-get.mdx +19 -0
- package/docs/docs/cmd/spo/cdn/cdn-origin-add.mdx +21 -0
- package/docs/docs/cmd/spo/cdn/cdn-origin-list.mdx +19 -0
- package/docs/docs/cmd/spo/cdn/cdn-origin-remove.mdx +21 -0
- package/docs/docs/cmd/spo/cdn/cdn-policy-list.mdx +19 -0
- package/docs/docs/cmd/spo/cdn/cdn-policy-set.mdx +21 -0
- package/docs/docs/cmd/spo/cdn/cdn-set.mdx +21 -0
- package/docs/docs/cmd/spo/contenttype/contenttype-add.mdx +19 -0
- package/docs/docs/cmd/spo/contenttype/contenttype-get.mdx +19 -0
- package/docs/docs/cmd/spo/contenttype/contenttype-list.mdx +19 -0
- package/docs/docs/cmd/spo/contenttype/contenttype-remove.mdx +21 -0
- package/docs/docs/cmd/spo/contenttype/contenttype-set.mdx +21 -0
- package/docs/docs/cmd/spo/contenttype/contenttype-sync.mdx +19 -0
- package/docs/docs/cmd/spo/field/field-add.mdx +19 -0
- package/docs/docs/cmd/spo/field/field-get.mdx +19 -0
- package/docs/docs/cmd/spo/field/field-list.mdx +19 -0
- package/docs/docs/cmd/spo/field/field-remove.mdx +21 -0
- package/docs/docs/cmd/spo/field/field-set.mdx +21 -0
- package/docs/docs/cmd/spo/file/file-checkout-undo.mdx +21 -0
- package/docs/docs/cmd/spo/file/file-retentionlabel-ensure.mdx +21 -0
- package/docs/docs/cmd/spo/file/file-retentionlabel-remove.mdx +21 -0
- package/docs/docs/cmd/spo/file/file-roleassignment-add.mdx +21 -0
- package/docs/docs/cmd/spo/file/file-roleassignment-remove.mdx +21 -0
- package/docs/docs/cmd/spo/file/file-roleinheritance-break.mdx +21 -0
- package/docs/docs/cmd/spo/file/file-roleinheritance-reset.mdx +21 -0
- package/docs/docs/cmd/spo/file/file-sharinginfo-get.mdx +19 -0
- package/docs/docs/cmd/spo/hubsite/hubsite-connect.mdx +21 -0
- package/docs/docs/cmd/spo/hubsite/hubsite-data-get.mdx +19 -0
- package/docs/docs/cmd/spo/hubsite/hubsite-disconnect.mdx +21 -0
- package/docs/docs/cmd/spo/hubsite/hubsite-get.mdx +19 -0
- package/docs/docs/cmd/spo/hubsite/hubsite-list.mdx +19 -0
- package/docs/docs/cmd/spo/hubsite/hubsite-register.mdx +19 -0
- package/docs/docs/cmd/spo/hubsite/hubsite-rights-grant.mdx +21 -0
- package/docs/docs/cmd/spo/hubsite/hubsite-rights-revoke.mdx +21 -0
- package/docs/docs/cmd/spo/hubsite/hubsite-set.mdx +19 -0
- package/docs/docs/cmd/spo/hubsite/hubsite-unregister.mdx +21 -0
- package/docs/docs/cmd/spo/web/{web-alert-list.mdx → web-rule-list.mdx} +13 -7
- package/docs/docs/cmd/spo/web/{web-alert-remove.mdx → web-rule-remove.mdx} +10 -4
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -2
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 _PurviewRetentionEventGetCommand_instances, _PurviewRetentionEventGetCommand_initOptions, _PurviewRetentionEventGetCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { validation } from '../../../../utils/validation.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
|
+
id: z.string().refine(val => validation.isValidGuid(val), {
|
|
10
|
+
message: 'The value must be a valid GUID.'
|
|
11
|
+
}).alias('i')
|
|
12
|
+
});
|
|
11
13
|
class PurviewRetentionEventGetCommand extends GraphCommand {
|
|
12
14
|
get name() {
|
|
13
15
|
return commands.RETENTIONEVENT_GET;
|
|
@@ -15,11 +17,8 @@ class PurviewRetentionEventGetCommand extends GraphCommand {
|
|
|
15
17
|
get description() {
|
|
16
18
|
return 'Gets a retention event';
|
|
17
19
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
_PurviewRetentionEventGetCommand_instances.add(this);
|
|
21
|
-
__classPrivateFieldGet(this, _PurviewRetentionEventGetCommand_instances, "m", _PurviewRetentionEventGetCommand_initOptions).call(this);
|
|
22
|
-
__classPrivateFieldGet(this, _PurviewRetentionEventGetCommand_instances, "m", _PurviewRetentionEventGetCommand_initValidators).call(this);
|
|
20
|
+
get schema() {
|
|
21
|
+
return options;
|
|
23
22
|
}
|
|
24
23
|
async commandAction(logger, args) {
|
|
25
24
|
if (this.verbose) {
|
|
@@ -41,17 +40,5 @@ class PurviewRetentionEventGetCommand extends GraphCommand {
|
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
42
|
}
|
|
44
|
-
_PurviewRetentionEventGetCommand_instances = new WeakSet(), _PurviewRetentionEventGetCommand_initOptions = function _PurviewRetentionEventGetCommand_initOptions() {
|
|
45
|
-
this.options.unshift({
|
|
46
|
-
option: '-i, --id <id>'
|
|
47
|
-
});
|
|
48
|
-
}, _PurviewRetentionEventGetCommand_initValidators = function _PurviewRetentionEventGetCommand_initValidators() {
|
|
49
|
-
this.validators.push(async (args) => {
|
|
50
|
-
if (!validation.isValidGuid(args.options.id)) {
|
|
51
|
-
return `'${args.options.id}' is not a valid GUID.`;
|
|
52
|
-
}
|
|
53
|
-
return true;
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
43
|
export default new PurviewRetentionEventGetCommand();
|
|
57
44
|
//# sourceMappingURL=retentionevent-get.js.map
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
|
|
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 _PurviewRetentionEventRemoveCommand_instances, _PurviewRetentionEventRemoveCommand_initTelemetry, _PurviewRetentionEventRemoveCommand_initOptions, _PurviewRetentionEventRemoveCommand_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
5
|
import { validation } from '../../../../utils/validation.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
|
+
id: z.string().refine(val => validation.isValidGuid(val), {
|
|
11
|
+
message: 'The value must be a valid GUID.'
|
|
12
|
+
}).alias('i'),
|
|
13
|
+
force: z.boolean().optional().alias('f')
|
|
14
|
+
});
|
|
12
15
|
class PurviewRetentionEventRemoveCommand extends GraphCommand {
|
|
13
16
|
get name() {
|
|
14
17
|
return commands.RETENTIONEVENT_REMOVE;
|
|
@@ -16,12 +19,8 @@ class PurviewRetentionEventRemoveCommand extends GraphCommand {
|
|
|
16
19
|
get description() {
|
|
17
20
|
return 'Deletes a retention event';
|
|
18
21
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
_PurviewRetentionEventRemoveCommand_instances.add(this);
|
|
22
|
-
__classPrivateFieldGet(this, _PurviewRetentionEventRemoveCommand_instances, "m", _PurviewRetentionEventRemoveCommand_initTelemetry).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _PurviewRetentionEventRemoveCommand_instances, "m", _PurviewRetentionEventRemoveCommand_initOptions).call(this);
|
|
24
|
-
__classPrivateFieldGet(this, _PurviewRetentionEventRemoveCommand_instances, "m", _PurviewRetentionEventRemoveCommand_initValidators).call(this);
|
|
22
|
+
get schema() {
|
|
23
|
+
return options;
|
|
25
24
|
}
|
|
26
25
|
async commandAction(logger, args) {
|
|
27
26
|
if (args.options.force) {
|
|
@@ -50,25 +49,5 @@ class PurviewRetentionEventRemoveCommand extends GraphCommand {
|
|
|
50
49
|
}
|
|
51
50
|
}
|
|
52
51
|
}
|
|
53
|
-
_PurviewRetentionEventRemoveCommand_instances = new WeakSet(), _PurviewRetentionEventRemoveCommand_initTelemetry = function _PurviewRetentionEventRemoveCommand_initTelemetry() {
|
|
54
|
-
this.telemetry.push((args) => {
|
|
55
|
-
Object.assign(this.telemetryProperties, {
|
|
56
|
-
force: !!args.options.force
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
}, _PurviewRetentionEventRemoveCommand_initOptions = function _PurviewRetentionEventRemoveCommand_initOptions() {
|
|
60
|
-
this.options.unshift({
|
|
61
|
-
option: '-i, --id <id>'
|
|
62
|
-
}, {
|
|
63
|
-
option: '-f, --force'
|
|
64
|
-
});
|
|
65
|
-
}, _PurviewRetentionEventRemoveCommand_initValidators = function _PurviewRetentionEventRemoveCommand_initValidators() {
|
|
66
|
-
this.validators.push(async (args) => {
|
|
67
|
-
if (!validation.isValidGuid(args.options.id)) {
|
|
68
|
-
return `'${args.options.id}' is not a valid GUID.`;
|
|
69
|
-
}
|
|
70
|
-
return true;
|
|
71
|
-
});
|
|
72
|
-
};
|
|
73
52
|
export default new PurviewRetentionEventRemoveCommand();
|
|
74
53
|
//# sourceMappingURL=retentionevent-remove.js.map
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 _PurviewRetentionEventTypeAddCommand_instances, _PurviewRetentionEventTypeAddCommand_initTelemetry, _PurviewRetentionEventTypeAddCommand_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
|
+
displayName: z.string().alias('n'),
|
|
9
|
+
description: z.string().optional().alias('d')
|
|
10
|
+
});
|
|
10
11
|
class PurviewRetentionEventTypeAddCommand extends GraphCommand {
|
|
11
12
|
get name() {
|
|
12
13
|
return commands.RETENTIONEVENTTYPE_ADD;
|
|
@@ -14,11 +15,8 @@ class PurviewRetentionEventTypeAddCommand extends GraphCommand {
|
|
|
14
15
|
get description() {
|
|
15
16
|
return 'Creates a retention event type';
|
|
16
17
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
_PurviewRetentionEventTypeAddCommand_instances.add(this);
|
|
20
|
-
__classPrivateFieldGet(this, _PurviewRetentionEventTypeAddCommand_instances, "m", _PurviewRetentionEventTypeAddCommand_initTelemetry).call(this);
|
|
21
|
-
__classPrivateFieldGet(this, _PurviewRetentionEventTypeAddCommand_instances, "m", _PurviewRetentionEventTypeAddCommand_initOptions).call(this);
|
|
18
|
+
get schema() {
|
|
19
|
+
return options;
|
|
22
20
|
}
|
|
23
21
|
async commandAction(logger, args) {
|
|
24
22
|
const requestBody = {
|
|
@@ -42,18 +40,5 @@ class PurviewRetentionEventTypeAddCommand extends GraphCommand {
|
|
|
42
40
|
}
|
|
43
41
|
}
|
|
44
42
|
}
|
|
45
|
-
_PurviewRetentionEventTypeAddCommand_instances = new WeakSet(), _PurviewRetentionEventTypeAddCommand_initTelemetry = function _PurviewRetentionEventTypeAddCommand_initTelemetry() {
|
|
46
|
-
this.telemetry.push((args) => {
|
|
47
|
-
Object.assign(this.telemetryProperties, {
|
|
48
|
-
description: typeof args.options.description !== 'undefined'
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
}, _PurviewRetentionEventTypeAddCommand_initOptions = function _PurviewRetentionEventTypeAddCommand_initOptions() {
|
|
52
|
-
this.options.unshift({
|
|
53
|
-
option: '-n, --displayName <displayName>'
|
|
54
|
-
}, {
|
|
55
|
-
option: '-d, --description [description]'
|
|
56
|
-
});
|
|
57
|
-
};
|
|
58
43
|
export default new PurviewRetentionEventTypeAddCommand();
|
|
59
44
|
//# sourceMappingURL=retentioneventtype-add.js.map
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 _PurviewRetentionEventTypeGetCommand_instances, _PurviewRetentionEventTypeGetCommand_initOptions, _PurviewRetentionEventTypeGetCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { validation } from '../../../../utils/validation.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
|
+
id: z.string().refine(val => validation.isValidGuid(val), {
|
|
10
|
+
message: 'The value must be a valid GUID.'
|
|
11
|
+
}).alias('i')
|
|
12
|
+
});
|
|
11
13
|
class PurviewRetentionEventTypeGetCommand extends GraphCommand {
|
|
12
14
|
get name() {
|
|
13
15
|
return commands.RETENTIONEVENTTYPE_GET;
|
|
@@ -15,11 +17,8 @@ class PurviewRetentionEventTypeGetCommand extends GraphCommand {
|
|
|
15
17
|
get description() {
|
|
16
18
|
return 'Gets a retention event type';
|
|
17
19
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
_PurviewRetentionEventTypeGetCommand_instances.add(this);
|
|
21
|
-
__classPrivateFieldGet(this, _PurviewRetentionEventTypeGetCommand_instances, "m", _PurviewRetentionEventTypeGetCommand_initOptions).call(this);
|
|
22
|
-
__classPrivateFieldGet(this, _PurviewRetentionEventTypeGetCommand_instances, "m", _PurviewRetentionEventTypeGetCommand_initValidators).call(this);
|
|
20
|
+
get schema() {
|
|
21
|
+
return options;
|
|
23
22
|
}
|
|
24
23
|
async commandAction(logger, args) {
|
|
25
24
|
try {
|
|
@@ -41,17 +40,5 @@ class PurviewRetentionEventTypeGetCommand extends GraphCommand {
|
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
42
|
}
|
|
44
|
-
_PurviewRetentionEventTypeGetCommand_instances = new WeakSet(), _PurviewRetentionEventTypeGetCommand_initOptions = function _PurviewRetentionEventTypeGetCommand_initOptions() {
|
|
45
|
-
this.options.unshift({
|
|
46
|
-
option: '-i, --id <id>'
|
|
47
|
-
});
|
|
48
|
-
}, _PurviewRetentionEventTypeGetCommand_initValidators = function _PurviewRetentionEventTypeGetCommand_initValidators() {
|
|
49
|
-
this.validators.push(async (args) => {
|
|
50
|
-
if (!validation.isValidGuid(args.options.id)) {
|
|
51
|
-
return `'${args.options.id}' is not a valid GUID.`;
|
|
52
|
-
}
|
|
53
|
-
return true;
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
43
|
export default new PurviewRetentionEventTypeGetCommand();
|
|
57
44
|
//# sourceMappingURL=retentioneventtype-get.js.map
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
|
|
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 _PurviewRetentionEventTypeRemoveCommand_instances, _PurviewRetentionEventTypeRemoveCommand_initTelemetry, _PurviewRetentionEventTypeRemoveCommand_initOptions, _PurviewRetentionEventTypeRemoveCommand_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
5
|
import { validation } from '../../../../utils/validation.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
|
+
id: z.string().refine(val => validation.isValidGuid(val), {
|
|
11
|
+
message: 'The value must be a valid GUID.'
|
|
12
|
+
}).alias('i'),
|
|
13
|
+
force: z.boolean().optional().alias('f')
|
|
14
|
+
});
|
|
12
15
|
class PurviewRetentionEventTypeRemoveCommand extends GraphCommand {
|
|
13
16
|
get name() {
|
|
14
17
|
return commands.RETENTIONEVENTTYPE_REMOVE;
|
|
@@ -16,12 +19,8 @@ class PurviewRetentionEventTypeRemoveCommand extends GraphCommand {
|
|
|
16
19
|
get description() {
|
|
17
20
|
return 'Deletes a retention event type';
|
|
18
21
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
_PurviewRetentionEventTypeRemoveCommand_instances.add(this);
|
|
22
|
-
__classPrivateFieldGet(this, _PurviewRetentionEventTypeRemoveCommand_instances, "m", _PurviewRetentionEventTypeRemoveCommand_initTelemetry).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _PurviewRetentionEventTypeRemoveCommand_instances, "m", _PurviewRetentionEventTypeRemoveCommand_initOptions).call(this);
|
|
24
|
-
__classPrivateFieldGet(this, _PurviewRetentionEventTypeRemoveCommand_instances, "m", _PurviewRetentionEventTypeRemoveCommand_initValidators).call(this);
|
|
22
|
+
get schema() {
|
|
23
|
+
return options;
|
|
25
24
|
}
|
|
26
25
|
async commandAction(logger, args) {
|
|
27
26
|
if (args.options.force) {
|
|
@@ -50,25 +49,5 @@ class PurviewRetentionEventTypeRemoveCommand extends GraphCommand {
|
|
|
50
49
|
}
|
|
51
50
|
}
|
|
52
51
|
}
|
|
53
|
-
_PurviewRetentionEventTypeRemoveCommand_instances = new WeakSet(), _PurviewRetentionEventTypeRemoveCommand_initTelemetry = function _PurviewRetentionEventTypeRemoveCommand_initTelemetry() {
|
|
54
|
-
this.telemetry.push((args) => {
|
|
55
|
-
Object.assign(this.telemetryProperties, {
|
|
56
|
-
force: !!args.options.force
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
}, _PurviewRetentionEventTypeRemoveCommand_initOptions = function _PurviewRetentionEventTypeRemoveCommand_initOptions() {
|
|
60
|
-
this.options.unshift({
|
|
61
|
-
option: '-i, --id <id>'
|
|
62
|
-
}, {
|
|
63
|
-
option: '-f, --force'
|
|
64
|
-
});
|
|
65
|
-
}, _PurviewRetentionEventTypeRemoveCommand_initValidators = function _PurviewRetentionEventTypeRemoveCommand_initValidators() {
|
|
66
|
-
this.validators.push(async (args) => {
|
|
67
|
-
if (!validation.isValidGuid(args.options.id)) {
|
|
68
|
-
return `'${args.options.id}' is not a valid GUID.`;
|
|
69
|
-
}
|
|
70
|
-
return true;
|
|
71
|
-
});
|
|
72
|
-
};
|
|
73
52
|
export default new PurviewRetentionEventTypeRemoveCommand();
|
|
74
53
|
//# sourceMappingURL=retentioneventtype-remove.js.map
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 _PurviewRetentionEventTypeSetCommand_instances, _PurviewRetentionEventTypeSetCommand_initTelemetry, _PurviewRetentionEventTypeSetCommand_initOptions, _PurviewRetentionEventTypeSetCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { validation } from '../../../../utils/validation.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
|
+
id: z.string().refine(val => validation.isValidGuid(val), {
|
|
10
|
+
message: 'The value must be a valid GUID.'
|
|
11
|
+
}).alias('i'),
|
|
12
|
+
description: z.string().optional().alias('d')
|
|
13
|
+
});
|
|
11
14
|
class PurviewRetentionEventTypeSetCommand extends GraphCommand {
|
|
12
15
|
get name() {
|
|
13
16
|
return commands.RETENTIONEVENTTYPE_SET;
|
|
@@ -15,12 +18,18 @@ class PurviewRetentionEventTypeSetCommand extends GraphCommand {
|
|
|
15
18
|
get description() {
|
|
16
19
|
return 'Updates a retention event type';
|
|
17
20
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
get schema() {
|
|
22
|
+
return options;
|
|
23
|
+
}
|
|
24
|
+
getRefinedSchema(schema) {
|
|
25
|
+
return schema
|
|
26
|
+
.refine(opts => opts.description !== undefined, {
|
|
27
|
+
error: 'Specify at least one option to update.',
|
|
28
|
+
params: {
|
|
29
|
+
customCode: 'optionSet',
|
|
30
|
+
options: ['description']
|
|
31
|
+
}
|
|
32
|
+
});
|
|
24
33
|
}
|
|
25
34
|
async commandAction(logger, args) {
|
|
26
35
|
if (this.verbose) {
|
|
@@ -45,28 +54,5 @@ class PurviewRetentionEventTypeSetCommand extends GraphCommand {
|
|
|
45
54
|
}
|
|
46
55
|
}
|
|
47
56
|
}
|
|
48
|
-
_PurviewRetentionEventTypeSetCommand_instances = new WeakSet(), _PurviewRetentionEventTypeSetCommand_initTelemetry = function _PurviewRetentionEventTypeSetCommand_initTelemetry() {
|
|
49
|
-
this.telemetry.push((args) => {
|
|
50
|
-
Object.assign(this.telemetryProperties, {
|
|
51
|
-
description: typeof args.options.description !== 'undefined'
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
}, _PurviewRetentionEventTypeSetCommand_initOptions = function _PurviewRetentionEventTypeSetCommand_initOptions() {
|
|
55
|
-
this.options.unshift({
|
|
56
|
-
option: '-i, --id <id>'
|
|
57
|
-
}, {
|
|
58
|
-
option: '-d, --description [description]'
|
|
59
|
-
});
|
|
60
|
-
}, _PurviewRetentionEventTypeSetCommand_initValidators = function _PurviewRetentionEventTypeSetCommand_initValidators() {
|
|
61
|
-
this.validators.push(async (args) => {
|
|
62
|
-
if (!validation.isValidGuid(args.options.id)) {
|
|
63
|
-
return `'${args.options.id}' is not a valid GUID.`;
|
|
64
|
-
}
|
|
65
|
-
if (!args.options.description) {
|
|
66
|
-
return 'Specify at least one option to update.';
|
|
67
|
-
}
|
|
68
|
-
return true;
|
|
69
|
-
});
|
|
70
|
-
};
|
|
71
57
|
export default new PurviewRetentionEventTypeSetCommand();
|
|
72
58
|
//# sourceMappingURL=retentioneventtype-set.js.map
|
|
@@ -1,13 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 _PurviewRetentionLabelAddCommand_instances, _a, _PurviewRetentionLabelAddCommand_initTelemetry, _PurviewRetentionLabelAddCommand_initOptions, _PurviewRetentionLabelAddCommand_initValidators, _PurviewRetentionLabelAddCommand_initOptionSets;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { odata } from '../../../../utils/odata.js';
|
|
9
5
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
10
6
|
import commands from '../../commands.js';
|
|
7
|
+
const behaviorDuringRetentionPeriods = ['doNotRetain', 'retain', 'retainAsRecord', 'retainAsRegulatoryRecord'];
|
|
8
|
+
const actionAfterRetentionPeriods = ['none', 'delete', 'startDispositionReview'];
|
|
9
|
+
const retentionTriggers = ['dateLabeled', 'dateCreated', 'dateModified', 'dateOfEvent'];
|
|
10
|
+
const defaultRecordBehaviors = ['startLocked', 'startUnlocked'];
|
|
11
|
+
export const options = z.strictObject({
|
|
12
|
+
...globalOptionsZod.shape,
|
|
13
|
+
displayName: z.string().alias('n'),
|
|
14
|
+
behaviorDuringRetentionPeriod: z.enum(behaviorDuringRetentionPeriods),
|
|
15
|
+
actionAfterRetentionPeriod: z.enum(actionAfterRetentionPeriods),
|
|
16
|
+
retentionDuration: z.string().refine(val => !isNaN(Number(val)), {
|
|
17
|
+
error: 'retentionDuration must be a number'
|
|
18
|
+
}),
|
|
19
|
+
retentionTrigger: z.enum(retentionTriggers).optional().alias('t'),
|
|
20
|
+
defaultRecordBehavior: z.enum(defaultRecordBehaviors).optional(),
|
|
21
|
+
descriptionForUsers: z.string().optional(),
|
|
22
|
+
descriptionForAdmins: z.string().optional(),
|
|
23
|
+
labelToBeApplied: z.string().optional(),
|
|
24
|
+
eventTypeId: z.string().optional(),
|
|
25
|
+
eventTypeName: z.string().optional()
|
|
26
|
+
});
|
|
11
27
|
class PurviewRetentionLabelAddCommand extends GraphCommand {
|
|
12
28
|
get name() {
|
|
13
29
|
return commands.RETENTIONLABEL_ADD;
|
|
@@ -15,13 +31,23 @@ class PurviewRetentionLabelAddCommand extends GraphCommand {
|
|
|
15
31
|
get description() {
|
|
16
32
|
return 'Creates a retention label';
|
|
17
33
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
34
|
+
get schema() {
|
|
35
|
+
return options;
|
|
36
|
+
}
|
|
37
|
+
getRefinedSchema(schema) {
|
|
38
|
+
return schema
|
|
39
|
+
.refine(opts => {
|
|
40
|
+
if (opts.retentionTrigger === 'dateOfEvent') {
|
|
41
|
+
return [opts.eventTypeId, opts.eventTypeName].filter(x => x !== undefined).length === 1;
|
|
42
|
+
}
|
|
43
|
+
return true;
|
|
44
|
+
}, {
|
|
45
|
+
error: `Specify either 'eventTypeId' or 'eventTypeName', but not both.`,
|
|
46
|
+
params: {
|
|
47
|
+
customCode: 'optionSet',
|
|
48
|
+
options: ['eventTypeId', 'eventTypeName']
|
|
49
|
+
}
|
|
50
|
+
});
|
|
25
51
|
}
|
|
26
52
|
async commandAction(logger, args) {
|
|
27
53
|
const retentionTrigger = args.options.retentionTrigger ? args.options.retentionTrigger : 'dateLabeled';
|
|
@@ -33,7 +59,7 @@ class PurviewRetentionLabelAddCommand extends GraphCommand {
|
|
|
33
59
|
retentionTrigger: retentionTrigger,
|
|
34
60
|
retentionDuration: {
|
|
35
61
|
'@odata.type': '#microsoft.graph.security.retentionDurationInDays',
|
|
36
|
-
days: args.options.retentionDuration
|
|
62
|
+
days: Number(args.options.retentionDuration)
|
|
37
63
|
},
|
|
38
64
|
defaultRecordBehavior: defaultRecordBehavior
|
|
39
65
|
};
|
|
@@ -90,73 +116,5 @@ class PurviewRetentionLabelAddCommand extends GraphCommand {
|
|
|
90
116
|
return filteredEventTypes[0].id;
|
|
91
117
|
}
|
|
92
118
|
}
|
|
93
|
-
_a = PurviewRetentionLabelAddCommand, _PurviewRetentionLabelAddCommand_instances = new WeakSet(), _PurviewRetentionLabelAddCommand_initTelemetry = function _PurviewRetentionLabelAddCommand_initTelemetry() {
|
|
94
|
-
this.telemetry.push((args) => {
|
|
95
|
-
Object.assign(this.telemetryProperties, {
|
|
96
|
-
retentionTrigger: typeof args.options.retentionTrigger !== 'undefined',
|
|
97
|
-
defaultRecordBehavior: typeof args.options.defaultRecordBehavior !== 'undefined',
|
|
98
|
-
descriptionForUsers: typeof args.options.descriptionForUsers !== 'undefined',
|
|
99
|
-
descriptionForAdmins: typeof args.options.descriptionForAdmins !== 'undefined',
|
|
100
|
-
labelToBeApplied: typeof args.options.labelToBeApplied !== 'undefined',
|
|
101
|
-
eventTypeId: typeof args.options.eventTypeId !== 'undefined',
|
|
102
|
-
eventTypeName: typeof args.options.eventTypeName !== 'undefined'
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
}, _PurviewRetentionLabelAddCommand_initOptions = function _PurviewRetentionLabelAddCommand_initOptions() {
|
|
106
|
-
this.options.unshift({
|
|
107
|
-
option: '-n, --displayName <displayName>'
|
|
108
|
-
}, {
|
|
109
|
-
option: '--behaviorDuringRetentionPeriod <behaviorDuringRetentionPeriod>',
|
|
110
|
-
autocomplete: _a.behaviorDuringRetentionPeriods
|
|
111
|
-
}, {
|
|
112
|
-
option: '--actionAfterRetentionPeriod <actionAfterRetentionPeriod>',
|
|
113
|
-
autocomplete: _a.actionAfterRetentionPeriods
|
|
114
|
-
}, {
|
|
115
|
-
option: '--retentionDuration <retentionDuration>'
|
|
116
|
-
}, {
|
|
117
|
-
option: '-t, --retentionTrigger [retentionTrigger]',
|
|
118
|
-
autocomplete: _a.retentionTriggers
|
|
119
|
-
}, {
|
|
120
|
-
option: '--defaultRecordBehavior [defaultRecordBehavior]',
|
|
121
|
-
autocomplete: _a.defaultRecordBehavior
|
|
122
|
-
}, {
|
|
123
|
-
option: '--descriptionForUsers [descriptionForUsers]'
|
|
124
|
-
}, {
|
|
125
|
-
option: '--descriptionForAdmins [descriptionForAdmins]'
|
|
126
|
-
}, {
|
|
127
|
-
option: '--labelToBeApplied [labelToBeApplied]'
|
|
128
|
-
}, {
|
|
129
|
-
option: '--eventTypeId [eventTypeId]'
|
|
130
|
-
}, {
|
|
131
|
-
option: '--eventTypeName [eventTypeName]'
|
|
132
|
-
});
|
|
133
|
-
}, _PurviewRetentionLabelAddCommand_initValidators = function _PurviewRetentionLabelAddCommand_initValidators() {
|
|
134
|
-
this.validators.push(async (args) => {
|
|
135
|
-
if (isNaN(args.options.retentionDuration)) {
|
|
136
|
-
return `Specified retentionDuration ${args.options.retentionDuration} is not a number`;
|
|
137
|
-
}
|
|
138
|
-
if (_a.behaviorDuringRetentionPeriods.indexOf(args.options.behaviorDuringRetentionPeriod) === -1) {
|
|
139
|
-
return `${args.options.behaviorDuringRetentionPeriod} is not a valid behavior of a document with the label. Allowed values are ${_a.behaviorDuringRetentionPeriods.join(', ')}`;
|
|
140
|
-
}
|
|
141
|
-
if (_a.actionAfterRetentionPeriods.indexOf(args.options.actionAfterRetentionPeriod) === -1) {
|
|
142
|
-
return `${args.options.actionAfterRetentionPeriod} is not a valid action to take on a document with the label. Allowed values are ${_a.actionAfterRetentionPeriods.join(', ')}`;
|
|
143
|
-
}
|
|
144
|
-
if (args.options.retentionTrigger &&
|
|
145
|
-
_a.retentionTriggers.indexOf(args.options.retentionTrigger) === -1) {
|
|
146
|
-
return `${args.options.retentionTrigger} is not a valid action retention duration calculation. Allowed values are ${_a.retentionTriggers.join(', ')}`;
|
|
147
|
-
}
|
|
148
|
-
if (args.options.defaultRecordBehavior &&
|
|
149
|
-
_a.defaultRecordBehavior.indexOf(args.options.defaultRecordBehavior) === -1) {
|
|
150
|
-
return `${args.options.defaultRecordBehavior} is not a valid state of a record label. Allowed values are ${_a.defaultRecordBehavior.join(', ')}`;
|
|
151
|
-
}
|
|
152
|
-
return true;
|
|
153
|
-
});
|
|
154
|
-
}, _PurviewRetentionLabelAddCommand_initOptionSets = function _PurviewRetentionLabelAddCommand_initOptionSets() {
|
|
155
|
-
this.optionSets.push({ options: ['eventTypeId', 'eventTypeName'], runsWhen(args) { return args.options.retentionTrigger === 'dateOfEvent'; } });
|
|
156
|
-
};
|
|
157
|
-
PurviewRetentionLabelAddCommand.behaviorDuringRetentionPeriods = ['doNotRetain', 'retain', 'retainAsRecord', 'retainAsRegulatoryRecord'];
|
|
158
|
-
PurviewRetentionLabelAddCommand.actionAfterRetentionPeriods = ['none', 'delete', 'startDispositionReview'];
|
|
159
|
-
PurviewRetentionLabelAddCommand.retentionTriggers = ['dateLabeled', 'dateCreated', 'dateModified', 'dateOfEvent'];
|
|
160
|
-
PurviewRetentionLabelAddCommand.defaultRecordBehavior = ['startLocked', 'startUnlocked'];
|
|
161
119
|
export default new PurviewRetentionLabelAddCommand();
|
|
162
120
|
//# sourceMappingURL=retentionlabel-add.js.map
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 _PurviewRetentionLabelGetCommand_instances, _PurviewRetentionLabelGetCommand_initOptions, _PurviewRetentionLabelGetCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { validation } from '../../../../utils/validation.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
|
+
id: z.string().refine(val => validation.isValidGuid(val), {
|
|
10
|
+
error: 'The value must be a valid GUID.'
|
|
11
|
+
}).alias('i')
|
|
12
|
+
});
|
|
11
13
|
class PurviewRetentionLabelGetCommand extends GraphCommand {
|
|
12
14
|
get name() {
|
|
13
15
|
return commands.RETENTIONLABEL_GET;
|
|
@@ -15,11 +17,8 @@ class PurviewRetentionLabelGetCommand extends GraphCommand {
|
|
|
15
17
|
get description() {
|
|
16
18
|
return 'Gets a retention label';
|
|
17
19
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
_PurviewRetentionLabelGetCommand_instances.add(this);
|
|
21
|
-
__classPrivateFieldGet(this, _PurviewRetentionLabelGetCommand_instances, "m", _PurviewRetentionLabelGetCommand_initOptions).call(this);
|
|
22
|
-
__classPrivateFieldGet(this, _PurviewRetentionLabelGetCommand_instances, "m", _PurviewRetentionLabelGetCommand_initValidators).call(this);
|
|
20
|
+
get schema() {
|
|
21
|
+
return options;
|
|
23
22
|
}
|
|
24
23
|
async commandAction(logger, args) {
|
|
25
24
|
try {
|
|
@@ -41,17 +40,5 @@ class PurviewRetentionLabelGetCommand extends GraphCommand {
|
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
42
|
}
|
|
44
|
-
_PurviewRetentionLabelGetCommand_instances = new WeakSet(), _PurviewRetentionLabelGetCommand_initOptions = function _PurviewRetentionLabelGetCommand_initOptions() {
|
|
45
|
-
this.options.unshift({
|
|
46
|
-
option: '-i, --id <id>'
|
|
47
|
-
});
|
|
48
|
-
}, _PurviewRetentionLabelGetCommand_initValidators = function _PurviewRetentionLabelGetCommand_initValidators() {
|
|
49
|
-
this.validators.push(async (args) => {
|
|
50
|
-
if (!validation.isValidGuid(args.options.id)) {
|
|
51
|
-
return `'${args.options.id}' is not a valid GUID.`;
|
|
52
|
-
}
|
|
53
|
-
return true;
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
43
|
export default new PurviewRetentionLabelGetCommand();
|
|
57
44
|
//# sourceMappingURL=retentionlabel-get.js.map
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
|
|
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 _PurviewRetentionLabelRemoveCommand_instances, _PurviewRetentionLabelRemoveCommand_initTelemetry, _PurviewRetentionLabelRemoveCommand_initOptions, _PurviewRetentionLabelRemoveCommand_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
5
|
import { validation } from '../../../../utils/validation.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
|
+
id: z.string().refine(val => validation.isValidGuid(val), {
|
|
11
|
+
error: 'The value must be a valid GUID.'
|
|
12
|
+
}).alias('i'),
|
|
13
|
+
force: z.boolean().optional()
|
|
14
|
+
});
|
|
12
15
|
class PurviewRetentionLabelRemoveCommand extends GraphCommand {
|
|
13
16
|
get name() {
|
|
14
17
|
return commands.RETENTIONLABEL_REMOVE;
|
|
@@ -16,12 +19,8 @@ class PurviewRetentionLabelRemoveCommand extends GraphCommand {
|
|
|
16
19
|
get description() {
|
|
17
20
|
return 'Deletes a retention label';
|
|
18
21
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
_PurviewRetentionLabelRemoveCommand_instances.add(this);
|
|
22
|
-
__classPrivateFieldGet(this, _PurviewRetentionLabelRemoveCommand_instances, "m", _PurviewRetentionLabelRemoveCommand_initTelemetry).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _PurviewRetentionLabelRemoveCommand_instances, "m", _PurviewRetentionLabelRemoveCommand_initOptions).call(this);
|
|
24
|
-
__classPrivateFieldGet(this, _PurviewRetentionLabelRemoveCommand_instances, "m", _PurviewRetentionLabelRemoveCommand_initValidators).call(this);
|
|
22
|
+
get schema() {
|
|
23
|
+
return options;
|
|
25
24
|
}
|
|
26
25
|
async commandAction(logger, args) {
|
|
27
26
|
if (args.options.force) {
|
|
@@ -50,25 +49,5 @@ class PurviewRetentionLabelRemoveCommand extends GraphCommand {
|
|
|
50
49
|
}
|
|
51
50
|
}
|
|
52
51
|
}
|
|
53
|
-
_PurviewRetentionLabelRemoveCommand_instances = new WeakSet(), _PurviewRetentionLabelRemoveCommand_initTelemetry = function _PurviewRetentionLabelRemoveCommand_initTelemetry() {
|
|
54
|
-
this.telemetry.push((args) => {
|
|
55
|
-
Object.assign(this.telemetryProperties, {
|
|
56
|
-
force: !!args.options.force
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
}, _PurviewRetentionLabelRemoveCommand_initOptions = function _PurviewRetentionLabelRemoveCommand_initOptions() {
|
|
60
|
-
this.options.unshift({
|
|
61
|
-
option: '-i, --id <id>'
|
|
62
|
-
}, {
|
|
63
|
-
option: '-f, --force'
|
|
64
|
-
});
|
|
65
|
-
}, _PurviewRetentionLabelRemoveCommand_initValidators = function _PurviewRetentionLabelRemoveCommand_initValidators() {
|
|
66
|
-
this.validators.push(async (args) => {
|
|
67
|
-
if (!validation.isValidGuid(args.options.id)) {
|
|
68
|
-
return `'${args.options.id}' is not a valid GUID.`;
|
|
69
|
-
}
|
|
70
|
-
return true;
|
|
71
|
-
});
|
|
72
|
-
};
|
|
73
52
|
export default new PurviewRetentionLabelRemoveCommand();
|
|
74
53
|
//# sourceMappingURL=retentionlabel-remove.js.map
|