@pnp/cli-microsoft365 11.0.0-beta.3d99ea3 → 11.0.0-beta.88d51e6
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/.devproxy/api-specs/sharepoint.yaml +54 -0
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/m365/flow/commands/environment/environment-get.js +19 -29
- package/dist/m365/pa/commands/environment/environment-get.js +18 -23
- package/dist/m365/pp/commands/environment/environment-get.js +19 -26
- package/dist/m365/spo/commands/file/file-version-keep.js +78 -0
- package/dist/m365/spo/commands/list/list-view-add.js +1 -1
- package/dist/m365/spo/commands.js +1 -0
- package/docs/docs/cmd/flow/environment/environment-get.mdx +6 -5
- package/docs/docs/cmd/pa/environment/environment-get.mdx +5 -2
- package/docs/docs/cmd/pp/environment/environment-get.mdx +5 -2
- package/docs/docs/cmd/spo/file/file-version-keep.mdx +68 -0
- package/docs/docs/cmd/spo/list/list-view-add.mdx +11 -11
- package/package.json +1 -1
|
@@ -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 _FlowEnvironmentGetCommand_instances, _FlowEnvironmentGetCommand_initOptions, _FlowEnvironmentGetCommand_initTelemetry;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { formatting } from '../../../../utils/formatting.js';
|
|
5
|
+
import { zod } from '../../../../utils/zod.js';
|
|
9
6
|
import PowerAutomateCommand from '../../../base/PowerAutomateCommand.js';
|
|
10
7
|
import commands from '../../commands.js';
|
|
8
|
+
const options = globalOptionsZod
|
|
9
|
+
.extend({
|
|
10
|
+
name: zod.alias('n', z.string().optional()),
|
|
11
|
+
default: z.boolean().optional()
|
|
12
|
+
})
|
|
13
|
+
.strict();
|
|
11
14
|
class FlowEnvironmentGetCommand extends PowerAutomateCommand {
|
|
12
15
|
get name() {
|
|
13
16
|
return commands.ENVIRONMENT_GET;
|
|
@@ -15,23 +18,21 @@ class FlowEnvironmentGetCommand extends PowerAutomateCommand {
|
|
|
15
18
|
get description() {
|
|
16
19
|
return 'Gets information about the specified Microsoft Flow environment';
|
|
17
20
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
get schema() {
|
|
22
|
+
return options;
|
|
23
|
+
}
|
|
24
|
+
getRefinedSchema(schema) {
|
|
25
|
+
return schema
|
|
26
|
+
.refine(options => !!options.name !== !!options.default, {
|
|
27
|
+
message: `Specify either name or default, but not both.`
|
|
28
|
+
});
|
|
23
29
|
}
|
|
24
30
|
async commandAction(logger, args) {
|
|
25
31
|
if (this.verbose) {
|
|
26
|
-
await logger.logToStderr(`Retrieving information about Microsoft Flow environment ${args.options.name ?? ''}...`);
|
|
32
|
+
await logger.logToStderr(`Retrieving information about Microsoft Flow environment ${args.options.name ?? 'default'}...`);
|
|
27
33
|
}
|
|
28
34
|
let requestUrl = `${PowerAutomateCommand.resource}/providers/Microsoft.ProcessSimple/environments/`;
|
|
29
|
-
|
|
30
|
-
requestUrl += `${formatting.encodeQueryParameter(args.options.name)}`;
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
requestUrl += `~default`;
|
|
34
|
-
}
|
|
35
|
+
requestUrl += args.options.default ? '~default' : formatting.encodeQueryParameter(args.options.name);
|
|
35
36
|
const requestOptions = {
|
|
36
37
|
url: `${requestUrl}?api-version=2016-11-01`,
|
|
37
38
|
headers: {
|
|
@@ -55,16 +56,5 @@ class FlowEnvironmentGetCommand extends PowerAutomateCommand {
|
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
|
-
_FlowEnvironmentGetCommand_instances = new WeakSet(), _FlowEnvironmentGetCommand_initOptions = function _FlowEnvironmentGetCommand_initOptions() {
|
|
59
|
-
this.options.unshift({
|
|
60
|
-
option: '-n, --name [name]'
|
|
61
|
-
});
|
|
62
|
-
}, _FlowEnvironmentGetCommand_initTelemetry = function _FlowEnvironmentGetCommand_initTelemetry() {
|
|
63
|
-
this.telemetry.push((args) => {
|
|
64
|
-
Object.assign(this.telemetryProperties, {
|
|
65
|
-
name: typeof args.options.name !== 'undefined'
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
59
|
export default new FlowEnvironmentGetCommand();
|
|
70
60
|
//# sourceMappingURL=environment-get.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 _PaEnvironmentGetCommand_instances, _PaEnvironmentGetCommand_initTelemetry, _PaEnvironmentGetCommand_initOptions;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { formatting } from '../../../../utils/formatting.js';
|
|
5
|
+
import { zod } from '../../../../utils/zod.js';
|
|
9
6
|
import PowerAppsCommand from '../../../base/PowerAppsCommand.js';
|
|
10
7
|
import commands from '../../commands.js';
|
|
8
|
+
const options = globalOptionsZod
|
|
9
|
+
.extend({
|
|
10
|
+
name: zod.alias('n', z.string().optional()),
|
|
11
|
+
default: z.boolean().optional()
|
|
12
|
+
})
|
|
13
|
+
.strict();
|
|
11
14
|
class PaEnvironmentGetCommand extends PowerAppsCommand {
|
|
12
15
|
get name() {
|
|
13
16
|
return commands.ENVIRONMENT_GET;
|
|
@@ -15,17 +18,20 @@ class PaEnvironmentGetCommand extends PowerAppsCommand {
|
|
|
15
18
|
get description() {
|
|
16
19
|
return 'Gets information about the specified Microsoft Power Apps environment';
|
|
17
20
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
get schema() {
|
|
22
|
+
return options;
|
|
23
|
+
}
|
|
24
|
+
getRefinedSchema(schema) {
|
|
25
|
+
return schema
|
|
26
|
+
.refine(options => !!options.name !== !!options.default, {
|
|
27
|
+
message: `Specify either name or default, but not both.`
|
|
28
|
+
});
|
|
23
29
|
}
|
|
24
30
|
async commandAction(logger, args) {
|
|
25
31
|
if (this.verbose) {
|
|
26
32
|
await logger.logToStderr(`Retrieving information about Microsoft Power Apps environment ${args.options.name || 'default'}...`);
|
|
27
33
|
}
|
|
28
|
-
const environmentName = args.options.
|
|
34
|
+
const environmentName = args.options.default ? '~default' : formatting.encodeQueryParameter(args.options.name);
|
|
29
35
|
const requestOptions = {
|
|
30
36
|
url: `${this.resource}/providers/Microsoft.PowerApps/environments/${environmentName}?api-version=2016-11-01`,
|
|
31
37
|
headers: {
|
|
@@ -47,16 +53,5 @@ class PaEnvironmentGetCommand extends PowerAppsCommand {
|
|
|
47
53
|
}
|
|
48
54
|
}
|
|
49
55
|
}
|
|
50
|
-
_PaEnvironmentGetCommand_instances = new WeakSet(), _PaEnvironmentGetCommand_initTelemetry = function _PaEnvironmentGetCommand_initTelemetry() {
|
|
51
|
-
this.telemetry.push((args) => {
|
|
52
|
-
Object.assign(this.telemetryProperties, {
|
|
53
|
-
name: typeof args.options.name !== 'undefined'
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
}, _PaEnvironmentGetCommand_initOptions = function _PaEnvironmentGetCommand_initOptions() {
|
|
57
|
-
this.options.unshift({
|
|
58
|
-
option: '-n, --name [name]'
|
|
59
|
-
});
|
|
60
|
-
};
|
|
61
56
|
export default new PaEnvironmentGetCommand();
|
|
62
57
|
//# sourceMappingURL=environment-get.js.map
|
|
@@ -1,13 +1,17 @@
|
|
|
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 _PpEnvironmentGetCommand_instances, _PpEnvironmentGetCommand_initTelemetry, _PpEnvironmentGetCommand_initOptions;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { formatting } from '../../../../utils/formatting.js';
|
|
5
|
+
import { zod } from '../../../../utils/zod.js';
|
|
9
6
|
import PowerPlatformCommand from '../../../base/PowerPlatformCommand.js';
|
|
10
7
|
import commands from '../../commands.js';
|
|
8
|
+
const options = globalOptionsZod
|
|
9
|
+
.extend({
|
|
10
|
+
name: zod.alias('n', z.string().optional()),
|
|
11
|
+
default: z.boolean().optional(),
|
|
12
|
+
asAdmin: z.boolean().optional()
|
|
13
|
+
})
|
|
14
|
+
.strict();
|
|
11
15
|
class PpEnvironmentGetCommand extends PowerPlatformCommand {
|
|
12
16
|
get name() {
|
|
13
17
|
return commands.ENVIRONMENT_GET;
|
|
@@ -15,11 +19,14 @@ class PpEnvironmentGetCommand extends PowerPlatformCommand {
|
|
|
15
19
|
get description() {
|
|
16
20
|
return 'Gets information about the specified Power Platform environment';
|
|
17
21
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
get schema() {
|
|
23
|
+
return options;
|
|
24
|
+
}
|
|
25
|
+
getRefinedSchema(schema) {
|
|
26
|
+
return schema
|
|
27
|
+
.refine(options => !!options.name !== !!options.default, {
|
|
28
|
+
message: `Specify either name or default, but not both.`
|
|
29
|
+
});
|
|
23
30
|
}
|
|
24
31
|
async commandAction(logger, args) {
|
|
25
32
|
if (this.verbose) {
|
|
@@ -29,7 +36,7 @@ class PpEnvironmentGetCommand extends PowerPlatformCommand {
|
|
|
29
36
|
if (args.options.asAdmin) {
|
|
30
37
|
url += '/scopes/admin';
|
|
31
38
|
}
|
|
32
|
-
const envName = args.options.
|
|
39
|
+
const envName = args.options.default ? '~Default' : formatting.encodeQueryParameter(args.options.name);
|
|
33
40
|
url += `/environments/${envName}?api-version=2020-10-01`;
|
|
34
41
|
const requestOptions = {
|
|
35
42
|
url: url,
|
|
@@ -42,19 +49,5 @@ class PpEnvironmentGetCommand extends PowerPlatformCommand {
|
|
|
42
49
|
await logger.log(response);
|
|
43
50
|
}
|
|
44
51
|
}
|
|
45
|
-
_PpEnvironmentGetCommand_instances = new WeakSet(), _PpEnvironmentGetCommand_initTelemetry = function _PpEnvironmentGetCommand_initTelemetry() {
|
|
46
|
-
this.telemetry.push((args) => {
|
|
47
|
-
Object.assign(this.telemetryProperties, {
|
|
48
|
-
name: typeof args.options.name !== 'undefined',
|
|
49
|
-
asAdmin: !!args.options.asAdmin
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
}, _PpEnvironmentGetCommand_initOptions = function _PpEnvironmentGetCommand_initOptions() {
|
|
53
|
-
this.options.unshift({
|
|
54
|
-
option: '-n, --name [name]'
|
|
55
|
-
}, {
|
|
56
|
-
option: '--asAdmin'
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
52
|
export default new PpEnvironmentGetCommand();
|
|
60
53
|
//# sourceMappingURL=environment-get.js.map
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import commands from '../../commands.js';
|
|
2
|
+
import SpoCommand from '../../../base/SpoCommand.js';
|
|
3
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { zod } from '../../../../utils/zod.js';
|
|
6
|
+
import { validation } from '../../../../utils/validation.js';
|
|
7
|
+
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
8
|
+
import request from '../../../../request.js';
|
|
9
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
10
|
+
import { odata } from '../../../../utils/odata.js';
|
|
11
|
+
export const options = globalOptionsZod
|
|
12
|
+
.extend({
|
|
13
|
+
webUrl: zod.alias('u', z.string()
|
|
14
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, url => ({
|
|
15
|
+
message: `'${url}' is not a valid SharePoint Online site URL.`
|
|
16
|
+
}))),
|
|
17
|
+
fileUrl: z.string().optional(),
|
|
18
|
+
fileId: zod.alias('i', z.string()
|
|
19
|
+
.refine(id => validation.isValidGuid(id), id => ({
|
|
20
|
+
message: `'${id}' is not a valid GUID.`
|
|
21
|
+
})).optional()),
|
|
22
|
+
label: z.string()
|
|
23
|
+
})
|
|
24
|
+
.strict();
|
|
25
|
+
class SpoFileVersionKeepCommand extends SpoCommand {
|
|
26
|
+
get name() {
|
|
27
|
+
return commands.FILE_VERSION_KEEP;
|
|
28
|
+
}
|
|
29
|
+
get description() {
|
|
30
|
+
return 'Ensure that a specific file version will never expire';
|
|
31
|
+
}
|
|
32
|
+
get schema() {
|
|
33
|
+
return options;
|
|
34
|
+
}
|
|
35
|
+
getRefinedSchema(schema) {
|
|
36
|
+
return schema
|
|
37
|
+
.refine(options => [options.fileUrl, options.fileId].filter(o => o !== undefined).length === 1, {
|
|
38
|
+
message: `Specify 'fileUrl' or 'fileId', but not both.`
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
async commandAction(logger, args) {
|
|
42
|
+
if (this.verbose) {
|
|
43
|
+
await logger.logToStderr(`Ensuring version '${args.options.label}' of file '${args.options.fileUrl || args.options.fileId}' at site '${args.options.webUrl}' will never expire...`);
|
|
44
|
+
}
|
|
45
|
+
try {
|
|
46
|
+
const baseApiUrl = this.getBaseApiUrl(args.options.webUrl, args.options.fileUrl, args.options.fileId);
|
|
47
|
+
const response = await odata.getAllItems(`${baseApiUrl}/versions?$filter=VersionLabel eq '${formatting.encodeQueryParameter(args.options.label)}'&$select=ID`);
|
|
48
|
+
if (response.length === 0) {
|
|
49
|
+
throw `Version with label '${args.options.label}' not found.`;
|
|
50
|
+
}
|
|
51
|
+
const requestExpirationOptions = {
|
|
52
|
+
url: `${baseApiUrl}/versions(${response[0].ID})/SetExpirationDate()`,
|
|
53
|
+
headers: {
|
|
54
|
+
accept: 'application/json;odata=nometadata',
|
|
55
|
+
'content-type': 'application/json'
|
|
56
|
+
},
|
|
57
|
+
responseType: 'json'
|
|
58
|
+
};
|
|
59
|
+
await request.post(requestExpirationOptions);
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
this.handleRejectedODataJsonPromise(err);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
getBaseApiUrl(webUrl, fileUrl, fileId) {
|
|
66
|
+
let requestUrl;
|
|
67
|
+
if (fileUrl) {
|
|
68
|
+
const serverRelUrl = urlUtil.getServerRelativePath(webUrl, fileUrl);
|
|
69
|
+
requestUrl = `${webUrl}/_api/web/GetFileByServerRelativePath(DecodedUrl='${formatting.encodeQueryParameter(serverRelUrl)}')`;
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
requestUrl = `${webUrl}/_api/web/GetFileById('${fileId}')`;
|
|
73
|
+
}
|
|
74
|
+
return requestUrl;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
export default new SpoFileVersionKeepCommand();
|
|
78
|
+
//# sourceMappingURL=file-version-keep.js.map
|
|
@@ -114,7 +114,7 @@ class SpoListViewAddCommand extends SpoCommand {
|
|
|
114
114
|
Query: args.options.viewQuery,
|
|
115
115
|
PersonalView: !!args.options.personal,
|
|
116
116
|
SetAsDefaultView: !!args.options.default,
|
|
117
|
-
Paged:
|
|
117
|
+
Paged: args.options.paged ?? true,
|
|
118
118
|
RowLimit: args.options.rowLimit ?? 30,
|
|
119
119
|
CustomFormatter: args.options.customFormatter
|
|
120
120
|
}
|
|
@@ -83,6 +83,7 @@ export default {
|
|
|
83
83
|
FILE_SHARINGLINK_SET: `${prefix} file sharinglink set`,
|
|
84
84
|
FILE_VERSION_CLEAR: `${prefix} file version clear`,
|
|
85
85
|
FILE_VERSION_GET: `${prefix} file version get`,
|
|
86
|
+
FILE_VERSION_KEEP: `${prefix} file version keep`,
|
|
86
87
|
FILE_VERSION_LIST: `${prefix} file version list`,
|
|
87
88
|
FILE_VERSION_REMOVE: `${prefix} file version remove`,
|
|
88
89
|
FILE_VERSION_RESTORE: `${prefix} file version restore`,
|
|
@@ -16,7 +16,10 @@ m365 flow environment get [options]
|
|
|
16
16
|
|
|
17
17
|
```md definition-list
|
|
18
18
|
`-n, --name [name]`
|
|
19
|
-
: The name of the environment to get information about. When not specified, the default environment is retrieved.
|
|
19
|
+
: The name of the environment to get information about. When not specified, the default environment is retrieved. Specify either `name` or `default`, but not both.
|
|
20
|
+
|
|
21
|
+
`--default`
|
|
22
|
+
: Indicates that the default environment should be retrieved. Specify either `name` or `default`, but not both.
|
|
20
23
|
```
|
|
21
24
|
|
|
22
25
|
<Global />
|
|
@@ -42,13 +45,11 @@ m365 flow environment get --name Default-d87a7535-dd31-4437-bfe1-95340acd55c5
|
|
|
42
45
|
Get information about the default Microsoft Flow environment.
|
|
43
46
|
|
|
44
47
|
```sh
|
|
45
|
-
m365 flow environment get
|
|
48
|
+
m365 flow environment get --default
|
|
46
49
|
```
|
|
47
50
|
|
|
48
51
|
## Response
|
|
49
52
|
|
|
50
|
-
### Standard response
|
|
51
|
-
|
|
52
53
|
<Tabs>
|
|
53
54
|
<TabItem value="JSON">
|
|
54
55
|
|
|
@@ -153,7 +154,7 @@ m365 flow environment get
|
|
|
153
154
|
<TabItem value="Markdown">
|
|
154
155
|
|
|
155
156
|
```md
|
|
156
|
-
# flow environment get
|
|
157
|
+
# flow environment get --default
|
|
157
158
|
|
|
158
159
|
Date: 8/2/2023
|
|
159
160
|
|
|
@@ -16,7 +16,10 @@ m365 pa environment get [options]
|
|
|
16
16
|
|
|
17
17
|
```md definition-list
|
|
18
18
|
`-n, --name [name]`
|
|
19
|
-
: The name of the environment. When not specified, the default environment is retrieved.
|
|
19
|
+
: The name of the environment. When not specified, the default environment is retrieved. Specify either `name` or `default`, but not both.
|
|
20
|
+
|
|
21
|
+
`--default`
|
|
22
|
+
: Indicates that the default environment should be retrieved. Specify either `name` or `default`, but not both.
|
|
20
23
|
```
|
|
21
24
|
|
|
22
25
|
<Global />
|
|
@@ -36,7 +39,7 @@ If the environment with the name you specified doesn't exist, you will get the `
|
|
|
36
39
|
Get information about the default Power Apps environment.
|
|
37
40
|
|
|
38
41
|
```sh
|
|
39
|
-
m365 pa environment get
|
|
42
|
+
m365 pa environment get --default
|
|
40
43
|
```
|
|
41
44
|
|
|
42
45
|
Get information about the Power Apps environment with the specified name.
|
|
@@ -16,7 +16,10 @@ m365 pp environment get [options]
|
|
|
16
16
|
|
|
17
17
|
```md definition-list
|
|
18
18
|
`-n, --name [name]`
|
|
19
|
-
: The name of the environment. When not specified, the default environment is retrieved.
|
|
19
|
+
: The name of the environment. When not specified, the default environment is retrieved. Specify either `name` or `default`, but not both.
|
|
20
|
+
|
|
21
|
+
`--default`
|
|
22
|
+
: Indicates that the default environment should be retrieved. Specify either `name` or `default`, but not both.
|
|
20
23
|
|
|
21
24
|
`--asAdmin`
|
|
22
25
|
: Run the command as admin and retrieve details of environments you do not have explicitly assigned permissions to.
|
|
@@ -53,7 +56,7 @@ m365 pp environment get --name Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --as
|
|
|
53
56
|
Get information about the default Power Platform environment.
|
|
54
57
|
|
|
55
58
|
```sh
|
|
56
|
-
m365 pp environment get
|
|
59
|
+
m365 pp environment get --default
|
|
57
60
|
```
|
|
58
61
|
|
|
59
62
|
## Response
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import Global from '/docs/cmd/_global.mdx';
|
|
2
|
+
import Tabs from '@theme/Tabs';
|
|
3
|
+
import TabItem from '@theme/TabItem';
|
|
4
|
+
|
|
5
|
+
# spo file version keep
|
|
6
|
+
|
|
7
|
+
Ensure that a specific file version will never expire
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
m365 spo file version keep [options]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Options
|
|
16
|
+
|
|
17
|
+
```md definition-list
|
|
18
|
+
`-u, --webUrl <webUrl>`
|
|
19
|
+
: The URL of the site where the file is located.
|
|
20
|
+
|
|
21
|
+
`--fileUrl [fileUrl]`
|
|
22
|
+
: The server- or site-relative decoded URL. Specify either `fileUrl` or `fileId` but not both.
|
|
23
|
+
|
|
24
|
+
`-i, --fileId [fileId]`
|
|
25
|
+
: The UniqueId (GUID) of the file. Specify either `fileUrl` or `fileId` but not both.
|
|
26
|
+
|
|
27
|
+
`--label <label>`
|
|
28
|
+
: Label of the version.
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
<Global />
|
|
32
|
+
|
|
33
|
+
## Permissions
|
|
34
|
+
|
|
35
|
+
<Tabs>
|
|
36
|
+
<TabItem value="Delegated">
|
|
37
|
+
|
|
38
|
+
| Resource | Permissions |
|
|
39
|
+
|------------|----------------|
|
|
40
|
+
| SharePoint | AllSites.Write |
|
|
41
|
+
|
|
42
|
+
</TabItem>
|
|
43
|
+
<TabItem value="Application">
|
|
44
|
+
|
|
45
|
+
| Resource | Permissions |
|
|
46
|
+
|------------|---------------------|
|
|
47
|
+
| SharePoint | Sites.ReadWrite.All |
|
|
48
|
+
|
|
49
|
+
</TabItem>
|
|
50
|
+
</Tabs>
|
|
51
|
+
|
|
52
|
+
## Examples
|
|
53
|
+
|
|
54
|
+
Mark a file version as never expiring by file URL.
|
|
55
|
+
|
|
56
|
+
```sh
|
|
57
|
+
m365 spo file version keep --webUrl "https://contoso.sharepoint.com/sites/marketing" --fileUrl "/sites/marketing/Documents/report.docx" --label "6.0"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Mark a file version as never expiring by file ID.
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
m365 spo file version keep --webUrl "https://contoso.sharepoint.com/sites/marketing" --fileId "12345678-90ab-cdef-1234-567890abcdef" --label "6.0"
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Response
|
|
67
|
+
|
|
68
|
+
The command won't return a response on success.
|
|
@@ -63,8 +63,8 @@ m365 spo list view add [options]
|
|
|
63
63
|
`--default`
|
|
64
64
|
: View will be set as default view, if specified.
|
|
65
65
|
|
|
66
|
-
`--paged`
|
|
67
|
-
: View supports paging
|
|
66
|
+
`--paged [paged]`
|
|
67
|
+
: View supports paging. Valid values are `true`, `false`. Defaults to `true`.
|
|
68
68
|
|
|
69
69
|
`--rowLimit [rowLimit]`
|
|
70
70
|
: Sets the number of items to display for the view. Default value is 30.
|
|
@@ -76,7 +76,7 @@ m365 spo list view add [options]
|
|
|
76
76
|
|
|
77
77
|
:::tip
|
|
78
78
|
|
|
79
|
-
We recommend using the `paged` option.
|
|
79
|
+
We recommend using the `paged` option. Paging is enabled by default: the view shows items page by page, up to the specified `rowLimit` per page. To disable paging, set `paged` to `false`; in a non-paged view, the `rowLimit` is absolute and there is no link to see more items.
|
|
80
80
|
|
|
81
81
|
:::
|
|
82
82
|
|
|
@@ -85,43 +85,43 @@ We recommend using the `paged` option. When specified, the view supports display
|
|
|
85
85
|
Add a list view called to a list with specific title.
|
|
86
86
|
|
|
87
87
|
```sh
|
|
88
|
-
m365 spo list view add --webUrl https://contoso.sharepoint.com/sites/Sales --listTitle "Customers" --title "All customers" --fields "LinkTitle,Country,Sector,Country,Address,Contact"
|
|
88
|
+
m365 spo list view add --webUrl https://contoso.sharepoint.com/sites/Sales --listTitle "Customers" --title "All customers" --fields "LinkTitle,Country,Sector,Country,Address,Contact"
|
|
89
89
|
```
|
|
90
90
|
|
|
91
91
|
Add a gallery view as default view to a list with a specific URL.
|
|
92
92
|
|
|
93
93
|
```sh
|
|
94
|
-
m365 spo list view add --webUrl https://contoso.sharepoint.com/sites/Sales --listUrl "/Lists/Customers" --title "All customers" --type gallery --fields "LinkTitle,Country,Sector,Country,Address,Contact" --
|
|
94
|
+
m365 spo list view add --webUrl https://contoso.sharepoint.com/sites/Sales --listUrl "/Lists/Customers" --title "All customers" --type gallery --fields "LinkTitle,Country,Sector,Country,Address,Contact" --default
|
|
95
95
|
```
|
|
96
96
|
|
|
97
97
|
Add a view with defined filter and sorting.
|
|
98
98
|
|
|
99
99
|
```sh
|
|
100
|
-
m365 spo list view add --webUrl https://contoso.sharepoint.com/sites/Sales --listTitle "Customers" --title "Transport customers" --fields "LinkTitle,Country,Country,Address,Contact" --viewQuery "<OrderBy><FieldRef Name='LinkTitle' Ascending='TRUE' /></OrderBy><Where><Eq><FieldRef Name='Sector' /><Value Type='Text'>Transportation</Value></Eq></Where>"
|
|
100
|
+
m365 spo list view add --webUrl https://contoso.sharepoint.com/sites/Sales --listTitle "Customers" --title "Transport customers" --fields "LinkTitle,Country,Country,Address,Contact" --viewQuery "<OrderBy><FieldRef Name='LinkTitle' Ascending='TRUE' /></OrderBy><Where><Eq><FieldRef Name='Sector' /><Value Type='Text'>Transportation</Value></Eq></Where>"
|
|
101
101
|
```
|
|
102
102
|
|
|
103
103
|
Add a gallery view as personal view.
|
|
104
104
|
|
|
105
105
|
```sh
|
|
106
|
-
m365 spo list view add --webUrl https://contoso.sharepoint.com/sites/Sales --listTitle "Customers" --title "All customers" --type gallery --fields "LinkTitle,Country,Sector,Country,Address,Contact" --
|
|
106
|
+
m365 spo list view add --webUrl https://contoso.sharepoint.com/sites/Sales --listTitle "Customers" --title "All customers" --type gallery --fields "LinkTitle,Country,Sector,Country,Address,Contact" --personal
|
|
107
107
|
```
|
|
108
108
|
|
|
109
109
|
Add a calendar view with month layout.
|
|
110
110
|
|
|
111
111
|
```sh
|
|
112
|
-
m365 spo list view add --webUrl https://contoso.sharepoint.com/sites/Sales --listTitle "Events" --title "All events" --type calendar --fields "EventType,InternalExternal" --calendarStartDateField EventStartDate --calendarEndDateField EventEndDate --calendarTitleField LinkTitle
|
|
112
|
+
m365 spo list view add --webUrl https://contoso.sharepoint.com/sites/Sales --listTitle "Events" --title "All events" --type calendar --fields "EventType,InternalExternal" --calendarStartDateField EventStartDate --calendarEndDateField EventEndDate --calendarTitleField LinkTitle
|
|
113
113
|
```
|
|
114
114
|
|
|
115
115
|
Add a calendar view with week layout and subtitle.
|
|
116
116
|
|
|
117
117
|
```sh
|
|
118
|
-
m365 spo list view add --webUrl https://contoso.sharepoint.com/sites/Sales --listTitle "Events" --title "All events" --type calendar --fields "EventType,InternalExternal" --calendarStartDateField EventStartDate --calendarEndDateField EventEndDate --calendarTitleField LinkTitle --calendarSubTitleField Location --calendarDefaultLayout week
|
|
118
|
+
m365 spo list view add --webUrl https://contoso.sharepoint.com/sites/Sales --listTitle "Events" --title "All events" --type calendar --fields "EventType,InternalExternal" --calendarStartDateField EventStartDate --calendarEndDateField EventEndDate --calendarTitleField LinkTitle --calendarSubTitleField Location --calendarDefaultLayout week
|
|
119
119
|
```
|
|
120
120
|
|
|
121
121
|
Add a Kanban board view.
|
|
122
122
|
|
|
123
123
|
```sh
|
|
124
|
-
m365 spo list view add --webUrl https://contoso.sharepoint.com/sites/Sales --listTitle "Tasks" --title "All tasks" --type kanban --fields "Title,AssignedTo" --kanbanBucketField Status
|
|
124
|
+
m365 spo list view add --webUrl https://contoso.sharepoint.com/sites/Sales --listTitle "Tasks" --title "All tasks" --type kanban --fields "Title,AssignedTo" --kanbanBucketField Status
|
|
125
125
|
```
|
|
126
126
|
|
|
127
127
|
## Response
|
|
@@ -252,7 +252,7 @@ m365 spo list view add --webUrl https://contoso.sharepoint.com/sites/Sales --lis
|
|
|
252
252
|
<TabItem value="Markdown">
|
|
253
253
|
|
|
254
254
|
```md
|
|
255
|
-
# spo list view add --webUrl "https://contoso.sharepoint.com" --listTitle "Test" --title "All events" --fields "FieldName1" --viewQuery "<OrderBy><FieldRef Name='Created' Ascending='FALSE' /></OrderBy><Where><Eq><FieldRef Name='TextFieldName' /><Value Type='Text'>Field value</Value></Eq></Where>"
|
|
255
|
+
# spo list view add --webUrl "https://contoso.sharepoint.com" --listTitle "Test" --title "All events" --fields "FieldName1" --viewQuery "<OrderBy><FieldRef Name='Created' Ascending='FALSE' /></OrderBy><Where><Eq><FieldRef Name='TextFieldName' /><Value Type='Text'>Field value</Value></Eq></Where>"
|
|
256
256
|
|
|
257
257
|
Date: 2/20/2023
|
|
258
258
|
|
package/package.json
CHANGED