@pnp/cli-microsoft365 12.1.0-beta.0c2915d → 12.1.0-beta.dbc076e
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/m365/spo/commands/file/file-add.js +77 -51
- package/dist/m365/spo/commands/file/file-archive.js +1 -1
- package/dist/m365/spo/commands/file/file-checkin.js +64 -35
- package/dist/m365/spo/commands/file/file-checkout-undo.js +49 -25
- package/dist/m365/spo/commands/file/file-checkout.js +47 -24
- package/dist/m365/spo/commands/file/file-copy.js +68 -37
- package/dist/m365/spo/commands/file/file-get.js +79 -44
- package/dist/m365/spo/commands/file/file-list.js +39 -16
- package/dist/m365/spo/commands/file/file-move.js +68 -30
- package/dist/m365/spo/commands/file/file-remove.js +56 -27
- package/dist/m365/spo/commands/file/file-rename.js +36 -15
- package/dist/m365/spo/commands/file/file-retentionlabel-ensure.js +51 -26
- package/dist/m365/spo/commands/file/file-retentionlabel-remove.js +50 -25
- package/dist/m365/spo/commands/file/file-roleassignment-add.js +75 -47
- package/dist/m365/spo/commands/file/file-roleassignment-remove.js +70 -39
- package/dist/m365/spo/commands/file/file-roleinheritance-break.js +52 -26
- package/dist/m365/spo/commands/file/file-roleinheritance-reset.js +49 -25
- package/dist/m365/spo/commands/file/file-sharinginfo-get.js +47 -24
- package/dist/m365/spo/commands/file/file-sharinglink-add.js +70 -46
- package/dist/m365/spo/commands/file/file-sharinglink-clear.js +57 -33
- package/dist/m365/spo/commands/file/file-sharinglink-get.js +47 -25
- package/dist/m365/spo/commands/file/file-sharinglink-list.js +53 -32
- package/dist/m365/spo/commands/file/file-sharinglink-remove.js +51 -26
- package/dist/m365/spo/commands/file/file-sharinglink-set.js +55 -29
- package/dist/m365/spo/commands/file/file-unarchive.js +1 -1
- package/dist/m365/spo/commands/file/file-version-clear.js +45 -25
- package/dist/m365/spo/commands/file/file-version-get.js +43 -25
- package/dist/m365/spo/commands/file/file-version-keep.js +1 -1
- package/dist/m365/spo/commands/file/file-version-list.js +41 -24
- package/dist/m365/spo/commands/file/file-version-remove.js +47 -26
- package/dist/m365/spo/commands/file/file-version-restore.js +47 -26
- package/dist/m365/spo/commands/folder/folder-add.js +48 -19
- package/dist/m365/spo/commands/folder/folder-copy.js +62 -36
- package/dist/m365/spo/commands/folder/folder-get.js +51 -30
- package/dist/m365/spo/commands/folder/folder-list.js +39 -16
- package/dist/m365/spo/commands/folder/folder-move.js +62 -36
- package/dist/m365/spo/commands/folder/folder-remove.js +36 -15
- package/dist/m365/spo/commands/folder/folder-retentionlabel-ensure.js +48 -30
- package/dist/m365/spo/commands/folder/folder-retentionlabel-remove.js +50 -30
- package/dist/m365/spo/commands/folder/folder-roleassignment-add.js +79 -49
- package/dist/m365/spo/commands/folder/folder-roleassignment-remove.js +67 -37
- package/dist/m365/spo/commands/folder/folder-roleinheritance-break.js +36 -15
- package/dist/m365/spo/commands/folder/folder-roleinheritance-reset.js +33 -14
- package/dist/m365/spo/commands/folder/folder-set.js +48 -28
- package/dist/m365/spo/commands/folder/folder-sharinglink-add.js +86 -58
- package/dist/m365/spo/commands/folder/folder-sharinglink-clear.js +50 -33
- package/dist/m365/spo/commands/folder/folder-sharinglink-get.js +42 -33
- package/dist/m365/spo/commands/folder/folder-sharinglink-list.js +47 -32
- package/dist/m365/spo/commands/folder/folder-sharinglink-remove.js +41 -34
- package/dist/m365/spo/commands/folder/folder-sharinglink-set.js +43 -38
- package/package.json +1 -1
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 _SpoFolderAddCommand_instances, _SpoFolderAddCommand_initTelemetry, _SpoFolderAddCommand_initOptions, _SpoFolderAddCommand_initValidators, _SpoFolderAddCommand_initTypes;
|
|
3
7
|
import request from '../../../../request.js';
|
|
4
8
|
import { formatting } from '../../../../utils/formatting.js';
|
|
5
9
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
@@ -7,21 +11,6 @@ import { validation } from '../../../../utils/validation.js';
|
|
|
7
11
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
8
12
|
import commands from '../../commands.js';
|
|
9
13
|
import { FolderColorValues } from './FolderColor.js';
|
|
10
|
-
const folderColorValues = [...Object.keys(FolderColorValues), ...Object.values(FolderColorValues)];
|
|
11
|
-
export const options = z.strictObject({
|
|
12
|
-
...globalOptionsZod.shape,
|
|
13
|
-
webUrl: z.string()
|
|
14
|
-
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
15
|
-
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
16
|
-
})
|
|
17
|
-
.alias('u'),
|
|
18
|
-
parentFolderUrl: z.string().alias('p'),
|
|
19
|
-
name: z.string().alias('n'),
|
|
20
|
-
color: z.enum(folderColorValues, {
|
|
21
|
-
error: e => `'${e.input}' is not a valid value for option 'color'. Allowed values are ${Object.keys(FolderColorValues).join(', ')}, ${Object.values(FolderColorValues).join(', ')}.`
|
|
22
|
-
}).optional(),
|
|
23
|
-
ensureParentFolders: z.boolean().optional()
|
|
24
|
-
});
|
|
25
14
|
class SpoFolderAddCommand extends SpoCommand {
|
|
26
15
|
get name() {
|
|
27
16
|
return commands.FOLDER_ADD;
|
|
@@ -29,8 +18,13 @@ class SpoFolderAddCommand extends SpoCommand {
|
|
|
29
18
|
get description() {
|
|
30
19
|
return 'Creates a folder within a parent folder';
|
|
31
20
|
}
|
|
32
|
-
|
|
33
|
-
|
|
21
|
+
constructor() {
|
|
22
|
+
super();
|
|
23
|
+
_SpoFolderAddCommand_instances.add(this);
|
|
24
|
+
__classPrivateFieldGet(this, _SpoFolderAddCommand_instances, "m", _SpoFolderAddCommand_initTelemetry).call(this);
|
|
25
|
+
__classPrivateFieldGet(this, _SpoFolderAddCommand_instances, "m", _SpoFolderAddCommand_initOptions).call(this);
|
|
26
|
+
__classPrivateFieldGet(this, _SpoFolderAddCommand_instances, "m", _SpoFolderAddCommand_initValidators).call(this);
|
|
27
|
+
__classPrivateFieldGet(this, _SpoFolderAddCommand_instances, "m", _SpoFolderAddCommand_initTypes).call(this);
|
|
34
28
|
}
|
|
35
29
|
async commandAction(logger, args) {
|
|
36
30
|
try {
|
|
@@ -104,5 +98,40 @@ class SpoFolderAddCommand extends SpoCommand {
|
|
|
104
98
|
return response;
|
|
105
99
|
}
|
|
106
100
|
}
|
|
101
|
+
_SpoFolderAddCommand_instances = new WeakSet(), _SpoFolderAddCommand_initTelemetry = function _SpoFolderAddCommand_initTelemetry() {
|
|
102
|
+
this.telemetry.push((args) => {
|
|
103
|
+
Object.assign(this.telemetryProperties, {
|
|
104
|
+
color: typeof args.options.color !== 'undefined',
|
|
105
|
+
ensureParentFolders: !!args.options.ensureParentFolders
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
}, _SpoFolderAddCommand_initOptions = function _SpoFolderAddCommand_initOptions() {
|
|
109
|
+
this.options.unshift({
|
|
110
|
+
option: '-u, --webUrl <webUrl>'
|
|
111
|
+
}, {
|
|
112
|
+
option: '-p, --parentFolderUrl <parentFolderUrl>'
|
|
113
|
+
}, {
|
|
114
|
+
option: '-n, --name <name>'
|
|
115
|
+
}, {
|
|
116
|
+
option: '--color [color]',
|
|
117
|
+
autocomplete: Object.keys(FolderColorValues)
|
|
118
|
+
}, {
|
|
119
|
+
option: '--ensureParentFolders'
|
|
120
|
+
});
|
|
121
|
+
}, _SpoFolderAddCommand_initValidators = function _SpoFolderAddCommand_initValidators() {
|
|
122
|
+
this.validators.push(async (args) => {
|
|
123
|
+
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
124
|
+
if (isValidSharePointUrl !== true) {
|
|
125
|
+
return isValidSharePointUrl;
|
|
126
|
+
}
|
|
127
|
+
if (args.options.color && !Object.entries(FolderColorValues).flat().includes(args.options.color)) {
|
|
128
|
+
return `'${args.options.color}' is not a valid value for option 'color'. Allowed values are ${Object.keys(FolderColorValues).join(', ')}, ${Object.values(FolderColorValues).join(', ')}.`;
|
|
129
|
+
}
|
|
130
|
+
return true;
|
|
131
|
+
});
|
|
132
|
+
}, _SpoFolderAddCommand_initTypes = function _SpoFolderAddCommand_initTypes() {
|
|
133
|
+
this.types.string.push('webUrl', 'parentFolderUrl', 'name', 'color');
|
|
134
|
+
this.types.boolean.push('ensureParentFolders');
|
|
135
|
+
};
|
|
107
136
|
export default new SpoFolderAddCommand();
|
|
108
137
|
//# sourceMappingURL=folder-add.js.map
|
|
@@ -1,33 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 _SpoFolderCopyCommand_instances, _SpoFolderCopyCommand_initTelemetry, _SpoFolderCopyCommand_initOptions, _SpoFolderCopyCommand_initValidators, _SpoFolderCopyCommand_initOptionSets, _SpoFolderCopyCommand_initTypes;
|
|
3
7
|
import request from '../../../../request.js';
|
|
4
8
|
import { CreateFolderCopyJobsNameConflictBehavior, spo } from '../../../../utils/spo.js';
|
|
5
9
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
6
10
|
import { validation } from '../../../../utils/validation.js';
|
|
7
11
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
8
12
|
import commands from '../../commands.js';
|
|
9
|
-
const nameConflictBehaviorOptions = ['fail', 'rename'];
|
|
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
|
-
sourceUrl: z.string().optional().alias('s'),
|
|
18
|
-
sourceId: z.string()
|
|
19
|
-
.refine(id => validation.isValidGuid(id), {
|
|
20
|
-
error: e => `'${e.input}' is not a valid GUID for sourceId.`
|
|
21
|
-
})
|
|
22
|
-
.optional()
|
|
23
|
-
.alias('i'),
|
|
24
|
-
targetUrl: z.string().alias('t'),
|
|
25
|
-
newName: z.string().optional(),
|
|
26
|
-
nameConflictBehavior: z.enum(nameConflictBehaviorOptions, {
|
|
27
|
-
error: e => `'${e.input}' is not a valid value for nameConflictBehavior. Allowed values are: ${nameConflictBehaviorOptions.join(', ')}.`
|
|
28
|
-
}).optional(),
|
|
29
|
-
skipWait: z.boolean().optional()
|
|
30
|
-
});
|
|
31
13
|
class SpoFolderCopyCommand extends SpoCommand {
|
|
32
14
|
get name() {
|
|
33
15
|
return commands.FOLDER_COPY;
|
|
@@ -35,18 +17,15 @@ class SpoFolderCopyCommand extends SpoCommand {
|
|
|
35
17
|
get description() {
|
|
36
18
|
return 'Copies a folder to another location';
|
|
37
19
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
options: ['sourceUrl', 'sourceId']
|
|
48
|
-
}
|
|
49
|
-
});
|
|
20
|
+
constructor() {
|
|
21
|
+
super();
|
|
22
|
+
_SpoFolderCopyCommand_instances.add(this);
|
|
23
|
+
this.nameConflictBehaviorOptions = ['fail', 'rename'];
|
|
24
|
+
__classPrivateFieldGet(this, _SpoFolderCopyCommand_instances, "m", _SpoFolderCopyCommand_initTelemetry).call(this);
|
|
25
|
+
__classPrivateFieldGet(this, _SpoFolderCopyCommand_instances, "m", _SpoFolderCopyCommand_initOptions).call(this);
|
|
26
|
+
__classPrivateFieldGet(this, _SpoFolderCopyCommand_instances, "m", _SpoFolderCopyCommand_initValidators).call(this);
|
|
27
|
+
__classPrivateFieldGet(this, _SpoFolderCopyCommand_instances, "m", _SpoFolderCopyCommand_initOptionSets).call(this);
|
|
28
|
+
__classPrivateFieldGet(this, _SpoFolderCopyCommand_instances, "m", _SpoFolderCopyCommand_initTypes).call(this);
|
|
50
29
|
}
|
|
51
30
|
getExcludedOptionsWithUrls() {
|
|
52
31
|
return ['targetUrl', 'sourceUrl'];
|
|
@@ -123,5 +102,52 @@ class SpoFolderCopyCommand extends SpoCommand {
|
|
|
123
102
|
return urlUtil.removeTrailingSlashes(result);
|
|
124
103
|
}
|
|
125
104
|
}
|
|
105
|
+
_SpoFolderCopyCommand_instances = new WeakSet(), _SpoFolderCopyCommand_initTelemetry = function _SpoFolderCopyCommand_initTelemetry() {
|
|
106
|
+
this.telemetry.push((args) => {
|
|
107
|
+
Object.assign(this.telemetryProperties, {
|
|
108
|
+
sourceUrl: typeof args.options.sourceUrl !== 'undefined',
|
|
109
|
+
sourceId: typeof args.options.sourceId !== 'undefined',
|
|
110
|
+
newName: typeof args.options.newName !== 'undefined',
|
|
111
|
+
nameConflictBehavior: typeof args.options.nameConflictBehavior !== 'undefined',
|
|
112
|
+
skipWait: !!args.options.skipWait
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
}, _SpoFolderCopyCommand_initOptions = function _SpoFolderCopyCommand_initOptions() {
|
|
116
|
+
this.options.unshift({
|
|
117
|
+
option: '-u, --webUrl <webUrl>'
|
|
118
|
+
}, {
|
|
119
|
+
option: '-s, --sourceUrl [sourceUrl]'
|
|
120
|
+
}, {
|
|
121
|
+
option: '-i, --sourceId [sourceId]'
|
|
122
|
+
}, {
|
|
123
|
+
option: '-t, --targetUrl <targetUrl>'
|
|
124
|
+
}, {
|
|
125
|
+
option: '--newName [newName]'
|
|
126
|
+
}, {
|
|
127
|
+
option: '--nameConflictBehavior [nameConflictBehavior]',
|
|
128
|
+
autocomplete: this.nameConflictBehaviorOptions
|
|
129
|
+
}, {
|
|
130
|
+
option: '--skipWait'
|
|
131
|
+
});
|
|
132
|
+
}, _SpoFolderCopyCommand_initValidators = function _SpoFolderCopyCommand_initValidators() {
|
|
133
|
+
this.validators.push(async (args) => {
|
|
134
|
+
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
135
|
+
if (isValidSharePointUrl !== true) {
|
|
136
|
+
return isValidSharePointUrl;
|
|
137
|
+
}
|
|
138
|
+
if (args.options.sourceId && !validation.isValidGuid(args.options.sourceId)) {
|
|
139
|
+
return `'${args.options.sourceId}' is not a valid GUID for sourceId.`;
|
|
140
|
+
}
|
|
141
|
+
if (args.options.nameConflictBehavior && this.nameConflictBehaviorOptions.indexOf(args.options.nameConflictBehavior) === -1) {
|
|
142
|
+
return `'${args.options.nameConflictBehavior}' is not a valid value for nameConflictBehavior. Allowed values are: ${this.nameConflictBehaviorOptions.join(', ')}.`;
|
|
143
|
+
}
|
|
144
|
+
return true;
|
|
145
|
+
});
|
|
146
|
+
}, _SpoFolderCopyCommand_initOptionSets = function _SpoFolderCopyCommand_initOptionSets() {
|
|
147
|
+
this.optionSets.push({ options: ['sourceUrl', 'sourceId'] });
|
|
148
|
+
}, _SpoFolderCopyCommand_initTypes = function _SpoFolderCopyCommand_initTypes() {
|
|
149
|
+
this.types.string.push('webUrl', 'sourceUrl', 'sourceId', 'targetUrl', 'newName', 'nameConflictBehavior');
|
|
150
|
+
this.types.boolean.push('skipWait');
|
|
151
|
+
};
|
|
126
152
|
export default new SpoFolderCopyCommand();
|
|
127
153
|
//# sourceMappingURL=folder-copy.js.map
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 _SpoFolderGetCommand_instances, _SpoFolderGetCommand_initTelemetry, _SpoFolderGetCommand_initOptions, _SpoFolderGetCommand_initValidators, _SpoFolderGetCommand_initOptionSets, _SpoFolderGetCommand_initTypes;
|
|
7
|
+
import { CommandError } from '../../../../Command.js';
|
|
3
8
|
import request from '../../../../request.js';
|
|
4
9
|
import { formatting } from '../../../../utils/formatting.js';
|
|
5
10
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
@@ -7,22 +12,6 @@ import { validation } from '../../../../utils/validation.js';
|
|
|
7
12
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
8
13
|
import commands from '../../commands.js';
|
|
9
14
|
import { ListPrincipalType } from '../list/ListPrincipalType.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
|
-
url: z.string().optional(),
|
|
18
|
-
id: z.string()
|
|
19
|
-
.refine(id => validation.isValidGuid(id), {
|
|
20
|
-
error: e => `'${e.input}' is not a valid GUID.`
|
|
21
|
-
})
|
|
22
|
-
.optional()
|
|
23
|
-
.alias('i'),
|
|
24
|
-
withPermissions: z.boolean().optional()
|
|
25
|
-
});
|
|
26
15
|
class SpoFolderGetCommand extends SpoCommand {
|
|
27
16
|
get name() {
|
|
28
17
|
return commands.FOLDER_GET;
|
|
@@ -30,18 +19,14 @@ class SpoFolderGetCommand extends SpoCommand {
|
|
|
30
19
|
get description() {
|
|
31
20
|
return 'Gets information about the specified folder';
|
|
32
21
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
customCode: 'optionSet',
|
|
42
|
-
options: ['url', 'id']
|
|
43
|
-
}
|
|
44
|
-
});
|
|
22
|
+
constructor() {
|
|
23
|
+
super();
|
|
24
|
+
_SpoFolderGetCommand_instances.add(this);
|
|
25
|
+
__classPrivateFieldGet(this, _SpoFolderGetCommand_instances, "m", _SpoFolderGetCommand_initTelemetry).call(this);
|
|
26
|
+
__classPrivateFieldGet(this, _SpoFolderGetCommand_instances, "m", _SpoFolderGetCommand_initOptions).call(this);
|
|
27
|
+
__classPrivateFieldGet(this, _SpoFolderGetCommand_instances, "m", _SpoFolderGetCommand_initValidators).call(this);
|
|
28
|
+
__classPrivateFieldGet(this, _SpoFolderGetCommand_instances, "m", _SpoFolderGetCommand_initOptionSets).call(this);
|
|
29
|
+
__classPrivateFieldGet(this, _SpoFolderGetCommand_instances, "m", _SpoFolderGetCommand_initTypes).call(this);
|
|
45
30
|
}
|
|
46
31
|
getExcludedOptionsWithUrls() {
|
|
47
32
|
return ['url'];
|
|
@@ -90,5 +75,41 @@ class SpoFolderGetCommand extends SpoCommand {
|
|
|
90
75
|
}
|
|
91
76
|
}
|
|
92
77
|
}
|
|
78
|
+
_SpoFolderGetCommand_instances = new WeakSet(), _SpoFolderGetCommand_initTelemetry = function _SpoFolderGetCommand_initTelemetry() {
|
|
79
|
+
this.telemetry.push((args) => {
|
|
80
|
+
Object.assign(this.telemetryProperties, {
|
|
81
|
+
id: typeof args.options.id !== 'undefined',
|
|
82
|
+
url: typeof args.options.url !== 'undefined',
|
|
83
|
+
withPermissions: typeof args.options.withPermissions !== 'undefined'
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
}, _SpoFolderGetCommand_initOptions = function _SpoFolderGetCommand_initOptions() {
|
|
87
|
+
this.options.unshift({
|
|
88
|
+
option: '-u, --webUrl <webUrl>'
|
|
89
|
+
}, {
|
|
90
|
+
option: '--url [url]'
|
|
91
|
+
}, {
|
|
92
|
+
option: '-i, --id [id]'
|
|
93
|
+
}, {
|
|
94
|
+
option: '--withPermissions'
|
|
95
|
+
});
|
|
96
|
+
}, _SpoFolderGetCommand_initValidators = function _SpoFolderGetCommand_initValidators() {
|
|
97
|
+
this.validators.push(async (args) => {
|
|
98
|
+
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
99
|
+
if (isValidSharePointUrl !== true) {
|
|
100
|
+
return isValidSharePointUrl;
|
|
101
|
+
}
|
|
102
|
+
if (args.options.id) {
|
|
103
|
+
if (!validation.isValidGuid(args.options.id)) {
|
|
104
|
+
return `${args.options.id} is not a valid GUID`;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return true;
|
|
108
|
+
});
|
|
109
|
+
}, _SpoFolderGetCommand_initOptionSets = function _SpoFolderGetCommand_initOptionSets() {
|
|
110
|
+
this.optionSets.push({ options: ['url', 'id'] });
|
|
111
|
+
}, _SpoFolderGetCommand_initTypes = function _SpoFolderGetCommand_initTypes() {
|
|
112
|
+
this.types.string.push('webUrl', 'url', 'id');
|
|
113
|
+
};
|
|
93
114
|
export default new SpoFolderGetCommand();
|
|
94
115
|
//# sourceMappingURL=folder-get.js.map
|
|
@@ -1,23 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 _SpoFolderListCommand_instances, _SpoFolderListCommand_initTelemetry, _SpoFolderListCommand_initOptions, _SpoFolderListCommand_initValidators, _SpoFolderListCommand_initTypes;
|
|
3
7
|
import request from '../../../../request.js';
|
|
4
8
|
import { formatting } from '../../../../utils/formatting.js';
|
|
5
9
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
6
10
|
import { validation } from '../../../../utils/validation.js';
|
|
7
11
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
8
12
|
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
|
-
parentFolderUrl: z.string().alias('p'),
|
|
17
|
-
fields: z.string().optional(),
|
|
18
|
-
filter: z.string().optional(),
|
|
19
|
-
recursive: z.boolean().optional().alias('r')
|
|
20
|
-
});
|
|
21
13
|
class SpoFolderListCommand extends SpoCommand {
|
|
22
14
|
get name() {
|
|
23
15
|
return commands.FOLDER_LIST;
|
|
@@ -28,8 +20,13 @@ class SpoFolderListCommand extends SpoCommand {
|
|
|
28
20
|
defaultProperties() {
|
|
29
21
|
return ['Name', 'ServerRelativeUrl'];
|
|
30
22
|
}
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
constructor() {
|
|
24
|
+
super();
|
|
25
|
+
_SpoFolderListCommand_instances.add(this);
|
|
26
|
+
__classPrivateFieldGet(this, _SpoFolderListCommand_instances, "m", _SpoFolderListCommand_initTelemetry).call(this);
|
|
27
|
+
__classPrivateFieldGet(this, _SpoFolderListCommand_instances, "m", _SpoFolderListCommand_initOptions).call(this);
|
|
28
|
+
__classPrivateFieldGet(this, _SpoFolderListCommand_instances, "m", _SpoFolderListCommand_initValidators).call(this);
|
|
29
|
+
__classPrivateFieldGet(this, _SpoFolderListCommand_instances, "m", _SpoFolderListCommand_initTypes).call(this);
|
|
33
30
|
}
|
|
34
31
|
async commandAction(logger, args) {
|
|
35
32
|
if (this.verbose) {
|
|
@@ -107,6 +104,32 @@ class SpoFolderListCommand extends SpoCommand {
|
|
|
107
104
|
};
|
|
108
105
|
}
|
|
109
106
|
}
|
|
107
|
+
_SpoFolderListCommand_instances = new WeakSet(), _SpoFolderListCommand_initTelemetry = function _SpoFolderListCommand_initTelemetry() {
|
|
108
|
+
this.telemetry.push((args) => {
|
|
109
|
+
Object.assign(this.telemetryProperties, {
|
|
110
|
+
recursive: !!args.options.recursive,
|
|
111
|
+
fields: typeof args.options.fields !== 'undefined',
|
|
112
|
+
filter: typeof args.options.filter !== 'undefined'
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
}, _SpoFolderListCommand_initOptions = function _SpoFolderListCommand_initOptions() {
|
|
116
|
+
this.options.unshift({
|
|
117
|
+
option: '-u, --webUrl <webUrl>'
|
|
118
|
+
}, {
|
|
119
|
+
option: '-p, --parentFolderUrl <parentFolderUrl>'
|
|
120
|
+
}, {
|
|
121
|
+
option: '--fields [fields]'
|
|
122
|
+
}, {
|
|
123
|
+
option: '--filter [filter]'
|
|
124
|
+
}, {
|
|
125
|
+
option: '-r, --recursive'
|
|
126
|
+
});
|
|
127
|
+
}, _SpoFolderListCommand_initValidators = function _SpoFolderListCommand_initValidators() {
|
|
128
|
+
this.validators.push(async (args) => validation.isValidSharePointUrl(args.options.webUrl));
|
|
129
|
+
}, _SpoFolderListCommand_initTypes = function _SpoFolderListCommand_initTypes() {
|
|
130
|
+
this.types.string.push('webUrl', 'parentFolderUrl', 'fields', 'filter');
|
|
131
|
+
this.types.boolean.push('recursive');
|
|
132
|
+
};
|
|
110
133
|
SpoFolderListCommand.pageSize = 5000;
|
|
111
134
|
export default new SpoFolderListCommand();
|
|
112
135
|
//# sourceMappingURL=folder-list.js.map
|
|
@@ -1,33 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 _SpoFolderMoveCommand_instances, _SpoFolderMoveCommand_initTelemetry, _SpoFolderMoveCommand_initOptions, _SpoFolderMoveCommand_initValidators, _SpoFolderMoveCommand_initOptionSets, _SpoFolderMoveCommand_initTypes;
|
|
3
7
|
import request from '../../../../request.js';
|
|
4
8
|
import { CreateFolderCopyJobsNameConflictBehavior, spo } from '../../../../utils/spo.js';
|
|
5
9
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
6
10
|
import { validation } from '../../../../utils/validation.js';
|
|
7
11
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
8
12
|
import commands from '../../commands.js';
|
|
9
|
-
const nameConflictBehaviorOptions = ['fail', 'rename'];
|
|
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
|
-
sourceUrl: z.string().optional().alias('s'),
|
|
18
|
-
sourceId: z.string()
|
|
19
|
-
.refine(id => validation.isValidGuid(id), {
|
|
20
|
-
error: e => `'${e.input}' is not a valid GUID for sourceId.`
|
|
21
|
-
})
|
|
22
|
-
.optional()
|
|
23
|
-
.alias('i'),
|
|
24
|
-
targetUrl: z.string().alias('t'),
|
|
25
|
-
newName: z.string().optional(),
|
|
26
|
-
nameConflictBehavior: z.enum(nameConflictBehaviorOptions, {
|
|
27
|
-
error: e => `'${e.input}' is not a valid value for nameConflictBehavior. Allowed values are: ${nameConflictBehaviorOptions.join(', ')}.`
|
|
28
|
-
}).optional(),
|
|
29
|
-
skipWait: z.boolean().optional()
|
|
30
|
-
});
|
|
31
13
|
class SpoFolderMoveCommand extends SpoCommand {
|
|
32
14
|
get name() {
|
|
33
15
|
return commands.FOLDER_MOVE;
|
|
@@ -35,18 +17,15 @@ class SpoFolderMoveCommand extends SpoCommand {
|
|
|
35
17
|
get description() {
|
|
36
18
|
return 'Moves a folder to another location';
|
|
37
19
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
options: ['sourceUrl', 'sourceId']
|
|
48
|
-
}
|
|
49
|
-
});
|
|
20
|
+
constructor() {
|
|
21
|
+
super();
|
|
22
|
+
_SpoFolderMoveCommand_instances.add(this);
|
|
23
|
+
this.nameConflictBehaviorOptions = ['fail', 'rename'];
|
|
24
|
+
__classPrivateFieldGet(this, _SpoFolderMoveCommand_instances, "m", _SpoFolderMoveCommand_initTelemetry).call(this);
|
|
25
|
+
__classPrivateFieldGet(this, _SpoFolderMoveCommand_instances, "m", _SpoFolderMoveCommand_initOptions).call(this);
|
|
26
|
+
__classPrivateFieldGet(this, _SpoFolderMoveCommand_instances, "m", _SpoFolderMoveCommand_initValidators).call(this);
|
|
27
|
+
__classPrivateFieldGet(this, _SpoFolderMoveCommand_instances, "m", _SpoFolderMoveCommand_initOptionSets).call(this);
|
|
28
|
+
__classPrivateFieldGet(this, _SpoFolderMoveCommand_instances, "m", _SpoFolderMoveCommand_initTypes).call(this);
|
|
50
29
|
}
|
|
51
30
|
getExcludedOptionsWithUrls() {
|
|
52
31
|
return ['targetUrl', 'sourceUrl'];
|
|
@@ -123,5 +102,52 @@ class SpoFolderMoveCommand extends SpoCommand {
|
|
|
123
102
|
return urlUtil.removeTrailingSlashes(result);
|
|
124
103
|
}
|
|
125
104
|
}
|
|
105
|
+
_SpoFolderMoveCommand_instances = new WeakSet(), _SpoFolderMoveCommand_initTelemetry = function _SpoFolderMoveCommand_initTelemetry() {
|
|
106
|
+
this.telemetry.push((args) => {
|
|
107
|
+
Object.assign(this.telemetryProperties, {
|
|
108
|
+
sourceUrl: typeof args.options.sourceUrl !== 'undefined',
|
|
109
|
+
sourceId: typeof args.options.sourceId !== 'undefined',
|
|
110
|
+
newName: typeof args.options.newName !== 'undefined',
|
|
111
|
+
nameConflictBehavior: typeof args.options.nameConflictBehavior !== 'undefined',
|
|
112
|
+
skipWait: !!args.options.skipWait
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
}, _SpoFolderMoveCommand_initOptions = function _SpoFolderMoveCommand_initOptions() {
|
|
116
|
+
this.options.unshift({
|
|
117
|
+
option: '-u, --webUrl <webUrl>'
|
|
118
|
+
}, {
|
|
119
|
+
option: '-s, --sourceUrl [sourceUrl]'
|
|
120
|
+
}, {
|
|
121
|
+
option: '-i, --sourceId [sourceId]'
|
|
122
|
+
}, {
|
|
123
|
+
option: '-t, --targetUrl <targetUrl>'
|
|
124
|
+
}, {
|
|
125
|
+
option: '--newName [newName]'
|
|
126
|
+
}, {
|
|
127
|
+
option: '--nameConflictBehavior [nameConflictBehavior]',
|
|
128
|
+
autocomplete: this.nameConflictBehaviorOptions
|
|
129
|
+
}, {
|
|
130
|
+
option: '--skipWait'
|
|
131
|
+
});
|
|
132
|
+
}, _SpoFolderMoveCommand_initValidators = function _SpoFolderMoveCommand_initValidators() {
|
|
133
|
+
this.validators.push(async (args) => {
|
|
134
|
+
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
135
|
+
if (isValidSharePointUrl !== true) {
|
|
136
|
+
return isValidSharePointUrl;
|
|
137
|
+
}
|
|
138
|
+
if (args.options.sourceId && !validation.isValidGuid(args.options.sourceId)) {
|
|
139
|
+
return `'${args.options.sourceId}' is not a valid GUID for sourceId.`;
|
|
140
|
+
}
|
|
141
|
+
if (args.options.nameConflictBehavior && this.nameConflictBehaviorOptions.indexOf(args.options.nameConflictBehavior) === -1) {
|
|
142
|
+
return `'${args.options.nameConflictBehavior}' is not a valid value for nameConflictBehavior. Allowed values are: ${this.nameConflictBehaviorOptions.join(', ')}.`;
|
|
143
|
+
}
|
|
144
|
+
return true;
|
|
145
|
+
});
|
|
146
|
+
}, _SpoFolderMoveCommand_initOptionSets = function _SpoFolderMoveCommand_initOptionSets() {
|
|
147
|
+
this.optionSets.push({ options: ['sourceUrl', 'sourceId'] });
|
|
148
|
+
}, _SpoFolderMoveCommand_initTypes = function _SpoFolderMoveCommand_initTypes() {
|
|
149
|
+
this.types.string.push('webUrl', 'sourceUrl', 'sourceId', 'targetUrl', 'newName', 'nameConflictBehavior');
|
|
150
|
+
this.types.boolean.push('skipWait');
|
|
151
|
+
};
|
|
126
152
|
export default new SpoFolderMoveCommand();
|
|
127
153
|
//# sourceMappingURL=folder-move.js.map
|
|
@@ -1,23 +1,16 @@
|
|
|
1
|
-
|
|
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 _SpoFolderRemoveCommand_instances, _SpoFolderRemoveCommand_initTelemetry, _SpoFolderRemoveCommand_initOptions, _SpoFolderRemoveCommand_initValidators, _SpoFolderRemoveCommand_initTypes;
|
|
2
7
|
import { cli } from '../../../../cli/cli.js';
|
|
3
|
-
import { globalOptionsZod } from '../../../../Command.js';
|
|
4
8
|
import request from '../../../../request.js';
|
|
5
9
|
import { formatting } from '../../../../utils/formatting.js';
|
|
6
10
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
7
11
|
import { validation } from '../../../../utils/validation.js';
|
|
8
12
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
9
13
|
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
|
-
url: z.string(),
|
|
18
|
-
permanent: z.boolean().optional(),
|
|
19
|
-
force: z.boolean().optional().alias('f')
|
|
20
|
-
});
|
|
21
14
|
class SpoFolderRemoveCommand extends SpoCommand {
|
|
22
15
|
get name() {
|
|
23
16
|
return commands.FOLDER_REMOVE;
|
|
@@ -25,8 +18,13 @@ class SpoFolderRemoveCommand extends SpoCommand {
|
|
|
25
18
|
get description() {
|
|
26
19
|
return 'Deletes the specified folder';
|
|
27
20
|
}
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
constructor() {
|
|
22
|
+
super();
|
|
23
|
+
_SpoFolderRemoveCommand_instances.add(this);
|
|
24
|
+
__classPrivateFieldGet(this, _SpoFolderRemoveCommand_instances, "m", _SpoFolderRemoveCommand_initTelemetry).call(this);
|
|
25
|
+
__classPrivateFieldGet(this, _SpoFolderRemoveCommand_instances, "m", _SpoFolderRemoveCommand_initOptions).call(this);
|
|
26
|
+
__classPrivateFieldGet(this, _SpoFolderRemoveCommand_instances, "m", _SpoFolderRemoveCommand_initValidators).call(this);
|
|
27
|
+
__classPrivateFieldGet(this, _SpoFolderRemoveCommand_instances, "m", _SpoFolderRemoveCommand_initTypes).call(this);
|
|
30
28
|
}
|
|
31
29
|
getExcludedOptionsWithUrls() {
|
|
32
30
|
return ['url'];
|
|
@@ -69,5 +67,28 @@ class SpoFolderRemoveCommand extends SpoCommand {
|
|
|
69
67
|
}
|
|
70
68
|
}
|
|
71
69
|
}
|
|
70
|
+
_SpoFolderRemoveCommand_instances = new WeakSet(), _SpoFolderRemoveCommand_initTelemetry = function _SpoFolderRemoveCommand_initTelemetry() {
|
|
71
|
+
this.telemetry.push((args) => {
|
|
72
|
+
Object.assign(this.telemetryProperties, {
|
|
73
|
+
permanent: !!args.options.permanent,
|
|
74
|
+
force: !!args.options.force
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
}, _SpoFolderRemoveCommand_initOptions = function _SpoFolderRemoveCommand_initOptions() {
|
|
78
|
+
this.options.unshift({
|
|
79
|
+
option: '-u, --webUrl <webUrl>'
|
|
80
|
+
}, {
|
|
81
|
+
option: '--url <url>'
|
|
82
|
+
}, {
|
|
83
|
+
option: '--permanent'
|
|
84
|
+
}, {
|
|
85
|
+
option: '-f, --force'
|
|
86
|
+
});
|
|
87
|
+
}, _SpoFolderRemoveCommand_initValidators = function _SpoFolderRemoveCommand_initValidators() {
|
|
88
|
+
this.validators.push(async (args) => validation.isValidSharePointUrl(args.options.webUrl));
|
|
89
|
+
}, _SpoFolderRemoveCommand_initTypes = function _SpoFolderRemoveCommand_initTypes() {
|
|
90
|
+
this.types.string.push('webUrl', 'url');
|
|
91
|
+
this.types.boolean.push('permanent', 'force');
|
|
92
|
+
};
|
|
72
93
|
export default new SpoFolderRemoveCommand();
|
|
73
94
|
//# sourceMappingURL=folder-remove.js.map
|