@pnp/cli-microsoft365 6.3.0-beta.a991329 → 6.3.0-beta.e46ffee
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/dist/Command.js +1 -12
- package/dist/cli/Cli.js +1 -4
- package/dist/m365/aad/commands/group/group-list.js +1 -2
- package/dist/m365/graph/commands/changelog/changelog-list.js +2 -3
- package/dist/m365/onenote/commands/notebook/notebook-list.js +40 -51
- package/dist/m365/planner/commands/task/task-checklistitem-add.js +1 -2
- package/dist/m365/planner/commands/task/task-checklistitem-list.js +1 -2
- package/dist/m365/pp/commands/solution/solution-get.js +1 -2
- package/dist/m365/pp/commands/solution/solution-list.js +1 -2
- package/dist/m365/spo/commands/app/app-add.js +1 -2
- package/dist/m365/spo/commands/file/file-sharinginfo-get.js +1 -2
- package/dist/m365/spo/commands/file/file-sharinglink-list.js +1 -2
- package/dist/m365/spo/commands/group/group-list.js +1 -2
- package/dist/m365/spo/commands/hubsite/hubsite-get.js +1 -1
- package/dist/m365/spo/commands/listitem/listitem-list.js +1 -2
- package/dist/m365/spo/commands/page/page-column-get.js +1 -2
- package/dist/m365/spo/commands/page/page-column-list.js +1 -2
- package/dist/m365/spo/commands/page/page-section-get.js +1 -2
- package/dist/m365/spo/commands/page/page-section-list.js +1 -2
- package/dist/m365/spo/commands/spo-search.js +1 -2
- package/dist/m365/spo/commands/term/term-list.js +1 -2
- package/dist/m365/spo/commands/userprofile/userprofile-get.js +2 -2
- package/dist/m365/teams/commands/meeting/meeting-list.js +1 -1
- package/dist/m365/teams/commands/team/team-app-list.js +1 -1
- package/dist/m365/teams/commands/user/user-app-list.js +1 -2
- package/dist/m365/todo/commands/task/task-get.js +1 -2
- package/dist/m365/todo/commands/task/task-list.js +1 -2
- package/dist/m365/yammer/commands/yammer-search.js +1 -2
- package/docs/docs/cmd/spo/navigation/navigation-node-add.md +1 -1
- package/docs/docs/cmd/spo/navigation/navigation-node-set.md +1 -1
- package/package.json +1 -1
package/dist/Command.js
CHANGED
|
@@ -481,18 +481,7 @@ class Command {
|
|
|
481
481
|
if (!l) {
|
|
482
482
|
return;
|
|
483
483
|
}
|
|
484
|
-
|
|
485
|
-
const id = this.getLogItemId(l);
|
|
486
|
-
if (title && id) {
|
|
487
|
-
output.push(`## ${title} (${id})`);
|
|
488
|
-
}
|
|
489
|
-
else if (title) {
|
|
490
|
-
output.push(`## ${title}`);
|
|
491
|
-
}
|
|
492
|
-
else if (id) {
|
|
493
|
-
output.push(`## ${id}`);
|
|
494
|
-
}
|
|
495
|
-
output.push(os.EOL, os.EOL, `Property | Value`, os.EOL, `---------|-------`, os.EOL);
|
|
484
|
+
output.push(`## ${this.getLogItemTitle(l)} (${this.getLogItemId(l)})`, os.EOL, os.EOL, `Property | Value`, os.EOL, `---------|-------`, os.EOL);
|
|
496
485
|
output.push(Object.keys(l).map(k => {
|
|
497
486
|
const value = l[k];
|
|
498
487
|
let stringValue = value;
|
package/dist/cli/Cli.js
CHANGED
|
@@ -458,7 +458,7 @@ class Cli {
|
|
|
458
458
|
// data so that returned objects contain only default properties specified
|
|
459
459
|
// on the current command. If there is no current command or the
|
|
460
460
|
// command doesn't specify default properties, return original data
|
|
461
|
-
if (
|
|
461
|
+
if (options.output === 'text' || options.output === 'csv') {
|
|
462
462
|
const cli = Cli.getInstance();
|
|
463
463
|
const currentCommand = cli.commandToExecute;
|
|
464
464
|
if (arrayType === 'object' &&
|
|
@@ -753,9 +753,6 @@ class Cli {
|
|
|
753
753
|
}
|
|
754
754
|
});
|
|
755
755
|
}
|
|
756
|
-
static shouldTrimOutput(output) {
|
|
757
|
-
return output === 'text' || output === 'csv';
|
|
758
|
-
}
|
|
759
756
|
}
|
|
760
757
|
exports.Cli = Cli;
|
|
761
758
|
Cli.defaultHelpMode = 'full';
|
|
@@ -15,7 +15,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _AadGroupListCommand_instances, _AadGroupListCommand_initTelemetry, _AadGroupListCommand_initOptions;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const Cli_1 = require("../../../../cli/Cli");
|
|
19
18
|
const odata_1 = require("../../../../utils/odata");
|
|
20
19
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
21
20
|
const commands_1 = require("../../commands");
|
|
@@ -40,7 +39,7 @@ class AadGroupListCommand extends GraphCommand_1.default {
|
|
|
40
39
|
const endpoint = args.options.deleted ? 'directory/deletedItems/microsoft.graph.group' : 'groups';
|
|
41
40
|
try {
|
|
42
41
|
const groups = yield odata_1.odata.getAllItems(`${this.resource}/v1.0/${endpoint}`);
|
|
43
|
-
if (
|
|
42
|
+
if (args.options.output === 'text') {
|
|
44
43
|
groups.forEach((group) => {
|
|
45
44
|
if (group.groupTypes && group.groupTypes.length > 0 && group.groupTypes[0] === 'Unified') {
|
|
46
45
|
group.groupType = 'Microsoft 365';
|
|
@@ -21,7 +21,6 @@ const AnonymousCommand_1 = require("../../../base/AnonymousCommand");
|
|
|
21
21
|
const commands_1 = require("../../commands");
|
|
22
22
|
const request_1 = require("../../../../request");
|
|
23
23
|
const xmldom_1 = require("@xmldom/xmldom");
|
|
24
|
-
const Cli_1 = require("../../../../cli/Cli");
|
|
25
24
|
class GraphChangelogListCommand extends AnonymousCommand_1.default {
|
|
26
25
|
get name() {
|
|
27
26
|
return commands_1.default.CHANGELOG_LIST;
|
|
@@ -107,14 +106,14 @@ class GraphChangelogListCommand extends AnonymousCommand_1.default {
|
|
|
107
106
|
items: []
|
|
108
107
|
};
|
|
109
108
|
Array.from(xmlDoc.getElementsByTagName('item')).forEach((item) => {
|
|
110
|
-
const description =
|
|
109
|
+
const description = args.options.output === 'text' ?
|
|
111
110
|
md_1.md.md2plain(item.getElementsByTagName('description').item(0).textContent, '') :
|
|
112
111
|
item.getElementsByTagName('description').item(0).textContent;
|
|
113
112
|
changelog.items.push({
|
|
114
113
|
guid: item.getElementsByTagName('guid').item(0).textContent,
|
|
115
114
|
category: item.getElementsByTagName('category').item(1).textContent,
|
|
116
115
|
title: item.getElementsByTagName('title').item(0).textContent,
|
|
117
|
-
description:
|
|
116
|
+
description: args.options.output === 'text' ?
|
|
118
117
|
description.length > 50 ? `${description.substring(0, 47)}...` : description :
|
|
119
118
|
description,
|
|
120
119
|
pubDate: new Date(item.getElementsByTagName('pubDate').item(0).textContent)
|
|
@@ -13,14 +13,14 @@ 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 _OneNoteNotebookListCommand_instances, _OneNoteNotebookListCommand_initTelemetry, _OneNoteNotebookListCommand_initOptions, _OneNoteNotebookListCommand_initValidators
|
|
16
|
+
var _OneNoteNotebookListCommand_instances, _OneNoteNotebookListCommand_initTelemetry, _OneNoteNotebookListCommand_initOptions, _OneNoteNotebookListCommand_initValidators;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const request_1 = require("../../../../request");
|
|
19
18
|
const odata_1 = require("../../../../utils/odata");
|
|
20
19
|
const validation_1 = require("../../../../utils/validation");
|
|
21
20
|
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
22
21
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
23
22
|
const commands_1 = require("../../commands");
|
|
23
|
+
const spo_1 = require("../../../../utils/spo");
|
|
24
24
|
class OneNoteNotebookListCommand extends GraphCommand_1.default {
|
|
25
25
|
get name() {
|
|
26
26
|
return commands_1.default.NOTEBOOK_LIST;
|
|
@@ -28,63 +28,61 @@ class OneNoteNotebookListCommand extends GraphCommand_1.default {
|
|
|
28
28
|
get description() {
|
|
29
29
|
return 'Retrieve a list of notebooks';
|
|
30
30
|
}
|
|
31
|
-
defaultProperties() {
|
|
32
|
-
return ['createdDateTime', 'displayName', 'id'];
|
|
33
|
-
}
|
|
34
31
|
constructor() {
|
|
35
32
|
super();
|
|
36
33
|
_OneNoteNotebookListCommand_instances.add(this);
|
|
37
34
|
__classPrivateFieldGet(this, _OneNoteNotebookListCommand_instances, "m", _OneNoteNotebookListCommand_initTelemetry).call(this);
|
|
38
35
|
__classPrivateFieldGet(this, _OneNoteNotebookListCommand_instances, "m", _OneNoteNotebookListCommand_initOptions).call(this);
|
|
39
36
|
__classPrivateFieldGet(this, _OneNoteNotebookListCommand_instances, "m", _OneNoteNotebookListCommand_initValidators).call(this);
|
|
40
|
-
__classPrivateFieldGet(this, _OneNoteNotebookListCommand_instances, "m", _OneNoteNotebookListCommand_initOptionSets).call(this);
|
|
41
37
|
}
|
|
42
38
|
getEndpointUrl(args) {
|
|
43
|
-
return
|
|
44
|
-
let endpoint = `${this.resource}/v1.0
|
|
39
|
+
return new Promise((resolve, reject) => {
|
|
40
|
+
let endpoint = `${this.resource}/v1.0/me/onenote/notebooks`;
|
|
45
41
|
if (args.options.userId) {
|
|
46
|
-
endpoint
|
|
42
|
+
endpoint = `${this.resource}/v1.0/users/${args.options.userId}/onenote/notebooks`;
|
|
43
|
+
return resolve(endpoint);
|
|
47
44
|
}
|
|
48
45
|
else if (args.options.userName) {
|
|
49
|
-
endpoint
|
|
46
|
+
endpoint = `${this.resource}/v1.0/users/${args.options.userName}/onenote/notebooks`;
|
|
47
|
+
return resolve(endpoint);
|
|
50
48
|
}
|
|
51
49
|
else if (args.options.groupId) {
|
|
52
|
-
endpoint
|
|
50
|
+
endpoint = `${this.resource}/v1.0/groups/${args.options.groupId}/onenote/notebooks`;
|
|
51
|
+
return resolve(endpoint);
|
|
53
52
|
}
|
|
54
53
|
else if (args.options.groupName) {
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
this
|
|
55
|
+
.getGroupId(args)
|
|
56
|
+
.then((retrievedgroupId) => {
|
|
57
|
+
endpoint = `${this.resource}/v1.0/groups/${retrievedgroupId}/onenote/notebooks`;
|
|
58
|
+
return resolve(endpoint);
|
|
59
|
+
})
|
|
60
|
+
.catch((err) => {
|
|
61
|
+
reject(err);
|
|
62
|
+
});
|
|
57
63
|
}
|
|
58
64
|
else if (args.options.webUrl) {
|
|
59
|
-
|
|
60
|
-
|
|
65
|
+
spo_1.spo.getSpoGraphSiteId(args.options.webUrl)
|
|
66
|
+
.then((siteId) => {
|
|
67
|
+
endpoint = `${this.resource}/v1.0/sites/${siteId}/onenote/notebooks`;
|
|
68
|
+
return resolve(endpoint);
|
|
69
|
+
})
|
|
70
|
+
.catch((err) => {
|
|
71
|
+
reject(err);
|
|
72
|
+
});
|
|
61
73
|
}
|
|
62
74
|
else {
|
|
63
|
-
endpoint
|
|
75
|
+
return resolve(endpoint);
|
|
64
76
|
}
|
|
65
|
-
endpoint += '/onenote/notebooks';
|
|
66
|
-
return endpoint;
|
|
67
77
|
});
|
|
68
78
|
}
|
|
69
|
-
|
|
70
|
-
return
|
|
71
|
-
const group = yield aadGroup_1.aadGroup.getGroupByDisplayName(groupName);
|
|
72
|
-
return group.id;
|
|
73
|
-
});
|
|
79
|
+
defaultProperties() {
|
|
80
|
+
return ['createdDateTime', 'displayName', 'id'];
|
|
74
81
|
}
|
|
75
|
-
|
|
76
|
-
return
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
url: `${this.resource}/v1.0/sites/${url.hostname}:${url.pathname}`,
|
|
80
|
-
headers: {
|
|
81
|
-
accept: 'application/json;odata.metadata=none'
|
|
82
|
-
},
|
|
83
|
-
responseType: 'json'
|
|
84
|
-
};
|
|
85
|
-
const site = yield request_1.default.get(requestOptions);
|
|
86
|
-
return site.id;
|
|
87
|
-
});
|
|
82
|
+
getGroupId(args) {
|
|
83
|
+
return aadGroup_1.aadGroup
|
|
84
|
+
.getGroupByDisplayName(args.options.groupName)
|
|
85
|
+
.then(group => group.id);
|
|
88
86
|
}
|
|
89
87
|
commandAction(logger, args) {
|
|
90
88
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -102,11 +100,7 @@ class OneNoteNotebookListCommand extends GraphCommand_1.default {
|
|
|
102
100
|
_OneNoteNotebookListCommand_instances = new WeakSet(), _OneNoteNotebookListCommand_initTelemetry = function _OneNoteNotebookListCommand_initTelemetry() {
|
|
103
101
|
this.telemetry.push((args) => {
|
|
104
102
|
Object.assign(this.telemetryProperties, {
|
|
105
|
-
|
|
106
|
-
userName: typeof args.options.userName !== 'undefined',
|
|
107
|
-
groupId: typeof args.options.groupId !== 'undefined',
|
|
108
|
-
groupName: typeof args.options.groupName !== 'undefined',
|
|
109
|
-
webUrl: typeof args.options.webUrl !== 'undefined'
|
|
103
|
+
joined: args.options.joined
|
|
110
104
|
});
|
|
111
105
|
});
|
|
112
106
|
}, _OneNoteNotebookListCommand_initOptions = function _OneNoteNotebookListCommand_initOptions() {
|
|
@@ -119,19 +113,14 @@ _OneNoteNotebookListCommand_instances = new WeakSet(), _OneNoteNotebookListComma
|
|
|
119
113
|
if (args.options.groupId && !validation_1.validation.isValidGuid(args.options.groupId)) {
|
|
120
114
|
return `${args.options.groupId} is not a valid GUID`;
|
|
121
115
|
}
|
|
122
|
-
if (args.options.
|
|
123
|
-
return
|
|
116
|
+
if (args.options.userId && args.options.userName) {
|
|
117
|
+
return 'Specify either userId or userName, but not both';
|
|
118
|
+
}
|
|
119
|
+
if (args.options.groupId && args.options.groupName) {
|
|
120
|
+
return 'Specify either groupId or groupName, but not both';
|
|
124
121
|
}
|
|
125
122
|
return true;
|
|
126
123
|
}));
|
|
127
|
-
}, _OneNoteNotebookListCommand_initOptionSets = function _OneNoteNotebookListCommand_initOptionSets() {
|
|
128
|
-
this.optionSets.push({
|
|
129
|
-
options: ['userId', 'userName', 'groupId', 'groupName', 'webUrl'],
|
|
130
|
-
runsWhen: (args) => {
|
|
131
|
-
const options = [args.options.userId, args.options.userName, args.options.groupId, args.options.groupName, args.options.webUrl];
|
|
132
|
-
return options.some(item => item !== undefined);
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
124
|
};
|
|
136
125
|
module.exports = new OneNoteNotebookListCommand();
|
|
137
126
|
//# sourceMappingURL=notebook-list.js.map
|
|
@@ -16,7 +16,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
16
16
|
var _PlannerTaskChecklistItemAddCommand_instances, _PlannerTaskChecklistItemAddCommand_initTelemetry, _PlannerTaskChecklistItemAddCommand_initOptions;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const uuid_1 = require("uuid");
|
|
19
|
-
const Cli_1 = require("../../../../cli/Cli");
|
|
20
19
|
const request_1 = require("../../../../request");
|
|
21
20
|
const formatting_1 = require("../../../../utils/formatting");
|
|
22
21
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
@@ -62,7 +61,7 @@ class PlannerTaskChecklistItemAddCommand extends GraphCommand_1.default {
|
|
|
62
61
|
data: body
|
|
63
62
|
};
|
|
64
63
|
const result = yield request_1.default.patch(requestOptions);
|
|
65
|
-
if (
|
|
64
|
+
if (args.options.output === 'json') {
|
|
66
65
|
logger.log(result.checklist);
|
|
67
66
|
}
|
|
68
67
|
else {
|
|
@@ -15,7 +15,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _PlannerTaskChecklistItemListCommand_instances, _PlannerTaskChecklistItemListCommand_initOptions;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const Cli_1 = require("../../../../cli/Cli");
|
|
19
18
|
const request_1 = require("../../../../request");
|
|
20
19
|
const formatting_1 = require("../../../../utils/formatting");
|
|
21
20
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
@@ -46,7 +45,7 @@ class PlannerTaskChecklistItemListCommand extends GraphCommand_1.default {
|
|
|
46
45
|
};
|
|
47
46
|
try {
|
|
48
47
|
const res = yield request_1.default.get(requestOptions);
|
|
49
|
-
if (!args.options.output ||
|
|
48
|
+
if (!args.options.output || args.options.output === 'json') {
|
|
50
49
|
logger.log(res.checklist);
|
|
51
50
|
}
|
|
52
51
|
else {
|
|
@@ -15,7 +15,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _PpSolutionGetCommand_instances, _PpSolutionGetCommand_initTelemetry, _PpSolutionGetCommand_initOptions, _PpSolutionGetCommand_initOptionSets, _PpSolutionGetCommand_initValidators;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const Cli_1 = require("../../../../cli/Cli");
|
|
19
18
|
const request_1 = require("../../../../request");
|
|
20
19
|
const powerPlatform_1 = require("../../../../utils/powerPlatform");
|
|
21
20
|
const validation_1 = require("../../../../utils/validation");
|
|
@@ -47,7 +46,7 @@ class PpSolutionGetCommand extends PowerPlatformCommand_1.default {
|
|
|
47
46
|
try {
|
|
48
47
|
const dynamicsApiUrl = yield powerPlatform_1.powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin);
|
|
49
48
|
const res = yield this.getSolution(dynamicsApiUrl, args.options);
|
|
50
|
-
if (!args.options.output ||
|
|
49
|
+
if (!args.options.output || args.options.output === 'json') {
|
|
51
50
|
logger.log(res);
|
|
52
51
|
}
|
|
53
52
|
else {
|
|
@@ -15,7 +15,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _PpSolutionListCommand_instances, _PpSolutionListCommand_initTelemetry, _PpSolutionListCommand_initOptions;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const Cli_1 = require("../../../../cli/Cli");
|
|
19
18
|
const odata_1 = require("../../../../utils/odata");
|
|
20
19
|
const powerPlatform_1 = require("../../../../utils/powerPlatform");
|
|
21
20
|
const PowerPlatformCommand_1 = require("../../../base/PowerPlatformCommand");
|
|
@@ -45,7 +44,7 @@ class PpSolutionListCommand extends PowerPlatformCommand_1.default {
|
|
|
45
44
|
const dynamicsApiUrl = yield powerPlatform_1.powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin);
|
|
46
45
|
const requestUrl = `${dynamicsApiUrl}/api/data/v9.0/solutions?$filter=isvisible eq true&$expand=publisherid($select=friendlyname)&$select=solutionid,uniquename,version,publisherid,installedon,solutionpackageversion,friendlyname,versionnumber&api-version=9.1`;
|
|
47
46
|
const res = yield odata_1.odata.getAllItems(requestUrl);
|
|
48
|
-
if (!args.options.output ||
|
|
47
|
+
if (!args.options.output || args.options.output === 'json') {
|
|
49
48
|
logger.log(res);
|
|
50
49
|
}
|
|
51
50
|
else {
|
|
@@ -17,7 +17,6 @@ var _SpoAppAddCommand_instances, _SpoAppAddCommand_initTelemetry, _SpoAppAddComm
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const fs = require("fs");
|
|
19
19
|
const path = require("path");
|
|
20
|
-
const Cli_1 = require("../../../../cli/Cli");
|
|
21
20
|
const request_1 = require("../../../../request");
|
|
22
21
|
const spo_1 = require("../../../../utils/spo");
|
|
23
22
|
const validation_1 = require("../../../../utils/validation");
|
|
@@ -59,7 +58,7 @@ class SpoAppAddCommand extends SpoAppBaseCommand_1.SpoAppBaseCommand {
|
|
|
59
58
|
};
|
|
60
59
|
const res = yield request_1.default.post(requestOptions);
|
|
61
60
|
const json = JSON.parse(res);
|
|
62
|
-
if (
|
|
61
|
+
if (args.options.output === 'json') {
|
|
63
62
|
logger.log(json);
|
|
64
63
|
}
|
|
65
64
|
else {
|
|
@@ -15,7 +15,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _SpoFileSharingInfoGetCommand_instances, _SpoFileSharingInfoGetCommand_initTelemetry, _SpoFileSharingInfoGetCommand_initOptions, _SpoFileSharingInfoGetCommand_initValidators, _SpoFileSharingInfoGetCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const Cli_1 = require("../../../../cli/Cli");
|
|
19
18
|
const request_1 = require("../../../../request");
|
|
20
19
|
const formatting_1 = require("../../../../utils/formatting");
|
|
21
20
|
const validation_1 = require("../../../../utils/validation");
|
|
@@ -61,7 +60,7 @@ class SpoFileSharingInfoGetCommand extends SpoCommand_1.default {
|
|
|
61
60
|
// typically, we don't do this, but in this case, we need to due to
|
|
62
61
|
// the complexity of the retrieved object and the fact that we can't
|
|
63
62
|
// use the generic way of simplifying the output
|
|
64
|
-
if (
|
|
63
|
+
if (args.options.output === 'json') {
|
|
65
64
|
logger.log(res);
|
|
66
65
|
}
|
|
67
66
|
else {
|
|
@@ -15,7 +15,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _SpoFileSharingLinkListCommand_instances, _SpoFileSharingLinkListCommand_initTelemetry, _SpoFileSharingLinkListCommand_initOptions, _SpoFileSharingLinkListCommand_initValidators, _SpoFileSharingLinkListCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const Cli_1 = require("../../../../cli/Cli");
|
|
19
18
|
const request_1 = require("../../../../request");
|
|
20
19
|
const formatting_1 = require("../../../../utils/formatting");
|
|
21
20
|
const odata_1 = require("../../../../utils/odata");
|
|
@@ -52,7 +51,7 @@ class SpoFileSharingLinkListCommand extends SpoCommand_1.default {
|
|
|
52
51
|
url += ` and Link/Scope eq '${args.options.scope}'`;
|
|
53
52
|
}
|
|
54
53
|
const sharingLinks = yield odata_1.odata.getAllItems(url);
|
|
55
|
-
if (!args.options.output ||
|
|
54
|
+
if (!args.options.output || args.options.output === 'json' || args.options.output === 'md') {
|
|
56
55
|
logger.log(sharingLinks);
|
|
57
56
|
}
|
|
58
57
|
else {
|
|
@@ -15,7 +15,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _SpoGroupListCommand_instances, _SpoGroupListCommand_initTelemetry, _SpoGroupListCommand_initOptions, _SpoGroupListCommand_initValidators;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const Cli_1 = require("../../../../cli/Cli");
|
|
19
18
|
const request_1 = require("../../../../request");
|
|
20
19
|
const odata_1 = require("../../../../utils/odata");
|
|
21
20
|
const validation_1 = require("../../../../utils/validation");
|
|
@@ -74,7 +73,7 @@ class SpoGroupListCommand extends SpoCommand_1.default {
|
|
|
74
73
|
};
|
|
75
74
|
const groupProperties = yield request_1.default.get(requestOptions);
|
|
76
75
|
logger.log(groupProperties);
|
|
77
|
-
if (!options.output ||
|
|
76
|
+
if (!options.output || options.output === 'json') {
|
|
78
77
|
logger.log(groupProperties);
|
|
79
78
|
}
|
|
80
79
|
else {
|
|
@@ -45,7 +45,7 @@ class SpoHubSiteGetCommand extends SpoCommand_1.default {
|
|
|
45
45
|
if (args.options.includeAssociatedSites && (args.options.output && args.options.output !== 'json')) {
|
|
46
46
|
throw 'includeAssociatedSites option is only allowed with json output mode';
|
|
47
47
|
}
|
|
48
|
-
if (args.options.includeAssociatedSites === true && args.options.output &&
|
|
48
|
+
if (args.options.includeAssociatedSites === true && args.options.output && args.options.output === 'json') {
|
|
49
49
|
const spoAdminUrl = yield spo_1.spo.getSpoAdminUrl(logger, this.debug);
|
|
50
50
|
const associatedSitesCommandOutput = yield this.getAssociatedSites(spoAdminUrl, hubSite.SiteId, logger, args);
|
|
51
51
|
const associatedSites = JSON.parse(associatedSitesCommandOutput.stdout);
|
|
@@ -15,7 +15,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _SpoListItemListCommand_instances, _SpoListItemListCommand_initTelemetry, _SpoListItemListCommand_initOptions, _SpoListItemListCommand_initValidators, _SpoListItemListCommand_initOptionSets, _SpoListItemListCommand_initTypes;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const Cli_1 = require("../../../../cli/Cli");
|
|
19
18
|
const request_1 = require("../../../../request");
|
|
20
19
|
const formatting_1 = require("../../../../utils/formatting");
|
|
21
20
|
const spo_1 = require("../../../../utils/spo");
|
|
@@ -54,7 +53,7 @@ class SpoListItemListCommand extends SpoCommand_1.default {
|
|
|
54
53
|
}
|
|
55
54
|
let formDigestValue = '';
|
|
56
55
|
const fieldsArray = args.options.fields ? args.options.fields.split(",")
|
|
57
|
-
: (!args.options.output ||
|
|
56
|
+
: (!args.options.output || args.options.output === "text") ? ["Title", "Id"] : [];
|
|
58
57
|
const fieldsWithSlash = fieldsArray.filter(item => item.includes('/'));
|
|
59
58
|
const fieldsToExpand = fieldsWithSlash.map(e => e.split('/')[0]);
|
|
60
59
|
const expandFieldsArray = fieldsToExpand.filter((item, pos) => fieldsToExpand.indexOf(item) === pos);
|
|
@@ -15,7 +15,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _SpoPageColumnGetCommand_instances, _SpoPageColumnGetCommand_initOptions, _SpoPageColumnGetCommand_initValidators;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const Cli_1 = require("../../../../cli/Cli");
|
|
19
18
|
const validation_1 = require("../../../../utils/validation");
|
|
20
19
|
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
21
20
|
const commands_1 = require("../../commands");
|
|
@@ -40,7 +39,7 @@ class SpoPageColumnGetCommand extends SpoCommand_1.default {
|
|
|
40
39
|
const sections = clientSidePage.sections
|
|
41
40
|
.filter(section => section.order === args.options.section);
|
|
42
41
|
if (sections.length) {
|
|
43
|
-
const isJSONOutput =
|
|
42
|
+
const isJSONOutput = args.options.output === 'json';
|
|
44
43
|
const columns = sections[0].columns.filter(col => col.order === args.options.column);
|
|
45
44
|
if (columns.length) {
|
|
46
45
|
const column = Page_1.Page.getColumnsInformation(columns[0], isJSONOutput);
|
|
@@ -15,7 +15,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _SpoPageColumnListCommand_instances, _SpoPageColumnListCommand_initOptions, _SpoPageColumnListCommand_initValidators;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const Cli_1 = require("../../../../cli/Cli");
|
|
19
18
|
const validation_1 = require("../../../../utils/validation");
|
|
20
19
|
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
21
20
|
const commands_1 = require("../../commands");
|
|
@@ -40,7 +39,7 @@ class SpoPageColumnListCommand extends SpoCommand_1.default {
|
|
|
40
39
|
const sections = clientSidePage.sections
|
|
41
40
|
.filter(section => section.order === args.options.section);
|
|
42
41
|
if (sections.length) {
|
|
43
|
-
const isJSONOutput =
|
|
42
|
+
const isJSONOutput = args.options.output === 'json';
|
|
44
43
|
logger.log(sections[0].columns.map(c => {
|
|
45
44
|
const column = Page_1.Page.getColumnsInformation(c, isJSONOutput);
|
|
46
45
|
column.controls = c.controls.length;
|
|
@@ -15,7 +15,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _SpoPageSectionGetCommand_instances, _SpoPageSectionGetCommand_initOptions, _SpoPageSectionGetCommand_initValidators;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const Cli_1 = require("../../../../cli/Cli");
|
|
19
18
|
const validation_1 = require("../../../../utils/validation");
|
|
20
19
|
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
21
20
|
const commands_1 = require("../../commands");
|
|
@@ -39,7 +38,7 @@ class SpoPageSectionGetCommand extends SpoCommand_1.default {
|
|
|
39
38
|
const clientSidePage = yield Page_1.Page.getPage(args.options.pageName, args.options.webUrl, logger, this.debug, this.verbose);
|
|
40
39
|
const sections = clientSidePage.sections
|
|
41
40
|
.filter(section => section.order === args.options.section);
|
|
42
|
-
const isJSONOutput =
|
|
41
|
+
const isJSONOutput = args.options.output === 'json';
|
|
43
42
|
if (sections.length) {
|
|
44
43
|
logger.log(Page_1.Page.getSectionInformation(sections[0], isJSONOutput));
|
|
45
44
|
}
|
|
@@ -15,7 +15,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _SpoPageSectionListCommand_instances, _SpoPageSectionListCommand_initOptions, _SpoPageSectionListCommand_initValidators;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const Cli_1 = require("../../../../cli/Cli");
|
|
19
18
|
const validation_1 = require("../../../../utils/validation");
|
|
20
19
|
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
21
20
|
const commands_1 = require("../../commands");
|
|
@@ -38,7 +37,7 @@ class SpoPageSectionListCommand extends SpoCommand_1.default {
|
|
|
38
37
|
try {
|
|
39
38
|
const clientSidePage = yield Page_1.Page.getPage(args.options.pageName, args.options.webUrl, logger, this.debug, this.verbose);
|
|
40
39
|
const sections = clientSidePage.sections;
|
|
41
|
-
const isJSONOutput =
|
|
40
|
+
const isJSONOutput = args.options.output === 'json';
|
|
42
41
|
if (sections.length) {
|
|
43
42
|
const output = sections.map(section => Page_1.Page.getSectionInformation(section, isJSONOutput));
|
|
44
43
|
if (isJSONOutput) {
|
|
@@ -16,7 +16,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
16
16
|
var _SpoSearchCommand_instances, _SpoSearchCommand_initTelemetry, _SpoSearchCommand_initOptions, _SpoSearchCommand_initValidators;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const util_1 = require("util");
|
|
19
|
-
const Cli_1 = require("../../../cli/Cli");
|
|
20
19
|
const request_1 = require("../../../request");
|
|
21
20
|
const formatting_1 = require("../../../utils/formatting");
|
|
22
21
|
const spo_1 = require("../../../utils/spo");
|
|
@@ -138,7 +137,7 @@ class SpoSearchCommand extends SpoCommand_1.default {
|
|
|
138
137
|
else {
|
|
139
138
|
logger.log(this.getParsedOutput(args, results));
|
|
140
139
|
}
|
|
141
|
-
if (!args.options.output ||
|
|
140
|
+
if (!args.options.output || args.options.output === 'text') {
|
|
142
141
|
logger.log("# Rows: " + results[results.length - 1].PrimaryQueryResult.RelevantResults.TotalRows);
|
|
143
142
|
logger.log("# Rows (Including duplicates): " + results[results.length - 1].PrimaryQueryResult.RelevantResults.TotalRowsIncludingDuplicates);
|
|
144
143
|
logger.log("Elapsed Time: " + this.getElapsedTime(results));
|
|
@@ -15,7 +15,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _SpoTermListCommand_instances, _SpoTermListCommand_initTelemetry, _SpoTermListCommand_initOptions, _SpoTermListCommand_initValidators, _SpoTermListCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const Cli_1 = require("../../../../cli/Cli");
|
|
19
18
|
const config_1 = require("../../../../config");
|
|
20
19
|
const request_1 = require("../../../../request");
|
|
21
20
|
const formatting_1 = require("../../../../utils/formatting");
|
|
@@ -63,7 +62,7 @@ class SpoTermListCommand extends SpoCommand_1.default {
|
|
|
63
62
|
}
|
|
64
63
|
}
|
|
65
64
|
}
|
|
66
|
-
if (!args.options.output ||
|
|
65
|
+
if (!args.options.output || args.options.output === 'json') {
|
|
67
66
|
logger.log(terms);
|
|
68
67
|
}
|
|
69
68
|
else if (!args.options.includeChildTerms) {
|
|
@@ -15,7 +15,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _SpoUserProfileGetCommand_instances, _SpoUserProfileGetCommand_initOptions, _SpoUserProfileGetCommand_initValidators;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const Cli_1 = require("../../../../cli/Cli");
|
|
19
18
|
const request_1 = require("../../../../request");
|
|
20
19
|
const formatting_1 = require("../../../../utils/formatting");
|
|
21
20
|
const spo_1 = require("../../../../utils/spo");
|
|
@@ -48,7 +47,8 @@ class SpoUserProfileGetCommand extends SpoCommand_1.default {
|
|
|
48
47
|
responseType: 'json'
|
|
49
48
|
};
|
|
50
49
|
const res = yield request_1.default.get(requestOptions);
|
|
51
|
-
if (!args.options.output ||
|
|
50
|
+
if (!args.options.output ||
|
|
51
|
+
args.options.output === 'text') {
|
|
52
52
|
res.UserProfileProperties = JSON.stringify(res.UserProfileProperties);
|
|
53
53
|
}
|
|
54
54
|
logger.log(res);
|
|
@@ -79,7 +79,7 @@ class TeamsMeetingListCommand extends GraphCommand_1.default {
|
|
|
79
79
|
}
|
|
80
80
|
const res = yield odata_1.odata.getAllItems(requestUrl);
|
|
81
81
|
const resFiltered = res.filter(y => y.isOnlineMeeting);
|
|
82
|
-
if (!args.options.output ||
|
|
82
|
+
if (!args.options.output || args.options.output === 'json') {
|
|
83
83
|
logger.log(resFiltered);
|
|
84
84
|
}
|
|
85
85
|
else {
|
|
@@ -47,7 +47,7 @@ class TeamsTeamAppListCommand extends GraphCommand_1.default {
|
|
|
47
47
|
}
|
|
48
48
|
const teamId = yield this.getTeamId(args);
|
|
49
49
|
const res = yield odata_1.odata.getAllItems(`${this.resource}/v1.0/teams/${teamId}/installedApps?$expand=teamsApp,teamsAppDefinition`);
|
|
50
|
-
if (
|
|
50
|
+
if (args.options.output === 'json') {
|
|
51
51
|
logger.log(res);
|
|
52
52
|
}
|
|
53
53
|
else {
|
|
@@ -15,7 +15,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _TeamsUserAppListCommand_instances, _TeamsUserAppListCommand_initTelemetry, _TeamsUserAppListCommand_initOptions, _TeamsUserAppListCommand_initValidators, _TeamsUserAppListCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const Cli_1 = require("../../../../cli/Cli");
|
|
19
18
|
const request_1 = require("../../../../request");
|
|
20
19
|
const formatting_1 = require("../../../../utils/formatting");
|
|
21
20
|
const odata_1 = require("../../../../utils/odata");
|
|
@@ -48,7 +47,7 @@ class TeamsUserAppListCommand extends GraphCommand_1.default {
|
|
|
48
47
|
const appId = userAppId.substr(userAppId.indexOf("##") + 2, userAppId.length - userId.length - 2);
|
|
49
48
|
i.appId = appId;
|
|
50
49
|
});
|
|
51
|
-
if (
|
|
50
|
+
if (args.options.output === 'json') {
|
|
52
51
|
logger.log(items);
|
|
53
52
|
}
|
|
54
53
|
else {
|
|
@@ -15,7 +15,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _TodoTaskGetCommand_instances, _TodoTaskGetCommand_initTelemetry, _TodoTaskGetCommand_initOptions, _TodoTaskGetCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const Cli_1 = require("../../../../cli/Cli");
|
|
19
18
|
const request_1 = require("../../../../request");
|
|
20
19
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
21
20
|
const commands_1 = require("../../commands");
|
|
@@ -68,7 +67,7 @@ class TodoTaskGetCommand extends GraphCommand_1.default {
|
|
|
68
67
|
responseType: 'json'
|
|
69
68
|
};
|
|
70
69
|
const item = yield request_1.default.get(requestOptions);
|
|
71
|
-
if (
|
|
70
|
+
if (args.options.output === 'json') {
|
|
72
71
|
logger.log(item);
|
|
73
72
|
}
|
|
74
73
|
else {
|
|
@@ -15,7 +15,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _TodoTaskListCommand_instances, _TodoTaskListCommand_initTelemetry, _TodoTaskListCommand_initOptions, _TodoTaskListCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const Cli_1 = require("../../../../cli/Cli");
|
|
19
18
|
const request_1 = require("../../../../request");
|
|
20
19
|
const odata_1 = require("../../../../utils/odata");
|
|
21
20
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
@@ -63,7 +62,7 @@ class TodoTaskListCommand extends GraphCommand_1.default {
|
|
|
63
62
|
const listId = yield this.getTodoListId(args);
|
|
64
63
|
const endpoint = `${this.resource}/v1.0/me/todo/lists/${listId}/tasks`;
|
|
65
64
|
const items = yield odata_1.odata.getAllItems(endpoint);
|
|
66
|
-
if (
|
|
65
|
+
if (args.options.output === 'json') {
|
|
67
66
|
logger.log(items);
|
|
68
67
|
}
|
|
69
68
|
else {
|
|
@@ -15,7 +15,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _YammerSearchCommand_instances, _YammerSearchCommand_initTelemetry, _YammerSearchCommand_initOptions, _YammerSearchCommand_initValidators;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const Cli_1 = require("../../../cli/Cli");
|
|
19
18
|
const request_1 = require("../../../request");
|
|
20
19
|
const formatting_1 = require("../../../utils/formatting");
|
|
21
20
|
const YammerCommand_1 = require("../../base/YammerCommand");
|
|
@@ -130,7 +129,7 @@ class YammerSearchCommand extends YammerCommand_1.default {
|
|
|
130
129
|
this.users = [];
|
|
131
130
|
try {
|
|
132
131
|
yield this.getAllItems(logger, args, 1);
|
|
133
|
-
if (
|
|
132
|
+
if (args.options.output === 'json') {
|
|
134
133
|
logger.log({
|
|
135
134
|
summary: this.summary,
|
|
136
135
|
messages: this.messages,
|
|
@@ -35,7 +35,7 @@ m365 spo navigation node add [options]
|
|
|
35
35
|
|
|
36
36
|
## Remarks
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
In order to use option `audienceIds`, make sure that audience targeted navigation is enabled using command [spo web set](../web/web-set.md).
|
|
39
39
|
|
|
40
40
|
## Examples
|
|
41
41
|
|
|
@@ -32,7 +32,7 @@ m365 spo navigation node set [options]
|
|
|
32
32
|
|
|
33
33
|
## Remarks
|
|
34
34
|
|
|
35
|
-
To enable/disable audience targeting for the
|
|
35
|
+
To enable/disable audience targeting for the nsavigation bar, use command [`spo web set`](../web/web-set.md).
|
|
36
36
|
|
|
37
37
|
## Examples
|
|
38
38
|
|
package/package.json
CHANGED