@pnp/cli-microsoft365 6.0.0 → 6.1.0-beta.54cca1f
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/cli/Cli.js +48 -5
- package/dist/m365/planner/commands/plan/plan-set.js +305 -0
- package/dist/m365/planner/commands/tenant/tenant-settings-set.js +4 -7
- package/dist/m365/planner/commands.js +1 -0
- package/dist/m365/pp/commands/chatbot/chatbot-get.js +111 -0
- package/dist/m365/pp/commands/chatbot/chatbot-remove.js +131 -0
- package/dist/m365/pp/commands/dataverse/dataverse-table-row-list.js +95 -0
- package/dist/m365/pp/commands/solution/solution-publisher-add.js +101 -0
- package/dist/m365/pp/commands.js +4 -0
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-list.js +38 -0
- package/dist/m365/purview/commands.js +7 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.16.1.js +23 -0
- package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN006006_CFG_PS_features.js +63 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN015009_FILE_config_sass_json.js +14 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.14.0.js +2 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.16.1.js +59 -0
- package/dist/m365/spfx/commands/project/project-upgrade.js +2 -1
- package/dist/m365/spfx/commands/spfx-doctor.js +15 -0
- package/dist/m365/spo/commands/contenttype/contenttype-set.js +78 -31
- package/dist/m365/spo/commands/file/file-get.js +5 -17
- package/dist/m365/spo/commands/folder/folder-get.js +1 -9
- package/dist/m365/spo/commands/listitem/listitem-get.js +4 -16
- package/dist/m365/spo/commands/listitem/listitem-list.js +2 -2
- package/dist/m365/spo/commands/listitem/listitem-set.js +7 -4
- package/dist/m365/spo/commands/navigation/navigation-node-add.js +5 -1
- package/dist/m365/spo/commands/roledefinition/roledefinition-list.js +2 -13
- package/dist/m365/spo/commands/web/web-get.js +5 -16
- package/dist/m365/teams/commands/meeting/meeting-attendancereport-list.js +121 -0
- package/dist/m365/teams/commands/user/user-app-list.js +1 -1
- package/dist/m365/teams/commands.js +1 -0
- package/dist/utils/formatting.js +37 -0
- package/docs/docs/cmd/cli/cli-consent.md +20 -0
- package/docs/docs/cmd/cli/cli-doctor.md +50 -0
- package/docs/docs/cmd/cli/cli-issue.md +20 -0
- package/docs/docs/cmd/cli/cli-reconsent.md +20 -0
- package/docs/docs/cmd/cli/completion/completion-clink-update.md +5 -1
- package/docs/docs/cmd/cli/completion/completion-pwsh-setup.md +5 -1
- package/docs/docs/cmd/cli/completion/completion-pwsh-update.md +5 -1
- package/docs/docs/cmd/cli/completion/completion-sh-setup.md +21 -1
- package/docs/docs/cmd/cli/completion/completion-sh-update.md +4 -0
- package/docs/docs/cmd/cli/config/config-get.md +22 -0
- package/docs/docs/cmd/cli/config/config-reset.md +4 -0
- package/docs/docs/cmd/cli/config/config-set.md +4 -0
- package/docs/docs/cmd/planner/plan/plan-set.md +144 -0
- package/docs/docs/cmd/pp/chatbot/chatbot-get.md +123 -0
- package/docs/docs/cmd/pp/chatbot/chatbot-remove.md +52 -0
- package/docs/docs/cmd/pp/dataverse/dataverse-table-row-list.md +90 -0
- package/docs/docs/cmd/pp/solution/solution-publisher-add.md +49 -0
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-list.md +81 -0
- package/docs/docs/cmd/search/externalconnection/externalconnection-add.md +4 -0
- package/docs/docs/cmd/search/externalconnection/externalconnection-get.md +38 -0
- package/docs/docs/cmd/search/externalconnection/externalconnection-list.md +38 -0
- package/docs/docs/cmd/search/externalconnection/externalconnection-remove.md +4 -0
- package/docs/docs/cmd/spfx/project/project-upgrade.md +1 -1
- package/docs/docs/cmd/spo/contenttype/contenttype-set.md +15 -1
- package/docs/docs/cmd/spo/navigation/navigation-node-add.md +6 -6
- package/docs/docs/cmd/teams/meeting/meeting-attendancereport-list.md +69 -0
- package/docs/docs/cmd/teams/user/user-app-list.md +6 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -2
|
@@ -21,6 +21,7 @@ const validation_1 = require("../../../../utils/validation");
|
|
|
21
21
|
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
22
22
|
const commands_1 = require("../../commands");
|
|
23
23
|
const request_1 = require("../../../../request");
|
|
24
|
+
const config_1 = require("../../../../config");
|
|
24
25
|
class SpoContentTypeSetCommand extends SpoCommand_1.default {
|
|
25
26
|
constructor() {
|
|
26
27
|
super();
|
|
@@ -35,46 +36,32 @@ class SpoContentTypeSetCommand extends SpoCommand_1.default {
|
|
|
35
36
|
return commands_1.default.CONTENTTYPE_SET;
|
|
36
37
|
}
|
|
37
38
|
get description() {
|
|
38
|
-
return '
|
|
39
|
+
return 'Update an existing content type';
|
|
39
40
|
}
|
|
40
41
|
allowUnknownOptions() {
|
|
41
42
|
return true;
|
|
42
43
|
}
|
|
43
44
|
commandAction(logger, args) {
|
|
44
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
-
const requestOptions = {
|
|
46
|
-
url: `${args.options.webUrl}/_api/Web`,
|
|
47
|
-
headers: {
|
|
48
|
-
accept: 'application/json;odata=nometadata'
|
|
49
|
-
},
|
|
50
|
-
responseType: 'json',
|
|
51
|
-
data: this.getRequestPayload(args.options)
|
|
52
|
-
};
|
|
53
|
-
if (args.options.listId) {
|
|
54
|
-
requestOptions.url += `/Lists/GetById('${formatting_1.formatting.encodeQueryParameter(args.options.listId)}')`;
|
|
55
|
-
}
|
|
56
|
-
else if (args.options.listTitle) {
|
|
57
|
-
requestOptions.url += `/Lists/GetByTitle('${formatting_1.formatting.encodeQueryParameter(args.options.listTitle)}')`;
|
|
58
|
-
}
|
|
59
|
-
else if (args.options.listUrl) {
|
|
60
|
-
requestOptions.url += `/GetList('${formatting_1.formatting.encodeQueryParameter(urlUtil_1.urlUtil.getServerRelativePath(args.options.webUrl, args.options.listUrl))}')`;
|
|
61
|
-
}
|
|
62
|
-
requestOptions.url += '/ContentTypes';
|
|
63
46
|
try {
|
|
64
|
-
const contentTypeId = yield this.getContentTypeId(args.options);
|
|
65
|
-
|
|
66
|
-
yield
|
|
47
|
+
const contentTypeId = yield this.getContentTypeId(logger, args.options);
|
|
48
|
+
const siteId = yield this.getSiteId(logger, args.options.webUrl);
|
|
49
|
+
const webId = yield this.getWebId(logger, args.options.webUrl);
|
|
50
|
+
yield this.updateContentType(logger, siteId, webId, contentTypeId, args.options);
|
|
67
51
|
}
|
|
68
52
|
catch (err) {
|
|
69
|
-
this.
|
|
53
|
+
this.handleRejectedODataJsonPromise(err);
|
|
70
54
|
}
|
|
71
55
|
});
|
|
72
56
|
}
|
|
73
|
-
getContentTypeId(options) {
|
|
57
|
+
getContentTypeId(logger, options) {
|
|
74
58
|
return __awaiter(this, void 0, void 0, function* () {
|
|
75
59
|
if (options.id) {
|
|
76
60
|
return options.id;
|
|
77
61
|
}
|
|
62
|
+
if (this.verbose) {
|
|
63
|
+
logger.logToStderr(`Retrieving content type to update...`);
|
|
64
|
+
}
|
|
78
65
|
const requestOptions = {
|
|
79
66
|
url: `${options.webUrl}/_api/Web`,
|
|
80
67
|
headers: {
|
|
@@ -99,6 +86,27 @@ class SpoContentTypeSetCommand extends SpoCommand_1.default {
|
|
|
99
86
|
return res.value[0].Id.StringValue;
|
|
100
87
|
});
|
|
101
88
|
}
|
|
89
|
+
updateContentType(logger, siteId, webId, contentTypeId, options) {
|
|
90
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
91
|
+
if (this.verbose) {
|
|
92
|
+
logger.logToStderr(`Updating content type...`);
|
|
93
|
+
}
|
|
94
|
+
const payload = this.getRequestPayload(options);
|
|
95
|
+
const requestOptions = {
|
|
96
|
+
url: `${options.webUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
97
|
+
headers: {
|
|
98
|
+
'Content-Type': 'text/xml'
|
|
99
|
+
},
|
|
100
|
+
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>${payload}</Actions><ObjectPaths><Identity Id="9" Name="fc4179a0-e0d7-5000-c38b-bc3506fbab6f|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:${siteId}:web:${webId}:contenttype:${formatting_1.formatting.escapeXml(contentTypeId)}" /></ObjectPaths></Request>`
|
|
101
|
+
};
|
|
102
|
+
const res = yield request_1.default.post(requestOptions);
|
|
103
|
+
const json = JSON.parse(res);
|
|
104
|
+
const response = json[0];
|
|
105
|
+
if (response.ErrorInfo) {
|
|
106
|
+
throw response.ErrorInfo.ErrorMessage;
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
}
|
|
102
110
|
getRequestPayload(options) {
|
|
103
111
|
const excludeOptions = [
|
|
104
112
|
'webUrl',
|
|
@@ -110,15 +118,51 @@ class SpoContentTypeSetCommand extends SpoCommand_1.default {
|
|
|
110
118
|
'query',
|
|
111
119
|
'debug',
|
|
112
120
|
'verbose',
|
|
113
|
-
'output'
|
|
121
|
+
'output',
|
|
122
|
+
'updateChildren'
|
|
114
123
|
];
|
|
124
|
+
let i = 12;
|
|
115
125
|
const payload = Object.keys(options)
|
|
116
126
|
.filter(key => excludeOptions.indexOf(key) === -1)
|
|
117
|
-
.
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
127
|
+
.map(key => {
|
|
128
|
+
return `<SetProperty Id="${i++}" ObjectPathId="9" Name="${key}"><Parameter Type="String">${formatting_1.formatting.escapeXml(options[key])}</Parameter></SetProperty>`;
|
|
129
|
+
});
|
|
130
|
+
if (options.updateChildren) {
|
|
131
|
+
payload.push(`<Method Name="Update" Id="${i++}" ObjectPathId="9"><Parameters><Parameter Type="Boolean">true</Parameter></Parameters></Method>`);
|
|
132
|
+
}
|
|
133
|
+
return payload.join('');
|
|
134
|
+
}
|
|
135
|
+
getSiteId(logger, webUrl) {
|
|
136
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
137
|
+
if (this.verbose) {
|
|
138
|
+
logger.logToStderr(`Retrieving site collection id...`);
|
|
139
|
+
}
|
|
140
|
+
const requestOptions = {
|
|
141
|
+
url: `${webUrl}/_api/site?$select=Id`,
|
|
142
|
+
headers: {
|
|
143
|
+
accept: 'application/json;odata=nometadata'
|
|
144
|
+
},
|
|
145
|
+
responseType: 'json'
|
|
146
|
+
};
|
|
147
|
+
const site = yield request_1.default.get(requestOptions);
|
|
148
|
+
return site.Id;
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
getWebId(logger, webUrl) {
|
|
152
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
153
|
+
if (this.verbose) {
|
|
154
|
+
logger.logToStderr(`Retrieving web id...`);
|
|
155
|
+
}
|
|
156
|
+
const requestOptions = {
|
|
157
|
+
url: `${webUrl}/_api/web?$select=Id`,
|
|
158
|
+
headers: {
|
|
159
|
+
accept: 'application/json;odata=nometadata'
|
|
160
|
+
},
|
|
161
|
+
responseType: 'json'
|
|
162
|
+
};
|
|
163
|
+
const web = yield request_1.default.get(requestOptions);
|
|
164
|
+
return web.Id;
|
|
165
|
+
});
|
|
122
166
|
}
|
|
123
167
|
}
|
|
124
168
|
_SpoContentTypeSetCommand_instances = new WeakSet(), _SpoContentTypeSetCommand_initTelemetry = function _SpoContentTypeSetCommand_initTelemetry() {
|
|
@@ -128,7 +172,8 @@ _SpoContentTypeSetCommand_instances = new WeakSet(), _SpoContentTypeSetCommand_i
|
|
|
128
172
|
name: typeof args.options.name !== 'undefined',
|
|
129
173
|
listTitle: typeof args.options.listTitle !== 'undefined',
|
|
130
174
|
listId: typeof args.options.listId !== 'undefined',
|
|
131
|
-
listUrl: typeof args.options.listUrl !== 'undefined'
|
|
175
|
+
listUrl: typeof args.options.listUrl !== 'undefined',
|
|
176
|
+
updateChildren: args.options.updateChildren
|
|
132
177
|
});
|
|
133
178
|
});
|
|
134
179
|
}, _SpoContentTypeSetCommand_initOptions = function _SpoContentTypeSetCommand_initOptions() {
|
|
@@ -144,6 +189,8 @@ _SpoContentTypeSetCommand_instances = new WeakSet(), _SpoContentTypeSetCommand_i
|
|
|
144
189
|
option: '--listId [listId]'
|
|
145
190
|
}, {
|
|
146
191
|
option: '--listUrl [listUrl]'
|
|
192
|
+
}, {
|
|
193
|
+
option: '--updateChildren'
|
|
147
194
|
});
|
|
148
195
|
}, _SpoContentTypeSetCommand_initValidators = function _SpoContentTypeSetCommand_initValidators() {
|
|
149
196
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -21,9 +21,7 @@ const request_1 = require("../../../../request");
|
|
|
21
21
|
const formatting_1 = require("../../../../utils/formatting");
|
|
22
22
|
const validation_1 = require("../../../../utils/validation");
|
|
23
23
|
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
24
|
-
const base_permissions_1 = require("../../base-permissions");
|
|
25
24
|
const commands_1 = require("../../commands");
|
|
26
|
-
const RoleType_1 = require("../roledefinition/RoleType");
|
|
27
25
|
class SpoFileGetCommand extends SpoCommand_1.default {
|
|
28
26
|
constructor() {
|
|
29
27
|
super();
|
|
@@ -107,10 +105,12 @@ class SpoFileGetCommand extends SpoCommand_1.default {
|
|
|
107
105
|
if (args.options.withPermissions) {
|
|
108
106
|
requestOptions.url = `${args.options.webUrl}/_api/web/GetFileByServerRelativePath(DecodedUrl='${file.ServerRelativeUrl}')/ListItemAllFields/RoleAssignments?$expand=Member,RoleDefinitionBindings`;
|
|
109
107
|
const response = yield request_1.default.get(requestOptions);
|
|
110
|
-
|
|
111
|
-
|
|
108
|
+
response.value.forEach((r) => {
|
|
109
|
+
r.RoleDefinitionBindings = formatting_1.formatting.setFriendlyPermissions(r.RoleDefinitionBindings);
|
|
110
|
+
});
|
|
111
|
+
fileProperties.RoleAssignments = response.value;
|
|
112
112
|
if (args.options.asListItem) {
|
|
113
|
-
fileProperties.ListItemAllFields.RoleAssignments =
|
|
113
|
+
fileProperties.ListItemAllFields.RoleAssignments = response.value;
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
logger.log(args.options.asListItem ? fileProperties.ListItemAllFields : fileProperties);
|
|
@@ -122,18 +122,6 @@ class SpoFileGetCommand extends SpoCommand_1.default {
|
|
|
122
122
|
}
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
|
-
setFriendlyPermissions(response) {
|
|
126
|
-
response.forEach((r) => {
|
|
127
|
-
r.RoleDefinitionBindings.forEach((r) => {
|
|
128
|
-
const permissions = new base_permissions_1.BasePermissions();
|
|
129
|
-
permissions.high = r.BasePermissions.High;
|
|
130
|
-
permissions.low = r.BasePermissions.Low;
|
|
131
|
-
r.BasePermissionsValue = permissions.parse();
|
|
132
|
-
r.RoleTypeKindValue = RoleType_1.RoleType[r.RoleTypeKind];
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
|
-
return response;
|
|
136
|
-
}
|
|
137
125
|
}
|
|
138
126
|
_SpoFileGetCommand_instances = new WeakSet(), _SpoFileGetCommand_initTelemetry = function _SpoFileGetCommand_initTelemetry() {
|
|
139
127
|
this.telemetry.push((args) => {
|
|
@@ -23,8 +23,6 @@ const validation_1 = require("../../../../utils/validation");
|
|
|
23
23
|
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
24
24
|
const commands_1 = require("../../commands");
|
|
25
25
|
const ListPrincipalType_1 = require("../list/ListPrincipalType");
|
|
26
|
-
const base_permissions_1 = require("../../base-permissions");
|
|
27
|
-
const RoleType_1 = require("../../commands/roledefinition/RoleType");
|
|
28
26
|
class SpoFolderGetCommand extends SpoCommand_1.default {
|
|
29
27
|
constructor() {
|
|
30
28
|
super();
|
|
@@ -72,13 +70,7 @@ class SpoFolderGetCommand extends SpoCommand_1.default {
|
|
|
72
70
|
}
|
|
73
71
|
listItemAllFields.RoleAssignments.forEach(r => {
|
|
74
72
|
r.Member.PrincipalTypeString = ListPrincipalType_1.ListPrincipalType[r.Member.PrincipalType];
|
|
75
|
-
r.RoleDefinitionBindings.
|
|
76
|
-
const permissions = new base_permissions_1.BasePermissions();
|
|
77
|
-
permissions.high = rb.BasePermissions.High;
|
|
78
|
-
permissions.low = rb.BasePermissions.Low;
|
|
79
|
-
rb.BasePermissionsValue = permissions.parse();
|
|
80
|
-
rb.RoleTypeKindValue = RoleType_1.RoleType[rb.RoleTypeKind];
|
|
81
|
-
});
|
|
73
|
+
r.RoleDefinitionBindings = formatting_1.formatting.setFriendlyPermissions(r.RoleDefinitionBindings);
|
|
82
74
|
});
|
|
83
75
|
}
|
|
84
76
|
logger.log(folder);
|
|
@@ -20,9 +20,7 @@ const formatting_1 = require("../../../../utils/formatting");
|
|
|
20
20
|
const urlUtil_1 = require("../../../../utils/urlUtil");
|
|
21
21
|
const validation_1 = require("../../../../utils/validation");
|
|
22
22
|
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
23
|
-
const base_permissions_1 = require("../../base-permissions");
|
|
24
23
|
const commands_1 = require("../../commands");
|
|
25
|
-
const RoleType_1 = require("../roledefinition/RoleType");
|
|
26
24
|
class SpoListItemGetCommand extends SpoCommand_1.default {
|
|
27
25
|
constructor() {
|
|
28
26
|
super();
|
|
@@ -72,8 +70,10 @@ class SpoListItemGetCommand extends SpoCommand_1.default {
|
|
|
72
70
|
if (args.options.withPermissions) {
|
|
73
71
|
requestOptions.url = `${requestUrl}/items(${args.options.id})/RoleAssignments?$expand=Member,RoleDefinitionBindings`;
|
|
74
72
|
const response = yield request_1.default.get(requestOptions);
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
response.value.forEach((r) => {
|
|
74
|
+
r.RoleDefinitionBindings = formatting_1.formatting.setFriendlyPermissions(r.RoleDefinitionBindings);
|
|
75
|
+
});
|
|
76
|
+
itemProperties.RoleAssignments = response.value;
|
|
77
77
|
}
|
|
78
78
|
delete itemProperties['ID'];
|
|
79
79
|
logger.log(itemProperties);
|
|
@@ -83,18 +83,6 @@ class SpoListItemGetCommand extends SpoCommand_1.default {
|
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
|
-
setFriendlyPermissions(response) {
|
|
87
|
-
response.forEach((r) => {
|
|
88
|
-
r.RoleDefinitionBindings.forEach((r) => {
|
|
89
|
-
const permissions = new base_permissions_1.BasePermissions();
|
|
90
|
-
permissions.high = r.BasePermissions.High;
|
|
91
|
-
permissions.low = r.BasePermissions.Low;
|
|
92
|
-
r.BasePermissionsValue = permissions.parse();
|
|
93
|
-
r.RoleTypeKindValue = RoleType_1.RoleType[r.RoleTypeKind];
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
return response;
|
|
97
|
-
}
|
|
98
86
|
}
|
|
99
87
|
_SpoListItemGetCommand_instances = new WeakSet(), _SpoListItemGetCommand_initTelemetry = function _SpoListItemGetCommand_initTelemetry() {
|
|
100
88
|
this.telemetry.push((args) => {
|
|
@@ -68,7 +68,7 @@ class SpoListItemListCommand extends SpoCommand_1.default {
|
|
|
68
68
|
let res;
|
|
69
69
|
if (args.options.pageNumber && Number(args.options.pageNumber) > 0) {
|
|
70
70
|
const rowLimit = `$top=${Number(args.options.pageSize) * Number(args.options.pageNumber)}`;
|
|
71
|
-
const filter = args.options.filter ? `$filter=${
|
|
71
|
+
const filter = args.options.filter ? `$filter=${encodeURIComponent(args.options.filter)}` : ``;
|
|
72
72
|
const fieldSelect = `?$select=Id&${rowLimit}&${filter}`;
|
|
73
73
|
const requestOptions = {
|
|
74
74
|
url: `${requestUrl}/items${fieldSelect}`,
|
|
@@ -83,7 +83,7 @@ class SpoListItemListCommand extends SpoCommand_1.default {
|
|
|
83
83
|
const skipTokenId = (res && res.value && res.value.length && res.value[res.value.length - 1]) ? res.value[res.value.length - 1].Id : 0;
|
|
84
84
|
const skipToken = (args.options.pageNumber && Number(args.options.pageNumber) > 0 && skipTokenId > 0) ? `$skiptoken=Paged=TRUE%26p_ID=${res.value[res.value.length - 1].Id}` : ``;
|
|
85
85
|
const rowLimit = args.options.pageSize ? `$top=${args.options.pageSize}` : ``;
|
|
86
|
-
const filter = args.options.filter ? `$filter=${
|
|
86
|
+
const filter = args.options.filter ? `$filter=${encodeURIComponent(args.options.filter)}` : ``;
|
|
87
87
|
const fieldExpand = expandFieldsArray.length > 0 ? `&$expand=${expandFieldsArray.join(",")}` : ``;
|
|
88
88
|
const fieldSelect = fieldsArray.length > 0 ?
|
|
89
89
|
`?$select=${formatting_1.formatting.encodeQueryParameter(fieldsArray.join(","))}${fieldExpand}&${rowLimit}&${skipToken}&${filter}` :
|
|
@@ -127,16 +127,17 @@ class SpoListItemSetCommand extends SpoCommand_1.default {
|
|
|
127
127
|
objectIdentity = yield this.requestObjectIdentity(args.options.webUrl, logger, formDigestValue);
|
|
128
128
|
}
|
|
129
129
|
const additionalContentType = (args.options.systemUpdate && args.options.contentType && contentTypeName !== '') ? `
|
|
130
|
+
<Method Name="ParseAndSetFieldValue" Id="1" ObjectPathId="147">
|
|
130
131
|
<Parameters>
|
|
131
132
|
<Parameter Type="String">ContentType</Parameter>
|
|
132
133
|
<Parameter Type="String">${contentTypeName}</Parameter>
|
|
133
|
-
</Parameters
|
|
134
|
+
</Parameters>
|
|
135
|
+
</Method>`
|
|
134
136
|
: ``;
|
|
135
137
|
const requestBody = args.options.systemUpdate ?
|
|
136
138
|
`<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">
|
|
137
139
|
<Actions>
|
|
138
|
-
|
|
139
|
-
</Method>
|
|
140
|
+
${this.mapRequestBody(args.options).join('')}${additionalContentType}
|
|
140
141
|
<Method Name="SystemUpdate" Id="2" ObjectPathId="147" />
|
|
141
142
|
</Actions>
|
|
142
143
|
<ObjectPaths>
|
|
@@ -231,10 +232,12 @@ class SpoListItemSetCommand extends SpoCommand_1.default {
|
|
|
231
232
|
if (excludeOptions.indexOf(key) === -1) {
|
|
232
233
|
if (options.systemUpdate) {
|
|
233
234
|
requestBody.push(`
|
|
235
|
+
<Method Name="ParseAndSetFieldValue" Id="1" ObjectPathId="147">
|
|
234
236
|
<Parameters>
|
|
235
237
|
<Parameter Type="String">${key}</Parameter>
|
|
236
238
|
<Parameter Type="String">${options[key].toString()}</Parameter>
|
|
237
|
-
</Parameters
|
|
239
|
+
</Parameters>
|
|
240
|
+
</Method>`);
|
|
238
241
|
}
|
|
239
242
|
else {
|
|
240
243
|
requestBody.push({ FieldName: key, FieldValue: options[key].toString() });
|
|
@@ -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 _SpoNavigationNodeAddCommand_instances, _SpoNavigationNodeAddCommand_initTelemetry, _SpoNavigationNodeAddCommand_initOptions, _SpoNavigationNodeAddCommand_initValidators;
|
|
16
|
+
var _SpoNavigationNodeAddCommand_instances, _SpoNavigationNodeAddCommand_initTelemetry, _SpoNavigationNodeAddCommand_initOptions, _SpoNavigationNodeAddCommand_initValidators, _SpoNavigationNodeAddCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const request_1 = require("../../../../request");
|
|
19
19
|
const validation_1 = require("../../../../utils/validation");
|
|
@@ -26,6 +26,7 @@ class SpoNavigationNodeAddCommand extends SpoCommand_1.default {
|
|
|
26
26
|
__classPrivateFieldGet(this, _SpoNavigationNodeAddCommand_instances, "m", _SpoNavigationNodeAddCommand_initTelemetry).call(this);
|
|
27
27
|
__classPrivateFieldGet(this, _SpoNavigationNodeAddCommand_instances, "m", _SpoNavigationNodeAddCommand_initOptions).call(this);
|
|
28
28
|
__classPrivateFieldGet(this, _SpoNavigationNodeAddCommand_instances, "m", _SpoNavigationNodeAddCommand_initValidators).call(this);
|
|
29
|
+
__classPrivateFieldGet(this, _SpoNavigationNodeAddCommand_instances, "m", _SpoNavigationNodeAddCommand_initOptionSets).call(this);
|
|
29
30
|
}
|
|
30
31
|
get name() {
|
|
31
32
|
return commands_1.default.NAVIGATION_NODE_ADD;
|
|
@@ -71,6 +72,7 @@ _SpoNavigationNodeAddCommand_instances = new WeakSet(), _SpoNavigationNodeAddCom
|
|
|
71
72
|
this.telemetry.push((args) => {
|
|
72
73
|
Object.assign(this.telemetryProperties, {
|
|
73
74
|
isExternal: args.options.isExternal,
|
|
75
|
+
location: typeof args.options.location !== 'undefined',
|
|
74
76
|
parentNodeId: typeof args.options.parentNodeId !== 'undefined'
|
|
75
77
|
});
|
|
76
78
|
});
|
|
@@ -108,6 +110,8 @@ _SpoNavigationNodeAddCommand_instances = new WeakSet(), _SpoNavigationNodeAddCom
|
|
|
108
110
|
}
|
|
109
111
|
return true;
|
|
110
112
|
}));
|
|
113
|
+
}, _SpoNavigationNodeAddCommand_initOptionSets = function _SpoNavigationNodeAddCommand_initOptionSets() {
|
|
114
|
+
this.optionSets.push({ options: ['location', 'parentNodeId'] });
|
|
111
115
|
};
|
|
112
116
|
module.exports = new SpoNavigationNodeAddCommand();
|
|
113
117
|
//# sourceMappingURL=navigation-node-add.js.map
|
|
@@ -16,11 +16,10 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
16
16
|
var _SpoRoleDefinitionListCommand_instances, _SpoRoleDefinitionListCommand_initOptions, _SpoRoleDefinitionListCommand_initValidators;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const odata_1 = require("../../../../utils/odata");
|
|
19
|
+
const formatting_1 = require("../../../../utils/formatting");
|
|
19
20
|
const validation_1 = require("../../../../utils/validation");
|
|
20
21
|
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
21
|
-
const base_permissions_1 = require("../../base-permissions");
|
|
22
22
|
const commands_1 = require("../../commands");
|
|
23
|
-
const RoleType_1 = require("./RoleType");
|
|
24
23
|
class SpoRoleDefinitionListCommand extends SpoCommand_1.default {
|
|
25
24
|
constructor() {
|
|
26
25
|
super();
|
|
@@ -44,7 +43,7 @@ class SpoRoleDefinitionListCommand extends SpoCommand_1.default {
|
|
|
44
43
|
}
|
|
45
44
|
try {
|
|
46
45
|
const res = yield odata_1.odata.getAllItems(`${args.options.webUrl}/_api/web/roledefinitions`);
|
|
47
|
-
const response =
|
|
46
|
+
const response = formatting_1.formatting.setFriendlyPermissions(res);
|
|
48
47
|
logger.log(response);
|
|
49
48
|
}
|
|
50
49
|
catch (err) {
|
|
@@ -52,16 +51,6 @@ class SpoRoleDefinitionListCommand extends SpoCommand_1.default {
|
|
|
52
51
|
}
|
|
53
52
|
});
|
|
54
53
|
}
|
|
55
|
-
setFriendlyPermissions(response) {
|
|
56
|
-
response.forEach((r) => {
|
|
57
|
-
const permissions = new base_permissions_1.BasePermissions();
|
|
58
|
-
permissions.high = r.BasePermissions.High;
|
|
59
|
-
permissions.low = r.BasePermissions.Low;
|
|
60
|
-
r.BasePermissionsValue = permissions.parse();
|
|
61
|
-
r.RoleTypeKindValue = RoleType_1.RoleType[r.RoleTypeKind];
|
|
62
|
-
});
|
|
63
|
-
return response;
|
|
64
|
-
}
|
|
65
54
|
}
|
|
66
55
|
_SpoRoleDefinitionListCommand_instances = new WeakSet(), _SpoRoleDefinitionListCommand_initOptions = function _SpoRoleDefinitionListCommand_initOptions() {
|
|
67
56
|
this.options.unshift({
|
|
@@ -16,11 +16,10 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
16
16
|
var _SpoWebGetCommand_instances, _SpoWebGetCommand_initTelemetry, _SpoWebGetCommand_initOptions, _SpoWebGetCommand_initValidators;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const request_1 = require("../../../../request");
|
|
19
|
+
const formatting_1 = require("../../../../utils/formatting");
|
|
19
20
|
const validation_1 = require("../../../../utils/validation");
|
|
20
21
|
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
21
|
-
const base_permissions_1 = require("../../base-permissions");
|
|
22
22
|
const commands_1 = require("../../commands");
|
|
23
|
-
const RoleType_1 = require("../roledefinition/RoleType");
|
|
24
23
|
class SpoWebGetCommand extends SpoCommand_1.default {
|
|
25
24
|
constructor() {
|
|
26
25
|
super();
|
|
@@ -53,8 +52,10 @@ class SpoWebGetCommand extends SpoCommand_1.default {
|
|
|
53
52
|
if (args.options.withPermissions) {
|
|
54
53
|
requestOptions.url = `${args.options.url}/_api/web/RoleAssignments?$expand=Member,RoleDefinitionBindings`;
|
|
55
54
|
const response = yield request_1.default.get(requestOptions);
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
response.value.forEach((r) => {
|
|
56
|
+
r.RoleDefinitionBindings = formatting_1.formatting.setFriendlyPermissions(r.RoleDefinitionBindings);
|
|
57
|
+
});
|
|
58
|
+
webProperties.RoleAssignments = response.value;
|
|
58
59
|
}
|
|
59
60
|
logger.log(webProperties);
|
|
60
61
|
}
|
|
@@ -63,18 +64,6 @@ class SpoWebGetCommand extends SpoCommand_1.default {
|
|
|
63
64
|
}
|
|
64
65
|
});
|
|
65
66
|
}
|
|
66
|
-
setFriendlyPermissions(response) {
|
|
67
|
-
response.forEach((r) => {
|
|
68
|
-
r.RoleDefinitionBindings.forEach((r) => {
|
|
69
|
-
const permissions = new base_permissions_1.BasePermissions();
|
|
70
|
-
permissions.high = r.BasePermissions.High;
|
|
71
|
-
permissions.low = r.BasePermissions.Low;
|
|
72
|
-
r.BasePermissionsValue = permissions.parse();
|
|
73
|
-
r.RoleTypeKindValue = RoleType_1.RoleType[r.RoleTypeKind];
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
return response;
|
|
77
|
-
}
|
|
78
67
|
}
|
|
79
68
|
_SpoWebGetCommand_instances = new WeakSet(), _SpoWebGetCommand_initTelemetry = function _SpoWebGetCommand_initTelemetry() {
|
|
80
69
|
this.telemetry.push((args) => {
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
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 _TeamsMeetingAttendancereportListCommand_instances, _TeamsMeetingAttendancereportListCommand_initTelemetry, _TeamsMeetingAttendancereportListCommand_initOptions, _TeamsMeetingAttendancereportListCommand_initValidators;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const Auth_1 = require("../../../../Auth");
|
|
19
|
+
const Cli_1 = require("../../../../cli/Cli");
|
|
20
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
21
|
+
const commands_1 = require("../../commands");
|
|
22
|
+
const odata_1 = require("../../../../utils/odata");
|
|
23
|
+
const validation_1 = require("../../../../utils/validation");
|
|
24
|
+
const AadUserGetCommand = require("../../../aad/commands/user/user-get");
|
|
25
|
+
const accessToken_1 = require("../../../../utils/accessToken");
|
|
26
|
+
class TeamsMeetingAttendancereportListCommand extends GraphCommand_1.default {
|
|
27
|
+
constructor() {
|
|
28
|
+
super();
|
|
29
|
+
_TeamsMeetingAttendancereportListCommand_instances.add(this);
|
|
30
|
+
__classPrivateFieldGet(this, _TeamsMeetingAttendancereportListCommand_instances, "m", _TeamsMeetingAttendancereportListCommand_initTelemetry).call(this);
|
|
31
|
+
__classPrivateFieldGet(this, _TeamsMeetingAttendancereportListCommand_instances, "m", _TeamsMeetingAttendancereportListCommand_initOptions).call(this);
|
|
32
|
+
__classPrivateFieldGet(this, _TeamsMeetingAttendancereportListCommand_instances, "m", _TeamsMeetingAttendancereportListCommand_initValidators).call(this);
|
|
33
|
+
}
|
|
34
|
+
get name() {
|
|
35
|
+
return commands_1.default.MEETING_ATTENDANCEREPORT_LIST;
|
|
36
|
+
}
|
|
37
|
+
get description() {
|
|
38
|
+
return 'Lists all attendance reports for a given meeting';
|
|
39
|
+
}
|
|
40
|
+
defaultProperties() {
|
|
41
|
+
return ['id', 'totalParticipantCount'];
|
|
42
|
+
}
|
|
43
|
+
commandAction(logger, args) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
const isAppOnlyAuth = accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken);
|
|
46
|
+
if (isAppOnlyAuth && !args.options.userId && !args.options.userName && !args.options.email) {
|
|
47
|
+
this.handleError(`The option 'userId', 'userName' or 'email' is required when retrieving meeting attendance report using app only permissions`);
|
|
48
|
+
}
|
|
49
|
+
else if (!isAppOnlyAuth && (args.options.userId || args.options.userName || args.options.email)) {
|
|
50
|
+
this.handleError(`The options 'userId', 'userName' and 'email' cannot be used when retrieving meeting attendance reports using delegated permissions`);
|
|
51
|
+
}
|
|
52
|
+
try {
|
|
53
|
+
if (this.verbose) {
|
|
54
|
+
logger.logToStderr(`Retrieving attendance report for ${isAppOnlyAuth ? 'specific user' : 'currently logged in user'}`);
|
|
55
|
+
}
|
|
56
|
+
let requestUrl = `${this.resource}/v1.0/`;
|
|
57
|
+
if (isAppOnlyAuth) {
|
|
58
|
+
requestUrl += 'users/';
|
|
59
|
+
if (args.options.userId) {
|
|
60
|
+
requestUrl += args.options.userId;
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
const userId = yield this.getUserId(args.options.userName, args.options.email);
|
|
64
|
+
requestUrl += userId;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
requestUrl += `me`;
|
|
69
|
+
}
|
|
70
|
+
requestUrl += `/onlineMeetings/${args.options.meetingId}/attendanceReports`;
|
|
71
|
+
const res = yield odata_1.odata.getAllItems(requestUrl);
|
|
72
|
+
logger.log(res);
|
|
73
|
+
}
|
|
74
|
+
catch (err) {
|
|
75
|
+
this.handleRejectedODataJsonPromise(err);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
getUserId(userName, email) {
|
|
80
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
81
|
+
const options = {
|
|
82
|
+
email: email,
|
|
83
|
+
userName: userName,
|
|
84
|
+
output: 'json',
|
|
85
|
+
debug: this.debug,
|
|
86
|
+
verbose: this.verbose
|
|
87
|
+
};
|
|
88
|
+
const output = yield Cli_1.Cli.executeCommandWithOutput(AadUserGetCommand, { options: Object.assign(Object.assign({}, options), { _: [] }) });
|
|
89
|
+
const getUserOutput = JSON.parse(output.stdout);
|
|
90
|
+
return getUserOutput.id;
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
_TeamsMeetingAttendancereportListCommand_instances = new WeakSet(), _TeamsMeetingAttendancereportListCommand_initTelemetry = function _TeamsMeetingAttendancereportListCommand_initTelemetry() {
|
|
95
|
+
this.telemetry.push((args) => {
|
|
96
|
+
Object.assign(this.telemetryProperties, {
|
|
97
|
+
userId: typeof args.options.userId !== 'undefined',
|
|
98
|
+
userName: typeof args.options.userName !== 'undefined',
|
|
99
|
+
email: typeof args.options.email !== 'undefined'
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
}, _TeamsMeetingAttendancereportListCommand_initOptions = function _TeamsMeetingAttendancereportListCommand_initOptions() {
|
|
103
|
+
this.options.unshift({
|
|
104
|
+
option: '-u, --userId [userId]'
|
|
105
|
+
}, {
|
|
106
|
+
option: '-n, --userName [userName]'
|
|
107
|
+
}, {
|
|
108
|
+
option: '--email [email]'
|
|
109
|
+
}, {
|
|
110
|
+
option: '-m, --meetingId <meetingId>'
|
|
111
|
+
});
|
|
112
|
+
}, _TeamsMeetingAttendancereportListCommand_initValidators = function _TeamsMeetingAttendancereportListCommand_initValidators() {
|
|
113
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
114
|
+
if (args.options.userId && !validation_1.validation.isValidGuid(args.options.userId)) {
|
|
115
|
+
return `${args.options.userId} is not a valid Guid`;
|
|
116
|
+
}
|
|
117
|
+
return true;
|
|
118
|
+
}));
|
|
119
|
+
};
|
|
120
|
+
module.exports = new TeamsMeetingAttendancereportListCommand();
|
|
121
|
+
//# sourceMappingURL=meeting-attendancereport-list.js.map
|
|
@@ -40,7 +40,7 @@ class TeamsUserAppListCommand extends GraphCommand_1.default {
|
|
|
40
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41
41
|
try {
|
|
42
42
|
const userId = (yield this.getUserId(args)).value;
|
|
43
|
-
const endpoint = `${this.resource}/v1.0/users/${formatting_1.formatting.encodeQueryParameter(userId)}/teamwork/installedApps?$expand=teamsAppDefinition`;
|
|
43
|
+
const endpoint = `${this.resource}/v1.0/users/${formatting_1.formatting.encodeQueryParameter(userId)}/teamwork/installedApps?$expand=teamsAppDefinition,teamsApp`;
|
|
44
44
|
const items = yield odata_1.odata.getAllItems(endpoint);
|
|
45
45
|
items.forEach(i => {
|
|
46
46
|
const userAppId = Buffer.from(i.id, 'base64').toString('ascii');
|
|
@@ -27,6 +27,7 @@ exports.default = {
|
|
|
27
27
|
FUNSETTINGS_SET: `${prefix} funsettings set`,
|
|
28
28
|
GUESTSETTINGS_LIST: `${prefix} guestsettings list`,
|
|
29
29
|
GUESTSETTINGS_SET: `${prefix} guestsettings set`,
|
|
30
|
+
MEETING_ATTENDANCEREPORT_LIST: `${prefix} meeting attendancereport list`,
|
|
30
31
|
MEETING_GET: `${prefix} meeting get`,
|
|
31
32
|
MEETING_LIST: `${prefix} meeting list`,
|
|
32
33
|
MEMBERSETTINGS_LIST: `${prefix} membersettings list`,
|