@pnp/cli-microsoft365 9.1.0-beta.acd25f7 → 9.1.0-beta.d9b8f73
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/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/Auth.js +3 -3
- package/dist/AuthServer.js +7 -7
- package/dist/api.js +1 -1
- package/dist/config.js +1 -0
- package/dist/m365/external/commands/item/item-add.js +2 -5
- package/dist/m365/spo/commands/site/site-admin-list.js +8 -9
- package/dist/m365/spo/commands/site/site-admin-remove.js +5 -4
- package/dist/m365/viva/commands/engage/Community.js +2 -0
- package/dist/m365/viva/commands/engage/engage-community-list.js +28 -0
- package/dist/m365/viva/commands.js +1 -0
- package/dist/request.js +46 -61
- package/dist/utils/spo.js +5 -7
- package/dist/utils/timersUtil.js +12 -0
- package/docs/docs/cmd/external/item/item-add.mdx +3 -3
- package/docs/docs/cmd/spo/site/site-admin-list.mdx +64 -12
- package/docs/docs/cmd/viva/engage/engage-community-list.mdx +81 -0
- package/package.json +1 -1
package/dist/Auth.js
CHANGED
|
@@ -117,7 +117,7 @@ export class Auth {
|
|
|
117
117
|
async restoreAuth() {
|
|
118
118
|
// check if auth has been restored previously
|
|
119
119
|
if (this._connection.active) {
|
|
120
|
-
return
|
|
120
|
+
return;
|
|
121
121
|
}
|
|
122
122
|
try {
|
|
123
123
|
const connection = await this.getConnectionInfoFromStorage();
|
|
@@ -473,7 +473,7 @@ export class Auth {
|
|
|
473
473
|
}
|
|
474
474
|
if (userName && process.env.ACC_CLOUD) {
|
|
475
475
|
// reject for now since the Azure Cloud Shell does not support user-managed identity
|
|
476
|
-
|
|
476
|
+
throw 'Azure Cloud Shell does not support user-managed identity. You can execute the command without the --userName option to login with user identity';
|
|
477
477
|
}
|
|
478
478
|
requestOptions.url = `${process.env.IDENTITY_ENDPOINT}?resource=${encodeURIComponent(resource)}`;
|
|
479
479
|
}
|
|
@@ -483,7 +483,7 @@ export class Auth {
|
|
|
483
483
|
}
|
|
484
484
|
if (userName && process.env.ACC_CLOUD) {
|
|
485
485
|
// reject for now since the Azure Cloud Shell does not support user-managed identity
|
|
486
|
-
|
|
486
|
+
throw 'Azure Cloud Shell does not support user-managed identity. You can execute the command without the --userName option to login with user identity';
|
|
487
487
|
}
|
|
488
488
|
requestOptions.url = `${process.env.MSI_ENDPOINT}?resource=${encodeURIComponent(resource)}`;
|
|
489
489
|
}
|
package/dist/AuthServer.js
CHANGED
|
@@ -26,7 +26,7 @@ export class AuthServer {
|
|
|
26
26
|
await this.logger.logToStderr(url);
|
|
27
27
|
await this.logger.logToStderr('');
|
|
28
28
|
}
|
|
29
|
-
this.openUrl(url);
|
|
29
|
+
await this.openUrl(url);
|
|
30
30
|
};
|
|
31
31
|
this.httpRequest = async (request, response) => {
|
|
32
32
|
if (this.debug) {
|
|
@@ -80,19 +80,19 @@ export class AuthServer {
|
|
|
80
80
|
get server() {
|
|
81
81
|
return this.httpServer;
|
|
82
82
|
}
|
|
83
|
-
openUrl(url) {
|
|
84
|
-
|
|
85
|
-
.
|
|
83
|
+
async openUrl(url) {
|
|
84
|
+
try {
|
|
85
|
+
await browserUtil.open(url);
|
|
86
86
|
await this.logger.logToStderr("To sign in, use the web browser that just has been opened. Please sign-in there.");
|
|
87
|
-
}
|
|
88
|
-
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
89
|
const errorResponse = {
|
|
90
90
|
error: "Can't open the default browser",
|
|
91
91
|
errorDescription: "Was not able to open a browser instance. Try again later or use a different authentication method."
|
|
92
92
|
};
|
|
93
93
|
this.reject(errorResponse);
|
|
94
94
|
this.httpServer.close();
|
|
95
|
-
}
|
|
95
|
+
}
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
export default new AuthServer();
|
package/dist/api.js
CHANGED
|
@@ -3,7 +3,7 @@ export async function executeCommand(commandName, options, listener) {
|
|
|
3
3
|
cli.loadAllCommandsInfo();
|
|
4
4
|
await cli.loadCommandFromArgs(commandName.split(' '));
|
|
5
5
|
if (!cli.commandToExecute) {
|
|
6
|
-
|
|
6
|
+
throw `Command not found: ${commandName}`;
|
|
7
7
|
}
|
|
8
8
|
return cli.executeCommandWithOutput(cli.commandToExecute.command, { options: options ?? {} }, listener);
|
|
9
9
|
}
|
package/dist/config.js
CHANGED
|
@@ -14,6 +14,7 @@ export default {
|
|
|
14
14
|
'https://graph.microsoft.com/ChannelMessage.Send',
|
|
15
15
|
'https://graph.microsoft.com/ChannelSettings.ReadWrite.All',
|
|
16
16
|
'https://graph.microsoft.com/Chat.ReadWrite',
|
|
17
|
+
'https://graph.microsoft.com/Community.ReadWrite.All',
|
|
17
18
|
'https://graph.microsoft.com/Directory.AccessAsUser.All',
|
|
18
19
|
'https://graph.microsoft.com/Directory.ReadWrite.All',
|
|
19
20
|
'https://graph.microsoft.com/ExternalConnection.ReadWrite.All',
|
|
@@ -45,8 +45,7 @@ class ExternalItemAddCommand extends GraphCommand {
|
|
|
45
45
|
properties: {}
|
|
46
46
|
};
|
|
47
47
|
// we need to rewrite the @odata properties to the correct format
|
|
48
|
-
//
|
|
49
|
-
// we also need to extract multiple values for collections into arrays
|
|
48
|
+
// to extract multiple values for collections into arrays
|
|
50
49
|
this.rewriteCollectionProperties(args.options);
|
|
51
50
|
this.addUnknownOptionsToPayload(requestBody.properties, args.options);
|
|
52
51
|
const requestOptions = {
|
|
@@ -81,11 +80,9 @@ class ExternalItemAddCommand extends GraphCommand {
|
|
|
81
80
|
}
|
|
82
81
|
rewriteCollectionProperties(options) {
|
|
83
82
|
Object.getOwnPropertyNames(options).forEach(name => {
|
|
84
|
-
if (!name.
|
|
83
|
+
if (!name.includes('@odata')) {
|
|
85
84
|
return;
|
|
86
85
|
}
|
|
87
|
-
options[`${name}.type`] = options[name].type;
|
|
88
|
-
delete options[name];
|
|
89
86
|
// convert the value of a collection to an array
|
|
90
87
|
const nameWithoutOData = name.substring(0, name.indexOf('@odata'));
|
|
91
88
|
if (options[nameWithoutOData]) {
|
|
@@ -17,6 +17,9 @@ class SpoSiteAdminListCommand extends SpoCommand {
|
|
|
17
17
|
get description() {
|
|
18
18
|
return 'Lists all administrators of a specific SharePoint site';
|
|
19
19
|
}
|
|
20
|
+
defaultProperties() {
|
|
21
|
+
return ['Id', 'LoginName', 'Title', 'PrincipalTypeString'];
|
|
22
|
+
}
|
|
20
23
|
constructor() {
|
|
21
24
|
super();
|
|
22
25
|
_SpoSiteAdminListCommand_instances.add(this);
|
|
@@ -46,20 +49,16 @@ class SpoSiteAdminListCommand extends SpoCommand {
|
|
|
46
49
|
const requestOptions = {
|
|
47
50
|
url: `${adminUrl}/_api/SPO.Tenant/GetSiteAdministrators?siteId='${siteId}'`,
|
|
48
51
|
headers: {
|
|
49
|
-
accept: 'application/json;odata=nometadata'
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
accept: 'application/json;odata=nometadata'
|
|
53
|
+
},
|
|
54
|
+
responseType: 'json'
|
|
52
55
|
};
|
|
53
56
|
const response = await request.post(requestOptions);
|
|
54
|
-
const responseContent = JSON.parse(response);
|
|
55
57
|
const primaryAdminLoginName = await spo.getPrimaryAdminLoginNameAsAdmin(adminUrl, siteId, logger, this.verbose);
|
|
56
|
-
const mappedResult =
|
|
57
|
-
Id: null,
|
|
58
|
+
const mappedResult = response.value.map((u) => ({
|
|
58
59
|
Email: u.email,
|
|
59
60
|
LoginName: u.loginName,
|
|
60
61
|
Title: u.name,
|
|
61
|
-
PrincipalType: null,
|
|
62
|
-
PrincipalTypeString: null,
|
|
63
62
|
IsPrimaryAdmin: u.loginName === primaryAdminLoginName
|
|
64
63
|
}));
|
|
65
64
|
await logger.log(mappedResult);
|
|
@@ -78,7 +77,6 @@ class SpoSiteAdminListCommand extends SpoCommand {
|
|
|
78
77
|
}
|
|
79
78
|
const requestOptions = {
|
|
80
79
|
url: `${args.options.siteUrl}/_api/web/siteusers?$filter=IsSiteAdmin eq true`,
|
|
81
|
-
method: 'GET',
|
|
82
80
|
headers: {
|
|
83
81
|
'accept': 'application/json;odata=nometadata'
|
|
84
82
|
},
|
|
@@ -114,6 +112,7 @@ _SpoSiteAdminListCommand_instances = new WeakSet(), _SpoSiteAdminListCommand_ini
|
|
|
114
112
|
this.validators.push(async (args) => validation.isValidSharePointUrl(args.options.siteUrl));
|
|
115
113
|
}, _SpoSiteAdminListCommand_initTypes = function _SpoSiteAdminListCommand_initTypes() {
|
|
116
114
|
this.types.string.push('siteUrl');
|
|
115
|
+
this.types.boolean.push('asAdmin');
|
|
117
116
|
};
|
|
118
117
|
export default new SpoSiteAdminListCommand();
|
|
119
118
|
//# sourceMappingURL=site-admin-list.js.map
|
|
@@ -77,11 +77,11 @@ class SpoSiteAdminRemoveCommand extends SpoCommand {
|
|
|
77
77
|
headers: {
|
|
78
78
|
accept: 'application/json;odata=nometadata',
|
|
79
79
|
'content-type': 'application/json;charset=utf-8'
|
|
80
|
-
}
|
|
80
|
+
},
|
|
81
|
+
responseType: 'json'
|
|
81
82
|
};
|
|
82
83
|
const response = await request.post(requestOptions);
|
|
83
|
-
|
|
84
|
-
return responseContent.value;
|
|
84
|
+
return response.value;
|
|
85
85
|
}
|
|
86
86
|
async getCorrectLoginName(options) {
|
|
87
87
|
if (options.userId || options.userName) {
|
|
@@ -116,7 +116,8 @@ class SpoSiteAdminRemoveCommand extends SpoCommand {
|
|
|
116
116
|
siteId: siteId,
|
|
117
117
|
secondaryAdministratorLoginNames: admins.map(u => u.loginName)
|
|
118
118
|
}
|
|
119
|
-
}
|
|
119
|
+
},
|
|
120
|
+
responseType: 'json'
|
|
120
121
|
};
|
|
121
122
|
await request.post(requestOptions);
|
|
122
123
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { odata } from '../../../../utils/odata.js';
|
|
2
|
+
import GraphCommand from '../../../base/GraphCommand.js';
|
|
3
|
+
import commands from '../../commands.js';
|
|
4
|
+
class VivaEngageCommunityListCommand extends GraphCommand {
|
|
5
|
+
get name() {
|
|
6
|
+
return commands.ENGAGE_COMMUNITY_LIST;
|
|
7
|
+
}
|
|
8
|
+
get description() {
|
|
9
|
+
return 'Lists all Viva Engage communities';
|
|
10
|
+
}
|
|
11
|
+
defaultProperties() {
|
|
12
|
+
return ['id', 'displayName', 'privacy'];
|
|
13
|
+
}
|
|
14
|
+
async commandAction(logger) {
|
|
15
|
+
if (this.verbose) {
|
|
16
|
+
await logger.logToStderr('Getting all Viva Engage communities...');
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
const results = await odata.getAllItems(`${this.resource}/v1.0/employeeExperience/communities`);
|
|
20
|
+
await logger.log(results);
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
this.handleRejectedODataJsonPromise(err);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export default new VivaEngageCommunityListCommand();
|
|
28
|
+
//# sourceMappingURL=engage-community-list.js.map
|
|
@@ -3,6 +3,7 @@ export default {
|
|
|
3
3
|
CONNECTIONS_APP_CREATE: `${prefix} connections app create`,
|
|
4
4
|
ENGAGE_COMMUNITY_ADD: `${prefix} engage community add`,
|
|
5
5
|
ENGAGE_COMMUNITY_GET: `${prefix} engage community get`,
|
|
6
|
+
ENGAGE_COMMUNITY_LIST: `${prefix} engage community list`,
|
|
6
7
|
ENGAGE_GROUP_LIST: `${prefix} engage group list`,
|
|
7
8
|
ENGAGE_GROUP_USER_ADD: `${prefix} engage group user add`,
|
|
8
9
|
ENGAGE_GROUP_USER_REMOVE: `${prefix} engage group user remove`,
|
package/dist/request.js
CHANGED
|
@@ -4,6 +4,7 @@ import auth, { Auth } from './Auth.js';
|
|
|
4
4
|
import { app } from './utils/app.js';
|
|
5
5
|
import { formatting } from './utils/formatting.js';
|
|
6
6
|
import { timings } from './cli/timings.js';
|
|
7
|
+
import { timersUtil } from './utils/timersUtil.js';
|
|
7
8
|
class Request {
|
|
8
9
|
set debug(debug) {
|
|
9
10
|
// if the value to set is the same as current value return early to avoid
|
|
@@ -125,76 +126,60 @@ class Request {
|
|
|
125
126
|
options.method = 'HEAD';
|
|
126
127
|
return this.execute(options);
|
|
127
128
|
}
|
|
128
|
-
execute(options
|
|
129
|
+
async execute(options) {
|
|
129
130
|
const start = process.hrtime.bigint();
|
|
130
131
|
if (!this._logger) {
|
|
131
|
-
|
|
132
|
+
throw 'Logger not set on the request object';
|
|
132
133
|
}
|
|
133
134
|
this.updateRequestForCloudType(options, auth.connection.cloudType);
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
.
|
|
146
|
-
|
|
147
|
-
if (options.headers['x-anonymous']) {
|
|
148
|
-
delete options.headers['x-anonymous'];
|
|
149
|
-
}
|
|
150
|
-
if (options.headers['x-resource']) {
|
|
151
|
-
delete options.headers['x-resource'];
|
|
152
|
-
}
|
|
153
|
-
if (accessToken !== '') {
|
|
154
|
-
options.headers.authorization = `Bearer ${accessToken}`;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
const proxyUrl = process.env.HTTP_PROXY || process.env.HTTPS_PROXY;
|
|
158
|
-
if (proxyUrl) {
|
|
159
|
-
options.proxy = this.createProxyConfigFromUrl(proxyUrl);
|
|
135
|
+
try {
|
|
136
|
+
let accessToken = '';
|
|
137
|
+
if (options.headers && options.headers['x-anonymous']) {
|
|
138
|
+
accessToken = '';
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
const url = options.headers && options.headers['x-resource'] ? options.headers['x-resource'] : options.url;
|
|
142
|
+
const resource = Auth.getResourceFromUrl(url);
|
|
143
|
+
accessToken = await auth.ensureAccessToken(resource, this._logger, this._debug);
|
|
144
|
+
}
|
|
145
|
+
if (options.headers) {
|
|
146
|
+
if (options.headers['x-anonymous']) {
|
|
147
|
+
delete options.headers['x-anonymous'];
|
|
160
148
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
.then((res) => {
|
|
164
|
-
if (resolve) {
|
|
165
|
-
resolve((options.responseType === 'stream' || options.fullResponse) ? res : res.data);
|
|
149
|
+
if (options.headers['x-resource']) {
|
|
150
|
+
delete options.headers['x-resource'];
|
|
166
151
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
timings.api.push(Number(end - start));
|
|
170
|
-
_resolve((options.responseType === 'stream' || options.fullResponse) ? res : res.data);
|
|
152
|
+
if (accessToken !== '') {
|
|
153
|
+
options.headers.authorization = `Bearer ${accessToken}`;
|
|
171
154
|
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
155
|
+
}
|
|
156
|
+
const proxyUrl = process.env.HTTP_PROXY || process.env.HTTPS_PROXY;
|
|
157
|
+
if (proxyUrl) {
|
|
158
|
+
options.proxy = this.createProxyConfigFromUrl(proxyUrl);
|
|
159
|
+
}
|
|
160
|
+
const res = await this.req(options);
|
|
161
|
+
const end = process.hrtime.bigint();
|
|
162
|
+
timings.api.push(Number(end - start));
|
|
163
|
+
return options.responseType === 'stream' || options.fullResponse ?
|
|
164
|
+
res :
|
|
165
|
+
res.data;
|
|
166
|
+
}
|
|
167
|
+
catch (error) {
|
|
168
|
+
const end = process.hrtime.bigint();
|
|
169
|
+
timings.api.push(Number(end - start));
|
|
170
|
+
if (error && error.response && (error.response.status === 429 || error.response.status === 503)) {
|
|
171
|
+
let retryAfter = parseInt(error.response.headers['retry-after'] || '10');
|
|
172
|
+
if (isNaN(retryAfter)) {
|
|
173
|
+
retryAfter = 10;
|
|
185
174
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
reject(error);
|
|
189
|
-
}
|
|
190
|
-
else {
|
|
191
|
-
const end = process.hrtime.bigint();
|
|
192
|
-
timings.api.push(Number(end - start));
|
|
193
|
-
_reject(error);
|
|
194
|
-
}
|
|
175
|
+
if (this._debug) {
|
|
176
|
+
await this._logger.log(`Request throttled. Waiting ${retryAfter} sec before retrying...`);
|
|
195
177
|
}
|
|
196
|
-
|
|
197
|
-
|
|
178
|
+
await timersUtil.setTimeout(retryAfter * 1000);
|
|
179
|
+
return this.execute(options);
|
|
180
|
+
}
|
|
181
|
+
throw error;
|
|
182
|
+
}
|
|
198
183
|
}
|
|
199
184
|
updateRequestForCloudType(options, cloudType) {
|
|
200
185
|
const url = new URL(options.url);
|
package/dist/utils/spo.js
CHANGED
|
@@ -1541,7 +1541,7 @@ export const spo = {
|
|
|
1541
1541
|
return file;
|
|
1542
1542
|
},
|
|
1543
1543
|
/**
|
|
1544
|
-
* Gets the
|
|
1544
|
+
* Gets the primary owner login from a site as admin.
|
|
1545
1545
|
* @param adminUrl The SharePoint admin URL
|
|
1546
1546
|
* @param siteId The site ID
|
|
1547
1547
|
* @param logger The logger object
|
|
@@ -1555,13 +1555,12 @@ export const spo = {
|
|
|
1555
1555
|
const requestOptions = {
|
|
1556
1556
|
url: `${adminUrl}/_api/SPO.Tenant/sites('${siteId}')?$select=OwnerLoginName`,
|
|
1557
1557
|
headers: {
|
|
1558
|
-
accept: 'application/json;odata=nometadata'
|
|
1559
|
-
|
|
1560
|
-
|
|
1558
|
+
accept: 'application/json;odata=nometadata'
|
|
1559
|
+
},
|
|
1560
|
+
responseType: 'json'
|
|
1561
1561
|
};
|
|
1562
1562
|
const response = await request.get(requestOptions);
|
|
1563
|
-
|
|
1564
|
-
return responseContent.OwnerLoginName;
|
|
1563
|
+
return response.OwnerLoginName;
|
|
1565
1564
|
},
|
|
1566
1565
|
/**
|
|
1567
1566
|
* Gets the primary owner login from a site.
|
|
@@ -1576,7 +1575,6 @@ export const spo = {
|
|
|
1576
1575
|
}
|
|
1577
1576
|
const requestOptions = {
|
|
1578
1577
|
url: `${siteUrl}/_api/site/owner`,
|
|
1579
|
-
method: 'GET',
|
|
1580
1578
|
headers: {
|
|
1581
1579
|
'accept': 'application/json;odata=nometadata'
|
|
1582
1580
|
},
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { setTimeout } from "timers/promises";
|
|
2
|
+
export const timersUtil = {
|
|
3
|
+
/**
|
|
4
|
+
* Timeout for a specific duration.
|
|
5
|
+
* @param duration Duration in milliseconds.
|
|
6
|
+
*/
|
|
7
|
+
/* c8 ignore next 3 */
|
|
8
|
+
async setTimeout(duration) {
|
|
9
|
+
return setTimeout(duration);
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=timersUtil.js.map
|
|
@@ -63,13 +63,13 @@ For more information about using these options, see the Microsoft Graph API docu
|
|
|
63
63
|
Creates an external item with simple properties that everyone is allowed to access
|
|
64
64
|
|
|
65
65
|
```sh
|
|
66
|
-
m365 external item add --id "pnp-ensure-siteassets-library" --
|
|
66
|
+
m365 external item add --id "pnp-ensure-siteassets-library" --externalConnectionId "samplesolutiongallery" --content "Ensure that the Site Assets library is created." --title "Ensure the Site Assets Library is created" --description "Ensure that the Site Assets library is created." --authors "Phil Harding" --acls "grant,everyone,everyone"
|
|
67
67
|
```
|
|
68
68
|
|
|
69
69
|
Creates an external item with multi-value properties accessible only to users from the specified Entra group
|
|
70
70
|
|
|
71
71
|
```sh
|
|
72
|
-
m365 external item add --id "pnp-ensure-siteassets-library" --
|
|
72
|
+
m365 external item add --id "pnp-ensure-siteassets-library" --externalConnectionId "samplesolutiongallery" --content "Ensure that the Site Assets library is created." --title "Ensure the Site Assets Library is created" --description "Ensure that the Site Assets library is created." --authors@odata.type "Collection(String)" --authors "Phil Harding;#Steve Smith" --acls "grant,group,Super users"
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
## Response
|
|
@@ -123,7 +123,7 @@ m365 external item add --id "pnp-ensure-siteassets-library" --connectionId "samp
|
|
|
123
123
|
<TabItem value="Markdown">
|
|
124
124
|
|
|
125
125
|
```md
|
|
126
|
-
# m365 external item add --id "pnp-ensure-siteassets-library" --
|
|
126
|
+
# m365 external item add --id "pnp-ensure-siteassets-library" --externalConnectionId "samplesolutiongallery" --content "Ensure that the Site Assets library is created." --title "Ensure the Site Assets Library is created" --description "Ensure that the Site Assets library is created." --authors "Phil Harding" --acls "grant,everyone,everyone"
|
|
127
127
|
|
|
128
128
|
Date: 2023-10-28
|
|
129
129
|
|
|
@@ -28,12 +28,10 @@ m365 spo site admin list [options]
|
|
|
28
28
|
|
|
29
29
|
:::info
|
|
30
30
|
|
|
31
|
-
To use this command with the `--asAdmin` mode, you must
|
|
31
|
+
To use this command with the `--asAdmin` mode, you must be at least SharePoint administrator.
|
|
32
32
|
|
|
33
33
|
Without this parameter, you must have site collection admin permissions for the requested site.
|
|
34
34
|
|
|
35
|
-
In `--asAdmin` mode, the Id, PrincipalType, and PrincipalTypeString properties are not exported.
|
|
36
|
-
|
|
37
35
|
:::
|
|
38
36
|
|
|
39
37
|
## Examples
|
|
@@ -52,6 +50,8 @@ m365 spo site admin list --siteUrl https://contoso.sharepoint.com --asAdmin
|
|
|
52
50
|
|
|
53
51
|
## Response
|
|
54
52
|
|
|
53
|
+
### Standard response
|
|
54
|
+
|
|
55
55
|
<Tabs>
|
|
56
56
|
<TabItem value="JSON">
|
|
57
57
|
|
|
@@ -73,13 +73,9 @@ m365 spo site admin list --siteUrl https://contoso.sharepoint.com --asAdmin
|
|
|
73
73
|
<TabItem value="Text">
|
|
74
74
|
|
|
75
75
|
```text
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
PrincipalType : 1
|
|
80
|
-
PrincipalTypeString : User
|
|
81
|
-
Title : User Example
|
|
82
|
-
IsPrimaryAdmin : true
|
|
76
|
+
Id LoginName Title PrincipalTypeString
|
|
77
|
+
-- --------------------------------------------------------------------------- ------- -------------------
|
|
78
|
+
15 c:0o.c|federateddirectoryclaimprovider|d8430798-5a00-00ba-83b0-dd7a032d549a Members SecurityGroup
|
|
83
79
|
```
|
|
84
80
|
|
|
85
81
|
</TabItem>
|
|
@@ -98,7 +94,7 @@ m365 spo site admin list --siteUrl https://contoso.sharepoint.com --asAdmin
|
|
|
98
94
|
|
|
99
95
|
Date: 20/03/2024
|
|
100
96
|
|
|
101
|
-
## User
|
|
97
|
+
## User Example
|
|
102
98
|
|
|
103
99
|
Property | Value
|
|
104
100
|
---------|-------
|
|
@@ -112,4 +108,60 @@ m365 spo site admin list --siteUrl https://contoso.sharepoint.com --asAdmin
|
|
|
112
108
|
```
|
|
113
109
|
|
|
114
110
|
</TabItem>
|
|
115
|
-
</Tabs>
|
|
111
|
+
</Tabs>
|
|
112
|
+
|
|
113
|
+
### `asAdmin` response
|
|
114
|
+
|
|
115
|
+
When we make use of the option `asAdmin` the response will differ.
|
|
116
|
+
|
|
117
|
+
<Tabs>
|
|
118
|
+
<TabItem value="JSON">
|
|
119
|
+
|
|
120
|
+
```json
|
|
121
|
+
[
|
|
122
|
+
{
|
|
123
|
+
"Email": "user@contoso.com",
|
|
124
|
+
"LoginName": "i:0#.f|membership|user@contoso.com",
|
|
125
|
+
"Title": "User Example",
|
|
126
|
+
"IsPrimaryAdmin": true
|
|
127
|
+
}
|
|
128
|
+
]
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
</TabItem>
|
|
132
|
+
<TabItem value="Text">
|
|
133
|
+
|
|
134
|
+
```text
|
|
135
|
+
LoginName Title
|
|
136
|
+
--------------------------------------------------------------------------- ---------------
|
|
137
|
+
c:0o.c|federateddirectoryclaimprovider|d8430798-5a00-00ba-83b0-dd7a032d549a Members
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
</TabItem>
|
|
141
|
+
<TabItem value="CSV">
|
|
142
|
+
|
|
143
|
+
```csv
|
|
144
|
+
Email,LoginName,Title,IsPrimaryAdmin
|
|
145
|
+
user@contoso.com,i:0#.f|membership|user@contoso.com,User Example,1
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
</TabItem>
|
|
149
|
+
<TabItem value="Markdown">
|
|
150
|
+
|
|
151
|
+
```md
|
|
152
|
+
# spo site admin list --siteUrl "https://contoso.sharepoint.com/sites/Test" --asAdmin
|
|
153
|
+
|
|
154
|
+
Date: 20/03/2024
|
|
155
|
+
|
|
156
|
+
## User Example
|
|
157
|
+
|
|
158
|
+
Property | Value
|
|
159
|
+
---------|-------
|
|
160
|
+
Email | user@contoso.com
|
|
161
|
+
LoginName | i:0#.f\|membership\|user@contoso.com
|
|
162
|
+
Title | User Example
|
|
163
|
+
IsPrimaryAdmin | true
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
</TabItem>
|
|
167
|
+
</Tabs>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import Global from '/docs/cmd/_global.mdx';
|
|
2
|
+
import Tabs from '@theme/Tabs';
|
|
3
|
+
import TabItem from '@theme/TabItem';
|
|
4
|
+
|
|
5
|
+
# viva engage community list
|
|
6
|
+
|
|
7
|
+
Lists all Viva Engage communities
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
m365 viva engage community list [options]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Options
|
|
16
|
+
|
|
17
|
+
<Global />
|
|
18
|
+
|
|
19
|
+
## Examples
|
|
20
|
+
|
|
21
|
+
Lists all Viva Engage communities
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
m365 viva engage community list
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Response
|
|
28
|
+
|
|
29
|
+
<Tabs>
|
|
30
|
+
<TabItem value="JSON">
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
[
|
|
34
|
+
{
|
|
35
|
+
"id": "eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiI0NzY5MTM1ODIwOSJ9",
|
|
36
|
+
"displayName": "All Company",
|
|
37
|
+
"description": "This is the default group for everyone in the network",
|
|
38
|
+
"privacy": "public",
|
|
39
|
+
"groupId": "7c99afd7-9f3a-49e2-b105-4ee36314350c"
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
</TabItem>
|
|
45
|
+
<TabItem value="Text">
|
|
46
|
+
|
|
47
|
+
```text
|
|
48
|
+
id displayName privacy
|
|
49
|
+
------------------------------------------------ ----------- -------
|
|
50
|
+
eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiI0NzY5MTM1ODIwOSJ9 All Company public
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
</TabItem>
|
|
54
|
+
<TabItem value="CSV">
|
|
55
|
+
|
|
56
|
+
```csv
|
|
57
|
+
id,displayName,description,privacy,groupId
|
|
58
|
+
eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiI0NzY5MTM1ODIwOSJ9,All Company,This is the default group for everyone in the network,public,7c99afd7-9f3a-49e2-b105-4ee36314350c
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
</TabItem>
|
|
62
|
+
<TabItem value="Markdown">
|
|
63
|
+
|
|
64
|
+
```md
|
|
65
|
+
# viva engage community list
|
|
66
|
+
|
|
67
|
+
Date: 8/29/2024
|
|
68
|
+
|
|
69
|
+
## All Company (eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiI0NzY5MTM1ODIwOSJ9)
|
|
70
|
+
|
|
71
|
+
Property | Value
|
|
72
|
+
---------|-------
|
|
73
|
+
id | eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiI0NzY5MTM1ODIwOSJ9
|
|
74
|
+
displayName | All Company
|
|
75
|
+
description | This is the default group for everyone in the network
|
|
76
|
+
privacy | public
|
|
77
|
+
groupId | 7c99afd7-9f3a-49e2-b105-4ee36314350c
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
</TabItem>
|
|
81
|
+
</Tabs>
|
package/package.json
CHANGED