@pnp/cli-microsoft365 5.0.0-beta.5a92c19 → 5.0.0-beta.83cd7c5
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/.eslintrc.js +1 -0
- package/dist/appInsights.js +2 -0
- package/dist/m365/aad/commands/app/app-add.js +58 -5
- package/dist/m365/aad/commands/app/app-get.js +97 -0
- package/dist/m365/aad/commands/o365group/o365group-add.js +56 -50
- package/dist/m365/aad/commands.js +1 -0
- package/dist/m365/base/M365RcJson.js +3 -0
- package/dist/m365/file/commands/file-list.js +181 -0
- package/dist/m365/file/commands.js +2 -1
- package/dist/m365/search/commands/externalconnection/externalconnection-add.js +99 -0
- package/dist/m365/search/commands.js +7 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.13.1.js +53 -0
- package/dist/m365/spfx/commands/project/project-upgrade.js +2 -1
- package/dist/m365/spfx/commands/spfx-doctor.js +19 -0
- package/dist/m365/spo/commands/contenttype/contenttype-list.js +52 -0
- package/dist/m365/spo/commands/list/list-get.js +6 -2
- package/dist/m365/spo/commands/page/Page.js +3 -1
- package/dist/m365/spo/commands/page/page-add.js +7 -10
- package/dist/m365/spo/commands/page/page-set.js +7 -10
- package/dist/m365/spo/commands/web/web-installedlanguage-list.js +48 -0
- package/dist/m365/spo/commands.js +3 -1
- package/docs/docs/cmd/aad/app/app-add.md +11 -0
- package/docs/docs/cmd/aad/app/app-get.md +48 -0
- package/docs/docs/cmd/aad/o365group/o365group-add.md +1 -0
- package/docs/docs/cmd/file/file-list.md +46 -0
- package/docs/docs/cmd/search/externalconnection/externalconnection-add.md +43 -0
- package/docs/docs/cmd/spfx/project/project-upgrade.md +1 -1
- package/docs/docs/cmd/spo/contenttype/contenttype-list.md +33 -0
- package/docs/docs/cmd/spo/list/list-get.md +9 -0
- package/docs/docs/cmd/spo/page/page-add.md +2 -2
- package/docs/docs/cmd/spo/page/page-set.md +3 -3
- package/docs/docs/cmd/spo/web/web-installedlanguage-list.md +24 -0
- package/npm-shrinkwrap.json +73 -40
- package/package.json +3 -2
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const request_1 = require("../../../../request");
|
|
4
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
5
|
+
const commands_1 = require("../../commands");
|
|
6
|
+
class SearchExternalConnectionAddCommand extends GraphCommand_1.default {
|
|
7
|
+
get name() {
|
|
8
|
+
return commands_1.default.EXTERNALCONNECTION_ADD;
|
|
9
|
+
}
|
|
10
|
+
get description() {
|
|
11
|
+
return 'Adds a new External Connection for Microsoft Search';
|
|
12
|
+
}
|
|
13
|
+
getTelemetryProperties(args) {
|
|
14
|
+
const telemetryProps = super.getTelemetryProperties(args);
|
|
15
|
+
telemetryProps.authorizedAppIds = typeof args.options.authorizedAppIds !== undefined;
|
|
16
|
+
return telemetryProps;
|
|
17
|
+
}
|
|
18
|
+
commandAction(logger, args, cb) {
|
|
19
|
+
let appIds = [];
|
|
20
|
+
if (args.options.authorizedAppIds !== undefined &&
|
|
21
|
+
args.options.authorizedAppIds !== '') {
|
|
22
|
+
appIds = args.options.authorizedAppIds.split(',');
|
|
23
|
+
}
|
|
24
|
+
const commandData = {
|
|
25
|
+
id: args.options.id,
|
|
26
|
+
name: args.options.name,
|
|
27
|
+
description: args.options.description,
|
|
28
|
+
configuration: {
|
|
29
|
+
authorizedAppIds: appIds
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const requestOptions = {
|
|
33
|
+
url: `${this.resource}/v1.0/external/connections`,
|
|
34
|
+
headers: {
|
|
35
|
+
accept: 'application/json;odata.metadata=none'
|
|
36
|
+
},
|
|
37
|
+
responseType: 'json',
|
|
38
|
+
data: commandData
|
|
39
|
+
};
|
|
40
|
+
request_1.default
|
|
41
|
+
.post(requestOptions)
|
|
42
|
+
.then(_ => cb(), err => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
43
|
+
}
|
|
44
|
+
options() {
|
|
45
|
+
const options = [
|
|
46
|
+
{
|
|
47
|
+
option: '-i, --id <id>'
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
option: '-n, --name <name>'
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
option: '-d, --description <description>'
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
option: '--authorizedAppIds [authorizedAppIds]'
|
|
57
|
+
}
|
|
58
|
+
];
|
|
59
|
+
const parentOptions = super.options();
|
|
60
|
+
return options.concat(parentOptions);
|
|
61
|
+
}
|
|
62
|
+
validate(args) {
|
|
63
|
+
const id = args.options.id;
|
|
64
|
+
if (id.length < 3 || id.length > 32) {
|
|
65
|
+
return 'ID must be between 3 and 32 characters in length.';
|
|
66
|
+
}
|
|
67
|
+
const alphaNumericRegEx = /[^\w]|_/g;
|
|
68
|
+
if (alphaNumericRegEx.test(id)) {
|
|
69
|
+
return 'ID must only contain alphanumeric characters.';
|
|
70
|
+
}
|
|
71
|
+
if (id.length > 9 &&
|
|
72
|
+
id.startsWith('Microsoft')) {
|
|
73
|
+
return 'ID cannot begin with Microsoft';
|
|
74
|
+
}
|
|
75
|
+
const invalidIds = ['None',
|
|
76
|
+
'Directory',
|
|
77
|
+
'Exchange',
|
|
78
|
+
'ExchangeArchive',
|
|
79
|
+
'LinkedIn',
|
|
80
|
+
'Mailbox',
|
|
81
|
+
'OneDriveBusiness',
|
|
82
|
+
'SharePoint',
|
|
83
|
+
'Teams',
|
|
84
|
+
'Yammer',
|
|
85
|
+
'Connectors',
|
|
86
|
+
'TaskFabric',
|
|
87
|
+
'PowerBI',
|
|
88
|
+
'Assistant',
|
|
89
|
+
'TopicEngine',
|
|
90
|
+
'MSFT_All_Connectors'
|
|
91
|
+
];
|
|
92
|
+
if (invalidIds.indexOf(id) > -1) {
|
|
93
|
+
return `ID cannot be one of the following values: ${invalidIds.join(', ')}.`;
|
|
94
|
+
}
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
module.exports = new SearchExternalConnectionAddCommand();
|
|
99
|
+
//# sourceMappingURL=externalconnection-add.js.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const FN001001_DEP_microsoft_sp_core_library_1 = require("./rules/FN001001_DEP_microsoft_sp_core_library");
|
|
4
|
+
const FN001002_DEP_microsoft_sp_lodash_subset_1 = require("./rules/FN001002_DEP_microsoft_sp_lodash_subset");
|
|
5
|
+
const FN001003_DEP_microsoft_sp_office_ui_fabric_core_1 = require("./rules/FN001003_DEP_microsoft_sp_office_ui_fabric_core");
|
|
6
|
+
const FN001004_DEP_microsoft_sp_webpart_base_1 = require("./rules/FN001004_DEP_microsoft_sp_webpart_base");
|
|
7
|
+
const FN001011_DEP_microsoft_sp_dialog_1 = require("./rules/FN001011_DEP_microsoft_sp_dialog");
|
|
8
|
+
const FN001012_DEP_microsoft_sp_application_base_1 = require("./rules/FN001012_DEP_microsoft_sp_application_base");
|
|
9
|
+
const FN001013_DEP_microsoft_decorators_1 = require("./rules/FN001013_DEP_microsoft_decorators");
|
|
10
|
+
const FN001014_DEP_microsoft_sp_listview_extensibility_1 = require("./rules/FN001014_DEP_microsoft_sp_listview_extensibility");
|
|
11
|
+
const FN001021_DEP_microsoft_sp_property_pane_1 = require("./rules/FN001021_DEP_microsoft_sp_property_pane");
|
|
12
|
+
const FN001023_DEP_microsoft_sp_component_base_1 = require("./rules/FN001023_DEP_microsoft_sp_component_base");
|
|
13
|
+
const FN001024_DEP_microsoft_sp_diagnostics_1 = require("./rules/FN001024_DEP_microsoft_sp_diagnostics");
|
|
14
|
+
const FN001025_DEP_microsoft_sp_dynamic_data_1 = require("./rules/FN001025_DEP_microsoft_sp_dynamic_data");
|
|
15
|
+
const FN001026_DEP_microsoft_sp_extension_base_1 = require("./rules/FN001026_DEP_microsoft_sp_extension_base");
|
|
16
|
+
const FN001027_DEP_microsoft_sp_http_1 = require("./rules/FN001027_DEP_microsoft_sp_http");
|
|
17
|
+
const FN001028_DEP_microsoft_sp_list_subscription_1 = require("./rules/FN001028_DEP_microsoft_sp_list_subscription");
|
|
18
|
+
const FN001029_DEP_microsoft_sp_loader_1 = require("./rules/FN001029_DEP_microsoft_sp_loader");
|
|
19
|
+
const FN001030_DEP_microsoft_sp_module_interfaces_1 = require("./rules/FN001030_DEP_microsoft_sp_module_interfaces");
|
|
20
|
+
const FN001031_DEP_microsoft_sp_odata_types_1 = require("./rules/FN001031_DEP_microsoft_sp_odata_types");
|
|
21
|
+
const FN001032_DEP_microsoft_sp_page_context_1 = require("./rules/FN001032_DEP_microsoft_sp_page_context");
|
|
22
|
+
const FN002001_DEVDEP_microsoft_sp_build_web_1 = require("./rules/FN002001_DEVDEP_microsoft_sp_build_web");
|
|
23
|
+
const FN002002_DEVDEP_microsoft_sp_module_interfaces_1 = require("./rules/FN002002_DEVDEP_microsoft_sp_module_interfaces");
|
|
24
|
+
const FN002009_DEVDEP_microsoft_sp_tslint_rules_1 = require("./rules/FN002009_DEVDEP_microsoft_sp_tslint_rules");
|
|
25
|
+
const FN006004_CFG_PS_developer_1 = require("./rules/FN006004_CFG_PS_developer");
|
|
26
|
+
const FN010001_YORC_version_1 = require("./rules/FN010001_YORC_version");
|
|
27
|
+
module.exports = [
|
|
28
|
+
new FN001001_DEP_microsoft_sp_core_library_1.FN001001_DEP_microsoft_sp_core_library('1.13.1'),
|
|
29
|
+
new FN001002_DEP_microsoft_sp_lodash_subset_1.FN001002_DEP_microsoft_sp_lodash_subset('1.13.1'),
|
|
30
|
+
new FN001003_DEP_microsoft_sp_office_ui_fabric_core_1.FN001003_DEP_microsoft_sp_office_ui_fabric_core('1.13.1'),
|
|
31
|
+
new FN001004_DEP_microsoft_sp_webpart_base_1.FN001004_DEP_microsoft_sp_webpart_base('1.13.1'),
|
|
32
|
+
new FN001011_DEP_microsoft_sp_dialog_1.FN001011_DEP_microsoft_sp_dialog('1.13.1'),
|
|
33
|
+
new FN001012_DEP_microsoft_sp_application_base_1.FN001012_DEP_microsoft_sp_application_base('1.13.1'),
|
|
34
|
+
new FN001013_DEP_microsoft_decorators_1.FN001013_DEP_microsoft_decorators('1.13.1'),
|
|
35
|
+
new FN001014_DEP_microsoft_sp_listview_extensibility_1.FN001014_DEP_microsoft_sp_listview_extensibility('1.13.1'),
|
|
36
|
+
new FN001021_DEP_microsoft_sp_property_pane_1.FN001021_DEP_microsoft_sp_property_pane('1.13.1'),
|
|
37
|
+
new FN001023_DEP_microsoft_sp_component_base_1.FN001023_DEP_microsoft_sp_component_base('1.13.1'),
|
|
38
|
+
new FN001024_DEP_microsoft_sp_diagnostics_1.FN001024_DEP_microsoft_sp_diagnostics('1.13.1'),
|
|
39
|
+
new FN001025_DEP_microsoft_sp_dynamic_data_1.FN001025_DEP_microsoft_sp_dynamic_data('1.13.1'),
|
|
40
|
+
new FN001026_DEP_microsoft_sp_extension_base_1.FN001026_DEP_microsoft_sp_extension_base('1.13.1'),
|
|
41
|
+
new FN001027_DEP_microsoft_sp_http_1.FN001027_DEP_microsoft_sp_http('1.13.1'),
|
|
42
|
+
new FN001028_DEP_microsoft_sp_list_subscription_1.FN001028_DEP_microsoft_sp_list_subscription('1.13.1'),
|
|
43
|
+
new FN001029_DEP_microsoft_sp_loader_1.FN001029_DEP_microsoft_sp_loader('1.13.1'),
|
|
44
|
+
new FN001030_DEP_microsoft_sp_module_interfaces_1.FN001030_DEP_microsoft_sp_module_interfaces('1.13.1'),
|
|
45
|
+
new FN001031_DEP_microsoft_sp_odata_types_1.FN001031_DEP_microsoft_sp_odata_types('1.13.1'),
|
|
46
|
+
new FN001032_DEP_microsoft_sp_page_context_1.FN001032_DEP_microsoft_sp_page_context('1.13.1'),
|
|
47
|
+
new FN002001_DEVDEP_microsoft_sp_build_web_1.FN002001_DEVDEP_microsoft_sp_build_web('1.13.1'),
|
|
48
|
+
new FN002002_DEVDEP_microsoft_sp_module_interfaces_1.FN002002_DEVDEP_microsoft_sp_module_interfaces('1.13.1'),
|
|
49
|
+
new FN002009_DEVDEP_microsoft_sp_tslint_rules_1.FN002009_DEVDEP_microsoft_sp_tslint_rules('1.13.1'),
|
|
50
|
+
new FN006004_CFG_PS_developer_1.FN006004_CFG_PS_developer('1.13.1'),
|
|
51
|
+
new FN010001_YORC_version_1.FN010001_YORC_version('1.13.1')
|
|
52
|
+
];
|
|
53
|
+
//# sourceMappingURL=upgrade-1.13.1.js.map
|
|
@@ -433,6 +433,25 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
433
433
|
range: '^4',
|
|
434
434
|
fix: 'npm i -g yo@4'
|
|
435
435
|
}
|
|
436
|
+
},
|
|
437
|
+
'1.13.1': {
|
|
438
|
+
gulp: {
|
|
439
|
+
range: '^4',
|
|
440
|
+
fix: 'npm i -g gulp@4'
|
|
441
|
+
},
|
|
442
|
+
node: {
|
|
443
|
+
range: '^12 || ^14',
|
|
444
|
+
fix: 'Install Node.js v12 or v14'
|
|
445
|
+
},
|
|
446
|
+
react: {
|
|
447
|
+
range: '16.9.0',
|
|
448
|
+
fix: 'npm i react@16.9.0'
|
|
449
|
+
},
|
|
450
|
+
sp: SharePointVersion.SPO,
|
|
451
|
+
yo: {
|
|
452
|
+
range: '^4',
|
|
453
|
+
fix: 'npm i -g yo@4'
|
|
454
|
+
}
|
|
436
455
|
}
|
|
437
456
|
};
|
|
438
457
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const request_1 = require("../../../../request");
|
|
4
|
+
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
5
|
+
const commands_1 = require("../../commands");
|
|
6
|
+
class SpoContentTypeListCommand extends SpoCommand_1.default {
|
|
7
|
+
get name() {
|
|
8
|
+
return commands_1.default.CONTENTTYPE_LIST;
|
|
9
|
+
}
|
|
10
|
+
get description() {
|
|
11
|
+
return 'Lists all available content types in the specified site';
|
|
12
|
+
}
|
|
13
|
+
defaultProperties() {
|
|
14
|
+
return ['StringId', 'Name', 'Hidden', 'ReadOnly', 'Sealed'];
|
|
15
|
+
}
|
|
16
|
+
commandAction(logger, args, cb) {
|
|
17
|
+
let requestUrl = `${args.options.webUrl}/_api/web/ContentTypes`;
|
|
18
|
+
if (args.options.category) {
|
|
19
|
+
requestUrl += `?$filter=Group eq '${encodeURIComponent(args.options.category)}'`;
|
|
20
|
+
}
|
|
21
|
+
const requestOptions = {
|
|
22
|
+
url: requestUrl,
|
|
23
|
+
headers: {
|
|
24
|
+
accept: 'application/json;odata=nometadata'
|
|
25
|
+
},
|
|
26
|
+
responseType: 'json'
|
|
27
|
+
};
|
|
28
|
+
request_1.default
|
|
29
|
+
.get(requestOptions)
|
|
30
|
+
.then((res) => {
|
|
31
|
+
logger.log(res.value);
|
|
32
|
+
cb();
|
|
33
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
34
|
+
}
|
|
35
|
+
options() {
|
|
36
|
+
const options = [
|
|
37
|
+
{
|
|
38
|
+
option: '-u, --webUrl <webUrl>'
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
option: '-c, --category [category]'
|
|
42
|
+
}
|
|
43
|
+
];
|
|
44
|
+
const parentOptions = super.options();
|
|
45
|
+
return options.concat(parentOptions);
|
|
46
|
+
}
|
|
47
|
+
validate(args) {
|
|
48
|
+
return SpoCommand_1.default.isValidSharePointUrl(args.options.webUrl);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
module.exports = new SpoContentTypeListCommand();
|
|
52
|
+
//# sourceMappingURL=contenttype-list.js.map
|
|
@@ -16,6 +16,7 @@ class SpoListGetCommand extends SpoCommand_1.default {
|
|
|
16
16
|
telemetryProps.id = (!(!args.options.id)).toString();
|
|
17
17
|
telemetryProps.title = (!(!args.options.title)).toString();
|
|
18
18
|
telemetryProps.properties = (!(!args.options.properties)).toString();
|
|
19
|
+
telemetryProps.withPermissions = typeof args.options.withPermissions !== 'undefined';
|
|
19
20
|
return telemetryProps;
|
|
20
21
|
}
|
|
21
22
|
commandAction(logger, args, cb) {
|
|
@@ -29,10 +30,10 @@ class SpoListGetCommand extends SpoCommand_1.default {
|
|
|
29
30
|
else {
|
|
30
31
|
requestUrl = `${args.options.webUrl}/_api/web/lists/GetByTitle('${encodeURIComponent(args.options.title)}')`;
|
|
31
32
|
}
|
|
32
|
-
|
|
33
|
+
let propertiesSelect = args.options.properties ? `?$select=${encodeURIComponent(args.options.properties)}` : ``;
|
|
34
|
+
propertiesSelect += args.options.withPermissions ? `${args.options.properties ? '&' : '?'}$expand=HasUniqueRoleAssignments,RoleAssignments/Member,RoleAssignments/RoleDefinitionBindings` : ``;
|
|
33
35
|
const requestOptions = {
|
|
34
36
|
url: requestUrl + propertiesSelect,
|
|
35
|
-
method: 'GET',
|
|
36
37
|
headers: {
|
|
37
38
|
'accept': 'application/json;odata=nometadata'
|
|
38
39
|
},
|
|
@@ -58,6 +59,9 @@ class SpoListGetCommand extends SpoCommand_1.default {
|
|
|
58
59
|
},
|
|
59
60
|
{
|
|
60
61
|
option: '-p, --properties [properties]'
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
option: '--withPermissions'
|
|
61
65
|
}
|
|
62
66
|
];
|
|
63
67
|
const parentOptions = super.options();
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Page = void 0;
|
|
3
|
+
exports.Page = exports.supportedPromoteAs = exports.supportedPageLayouts = void 0;
|
|
4
4
|
const request_1 = require("../../../../request");
|
|
5
5
|
const Utils_1 = require("../../../../Utils");
|
|
6
6
|
const clientsidepages_1 = require("./clientsidepages");
|
|
7
7
|
const pageMethods_1 = require("./pageMethods");
|
|
8
|
+
exports.supportedPageLayouts = ['Article', 'Home', 'SingleWebPartAppPage', 'RepostPage', 'HeaderlessSearchResults', 'Spaces', 'Topic'];
|
|
9
|
+
exports.supportedPromoteAs = ['HomePage', 'NewsPage', 'Template'];
|
|
8
10
|
class Page {
|
|
9
11
|
static getPage(name, webUrl, logger, debug, verbose) {
|
|
10
12
|
return new Promise((resolve, reject) => {
|
|
@@ -284,11 +284,11 @@ class SpoPageAddCommand extends SpoCommand_1.default {
|
|
|
284
284
|
},
|
|
285
285
|
{
|
|
286
286
|
option: '-l, --layoutType [layoutType]',
|
|
287
|
-
autocomplete:
|
|
287
|
+
autocomplete: Page_1.supportedPageLayouts
|
|
288
288
|
},
|
|
289
289
|
{
|
|
290
290
|
option: '-p, --promoteAs [promoteAs]',
|
|
291
|
-
autocomplete:
|
|
291
|
+
autocomplete: Page_1.supportedPromoteAs
|
|
292
292
|
},
|
|
293
293
|
{
|
|
294
294
|
option: '--commentsEnabled'
|
|
@@ -312,20 +312,17 @@ class SpoPageAddCommand extends SpoCommand_1.default {
|
|
|
312
312
|
return isValidSharePointUrl;
|
|
313
313
|
}
|
|
314
314
|
if (args.options.layoutType &&
|
|
315
|
-
args.options.layoutType
|
|
316
|
-
args.options.layoutType
|
|
317
|
-
return `${args.options.layoutType} is not a valid option for layoutType. Allowed values Article|Home`;
|
|
315
|
+
Page_1.supportedPageLayouts.indexOf(args.options.layoutType) < 0) {
|
|
316
|
+
return `${args.options.layoutType} is not a valid option for layoutType. Allowed values ${Page_1.supportedPageLayouts.join(', ')}`;
|
|
318
317
|
}
|
|
319
318
|
if (args.options.promoteAs &&
|
|
320
|
-
args.options.promoteAs
|
|
321
|
-
args.options.promoteAs
|
|
322
|
-
args.options.promoteAs !== 'Template') {
|
|
323
|
-
return `${args.options.promoteAs} is not a valid option for promoteAs. Allowed values HomePage|NewsPage|Template`;
|
|
319
|
+
Page_1.supportedPromoteAs.indexOf(args.options.promoteAs) < 0) {
|
|
320
|
+
return `${args.options.promoteAs} is not a valid option for promoteAs. Allowed values ${Page_1.supportedPromoteAs.join(', ')}`;
|
|
324
321
|
}
|
|
325
322
|
if (args.options.promoteAs === 'HomePage' && args.options.layoutType !== 'Home') {
|
|
326
323
|
return 'You can only promote home pages as site home page';
|
|
327
324
|
}
|
|
328
|
-
if (args.options.promoteAs === 'NewsPage' && args.options.layoutType
|
|
325
|
+
if (args.options.promoteAs === 'NewsPage' && args.options.layoutType && args.options.layoutType !== 'Article') {
|
|
329
326
|
return 'You can only promote article pages as news article';
|
|
330
327
|
}
|
|
331
328
|
return true;
|
|
@@ -283,11 +283,11 @@ class SpoPageSetCommand extends SpoCommand_1.default {
|
|
|
283
283
|
},
|
|
284
284
|
{
|
|
285
285
|
option: '-l, --layoutType [layoutType]',
|
|
286
|
-
autocomplete:
|
|
286
|
+
autocomplete: Page_1.supportedPageLayouts
|
|
287
287
|
},
|
|
288
288
|
{
|
|
289
289
|
option: '-p, --promoteAs [promoteAs]',
|
|
290
|
-
autocomplete:
|
|
290
|
+
autocomplete: Page_1.supportedPromoteAs
|
|
291
291
|
},
|
|
292
292
|
{
|
|
293
293
|
option: '--commentsEnabled [commentsEnabled]',
|
|
@@ -315,20 +315,17 @@ class SpoPageSetCommand extends SpoCommand_1.default {
|
|
|
315
315
|
return isValidSharePointUrl;
|
|
316
316
|
}
|
|
317
317
|
if (args.options.layoutType &&
|
|
318
|
-
args.options.layoutType
|
|
319
|
-
args.options.layoutType
|
|
320
|
-
return `${args.options.layoutType} is not a valid option for layoutType. Allowed values Article|Home`;
|
|
318
|
+
Page_1.supportedPageLayouts.indexOf(args.options.layoutType) < 0) {
|
|
319
|
+
return `${args.options.layoutType} is not a valid option for layoutType. Allowed values ${Page_1.supportedPageLayouts.join(', ')}`;
|
|
321
320
|
}
|
|
322
321
|
if (args.options.promoteAs &&
|
|
323
|
-
args.options.promoteAs
|
|
324
|
-
args.options.promoteAs
|
|
325
|
-
args.options.promoteAs !== 'Template') {
|
|
326
|
-
return `${args.options.promoteAs} is not a valid option for promoteAs. Allowed values HomePage|NewsPage|Template`;
|
|
322
|
+
Page_1.supportedPromoteAs.indexOf(args.options.promoteAs) < 0) {
|
|
323
|
+
return `${args.options.promoteAs} is not a valid option for promoteAs. Allowed values ${Page_1.supportedPromoteAs.join(', ')}`;
|
|
327
324
|
}
|
|
328
325
|
if (args.options.promoteAs === 'HomePage' && args.options.layoutType !== 'Home') {
|
|
329
326
|
return 'You can only promote home pages as site home page';
|
|
330
327
|
}
|
|
331
|
-
if (args.options.promoteAs === 'NewsPage' && args.options.layoutType
|
|
328
|
+
if (args.options.promoteAs === 'NewsPage' && args.options.layoutType && args.options.layoutType !== 'Article') {
|
|
332
329
|
return 'You can only promote article pages as news article';
|
|
333
330
|
}
|
|
334
331
|
if (typeof args.options.commentsEnabled !== 'undefined' &&
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const request_1 = require("../../../../request");
|
|
4
|
+
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
5
|
+
const commands_1 = require("../../commands");
|
|
6
|
+
class SpoWebInstalledLanguageListCommand extends SpoCommand_1.default {
|
|
7
|
+
get name() {
|
|
8
|
+
return commands_1.default.WEB_INSTALLEDLANGUAGE_LIST;
|
|
9
|
+
}
|
|
10
|
+
get description() {
|
|
11
|
+
return 'Lists all installed languages on site';
|
|
12
|
+
}
|
|
13
|
+
defaultProperties() {
|
|
14
|
+
return ['DisplayName', 'LanguageTag', 'Lcid'];
|
|
15
|
+
}
|
|
16
|
+
commandAction(logger, args, cb) {
|
|
17
|
+
if (this.verbose) {
|
|
18
|
+
logger.logToStderr(`Retrieving all installed languages on site ${args.options.webUrl}...`);
|
|
19
|
+
}
|
|
20
|
+
const requestOptions = {
|
|
21
|
+
url: `${args.options.webUrl}/_api/web/RegionalSettings/InstalledLanguages`,
|
|
22
|
+
headers: {
|
|
23
|
+
'accept': 'application/json;odata=nometadata'
|
|
24
|
+
},
|
|
25
|
+
responseType: 'json'
|
|
26
|
+
};
|
|
27
|
+
request_1.default
|
|
28
|
+
.get(requestOptions)
|
|
29
|
+
.then((webInstalledLanguageProperties) => {
|
|
30
|
+
logger.log(webInstalledLanguageProperties.Items);
|
|
31
|
+
cb();
|
|
32
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
33
|
+
}
|
|
34
|
+
options() {
|
|
35
|
+
const options = [
|
|
36
|
+
{
|
|
37
|
+
option: '-u, --webUrl <webUrl>'
|
|
38
|
+
}
|
|
39
|
+
];
|
|
40
|
+
const parentOptions = super.options();
|
|
41
|
+
return options.concat(parentOptions);
|
|
42
|
+
}
|
|
43
|
+
validate(args) {
|
|
44
|
+
return SpoCommand_1.default.isValidSharePointUrl(args.options.webUrl);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
module.exports = new SpoWebInstalledLanguageListCommand();
|
|
48
|
+
//# sourceMappingURL=web-installedlanguage-list.js.map
|
|
@@ -22,9 +22,10 @@ exports.default = {
|
|
|
22
22
|
CDN_POLICY_SET: `${prefix} cdn policy set`,
|
|
23
23
|
CDN_SET: `${prefix} cdn set`,
|
|
24
24
|
CONTENTTYPE_ADD: `${prefix} contenttype add`,
|
|
25
|
-
CONTENTTYPE_GET: `${prefix} contenttype get`,
|
|
26
25
|
CONTENTTYPE_FIELD_REMOVE: `${prefix} contenttype field remove`,
|
|
27
26
|
CONTENTTYPE_FIELD_SET: `${prefix} contenttype field set`,
|
|
27
|
+
CONTENTTYPE_GET: `${prefix} contenttype get`,
|
|
28
|
+
CONTENTTYPE_LIST: `${prefix} contenttype list`,
|
|
28
29
|
CONTENTTYPE_REMOVE: `${prefix} contenttype remove`,
|
|
29
30
|
CONTENTTYPEHUB_GET: `${prefix} contenttypehub get`,
|
|
30
31
|
CUSTOMACTION_ADD: `${prefix} customaction add`,
|
|
@@ -245,6 +246,7 @@ exports.default = {
|
|
|
245
246
|
WEB_ADD: `${prefix} web add`,
|
|
246
247
|
WEB_CLIENTSIDEWEBPART_LIST: `${prefix} web clientsidewebpart list`,
|
|
247
248
|
WEB_GET: `${prefix} web get`,
|
|
249
|
+
WEB_INSTALLEDLANGUAGE_LIST: `${prefix} web installedlanguage list`,
|
|
248
250
|
WEB_LIST: `${prefix} web list`,
|
|
249
251
|
WEB_REINDEX: `${prefix} web reindex`,
|
|
250
252
|
WEB_REMOVE: `${prefix} web remove`,
|
|
@@ -52,6 +52,9 @@ m365 aad app add [options]
|
|
|
52
52
|
`--manifest [manifest]`
|
|
53
53
|
: Azure AD app manifest as retrieved from the Azure Portal to create the app registration from
|
|
54
54
|
|
|
55
|
+
`--save`
|
|
56
|
+
: Use to store the information about the created app in a local file
|
|
57
|
+
|
|
55
58
|
--8<-- "docs/cmd/_global.md"
|
|
56
59
|
|
|
57
60
|
## Remarks
|
|
@@ -80,6 +83,8 @@ When using the `withSecret` option, this command will automatically generate a s
|
|
|
80
83
|
|
|
81
84
|
After creating the Azure AD app registration, this command returns the app ID and object ID of the created app registration. If you used the `withSecret` option, it will also return the generated secret.
|
|
82
85
|
|
|
86
|
+
If you want to store the information about the created Azure AD app registration, use the `--save` option. This is useful when you build solutions connected to Microsoft 365 and want to easily manage app registrations used with your solution. When you use the `--save` option, after you create the app registration, the command will write its ID and name to the `.m365rc.json` file in the current directory. If the file already exists, it will add the information about the to it, allowing you to track multiple apps. If the file doesn't exist, the command will create it.
|
|
87
|
+
|
|
83
88
|
## Examples
|
|
84
89
|
|
|
85
90
|
Create new Azure AD app registration with the specified name
|
|
@@ -141,3 +146,9 @@ Create new Azure AD app registration with Application ID URI set to a value that
|
|
|
141
146
|
```sh
|
|
142
147
|
m365 aad app add --name 'My AAD app' --uri api://caf406b91cd4.ngrok.io/_appId_ --scopeName access_as_user --scopeAdminConsentDescription 'Access as a user' --scopeAdminConsentDisplayName 'Access as a user' --scopeConsentBy adminsAndUsers
|
|
143
148
|
```
|
|
149
|
+
|
|
150
|
+
Create new Azure AD app registration with the specified name. Store information about the created app registration in the _.m365rc.json_ file in the current directory.
|
|
151
|
+
|
|
152
|
+
```sh
|
|
153
|
+
m365 aad app add --name 'My AAD app' --save
|
|
154
|
+
```
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# aad app get
|
|
2
|
+
|
|
3
|
+
Gets an Azure AD app registration
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
m365 aad app get [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
`--appId [appId]`
|
|
14
|
+
: Application (client) ID of the Azure AD application registration to get. Specify either `appId`, `objectId` or `name`
|
|
15
|
+
|
|
16
|
+
`--objectId [objectId]`
|
|
17
|
+
: Object ID of the Azure AD application registration to get. Specify either `appId`, `objectId` or `name`
|
|
18
|
+
|
|
19
|
+
`--name [name]`
|
|
20
|
+
: Name of the Azure AD application registration to get. Specify either `appId`, `objectId` or `name`
|
|
21
|
+
|
|
22
|
+
--8<-- "docs/cmd/_global.md"
|
|
23
|
+
|
|
24
|
+
## Remarks
|
|
25
|
+
|
|
26
|
+
For best performance use the `objectId` option to reference the Azure AD application registration to update. If you use `appId` or `name`, this command will first need to find the corresponding object ID for that application.
|
|
27
|
+
|
|
28
|
+
If the command finds multiple Azure AD application registrations with the specified app name, it will prompt you to disambiguate which app it should use, listing the discovered object IDs.
|
|
29
|
+
|
|
30
|
+
## Examples
|
|
31
|
+
|
|
32
|
+
Get the Azure AD application registration by its app (client) ID
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
m365 aad app get --appId d75be2e1-0204-4f95-857d-51a37cf40be8
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Get the Azure AD application registration by its object ID
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
m365 aad app get --objectId d75be2e1-0204-4f95-857d-51a37cf40be8
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Get the Azure AD application registration by its name
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
m365 aad app get --name "My app"
|
|
48
|
+
```
|
|
@@ -36,6 +36,7 @@ m365 aad o365group add [options]
|
|
|
36
36
|
## Remarks
|
|
37
37
|
|
|
38
38
|
When specifying the path to the logo image you can use both relative and absolute paths. Note, that ~ in the path, will not be resolved and will most likely result in an error.
|
|
39
|
+
If an invalid user is provided in the comma-separated list or Owners or Members, the command operation will fail and the Micrsoft 365 Group will not be created.
|
|
39
40
|
|
|
40
41
|
## Examples
|
|
41
42
|
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# file list
|
|
2
|
+
|
|
3
|
+
Retrieves files from the specified folder and site
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
m365 file list [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
`-u, --webUrl <webUrl>`
|
|
14
|
+
: The URL of the site where the folder from which to retrieve files is located
|
|
15
|
+
|
|
16
|
+
`-f, --folderUrl <folderUrl>`
|
|
17
|
+
: The server- or site-relative URL of the folder from which to retrieve files
|
|
18
|
+
|
|
19
|
+
`--recursive`
|
|
20
|
+
: Set to retrieve files from subfolders
|
|
21
|
+
|
|
22
|
+
--8<-- "docs/cmd/_global.md"
|
|
23
|
+
|
|
24
|
+
## Remarks
|
|
25
|
+
|
|
26
|
+
This command is an improved version of the `spo file list` command. The main difference between the two commands is, that `file list` uses Microsoft Graph and properly supports retrieving files from large folders. Because `file list` uses Microsoft Graph and `spo file list` uses SharePoint REST APIs, the data returned by both commands is different.
|
|
27
|
+
|
|
28
|
+
## Examples
|
|
29
|
+
|
|
30
|
+
Return all files from folder _Shared Documents_ located in site _https://contoso.sharepoint.com/sites/project-x_
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
m365 file list --webUrl https://contoso.sharepoint.com/sites/project-x --folder 'Shared Documents'
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Return all files from the folder _Shared Documents_ and all the sub-folders of _Shared Documents_ located in site _https://contoso.sharepoint.com/sites/project-x_
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
m365 file list --webUrl https://contoso.sharepoint.com/sites/project-x --folder 'Shared Documents' --recursive
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Return all files from the _Important_ folder in the _Shared Documents_ document library located in site _https://contoso.sharepoint.com/sites/project-x_
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
m365 file list --webUrl https://contoso.sharepoint.com/sites/project-x --folder 'Shared Documents/Important'
|
|
46
|
+
```
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# search externalconnection add
|
|
2
|
+
|
|
3
|
+
Add a new external connection to be defined for Microsoft Search
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
m365 search externalconnection add [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
`-i, --id <id>`
|
|
14
|
+
: Developer-provided unique ID of the connection within the Azure Active Directory tenant
|
|
15
|
+
|
|
16
|
+
`-n, --name <name>`
|
|
17
|
+
: The display name of the connection to be displayed in the Microsoft 365 admin center. Maximum length of 128 characters
|
|
18
|
+
|
|
19
|
+
`-d, --description <description>`
|
|
20
|
+
: Description of the connection displayed in the Microsoft 365 admin center
|
|
21
|
+
|
|
22
|
+
`--authorizedAppIds [authorizedAppIds]`
|
|
23
|
+
: Comma-separated collection of application IDs for registered Azure Active Directory apps that are allowed to manage the external connection and to index content in the external connection.
|
|
24
|
+
|
|
25
|
+
--8<-- "docs/cmd/_global.md"
|
|
26
|
+
|
|
27
|
+
## Remarks
|
|
28
|
+
|
|
29
|
+
The `id` must be at least 3 and no more than 32 characters long. It can contain only alphanumeric characters, can't begin with _Microsoft_ and can be any of the following values: *None, Directory, Exchange, ExchangeArchive, LinkedIn, Mailbox, OneDriveBusiness, SharePoint, Teams, Yammer, Connectors, TaskFabric, PowerBI, Assistant, TopicEngine, MSFT_All_Connectors*.
|
|
30
|
+
|
|
31
|
+
## Examples
|
|
32
|
+
|
|
33
|
+
Adds a new external connection with name and description of test
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
m365 search externalconnection add --id MyApp --name "My application" --description "Description of your application"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Adds a new external connection with a limited number of authorized apps
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
m365 search externalconnection add --id MyApp --name "My application" --description "Description of your application" --authorizedAppIds "00000000-0000-0000-0000-000000000000,00000000-0000-0000-0000-000000000001,00000000-0000-0000-0000-000000000002"
|
|
43
|
+
```
|
|
@@ -32,7 +32,7 @@ m365 spfx project upgrade [options]
|
|
|
32
32
|
|
|
33
33
|
## Remarks
|
|
34
34
|
|
|
35
|
-
The `spfx project upgrade` command helps you upgrade your SharePoint Framework project to the specified version. If no version is specified, the command will upgrade to the latest version of the SharePoint Framework it supports (v1.13.
|
|
35
|
+
The `spfx project upgrade` command helps you upgrade your SharePoint Framework project to the specified version. If no version is specified, the command will upgrade to the latest version of the SharePoint Framework it supports (v1.13.1).
|
|
36
36
|
|
|
37
37
|
This command doesn't change your project files. Instead, it gives you a report with all steps necessary to upgrade your project to the specified version of the SharePoint Framework. Changing project files is error-prone, especially when it comes to updating your solution's code. This is why at this moment, this command produces a report that you can use yourself to perform the necessary updates and verify that everything is working as expected.
|
|
38
38
|
|