@pnp/cli-microsoft365 11.0.0-beta.4be9237 → 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/.eslintrc.cjs +2 -0
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/m365/entra/commands/app/app-add.js +14 -2
- package/dist/m365/flow/commands/environment/environment-get.js +19 -29
- package/dist/m365/outlook/commands/mail/mail-searchfolder-add.js +85 -0
- package/dist/m365/outlook/commands.js +1 -0
- 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/dist/utils/entraApp.js +15 -0
- package/docs/docs/cmd/entra/app/app-add.mdx +7 -1
- package/docs/docs/cmd/flow/environment/environment-get.mdx +6 -5
- package/docs/docs/cmd/outlook/mail/mail-searchfolder-add.mdx +147 -0
- 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
|
@@ -425,7 +425,9 @@ _a = EntraAppAddCommand, _EntraAppAddCommand_instances = new WeakSet(), _EntraAp
|
|
|
425
425
|
certificateBase64Encoded: typeof args.options.certificateBase64Encoded !== 'undefined',
|
|
426
426
|
certificateDisplayName: typeof args.options.certificateDisplayName !== 'undefined',
|
|
427
427
|
grantAdminConsent: typeof args.options.grantAdminConsent !== 'undefined',
|
|
428
|
-
allowPublicClientFlows: typeof args.options.allowPublicClientFlows !== 'undefined'
|
|
428
|
+
allowPublicClientFlows: typeof args.options.allowPublicClientFlows !== 'undefined',
|
|
429
|
+
bundleId: typeof args.options.bundleId !== 'undefined',
|
|
430
|
+
signatureHash: typeof args.options.signatureHash !== 'undefined'
|
|
429
431
|
});
|
|
430
432
|
});
|
|
431
433
|
}, _EntraAppAddCommand_initOptions = function _EntraAppAddCommand_initOptions() {
|
|
@@ -465,6 +467,10 @@ _a = EntraAppAddCommand, _EntraAppAddCommand_instances = new WeakSet(), _EntraAp
|
|
|
465
467
|
option: '--certificateDisplayName [certificateDisplayName]'
|
|
466
468
|
}, {
|
|
467
469
|
option: '--manifest [manifest]'
|
|
470
|
+
}, {
|
|
471
|
+
option: '--bundleId [bundleId]'
|
|
472
|
+
}, {
|
|
473
|
+
option: '--signatureHash [signatureHash]'
|
|
468
474
|
}, {
|
|
469
475
|
option: '--save'
|
|
470
476
|
}, {
|
|
@@ -519,12 +525,18 @@ _a = EntraAppAddCommand, _EntraAppAddCommand_instances = new WeakSet(), _EntraAp
|
|
|
519
525
|
return `Error while parsing the specified manifest: ${e}`;
|
|
520
526
|
}
|
|
521
527
|
}
|
|
528
|
+
if (args.options.platform === 'apple' && !args.options.bundleId) {
|
|
529
|
+
return `When you use platform apple, you'll need to specify bundleId`;
|
|
530
|
+
}
|
|
531
|
+
if (args.options.platform === 'android' && (!args.options.bundleId || !args.options.signatureHash)) {
|
|
532
|
+
return `When you use platform android, you'll need to specify bundleId and signatureHash`;
|
|
533
|
+
}
|
|
522
534
|
return true;
|
|
523
535
|
});
|
|
524
536
|
}, _EntraAppAddCommand_initOptionSets = function _EntraAppAddCommand_initOptionSets() {
|
|
525
537
|
this.optionSets.push({ options: ['name', 'manifest'] });
|
|
526
538
|
};
|
|
527
|
-
EntraAppAddCommand.entraApplicationPlatform = ['spa', 'web', 'publicClient'];
|
|
539
|
+
EntraAppAddCommand.entraApplicationPlatform = ['spa', 'web', 'publicClient', 'apple', 'android'];
|
|
528
540
|
EntraAppAddCommand.entraAppScopeConsentBy = ['admins', 'adminsAndUsers'];
|
|
529
541
|
export default new EntraAppAddCommand();
|
|
530
542
|
//# sourceMappingURL=app-add.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 _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
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import request from '../../../../request.js';
|
|
2
|
+
import GraphCommand from '../../../base/GraphCommand.js';
|
|
3
|
+
import commands from '../../commands.js';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
6
|
+
import { zod } from '../../../../utils/zod.js';
|
|
7
|
+
import { validation } from '../../../../utils/validation.js';
|
|
8
|
+
import { accessToken } from '../../../../utils/accessToken.js';
|
|
9
|
+
import auth from '../../../../Auth.js';
|
|
10
|
+
const options = globalOptionsZod
|
|
11
|
+
.extend({
|
|
12
|
+
userId: zod.alias('i', z.string()
|
|
13
|
+
.refine(userId => validation.isValidGuid(userId), userId => ({
|
|
14
|
+
message: `'${userId}' is not a valid GUID.`
|
|
15
|
+
})).optional()),
|
|
16
|
+
userName: zod.alias('n', z.string()
|
|
17
|
+
.refine(userName => validation.isValidUserPrincipalName(userName), userName => ({
|
|
18
|
+
message: `'${userName}' is not a valid UPN.`
|
|
19
|
+
})).optional()),
|
|
20
|
+
folderName: z.string(),
|
|
21
|
+
messageFilter: z.string(),
|
|
22
|
+
sourceFoldersIds: z.string().transform((value) => value.split(',')).pipe(z.string().array()),
|
|
23
|
+
includeNestedFolders: z.boolean().optional()
|
|
24
|
+
})
|
|
25
|
+
.strict();
|
|
26
|
+
class OutlookMailSearchFolderAddCommand extends GraphCommand {
|
|
27
|
+
get name() {
|
|
28
|
+
return commands.MAIL_SEARCHFOLDER_ADD;
|
|
29
|
+
}
|
|
30
|
+
get description() {
|
|
31
|
+
return `Creates a new mail search folder in the user's mailbox`;
|
|
32
|
+
}
|
|
33
|
+
get schema() {
|
|
34
|
+
return options;
|
|
35
|
+
}
|
|
36
|
+
getRefinedSchema(schema) {
|
|
37
|
+
return schema
|
|
38
|
+
.refine(options => !(options.userId && options.userName), {
|
|
39
|
+
message: 'Specify either userId or userName, but not both'
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
async commandAction(logger, args) {
|
|
43
|
+
try {
|
|
44
|
+
const isAppOnlyAccessToken = accessToken.isAppOnlyAccessToken(auth.connection.accessTokens[auth.defaultResource].accessToken);
|
|
45
|
+
let requestUrl = `${this.resource}/v1.0/me/mailFolders/searchFolders/childFolders`;
|
|
46
|
+
if (isAppOnlyAccessToken) {
|
|
47
|
+
if (!args.options.userId && !args.options.userName) {
|
|
48
|
+
throw 'When running with application permissions either userId or userName is required';
|
|
49
|
+
}
|
|
50
|
+
const userIdentifier = args.options.userId ?? args.options.userName;
|
|
51
|
+
requestUrl = `${this.resource}/v1.0/users('${userIdentifier}')/mailFolders/searchFolders/childFolders`;
|
|
52
|
+
if (args.options.verbose) {
|
|
53
|
+
await logger.logToStderr(`Creating a mail search folder in the mailbox of the user ${userIdentifier}...`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
if (args.options.userId || args.options.userName) {
|
|
58
|
+
throw 'You can create mail search folder for other users only if CLI is authenticated in app-only mode';
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const requestOptions = {
|
|
62
|
+
url: requestUrl,
|
|
63
|
+
headers: {
|
|
64
|
+
accept: 'application/json;odata.metadata=none',
|
|
65
|
+
'content-type': 'application/json'
|
|
66
|
+
},
|
|
67
|
+
responseType: 'json',
|
|
68
|
+
data: {
|
|
69
|
+
'@odata.type': '#microsoft.graph.mailSearchFolder',
|
|
70
|
+
displayName: args.options.folderName,
|
|
71
|
+
includeNestedFolders: args.options.includeNestedFolders,
|
|
72
|
+
filterQuery: args.options.messageFilter,
|
|
73
|
+
sourceFolderIds: args.options.sourceFoldersIds
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
const result = await request.post(requestOptions);
|
|
77
|
+
await logger.log(result);
|
|
78
|
+
}
|
|
79
|
+
catch (err) {
|
|
80
|
+
this.handleRejectedODataJsonPromise(err);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
export default new OutlookMailSearchFolderAddCommand();
|
|
85
|
+
//# sourceMappingURL=mail-searchfolder-add.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`,
|
package/dist/utils/entraApp.js
CHANGED
|
@@ -143,6 +143,21 @@ export const entraApp = {
|
|
|
143
143
|
redirectUris: options.redirectUris.split(',').map(u => u.trim())
|
|
144
144
|
};
|
|
145
145
|
}
|
|
146
|
+
if (options.platform === 'android') {
|
|
147
|
+
applicationInfo['publicClient'] = {
|
|
148
|
+
redirectUris: [
|
|
149
|
+
`msauth://${options.bundleId}/${formatting.encodeQueryParameter(options.signatureHash)}`
|
|
150
|
+
]
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
if (options.platform === 'apple') {
|
|
154
|
+
applicationInfo['publicClient'] = {
|
|
155
|
+
redirectUris: [
|
|
156
|
+
`msauth://code/msauth.${options.bundleId}%3A%2F%2Fauth`,
|
|
157
|
+
`msauth.${options.bundleId}://auth`
|
|
158
|
+
]
|
|
159
|
+
};
|
|
160
|
+
}
|
|
146
161
|
if (options.implicitFlow) {
|
|
147
162
|
if (!applicationInfo.web) {
|
|
148
163
|
applicationInfo.web = {};
|
|
@@ -31,7 +31,7 @@ m365 entra appregistration add [options]
|
|
|
31
31
|
: Comma-separated list of redirect URIs. Requires `platform` to be specified.
|
|
32
32
|
|
|
33
33
|
`-p, --platform [platform]`
|
|
34
|
-
: Platform for which the
|
|
34
|
+
: Platform for which the app should be configured. Allowed values `spa`, `web`, `publicClient`, `apple`, `android`.
|
|
35
35
|
|
|
36
36
|
`--implicitFlow`
|
|
37
37
|
: Specify, to indicate that the authorization endpoint should return ID and access tokens.
|
|
@@ -75,6 +75,12 @@ m365 entra appregistration add [options]
|
|
|
75
75
|
`--manifest [manifest]`
|
|
76
76
|
: App manifest as retrieved from Entra ID to create the app registration from. Specify either `name` or `manifest` but not both.
|
|
77
77
|
|
|
78
|
+
`--bundleId [bundleId]`
|
|
79
|
+
: Specify a bundle Id to add the iOS / macOS or Android platform to the application. Required when platform is `apple` or `android`.
|
|
80
|
+
|
|
81
|
+
`--signatureHash [signatureHash]`
|
|
82
|
+
: A required hash when specifying a bundle Id and platform `android`.
|
|
83
|
+
|
|
78
84
|
`--save`
|
|
79
85
|
: Use to store the information about the created app in a local file.
|
|
80
86
|
|
|
@@ -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
|
|