@pnp/cli-microsoft365 12.1.0-beta.79db3d9 → 12.1.0-beta.81e442d
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/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/cli/cli.js +12 -7
- package/dist/m365/entra/commands/app/app-add.js +106 -150
- package/dist/m365/entra/commands/app/app-get.js +22 -38
- package/dist/m365/entra/commands/app/app-list.js +10 -22
- package/dist/m365/entra/commands/app/app-permission-add.js +36 -50
- package/dist/m365/entra/commands/app/app-permission-list.js +29 -48
- package/dist/m365/entra/commands/app/app-permission-remove.js +44 -82
- package/dist/m365/entra/commands/app/app-remove.js +21 -38
- package/dist/m365/entra/commands/app/app-role-add.js +32 -46
- package/dist/m365/entra/commands/app/app-role-list.js +20 -25
- package/dist/m365/entra/commands/app/app-role-remove.js +33 -41
- package/dist/m365/entra/commands/app/app-set.js +46 -69
- package/dist/m365/spfx/commands/package/package-generate.js +30 -51
- package/dist/m365/spfx/commands/project/project-azuredevops-pipeline-add.js +27 -62
- package/dist/m365/spfx/commands/project/project-doctor.js +20 -51
- package/dist/m365/spfx/commands/project/project-externalize.js +16 -26
- package/dist/m365/spfx/commands/project/project-github-workflow-add.js +28 -65
- package/dist/m365/spfx/commands/project/project-permissions-grant.js +4 -2
- package/dist/m365/spfx/commands/project/project-rename.js +17 -29
- package/dist/m365/spfx/commands/project/project-upgrade.js +0 -3
- package/dist/m365/spfx/commands/spfx-doctor.js +23 -47
- package/dist/m365/spo/commands/file/file-add.js +51 -77
- package/dist/m365/spo/commands/file/file-archive.js +1 -1
- package/dist/m365/spo/commands/file/file-checkin.js +35 -64
- package/dist/m365/spo/commands/file/file-checkout-undo.js +25 -49
- package/dist/m365/spo/commands/file/file-checkout.js +24 -47
- package/dist/m365/spo/commands/file/file-copy.js +37 -68
- package/dist/m365/spo/commands/file/file-get.js +44 -79
- package/dist/m365/spo/commands/file/file-list.js +16 -39
- package/dist/m365/spo/commands/file/file-move.js +30 -68
- package/dist/m365/spo/commands/file/file-remove.js +27 -56
- package/dist/m365/spo/commands/file/file-rename.js +15 -36
- package/dist/m365/spo/commands/file/file-retentionlabel-ensure.js +26 -51
- package/dist/m365/spo/commands/file/file-retentionlabel-remove.js +25 -50
- package/dist/m365/spo/commands/file/file-roleassignment-add.js +47 -75
- package/dist/m365/spo/commands/file/file-roleassignment-remove.js +39 -70
- package/dist/m365/spo/commands/file/file-roleinheritance-break.js +26 -52
- package/dist/m365/spo/commands/file/file-roleinheritance-reset.js +25 -49
- package/dist/m365/spo/commands/file/file-sharinginfo-get.js +24 -47
- package/dist/m365/spo/commands/file/file-sharinglink-add.js +46 -70
- package/dist/m365/spo/commands/file/file-sharinglink-clear.js +33 -57
- package/dist/m365/spo/commands/file/file-sharinglink-get.js +25 -47
- package/dist/m365/spo/commands/file/file-sharinglink-list.js +32 -53
- package/dist/m365/spo/commands/file/file-sharinglink-remove.js +26 -51
- package/dist/m365/spo/commands/file/file-sharinglink-set.js +29 -55
- package/dist/m365/spo/commands/file/file-unarchive.js +1 -1
- package/dist/m365/spo/commands/file/file-version-clear.js +25 -45
- package/dist/m365/spo/commands/file/file-version-get.js +25 -43
- package/dist/m365/spo/commands/file/file-version-keep.js +1 -1
- package/dist/m365/spo/commands/file/file-version-list.js +24 -41
- package/dist/m365/spo/commands/file/file-version-remove.js +26 -47
- package/dist/m365/spo/commands/file/file-version-restore.js +26 -47
- package/dist/m365/spo/commands/folder/folder-add.js +19 -48
- package/dist/m365/spo/commands/folder/folder-copy.js +36 -62
- package/dist/m365/spo/commands/folder/folder-get.js +30 -51
- package/dist/m365/spo/commands/folder/folder-list.js +16 -39
- package/dist/m365/spo/commands/folder/folder-move.js +36 -62
- package/dist/m365/spo/commands/folder/folder-remove.js +15 -36
- package/dist/m365/spo/commands/folder/folder-retentionlabel-ensure.js +30 -48
- package/dist/m365/spo/commands/folder/folder-retentionlabel-remove.js +30 -50
- package/dist/m365/spo/commands/folder/folder-roleassignment-add.js +49 -79
- package/dist/m365/spo/commands/folder/folder-roleassignment-remove.js +37 -67
- package/dist/m365/spo/commands/folder/folder-roleinheritance-break.js +15 -36
- package/dist/m365/spo/commands/folder/folder-roleinheritance-reset.js +14 -33
- package/dist/m365/spo/commands/folder/folder-set.js +28 -48
- package/dist/m365/spo/commands/folder/folder-sharinglink-add.js +58 -86
- package/dist/m365/spo/commands/folder/folder-sharinglink-clear.js +33 -50
- package/dist/m365/spo/commands/folder/folder-sharinglink-get.js +33 -42
- package/dist/m365/spo/commands/folder/folder-sharinglink-list.js +32 -47
- package/dist/m365/spo/commands/folder/folder-sharinglink-remove.js +34 -41
- package/dist/m365/spo/commands/folder/folder-sharinglink-set.js +38 -43
- package/dist/m365/spo/commands/page/page-add.js +31 -68
- package/dist/m365/spo/commands/page/page-clientsidewebpart-add.js +74 -101
- package/dist/m365/spo/commands/page/page-column-get.js +15 -32
- package/dist/m365/spo/commands/page/page-column-list.js +14 -27
- package/dist/m365/spo/commands/page/page-control-get.js +18 -27
- package/dist/m365/spo/commands/page/page-control-list.js +13 -20
- package/dist/m365/spo/commands/page/page-control-remove.js +1 -1
- package/dist/m365/spo/commands/page/page-control-set.js +51 -61
- package/dist/m365/spo/commands/page/page-copy.js +15 -31
- package/dist/m365/spo/commands/page/page-header-set.js +25 -89
- package/dist/m365/spo/commands/page/page-list.js +12 -18
- package/dist/m365/spo/commands/page/page-remove.js +16 -39
- package/dist/m365/spo/commands/page/page-section-add.js +108 -173
- package/dist/m365/spo/commands/page/page-section-get.js +17 -27
- package/dist/m365/spo/commands/page/page-section-list.js +13 -20
- package/dist/m365/spo/commands/page/page-section-remove.js +4 -1
- package/dist/m365/spo/commands/page/page-set.js +50 -100
- package/dist/m365/spo/commands/page/page-template-list.js +12 -18
- package/dist/m365/spo/commands/page/page-text-add.js +23 -45
- package/dist/m365/viva/commands/connections/connections-app-create.js +36 -42
- package/dist/m365/viva/commands/engage/engage-community-add.js +75 -71
- package/dist/m365/viva/commands/engage/engage-community-get.js +8 -16
- package/dist/m365/viva/commands/engage/engage-community-list.js +5 -0
- package/dist/m365/viva/commands/engage/engage-community-remove.js +28 -48
- package/dist/m365/viva/commands/engage/engage-community-set.js +43 -66
- package/dist/m365/viva/commands/engage/engage-community-user-add.js +7 -12
- package/dist/m365/viva/commands/engage/engage-community-user-list.js +1 -1
- package/dist/m365/viva/commands/engage/engage-community-user-remove.js +4 -2
- package/dist/m365/viva/commands/engage/engage-message-add.js +22 -52
- package/dist/m365/viva/commands/engage/engage-message-get.js +8 -23
- package/dist/m365/viva/commands/engage/engage-message-like-set.js +10 -39
- package/dist/m365/viva/commands/engage/engage-message-list.js +22 -66
- package/dist/m365/viva/commands/engage/engage-message-remove.js +9 -32
- package/dist/m365/viva/commands/engage/engage-network-list.js +8 -22
- package/dist/m365/viva/commands/engage/engage-report-activitycounts.js +2 -1
- package/dist/m365/viva/commands/engage/engage-report-activityusercounts.js +2 -1
- package/dist/m365/viva/commands/engage/engage-report-activityuserdetail.js +2 -1
- package/dist/m365/viva/commands/engage/engage-report-deviceusagedistributionusercounts.js +2 -1
- package/dist/m365/viva/commands/engage/engage-report-deviceusageusercounts.js +2 -1
- package/dist/m365/viva/commands/engage/engage-report-deviceusageuserdetail.js +2 -1
- package/dist/m365/viva/commands/engage/engage-report-groupsactivitycounts.js +2 -1
- package/dist/m365/viva/commands/engage/engage-report-groupsactivitydetail.js +2 -1
- package/dist/m365/viva/commands/engage/engage-report-groupsactivitygroupcounts.js +2 -1
- package/dist/m365/viva/commands/engage/engage-role-list.js +5 -0
- package/dist/m365/viva/commands/engage/engage-role-member-add.js +3 -5
- package/dist/m365/viva/commands/engage/engage-role-member-list.js +1 -1
- package/dist/m365/viva/commands/engage/engage-role-member-remove.js +4 -2
- package/dist/m365/viva/commands/engage/engage-search.js +16 -65
- package/dist/m365/viva/commands/engage/engage-user-get.js +15 -33
- package/dist/m365/viva/commands/engage/engage-user-list.js +22 -57
- package/docs/docs/cmd/spo/listitem/listitem-record-declare.mdx +19 -0
- package/docs/docs/cmd/spo/listitem/listitem-record-lock.mdx +21 -0
- package/docs/docs/cmd/spo/listitem/listitem-record-undeclare.mdx +21 -0
- package/docs/docs/cmd/spo/listitem/listitem-record-unlock.mdx +21 -0
- package/docs/docs/cmd/spo/page/page-text-add.mdx +1 -1
- package/docs/docs/cmd/viva/engage/engage-community-add.mdx +19 -0
- package/docs/docs/cmd/viva/engage/engage-community-get.mdx +19 -0
- package/docs/docs/cmd/viva/engage/engage-community-remove.mdx +21 -0
- package/docs/docs/cmd/viva/engage/engage-community-set.mdx +19 -0
- package/npm-shrinkwrap.json +55 -55
- package/package.json +1 -1
|
@@ -1,16 +1,31 @@
|
|
|
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 _SpoFileSharingLinkClearCommand_instances, _SpoFileSharingLinkClearCommand_initTelemetry, _SpoFileSharingLinkClearCommand_initOptions, _SpoFileSharingLinkClearCommand_initValidators, _SpoFileSharingLinkClearCommand_initOptionSets, _SpoFileSharingLinkClearCommand_initTypes;
|
|
1
|
+
import { z } from 'zod';
|
|
7
2
|
import { cli } from '../../../../cli/cli.js';
|
|
3
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
8
4
|
import request from '../../../../request.js';
|
|
9
5
|
import { spo } from '../../../../utils/spo.js';
|
|
10
6
|
import { validation } from '../../../../utils/validation.js';
|
|
7
|
+
import { zod } from '../../../../utils/zod.js';
|
|
11
8
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
12
9
|
import commands from '../../commands.js';
|
|
13
10
|
import spoFileSharingLinkListCommand from './file-sharinglink-list.js';
|
|
11
|
+
var SharingLinkScope;
|
|
12
|
+
(function (SharingLinkScope) {
|
|
13
|
+
SharingLinkScope["anonymous"] = "anonymous";
|
|
14
|
+
SharingLinkScope["users"] = "users";
|
|
15
|
+
SharingLinkScope["organization"] = "organization";
|
|
16
|
+
})(SharingLinkScope || (SharingLinkScope = {}));
|
|
17
|
+
export const options = z.strictObject({
|
|
18
|
+
...globalOptionsZod.shape,
|
|
19
|
+
webUrl: z.string()
|
|
20
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
21
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
22
|
+
})
|
|
23
|
+
.alias('u'),
|
|
24
|
+
fileUrl: z.string().optional(),
|
|
25
|
+
fileId: z.guid().optional(),
|
|
26
|
+
scope: zod.coercedEnum(SharingLinkScope).optional().alias('s'),
|
|
27
|
+
force: z.boolean().optional().alias('f')
|
|
28
|
+
});
|
|
14
29
|
class SpoFileSharingLinkClearCommand extends SpoCommand {
|
|
15
30
|
get name() {
|
|
16
31
|
return commands.FILE_SHARINGLINK_CLEAR;
|
|
@@ -18,15 +33,18 @@ class SpoFileSharingLinkClearCommand extends SpoCommand {
|
|
|
18
33
|
get description() {
|
|
19
34
|
return 'Removes sharing links of a file';
|
|
20
35
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
36
|
+
get schema() {
|
|
37
|
+
return options;
|
|
38
|
+
}
|
|
39
|
+
getRefinedSchema(schema) {
|
|
40
|
+
return schema
|
|
41
|
+
.refine(opts => [opts.fileUrl, opts.fileId].filter(o => o !== undefined).length === 1, {
|
|
42
|
+
error: `Specify 'fileUrl' or 'fileId', but not both.`,
|
|
43
|
+
params: {
|
|
44
|
+
customCode: 'optionSet',
|
|
45
|
+
options: ['fileUrl', 'fileId']
|
|
46
|
+
}
|
|
47
|
+
});
|
|
30
48
|
}
|
|
31
49
|
async commandAction(logger, args) {
|
|
32
50
|
const clearSharingLinks = async () => {
|
|
@@ -75,47 +93,5 @@ class SpoFileSharingLinkClearCommand extends SpoCommand {
|
|
|
75
93
|
return outputParsed;
|
|
76
94
|
}
|
|
77
95
|
}
|
|
78
|
-
_SpoFileSharingLinkClearCommand_instances = new WeakSet(), _SpoFileSharingLinkClearCommand_initTelemetry = function _SpoFileSharingLinkClearCommand_initTelemetry() {
|
|
79
|
-
this.telemetry.push((args) => {
|
|
80
|
-
Object.assign(this.telemetryProperties, {
|
|
81
|
-
fileUrl: typeof args.options.fileUrl !== 'undefined',
|
|
82
|
-
fileId: typeof args.options.fileId !== 'undefined',
|
|
83
|
-
scope: typeof args.options.scope !== 'undefined',
|
|
84
|
-
force: !!args.options.force
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
}, _SpoFileSharingLinkClearCommand_initOptions = function _SpoFileSharingLinkClearCommand_initOptions() {
|
|
88
|
-
this.options.unshift({
|
|
89
|
-
option: '-u, --webUrl <webUrl>'
|
|
90
|
-
}, {
|
|
91
|
-
option: '--fileUrl [fileUrl]'
|
|
92
|
-
}, {
|
|
93
|
-
option: '--fileId [fileId]'
|
|
94
|
-
}, {
|
|
95
|
-
option: '-s, --scope [scope]',
|
|
96
|
-
autocomplete: this.allowedScopes
|
|
97
|
-
}, {
|
|
98
|
-
option: '-f, --force'
|
|
99
|
-
});
|
|
100
|
-
}, _SpoFileSharingLinkClearCommand_initValidators = function _SpoFileSharingLinkClearCommand_initValidators() {
|
|
101
|
-
this.validators.push(async (args) => {
|
|
102
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
103
|
-
if (isValidSharePointUrl !== true) {
|
|
104
|
-
return isValidSharePointUrl;
|
|
105
|
-
}
|
|
106
|
-
if (args.options.fileId && !validation.isValidGuid(args.options.fileId)) {
|
|
107
|
-
return `${args.options.fileId} is not a valid GUID`;
|
|
108
|
-
}
|
|
109
|
-
if (args.options.scope && this.allowedScopes.indexOf(args.options.scope) === -1) {
|
|
110
|
-
return `'${args.options.scope}' is not a valid scope. Allowed values are: ${this.allowedScopes.join(',')}`;
|
|
111
|
-
}
|
|
112
|
-
return true;
|
|
113
|
-
});
|
|
114
|
-
}, _SpoFileSharingLinkClearCommand_initOptionSets = function _SpoFileSharingLinkClearCommand_initOptionSets() {
|
|
115
|
-
this.optionSets.push({ options: ['fileUrl', 'fileId'] });
|
|
116
|
-
}, _SpoFileSharingLinkClearCommand_initTypes = function _SpoFileSharingLinkClearCommand_initTypes() {
|
|
117
|
-
this.types.string.push('webUrl', 'fileUrl', 'fileId', 'scope');
|
|
118
|
-
this.types.boolean.push('force');
|
|
119
|
-
};
|
|
120
96
|
export default new SpoFileSharingLinkClearCommand();
|
|
121
97
|
//# sourceMappingURL=file-sharinglink-clear.js.map
|
|
@@ -1,14 +1,21 @@
|
|
|
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 _SpoFileSharingLinkGetCommand_instances, _SpoFileSharingLinkGetCommand_initTelemetry, _SpoFileSharingLinkGetCommand_initOptions, _SpoFileSharingLinkGetCommand_initValidators, _SpoFileSharingLinkGetCommand_initOptionSets, _SpoFileSharingLinkGetCommand_initTypes;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { spo } from '../../../../utils/spo.js';
|
|
9
5
|
import { validation } from '../../../../utils/validation.js';
|
|
10
6
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
11
7
|
import commands from '../../commands.js';
|
|
8
|
+
export const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
webUrl: z.string()
|
|
11
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
12
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
13
|
+
})
|
|
14
|
+
.alias('u'),
|
|
15
|
+
fileUrl: z.string().optional(),
|
|
16
|
+
fileId: z.guid().optional(),
|
|
17
|
+
id: z.string().alias('i')
|
|
18
|
+
});
|
|
12
19
|
class SpoFileSharingLinkGetCommand extends SpoCommand {
|
|
13
20
|
get name() {
|
|
14
21
|
return commands.FILE_SHARINGLINK_GET;
|
|
@@ -16,14 +23,18 @@ class SpoFileSharingLinkGetCommand extends SpoCommand {
|
|
|
16
23
|
get description() {
|
|
17
24
|
return 'Gets details about a specific sharing link of a file';
|
|
18
25
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
get schema() {
|
|
27
|
+
return options;
|
|
28
|
+
}
|
|
29
|
+
getRefinedSchema(schema) {
|
|
30
|
+
return schema
|
|
31
|
+
.refine(opts => [opts.fileUrl, opts.fileId].filter(o => o !== undefined).length === 1, {
|
|
32
|
+
error: `Specify 'fileUrl' or 'fileId', but not both.`,
|
|
33
|
+
params: {
|
|
34
|
+
customCode: 'optionSet',
|
|
35
|
+
options: ['fileUrl', 'fileId']
|
|
36
|
+
}
|
|
37
|
+
});
|
|
27
38
|
}
|
|
28
39
|
async commandAction(logger, args) {
|
|
29
40
|
if (this.verbose) {
|
|
@@ -46,38 +57,5 @@ class SpoFileSharingLinkGetCommand extends SpoCommand {
|
|
|
46
57
|
}
|
|
47
58
|
}
|
|
48
59
|
}
|
|
49
|
-
_SpoFileSharingLinkGetCommand_instances = new WeakSet(), _SpoFileSharingLinkGetCommand_initTelemetry = function _SpoFileSharingLinkGetCommand_initTelemetry() {
|
|
50
|
-
this.telemetry.push((args) => {
|
|
51
|
-
Object.assign(this.telemetryProperties, {
|
|
52
|
-
fileUrl: typeof args.options.fileUrl !== 'undefined',
|
|
53
|
-
fileId: typeof args.options.fileId !== 'undefined'
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
}, _SpoFileSharingLinkGetCommand_initOptions = function _SpoFileSharingLinkGetCommand_initOptions() {
|
|
57
|
-
this.options.unshift({
|
|
58
|
-
option: '-u, --webUrl <webUrl>'
|
|
59
|
-
}, {
|
|
60
|
-
option: '--fileUrl [fileUrl]'
|
|
61
|
-
}, {
|
|
62
|
-
option: '--fileId [fileId]'
|
|
63
|
-
}, {
|
|
64
|
-
option: '-i, --id <id>'
|
|
65
|
-
});
|
|
66
|
-
}, _SpoFileSharingLinkGetCommand_initValidators = function _SpoFileSharingLinkGetCommand_initValidators() {
|
|
67
|
-
this.validators.push(async (args) => {
|
|
68
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
69
|
-
if (isValidSharePointUrl !== true) {
|
|
70
|
-
return isValidSharePointUrl;
|
|
71
|
-
}
|
|
72
|
-
if (args.options.fileId && !validation.isValidGuid(args.options.fileId)) {
|
|
73
|
-
return `${args.options.fileId} is not a valid GUID`;
|
|
74
|
-
}
|
|
75
|
-
return true;
|
|
76
|
-
});
|
|
77
|
-
}, _SpoFileSharingLinkGetCommand_initOptionSets = function _SpoFileSharingLinkGetCommand_initOptionSets() {
|
|
78
|
-
this.optionSets.push({ options: ['fileUrl', 'fileId'] });
|
|
79
|
-
}, _SpoFileSharingLinkGetCommand_initTypes = function _SpoFileSharingLinkGetCommand_initTypes() {
|
|
80
|
-
this.types.string.push('webUrl', 'fileUrl', 'fileId', 'id');
|
|
81
|
-
};
|
|
82
60
|
export default new SpoFileSharingLinkGetCommand();
|
|
83
61
|
//# sourceMappingURL=file-sharinglink-get.js.map
|
|
@@ -1,15 +1,29 @@
|
|
|
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 _SpoFileSharingLinkListCommand_instances, _a, _SpoFileSharingLinkListCommand_initTelemetry, _SpoFileSharingLinkListCommand_initOptions, _SpoFileSharingLinkListCommand_initValidators, _SpoFileSharingLinkListCommand_initOptionSets, _SpoFileSharingLinkListCommand_initTypes;
|
|
1
|
+
import { z } from 'zod';
|
|
7
2
|
import { cli } from '../../../../cli/cli.js';
|
|
3
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
8
4
|
import { odata } from '../../../../utils/odata.js';
|
|
9
5
|
import { spo } from '../../../../utils/spo.js';
|
|
10
6
|
import { validation } from '../../../../utils/validation.js';
|
|
7
|
+
import { zod } from '../../../../utils/zod.js';
|
|
11
8
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
12
9
|
import commands from '../../commands.js';
|
|
10
|
+
var SharingLinkScope;
|
|
11
|
+
(function (SharingLinkScope) {
|
|
12
|
+
SharingLinkScope["anonymous"] = "anonymous";
|
|
13
|
+
SharingLinkScope["users"] = "users";
|
|
14
|
+
SharingLinkScope["organization"] = "organization";
|
|
15
|
+
})(SharingLinkScope || (SharingLinkScope = {}));
|
|
16
|
+
export const options = z.strictObject({
|
|
17
|
+
...globalOptionsZod.shape,
|
|
18
|
+
webUrl: z.string()
|
|
19
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
20
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
21
|
+
})
|
|
22
|
+
.alias('u'),
|
|
23
|
+
fileId: z.guid().optional(),
|
|
24
|
+
fileUrl: z.string().optional(),
|
|
25
|
+
scope: zod.coercedEnum(SharingLinkScope).optional().alias('s')
|
|
26
|
+
});
|
|
13
27
|
class SpoFileSharingLinkListCommand extends SpoCommand {
|
|
14
28
|
get name() {
|
|
15
29
|
return commands.FILE_SHARINGLINK_LIST;
|
|
@@ -20,14 +34,18 @@ class SpoFileSharingLinkListCommand extends SpoCommand {
|
|
|
20
34
|
defaultProperties() {
|
|
21
35
|
return ['id', 'scope', 'roles', 'link'];
|
|
22
36
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
37
|
+
get schema() {
|
|
38
|
+
return options;
|
|
39
|
+
}
|
|
40
|
+
getRefinedSchema(schema) {
|
|
41
|
+
return schema
|
|
42
|
+
.refine(opts => [opts.fileId, opts.fileUrl].filter(o => o !== undefined).length === 1, {
|
|
43
|
+
error: `Specify 'fileId' or 'fileUrl', but not both.`,
|
|
44
|
+
params: {
|
|
45
|
+
customCode: 'optionSet',
|
|
46
|
+
options: ['fileId', 'fileUrl']
|
|
47
|
+
}
|
|
48
|
+
});
|
|
31
49
|
}
|
|
32
50
|
async commandAction(logger, args) {
|
|
33
51
|
if (this.verbose) {
|
|
@@ -60,44 +78,5 @@ class SpoFileSharingLinkListCommand extends SpoCommand {
|
|
|
60
78
|
}
|
|
61
79
|
}
|
|
62
80
|
}
|
|
63
|
-
_a = SpoFileSharingLinkListCommand, _SpoFileSharingLinkListCommand_instances = new WeakSet(), _SpoFileSharingLinkListCommand_initTelemetry = function _SpoFileSharingLinkListCommand_initTelemetry() {
|
|
64
|
-
this.telemetry.push((args) => {
|
|
65
|
-
Object.assign(this.telemetryProperties, {
|
|
66
|
-
fileId: typeof args.options.fileId !== 'undefined',
|
|
67
|
-
fileUrl: typeof args.options.fileUrl !== 'undefined',
|
|
68
|
-
scope: typeof args.options.scope !== 'undefined'
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
}, _SpoFileSharingLinkListCommand_initOptions = function _SpoFileSharingLinkListCommand_initOptions() {
|
|
72
|
-
this.options.unshift({
|
|
73
|
-
option: '-u, --webUrl <webUrl>'
|
|
74
|
-
}, {
|
|
75
|
-
option: '--fileId [fileId]'
|
|
76
|
-
}, {
|
|
77
|
-
option: '--fileUrl [fileUrl]'
|
|
78
|
-
}, {
|
|
79
|
-
option: '-s, --scope [scope]',
|
|
80
|
-
autocomplete: _a.allowedScopes
|
|
81
|
-
});
|
|
82
|
-
}, _SpoFileSharingLinkListCommand_initValidators = function _SpoFileSharingLinkListCommand_initValidators() {
|
|
83
|
-
this.validators.push(async (args) => {
|
|
84
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
85
|
-
if (isValidSharePointUrl !== true) {
|
|
86
|
-
return isValidSharePointUrl;
|
|
87
|
-
}
|
|
88
|
-
if (args.options.fileId && !validation.isValidGuid(args.options.fileId)) {
|
|
89
|
-
return `${args.options.fileId} is not a valid GUID`;
|
|
90
|
-
}
|
|
91
|
-
if (args.options.scope && _a.allowedScopes.indexOf(args.options.scope) === -1) {
|
|
92
|
-
return `'${args.options.scope}' is not a valid scope. Allowed values are: ${_a.allowedScopes.join(',')}`;
|
|
93
|
-
}
|
|
94
|
-
return true;
|
|
95
|
-
});
|
|
96
|
-
}, _SpoFileSharingLinkListCommand_initOptionSets = function _SpoFileSharingLinkListCommand_initOptionSets() {
|
|
97
|
-
this.optionSets.push({ options: ['fileId', 'fileUrl'] });
|
|
98
|
-
}, _SpoFileSharingLinkListCommand_initTypes = function _SpoFileSharingLinkListCommand_initTypes() {
|
|
99
|
-
this.types.string.push('webUrl', 'fileId', 'fileUrl', 'scope');
|
|
100
|
-
};
|
|
101
|
-
SpoFileSharingLinkListCommand.allowedScopes = ['anonymous', 'users', 'organization'];
|
|
102
81
|
export default new SpoFileSharingLinkListCommand();
|
|
103
82
|
//# sourceMappingURL=file-sharinglink-list.js.map
|
|
@@ -1,15 +1,23 @@
|
|
|
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 _SpoFileSharingLinkRemoveCommand_instances, _SpoFileSharingLinkRemoveCommand_initTelemetry, _SpoFileSharingLinkRemoveCommand_initOptions, _SpoFileSharingLinkRemoveCommand_initValidators, _SpoFileSharingLinkRemoveCommand_initOptionSets, _SpoFileSharingLinkRemoveCommand_initTypes;
|
|
1
|
+
import { z } from 'zod';
|
|
7
2
|
import { cli } from '../../../../cli/cli.js';
|
|
3
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
8
4
|
import request from '../../../../request.js';
|
|
9
5
|
import { spo } from '../../../../utils/spo.js';
|
|
10
6
|
import { validation } from '../../../../utils/validation.js';
|
|
11
7
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
12
8
|
import commands from '../../commands.js';
|
|
9
|
+
export const options = z.strictObject({
|
|
10
|
+
...globalOptionsZod.shape,
|
|
11
|
+
webUrl: z.string()
|
|
12
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
13
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
14
|
+
})
|
|
15
|
+
.alias('u'),
|
|
16
|
+
fileUrl: z.string().optional(),
|
|
17
|
+
fileId: z.guid().optional(),
|
|
18
|
+
id: z.string().alias('i'),
|
|
19
|
+
force: z.boolean().optional().alias('f')
|
|
20
|
+
});
|
|
13
21
|
class SpoFileSharingLinkRemoveCommand extends SpoCommand {
|
|
14
22
|
get name() {
|
|
15
23
|
return commands.FILE_SHARINGLINK_REMOVE;
|
|
@@ -17,14 +25,18 @@ class SpoFileSharingLinkRemoveCommand extends SpoCommand {
|
|
|
17
25
|
get description() {
|
|
18
26
|
return 'Removes a specific sharing link of a file';
|
|
19
27
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
get schema() {
|
|
29
|
+
return options;
|
|
30
|
+
}
|
|
31
|
+
getRefinedSchema(schema) {
|
|
32
|
+
return schema
|
|
33
|
+
.refine(opts => [opts.fileUrl, opts.fileId].filter(o => o !== undefined).length === 1, {
|
|
34
|
+
error: `Specify 'fileUrl' or 'fileId', but not both.`,
|
|
35
|
+
params: {
|
|
36
|
+
customCode: 'optionSet',
|
|
37
|
+
options: ['fileUrl', 'fileId']
|
|
38
|
+
}
|
|
39
|
+
});
|
|
28
40
|
}
|
|
29
41
|
async commandAction(logger, args) {
|
|
30
42
|
const removeSharingLink = async () => {
|
|
@@ -57,42 +69,5 @@ class SpoFileSharingLinkRemoveCommand extends SpoCommand {
|
|
|
57
69
|
}
|
|
58
70
|
}
|
|
59
71
|
}
|
|
60
|
-
_SpoFileSharingLinkRemoveCommand_instances = new WeakSet(), _SpoFileSharingLinkRemoveCommand_initTelemetry = function _SpoFileSharingLinkRemoveCommand_initTelemetry() {
|
|
61
|
-
this.telemetry.push((args) => {
|
|
62
|
-
Object.assign(this.telemetryProperties, {
|
|
63
|
-
fileUrl: typeof args.options.fileUrl !== 'undefined',
|
|
64
|
-
fileId: typeof args.options.fileId !== 'undefined',
|
|
65
|
-
force: !!args.options.force
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
}, _SpoFileSharingLinkRemoveCommand_initOptions = function _SpoFileSharingLinkRemoveCommand_initOptions() {
|
|
69
|
-
this.options.unshift({
|
|
70
|
-
option: '-u, --webUrl <webUrl>'
|
|
71
|
-
}, {
|
|
72
|
-
option: '--fileUrl [fileUrl]'
|
|
73
|
-
}, {
|
|
74
|
-
option: '--fileId [fileId]'
|
|
75
|
-
}, {
|
|
76
|
-
option: '-i, --id <id>'
|
|
77
|
-
}, {
|
|
78
|
-
option: '-f, --force'
|
|
79
|
-
});
|
|
80
|
-
}, _SpoFileSharingLinkRemoveCommand_initValidators = function _SpoFileSharingLinkRemoveCommand_initValidators() {
|
|
81
|
-
this.validators.push(async (args) => {
|
|
82
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
83
|
-
if (isValidSharePointUrl !== true) {
|
|
84
|
-
return isValidSharePointUrl;
|
|
85
|
-
}
|
|
86
|
-
if (args.options.fileId && !validation.isValidGuid(args.options.fileId)) {
|
|
87
|
-
return `${args.options.fileId} is not a valid GUID`;
|
|
88
|
-
}
|
|
89
|
-
return true;
|
|
90
|
-
});
|
|
91
|
-
}, _SpoFileSharingLinkRemoveCommand_initOptionSets = function _SpoFileSharingLinkRemoveCommand_initOptionSets() {
|
|
92
|
-
this.optionSets.push({ options: ['fileUrl', 'fileId'] });
|
|
93
|
-
}, _SpoFileSharingLinkRemoveCommand_initTypes = function _SpoFileSharingLinkRemoveCommand_initTypes() {
|
|
94
|
-
this.types.string.push('webUrl', 'fileUrl', 'fileId', 'id');
|
|
95
|
-
this.types.boolean.push('force');
|
|
96
|
-
};
|
|
97
72
|
export default new SpoFileSharingLinkRemoveCommand();
|
|
98
73
|
//# sourceMappingURL=file-sharinglink-remove.js.map
|
|
@@ -1,14 +1,25 @@
|
|
|
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 _SpoFileSharingLinkSetCommand_instances, _SpoFileSharingLinkSetCommand_initTelemetry, _SpoFileSharingLinkSetCommand_initOptions, _SpoFileSharingLinkSetCommand_initValidators, _SpoFileSharingLinkSetCommand_initOptionSets, _SpoFileSharingLinkSetCommand_initTypes;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { spo } from '../../../../utils/spo.js';
|
|
9
5
|
import { validation } from '../../../../utils/validation.js';
|
|
10
6
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
11
7
|
import commands from '../../commands.js';
|
|
8
|
+
export const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
webUrl: z.string()
|
|
11
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
12
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
13
|
+
})
|
|
14
|
+
.alias('u'),
|
|
15
|
+
id: z.guid(),
|
|
16
|
+
fileId: z.guid().optional(),
|
|
17
|
+
fileUrl: z.string().optional(),
|
|
18
|
+
expirationDateTime: z.string()
|
|
19
|
+
.refine(date => validation.isValidISODateTime(date) === true, {
|
|
20
|
+
error: e => `'${e.input}' is not a valid ISO date string.`
|
|
21
|
+
})
|
|
22
|
+
});
|
|
12
23
|
class SpoFileSharingLinkSetCommand extends SpoCommand {
|
|
13
24
|
get name() {
|
|
14
25
|
return commands.FILE_SHARINGLINK_SET;
|
|
@@ -16,14 +27,18 @@ class SpoFileSharingLinkSetCommand extends SpoCommand {
|
|
|
16
27
|
get description() {
|
|
17
28
|
return 'Updates a sharing link of a file';
|
|
18
29
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
get schema() {
|
|
31
|
+
return options;
|
|
32
|
+
}
|
|
33
|
+
getRefinedSchema(schema) {
|
|
34
|
+
return schema
|
|
35
|
+
.refine(opts => [opts.fileId, opts.fileUrl].filter(o => o !== undefined).length === 1, {
|
|
36
|
+
error: `Specify 'fileId' or 'fileUrl', but not both.`,
|
|
37
|
+
params: {
|
|
38
|
+
customCode: 'optionSet',
|
|
39
|
+
options: ['fileId', 'fileUrl']
|
|
40
|
+
}
|
|
41
|
+
});
|
|
27
42
|
}
|
|
28
43
|
async commandAction(logger, args) {
|
|
29
44
|
if (this.verbose) {
|
|
@@ -49,46 +64,5 @@ class SpoFileSharingLinkSetCommand extends SpoCommand {
|
|
|
49
64
|
}
|
|
50
65
|
}
|
|
51
66
|
}
|
|
52
|
-
_SpoFileSharingLinkSetCommand_instances = new WeakSet(), _SpoFileSharingLinkSetCommand_initTelemetry = function _SpoFileSharingLinkSetCommand_initTelemetry() {
|
|
53
|
-
this.telemetry.push((args) => {
|
|
54
|
-
Object.assign(this.telemetryProperties, {
|
|
55
|
-
fileId: typeof args.options.fileId !== 'undefined',
|
|
56
|
-
fileUrl: typeof args.options.fileUrl !== 'undefined'
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
}, _SpoFileSharingLinkSetCommand_initOptions = function _SpoFileSharingLinkSetCommand_initOptions() {
|
|
60
|
-
this.options.unshift({
|
|
61
|
-
option: '-u, --webUrl <webUrl>'
|
|
62
|
-
}, {
|
|
63
|
-
option: '--fileId [fileId]'
|
|
64
|
-
}, {
|
|
65
|
-
option: '--fileUrl [fileUrl]'
|
|
66
|
-
}, {
|
|
67
|
-
option: '--id <id>'
|
|
68
|
-
}, {
|
|
69
|
-
option: '--expirationDateTime <expirationDateTime>'
|
|
70
|
-
});
|
|
71
|
-
}, _SpoFileSharingLinkSetCommand_initValidators = function _SpoFileSharingLinkSetCommand_initValidators() {
|
|
72
|
-
this.validators.push(async (args) => {
|
|
73
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
74
|
-
if (isValidSharePointUrl !== true) {
|
|
75
|
-
return isValidSharePointUrl;
|
|
76
|
-
}
|
|
77
|
-
if (args.options.fileId && !validation.isValidGuid(args.options.fileId)) {
|
|
78
|
-
return `${args.options.fileId} is not a valid GUID`;
|
|
79
|
-
}
|
|
80
|
-
if (!validation.isValidGuid(args.options.id)) {
|
|
81
|
-
return `${args.options.id} is not a valid GUID`;
|
|
82
|
-
}
|
|
83
|
-
if (!validation.isValidISODateTime(args.options.expirationDateTime)) {
|
|
84
|
-
return `'${args.options.expirationDateTime}' is not a valid ISO date string`;
|
|
85
|
-
}
|
|
86
|
-
return true;
|
|
87
|
-
});
|
|
88
|
-
}, _SpoFileSharingLinkSetCommand_initOptionSets = function _SpoFileSharingLinkSetCommand_initOptionSets() {
|
|
89
|
-
this.optionSets.push({ options: ['fileId', 'fileUrl'] });
|
|
90
|
-
}, _SpoFileSharingLinkSetCommand_initTypes = function _SpoFileSharingLinkSetCommand_initTypes() {
|
|
91
|
-
this.types.string.push('webUrl', 'id', 'fileId', 'fileUrl', 'expirationDateTime');
|
|
92
|
-
};
|
|
93
67
|
export default new SpoFileSharingLinkSetCommand();
|
|
94
68
|
//# sourceMappingURL=file-sharinglink-set.js.map
|
|
@@ -15,7 +15,7 @@ export const options = z.strictObject({
|
|
|
15
15
|
})
|
|
16
16
|
.alias('u'),
|
|
17
17
|
url: z.string().optional(),
|
|
18
|
-
id: z.
|
|
18
|
+
id: z.guid().optional().alias('i'),
|
|
19
19
|
force: z.boolean().optional().alias('f')
|
|
20
20
|
});
|
|
21
21
|
class SpoFileUnarchiveCommand extends SpoCommand {
|
|
@@ -1,16 +1,23 @@
|
|
|
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 _SpoFileVersionClearCommand_instances, _SpoFileVersionClearCommand_initTelemetry, _SpoFileVersionClearCommand_initOptions, _SpoFileVersionClearCommand_initValidators, _SpoFileVersionClearCommand_initOptionSets, _SpoFileVersionClearCommand_initTypes;
|
|
1
|
+
import { z } from 'zod';
|
|
7
2
|
import { cli } from '../../../../cli/cli.js';
|
|
3
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
8
4
|
import request from '../../../../request.js';
|
|
9
5
|
import { formatting } from '../../../../utils/formatting.js';
|
|
10
6
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
11
7
|
import { validation } from '../../../../utils/validation.js';
|
|
12
8
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
13
9
|
import commands from '../../commands.js';
|
|
10
|
+
export const options = z.strictObject({
|
|
11
|
+
...globalOptionsZod.shape,
|
|
12
|
+
webUrl: z.string()
|
|
13
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
14
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
15
|
+
})
|
|
16
|
+
.alias('u'),
|
|
17
|
+
fileUrl: z.string().optional(),
|
|
18
|
+
fileId: z.guid().optional().alias('i'),
|
|
19
|
+
force: z.boolean().optional().alias('f')
|
|
20
|
+
});
|
|
14
21
|
class SpoFileVersionClearCommand extends SpoCommand {
|
|
15
22
|
get name() {
|
|
16
23
|
return commands.FILE_VERSION_CLEAR;
|
|
@@ -18,14 +25,18 @@ class SpoFileVersionClearCommand extends SpoCommand {
|
|
|
18
25
|
get description() {
|
|
19
26
|
return 'Deletes all file version history of a file in a SharePoint Document library';
|
|
20
27
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
get schema() {
|
|
29
|
+
return options;
|
|
30
|
+
}
|
|
31
|
+
getRefinedSchema(schema) {
|
|
32
|
+
return schema
|
|
33
|
+
.refine(opts => [opts.fileUrl, opts.fileId].filter(o => o !== undefined).length === 1, {
|
|
34
|
+
error: `Specify 'fileUrl' or 'fileId', but not both.`,
|
|
35
|
+
params: {
|
|
36
|
+
customCode: 'optionSet',
|
|
37
|
+
options: ['fileUrl', 'fileId']
|
|
38
|
+
}
|
|
39
|
+
});
|
|
29
40
|
}
|
|
30
41
|
async commandAction(logger, args) {
|
|
31
42
|
if (this.verbose) {
|
|
@@ -65,36 +76,5 @@ class SpoFileVersionClearCommand extends SpoCommand {
|
|
|
65
76
|
return request.post(requestOptions);
|
|
66
77
|
}
|
|
67
78
|
}
|
|
68
|
-
_SpoFileVersionClearCommand_instances = new WeakSet(), _SpoFileVersionClearCommand_initTelemetry = function _SpoFileVersionClearCommand_initTelemetry() {
|
|
69
|
-
this.telemetry.push((args) => {
|
|
70
|
-
Object.assign(this.telemetryProperties, {
|
|
71
|
-
fileUrl: args.options.fileUrl,
|
|
72
|
-
fileId: args.options.fileId,
|
|
73
|
-
force: !!args.options.force
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
}, _SpoFileVersionClearCommand_initOptions = function _SpoFileVersionClearCommand_initOptions() {
|
|
77
|
-
this.options.unshift({
|
|
78
|
-
option: '-u, --webUrl <webUrl>'
|
|
79
|
-
}, {
|
|
80
|
-
option: '--fileUrl [fileUrl]'
|
|
81
|
-
}, {
|
|
82
|
-
option: '-i, --fileId [fileId]'
|
|
83
|
-
}, {
|
|
84
|
-
option: '-f, --force'
|
|
85
|
-
});
|
|
86
|
-
}, _SpoFileVersionClearCommand_initValidators = function _SpoFileVersionClearCommand_initValidators() {
|
|
87
|
-
this.validators.push(async (args) => {
|
|
88
|
-
if (args.options.fileId && !validation.isValidGuid(args.options.fileId)) {
|
|
89
|
-
return `${args.options.fileId} is not a valid GUID`;
|
|
90
|
-
}
|
|
91
|
-
return validation.isValidSharePointUrl(args.options.webUrl);
|
|
92
|
-
});
|
|
93
|
-
}, _SpoFileVersionClearCommand_initOptionSets = function _SpoFileVersionClearCommand_initOptionSets() {
|
|
94
|
-
this.optionSets.push({ options: ['fileUrl', 'fileId'] });
|
|
95
|
-
}, _SpoFileVersionClearCommand_initTypes = function _SpoFileVersionClearCommand_initTypes() {
|
|
96
|
-
this.types.string.push('webUrl', 'fileUrl', 'fileId');
|
|
97
|
-
this.types.boolean.push('force');
|
|
98
|
-
};
|
|
99
79
|
export default new SpoFileVersionClearCommand();
|
|
100
80
|
//# sourceMappingURL=file-version-clear.js.map
|