@pnp/cli-microsoft365 6.8.0-beta.9f8a015 → 6.8.0-beta.bb09db9
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 +2 -0
- package/dist/m365/commands/commands.js +1 -0
- package/dist/m365/commands/docs.js +42 -0
- package/dist/m365/commands/login.js +1 -1
- package/dist/m365/pa/commands/app/app-consent-set.js +101 -0
- package/dist/m365/pa/commands.js +1 -0
- package/dist/m365/purview/commands/sensitivitylabel/sensitivitylabel-get.js +97 -0
- package/dist/m365/purview/commands/sensitivitylabel/sensitivitylabel-list.js +85 -0
- package/dist/m365/purview/commands/sensitivitylabel/sensitivitylabel-policysettings-list.js +89 -0
- package/dist/m365/purview/commands.js +3 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.15.2.js +2 -0
- package/dist/m365/spo/commands/file/file-list.js +15 -4
- package/dist/m365/spo/commands/file/file-remove.js +3 -0
- package/dist/m365/spo/commands/list/list-get.js +30 -3
- package/dist/m365/spo/commands/list/list-list.js +39 -2
- package/dist/m365/spo/commands/page/page-section-add.js +2 -3
- package/dist/m365/spo/commands/term/term-add.js +13 -4
- package/dist/m365/spo/commands/term/term-get.js +14 -5
- package/dist/m365/spo/commands/term/term-group-get.js +12 -3
- package/dist/m365/spo/commands/term/term-group-list.js +39 -4
- package/dist/m365/spo/commands/term/term-list.js +18 -9
- package/dist/m365/spo/commands/term/term-set-add.js +13 -4
- package/dist/m365/spo/commands/term/term-set-get.js +12 -3
- package/dist/m365/spo/commands/term/term-set-list.js +12 -3
- package/dist/m365/spo/commands.js +1 -0
- package/docs/docs/cmd/aad/o365group/o365group-get.md +0 -12
- package/docs/docs/cmd/docs.md +51 -0
- package/docs/docs/cmd/flow/environment/environment-list.md +18 -0
- package/docs/docs/cmd/flow/flow-get.md +20 -0
- package/docs/docs/cmd/flow/flow-list.md +17 -0
- package/docs/docs/cmd/pa/app/app-consent-set.md +47 -0
- package/docs/docs/cmd/planner/task/task-get.md +0 -6
- package/docs/docs/cmd/purview/sensitivitylabel/sensitivitylabel-get.md +118 -0
- package/docs/docs/cmd/purview/sensitivitylabel/sensitivitylabel-list.md +111 -0
- package/docs/docs/cmd/purview/sensitivitylabel/sensitivitylabel-policysettings-list.md +97 -0
- package/docs/docs/cmd/spo/file/file-list.md +9 -6
- package/docs/docs/cmd/spo/file/file-remove.md +12 -0
- package/docs/docs/cmd/spo/list/list-get.md +10 -0
- package/docs/docs/cmd/spo/list/list-list.md +28 -0
- package/docs/docs/cmd/spo/term/term-add.md +107 -6
- package/docs/docs/cmd/spo/term/term-get.md +111 -10
- package/docs/docs/cmd/spo/term/term-group-get.md +71 -5
- package/docs/docs/cmd/spo/term/term-group-list.md +70 -2
- package/docs/docs/cmd/spo/term/term-list.md +80 -8
- package/docs/docs/cmd/spo/term/term-set-add.md +95 -11
- package/docs/docs/cmd/spo/term/term-set-get.md +92 -8
- package/docs/docs/cmd/spo/term/term-set-list.md +85 -5
- package/docs/docs/cmd/teams/app/app-list.md +17 -0
- package/docs/docs/cmd/teams/app/app-publish.md +18 -1
- package/docs/docs/cmd/teams/channel/channel-add.md +20 -0
- package/docs/docs/cmd/teams/channel/channel-get.md +21 -0
- package/docs/docs/cmd/teams/channel/channel-list.md +21 -0
- package/docs/docs/cmd/teams/channel/channel-member-list.md +20 -0
- package/docs/docs/cmd/teams/channel/channel-member-set.md +21 -0
- package/docs/docs/cmd/teams/chat/chat-get.md +22 -0
- package/docs/docs/cmd/teams/chat/chat-list.md +22 -0
- package/docs/docs/cmd/teams/chat/chat-member-list.md +20 -0
- package/docs/docs/cmd/teams/chat/chat-message-list.md +23 -0
- package/docs/docs/cmd/teams/funsettings/funsettings-list.md +15 -0
- package/docs/docs/cmd/teams/guestsettings/guestsettings-list.md +13 -0
- package/docs/docs/cmd/teams/membersettings/membersettings-list.md +17 -0
- package/docs/docs/cmd/yammer/group/group-list.md +42 -0
- package/docs/docs/cmd/yammer/message/message-add.md +32 -0
- package/docs/docs/cmd/yammer/message/message-get.md +32 -0
- package/docs/docs/cmd/yammer/message/message-list.md +34 -0
- package/docs/docs/cmd/yammer/network/network-list.md +70 -0
- package/docs/docs/cmd/yammer/report/report-activitycounts.md +7 -0
- package/docs/docs/cmd/yammer/report/report-activityusercounts.md +7 -0
- package/docs/docs/cmd/yammer/report/report-activityuserdetail.md +7 -0
- package/docs/docs/cmd/yammer/report/report-deviceusagedistributionusercounts.md +7 -0
- package/docs/docs/cmd/yammer/report/report-deviceusageusercounts.md +7 -0
- package/docs/docs/cmd/yammer/report/report-deviceusageuserdetail.md +7 -0
- package/docs/docs/cmd/yammer/report/report-groupsactivitycounts.md +7 -0
- package/docs/docs/cmd/yammer/report/report-groupsactivitydetail.md +7 -0
- package/docs/docs/cmd/yammer/report/report-groupsactivitygroupcounts.md +7 -0
- package/docs/docs/cmd/yammer/user/user-get.md +55 -0
- package/docs/docs/cmd/yammer/user/user-list.md +55 -0
- package/docs/docs/cmd/yammer/yammer-search.md +15 -3
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
13
13
|
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");
|
|
14
14
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15
15
|
};
|
|
16
|
-
var _SpoListListCommand_instances, _SpoListListCommand_initOptions, _SpoListListCommand_initValidators;
|
|
16
|
+
var _SpoListListCommand_instances, _SpoListListCommand_initOptions, _SpoListListCommand_initValidators, _SpoListListCommand_initTelemetry;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const odata_1 = require("../../../../utils/odata");
|
|
19
19
|
const validation_1 = require("../../../../utils/validation");
|
|
@@ -34,6 +34,7 @@ class SpoListListCommand extends SpoCommand_1.default {
|
|
|
34
34
|
_SpoListListCommand_instances.add(this);
|
|
35
35
|
__classPrivateFieldGet(this, _SpoListListCommand_instances, "m", _SpoListListCommand_initOptions).call(this);
|
|
36
36
|
__classPrivateFieldGet(this, _SpoListListCommand_instances, "m", _SpoListListCommand_initValidators).call(this);
|
|
37
|
+
__classPrivateFieldGet(this, _SpoListListCommand_instances, "m", _SpoListListCommand_initTelemetry).call(this);
|
|
37
38
|
}
|
|
38
39
|
commandAction(logger, args) {
|
|
39
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -41,7 +42,12 @@ class SpoListListCommand extends SpoCommand_1.default {
|
|
|
41
42
|
logger.logToStderr(`Retrieving all lists in site at ${args.options.webUrl}...`);
|
|
42
43
|
}
|
|
43
44
|
try {
|
|
44
|
-
const
|
|
45
|
+
const fieldProperties = this.formatSelectProperties(args.options.properties);
|
|
46
|
+
const queryParams = [`$expand=${fieldProperties.expandProperties.join(',')}`, `$select=${fieldProperties.selectProperties.join(',')}`];
|
|
47
|
+
if (args.options.filter) {
|
|
48
|
+
queryParams.push(`$filter=${args.options.filter}`);
|
|
49
|
+
}
|
|
50
|
+
const listInstances = yield odata_1.odata.getAllItems(`${args.options.webUrl}/_api/web/lists?${queryParams.join('&')}`);
|
|
45
51
|
listInstances.forEach(l => {
|
|
46
52
|
l.Url = l.RootFolder.ServerRelativeUrl;
|
|
47
53
|
});
|
|
@@ -52,13 +58,44 @@ class SpoListListCommand extends SpoCommand_1.default {
|
|
|
52
58
|
}
|
|
53
59
|
});
|
|
54
60
|
}
|
|
61
|
+
formatSelectProperties(fields) {
|
|
62
|
+
const selectProperties = ['RootFolder/ServerRelativeUrl'];
|
|
63
|
+
const expandProperties = ['RootFolder'];
|
|
64
|
+
if (!fields) {
|
|
65
|
+
selectProperties.push('*');
|
|
66
|
+
}
|
|
67
|
+
if (fields) {
|
|
68
|
+
fields.split(',').forEach((field) => {
|
|
69
|
+
const subparts = field.trim().split('/');
|
|
70
|
+
if (subparts.length > 1) {
|
|
71
|
+
expandProperties.push(subparts[0]);
|
|
72
|
+
}
|
|
73
|
+
selectProperties.push(field.trim());
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
selectProperties: [...new Set(selectProperties)],
|
|
78
|
+
expandProperties: [...new Set(expandProperties)]
|
|
79
|
+
};
|
|
80
|
+
}
|
|
55
81
|
}
|
|
56
82
|
_SpoListListCommand_instances = new WeakSet(), _SpoListListCommand_initOptions = function _SpoListListCommand_initOptions() {
|
|
57
83
|
this.options.unshift({
|
|
58
84
|
option: '-u, --webUrl <webUrl>'
|
|
85
|
+
}, {
|
|
86
|
+
option: '-p, --properties [properties]'
|
|
87
|
+
}, {
|
|
88
|
+
option: '-f, --filter [filter]'
|
|
59
89
|
});
|
|
60
90
|
}, _SpoListListCommand_initValidators = function _SpoListListCommand_initValidators() {
|
|
61
91
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () { return validation_1.validation.isValidSharePointUrl(args.options.webUrl); }));
|
|
92
|
+
}, _SpoListListCommand_initTelemetry = function _SpoListListCommand_initTelemetry() {
|
|
93
|
+
this.telemetry.push((args) => {
|
|
94
|
+
Object.assign(this.telemetryProperties, {
|
|
95
|
+
properties: typeof args.options.properties !== 'undefined',
|
|
96
|
+
filter: typeof args.options.filter !== 'undefined'
|
|
97
|
+
});
|
|
98
|
+
});
|
|
62
99
|
};
|
|
63
100
|
module.exports = new SpoListListCommand();
|
|
64
101
|
//# sourceMappingURL=list-list.js.map
|
|
@@ -15,7 +15,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _SpoPageSectionAddCommand_instances, _SpoPageSectionAddCommand_initTelemetry, _SpoPageSectionAddCommand_initOptions, _SpoPageSectionAddCommand_initValidators;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const util_1 = require("util");
|
|
19
18
|
const request_1 = require("../../../../request");
|
|
20
19
|
const formatting_1 = require("../../../../utils/formatting");
|
|
21
20
|
const validation_1 = require("../../../../utils/validation");
|
|
@@ -64,7 +63,7 @@ class SpoPageSectionAddCommand extends SpoCommand_1.default {
|
|
|
64
63
|
},
|
|
65
64
|
responseType: 'json'
|
|
66
65
|
};
|
|
67
|
-
|
|
66
|
+
yield request_1.default.post(requestOptions);
|
|
68
67
|
}
|
|
69
68
|
// get columns
|
|
70
69
|
const columns = canvasContent
|
|
@@ -187,7 +186,7 @@ _SpoPageSectionAddCommand_instances = new WeakSet(), _SpoPageSectionAddCommand_i
|
|
|
187
186
|
return `${args.options.sectionTemplate} is not a valid section template. Allowed values are OneColumn|OneColumnFullWidth|TwoColumn|ThreeColumn|TwoColumnLeft|TwoColumnRight`;
|
|
188
187
|
}
|
|
189
188
|
if (typeof args.options.order !== 'undefined') {
|
|
190
|
-
if (!
|
|
189
|
+
if (!Number.isInteger(args.options.order) || args.options.order < 1) {
|
|
191
190
|
return 'The value of parameter order must be 1 or higher';
|
|
192
191
|
}
|
|
193
192
|
}
|
|
@@ -43,8 +43,8 @@ class SpoTermAddCommand extends SpoCommand_1.default {
|
|
|
43
43
|
let term;
|
|
44
44
|
let formDigest;
|
|
45
45
|
try {
|
|
46
|
-
const
|
|
47
|
-
const res = yield spo_1.spo.getRequestDigest(
|
|
46
|
+
const spoWebUrl = args.options.webUrl ? args.options.webUrl : yield spo_1.spo.getSpoAdminUrl(logger, this.debug);
|
|
47
|
+
const res = yield spo_1.spo.getRequestDigest(spoWebUrl);
|
|
48
48
|
formDigest = res.FormDigestValue;
|
|
49
49
|
if (this.verbose) {
|
|
50
50
|
logger.logToStderr(`Adding taxonomy term...`);
|
|
@@ -58,7 +58,7 @@ class SpoTermAddCommand extends SpoCommand_1.default {
|
|
|
58
58
|
const termId = args.options.id || (0, uuid_1.v4)();
|
|
59
59
|
const data = `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="${config_1.default.applicationName}" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions><ObjectPath Id="4" ObjectPathId="3" /><ObjectIdentityQuery Id="5" ObjectPathId="3" /><ObjectPath Id="7" ObjectPathId="6" /><ObjectIdentityQuery Id="8" ObjectPathId="6" /><ObjectPath Id="10" ObjectPathId="9" /><ObjectPath Id="12" ObjectPathId="11" /><ObjectIdentityQuery Id="13" ObjectPathId="11" /><ObjectPath Id="15" ObjectPathId="14" /><ObjectPath Id="17" ObjectPathId="16" /><ObjectIdentityQuery Id="18" ObjectPathId="16" /><ObjectPath Id="20" ObjectPathId="19" /><ObjectIdentityQuery Id="21" ObjectPathId="19" /><Query Id="22" ObjectPathId="19"><Query SelectAllProperties="true"><Properties /></Query></Query></Actions><ObjectPaths><StaticMethod Id="3" Name="GetTaxonomySession" TypeId="{981cbc68-9edc-4f8d-872f-71146fcbb84f}" /><Method Id="6" ParentId="3" Name="GetDefaultSiteCollectionTermStore" /><Property Id="9" ParentId="6" Name="Groups" />${termGroupQuery}<Property Id="14" ParentId="11" Name="TermSets" />${termParentQuery}<Method Id="19" ParentId="16" Name="CreateTerm"><Parameters><Parameter Type="String">${formatting_1.formatting.escapeXml(args.options.name)}</Parameter><Parameter Type="Int32">1033</Parameter><Parameter Type="Guid">{${termId}}</Parameter></Parameters></Method></ObjectPaths></Request>`;
|
|
60
60
|
const requestOptionsPost = {
|
|
61
|
-
url: `${
|
|
61
|
+
url: `${spoWebUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
62
62
|
headers: {
|
|
63
63
|
'X-RequestDigest': res.FormDigestValue
|
|
64
64
|
},
|
|
@@ -108,7 +108,7 @@ class SpoTermAddCommand extends SpoCommand_1.default {
|
|
|
108
108
|
break;
|
|
109
109
|
}
|
|
110
110
|
const requestOptions = {
|
|
111
|
-
url: `${
|
|
111
|
+
url: `${spoWebUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
112
112
|
headers: {
|
|
113
113
|
'X-RequestDigest': formDigest
|
|
114
114
|
},
|
|
@@ -139,6 +139,7 @@ class SpoTermAddCommand extends SpoCommand_1.default {
|
|
|
139
139
|
_SpoTermAddCommand_instances = new WeakSet(), _SpoTermAddCommand_initTelemetry = function _SpoTermAddCommand_initTelemetry() {
|
|
140
140
|
this.telemetry.push((args) => {
|
|
141
141
|
Object.assign(this.telemetryProperties, {
|
|
142
|
+
webUrl: typeof args.options.webUrl !== 'undefined',
|
|
142
143
|
customProperties: typeof args.options.customProperties !== 'undefined',
|
|
143
144
|
description: typeof args.options.description !== 'undefined',
|
|
144
145
|
id: typeof args.options.id !== 'undefined',
|
|
@@ -153,6 +154,8 @@ _SpoTermAddCommand_instances = new WeakSet(), _SpoTermAddCommand_initTelemetry =
|
|
|
153
154
|
}, _SpoTermAddCommand_initOptions = function _SpoTermAddCommand_initOptions() {
|
|
154
155
|
this.options.unshift({
|
|
155
156
|
option: '-n, --name <name>'
|
|
157
|
+
}, {
|
|
158
|
+
option: '-u, --webUrl [webUrl]'
|
|
156
159
|
}, {
|
|
157
160
|
option: '--termSetId [termSetId]'
|
|
158
161
|
}, {
|
|
@@ -174,6 +177,12 @@ _SpoTermAddCommand_instances = new WeakSet(), _SpoTermAddCommand_initTelemetry =
|
|
|
174
177
|
});
|
|
175
178
|
}, _SpoTermAddCommand_initValidators = function _SpoTermAddCommand_initValidators() {
|
|
176
179
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
180
|
+
if (args.options.webUrl) {
|
|
181
|
+
const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
182
|
+
if (isValidSharePointUrl !== true) {
|
|
183
|
+
return isValidSharePointUrl;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
177
186
|
if (args.options.id) {
|
|
178
187
|
if (!validation_1.validation.isValidGuid(args.options.id)) {
|
|
179
188
|
return `${args.options.id} is not a valid GUID`;
|
|
@@ -41,8 +41,8 @@ class SpoTermGetCommand extends SpoCommand_1.default {
|
|
|
41
41
|
commandAction(logger, args) {
|
|
42
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
43
|
try {
|
|
44
|
-
const
|
|
45
|
-
const res = yield spo_1.spo.getRequestDigest(
|
|
44
|
+
const spoWebUrl = args.options.webUrl ? args.options.webUrl : yield spo_1.spo.getSpoAdminUrl(logger, this.debug);
|
|
45
|
+
const res = yield spo_1.spo.getRequestDigest(spoWebUrl);
|
|
46
46
|
if (this.verbose) {
|
|
47
47
|
logger.logToStderr(`Retrieving taxonomy term...`);
|
|
48
48
|
}
|
|
@@ -54,7 +54,7 @@ class SpoTermGetCommand extends SpoCommand_1.default {
|
|
|
54
54
|
data = `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="${config_1.default.applicationName}" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions><ObjectPath Id="2" ObjectPathId="1" /><ObjectIdentityQuery Id="3" ObjectPathId="1" /><ObjectPath Id="5" ObjectPathId="4" /><ObjectIdentityQuery Id="6" ObjectPathId="4" /><ObjectPath Id="8" ObjectPathId="7" /><ObjectPath Id="10" ObjectPathId="9" /><ObjectIdentityQuery Id="11" ObjectPathId="9" /><ObjectPath Id="13" ObjectPathId="12" /><ObjectPath Id="15" ObjectPathId="14" /><ObjectIdentityQuery Id="16" ObjectPathId="14" /><ObjectPath Id="18" ObjectPathId="17" /><SetProperty Id="19" ObjectPathId="17" Name="TrimUnavailable"><Parameter Type="Boolean">true</Parameter></SetProperty><SetProperty Id="20" ObjectPathId="17" Name="TermLabel"><Parameter Type="String">${formatting_1.formatting.escapeXml(args.options.name)}</Parameter></SetProperty><ObjectPath Id="22" ObjectPathId="21" /><Query Id="23" ObjectPathId="21"><Query SelectAllProperties="true"><Properties /></Query><ChildItemQuery SelectAllProperties="true"><Properties /></ChildItemQuery></Query></Actions><ObjectPaths><StaticMethod Id="1" Name="GetTaxonomySession" TypeId="{981cbc68-9edc-4f8d-872f-71146fcbb84f}" /><Method Id="4" ParentId="1" Name="GetDefaultSiteCollectionTermStore" /><Property Id="7" ParentId="4" Name="Groups" /><Method Id="9" ParentId="7" Name="${args.options.termGroupName === undefined ? "GetById" : "GetByName"}"><Parameters><Parameter Type="String">${formatting_1.formatting.escapeXml(args.options.termGroupName) || args.options.termGroupId}</Parameter></Parameters></Method><Property Id="12" ParentId="9" Name="TermSets" /><Method Id="14" ParentId="12" Name="${args.options.termSetName === undefined ? "GetById" : "GetByName"}"><Parameters><Parameter Type="String">${formatting_1.formatting.escapeXml(args.options.termSetName) || args.options.termSetId}</Parameter></Parameters></Method><Constructor Id="17" TypeId="{61a1d689-2744-4ea3-a88b-c95bee9803aa}" /><Method Id="21" ParentId="14" Name="GetTerms"><Parameters><Parameter ObjectPathId="17" /></Parameters></Method></ObjectPaths></Request>`;
|
|
55
55
|
}
|
|
56
56
|
let term;
|
|
57
|
-
const csomResponse = yield this.executeCsomCall(data,
|
|
57
|
+
const csomResponse = yield this.executeCsomCall(data, spoWebUrl, res);
|
|
58
58
|
if (csomResponse === null) {
|
|
59
59
|
throw `Term with id '${args.options.id}' could not be found.`;
|
|
60
60
|
}
|
|
@@ -86,10 +86,10 @@ class SpoTermGetCommand extends SpoCommand_1.default {
|
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
|
-
executeCsomCall(data,
|
|
89
|
+
executeCsomCall(data, spoWebUrl, res) {
|
|
90
90
|
return __awaiter(this, void 0, void 0, function* () {
|
|
91
91
|
const requestOptions = {
|
|
92
|
-
url: `${
|
|
92
|
+
url: `${spoWebUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
93
93
|
headers: {
|
|
94
94
|
'X-RequestDigest': res.FormDigestValue
|
|
95
95
|
},
|
|
@@ -115,6 +115,7 @@ class SpoTermGetCommand extends SpoCommand_1.default {
|
|
|
115
115
|
_SpoTermGetCommand_instances = new WeakSet(), _SpoTermGetCommand_initTelemetry = function _SpoTermGetCommand_initTelemetry() {
|
|
116
116
|
this.telemetry.push((args) => {
|
|
117
117
|
Object.assign(this.telemetryProperties, {
|
|
118
|
+
webUrl: typeof args.options.webUrl !== 'undefined',
|
|
118
119
|
id: typeof args.options.id !== 'undefined',
|
|
119
120
|
name: typeof args.options.name !== 'undefined',
|
|
120
121
|
termGroupId: typeof args.options.termGroupId !== 'undefined',
|
|
@@ -125,6 +126,8 @@ _SpoTermGetCommand_instances = new WeakSet(), _SpoTermGetCommand_initTelemetry =
|
|
|
125
126
|
});
|
|
126
127
|
}, _SpoTermGetCommand_initOptions = function _SpoTermGetCommand_initOptions() {
|
|
127
128
|
this.options.unshift({
|
|
129
|
+
option: '-u, --webUrl [webUrl]'
|
|
130
|
+
}, {
|
|
128
131
|
option: '-i, --id [id]'
|
|
129
132
|
}, {
|
|
130
133
|
option: '-n, --name [name]'
|
|
@@ -139,6 +142,12 @@ _SpoTermGetCommand_instances = new WeakSet(), _SpoTermGetCommand_initTelemetry =
|
|
|
139
142
|
});
|
|
140
143
|
}, _SpoTermGetCommand_initValidators = function _SpoTermGetCommand_initValidators() {
|
|
141
144
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
145
|
+
if (args.options.webUrl) {
|
|
146
|
+
const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
147
|
+
if (isValidSharePointUrl !== true) {
|
|
148
|
+
return isValidSharePointUrl;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
142
151
|
if (args.options.id && !validation_1.validation.isValidGuid(args.options.id)) {
|
|
143
152
|
return `${args.options.id} is not a valid GUID`;
|
|
144
153
|
}
|
|
@@ -40,14 +40,14 @@ class SpoTermGroupGetCommand extends SpoCommand_1.default {
|
|
|
40
40
|
commandAction(logger, args) {
|
|
41
41
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42
42
|
try {
|
|
43
|
-
const
|
|
44
|
-
const res = yield spo_1.spo.getRequestDigest(
|
|
43
|
+
const spoWebUrl = args.options.webUrl ? args.options.webUrl : yield spo_1.spo.getSpoAdminUrl(logger, this.debug);
|
|
44
|
+
const res = yield spo_1.spo.getRequestDigest(spoWebUrl);
|
|
45
45
|
if (this.verbose) {
|
|
46
46
|
logger.logToStderr(`Retrieving taxonomy term groups...`);
|
|
47
47
|
}
|
|
48
48
|
const query = args.options.id ? `<Method Id="32" ParentId="30" Name="GetById"><Parameters><Parameter Type="Guid">{${formatting_1.formatting.escapeXml(args.options.id)}}</Parameter></Parameters></Method>` : `<Method Id="32" ParentId="30" Name="GetByName"><Parameters><Parameter Type="String">${formatting_1.formatting.escapeXml(args.options.name)}</Parameter></Parameters></Method>`;
|
|
49
49
|
const requestOptions = {
|
|
50
|
-
url: `${
|
|
50
|
+
url: `${spoWebUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
51
51
|
headers: {
|
|
52
52
|
'X-RequestDigest': res.FormDigestValue
|
|
53
53
|
},
|
|
@@ -76,18 +76,27 @@ class SpoTermGroupGetCommand extends SpoCommand_1.default {
|
|
|
76
76
|
_SpoTermGroupGetCommand_instances = new WeakSet(), _SpoTermGroupGetCommand_initTelemetry = function _SpoTermGroupGetCommand_initTelemetry() {
|
|
77
77
|
this.telemetry.push((args) => {
|
|
78
78
|
Object.assign(this.telemetryProperties, {
|
|
79
|
+
webUrl: typeof args.options.webUrl !== 'undefined',
|
|
79
80
|
id: typeof args.options.id !== 'undefined',
|
|
80
81
|
name: typeof args.options.name !== 'undefined'
|
|
81
82
|
});
|
|
82
83
|
});
|
|
83
84
|
}, _SpoTermGroupGetCommand_initOptions = function _SpoTermGroupGetCommand_initOptions() {
|
|
84
85
|
this.options.unshift({
|
|
86
|
+
option: '-u, --webUrl [webUrl]'
|
|
87
|
+
}, {
|
|
85
88
|
option: '-i, --id [id]'
|
|
86
89
|
}, {
|
|
87
90
|
option: '-n, --name [name]'
|
|
88
91
|
});
|
|
89
92
|
}, _SpoTermGroupGetCommand_initValidators = function _SpoTermGroupGetCommand_initValidators() {
|
|
90
93
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
94
|
+
if (args.options.webUrl) {
|
|
95
|
+
const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
96
|
+
if (isValidSharePointUrl !== true) {
|
|
97
|
+
return isValidSharePointUrl;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
91
100
|
if (args.options.id) {
|
|
92
101
|
if (!validation_1.validation.isValidGuid(args.options.id)) {
|
|
93
102
|
return `${args.options.id} is not a valid GUID`;
|
|
@@ -8,10 +8,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
12
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
13
|
+
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");
|
|
14
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15
|
+
};
|
|
16
|
+
var _SpoTermGroupListCommand_instances, _SpoTermGroupListCommand_initTelemetry, _SpoTermGroupListCommand_initOptions, _SpoTermGroupListCommand_initValidators;
|
|
11
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
18
|
const config_1 = require("../../../../config");
|
|
13
19
|
const request_1 = require("../../../../request");
|
|
14
20
|
const spo_1 = require("../../../../utils/spo");
|
|
21
|
+
const validation_1 = require("../../../../utils/validation");
|
|
15
22
|
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
16
23
|
const commands_1 = require("../../commands");
|
|
17
24
|
class SpoTermGroupListCommand extends SpoCommand_1.default {
|
|
@@ -24,16 +31,23 @@ class SpoTermGroupListCommand extends SpoCommand_1.default {
|
|
|
24
31
|
defaultProperties() {
|
|
25
32
|
return ['Id', 'Name'];
|
|
26
33
|
}
|
|
27
|
-
|
|
34
|
+
constructor() {
|
|
35
|
+
super();
|
|
36
|
+
_SpoTermGroupListCommand_instances.add(this);
|
|
37
|
+
__classPrivateFieldGet(this, _SpoTermGroupListCommand_instances, "m", _SpoTermGroupListCommand_initTelemetry).call(this);
|
|
38
|
+
__classPrivateFieldGet(this, _SpoTermGroupListCommand_instances, "m", _SpoTermGroupListCommand_initOptions).call(this);
|
|
39
|
+
__classPrivateFieldGet(this, _SpoTermGroupListCommand_instances, "m", _SpoTermGroupListCommand_initValidators).call(this);
|
|
40
|
+
}
|
|
41
|
+
commandAction(logger, args) {
|
|
28
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
29
43
|
try {
|
|
30
|
-
const
|
|
31
|
-
const res = yield spo_1.spo.getRequestDigest(
|
|
44
|
+
const spoWebUrl = args.options.webUrl ? args.options.webUrl : yield spo_1.spo.getSpoAdminUrl(logger, this.debug);
|
|
45
|
+
const res = yield spo_1.spo.getRequestDigest(spoWebUrl);
|
|
32
46
|
if (this.verbose) {
|
|
33
47
|
logger.logToStderr(`Retrieving taxonomy term groups...`);
|
|
34
48
|
}
|
|
35
49
|
const requestOptions = {
|
|
36
|
-
url: `${
|
|
50
|
+
url: `${spoWebUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
37
51
|
headers: {
|
|
38
52
|
'X-RequestDigest': res.FormDigestValue
|
|
39
53
|
},
|
|
@@ -61,5 +75,26 @@ class SpoTermGroupListCommand extends SpoCommand_1.default {
|
|
|
61
75
|
});
|
|
62
76
|
}
|
|
63
77
|
}
|
|
78
|
+
_SpoTermGroupListCommand_instances = new WeakSet(), _SpoTermGroupListCommand_initTelemetry = function _SpoTermGroupListCommand_initTelemetry() {
|
|
79
|
+
this.telemetry.push((args) => {
|
|
80
|
+
Object.assign(this.telemetryProperties, {
|
|
81
|
+
webUrl: typeof args.options.webUrl !== 'undefined'
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
}, _SpoTermGroupListCommand_initOptions = function _SpoTermGroupListCommand_initOptions() {
|
|
85
|
+
this.options.unshift({
|
|
86
|
+
option: '-u, --webUrl [webUrl]'
|
|
87
|
+
});
|
|
88
|
+
}, _SpoTermGroupListCommand_initValidators = function _SpoTermGroupListCommand_initValidators() {
|
|
89
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
if (args.options.webUrl) {
|
|
91
|
+
const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
92
|
+
if (isValidSharePointUrl !== true) {
|
|
93
|
+
return isValidSharePointUrl;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return true;
|
|
97
|
+
}));
|
|
98
|
+
};
|
|
64
99
|
module.exports = new SpoTermGroupListCommand();
|
|
65
100
|
//# sourceMappingURL=term-group-list.js.map
|
|
@@ -44,22 +44,22 @@ class SpoTermListCommand extends SpoCommand_1.default {
|
|
|
44
44
|
commandAction(logger, args) {
|
|
45
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
46
46
|
try {
|
|
47
|
-
const
|
|
48
|
-
const res = yield spo_1.spo.getRequestDigest(
|
|
47
|
+
const spoWebUrl = args.options.webUrl ? args.options.webUrl : yield spo_1.spo.getSpoAdminUrl(logger, this.debug);
|
|
48
|
+
const res = yield spo_1.spo.getRequestDigest(spoWebUrl);
|
|
49
49
|
if (this.verbose) {
|
|
50
50
|
logger.logToStderr(`Retrieving taxonomy term sets...`);
|
|
51
51
|
}
|
|
52
52
|
const termGroupQuery = args.options.termGroupId ? `<Method Id="77" ParentId="75" Name="GetById"><Parameters><Parameter Type="Guid">{${args.options.termGroupId}}</Parameter></Parameters></Method>` : `<Method Id="77" ParentId="75" Name="GetByName"><Parameters><Parameter Type="String">${formatting_1.formatting.escapeXml(args.options.termGroupName)}</Parameter></Parameters></Method>`;
|
|
53
53
|
const termSetQuery = args.options.termSetId ? `<Method Id="82" ParentId="80" Name="GetById"><Parameters><Parameter Type="Guid">{${args.options.termSetId}}</Parameter></Parameters></Method>` : `<Method Id="82" ParentId="80" Name="GetByName"><Parameters><Parameter Type="String">${formatting_1.formatting.escapeXml(args.options.termSetName)}</Parameter></Parameters></Method>`;
|
|
54
54
|
const data = `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="${config_1.default.applicationName}" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions><ObjectPath Id="70" ObjectPathId="69" /><ObjectIdentityQuery Id="71" ObjectPathId="69" /><ObjectPath Id="73" ObjectPathId="72" /><ObjectIdentityQuery Id="74" ObjectPathId="72" /><ObjectPath Id="76" ObjectPathId="75" /><ObjectPath Id="78" ObjectPathId="77" /><ObjectIdentityQuery Id="79" ObjectPathId="77" /><ObjectPath Id="81" ObjectPathId="80" /><ObjectPath Id="83" ObjectPathId="82" /><ObjectIdentityQuery Id="84" ObjectPathId="82" /><ObjectPath Id="86" ObjectPathId="85" /><Query Id="87" ObjectPathId="85"><Query SelectAllProperties="false"><Properties /></Query><ChildItemQuery SelectAllProperties="true"><Properties><Property Name="Name" ScalarProperty="true" /><Property Name="Id" ScalarProperty="true" /></Properties></ChildItemQuery></Query></Actions><ObjectPaths><StaticMethod Id="69" Name="GetTaxonomySession" TypeId="{981cbc68-9edc-4f8d-872f-71146fcbb84f}" /><Method Id="72" ParentId="69" Name="GetDefaultSiteCollectionTermStore" /><Property Id="75" ParentId="72" Name="Groups" />${termGroupQuery}<Property Id="80" ParentId="77" Name="TermSets" />${termSetQuery}<Property Id="85" ParentId="82" Name="Terms" /></ObjectPaths></Request>`;
|
|
55
|
-
const result = yield this.executeCsomCall(data,
|
|
55
|
+
const result = yield this.executeCsomCall(data, spoWebUrl, res);
|
|
56
56
|
const terms = [];
|
|
57
57
|
if (result._Child_Items_ && result._Child_Items_.length > 0) {
|
|
58
58
|
for (const term of result._Child_Items_) {
|
|
59
59
|
this.setTermDetails(term);
|
|
60
60
|
terms.push(term);
|
|
61
61
|
if (args.options.includeChildTerms && term.TermsCount > 0) {
|
|
62
|
-
yield this.getChildTerms(
|
|
62
|
+
yield this.getChildTerms(spoWebUrl, res, term);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
}
|
|
@@ -108,17 +108,17 @@ class SpoTermListCommand extends SpoCommand_1.default {
|
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
|
-
getChildTerms(
|
|
111
|
+
getChildTerms(spoWebUrl, res, parentTerm) {
|
|
112
112
|
return __awaiter(this, void 0, void 0, function* () {
|
|
113
113
|
parentTerm.Children = [];
|
|
114
114
|
const data = `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="${config_1.default.applicationName}" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions><ObjectPath Id="20" ObjectPathId="19" /><Query Id="21" ObjectPathId="19"><Query SelectAllProperties="false"><Properties /></Query><ChildItemQuery SelectAllProperties="true"><Properties><Property Name="CustomSortOrder" ScalarProperty="true" /><Property Name="CustomProperties" ScalarProperty="true" /><Property Name="LocalCustomProperties" ScalarProperty="true" /></Properties></ChildItemQuery></Query></Actions><ObjectPaths><Property Id="19" ParentId="16" Name="Terms" /><Identity Id="16" Name="${parentTerm._ObjectIdentity_}" /></ObjectPaths></Request>`;
|
|
115
|
-
const result = yield this.executeCsomCall(data,
|
|
115
|
+
const result = yield this.executeCsomCall(data, spoWebUrl, res);
|
|
116
116
|
if (result._Child_Items_ && result._Child_Items_.length > 0) {
|
|
117
117
|
for (const term of result._Child_Items_) {
|
|
118
118
|
this.setTermDetails(term);
|
|
119
119
|
parentTerm.Children.push(term);
|
|
120
120
|
if (term.TermsCount > 0) {
|
|
121
|
-
yield this.getChildTerms(
|
|
121
|
+
yield this.getChildTerms(spoWebUrl, res, term);
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
}
|
|
@@ -132,10 +132,10 @@ class SpoTermListCommand extends SpoCommand_1.default {
|
|
|
132
132
|
parseTermDateToIsoString(dateAsString) {
|
|
133
133
|
return new Date(Number(dateAsString.replace('/Date(', '').replace(')/', ''))).toISOString();
|
|
134
134
|
}
|
|
135
|
-
executeCsomCall(data,
|
|
135
|
+
executeCsomCall(data, spoWebUrl, res) {
|
|
136
136
|
return __awaiter(this, void 0, void 0, function* () {
|
|
137
137
|
const requestOptions = {
|
|
138
|
-
url: `${
|
|
138
|
+
url: `${spoWebUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
139
139
|
headers: {
|
|
140
140
|
'X-RequestDigest': res.FormDigestValue
|
|
141
141
|
},
|
|
@@ -154,6 +154,7 @@ class SpoTermListCommand extends SpoCommand_1.default {
|
|
|
154
154
|
_SpoTermListCommand_instances = new WeakSet(), _SpoTermListCommand_initTelemetry = function _SpoTermListCommand_initTelemetry() {
|
|
155
155
|
this.telemetry.push((args) => {
|
|
156
156
|
Object.assign(this.telemetryProperties, {
|
|
157
|
+
webUrl: typeof args.options.webUrl !== 'undefined',
|
|
157
158
|
termGroupId: typeof args.options.termGroupId !== 'undefined',
|
|
158
159
|
termGroupName: typeof args.options.termGroupName !== 'undefined',
|
|
159
160
|
termSetId: typeof args.options.termSetId !== 'undefined',
|
|
@@ -163,6 +164,8 @@ _SpoTermListCommand_instances = new WeakSet(), _SpoTermListCommand_initTelemetry
|
|
|
163
164
|
});
|
|
164
165
|
}, _SpoTermListCommand_initOptions = function _SpoTermListCommand_initOptions() {
|
|
165
166
|
this.options.unshift({
|
|
167
|
+
option: '-u, --webUrl [webUrl]'
|
|
168
|
+
}, {
|
|
166
169
|
option: '--termGroupId [termGroupId]'
|
|
167
170
|
}, {
|
|
168
171
|
option: '--termGroupName [termGroupName]'
|
|
@@ -175,6 +178,12 @@ _SpoTermListCommand_instances = new WeakSet(), _SpoTermListCommand_initTelemetry
|
|
|
175
178
|
});
|
|
176
179
|
}, _SpoTermListCommand_initValidators = function _SpoTermListCommand_initValidators() {
|
|
177
180
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
181
|
+
if (args.options.webUrl) {
|
|
182
|
+
const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
183
|
+
if (isValidSharePointUrl !== true) {
|
|
184
|
+
return isValidSharePointUrl;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
178
187
|
if (args.options.termGroupId && !validation_1.validation.isValidGuid(args.options.termGroupId)) {
|
|
179
188
|
return `${args.options.termGroupId} is not a valid GUID`;
|
|
180
189
|
}
|
|
@@ -43,8 +43,8 @@ class SpoTermSetAddCommand extends SpoCommand_1.default {
|
|
|
43
43
|
let formDigest = '';
|
|
44
44
|
let termSet;
|
|
45
45
|
try {
|
|
46
|
-
const
|
|
47
|
-
const res = yield spo_1.spo.getRequestDigest(
|
|
46
|
+
const spoWebUrl = args.options.webUrl ? args.options.webUrl : yield spo_1.spo.getSpoAdminUrl(logger, this.debug);
|
|
47
|
+
const res = yield spo_1.spo.getRequestDigest(spoWebUrl);
|
|
48
48
|
formDigest = res.FormDigestValue;
|
|
49
49
|
if (this.verbose) {
|
|
50
50
|
logger.logToStderr(`Adding taxonomy term set...`);
|
|
@@ -54,7 +54,7 @@ class SpoTermSetAddCommand extends SpoCommand_1.default {
|
|
|
54
54
|
`<Method Id="42" ParentId="40" Name="GetById"><Parameters><Parameter Type="Guid">{${args.options.termGroupId}}</Parameter></Parameters></Method>`;
|
|
55
55
|
const termSetId = args.options.id || (0, uuid_1.v4)();
|
|
56
56
|
const requestOptionsQuery = {
|
|
57
|
-
url: `${
|
|
57
|
+
url: `${spoWebUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
58
58
|
headers: {
|
|
59
59
|
'X-RequestDigest': res.FormDigestValue
|
|
60
60
|
},
|
|
@@ -96,7 +96,7 @@ class SpoTermSetAddCommand extends SpoCommand_1.default {
|
|
|
96
96
|
termSet.CustomProperties = customProperties;
|
|
97
97
|
}
|
|
98
98
|
const requestOptions = {
|
|
99
|
-
url: `${
|
|
99
|
+
url: `${spoWebUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
100
100
|
headers: {
|
|
101
101
|
'X-RequestDigest': formDigest
|
|
102
102
|
},
|
|
@@ -127,6 +127,7 @@ class SpoTermSetAddCommand extends SpoCommand_1.default {
|
|
|
127
127
|
_SpoTermSetAddCommand_instances = new WeakSet(), _SpoTermSetAddCommand_initTelemetry = function _SpoTermSetAddCommand_initTelemetry() {
|
|
128
128
|
this.telemetry.push((args) => {
|
|
129
129
|
Object.assign(this.telemetryProperties, {
|
|
130
|
+
webUrl: typeof args.options.webUrl !== 'undefined',
|
|
130
131
|
customProperties: typeof args.options.customProperties !== 'undefined',
|
|
131
132
|
description: typeof args.options.description !== 'undefined',
|
|
132
133
|
id: typeof args.options.id !== 'undefined',
|
|
@@ -137,6 +138,8 @@ _SpoTermSetAddCommand_instances = new WeakSet(), _SpoTermSetAddCommand_initTelem
|
|
|
137
138
|
}, _SpoTermSetAddCommand_initOptions = function _SpoTermSetAddCommand_initOptions() {
|
|
138
139
|
this.options.unshift({
|
|
139
140
|
option: '-n, --name <name>'
|
|
141
|
+
}, {
|
|
142
|
+
option: '-u, --webUrl [webUrl]'
|
|
140
143
|
}, {
|
|
141
144
|
option: '--termGroupId [termGroupId]'
|
|
142
145
|
}, {
|
|
@@ -150,6 +153,12 @@ _SpoTermSetAddCommand_instances = new WeakSet(), _SpoTermSetAddCommand_initTelem
|
|
|
150
153
|
});
|
|
151
154
|
}, _SpoTermSetAddCommand_initValidators = function _SpoTermSetAddCommand_initValidators() {
|
|
152
155
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
156
|
+
if (args.options.webUrl) {
|
|
157
|
+
const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
158
|
+
if (isValidSharePointUrl !== true) {
|
|
159
|
+
return isValidSharePointUrl;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
153
162
|
if (args.options.id) {
|
|
154
163
|
if (!validation_1.validation.isValidGuid(args.options.id)) {
|
|
155
164
|
return `${args.options.id} is not a valid GUID`;
|
|
@@ -40,15 +40,15 @@ class SpoTermSetGetCommand extends SpoCommand_1.default {
|
|
|
40
40
|
commandAction(logger, args) {
|
|
41
41
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42
42
|
try {
|
|
43
|
-
const
|
|
44
|
-
const res = yield spo_1.spo.getRequestDigest(
|
|
43
|
+
const spoWebUrl = args.options.webUrl ? args.options.webUrl : yield spo_1.spo.getSpoAdminUrl(logger, this.debug);
|
|
44
|
+
const res = yield spo_1.spo.getRequestDigest(spoWebUrl);
|
|
45
45
|
if (this.verbose) {
|
|
46
46
|
logger.logToStderr(`Retrieving taxonomy term set...`);
|
|
47
47
|
}
|
|
48
48
|
const termGroupQuery = args.options.termGroupId ? `<Method Id="62" ParentId="60" Name="GetById"><Parameters><Parameter Type="Guid">{${args.options.termGroupId}}</Parameter></Parameters></Method>` : `<Method Id="62" ParentId="60" Name="GetByName"><Parameters><Parameter Type="String">${formatting_1.formatting.escapeXml(args.options.termGroupName)}</Parameter></Parameters></Method>`;
|
|
49
49
|
const termSetQuery = args.options.id ? `<Method Id="67" ParentId="65" Name="GetById"><Parameters><Parameter Type="Guid">{${args.options.id}}</Parameter></Parameters></Method>` : `<Method Id="67" ParentId="65" Name="GetByName"><Parameters><Parameter Type="String">${formatting_1.formatting.escapeXml(args.options.name)}</Parameter></Parameters></Method>`;
|
|
50
50
|
const requestOptions = {
|
|
51
|
-
url: `${
|
|
51
|
+
url: `${spoWebUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
52
52
|
headers: {
|
|
53
53
|
'X-RequestDigest': res.FormDigestValue
|
|
54
54
|
},
|
|
@@ -77,6 +77,7 @@ class SpoTermSetGetCommand extends SpoCommand_1.default {
|
|
|
77
77
|
_SpoTermSetGetCommand_instances = new WeakSet(), _SpoTermSetGetCommand_initTelemetry = function _SpoTermSetGetCommand_initTelemetry() {
|
|
78
78
|
this.telemetry.push((args) => {
|
|
79
79
|
Object.assign(this.telemetryProperties, {
|
|
80
|
+
webUrl: typeof args.options.webUrl !== 'undefined',
|
|
80
81
|
id: typeof args.options.id !== 'undefined',
|
|
81
82
|
name: typeof args.options.name !== 'undefined',
|
|
82
83
|
termGroupId: typeof args.options.termGroupId !== 'undefined',
|
|
@@ -85,6 +86,8 @@ _SpoTermSetGetCommand_instances = new WeakSet(), _SpoTermSetGetCommand_initTelem
|
|
|
85
86
|
});
|
|
86
87
|
}, _SpoTermSetGetCommand_initOptions = function _SpoTermSetGetCommand_initOptions() {
|
|
87
88
|
this.options.unshift({
|
|
89
|
+
option: '-u, --webUrl [webUrl]'
|
|
90
|
+
}, {
|
|
88
91
|
option: '-i, --id [id]'
|
|
89
92
|
}, {
|
|
90
93
|
option: '-n, --name [name]'
|
|
@@ -95,6 +98,12 @@ _SpoTermSetGetCommand_instances = new WeakSet(), _SpoTermSetGetCommand_initTelem
|
|
|
95
98
|
});
|
|
96
99
|
}, _SpoTermSetGetCommand_initValidators = function _SpoTermSetGetCommand_initValidators() {
|
|
97
100
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
101
|
+
if (args.options.webUrl) {
|
|
102
|
+
const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
103
|
+
if (isValidSharePointUrl !== true) {
|
|
104
|
+
return isValidSharePointUrl;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
98
107
|
if (args.options.id) {
|
|
99
108
|
if (!validation_1.validation.isValidGuid(args.options.id)) {
|
|
100
109
|
return `${args.options.id} is not a valid GUID`;
|
|
@@ -43,14 +43,14 @@ class SpoTermSetListCommand extends SpoCommand_1.default {
|
|
|
43
43
|
commandAction(logger, args) {
|
|
44
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
45
45
|
try {
|
|
46
|
-
const
|
|
47
|
-
const res = yield spo_1.spo.getRequestDigest(
|
|
46
|
+
const spoWebUrl = args.options.webUrl ? args.options.webUrl : yield spo_1.spo.getSpoAdminUrl(logger, this.debug);
|
|
47
|
+
const res = yield spo_1.spo.getRequestDigest(spoWebUrl);
|
|
48
48
|
if (this.verbose) {
|
|
49
49
|
logger.logToStderr(`Retrieving taxonomy term sets...`);
|
|
50
50
|
}
|
|
51
51
|
const query = args.options.termGroupId ? `<Method Id="62" ParentId="60" Name="GetById"><Parameters><Parameter Type="Guid">{${args.options.termGroupId}}</Parameter></Parameters></Method>` : `<Method Id="62" ParentId="60" Name="GetByName"><Parameters><Parameter Type="String">${formatting_1.formatting.escapeXml(args.options.termGroupName)}</Parameter></Parameters></Method>`;
|
|
52
52
|
const requestOptions = {
|
|
53
|
-
url: `${
|
|
53
|
+
url: `${spoWebUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
54
54
|
headers: {
|
|
55
55
|
'X-RequestDigest': res.FormDigestValue
|
|
56
56
|
},
|
|
@@ -82,18 +82,27 @@ class SpoTermSetListCommand extends SpoCommand_1.default {
|
|
|
82
82
|
_SpoTermSetListCommand_instances = new WeakSet(), _SpoTermSetListCommand_initTelemetry = function _SpoTermSetListCommand_initTelemetry() {
|
|
83
83
|
this.telemetry.push((args) => {
|
|
84
84
|
Object.assign(this.telemetryProperties, {
|
|
85
|
+
webUrl: typeof args.options.webUrl !== 'undefined',
|
|
85
86
|
termGroupId: typeof args.options.termGroupId !== 'undefined',
|
|
86
87
|
termGroupName: typeof args.options.termGroupName !== 'undefined'
|
|
87
88
|
});
|
|
88
89
|
});
|
|
89
90
|
}, _SpoTermSetListCommand_initOptions = function _SpoTermSetListCommand_initOptions() {
|
|
90
91
|
this.options.unshift({
|
|
92
|
+
option: '-u, --webUrl [webUrl]'
|
|
93
|
+
}, {
|
|
91
94
|
option: '--termGroupId [termGroupId]'
|
|
92
95
|
}, {
|
|
93
96
|
option: '--termGroupName [termGroupName]'
|
|
94
97
|
});
|
|
95
98
|
}, _SpoTermSetListCommand_initValidators = function _SpoTermSetListCommand_initValidators() {
|
|
96
99
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
100
|
+
if (args.options.webUrl) {
|
|
101
|
+
const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
102
|
+
if (isValidSharePointUrl !== true) {
|
|
103
|
+
return isValidSharePointUrl;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
97
106
|
if (args.options.termGroupId) {
|
|
98
107
|
if (!validation_1.validation.isValidGuid(args.options.termGroupId)) {
|
|
99
108
|
return `${args.options.termGroupId} is not a valid GUID`;
|
|
@@ -202,6 +202,7 @@ exports.default = {
|
|
|
202
202
|
PAGE_SECTION_GET: `${prefix} page section get`,
|
|
203
203
|
PAGE_SECTION_LIST: `${prefix} page section list`,
|
|
204
204
|
PAGE_TEMPLATE_LIST: `${prefix} page template list`,
|
|
205
|
+
PAGE_TEMPLATE_REMOVE: `${prefix} page template remove`,
|
|
205
206
|
PAGE_TEXT_ADD: `${prefix} page text add`,
|
|
206
207
|
PROPERTYBAG_GET: `${prefix} propertybag get`,
|
|
207
208
|
PROPERTYBAG_LIST: `${prefix} propertybag list`,
|
|
@@ -8,12 +8,6 @@ Gets information about the specified Microsoft 365 Group or Microsoft Teams team
|
|
|
8
8
|
m365 aad o365group get [options]
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
## Alias
|
|
12
|
-
|
|
13
|
-
```sh
|
|
14
|
-
m365 teams team get
|
|
15
|
-
```
|
|
16
|
-
|
|
17
11
|
## Options
|
|
18
12
|
|
|
19
13
|
`-i, --id <id>`
|
|
@@ -37,9 +31,3 @@ Get information about the Microsoft 365 Group with id _1caf7dcd-7e83-4c3a-94f7-9
|
|
|
37
31
|
```sh
|
|
38
32
|
m365 aad o365group get --id 1caf7dcd-7e83-4c3a-94f7-932a1299c844 --includeSiteUrl
|
|
39
33
|
```
|
|
40
|
-
|
|
41
|
-
Get information about the Microsoft Teams team with id _2eaf7dcd-7e83-4c3a-94f7-932a1299c844_
|
|
42
|
-
|
|
43
|
-
```sh
|
|
44
|
-
m365 teams team get --id 2eaf7dcd-7e83-4c3a-94f7-932a1299c844
|
|
45
|
-
```
|