@pnp/cli-microsoft365 7.0.0-beta.5fdb9e3 → 7.0.0-beta.607e42d
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.cjs +0 -2
- package/dist/GlobalOptions.js +1 -7
- package/dist/m365/aad/commands/app/app-add.js +8 -8
- package/dist/m365/aad/commands/app/app-role-add.js +5 -5
- package/dist/m365/aad/commands/app/app-set.js +5 -5
- package/dist/m365/aad/commands/group/group-get.js +4 -4
- package/dist/m365/aad/commands/group/group-list.js +1 -23
- package/dist/m365/aad/commands/policy/policy-list.js +5 -5
- package/dist/m365/cli/commands/cli-issue.js +5 -5
- package/dist/m365/cli/commands/config/config-get.js +5 -5
- package/dist/m365/cli/commands/config/config-reset.js +5 -5
- package/dist/m365/cli/commands/config/config-set.js +5 -5
- package/dist/m365/commands/login.js +5 -5
- package/dist/m365/commands/request.js +1 -1
- package/dist/m365/flow/commands/owner/owner-ensure.js +5 -5
- package/dist/m365/pa/commands/app/app-export.js +7 -7
- package/dist/m365/pa/commands/app/app-owner-set.js +5 -5
- package/dist/m365/pa/commands/app/app-permission-ensure.js +5 -5
- package/dist/m365/pa/commands.js +1 -4
- package/dist/m365/planner/commands/task/task-add.js +17 -11
- package/dist/m365/planner/commands/task/task-get.js +35 -25
- package/dist/m365/planner/commands/task/task-list.js +26 -19
- package/dist/m365/planner/commands/task/task-remove.js +39 -34
- package/dist/m365/planner/commands/task/task-set.js +35 -23
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-add.js +14 -14
- package/dist/m365/spfx/commands/package/package-generate.js +15 -15
- package/dist/m365/spfx/commands/project/DeployWorkflow.js +55 -0
- package/dist/m365/spfx/commands/project/project-doctor.js +8 -8
- package/dist/m365/spfx/commands/project/project-github-workflow-add.js +157 -0
- package/dist/m365/spfx/commands/project/project-github-workflow-model.js +2 -0
- package/dist/m365/spfx/commands/project/project-upgrade.js +13 -13
- package/dist/m365/spfx/commands.js +1 -0
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-add.js +5 -5
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-list.js +5 -5
- package/dist/m365/spo/commands/commandset/commandset-add.js +11 -11
- package/dist/m365/spo/commands/commandset/commandset-get.js +8 -8
- package/dist/m365/spo/commands/commandset/commandset-list.js +5 -5
- package/dist/m365/spo/commands/commandset/commandset-remove.js +5 -5
- package/dist/m365/spo/commands/commandset/commandset-set.js +11 -11
- package/dist/m365/spo/commands/file/file-get.js +9 -6
- package/dist/m365/spo/commands/file/file-sharinglink-add.js +8 -8
- package/dist/m365/spo/commands/file/file-sharinglink-list.js +5 -5
- package/dist/m365/spo/commands/list/list-add.js +4 -4
- package/dist/m365/spo/commands/list/list-set.js +4 -4
- package/dist/m365/spo/commands/listitem/listitem-add.js +1 -0
- package/dist/m365/spo/commands/listitem/listitem-set.js +3 -2
- package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-add.js +8 -8
- package/dist/m365/spo/commands/page/clientsidepages.js +1 -81
- package/dist/m365/spo/commands/page/page-get.js +1 -0
- package/dist/m365/spo/commands/page/page-list.js +4 -3
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-set.js +30 -32
- package/dist/m365/spo/commands/site/site-add.js +114 -161
- package/dist/m365/spo/commands/site/site-apppermission-add.js +15 -18
- package/dist/m365/spo/commands/site/site-apppermission-remove.js +34 -38
- package/dist/m365/spo/commands/site/site-apppermission-set.js +11 -14
- package/dist/m365/spo/commands/site/site-ensure.js +13 -66
- package/dist/m365/spo/commands/site/site-list.js +9 -17
- package/dist/m365/spo/commands/site/site-recyclebinitem-list.js +6 -6
- package/dist/m365/spo/commands/site/site-remove.js +166 -210
- package/dist/m365/spo/commands/site/site-set.js +121 -153
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-list.js +3 -2
- package/dist/m365/spo/commands/tenant/tenant-commandset-add.js +8 -8
- package/dist/m365/spo/commands/tenant/tenant-commandset-list.js +3 -2
- package/dist/m365/spo/commands/tenant/tenant-commandset-set.js +8 -8
- package/dist/m365/spo/commands/tenant/tenant-settings-set.js +4 -4
- package/dist/m365/spo/commands/web/web-roleinheritance-break.js +3 -3
- package/dist/m365/spo/commands/web/web-set.js +5 -5
- package/dist/m365/teams/commands/app/app-list.js +5 -5
- package/dist/m365/teams/commands/chat/chat-member-add.js +5 -5
- package/dist/m365/teams/commands/funsettings/funsettings-set.js +4 -4
- package/dist/m365/teams/commands/guestsettings/guestsettings-set.js +4 -4
- package/dist/m365/teams/commands/membersettings/membersettings-set.js +4 -4
- package/dist/m365/teams/commands/messagingsettings/messagingsettings-set.js +5 -5
- package/dist/m365/teams/commands/team/team-set.js +3 -3
- package/dist/m365/todo/commands/task/task-add.js +6 -6
- package/dist/m365/yammer/commands/message/message-list.js +5 -5
- package/dist/m365/yammer/commands/yammer-search.js +5 -5
- package/dist/utils/aadGroup.js +18 -0
- package/dist/utils/fsUtil.js +5 -0
- package/dist/utils/spo.js +582 -0
- package/dist/utils/validation.js +0 -3
- package/docs/docs/cmd/aad/group/group-get.mdx +5 -5
- package/docs/docs/cmd/aad/group/group-list.mdx +0 -11
- package/docs/docs/cmd/pa/app/app-export.mdx +5 -5
- package/docs/docs/cmd/planner/task/task-add.mdx +22 -7
- package/docs/docs/cmd/planner/task/task-get.mdx +13 -4
- package/docs/docs/cmd/planner/task/task-list.mdx +22 -7
- package/docs/docs/cmd/planner/task/task-remove.mdx +25 -8
- package/docs/docs/cmd/planner/task/task-set.mdx +22 -7
- package/docs/docs/cmd/spfx/project/project-github-workflow-add.mdx +94 -0
- package/docs/docs/cmd/spo/listitem/listitem-add.mdx +2 -5
- package/docs/docs/cmd/spo/listitem/listitem-set.mdx +2 -5
- package/docs/docs/cmd/spo/page/page-get.mdx +0 -1
- package/docs/docs/cmd/spo/page/page-list.mdx +0 -1
- package/docs/docs/cmd/spo/site/site-list.mdx +3 -78
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-list.mdx +2 -4
- package/docs/docs/cmd/spo/tenant/tenant-commandset-list.mdx +2 -4
- package/npm-shrinkwrap.json +239 -1416
- package/package.json +6 -12
- package/dist/m365/pa/cds-project-mutator.js +0 -91
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/dataset-template/generated/ManifestTypes.d.ts +0 -11
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/dataset-template/template_ControlManifest.Input.xml +0 -31
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/dataset-template/template_index.ts +0 -51
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/field-template/generated/ManifestTypes.d.ts +0 -12
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/field-template/template_ControlManifest.Input.xml +0 -37
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/field-template/template_index.ts +0 -48
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/index.ts +0 -0
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/virtual-dataset-template/template_ControlManifest.Input.xml +0 -31
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/virtual-dataset-template/template_index.tsx +0 -58
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/virtual-field-template/template_ControlManifest.Input.xml +0 -37
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/virtual-field-template/template_index.tsx +0 -55
- package/dist/m365/pa/commands/pcf/pcf-init/assets/package.json +0 -19
- package/dist/m365/pa/commands/pcf/pcf-init/assets/pcfconfig.json +0 -3
- package/dist/m365/pa/commands/pcf/pcf-init/assets/template_.gitignore +0 -14
- package/dist/m365/pa/commands/pcf/pcf-init/assets/template_pcfprojecttype.pcfproj +0 -45
- package/dist/m365/pa/commands/pcf/pcf-init/pcf-init-variables.js +0 -2
- package/dist/m365/pa/commands/pcf/pcf-init.js +0 -120
- package/dist/m365/pa/commands/solution/solution-init/assets/Other/Customizations.xml +0 -18
- package/dist/m365/pa/commands/solution/solution-init/assets/Other/Relationships.xml +0 -2
- package/dist/m365/pa/commands/solution/solution-init/assets/Other/template_Solution.xml +0 -94
- package/dist/m365/pa/commands/solution/solution-init/assets/template_.gitignore +0 -2
- package/dist/m365/pa/commands/solution/solution-init/assets/template_solutionprojecttype.cdsproj +0 -44
- package/dist/m365/pa/commands/solution/solution-init/solution-init-variables.js +0 -2
- package/dist/m365/pa/commands/solution/solution-init.js +0 -126
- package/dist/m365/pa/commands/solution/solution-reference-add.js +0 -88
- package/dist/m365/pa/template-instantiator.js +0 -57
- package/docs/docs/cmd/pa/pcf/pcf-init.mdx +0 -56
- package/docs/docs/cmd/pa/solution/solution-init.mdx +0 -46
- package/docs/docs/cmd/pa/solution/solution-reference-add.mdx +0 -42
|
@@ -84,89 +84,69 @@ class SpoSiteSetCommand extends SpoCommand {
|
|
|
84
84
|
await logger.logToStderr('Site is not group connected');
|
|
85
85
|
}
|
|
86
86
|
if (typeof args.options.isPublic !== 'undefined') {
|
|
87
|
-
|
|
87
|
+
throw `The isPublic option can't be set on a site that is not groupified`;
|
|
88
88
|
}
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
await this.updateSiteDescription(logger, args);
|
|
90
|
+
await this.updateSiteOwners(logger, args);
|
|
91
91
|
}
|
|
92
|
-
waitForSiteUpdateCompletion(logger, args,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
verbose: this.verbose
|
|
120
|
-
});
|
|
121
|
-
}, operation.PollingInterval);
|
|
122
|
-
}
|
|
92
|
+
async waitForSiteUpdateCompletion(logger, args, response) {
|
|
93
|
+
if (!response) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const json = JSON.parse(response);
|
|
97
|
+
const responseContent = json[0];
|
|
98
|
+
if (responseContent.ErrorInfo) {
|
|
99
|
+
throw responseContent.ErrorInfo.ErrorMessage;
|
|
100
|
+
}
|
|
101
|
+
const operation = json[json.length - 1];
|
|
102
|
+
const isComplete = operation.IsComplete;
|
|
103
|
+
if (!args.options.wait || isComplete) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
await new Promise((resolve, reject) => {
|
|
107
|
+
setTimeout(() => {
|
|
108
|
+
spo.waitUntilFinished({
|
|
109
|
+
operationId: JSON.stringify(operation._ObjectIdentity_),
|
|
110
|
+
siteUrl: this.spoAdminUrl,
|
|
111
|
+
resolve,
|
|
112
|
+
reject,
|
|
113
|
+
logger,
|
|
114
|
+
currentContext: this.context,
|
|
115
|
+
debug: this.debug,
|
|
116
|
+
verbose: this.verbose
|
|
117
|
+
});
|
|
118
|
+
}, operation.PollingInterval);
|
|
123
119
|
});
|
|
124
120
|
}
|
|
125
121
|
async updateSiteOwners(logger, args) {
|
|
126
122
|
if (!args.options.owners) {
|
|
127
|
-
return
|
|
123
|
+
return;
|
|
128
124
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}))
|
|
136
|
-
.then(() => {
|
|
137
|
-
resolve();
|
|
138
|
-
}, (err) => {
|
|
139
|
-
reject(err);
|
|
140
|
-
});
|
|
141
|
-
});
|
|
125
|
+
if (this.verbose) {
|
|
126
|
+
await logger.logToStderr(`Updating site owners ${args.options.url}...`);
|
|
127
|
+
}
|
|
128
|
+
await Promise.all(args.options.owners.split(',').map(o => {
|
|
129
|
+
return this.setAdmin(args.options.url, o.trim());
|
|
130
|
+
}));
|
|
142
131
|
}
|
|
143
|
-
setAdmin(siteUrl, principal) {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
reject(response.ErrorInfo.ErrorMessage);
|
|
158
|
-
}
|
|
159
|
-
else {
|
|
160
|
-
resolve();
|
|
161
|
-
}
|
|
162
|
-
}, (err) => {
|
|
163
|
-
reject(err);
|
|
164
|
-
});
|
|
165
|
-
});
|
|
132
|
+
async setAdmin(siteUrl, principal) {
|
|
133
|
+
const requestOptions = {
|
|
134
|
+
url: `${this.spoAdminUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
135
|
+
headers: {
|
|
136
|
+
'X-RequestDigest': this.context.FormDigestValue
|
|
137
|
+
},
|
|
138
|
+
data: `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="${config.applicationName}" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions><ObjectPath Id="48" ObjectPathId="47" /></Actions><ObjectPaths><Method Id="47" ParentId="34" Name="SetSiteAdmin"><Parameters><Parameter Type="String">${formatting.escapeXml(siteUrl)}</Parameter><Parameter Type="String">${formatting.escapeXml(principal)}</Parameter><Parameter Type="Boolean">true</Parameter></Parameters></Method><Constructor Id="34" TypeId="{268004ae-ef6b-4e9b-8425-127220d84719}" /></ObjectPaths></Request>`
|
|
139
|
+
};
|
|
140
|
+
const response = await request.post(requestOptions);
|
|
141
|
+
const json = JSON.parse(response);
|
|
142
|
+
const responseContent = json[0];
|
|
143
|
+
if (responseContent.ErrorInfo) {
|
|
144
|
+
throw responseContent.ErrorInfo.ErrorMessage;
|
|
145
|
+
}
|
|
166
146
|
}
|
|
167
147
|
async updateSiteDescription(logger, args) {
|
|
168
148
|
if (!args.options.description) {
|
|
169
|
-
return
|
|
149
|
+
return;
|
|
170
150
|
}
|
|
171
151
|
if (this.verbose) {
|
|
172
152
|
await logger.logToStderr(`Setting site description ${args.options.url}...`);
|
|
@@ -185,11 +165,11 @@ class SpoSiteSetCommand extends SpoCommand {
|
|
|
185
165
|
},
|
|
186
166
|
json: true
|
|
187
167
|
};
|
|
188
|
-
|
|
168
|
+
await request.post(requestOptions);
|
|
189
169
|
}
|
|
190
170
|
async updateSiteLockState(logger, args) {
|
|
191
171
|
if (!args.options.lockState) {
|
|
192
|
-
return
|
|
172
|
+
return;
|
|
193
173
|
}
|
|
194
174
|
if (this.verbose) {
|
|
195
175
|
await logger.logToStderr(`Setting site lock state ${args.options.url}...`);
|
|
@@ -207,52 +187,44 @@ class SpoSiteSetCommand extends SpoCommand {
|
|
|
207
187
|
if (this.debug) {
|
|
208
188
|
await logger.logToStderr(`Site attached to group ${this.groupId}`);
|
|
209
189
|
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
Promise
|
|
249
|
-
.all(promises)
|
|
250
|
-
.then(() => {
|
|
251
|
-
resolve();
|
|
252
|
-
}, (error) => {
|
|
253
|
-
reject(error);
|
|
254
|
-
});
|
|
255
|
-
});
|
|
190
|
+
if (typeof args.options.title === 'undefined' &&
|
|
191
|
+
typeof args.options.description === 'undefined' &&
|
|
192
|
+
typeof args.options.isPublic === 'undefined' &&
|
|
193
|
+
typeof args.options.owners === 'undefined') {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
const promises = [];
|
|
197
|
+
if (typeof args.options.title !== 'undefined') {
|
|
198
|
+
const requestOptions = {
|
|
199
|
+
url: `${this.spoAdminUrl}/_api/SPOGroup/UpdateGroupPropertiesBySiteId`,
|
|
200
|
+
headers: {
|
|
201
|
+
accept: 'application/json;odata=nometadata',
|
|
202
|
+
'content-type': 'application/json;charset=utf-8',
|
|
203
|
+
'X-RequestDigest': this.context.FormDigestValue
|
|
204
|
+
},
|
|
205
|
+
data: {
|
|
206
|
+
groupId: this.groupId,
|
|
207
|
+
siteId: this.siteId,
|
|
208
|
+
displayName: args.options.title
|
|
209
|
+
},
|
|
210
|
+
responseType: 'json'
|
|
211
|
+
};
|
|
212
|
+
promises.push(request.post(requestOptions));
|
|
213
|
+
}
|
|
214
|
+
if (typeof args.options.isPublic !== 'undefined') {
|
|
215
|
+
const commandOptions = {
|
|
216
|
+
id: this.groupId,
|
|
217
|
+
isPrivate: (args.options.isPublic === false),
|
|
218
|
+
debug: this.debug,
|
|
219
|
+
verbose: this.verbose
|
|
220
|
+
};
|
|
221
|
+
promises.push(Cli.executeCommand(aadM365GroupSetCommand, { options: { ...commandOptions, _: [] } }));
|
|
222
|
+
}
|
|
223
|
+
if (args.options.description) {
|
|
224
|
+
promises.push(this.setGroupifiedSiteDescription(args.options.description));
|
|
225
|
+
}
|
|
226
|
+
promises.push(this.setGroupifiedSiteOwners(logger, args));
|
|
227
|
+
await Promise.all(promises);
|
|
256
228
|
}
|
|
257
229
|
setGroupifiedSiteDescription(description) {
|
|
258
230
|
const requestOptions = {
|
|
@@ -268,7 +240,7 @@ class SpoSiteSetCommand extends SpoCommand {
|
|
|
268
240
|
}
|
|
269
241
|
async setGroupifiedSiteOwners(logger, args) {
|
|
270
242
|
if (typeof args.options.owners === 'undefined') {
|
|
271
|
-
return
|
|
243
|
+
return;
|
|
272
244
|
}
|
|
273
245
|
const owners = args.options.owners.split(',').map(o => o.trim());
|
|
274
246
|
if (this.verbose) {
|
|
@@ -281,21 +253,19 @@ class SpoSiteSetCommand extends SpoCommand {
|
|
|
281
253
|
},
|
|
282
254
|
responseType: 'json'
|
|
283
255
|
};
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
}));
|
|
298
|
-
});
|
|
256
|
+
const response = await request.get(requestOptions);
|
|
257
|
+
if (response.value.length === 0) {
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
await Promise.all(response.value.map(user => {
|
|
261
|
+
const requestOptions = {
|
|
262
|
+
url: `${this.spoAdminUrl}/_api/SP.Directory.DirectorySession/Group('${this.groupId}')/Owners/Add(objectId='${user.id}', principalName='')`,
|
|
263
|
+
headers: {
|
|
264
|
+
'content-type': 'application/json;odata=verbose'
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
return request.post(requestOptions);
|
|
268
|
+
}));
|
|
299
269
|
}
|
|
300
270
|
async updateSiteProperties(logger, args) {
|
|
301
271
|
const isGroupConnectedSite = this.isGroupConnectedSite();
|
|
@@ -313,10 +283,9 @@ class SpoSiteSetCommand extends SpoCommand {
|
|
|
313
283
|
}
|
|
314
284
|
}
|
|
315
285
|
if (!updatedProperties) {
|
|
316
|
-
return
|
|
286
|
+
return;
|
|
317
287
|
}
|
|
318
|
-
|
|
319
|
-
this.context = res;
|
|
288
|
+
this.context = await spo.ensureFormDigest(this.spoAdminUrl, logger, this.context, this.debug);
|
|
320
289
|
if (this.verbose) {
|
|
321
290
|
await logger.logToStderr(`Updating site ${args.options.url} properties...`);
|
|
322
291
|
}
|
|
@@ -350,6 +319,9 @@ class SpoSiteSetCommand extends SpoCommand {
|
|
|
350
319
|
const flowsPolicy = args.options.disableFlows ? FlowsPolicy.Disabled : FlowsPolicy.Enabled;
|
|
351
320
|
payload.push(`<SetProperty Id="${propertyId++}" ObjectPathId="5" Name="DisableFlows"><Parameter Type="Enum">${flowsPolicy}</Parameter></SetProperty>`);
|
|
352
321
|
}
|
|
322
|
+
if (typeof args.options.socialBarOnSitePagesDisabled !== 'undefined') {
|
|
323
|
+
payload.push(`<SetProperty Id="${propertyId++}" ObjectPathId="5" Name="SocialBarOnSitePagesDisabled"><Parameter Type="Boolean">${args.options.socialBarOnSitePagesDisabled}</Parameter></SetProperty>`);
|
|
324
|
+
}
|
|
353
325
|
if (args.options.shareByEmailEnabled !== undefined) {
|
|
354
326
|
sitePropertiesPayload.push(`<SetProperty Id="${propertyId++}" ObjectPathId="5" Name="ShareByEmailEnabled"><Parameter Type="Boolean">${args.options.shareByEmailEnabled}</Parameter></SetProperty>`);
|
|
355
327
|
}
|
|
@@ -367,7 +339,7 @@ class SpoSiteSetCommand extends SpoCommand {
|
|
|
367
339
|
const requestOptions = {
|
|
368
340
|
url: `${args.options.url}/_vti_bin/client.svc/ProcessQuery`,
|
|
369
341
|
headers: {
|
|
370
|
-
'X-RequestDigest':
|
|
342
|
+
'X-RequestDigest': this.context.FormDigestValue
|
|
371
343
|
},
|
|
372
344
|
data: `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="${config.applicationName}" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions>${sitePropertiesPayload.join('')}</Actions><ObjectPaths><StaticProperty Id="1" TypeId="{3747adcd-a3c3-41b9-bfab-4a64dd2f1e0a}" Name="Current" /><Property Id="5" ParentId="1" Name="Site" /></ObjectPaths></Request>`
|
|
373
345
|
};
|
|
@@ -378,7 +350,7 @@ class SpoSiteSetCommand extends SpoCommand {
|
|
|
378
350
|
const requestOptions = {
|
|
379
351
|
url: `${this.spoAdminUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
380
352
|
headers: {
|
|
381
|
-
'X-RequestDigest':
|
|
353
|
+
'X-RequestDigest': this.context.FormDigestValue
|
|
382
354
|
},
|
|
383
355
|
data: `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="${config.applicationName}" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions>${payload.join('')}<ObjectPath Id="14" ObjectPathId="13" /><ObjectIdentityQuery Id="15" ObjectPathId="5" /><Query Id="16" ObjectPathId="13"><Query SelectAllProperties="false"><Properties><Property Name="IsComplete" ScalarProperty="true" /><Property Name="PollingInterval" ScalarProperty="true" /></Properties></Query></Query></Actions><ObjectPaths><Identity Id="5" Name="53d8499e-d0d2-5000-cb83-9ade5be42ca4|${this.tenantId.substr(pos, this.tenantId.indexOf('&') - pos)}
SiteProperties
${formatting.encodeQueryParameter(args.options.url)}" /><Method Id="13" ParentId="5" Name="Update" /></ObjectPaths></Request>`
|
|
384
356
|
};
|
|
@@ -386,9 +358,9 @@ class SpoSiteSetCommand extends SpoCommand {
|
|
|
386
358
|
}
|
|
387
359
|
return response || sitePropertiesResponse;
|
|
388
360
|
}
|
|
389
|
-
applySiteDesign(logger, args) {
|
|
361
|
+
async applySiteDesign(logger, args) {
|
|
390
362
|
if (typeof args.options.siteDesignId === 'undefined') {
|
|
391
|
-
return
|
|
363
|
+
return;
|
|
392
364
|
}
|
|
393
365
|
const options = {
|
|
394
366
|
webUrl: args.options.url,
|
|
@@ -410,16 +382,12 @@ class SpoSiteSetCommand extends SpoCommand {
|
|
|
410
382
|
},
|
|
411
383
|
responseType: 'json'
|
|
412
384
|
};
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
this.siteId
|
|
418
|
-
|
|
419
|
-
await logger.logToStderr(`Retrieved site IDs. siteId: ${this.siteId}, groupId: ${this.groupId}`);
|
|
420
|
-
}
|
|
421
|
-
return Promise.resolve();
|
|
422
|
-
});
|
|
385
|
+
const siteInfo = await request.get(requestOptions);
|
|
386
|
+
this.groupId = siteInfo.GroupId;
|
|
387
|
+
this.siteId = siteInfo.Id;
|
|
388
|
+
if (this.debug) {
|
|
389
|
+
await logger.logToStderr(`Retrieved site IDs. siteId: ${this.siteId}, groupId: ${this.groupId}`);
|
|
390
|
+
}
|
|
423
391
|
}
|
|
424
392
|
isGroupConnectedSite() {
|
|
425
393
|
return this.groupId !== '00000000-0000-0000-0000-000000000000';
|
|
@@ -22,8 +22,9 @@ class SpoTenantApplicationCustomizerListCommand extends SpoCommand {
|
|
|
22
22
|
}
|
|
23
23
|
const listServerRelativeUrl = urlUtil.getServerRelativePath(appCatalogUrl, '/lists/TenantWideExtensions');
|
|
24
24
|
try {
|
|
25
|
-
const
|
|
26
|
-
|
|
25
|
+
const listItems = await odata.getAllItems(`${appCatalogUrl}/_api/web/GetList('${formatting.encodeQueryParameter(listServerRelativeUrl)}')/items?$filter=TenantWideExtensionLocation eq 'ClientSideExtension.ApplicationCustomizer'`);
|
|
26
|
+
listItems.forEach(i => delete i.ID);
|
|
27
|
+
await logger.log(listItems);
|
|
27
28
|
}
|
|
28
29
|
catch (err) {
|
|
29
30
|
this.handleRejectedODataJsonPromise(err);
|
|
@@ -3,7 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
3
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _SpoTenantCommandSetAddCommand_instances, _SpoTenantCommandSetAddCommand_initTelemetry, _SpoTenantCommandSetAddCommand_initOptions, _SpoTenantCommandSetAddCommand_initValidators;
|
|
6
|
+
var _SpoTenantCommandSetAddCommand_instances, _a, _SpoTenantCommandSetAddCommand_initTelemetry, _SpoTenantCommandSetAddCommand_initOptions, _SpoTenantCommandSetAddCommand_initValidators;
|
|
7
7
|
import { Cli } from '../../../../cli/Cli.js';
|
|
8
8
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
9
9
|
import { validation } from '../../../../utils/validation.js';
|
|
@@ -149,7 +149,7 @@ class SpoTenantCommandSetAddCommand extends SpoCommand {
|
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
|
-
_SpoTenantCommandSetAddCommand_instances = new WeakSet(), _SpoTenantCommandSetAddCommand_initTelemetry = function _SpoTenantCommandSetAddCommand_initTelemetry() {
|
|
152
|
+
_a = SpoTenantCommandSetAddCommand, _SpoTenantCommandSetAddCommand_instances = new WeakSet(), _SpoTenantCommandSetAddCommand_initTelemetry = function _SpoTenantCommandSetAddCommand_initTelemetry() {
|
|
153
153
|
this.telemetry.push((args) => {
|
|
154
154
|
Object.assign(this.telemetryProperties, {
|
|
155
155
|
listType: args.options.listType,
|
|
@@ -163,7 +163,7 @@ _SpoTenantCommandSetAddCommand_instances = new WeakSet(), _SpoTenantCommandSetAd
|
|
|
163
163
|
option: '-t, --title <title>'
|
|
164
164
|
}, {
|
|
165
165
|
option: '-l, --listType <listType>',
|
|
166
|
-
autocomplete:
|
|
166
|
+
autocomplete: _a.listTypes
|
|
167
167
|
}, {
|
|
168
168
|
option: '-i, --clientSideComponentId <clientSideComponentId>'
|
|
169
169
|
}, {
|
|
@@ -172,18 +172,18 @@ _SpoTenantCommandSetAddCommand_instances = new WeakSet(), _SpoTenantCommandSetAd
|
|
|
172
172
|
option: '-w, --webTemplate [webTemplate]'
|
|
173
173
|
}, {
|
|
174
174
|
option: '--location [location]',
|
|
175
|
-
autocomplete:
|
|
175
|
+
autocomplete: _a.locations
|
|
176
176
|
});
|
|
177
177
|
}, _SpoTenantCommandSetAddCommand_initValidators = function _SpoTenantCommandSetAddCommand_initValidators() {
|
|
178
178
|
this.validators.push(async (args) => {
|
|
179
179
|
if (!validation.isValidGuid(args.options.clientSideComponentId)) {
|
|
180
180
|
return `${args.options.clientSideComponentId} is not a valid GUID`;
|
|
181
181
|
}
|
|
182
|
-
if (
|
|
183
|
-
return `${args.options.listType} is not a valid list type. Allowed values are ${
|
|
182
|
+
if (_a.listTypes.indexOf(args.options.listType) < 0) {
|
|
183
|
+
return `${args.options.listType} is not a valid list type. Allowed values are ${_a.listTypes.join(', ')}`;
|
|
184
184
|
}
|
|
185
|
-
if (args.options.location &&
|
|
186
|
-
return `${args.options.location} is not a valid location. Allowed values are ${
|
|
185
|
+
if (args.options.location && _a.locations.indexOf(args.options.location) < 0) {
|
|
186
|
+
return `${args.options.location} is not a valid location. Allowed values are ${_a.locations.join(', ')}`;
|
|
187
187
|
}
|
|
188
188
|
return true;
|
|
189
189
|
});
|
|
@@ -25,8 +25,9 @@ class SpoTenantCommandSetListCommand extends SpoCommand {
|
|
|
25
25
|
}
|
|
26
26
|
const listServerRelativeUrl = urlUtil.getServerRelativePath(appCatalogUrl, '/lists/TenantWideExtensions');
|
|
27
27
|
try {
|
|
28
|
-
const
|
|
29
|
-
|
|
28
|
+
const listItems = await odata.getAllItems(`${appCatalogUrl}/_api/web/GetList('${formatting.encodeQueryParameter(listServerRelativeUrl)}')/items?$filter=startswith(TenantWideExtensionLocation, 'ClientSideExtension.ListViewCommandSet')`);
|
|
29
|
+
listItems.forEach(i => delete i.ID);
|
|
30
|
+
await logger.log(listItems);
|
|
30
31
|
}
|
|
31
32
|
catch (err) {
|
|
32
33
|
this.handleRejectedODataJsonPromise(err);
|
|
@@ -3,7 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
3
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _SpoTenantCommandSetSetCommand_instances, _SpoTenantCommandSetSetCommand_initTelemetry, _SpoTenantCommandSetSetCommand_initOptions, _SpoTenantCommandSetSetCommand_initValidators;
|
|
6
|
+
var _SpoTenantCommandSetSetCommand_instances, _a, _SpoTenantCommandSetSetCommand_initTelemetry, _SpoTenantCommandSetSetCommand_initOptions, _SpoTenantCommandSetSetCommand_initValidators;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
9
|
import { spo } from '../../../../utils/spo.js';
|
|
@@ -129,7 +129,7 @@ class SpoTenantCommandSetSetCommand extends SpoCommand {
|
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
-
_SpoTenantCommandSetSetCommand_instances = new WeakSet(), _SpoTenantCommandSetSetCommand_initTelemetry = function _SpoTenantCommandSetSetCommand_initTelemetry() {
|
|
132
|
+
_a = SpoTenantCommandSetSetCommand, _SpoTenantCommandSetSetCommand_instances = new WeakSet(), _SpoTenantCommandSetSetCommand_initTelemetry = function _SpoTenantCommandSetSetCommand_initTelemetry() {
|
|
133
133
|
this.telemetry.push((args) => {
|
|
134
134
|
Object.assign(this.telemetryProperties, {
|
|
135
135
|
newTitle: typeof args.options.newTitle !== 'undefined',
|
|
@@ -147,7 +147,7 @@ _SpoTenantCommandSetSetCommand_instances = new WeakSet(), _SpoTenantCommandSetSe
|
|
|
147
147
|
option: '-t, --newTitle [newTitle]'
|
|
148
148
|
}, {
|
|
149
149
|
option: '-l, --listType [listType]',
|
|
150
|
-
autocomplete:
|
|
150
|
+
autocomplete: _a.listTypes
|
|
151
151
|
}, {
|
|
152
152
|
option: '-c, --clientSideComponentId [clientSideComponentId]'
|
|
153
153
|
}, {
|
|
@@ -156,7 +156,7 @@ _SpoTenantCommandSetSetCommand_instances = new WeakSet(), _SpoTenantCommandSetSe
|
|
|
156
156
|
option: '-w, --webTemplate [webTemplate]'
|
|
157
157
|
}, {
|
|
158
158
|
option: '--location [location]',
|
|
159
|
-
autocomplete:
|
|
159
|
+
autocomplete: _a.locations
|
|
160
160
|
});
|
|
161
161
|
}, _SpoTenantCommandSetSetCommand_initValidators = function _SpoTenantCommandSetSetCommand_initValidators() {
|
|
162
162
|
this.validators.push(async (args) => {
|
|
@@ -171,11 +171,11 @@ _SpoTenantCommandSetSetCommand_instances = new WeakSet(), _SpoTenantCommandSetSe
|
|
|
171
171
|
if (args.options.clientSideComponentId && !validation.isValidGuid(args.options.clientSideComponentId)) {
|
|
172
172
|
return `${args.options.clientSideComponentId} is not a valid GUID`;
|
|
173
173
|
}
|
|
174
|
-
if (args.options.listType &&
|
|
175
|
-
return `${args.options.listType} is not a valid list type. Allowed values are ${
|
|
174
|
+
if (args.options.listType && _a.listTypes.indexOf(args.options.listType) < 0) {
|
|
175
|
+
return `${args.options.listType} is not a valid list type. Allowed values are ${_a.listTypes.join(', ')}`;
|
|
176
176
|
}
|
|
177
|
-
if (args.options.location &&
|
|
178
|
-
return `${args.options.location} is not a valid location. Allowed values are ${
|
|
177
|
+
if (args.options.location && _a.locations.indexOf(args.options.location) < 0) {
|
|
178
|
+
return `${args.options.location} is not a valid location. Allowed values are ${_a.locations.join(', ')}`;
|
|
179
179
|
}
|
|
180
180
|
return true;
|
|
181
181
|
});
|
|
@@ -3,7 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
3
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _SpoTenantSettingsSetCommand_instances, _SpoTenantSettingsSetCommand_initTelemetry, _SpoTenantSettingsSetCommand_initOptions, _SpoTenantSettingsSetCommand_initValidators, _SpoTenantSettingsSetCommand_initTypes;
|
|
6
|
+
var _SpoTenantSettingsSetCommand_instances, _a, _SpoTenantSettingsSetCommand_initTelemetry, _SpoTenantSettingsSetCommand_initOptions, _SpoTenantSettingsSetCommand_initValidators, _SpoTenantSettingsSetCommand_initTypes;
|
|
7
7
|
import config from '../../../../config.js';
|
|
8
8
|
import request from '../../../../request.js';
|
|
9
9
|
import { formatting } from '../../../../utils/formatting.js';
|
|
@@ -132,7 +132,7 @@ class SpoTenantSettingsSetCommand extends SpoCommand {
|
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
-
_SpoTenantSettingsSetCommand_instances = new WeakSet(), _SpoTenantSettingsSetCommand_initTelemetry = function _SpoTenantSettingsSetCommand_initTelemetry() {
|
|
135
|
+
_a = SpoTenantSettingsSetCommand, _SpoTenantSettingsSetCommand_instances = new WeakSet(), _SpoTenantSettingsSetCommand_initTelemetry = function _SpoTenantSettingsSetCommand_initTelemetry() {
|
|
136
136
|
this.telemetry.push((args) => {
|
|
137
137
|
const telemetryProps = {
|
|
138
138
|
MinCompatibilityLevel: (!(!args.options.MinCompatibilityLevel)).toString(),
|
|
@@ -167,7 +167,7 @@ _SpoTenantSettingsSetCommand_instances = new WeakSet(), _SpoTenantSettingsSetCom
|
|
|
167
167
|
AllowedDomainListForSyncClient: (!(!args.options.AllowedDomainListForSyncClient)).toString()
|
|
168
168
|
};
|
|
169
169
|
// add boolean values
|
|
170
|
-
|
|
170
|
+
_a.booleanOptions.forEach(o => {
|
|
171
171
|
const value = args.options[o];
|
|
172
172
|
if (value !== undefined) {
|
|
173
173
|
telemetryProps[o] = value;
|
|
@@ -439,7 +439,7 @@ _SpoTenantSettingsSetCommand_instances = new WeakSet(), _SpoTenantSettingsSetCom
|
|
|
439
439
|
return true;
|
|
440
440
|
});
|
|
441
441
|
}, _SpoTenantSettingsSetCommand_initTypes = function _SpoTenantSettingsSetCommand_initTypes() {
|
|
442
|
-
this.types.boolean.push(...
|
|
442
|
+
this.types.boolean.push(..._a.booleanOptions);
|
|
443
443
|
};
|
|
444
444
|
SpoTenantSettingsSetCommand.booleanOptions = [
|
|
445
445
|
'ExternalServicesEnabled',
|
|
@@ -28,7 +28,7 @@ class SpoWebRoleInheritanceBreakCommand extends SpoCommand {
|
|
|
28
28
|
await logger.logToStderr(`Break role inheritance of subsite with URL ${args.options.webUrl}...`);
|
|
29
29
|
}
|
|
30
30
|
if (args.options.force) {
|
|
31
|
-
await this.
|
|
31
|
+
await this.breakRoleInheritance(args.options);
|
|
32
32
|
}
|
|
33
33
|
else {
|
|
34
34
|
const result = await Cli.prompt({
|
|
@@ -38,11 +38,11 @@ class SpoWebRoleInheritanceBreakCommand extends SpoCommand {
|
|
|
38
38
|
message: `Are you sure you want to break the role inheritance of subsite ${args.options.webUrl}`
|
|
39
39
|
});
|
|
40
40
|
if (result.continue) {
|
|
41
|
-
await this.
|
|
41
|
+
await this.breakRoleInheritance(args.options);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
async
|
|
45
|
+
async breakRoleInheritance(options) {
|
|
46
46
|
const requestOptions = {
|
|
47
47
|
url: `${options.webUrl}/_api/web/breakroleinheritance(${!options.clearExistingPermissions})`,
|
|
48
48
|
headers: {
|
|
@@ -3,7 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
3
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _SpoWebSetCommand_instances, _SpoWebSetCommand_initTelemetry, _SpoWebSetCommand_initOptions, _SpoWebSetCommand_initTypes, _SpoWebSetCommand_initValidators;
|
|
6
|
+
var _SpoWebSetCommand_instances, _a, _SpoWebSetCommand_initTelemetry, _SpoWebSetCommand_initOptions, _SpoWebSetCommand_initTypes, _SpoWebSetCommand_initValidators;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { validation } from '../../../../utils/validation.js';
|
|
9
9
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
@@ -55,7 +55,7 @@ class SpoWebSetCommand extends SpoCommand {
|
|
|
55
55
|
}
|
|
56
56
|
if (typeof args.options.searchScope !== 'undefined') {
|
|
57
57
|
const searchScope = args.options.searchScope.toLowerCase();
|
|
58
|
-
payload.SearchScope =
|
|
58
|
+
payload.SearchScope = _a.searchScopeOptions.indexOf(searchScope);
|
|
59
59
|
}
|
|
60
60
|
try {
|
|
61
61
|
const requestOptions = {
|
|
@@ -97,7 +97,7 @@ class SpoWebSetCommand extends SpoCommand {
|
|
|
97
97
|
return true;
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
_SpoWebSetCommand_instances = new WeakSet(), _SpoWebSetCommand_initTelemetry = function _SpoWebSetCommand_initTelemetry() {
|
|
100
|
+
_a = SpoWebSetCommand, _SpoWebSetCommand_instances = new WeakSet(), _SpoWebSetCommand_initTelemetry = function _SpoWebSetCommand_initTelemetry() {
|
|
101
101
|
this.telemetry.push((args) => {
|
|
102
102
|
Object.assign(this.telemetryProperties, {
|
|
103
103
|
description: typeof args.options.description !== 'undefined',
|
|
@@ -143,7 +143,7 @@ _SpoWebSetCommand_instances = new WeakSet(), _SpoWebSetCommand_initTelemetry = f
|
|
|
143
143
|
autocomplete: ['true', 'false']
|
|
144
144
|
}, {
|
|
145
145
|
option: '--searchScope [searchScope]',
|
|
146
|
-
autocomplete:
|
|
146
|
+
autocomplete: _a.searchScopeOptions
|
|
147
147
|
}, {
|
|
148
148
|
option: '--welcomePage [welcomePage]'
|
|
149
149
|
});
|
|
@@ -170,7 +170,7 @@ _SpoWebSetCommand_instances = new WeakSet(), _SpoWebSetCommand_initTelemetry = f
|
|
|
170
170
|
}
|
|
171
171
|
if (typeof args.options.searchScope !== 'undefined') {
|
|
172
172
|
const searchScope = args.options.searchScope.toString().toLowerCase();
|
|
173
|
-
if (
|
|
173
|
+
if (_a.searchScopeOptions.indexOf(searchScope) < 0) {
|
|
174
174
|
return `${args.options.searchScope} is not a valid value for searchScope. Allowed values are DefaultScope|Tenant|Hub|Site`;
|
|
175
175
|
}
|
|
176
176
|
}
|