@pnp/cli-microsoft365 7.0.0-beta.093ef31 → 7.0.0-beta.14c7857
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/README.md +4 -4
- package/dist/Auth.js +10 -1
- package/dist/cli/Cli.js +3 -3
- package/dist/m365/aad/commands/app/app-get.js +4 -1
- package/dist/m365/aad/commands/app/app-remove.js +3 -1
- package/dist/m365/aad/commands/app/app-role-add.js +4 -1
- package/dist/m365/aad/commands/app/app-role-list.js +4 -1
- package/dist/m365/aad/commands/app/app-role-remove.js +5 -2
- package/dist/m365/aad/commands/app/app-set.js +8 -5
- package/dist/m365/aad/commands/approleassignment/approleassignment-add.js +11 -6
- package/dist/m365/aad/commands/approleassignment/approleassignment-remove.js +4 -4
- package/dist/m365/aad/commands/group/group-get.js +4 -4
- package/dist/m365/aad/commands/group/group-list.js +1 -23
- package/dist/m365/aad/commands/group/group-remove.js +98 -0
- package/dist/m365/aad/commands/m365group/m365group-add.js +21 -12
- package/dist/m365/aad/commands/m365group/m365group-recyclebinitem-remove.js +3 -1
- package/dist/m365/aad/commands/m365group/m365group-recyclebinitem-restore.js +4 -1
- package/dist/m365/aad/commands/m365group/m365group-teamify.js +4 -1
- package/dist/m365/aad/commands/sp/sp-add.js +4 -1
- package/dist/m365/aad/commands/sp/sp-get.js +4 -1
- package/dist/m365/aad/commands/user/user-get.js +7 -2
- package/dist/m365/aad/commands.js +1 -0
- package/dist/m365/booking/commands/business/business-get.js +4 -1
- package/dist/m365/commands/login.js +2 -2
- package/dist/m365/graph/commands/subscription/subscription-add.js +5 -5
- package/dist/m365/outlook/commands/message/message-list.js +4 -2
- package/dist/m365/outlook/commands/message/message-move.js +4 -2
- package/dist/m365/pa/commands/app/app-export.js +7 -7
- package/dist/m365/planner/commands/bucket/bucket-add.js +4 -1
- package/dist/m365/planner/commands/bucket/bucket-get.js +9 -2
- package/dist/m365/planner/commands/bucket/bucket-list.js +4 -1
- package/dist/m365/planner/commands/bucket/bucket-remove.js +7 -2
- package/dist/m365/planner/commands/bucket/bucket-set.js +8 -2
- package/dist/m365/planner/commands/plan/plan-add.js +4 -1
- package/dist/m365/planner/commands/plan/plan-get.js +4 -1
- package/dist/m365/planner/commands/plan/plan-list.js +4 -1
- package/dist/m365/planner/commands/plan/plan-remove.js +4 -1
- package/dist/m365/planner/commands/plan/plan-set.js +4 -1
- package/dist/m365/planner/commands/roster/roster-get.js +4 -1
- package/dist/m365/planner/commands/roster/roster-member-add.js +4 -1
- package/dist/m365/planner/commands/roster/roster-member-get.js +4 -1
- package/dist/m365/planner/commands/roster/roster-member-list.js +4 -1
- package/dist/m365/planner/commands/roster/roster-member-remove.js +4 -1
- package/dist/m365/planner/commands/roster/roster-plan-list.js +4 -1
- package/dist/m365/planner/commands/roster/roster-remove.js +4 -1
- package/dist/m365/planner/commands/task/task-add.js +4 -1
- package/dist/m365/planner/commands/task/task-checklistitem-add.js +4 -1
- package/dist/m365/planner/commands/task/task-checklistitem-list.js +4 -1
- package/dist/m365/planner/commands/task/task-checklistitem-remove.js +4 -1
- package/dist/m365/planner/commands/task/task-get.js +11 -3
- package/dist/m365/planner/commands/task/task-list.js +10 -2
- package/dist/m365/planner/commands/task/task-reference-add.js +4 -1
- package/dist/m365/planner/commands/task/task-reference-list.js +4 -1
- package/dist/m365/planner/commands/task/task-reference-remove.js +4 -1
- package/dist/m365/planner/commands/task/task-remove.js +10 -4
- package/dist/m365/planner/commands/task/task-set.js +4 -1
- package/dist/m365/pp/commands/aibuildermodel/aibuildermodel-get.js +4 -1
- package/dist/m365/pp/commands/card/card-get.js +3 -5
- package/dist/m365/pp/commands/chatbot/chatbot-get.js +3 -1
- package/dist/m365/pp/commands/managementapp/managementapp-add.js +4 -1
- package/dist/m365/search/commands/externalconnection/externalconnection-remove.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/{doctor-1.18.0-beta.5.js → doctor-1.18.0.js} +2 -2
- package/dist/m365/spfx/commands/project/project-doctor.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN001022_DEP_office_ui_fabric_react.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002028_DEVDEP_microsoft_rush_stack_compiler_4_7.js +13 -0
- package/dist/m365/spfx/commands/project/project-upgrade/{upgrade-1.18.0-beta.5.js → upgrade-1.18.0.js} +35 -27
- package/dist/m365/spfx/commands/project/project-upgrade.js +13 -15
- package/dist/m365/spfx/commands/spfx-doctor.js +3 -3
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-get.js +5 -3
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-remove.js +2 -2
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-set.js +3 -2
- package/dist/m365/spo/commands/commandset/commandset-get.js +4 -2
- package/dist/m365/spo/commands/commandset/commandset-remove.js +2 -1
- package/dist/m365/spo/commands/commandset/commandset-set.js +3 -1
- package/dist/m365/spo/commands/customaction/customaction-get.js +5 -2
- package/dist/m365/spo/commands/customaction/customaction-remove.js +3 -1
- package/dist/m365/spo/commands/eventreceiver/eventreceiver-get.js +3 -1
- package/dist/m365/spo/commands/file/file-get.js +11 -8
- package/dist/m365/spo/commands/file/file-remove.js +2 -2
- package/dist/m365/spo/commands/file/file-version-clear.js +2 -2
- package/dist/m365/spo/commands/file/file-version-get.js +2 -2
- package/dist/m365/spo/commands/file/file-version-list.js +2 -2
- package/dist/m365/spo/commands/file/file-version-remove.js +2 -2
- package/dist/m365/spo/commands/file/file-version-restore.js +2 -2
- package/dist/m365/spo/commands/group/group-member-add.js +24 -24
- package/dist/m365/spo/commands/hubsite/hubsite-connect.js +7 -4
- package/dist/m365/spo/commands/hubsite/hubsite-disconnect.js +4 -1
- package/dist/m365/spo/commands/hubsite/hubsite-get.js +3 -1
- package/dist/m365/spo/commands/listitem/listitem-add.js +1 -0
- package/dist/m365/spo/commands/listitem/listitem-set.js +3 -2
- package/dist/m365/spo/commands/page/clientsidepages.js +18 -0
- package/dist/m365/spo/commands/page/page-get.js +1 -0
- package/dist/m365/spo/commands/page/page-list.js +4 -3
- package/dist/m365/spo/commands/page/page-section-add.js +56 -21
- package/dist/m365/spo/commands/page/page-set.js +13 -2
- package/dist/m365/spo/commands/site/site-commsite-enable.js +34 -5
- package/dist/m365/spo/commands/site/site-list.js +5 -7
- package/dist/m365/spo/commands/tenant/tenant-appcatalog-add.js +1 -1
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-get.js +8 -3
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-list.js +3 -2
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-remove.js +2 -1
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-set.js +3 -2
- package/dist/m365/spo/commands/tenant/tenant-commandset-get.js +8 -3
- package/dist/m365/spo/commands/tenant/tenant-commandset-list.js +3 -2
- package/dist/m365/spo/commands/tenant/tenant-commandset-remove.js +3 -1
- package/dist/m365/spo/commands/term/term-get.js +6 -6
- package/dist/m365/teams/commands/app/app-remove.js +49 -15
- package/dist/m365/teams/commands/channel/channel-add.js +5 -1
- package/dist/m365/teams/commands/channel/channel-member-add.js +12 -10
- package/dist/m365/teams/commands/channel/channel-member-remove.js +3 -1
- package/dist/m365/teams/commands/channel/channel-member-set.js +4 -1
- package/dist/m365/teams/commands/chat/chat-get.js +7 -10
- package/dist/m365/teams/commands/chat/chat-message-send.js +8 -10
- package/dist/m365/teams/commands/team/team-clone.js +5 -10
- package/dist/m365/teams/commands/team/team-list.js +94 -30
- package/dist/m365/tenant/commands/info/info-get.js +83 -0
- package/dist/m365/tenant/commands.js +1 -0
- package/dist/utils/aadGroup.js +5 -3
- package/dist/utils/formatting.js +7 -0
- package/dist/utils/powerPlatform.js +1 -1
- package/docs/docs/cmd/aad/app/app-set.mdx +15 -15
- package/docs/docs/cmd/aad/approleassignment/approleassignment-add.mdx +9 -9
- package/docs/docs/cmd/aad/approleassignment/approleassignment-remove.mdx +10 -10
- package/docs/docs/cmd/aad/group/group-get.mdx +5 -5
- package/docs/docs/cmd/aad/group/group-list.mdx +0 -11
- package/docs/docs/cmd/aad/group/group-remove.mdx +44 -0
- package/docs/docs/cmd/aad/m365group/m365group-add.mdx +13 -3
- package/docs/docs/cmd/aad/policy/policy-list.mdx +5 -5
- package/docs/docs/cmd/cli/config/config-list.mdx +1 -1
- package/docs/docs/cmd/graph/subscription/subscription-add.mdx +10 -10
- package/docs/docs/cmd/pa/app/app-export.mdx +5 -5
- package/docs/docs/cmd/pp/solution/solution-publisher-get.mdx +2 -2
- package/docs/docs/cmd/pp/solution/solution-publisher-remove.mdx +2 -2
- package/docs/docs/cmd/spfx/project/project-upgrade.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-get.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-remove.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-version-clear.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-version-get.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-version-list.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-version-remove.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-version-restore.mdx +2 -2
- package/docs/docs/cmd/spo/group/group-member-add.mdx +27 -27
- package/docs/docs/cmd/spo/list/list-contenttype-remove.mdx +1 -1
- package/docs/docs/cmd/spo/listitem/listitem-add.mdx +2 -5
- package/docs/docs/cmd/spo/listitem/listitem-set.mdx +2 -5
- package/docs/docs/cmd/spo/page/page-get.mdx +0 -1
- package/docs/docs/cmd/spo/page/page-list.mdx +0 -1
- package/docs/docs/cmd/spo/page/page-section-add.mdx +25 -1
- package/docs/docs/cmd/spo/page/page-set.mdx +23 -0
- package/docs/docs/cmd/spo/site/site-commsite-enable.mdx +11 -2
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-list.mdx +2 -4
- package/docs/docs/cmd/spo/tenant/tenant-commandset-list.mdx +2 -4
- package/docs/docs/cmd/teams/app/app-remove.mdx +9 -6
- package/docs/docs/cmd/teams/channel/channel-member-add.mdx +4 -4
- package/docs/docs/cmd/teams/team/team-clone.mdx +3 -3
- package/docs/docs/cmd/teams/team/team-list.mdx +47 -22
- package/docs/docs/cmd/tenant/info/info-get.mdx +101 -0
- package/npm-shrinkwrap.json +24 -24
- package/package.json +8 -12
|
@@ -9,6 +9,8 @@ import { spo } from '../../../../utils/spo.js';
|
|
|
9
9
|
import { validation } from '../../../../utils/validation.js';
|
|
10
10
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
11
11
|
import commands from '../../commands.js';
|
|
12
|
+
import { Cli } from '../../../../cli/Cli.js';
|
|
13
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
12
14
|
class SpoHubSiteConnectCommand extends SpoCommand {
|
|
13
15
|
get name() {
|
|
14
16
|
return commands.HUBSITE_CONNECT;
|
|
@@ -31,8 +33,8 @@ class SpoHubSiteConnectCommand extends SpoCommand {
|
|
|
31
33
|
try {
|
|
32
34
|
const spoAdminUrl = await spo.getSpoAdminUrl(logger, this.debug);
|
|
33
35
|
const hubSites = await this.getHubSites(spoAdminUrl);
|
|
34
|
-
const hubSite = this.getSpecificHubSite(hubSites, args.options.id, args.options.title, args.options.url);
|
|
35
|
-
const parentHubSite = this.getSpecificHubSite(hubSites, args.options.parentId, args.options.parentTitle, args.options.parentUrl);
|
|
36
|
+
const hubSite = await this.getSpecificHubSite(hubSites, args.options.id, args.options.title, args.options.url);
|
|
37
|
+
const parentHubSite = await this.getSpecificHubSite(hubSites, args.options.parentId, args.options.parentTitle, args.options.parentUrl);
|
|
36
38
|
const requestOptions = {
|
|
37
39
|
url: `${spoAdminUrl}/_api/HubSites/GetById('${hubSite.ID}')`,
|
|
38
40
|
headers: {
|
|
@@ -61,7 +63,7 @@ class SpoHubSiteConnectCommand extends SpoCommand {
|
|
|
61
63
|
const hubSites = await request.get(requestOptions);
|
|
62
64
|
return hubSites.value;
|
|
63
65
|
}
|
|
64
|
-
getSpecificHubSite(hubSites, id, title, url) {
|
|
66
|
+
async getSpecificHubSite(hubSites, id, title, url) {
|
|
65
67
|
let filteredHubSites = [];
|
|
66
68
|
if (id) {
|
|
67
69
|
filteredHubSites = hubSites.filter(site => site.ID.toLowerCase() === id.toLowerCase());
|
|
@@ -76,7 +78,8 @@ class SpoHubSiteConnectCommand extends SpoCommand {
|
|
|
76
78
|
throw `The specified hub site '${id || title || url}' does not exist.`;
|
|
77
79
|
}
|
|
78
80
|
if (filteredHubSites.length > 1) {
|
|
79
|
-
|
|
81
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('ID', filteredHubSites);
|
|
82
|
+
return await Cli.handleMultipleResultsFound(`Multiple hub sites with name '${title}' found.`, resultAsKeyValuePair);
|
|
80
83
|
}
|
|
81
84
|
return filteredHubSites[0];
|
|
82
85
|
}
|
|
@@ -6,6 +6,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
6
6
|
var _SpoHubSiteDisconnectCommand_instances, _SpoHubSiteDisconnectCommand_initTelemetry, _SpoHubSiteDisconnectCommand_initOptions, _SpoHubSiteDisconnectCommand_initOptionSets, _SpoHubSiteDisconnectCommand_initValidators;
|
|
7
7
|
import { Cli } from '../../../../cli/Cli.js';
|
|
8
8
|
import request from '../../../../request.js';
|
|
9
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
9
10
|
import { spo } from '../../../../utils/spo.js';
|
|
10
11
|
import { validation } from '../../../../utils/validation.js';
|
|
11
12
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
@@ -91,7 +92,9 @@ class SpoHubSiteDisconnectCommand extends SpoCommand {
|
|
|
91
92
|
throw `The specified hub site '${options.title || options.url}' does not exist.`;
|
|
92
93
|
}
|
|
93
94
|
if (filteredHubSites.length > 1) {
|
|
94
|
-
|
|
95
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('ID', filteredHubSites);
|
|
96
|
+
const result = await Cli.handleMultipleResultsFound(`Multiple hub sites with name '${options.title}' found.`, resultAsKeyValuePair);
|
|
97
|
+
return result;
|
|
95
98
|
}
|
|
96
99
|
return filteredHubSites[0];
|
|
97
100
|
}
|
|
@@ -6,6 +6,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
6
6
|
var _SpoHubSiteGetCommand_instances, _SpoHubSiteGetCommand_initTelemetry, _SpoHubSiteGetCommand_initOptions, _SpoHubSiteGetCommand_initValidators, _SpoHubSiteGetCommand_initOptionSets;
|
|
7
7
|
import { Cli } from '../../../../cli/Cli.js';
|
|
8
8
|
import request from '../../../../request.js';
|
|
9
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
9
10
|
import { spo } from '../../../../utils/spo.js';
|
|
10
11
|
import { validation } from '../../../../utils/validation.js';
|
|
11
12
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
@@ -87,7 +88,8 @@ class SpoHubSiteGetCommand extends SpoCommand {
|
|
|
87
88
|
throw `The specified hub site ${options.title || options.url} does not exist`;
|
|
88
89
|
}
|
|
89
90
|
if (hubSites.length > 1) {
|
|
90
|
-
|
|
91
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('ID', hubSites);
|
|
92
|
+
return await Cli.handleMultipleResultsFound(`Multiple hub sites with ${options.title || options.url} found.`, resultAsKeyValuePair);
|
|
91
93
|
}
|
|
92
94
|
return hubSites[0];
|
|
93
95
|
}
|
|
@@ -188,8 +188,9 @@ class SpoListItemSetCommand extends SpoCommand {
|
|
|
188
188
|
},
|
|
189
189
|
responseType: 'json'
|
|
190
190
|
};
|
|
191
|
-
const
|
|
192
|
-
|
|
191
|
+
const item = await request.get(requestOptionsItems);
|
|
192
|
+
delete item.ID;
|
|
193
|
+
await logger.log(item);
|
|
193
194
|
}
|
|
194
195
|
catch (err) {
|
|
195
196
|
this.handleRejectedODataJsonPromise(err);
|
|
@@ -26,7 +26,25 @@ export var CanvasSectionTemplate;
|
|
|
26
26
|
/// Two columns, left one is 1/3, right one 2/3
|
|
27
27
|
/// </summary>
|
|
28
28
|
CanvasSectionTemplate[CanvasSectionTemplate["TwoColumnRight"] = 5] = "TwoColumnRight";
|
|
29
|
+
/// <summary>
|
|
30
|
+
/// Vertical
|
|
31
|
+
/// </summary>
|
|
32
|
+
CanvasSectionTemplate[CanvasSectionTemplate["Vertical"] = 6] = "Vertical";
|
|
29
33
|
})(CanvasSectionTemplate || (CanvasSectionTemplate = {}));
|
|
34
|
+
/**
|
|
35
|
+
* Section background shading
|
|
36
|
+
* 0 - None
|
|
37
|
+
* 1 - Neutral
|
|
38
|
+
* 2 - Soft
|
|
39
|
+
* 3 - Strong
|
|
40
|
+
*/
|
|
41
|
+
export var ZoneEmphasis;
|
|
42
|
+
(function (ZoneEmphasis) {
|
|
43
|
+
ZoneEmphasis[ZoneEmphasis["None"] = 0] = "None";
|
|
44
|
+
ZoneEmphasis[ZoneEmphasis["Neutral"] = 1] = "Neutral";
|
|
45
|
+
ZoneEmphasis[ZoneEmphasis["Soft"] = 2] = "Soft";
|
|
46
|
+
ZoneEmphasis[ZoneEmphasis["Strong"] = 3] = "Strong";
|
|
47
|
+
})(ZoneEmphasis || (ZoneEmphasis = {}));
|
|
30
48
|
/**
|
|
31
49
|
* Shorthand for Object.hasOwnProperty
|
|
32
50
|
*
|
|
@@ -34,9 +34,9 @@ class SpoPageListCommand extends SpoCommand {
|
|
|
34
34
|
if (pagesList && pagesList.length > 0) {
|
|
35
35
|
pages = pagesList;
|
|
36
36
|
}
|
|
37
|
-
const
|
|
38
|
-
if (
|
|
39
|
-
const clientSidePages =
|
|
37
|
+
const files = await odata.getAllItems(`${args.options.webUrl}/_api/web/lists/SitePages/rootfolder/files?$expand=ListItemAllFields/ClientSideApplicationId&$orderby=Name`);
|
|
38
|
+
if (files?.length > 0) {
|
|
39
|
+
const clientSidePages = files.filter(f => f.ListItemAllFields.ClientSideApplicationId === 'b6917cb1-93a0-4b97-a84d-7cf49975d4ec');
|
|
40
40
|
pages = pages.map(p => {
|
|
41
41
|
const clientSidePage = clientSidePages.find(cp => cp && cp.ListItemAllFields && cp.ListItemAllFields.Id === p.Id);
|
|
42
42
|
if (clientSidePage) {
|
|
@@ -47,6 +47,7 @@ class SpoPageListCommand extends SpoCommand {
|
|
|
47
47
|
}
|
|
48
48
|
return p;
|
|
49
49
|
});
|
|
50
|
+
pages.filter(p => p.ListItemAllFields).forEach(page => delete page.ListItemAllFields.ID);
|
|
50
51
|
await logger.log(pages);
|
|
51
52
|
}
|
|
52
53
|
}
|
|
@@ -3,13 +3,13 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
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
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _SpoPageSectionAddCommand_instances, _SpoPageSectionAddCommand_initTelemetry, _SpoPageSectionAddCommand_initOptions, _SpoPageSectionAddCommand_initValidators;
|
|
6
|
+
var _SpoPageSectionAddCommand_instances, _a, _SpoPageSectionAddCommand_initTelemetry, _SpoPageSectionAddCommand_initOptions, _SpoPageSectionAddCommand_initValidators;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
9
|
import { validation } from '../../../../utils/validation.js';
|
|
10
10
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
11
11
|
import commands from '../../commands.js';
|
|
12
|
-
import { CanvasSectionTemplate } from './clientsidepages.js';
|
|
12
|
+
import { CanvasSectionTemplate, ZoneEmphasis } from './clientsidepages.js';
|
|
13
13
|
class SpoPageSectionAddCommand extends SpoCommand {
|
|
14
14
|
get name() {
|
|
15
15
|
return commands.PAGE_SECTION_ADD;
|
|
@@ -67,7 +67,7 @@ class SpoPageSectionAddCommand extends SpoCommand {
|
|
|
67
67
|
// zoneIndex for the new section to add
|
|
68
68
|
const zoneIndex = this.getSectionIndex(zoneIndices, args.options.order);
|
|
69
69
|
// get the list of columns to insert based on the selected template
|
|
70
|
-
const columnsToAdd = this.getColumns(zoneIndex, args.options.sectionTemplate);
|
|
70
|
+
const columnsToAdd = this.getColumns(zoneIndex, args.options.sectionTemplate, args.options.zoneEmphasis, args.options.isLayoutReflowOnTop);
|
|
71
71
|
// insert the column in the right place in the array so that
|
|
72
72
|
// it stays sorted ascending by zoneIndex
|
|
73
73
|
let pos = canvasContent.findIndex(c => typeof c.controlType === 'undefined' && c.position.zoneIndex > zoneIndex);
|
|
@@ -107,39 +107,42 @@ class SpoPageSectionAddCommand extends SpoCommand {
|
|
|
107
107
|
}
|
|
108
108
|
return zoneIndices[order - 2] + ((zoneIndices[order - 1] - zoneIndices[order - 2]) / 2);
|
|
109
109
|
}
|
|
110
|
-
getColumns(zoneIndex, sectionTemplate) {
|
|
110
|
+
getColumns(zoneIndex, sectionTemplate, zoneEmphasis, isLayoutReflowOnTop) {
|
|
111
111
|
const columns = [];
|
|
112
112
|
let sectionIndex = 1;
|
|
113
113
|
switch (sectionTemplate) {
|
|
114
114
|
case 'OneColumnFullWidth':
|
|
115
|
-
columns.push(this.getColumn(zoneIndex, sectionIndex++, 0));
|
|
115
|
+
columns.push(this.getColumn(zoneIndex, sectionIndex++, 0, zoneEmphasis));
|
|
116
116
|
break;
|
|
117
117
|
case 'TwoColumn':
|
|
118
|
-
columns.push(this.getColumn(zoneIndex, sectionIndex++, 6));
|
|
119
|
-
columns.push(this.getColumn(zoneIndex, sectionIndex++, 6));
|
|
118
|
+
columns.push(this.getColumn(zoneIndex, sectionIndex++, 6, zoneEmphasis));
|
|
119
|
+
columns.push(this.getColumn(zoneIndex, sectionIndex++, 6, zoneEmphasis));
|
|
120
120
|
break;
|
|
121
121
|
case 'ThreeColumn':
|
|
122
|
-
columns.push(this.getColumn(zoneIndex, sectionIndex++, 4));
|
|
123
|
-
columns.push(this.getColumn(zoneIndex, sectionIndex++, 4));
|
|
124
|
-
columns.push(this.getColumn(zoneIndex, sectionIndex++, 4));
|
|
122
|
+
columns.push(this.getColumn(zoneIndex, sectionIndex++, 4, zoneEmphasis));
|
|
123
|
+
columns.push(this.getColumn(zoneIndex, sectionIndex++, 4, zoneEmphasis));
|
|
124
|
+
columns.push(this.getColumn(zoneIndex, sectionIndex++, 4, zoneEmphasis));
|
|
125
125
|
break;
|
|
126
126
|
case 'TwoColumnLeft':
|
|
127
|
-
columns.push(this.getColumn(zoneIndex, sectionIndex++, 8));
|
|
128
|
-
columns.push(this.getColumn(zoneIndex, sectionIndex++, 4));
|
|
127
|
+
columns.push(this.getColumn(zoneIndex, sectionIndex++, 8, zoneEmphasis));
|
|
128
|
+
columns.push(this.getColumn(zoneIndex, sectionIndex++, 4, zoneEmphasis));
|
|
129
129
|
break;
|
|
130
130
|
case 'TwoColumnRight':
|
|
131
|
-
columns.push(this.getColumn(zoneIndex, sectionIndex++, 4));
|
|
132
|
-
columns.push(this.getColumn(zoneIndex, sectionIndex++, 8));
|
|
131
|
+
columns.push(this.getColumn(zoneIndex, sectionIndex++, 4, zoneEmphasis));
|
|
132
|
+
columns.push(this.getColumn(zoneIndex, sectionIndex++, 8, zoneEmphasis));
|
|
133
|
+
break;
|
|
134
|
+
case 'Vertical':
|
|
135
|
+
columns.push(this.getVerticalColumn(zoneEmphasis, isLayoutReflowOnTop));
|
|
133
136
|
break;
|
|
134
137
|
case 'OneColumn':
|
|
135
138
|
default:
|
|
136
|
-
columns.push(this.getColumn(zoneIndex, sectionIndex++, 12));
|
|
139
|
+
columns.push(this.getColumn(zoneIndex, sectionIndex++, 12, zoneEmphasis));
|
|
137
140
|
break;
|
|
138
141
|
}
|
|
139
142
|
return columns;
|
|
140
143
|
}
|
|
141
|
-
getColumn(zoneIndex, sectionIndex, sectionFactor) {
|
|
142
|
-
|
|
144
|
+
getColumn(zoneIndex, sectionIndex, sectionFactor, zoneEmphasis) {
|
|
145
|
+
const columnValue = {
|
|
143
146
|
displayMode: 2,
|
|
144
147
|
position: {
|
|
145
148
|
zoneIndex: zoneIndex,
|
|
@@ -149,12 +152,26 @@ class SpoPageSectionAddCommand extends SpoCommand {
|
|
|
149
152
|
},
|
|
150
153
|
emphasis: {}
|
|
151
154
|
};
|
|
155
|
+
if (zoneEmphasis) {
|
|
156
|
+
const zoneEmphasisValue = ZoneEmphasis[zoneEmphasis];
|
|
157
|
+
columnValue.emphasis = { zoneEmphasis: zoneEmphasisValue };
|
|
158
|
+
}
|
|
159
|
+
return columnValue;
|
|
160
|
+
}
|
|
161
|
+
getVerticalColumn(zoneEmphasis, isLayoutReflowOnTop) {
|
|
162
|
+
const columnValue = this.getColumn(1, 1, 12, zoneEmphasis);
|
|
163
|
+
columnValue.position.isLayoutReflowOnTop = isLayoutReflowOnTop !== undefined ? true : false;
|
|
164
|
+
columnValue.position.layoutIndex = 2;
|
|
165
|
+
columnValue.position.controlIndex = 1;
|
|
166
|
+
return columnValue;
|
|
152
167
|
}
|
|
153
168
|
}
|
|
154
|
-
_SpoPageSectionAddCommand_instances = new WeakSet(), _SpoPageSectionAddCommand_initTelemetry = function _SpoPageSectionAddCommand_initTelemetry() {
|
|
169
|
+
_a = SpoPageSectionAddCommand, _SpoPageSectionAddCommand_instances = new WeakSet(), _SpoPageSectionAddCommand_initTelemetry = function _SpoPageSectionAddCommand_initTelemetry() {
|
|
155
170
|
this.telemetry.push((args) => {
|
|
156
171
|
Object.assign(this.telemetryProperties, {
|
|
157
|
-
order: typeof args.options.order !== 'undefined'
|
|
172
|
+
order: typeof args.options.order !== 'undefined',
|
|
173
|
+
zoneEmphasis: typeof args.options.zoneEmphasis !== 'undefined',
|
|
174
|
+
isLayoutReflowOnTop: !!args.options.isLayoutReflowOnTop
|
|
158
175
|
});
|
|
159
176
|
});
|
|
160
177
|
}, _SpoPageSectionAddCommand_initOptions = function _SpoPageSectionAddCommand_initOptions() {
|
|
@@ -163,22 +180,40 @@ _SpoPageSectionAddCommand_instances = new WeakSet(), _SpoPageSectionAddCommand_i
|
|
|
163
180
|
}, {
|
|
164
181
|
option: '-u, --webUrl <webUrl>'
|
|
165
182
|
}, {
|
|
166
|
-
option: '-t, --sectionTemplate <sectionTemplate>'
|
|
183
|
+
option: '-t, --sectionTemplate <sectionTemplate>',
|
|
184
|
+
autocomplete: _a.SectionTemplate
|
|
167
185
|
}, {
|
|
168
186
|
option: '--order [order]'
|
|
187
|
+
}, {
|
|
188
|
+
option: '--zoneEmphasis [zoneEmphasis]',
|
|
189
|
+
autocomplete: _a.ZoneEmphasis
|
|
190
|
+
}, {
|
|
191
|
+
option: '--isLayoutReflowOnTop'
|
|
169
192
|
});
|
|
170
193
|
}, _SpoPageSectionAddCommand_initValidators = function _SpoPageSectionAddCommand_initValidators() {
|
|
171
194
|
this.validators.push(async (args) => {
|
|
172
195
|
if (!(args.options.sectionTemplate in CanvasSectionTemplate)) {
|
|
173
|
-
return `${args.options.sectionTemplate} is not a valid section template. Allowed values are OneColumn|OneColumnFullWidth|TwoColumn|ThreeColumn|TwoColumnLeft|TwoColumnRight`;
|
|
196
|
+
return `${args.options.sectionTemplate} is not a valid section template. Allowed values are OneColumn|OneColumnFullWidth|TwoColumn|ThreeColumn|TwoColumnLeft|TwoColumnRight|Vertical`;
|
|
174
197
|
}
|
|
175
198
|
if (typeof args.options.order !== 'undefined') {
|
|
176
199
|
if (!Number.isInteger(args.options.order) || args.options.order < 1) {
|
|
177
200
|
return 'The value of parameter order must be 1 or higher';
|
|
178
201
|
}
|
|
179
202
|
}
|
|
203
|
+
if (typeof args.options.zoneEmphasis !== 'undefined') {
|
|
204
|
+
if (!(args.options.zoneEmphasis in ZoneEmphasis)) {
|
|
205
|
+
return 'The value of parameter zoneEmphasis must be None|Neutral|Soft|Strong';
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
if (typeof args.options.isLayoutReflowOnTop !== 'undefined') {
|
|
209
|
+
if (args.options.sectionTemplate !== 'Vertical') {
|
|
210
|
+
return 'Specify isLayoutReflowOnTop when the sectionTemplate is set to Vertical.';
|
|
211
|
+
}
|
|
212
|
+
}
|
|
180
213
|
return validation.isValidSharePointUrl(args.options.webUrl);
|
|
181
214
|
});
|
|
182
215
|
};
|
|
216
|
+
SpoPageSectionAddCommand.SectionTemplate = ['OneColumn', 'OneColumnFullWidth', 'TwoColumn', 'ThreeColumn', 'TwoColumnLeft', 'TwoColumnRight', 'Vertical'];
|
|
217
|
+
SpoPageSectionAddCommand.ZoneEmphasis = ['None', 'Neutral', 'Soft', 'Strong'];
|
|
183
218
|
export default new SpoPageSectionAddCommand();
|
|
184
219
|
//# sourceMappingURL=page-section-add.js.map
|
|
@@ -58,7 +58,7 @@ class SpoPageSetCommand extends SpoCommand {
|
|
|
58
58
|
pageTitle = pageTitle || page.Title;
|
|
59
59
|
pageId = page.Id;
|
|
60
60
|
bannerImageUrl = page.BannerImageUrl;
|
|
61
|
-
canvasContent1 = page.CanvasContent1;
|
|
61
|
+
canvasContent1 = args.options.content || page.CanvasContent1;
|
|
62
62
|
layoutWebpartsContent = page.LayoutWebpartsContent;
|
|
63
63
|
pageDescription = pageDescription || page.Description;
|
|
64
64
|
topicHeader = page.TopicHeader;
|
|
@@ -277,7 +277,8 @@ _SpoPageSetCommand_instances = new WeakSet(), _SpoPageSetCommand_initTelemetry =
|
|
|
277
277
|
publish: args.options.publish || false,
|
|
278
278
|
publishMessage: typeof args.options.publishMessage !== 'undefined',
|
|
279
279
|
description: typeof args.options.description !== 'undefined',
|
|
280
|
-
title: typeof args.options.title !== 'undefined'
|
|
280
|
+
title: typeof args.options.title !== 'undefined',
|
|
281
|
+
content: typeof args.options.content !== 'undefined'
|
|
281
282
|
});
|
|
282
283
|
});
|
|
283
284
|
}, _SpoPageSetCommand_initOptions = function _SpoPageSetCommand_initOptions() {
|
|
@@ -305,6 +306,8 @@ _SpoPageSetCommand_instances = new WeakSet(), _SpoPageSetCommand_initTelemetry =
|
|
|
305
306
|
option: '--description [description]'
|
|
306
307
|
}, {
|
|
307
308
|
option: '--title [title]'
|
|
309
|
+
}, {
|
|
310
|
+
option: '--content [content]'
|
|
308
311
|
});
|
|
309
312
|
}, _SpoPageSetCommand_initTypes = function _SpoPageSetCommand_initTypes() {
|
|
310
313
|
this.types.boolean.push('commentsEnabled');
|
|
@@ -332,6 +335,14 @@ _SpoPageSetCommand_instances = new WeakSet(), _SpoPageSetCommand_initTelemetry =
|
|
|
332
335
|
if (args.options.promoteAs === 'NewsPage' && args.options.layoutType && args.options.layoutType !== 'Article') {
|
|
333
336
|
return 'You can only promote article pages as news article';
|
|
334
337
|
}
|
|
338
|
+
if (args.options.content) {
|
|
339
|
+
try {
|
|
340
|
+
JSON.parse(args.options.content);
|
|
341
|
+
}
|
|
342
|
+
catch (e) {
|
|
343
|
+
return `Specified content is not a valid JSON string. Input: ${args.options.content}. Error: ${e}`;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
335
346
|
return true;
|
|
336
347
|
});
|
|
337
348
|
};
|
|
@@ -3,7 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
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
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _SpoSiteCommSiteEnableCommand_instances, _SpoSiteCommSiteEnableCommand_initTelemetry, _SpoSiteCommSiteEnableCommand_initOptions, _SpoSiteCommSiteEnableCommand_initValidators;
|
|
6
|
+
var _SpoSiteCommSiteEnableCommand_instances, _SpoSiteCommSiteEnableCommand_initTelemetry, _SpoSiteCommSiteEnableCommand_initOptions, _SpoSiteCommSiteEnableCommand_initOptionSets, _SpoSiteCommSiteEnableCommand_initValidators;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { validation } from '../../../../utils/validation.js';
|
|
9
9
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
@@ -21,11 +21,12 @@ class SpoSiteCommSiteEnableCommand extends SpoCommand {
|
|
|
21
21
|
__classPrivateFieldGet(this, _SpoSiteCommSiteEnableCommand_instances, "m", _SpoSiteCommSiteEnableCommand_initTelemetry).call(this);
|
|
22
22
|
__classPrivateFieldGet(this, _SpoSiteCommSiteEnableCommand_instances, "m", _SpoSiteCommSiteEnableCommand_initOptions).call(this);
|
|
23
23
|
__classPrivateFieldGet(this, _SpoSiteCommSiteEnableCommand_instances, "m", _SpoSiteCommSiteEnableCommand_initValidators).call(this);
|
|
24
|
+
__classPrivateFieldGet(this, _SpoSiteCommSiteEnableCommand_instances, "m", _SpoSiteCommSiteEnableCommand_initOptionSets).call(this);
|
|
24
25
|
}
|
|
25
26
|
async commandAction(logger, args) {
|
|
26
|
-
const designPackageId = args.options
|
|
27
|
+
const designPackageId = this.getDesignPackageId(args.options);
|
|
27
28
|
if (this.verbose) {
|
|
28
|
-
logger.logToStderr(`Enabling communication site at ${args.options.url}...`);
|
|
29
|
+
logger.logToStderr(`Enabling communication site with design package '${designPackageId}' at '${args.options.url}'...`);
|
|
29
30
|
}
|
|
30
31
|
try {
|
|
31
32
|
const requestOptions = {
|
|
@@ -42,11 +43,26 @@ class SpoSiteCommSiteEnableCommand extends SpoCommand {
|
|
|
42
43
|
this.handleRejectedODataJsonPromise(err);
|
|
43
44
|
}
|
|
44
45
|
}
|
|
46
|
+
getDesignPackageId(options) {
|
|
47
|
+
if (options.designPackageId) {
|
|
48
|
+
return options.designPackageId;
|
|
49
|
+
}
|
|
50
|
+
switch (options.designPackage) {
|
|
51
|
+
case 'Blank':
|
|
52
|
+
return 'f6cc5403-0d63-442e-96c0-285923709ffc';
|
|
53
|
+
case 'Showcase':
|
|
54
|
+
return '6142d2a0-63a5-4ba0-aede-d9fefca2c767';
|
|
55
|
+
case 'Topic':
|
|
56
|
+
default:
|
|
57
|
+
return '96c933ac-3698-44c7-9f4a-5fd17d71af9e';
|
|
58
|
+
}
|
|
59
|
+
}
|
|
45
60
|
}
|
|
46
61
|
_SpoSiteCommSiteEnableCommand_instances = new WeakSet(), _SpoSiteCommSiteEnableCommand_initTelemetry = function _SpoSiteCommSiteEnableCommand_initTelemetry() {
|
|
47
62
|
this.telemetry.push((args) => {
|
|
48
63
|
Object.assign(this.telemetryProperties, {
|
|
49
|
-
designPackageId: typeof args.options.designPackageId !== 'undefined'
|
|
64
|
+
designPackageId: typeof args.options.designPackageId !== 'undefined',
|
|
65
|
+
designPackage: typeof args.options.designPackage !== 'undefined'
|
|
50
66
|
});
|
|
51
67
|
});
|
|
52
68
|
}, _SpoSiteCommSiteEnableCommand_initOptions = function _SpoSiteCommSiteEnableCommand_initOptions() {
|
|
@@ -54,12 +70,25 @@ _SpoSiteCommSiteEnableCommand_instances = new WeakSet(), _SpoSiteCommSiteEnableC
|
|
|
54
70
|
option: '-u, --url <url>'
|
|
55
71
|
}, {
|
|
56
72
|
option: '-i, --designPackageId [designPackageId]'
|
|
73
|
+
}, {
|
|
74
|
+
option: '-p, --designPackage [designPackage]',
|
|
75
|
+
autocomplete: ["Topic", "Showcase", "Blank"]
|
|
76
|
+
});
|
|
77
|
+
}, _SpoSiteCommSiteEnableCommand_initOptionSets = function _SpoSiteCommSiteEnableCommand_initOptionSets() {
|
|
78
|
+
this.optionSets.push({
|
|
79
|
+
options: ['designPackageId', 'designPackage'],
|
|
80
|
+
runsWhen: (args) => args.options.designPackageId || args.options.designPackage
|
|
57
81
|
});
|
|
58
82
|
}, _SpoSiteCommSiteEnableCommand_initValidators = function _SpoSiteCommSiteEnableCommand_initValidators() {
|
|
59
83
|
this.validators.push(async (args) => {
|
|
60
84
|
if (args.options.designPackageId &&
|
|
61
85
|
!validation.isValidGuid(args.options.designPackageId)) {
|
|
62
|
-
return `${args.options.designPackageId} is not a valid GUID
|
|
86
|
+
return `${args.options.designPackageId} is not a valid GUID.`;
|
|
87
|
+
}
|
|
88
|
+
if (args.options.designPackage) {
|
|
89
|
+
if (['Topic', 'Showcase', 'Blank'].indexOf(args.options.designPackage) === -1) {
|
|
90
|
+
return `${args.options.designPackage} is not a valid designPackage. Allowed values are Topic|Showcase|Blank`;
|
|
91
|
+
}
|
|
63
92
|
}
|
|
64
93
|
return validation.isValidSharePointUrl(args.options.url);
|
|
65
94
|
});
|
|
@@ -54,16 +54,14 @@ class SpoSiteListCommand extends SpoCommand {
|
|
|
54
54
|
},
|
|
55
55
|
data: requestBody
|
|
56
56
|
};
|
|
57
|
-
const
|
|
58
|
-
const json = JSON.parse(
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
throw response.ErrorInfo.ErrorMessage;
|
|
57
|
+
const response = await request.post(requestOptions);
|
|
58
|
+
const json = JSON.parse(response);
|
|
59
|
+
const responseContent = json[0];
|
|
60
|
+
if (responseContent.ErrorInfo) {
|
|
61
|
+
throw responseContent.ErrorInfo.ErrorMessage;
|
|
63
62
|
}
|
|
64
63
|
else {
|
|
65
64
|
const sites = json[json.length - 1];
|
|
66
|
-
logger.log(sites);
|
|
67
65
|
this.allSites.push(...sites._Child_Items_);
|
|
68
66
|
if (sites.NextStartIndexFromSharePoint) {
|
|
69
67
|
await this.getAllSites(spoAdminUrl, filter, sites.NextStartIndexFromSharePoint, personalSite, webTemplate, formDigest, logger);
|
|
@@ -11,6 +11,7 @@ import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
|
11
11
|
import { validation } from '../../../../utils/validation.js';
|
|
12
12
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
13
13
|
import commands from '../../commands.js';
|
|
14
|
+
import { Cli } from '../../../../cli/Cli.js';
|
|
14
15
|
class SpoTenantApplicationCustomizerGetCommand extends SpoCommand {
|
|
15
16
|
get name() {
|
|
16
17
|
return commands.TENANT_APPLICATIONCUSTOMIZER_GET;
|
|
@@ -48,11 +49,15 @@ class SpoTenantApplicationCustomizerGetCommand extends SpoCommand {
|
|
|
48
49
|
if (listItemInstances.length === 0) {
|
|
49
50
|
throw 'The specified application customizer was not found';
|
|
50
51
|
}
|
|
52
|
+
listItemInstances.forEach(v => delete v['ID']);
|
|
51
53
|
if (listItemInstances.length > 1) {
|
|
52
|
-
|
|
54
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('Id', listItemInstances);
|
|
55
|
+
const result = await Cli.handleMultipleResultsFound(`Multiple application customizers with ${args.options.title || args.options.clientSideComponentId} were found.`, resultAsKeyValuePair);
|
|
56
|
+
await logger.log(result);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
await logger.log(listItemInstances[0]);
|
|
53
60
|
}
|
|
54
|
-
listItemInstances.forEach(v => delete v['ID']);
|
|
55
|
-
await logger.log(listItemInstances[0]);
|
|
56
61
|
}
|
|
57
62
|
else {
|
|
58
63
|
throw 'The specified application customizer was not found';
|
|
@@ -22,8 +22,9 @@ class SpoTenantApplicationCustomizerListCommand extends SpoCommand {
|
|
|
22
22
|
}
|
|
23
23
|
const listServerRelativeUrl = urlUtil.getServerRelativePath(appCatalogUrl, '/lists/TenantWideExtensions');
|
|
24
24
|
try {
|
|
25
|
-
const
|
|
26
|
-
|
|
25
|
+
const listItems = await odata.getAllItems(`${appCatalogUrl}/_api/web/GetList('${formatting.encodeQueryParameter(listServerRelativeUrl)}')/items?$filter=TenantWideExtensionLocation eq 'ClientSideExtension.ApplicationCustomizer'`);
|
|
26
|
+
listItems.forEach(i => delete i.ID);
|
|
27
|
+
await logger.log(listItems);
|
|
27
28
|
}
|
|
28
29
|
catch (err) {
|
|
29
30
|
this.handleRejectedODataJsonPromise(err);
|
|
@@ -66,7 +66,8 @@ class SpoTenantApplicationCustomizerRemoveCommand extends SpoCommand {
|
|
|
66
66
|
throw 'The specified application customizer was not found';
|
|
67
67
|
}
|
|
68
68
|
if (listItemInstances.length > 1) {
|
|
69
|
-
|
|
69
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('Id', listItemInstances);
|
|
70
|
+
listItemInstances[0] = await Cli.handleMultipleResultsFound(`Multiple application customizers with ${args.options.title || args.options.clientSideComponentId} were found.`, resultAsKeyValuePair);
|
|
70
71
|
}
|
|
71
72
|
return listItemInstances[0].Id;
|
|
72
73
|
}
|
|
@@ -4,7 +4,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
6
|
var _SpoTenantApplicationCustomizerSetCommand_instances, _SpoTenantApplicationCustomizerSetCommand_initTelemetry, _SpoTenantApplicationCustomizerSetCommand_initOptions, _SpoTenantApplicationCustomizerSetCommand_initValidators, _SpoTenantApplicationCustomizerSetCommand_initOptionSets;
|
|
7
|
-
import os from 'os';
|
|
8
7
|
import { Cli } from '../../../../cli/Cli.js';
|
|
9
8
|
import request from '../../../../request.js';
|
|
10
9
|
import { formatting } from '../../../../utils/formatting.js';
|
|
@@ -69,7 +68,9 @@ class SpoTenantApplicationCustomizerSetCommand extends SpoCommand {
|
|
|
69
68
|
throw 'The specified application customizer was not found';
|
|
70
69
|
}
|
|
71
70
|
if (listItemInstances.length > 1) {
|
|
72
|
-
|
|
71
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('Id', listItemInstances);
|
|
72
|
+
const result = await Cli.handleMultipleResultsFound(`Multiple application customizers with ${title ? `title '${title}'` : `ClientSideComponentId '${clientSideComponentId}'`} found.`, resultAsKeyValuePair);
|
|
73
|
+
return result.Id;
|
|
73
74
|
}
|
|
74
75
|
return listItemInstances[0].Id;
|
|
75
76
|
}
|
|
@@ -4,6 +4,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
6
|
var _SpoTenantCommandSetGetCommand_instances, _SpoTenantCommandSetGetCommand_initTelemetry, _SpoTenantCommandSetGetCommand_initOptions, _SpoTenantCommandSetGetCommand_initValidators, _SpoTenantCommandSetGetCommand_initOptionSets;
|
|
7
|
+
import { Cli } from '../../../../cli/Cli.js';
|
|
7
8
|
import { CommandError } from '../../../../Command.js';
|
|
8
9
|
import request from '../../../../request.js';
|
|
9
10
|
import { formatting } from '../../../../utils/formatting.js';
|
|
@@ -53,11 +54,15 @@ class SpoTenantCommandSetGetCommand extends SpoCommand {
|
|
|
53
54
|
try {
|
|
54
55
|
const listItemInstances = await request.get(reqOptions);
|
|
55
56
|
if (listItemInstances?.value.length > 0) {
|
|
57
|
+
listItemInstances.value.forEach(v => delete v['ID']);
|
|
56
58
|
if (listItemInstances.value.length > 1) {
|
|
57
|
-
|
|
59
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('Id', listItemInstances.value);
|
|
60
|
+
const result = await Cli.handleMultipleResultsFound(`Multiple ListView Command Sets with ${args.options.title || args.options.clientSideComponentId} were found.`, resultAsKeyValuePair);
|
|
61
|
+
await logger.log(result);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
await logger.log(listItemInstances.value[0]);
|
|
58
65
|
}
|
|
59
|
-
listItemInstances.value.forEach(v => delete v['ID']);
|
|
60
|
-
await logger.log(listItemInstances.value[0]);
|
|
61
66
|
}
|
|
62
67
|
else {
|
|
63
68
|
throw 'The specified ListView Command Set was not found';
|
|
@@ -25,8 +25,9 @@ class SpoTenantCommandSetListCommand extends SpoCommand {
|
|
|
25
25
|
}
|
|
26
26
|
const listServerRelativeUrl = urlUtil.getServerRelativePath(appCatalogUrl, '/lists/TenantWideExtensions');
|
|
27
27
|
try {
|
|
28
|
-
const
|
|
29
|
-
|
|
28
|
+
const listItems = await odata.getAllItems(`${appCatalogUrl}/_api/web/GetList('${formatting.encodeQueryParameter(listServerRelativeUrl)}')/items?$filter=startswith(TenantWideExtensionLocation, 'ClientSideExtension.ListViewCommandSet')`);
|
|
29
|
+
listItems.forEach(i => delete i.ID);
|
|
30
|
+
await logger.log(listItems);
|
|
30
31
|
}
|
|
31
32
|
catch (err) {
|
|
32
33
|
this.handleRejectedODataJsonPromise(err);
|
|
@@ -90,7 +90,9 @@ class SpoTenantCommandSetRemoveCommand extends SpoCommand {
|
|
|
90
90
|
throw 'The specified command set was not found';
|
|
91
91
|
}
|
|
92
92
|
if (listItemInstances.length > 1) {
|
|
93
|
-
|
|
93
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('Id', listItemInstances);
|
|
94
|
+
const result = await Cli.handleMultipleResultsFound(`Multiple command sets with ${args.options.title || args.options.clientSideComponentId} were found.`, resultAsKeyValuePair);
|
|
95
|
+
return result.Id;
|
|
94
96
|
}
|
|
95
97
|
return listItemInstances[0].Id;
|
|
96
98
|
}
|
|
@@ -4,7 +4,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
6
|
var _SpoTermGetCommand_instances, _SpoTermGetCommand_initTelemetry, _SpoTermGetCommand_initOptions, _SpoTermGetCommand_initValidators, _SpoTermGetCommand_initOptionSets;
|
|
7
|
-
import
|
|
7
|
+
import { Cli } from '../../../../cli/Cli.js';
|
|
8
8
|
import config from '../../../../config.js';
|
|
9
9
|
import request from '../../../../request.js';
|
|
10
10
|
import { formatting } from '../../../../utils/formatting.js';
|
|
@@ -52,12 +52,12 @@ class SpoTermGetCommand extends SpoCommand {
|
|
|
52
52
|
throw `Term with name '${args.options.name}' could not be found.`;
|
|
53
53
|
}
|
|
54
54
|
if (terms._Child_Items_.length > 1) {
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('Id', terms._Child_Items_);
|
|
56
|
+
term = await Cli.handleMultipleResultsFound(`Multiple terms with the specific term name found.`, resultAsKeyValuePair);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
term = terms._Child_Items_[0];
|
|
59
60
|
}
|
|
60
|
-
term = terms._Child_Items_[0];
|
|
61
61
|
}
|
|
62
62
|
else {
|
|
63
63
|
term = csomResponse;
|