@pnp/cli-microsoft365 8.1.0-beta.bf59841 → 9.0.0-beta.1cfb646
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/config.js +1 -1
- package/dist/m365/app/commands/permission/permission-add.js +9 -9
- package/dist/m365/commands/status.js +2 -2
- package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-add.js +13 -13
- package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-get.js +18 -18
- package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-list.js +1 -1
- package/dist/m365/entra/commands/group/group-user-list.js +4 -4
- package/dist/m365/entra/commands/m365group/m365group-conversation-post-list.js +4 -4
- package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-list.js +3 -3
- package/dist/m365/entra/commands/m365group/m365group-user-list.js +6 -9
- package/dist/m365/outlook/commands/message/message-get.js +11 -11
- package/dist/m365/spfx/commands/project/DeployWorkflow.js +1 -1
- package/dist/m365/spfx/commands/project/project-github-workflow-add.js +1 -10
- package/dist/m365/spo/commands/file/file-copy.js +55 -34
- package/dist/m365/spo/commands/folder/folder-set.js +0 -4
- package/dist/m365/spo/commands/list/list-list.js +1 -4
- package/dist/m365/spo/commands/site/site-appcatalog-remove.js +48 -24
- package/dist/m365/spo/commands/site/site-remove.js +1 -7
- package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-restore.js +2 -22
- package/dist/m365/spo/commands.js +0 -1
- package/dist/utils/spo.js +74 -0
- package/docs/docs/cmd/app/permission/permission-add.mdx +5 -5
- package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-add.mdx +12 -12
- package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-get.mdx +14 -14
- package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-list.mdx +5 -5
- package/docs/docs/cmd/entra/group/group-user-list.mdx +7 -7
- package/docs/docs/cmd/entra/m365group/m365group-conversation-post-list.mdx +5 -5
- package/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-list.mdx +3 -3
- package/docs/docs/cmd/entra/m365group/m365group-user-list.mdx +1 -1
- package/docs/docs/cmd/outlook/message/message-get.mdx +5 -5
- package/docs/docs/cmd/spfx/project/project-github-workflow-add.mdx +11 -12
- package/docs/docs/cmd/spo/file/file-copy.mdx +119 -12
- package/docs/docs/cmd/spo/folder/folder-set.mdx +0 -6
- package/docs/docs/cmd/spo/list/list-list.mdx +5 -7
- package/docs/docs/cmd/spo/site/site-appcatalog-remove.mdx +11 -2
- package/docs/docs/cmd/spo/site/site-remove.mdx +0 -3
- package/docs/docs/cmd/spo/tenant/tenant-recyclebinitem-restore.mdx +2 -49
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
|
@@ -16,7 +16,7 @@ class SpoListListCommand extends SpoCommand {
|
|
|
16
16
|
return 'Lists all available list in the specified site';
|
|
17
17
|
}
|
|
18
18
|
defaultProperties() {
|
|
19
|
-
return ['Title', '
|
|
19
|
+
return ['Title', 'Id'];
|
|
20
20
|
}
|
|
21
21
|
constructor() {
|
|
22
22
|
super();
|
|
@@ -36,9 +36,6 @@ class SpoListListCommand extends SpoCommand {
|
|
|
36
36
|
queryParams.push(`$filter=${args.options.filter}`);
|
|
37
37
|
}
|
|
38
38
|
const listInstances = await odata.getAllItems(`${args.options.webUrl}/_api/web/lists?${queryParams.join('&')}`);
|
|
39
|
-
listInstances.forEach(l => {
|
|
40
|
-
l.Url = l.RootFolder.ServerRelativeUrl;
|
|
41
|
-
});
|
|
42
39
|
await logger.log(listInstances);
|
|
43
40
|
}
|
|
44
41
|
catch (err) {
|
|
@@ -3,7 +3,8 @@ 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 _SpoSiteAppCatalogRemoveCommand_instances, _SpoSiteAppCatalogRemoveCommand_initOptions, _SpoSiteAppCatalogRemoveCommand_initValidators;
|
|
6
|
+
var _SpoSiteAppCatalogRemoveCommand_instances, _SpoSiteAppCatalogRemoveCommand_initTelemetry, _SpoSiteAppCatalogRemoveCommand_initOptions, _SpoSiteAppCatalogRemoveCommand_initValidators, _SpoSiteAppCatalogRemoveCommand_initTypes;
|
|
7
|
+
import { cli } from '../../../../cli/cli.js';
|
|
7
8
|
import config from '../../../../config.js';
|
|
8
9
|
import request from '../../../../request.js';
|
|
9
10
|
import { formatting } from '../../../../utils/formatting.js';
|
|
@@ -21,47 +22,70 @@ class SpoSiteAppCatalogRemoveCommand extends SpoCommand {
|
|
|
21
22
|
constructor() {
|
|
22
23
|
super();
|
|
23
24
|
_SpoSiteAppCatalogRemoveCommand_instances.add(this);
|
|
25
|
+
__classPrivateFieldGet(this, _SpoSiteAppCatalogRemoveCommand_instances, "m", _SpoSiteAppCatalogRemoveCommand_initTelemetry).call(this);
|
|
24
26
|
__classPrivateFieldGet(this, _SpoSiteAppCatalogRemoveCommand_instances, "m", _SpoSiteAppCatalogRemoveCommand_initOptions).call(this);
|
|
25
27
|
__classPrivateFieldGet(this, _SpoSiteAppCatalogRemoveCommand_instances, "m", _SpoSiteAppCatalogRemoveCommand_initValidators).call(this);
|
|
28
|
+
__classPrivateFieldGet(this, _SpoSiteAppCatalogRemoveCommand_instances, "m", _SpoSiteAppCatalogRemoveCommand_initTypes).call(this);
|
|
26
29
|
}
|
|
27
30
|
async commandAction(logger, args) {
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
const spoAdminUrl = await spo.getSpoAdminUrl(logger, this.debug);
|
|
31
|
-
const requestDigest = await spo.getRequestDigest(spoAdminUrl);
|
|
31
|
+
const removeSiteAppcatalog = async () => {
|
|
32
|
+
const url = args.options.siteUrl;
|
|
32
33
|
if (this.verbose) {
|
|
33
34
|
await logger.logToStderr(`Disabling site collection app catalog...`);
|
|
34
35
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
36
|
+
try {
|
|
37
|
+
const spoAdminUrl = await spo.getSpoAdminUrl(logger, this.debug);
|
|
38
|
+
const requestDigest = await spo.getRequestDigest(spoAdminUrl);
|
|
39
|
+
const requestOptions = {
|
|
40
|
+
url: `${spoAdminUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
41
|
+
headers: {
|
|
42
|
+
'X-RequestDigest': requestDigest.FormDigestValue
|
|
43
|
+
},
|
|
44
|
+
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="50" ObjectPathId="49" /><ObjectPath Id="52" ObjectPathId="51" /><ObjectPath Id="54" ObjectPathId="53" /><ObjectPath Id="56" ObjectPathId="55" /><ObjectPath Id="58" ObjectPathId="57" /><Method Name="Remove" Id="59" ObjectPathId="57"><Parameters><Parameter Type="String">${formatting.escapeXml(url)}</Parameter></Parameters></Method></Actions><ObjectPaths><Constructor Id="49" TypeId="{268004ae-ef6b-4e9b-8425-127220d84719}" /><Method Id="51" ParentId="49" Name="GetSiteByUrl"><Parameters><Parameter Type="String">${formatting.escapeXml(url)}</Parameter></Parameters></Method><Property Id="53" ParentId="51" Name="RootWeb" /><Property Id="55" ParentId="53" Name="TenantAppCatalog" /><Property Id="57" ParentId="55" Name="SiteCollectionAppCatalogsSites" /></ObjectPaths></Request>`
|
|
45
|
+
};
|
|
46
|
+
const res = await request.post(requestOptions);
|
|
47
|
+
const json = JSON.parse(res);
|
|
48
|
+
const response = json[0];
|
|
49
|
+
if (response.ErrorInfo) {
|
|
50
|
+
throw response.ErrorInfo.ErrorMessage;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
if (this.verbose) {
|
|
54
|
+
await logger.logToStderr('Site collection app catalog disabled');
|
|
55
|
+
}
|
|
51
56
|
}
|
|
52
57
|
}
|
|
58
|
+
catch (err) {
|
|
59
|
+
this.handleRejectedPromise(err);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
if (args.options.force) {
|
|
63
|
+
await removeSiteAppcatalog();
|
|
53
64
|
}
|
|
54
|
-
|
|
55
|
-
|
|
65
|
+
else {
|
|
66
|
+
const result = await cli.promptForConfirmation({ message: `Are you sure you want to remove the app catalog from ${args.options.siteUrl}?` });
|
|
67
|
+
if (result) {
|
|
68
|
+
await removeSiteAppcatalog();
|
|
69
|
+
}
|
|
56
70
|
}
|
|
57
71
|
}
|
|
58
72
|
}
|
|
59
|
-
_SpoSiteAppCatalogRemoveCommand_instances = new WeakSet(),
|
|
73
|
+
_SpoSiteAppCatalogRemoveCommand_instances = new WeakSet(), _SpoSiteAppCatalogRemoveCommand_initTelemetry = function _SpoSiteAppCatalogRemoveCommand_initTelemetry() {
|
|
74
|
+
this.telemetry.push((args) => {
|
|
75
|
+
Object.assign(this.telemetryProperties, {
|
|
76
|
+
force: !!args.options.force
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
}, _SpoSiteAppCatalogRemoveCommand_initOptions = function _SpoSiteAppCatalogRemoveCommand_initOptions() {
|
|
60
80
|
this.options.unshift({
|
|
61
81
|
option: '-u, --siteUrl <siteUrl>'
|
|
82
|
+
}, {
|
|
83
|
+
option: '-f, --force'
|
|
62
84
|
});
|
|
63
85
|
}, _SpoSiteAppCatalogRemoveCommand_initValidators = function _SpoSiteAppCatalogRemoveCommand_initValidators() {
|
|
64
86
|
this.validators.push(async (args) => validation.isValidSharePointUrl(args.options.siteUrl));
|
|
87
|
+
}, _SpoSiteAppCatalogRemoveCommand_initTypes = function _SpoSiteAppCatalogRemoveCommand_initTypes() {
|
|
88
|
+
this.types.string.push('siteUrl');
|
|
65
89
|
};
|
|
66
90
|
export default new SpoSiteAppCatalogRemoveCommand();
|
|
67
91
|
//# sourceMappingURL=site-appcatalog-remove.js.map
|
|
@@ -31,9 +31,6 @@ class SpoSiteRemoveCommand extends SpoCommand {
|
|
|
31
31
|
__classPrivateFieldGet(this, _SpoSiteRemoveCommand_instances, "m", _SpoSiteRemoveCommand_initTypes).call(this);
|
|
32
32
|
}
|
|
33
33
|
async commandAction(logger, args) {
|
|
34
|
-
if (args.options.wait) {
|
|
35
|
-
await this.warn(logger, `Option 'wait' is deprecated and will be removed in the next major release.`);
|
|
36
|
-
}
|
|
37
34
|
if (args.options.force) {
|
|
38
35
|
await this.removeSite(logger, args.options);
|
|
39
36
|
}
|
|
@@ -196,7 +193,6 @@ _SpoSiteRemoveCommand_instances = new WeakSet(), _SpoSiteRemoveCommand_initTelem
|
|
|
196
193
|
Object.assign(this.telemetryProperties, {
|
|
197
194
|
skipRecycleBin: !!args.options.skipRecycleBin,
|
|
198
195
|
fromRecycleBin: !!args.options.fromRecycleBin,
|
|
199
|
-
wait: !!args.options.wait,
|
|
200
196
|
force: !!args.options.force
|
|
201
197
|
});
|
|
202
198
|
});
|
|
@@ -207,8 +203,6 @@ _SpoSiteRemoveCommand_instances = new WeakSet(), _SpoSiteRemoveCommand_initTelem
|
|
|
207
203
|
option: '--skipRecycleBin'
|
|
208
204
|
}, {
|
|
209
205
|
option: '--fromRecycleBin'
|
|
210
|
-
}, {
|
|
211
|
-
option: '--wait'
|
|
212
206
|
}, {
|
|
213
207
|
option: '-f, --force'
|
|
214
208
|
});
|
|
@@ -230,7 +224,7 @@ _SpoSiteRemoveCommand_instances = new WeakSet(), _SpoSiteRemoveCommand_initTelem
|
|
|
230
224
|
});
|
|
231
225
|
}, _SpoSiteRemoveCommand_initTypes = function _SpoSiteRemoveCommand_initTypes() {
|
|
232
226
|
this.types.string.push('url');
|
|
233
|
-
this.types.boolean.push('skipRecycleBin', 'fromRecycleBin', '
|
|
227
|
+
this.types.boolean.push('skipRecycleBin', 'fromRecycleBin', 'force');
|
|
234
228
|
};
|
|
235
229
|
export default new SpoSiteRemoveCommand();
|
|
236
230
|
//# sourceMappingURL=site-remove.js.map
|
|
@@ -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 _SpoTenantRecycleBinItemRestoreCommand_instances,
|
|
6
|
+
var _SpoTenantRecycleBinItemRestoreCommand_instances, _SpoTenantRecycleBinItemRestoreCommand_initOptions, _SpoTenantRecycleBinItemRestoreCommand_initValidators, _SpoTenantRecycleBinItemRestoreCommand_initTypes;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
9
|
import { odata } from '../../../../utils/odata.js';
|
|
@@ -22,15 +22,11 @@ class SpoTenantRecycleBinItemRestoreCommand extends SpoCommand {
|
|
|
22
22
|
constructor() {
|
|
23
23
|
super();
|
|
24
24
|
_SpoTenantRecycleBinItemRestoreCommand_instances.add(this);
|
|
25
|
-
__classPrivateFieldGet(this, _SpoTenantRecycleBinItemRestoreCommand_instances, "m", _SpoTenantRecycleBinItemRestoreCommand_initTelemetry).call(this);
|
|
26
25
|
__classPrivateFieldGet(this, _SpoTenantRecycleBinItemRestoreCommand_instances, "m", _SpoTenantRecycleBinItemRestoreCommand_initOptions).call(this);
|
|
27
26
|
__classPrivateFieldGet(this, _SpoTenantRecycleBinItemRestoreCommand_instances, "m", _SpoTenantRecycleBinItemRestoreCommand_initValidators).call(this);
|
|
28
27
|
__classPrivateFieldGet(this, _SpoTenantRecycleBinItemRestoreCommand_instances, "m", _SpoTenantRecycleBinItemRestoreCommand_initTypes).call(this);
|
|
29
28
|
}
|
|
30
29
|
async commandAction(logger, args) {
|
|
31
|
-
if (args.options.wait) {
|
|
32
|
-
await this.warn(logger, `Option 'wait' is deprecated and will be removed in the next major release.`);
|
|
33
|
-
}
|
|
34
30
|
try {
|
|
35
31
|
if (this.verbose) {
|
|
36
32
|
await logger.logToStderr(`Restoring site collection '${args.options.siteUrl}' from recycle bin.`);
|
|
@@ -62,13 +58,6 @@ class SpoTenantRecycleBinItemRestoreCommand extends SpoCommand {
|
|
|
62
58
|
};
|
|
63
59
|
await request.post(restoreOptions);
|
|
64
60
|
}
|
|
65
|
-
// Here, we return a fixed response because this new API endpoint doesn't return a response while the previous API did.
|
|
66
|
-
// This has to be removed in the next major release.
|
|
67
|
-
await logger.log({
|
|
68
|
-
HasTimedout: false,
|
|
69
|
-
IsComplete: !!args.options.wait,
|
|
70
|
-
PollingInterval: 15000
|
|
71
|
-
});
|
|
72
61
|
}
|
|
73
62
|
catch (err) {
|
|
74
63
|
this.handleRejectedODataJsonPromise(err);
|
|
@@ -79,23 +68,14 @@ class SpoTenantRecycleBinItemRestoreCommand extends SpoCommand {
|
|
|
79
68
|
return sites[0].GroupId;
|
|
80
69
|
}
|
|
81
70
|
}
|
|
82
|
-
_SpoTenantRecycleBinItemRestoreCommand_instances = new WeakSet(),
|
|
83
|
-
this.telemetry.push((args) => {
|
|
84
|
-
Object.assign(this.telemetryProperties, {
|
|
85
|
-
wait: !!args.options.wait
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
}, _SpoTenantRecycleBinItemRestoreCommand_initOptions = function _SpoTenantRecycleBinItemRestoreCommand_initOptions() {
|
|
71
|
+
_SpoTenantRecycleBinItemRestoreCommand_instances = new WeakSet(), _SpoTenantRecycleBinItemRestoreCommand_initOptions = function _SpoTenantRecycleBinItemRestoreCommand_initOptions() {
|
|
89
72
|
this.options.unshift({
|
|
90
73
|
option: '-u, --siteUrl <siteUrl>'
|
|
91
|
-
}, {
|
|
92
|
-
option: '--wait'
|
|
93
74
|
});
|
|
94
75
|
}, _SpoTenantRecycleBinItemRestoreCommand_initValidators = function _SpoTenantRecycleBinItemRestoreCommand_initValidators() {
|
|
95
76
|
this.validators.push(async (args) => validation.isValidSharePointUrl(args.options.siteUrl));
|
|
96
77
|
}, _SpoTenantRecycleBinItemRestoreCommand_initTypes = function _SpoTenantRecycleBinItemRestoreCommand_initTypes() {
|
|
97
78
|
this.types.string.push('siteUrl');
|
|
98
|
-
this.types.boolean.push('wait');
|
|
99
79
|
};
|
|
100
80
|
export default new SpoTenantRecycleBinItemRestoreCommand();
|
|
101
81
|
//# sourceMappingURL=tenant-recyclebinitem-restore.js.map
|
|
@@ -92,7 +92,6 @@ export default {
|
|
|
92
92
|
FOLDER_LIST: `${prefix} folder list`,
|
|
93
93
|
FOLDER_MOVE: `${prefix} folder move`,
|
|
94
94
|
FOLDER_REMOVE: `${prefix} folder remove`,
|
|
95
|
-
FOLDER_RENAME: `${prefix} folder rename`,
|
|
96
95
|
FOLDER_SET: `${prefix} folder set`,
|
|
97
96
|
FOLDER_RETENTIONLABEL_ENSURE: `${prefix} folder retentionlabel ensure`,
|
|
98
97
|
FOLDER_RETENTIONLABEL_REMOVE: `${prefix} folder retentionlabel remove`,
|
package/dist/utils/spo.js
CHANGED
|
@@ -12,6 +12,16 @@ import { RoleType } from '../m365/spo/commands/roledefinition/RoleType.js';
|
|
|
12
12
|
import { entraGroup } from './entraGroup.js';
|
|
13
13
|
import { SharingCapabilities } from '../m365/spo/commands/site/SharingCapabilities.js';
|
|
14
14
|
import { setTimeout } from 'timers/promises';
|
|
15
|
+
export var CreateCopyJobsNameConflictBehavior;
|
|
16
|
+
(function (CreateCopyJobsNameConflictBehavior) {
|
|
17
|
+
CreateCopyJobsNameConflictBehavior[CreateCopyJobsNameConflictBehavior["Fail"] = 0] = "Fail";
|
|
18
|
+
CreateCopyJobsNameConflictBehavior[CreateCopyJobsNameConflictBehavior["Replace"] = 1] = "Replace";
|
|
19
|
+
CreateCopyJobsNameConflictBehavior[CreateCopyJobsNameConflictBehavior["Rename"] = 2] = "Rename";
|
|
20
|
+
})(CreateCopyJobsNameConflictBehavior || (CreateCopyJobsNameConflictBehavior = {}));
|
|
21
|
+
// Wrapping this into a settings object so we can alter the values in tests
|
|
22
|
+
export const settings = {
|
|
23
|
+
pollingInterval: 3000
|
|
24
|
+
};
|
|
15
25
|
export const spo = {
|
|
16
26
|
async getRequestDigest(siteUrl) {
|
|
17
27
|
const requestOptions = {
|
|
@@ -1484,6 +1494,70 @@ export const spo = {
|
|
|
1484
1494
|
};
|
|
1485
1495
|
const itemsResponse = await request.get(requestOptionsItems);
|
|
1486
1496
|
return (itemsResponse);
|
|
1497
|
+
},
|
|
1498
|
+
/**
|
|
1499
|
+
* Create a SharePoint copy job to copy a file/folder to another location.
|
|
1500
|
+
* @param webUrl Absolute web URL where the source file/folder is located.
|
|
1501
|
+
* @param sourceUrl Absolute URL of the source file/folder.
|
|
1502
|
+
* @param destinationUrl Absolute URL of the destination folder.
|
|
1503
|
+
* @param options Options for the copy job.
|
|
1504
|
+
* @returns Copy job information. Use {@link spo.getCopyJobResult} to get the result of the copy job.
|
|
1505
|
+
*/
|
|
1506
|
+
async createCopyJob(webUrl, sourceUrl, destinationUrl, options) {
|
|
1507
|
+
const requestOptions = {
|
|
1508
|
+
url: `${webUrl}/_api/Site/CreateCopyJobs`,
|
|
1509
|
+
headers: {
|
|
1510
|
+
accept: 'application/json;odata=nometadata'
|
|
1511
|
+
},
|
|
1512
|
+
responseType: 'json',
|
|
1513
|
+
data: {
|
|
1514
|
+
destinationUri: destinationUrl,
|
|
1515
|
+
exportObjectUris: [sourceUrl],
|
|
1516
|
+
options: {
|
|
1517
|
+
NameConflictBehavior: options?.nameConflictBehavior ?? CreateCopyJobsNameConflictBehavior.Fail,
|
|
1518
|
+
AllowSchemaMismatch: true,
|
|
1519
|
+
BypassSharedLock: !!options?.bypassSharedLock,
|
|
1520
|
+
IgnoreVersionHistory: !!options?.ignoreVersionHistory,
|
|
1521
|
+
CustomizedItemName: options?.newName ? [options.newName] : undefined,
|
|
1522
|
+
SameWebCopyMoveOptimization: true
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
};
|
|
1526
|
+
const response = await request.post(requestOptions);
|
|
1527
|
+
return response.value[0];
|
|
1528
|
+
},
|
|
1529
|
+
/**
|
|
1530
|
+
* Poll until the copy job is finished and return the result.
|
|
1531
|
+
* @param webUrl Absolute web URL where the copy job was created.
|
|
1532
|
+
* @param copyJobInfo Information about the copy job.
|
|
1533
|
+
* @throws Error if the copy job has failed.
|
|
1534
|
+
* @returns Information about the destination object.
|
|
1535
|
+
*/
|
|
1536
|
+
async getCopyJobResult(webUrl, copyJobInfo) {
|
|
1537
|
+
const requestOptions = {
|
|
1538
|
+
url: `${webUrl}/_api/Site/GetCopyJobProgress`,
|
|
1539
|
+
headers: {
|
|
1540
|
+
accept: 'application/json;odata=nometadata'
|
|
1541
|
+
},
|
|
1542
|
+
responseType: 'json',
|
|
1543
|
+
data: {
|
|
1544
|
+
copyJobInfo: copyJobInfo
|
|
1545
|
+
}
|
|
1546
|
+
};
|
|
1547
|
+
let progress = await request.post(requestOptions);
|
|
1548
|
+
while (progress.JobState !== 0) {
|
|
1549
|
+
await setTimeout(settings.pollingInterval);
|
|
1550
|
+
progress = await request.post(requestOptions);
|
|
1551
|
+
}
|
|
1552
|
+
const logs = progress.Logs.map(l => JSON.parse(l));
|
|
1553
|
+
// Check if the job has failed
|
|
1554
|
+
const errorLog = logs.find(l => l.Event === 'JobError');
|
|
1555
|
+
if (errorLog) {
|
|
1556
|
+
throw new Error(errorLog.Message);
|
|
1557
|
+
}
|
|
1558
|
+
// Get the destination object information
|
|
1559
|
+
const objectInfo = logs.find(l => l.Event === 'JobFinishedObjectInfo');
|
|
1560
|
+
return objectInfo;
|
|
1487
1561
|
}
|
|
1488
1562
|
};
|
|
1489
1563
|
//# sourceMappingURL=spo.js.map
|
|
@@ -16,10 +16,10 @@ m365 app permission add [options]
|
|
|
16
16
|
`--appId [appId]`
|
|
17
17
|
: Client ID of the Microsoft Entra app registered in the .m365rc.json file to retrieve API permissions for.
|
|
18
18
|
|
|
19
|
-
`--
|
|
19
|
+
`--applicationPermissions [applicationPermissions]`
|
|
20
20
|
: Space-separated list of application permissions to add.
|
|
21
21
|
|
|
22
|
-
`--
|
|
22
|
+
`--delegatedPermissions [delegatedPermissions]`
|
|
23
23
|
: Space-separated list of delegated permissions to add.
|
|
24
24
|
|
|
25
25
|
`--grantAdminConsent`
|
|
@@ -37,19 +37,19 @@ If you have multiple apps registered in your .m365rc.json file, you can specify
|
|
|
37
37
|
Adds the specified application permissions to the default app registered in the _.m365rc.json_ file while granting admin consent.
|
|
38
38
|
|
|
39
39
|
```sh
|
|
40
|
-
m365 app permission add --
|
|
40
|
+
m365 app permission add --applicationPermissions 'https://graph.microsoft.com/User.ReadWrite.All https://graph.microsoft.com/User.Read.All' --grantAdminConsent
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
Adds the specified delegated permissions to the default app registered in the _.m365rc.json_ file without granting admin consent.
|
|
44
44
|
|
|
45
45
|
```sh
|
|
46
|
-
m365 app permission add --
|
|
46
|
+
m365 app permission add --delegatedPermissions 'https://graph.microsoft.com/offline_access'
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
Adds the specified application and delegated permissions to a specific app registered in the _.m365rc.json_ file while granting admin consent.
|
|
50
50
|
|
|
51
51
|
```sh
|
|
52
|
-
m365 app permission add --appId '1663767b-4172-4519-bfd1-28e6ff19055b' --
|
|
52
|
+
m365 app permission add --appId '1663767b-4172-4519-bfd1-28e6ff19055b' --applicationPermissions 'https://graph.microsoft.com/User.ReadWrite.All https://graph.microsoft.com/User.Read.All' --delegatedPermissions 'https://graph.microsoft.com/offline_access' --grantAdminConsent
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
## Response
|
|
@@ -22,39 +22,39 @@ m365 entra sp add [options]
|
|
|
22
22
|
## Options
|
|
23
23
|
|
|
24
24
|
```md definition-list
|
|
25
|
-
|
|
26
|
-
: ID of the app for which the enterprise application should be created
|
|
25
|
+
`-i, --id [id]`
|
|
26
|
+
: ID of the app for which the enterprise application should be created.
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
: Display name of the app for which the enterprise application should be created
|
|
28
|
+
`-n, --displayName [displayName]`
|
|
29
|
+
: Display name of the app for which the enterprise application should be created.
|
|
30
30
|
|
|
31
31
|
`--objectId [objectId]`
|
|
32
|
-
: ObjectId of the app for which the enterprise application should be created
|
|
32
|
+
: ObjectId of the app for which the enterprise application should be created.
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
<Global />
|
|
36
36
|
|
|
37
37
|
## Remarks
|
|
38
38
|
|
|
39
|
-
Specify either the `
|
|
39
|
+
Specify either the `id`, `displayName` or `objectId`. If you specify more than one option value, the command will fail with an error.
|
|
40
40
|
|
|
41
41
|
If you register an application in the portal, an application object as well as an enterprise application object are automatically created in your home tenant. If you register an application using CLI for Microsoft 365 or the Microsoft Graph, you'll need to create the enterprise application separately. To register/create an application using the CLI for Microsoft 365, use the [m365 entra app add](../app/app-add.mdx) command.
|
|
42
42
|
|
|
43
43
|
## Examples
|
|
44
44
|
|
|
45
|
-
Creates an enterprise application for a registered Entra app with
|
|
45
|
+
Creates an enterprise application for a registered Entra app with the specified id.
|
|
46
46
|
|
|
47
47
|
```sh
|
|
48
|
-
m365 entra enterpriseapp add --
|
|
48
|
+
m365 entra enterpriseapp add --id b2307a39-e878-458b-bc90-03bc578531d6
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
Creates an enterprise application for a registered Entra app with
|
|
51
|
+
Creates an enterprise application for a registered Entra app with the specified displayName.
|
|
52
52
|
|
|
53
53
|
```sh
|
|
54
|
-
m365 entra enterpriseapp add --
|
|
54
|
+
m365 entra enterpriseapp add --displayName "Microsoft Graph"
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
Creates an enterprise application for a registered Entra app with objectId
|
|
57
|
+
Creates an enterprise application for a registered Entra app with the specified objectId.
|
|
58
58
|
|
|
59
59
|
```sh
|
|
60
60
|
m365 entra enterpriseapp add --objectId b2307a39-e878-458b-bc90-03bc578531d6
|
|
@@ -172,7 +172,7 @@ m365 entra enterpriseapp add --objectId b2307a39-e878-458b-bc90-03bc578531d6
|
|
|
172
172
|
<TabItem value="Markdown">
|
|
173
173
|
|
|
174
174
|
```md
|
|
175
|
-
# entra enterpriseapp add --
|
|
175
|
+
# entra enterpriseapp add --id "8da75b6a-4272-4b17-8ee1-20ba66e2b06f"
|
|
176
176
|
|
|
177
177
|
Date: 2023-06-02
|
|
178
178
|
|
|
@@ -22,40 +22,40 @@ m365 entra sp get [options]
|
|
|
22
22
|
## Options
|
|
23
23
|
|
|
24
24
|
```md definition-list
|
|
25
|
-
`-i, --
|
|
26
|
-
: ID of the application for which the enterprise application should be retrieved
|
|
25
|
+
`-i, --id [id]`
|
|
26
|
+
: ID of the application for which the enterprise application should be retrieved.
|
|
27
27
|
|
|
28
|
-
`-n, --
|
|
29
|
-
: Display name of the application for which the enterprise application should be retrieved
|
|
28
|
+
`-n, --displayName [displayName]`
|
|
29
|
+
: Display name of the application for which the enterprise application should be retrieved.
|
|
30
30
|
|
|
31
|
-
`--
|
|
32
|
-
: ObjectId of the application for which the enterprise application should be retrieved
|
|
31
|
+
`--objectId [objectId]`
|
|
32
|
+
: ObjectId of the application for which the enterprise application should be retrieved.
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
<Global />
|
|
36
36
|
|
|
37
37
|
## Remarks
|
|
38
38
|
|
|
39
|
-
Specify either the `
|
|
39
|
+
Specify either the `id`, `objectId` or `displayName`. If you specify more than one option value, the command will fail with an error.
|
|
40
40
|
|
|
41
41
|
## Examples
|
|
42
42
|
|
|
43
|
-
Return details about the enterprise application with
|
|
43
|
+
Return details about the enterprise application with the specified id.
|
|
44
44
|
|
|
45
45
|
```sh
|
|
46
|
-
m365 entra enterpriseapp get --
|
|
46
|
+
m365 entra enterpriseapp get --id b2307a39-e878-458b-bc90-03bc578531d6
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
Return details about the
|
|
49
|
+
Return details about the enterprise application with the specified displayName.
|
|
50
50
|
|
|
51
51
|
```sh
|
|
52
|
-
m365 entra enterpriseapp get --
|
|
52
|
+
m365 entra enterpriseapp get --displayName "Microsoft Graph"
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
Return details about the enterprise application with ObjectId
|
|
55
|
+
Return details about the enterprise application with the specified ObjectId.
|
|
56
56
|
|
|
57
57
|
```sh
|
|
58
|
-
m365 entra enterpriseapp get --
|
|
58
|
+
m365 entra enterpriseapp get --objectId b2307a39-e878-458b-bc90-03bc578531dd
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
## Response
|
|
@@ -198,7 +198,7 @@ m365 entra enterpriseapp get --appObjectId b2307a39-e878-458b-bc90-03bc578531dd
|
|
|
198
198
|
<TabItem value="Markdown">
|
|
199
199
|
|
|
200
200
|
```md
|
|
201
|
-
# entra enterpriseapp get --
|
|
201
|
+
# entra enterpriseapp get --id "ac7c9b4b-83b0-4a5e-ace2-a3530162c8f8"
|
|
202
202
|
|
|
203
203
|
Date: 2023-06-02
|
|
204
204
|
|
|
@@ -22,24 +22,24 @@ m365 entra sp list [options]
|
|
|
22
22
|
## Options
|
|
23
23
|
|
|
24
24
|
```md definition-list
|
|
25
|
-
|
|
26
|
-
: Returns only enterprise applications with the specified name
|
|
25
|
+
`-n, --displayName [displayName]`
|
|
26
|
+
: Returns only enterprise applications with the specified name.
|
|
27
27
|
|
|
28
28
|
`--tag [tag]`
|
|
29
|
-
: Returns only enterprise applications with the specified tag
|
|
29
|
+
: Returns only enterprise applications with the specified tag.
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
<Global />
|
|
33
33
|
|
|
34
34
|
## Examples
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
Returns a list of all enterprise applications.
|
|
37
37
|
|
|
38
38
|
```sh
|
|
39
39
|
m365 entra enterpriseapp list
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
Returns a list of all enterprise applications that comply with the specified display name and the tag parameters.
|
|
43
43
|
|
|
44
44
|
```sh
|
|
45
45
|
m365 entra enterpriseapp list --displayName "My custom enterprise application" --tag "WindowsAzureActiveDirectoryIntegratedApp"
|
|
@@ -22,10 +22,10 @@ m365 aad group user list [options]
|
|
|
22
22
|
|
|
23
23
|
```md definition-list
|
|
24
24
|
`-i, --groupId [groupId]`
|
|
25
|
-
: The ID of the Entra group. Specify `groupId` or `
|
|
25
|
+
: The ID of the Entra group. Specify `groupId` or `groupName` but not both.
|
|
26
26
|
|
|
27
|
-
`-n, --
|
|
28
|
-
: The display name of the Entra group. Specify `groupId` or `
|
|
27
|
+
`-n, --groupName [groupName]`
|
|
28
|
+
: The display name of the Entra group. Specify `groupId` or `groupName` but not both.
|
|
29
29
|
|
|
30
30
|
`-r, --role [role]`
|
|
31
31
|
: Filter the results to only users with the given role: `Owner`, `Member`.
|
|
@@ -54,25 +54,25 @@ m365 entra group user list --groupId 03cba9da-3974-46c1-afaf-79caa2e45bbe
|
|
|
54
54
|
List all owners from a group specified by display name.
|
|
55
55
|
|
|
56
56
|
```sh
|
|
57
|
-
m365 entra group user list --
|
|
57
|
+
m365 entra group user list --groupName Developers --role Owner
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
List all group users from a group specified by name. For each one return the display name, e-mail address, and manager display name.
|
|
61
61
|
|
|
62
62
|
```sh
|
|
63
|
-
m365 entra group user list --
|
|
63
|
+
m365 entra group user list --groupName Developers --properties "displayName,mail,manager/displayName"
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
List all group users from a group specified by name. For each one return the display name, e-mail address, and manager information.
|
|
67
67
|
|
|
68
68
|
```sh
|
|
69
|
-
m365 entra group user list --
|
|
69
|
+
m365 entra group user list --groupName Developers --properties "displayName,mail,manager/*"
|
|
70
70
|
```
|
|
71
71
|
|
|
72
72
|
List all group members that are guest users.
|
|
73
73
|
|
|
74
74
|
```sh
|
|
75
|
-
m365 entra group user list --
|
|
75
|
+
m365 entra group user list --groupName Developers --filter "userType eq 'Guest'"
|
|
76
76
|
```
|
|
77
77
|
|
|
78
78
|
## Response
|
|
@@ -22,10 +22,10 @@ m365 aad m365group conversation post list [options]
|
|
|
22
22
|
|
|
23
23
|
```md definition-list
|
|
24
24
|
`-i, --groupId [groupId]`
|
|
25
|
-
: The Id of the Microsoft 365 Group. You can specify the groupId or
|
|
25
|
+
: The Id of the Microsoft 365 Group. You can specify the groupId or groupName, but not both.
|
|
26
26
|
|
|
27
|
-
`-d, --
|
|
28
|
-
: The Displayname of the Microsoft 365 Group. You can specify the groupId or
|
|
27
|
+
`-d, --groupName [groupName]`
|
|
28
|
+
: The Displayname of the Microsoft 365 Group. You can specify the groupId or groupName, but not both.
|
|
29
29
|
|
|
30
30
|
`-t, --threadId <threadId>`
|
|
31
31
|
: The ID of the thread to retrieve details for
|
|
@@ -41,10 +41,10 @@ Lists the posts of the specific conversation of Microsoft 365 group by groupId
|
|
|
41
41
|
m365 entra m365group conversation post list --groupId '00000000-0000-0000-0000-000000000000' --threadId 'AAQkADkwN2Q2NDg1LWQ3ZGYtNDViZi1iNGRiLTVhYjJmN2Q5NDkxZQAQAOnRAfDf71lIvrdK85FAn5E='
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
Lists the posts of the specific conversation of Microsoft 365 group by
|
|
44
|
+
Lists the posts of the specific conversation of Microsoft 365 group by groupName
|
|
45
45
|
|
|
46
46
|
```sh
|
|
47
|
-
m365 entra m365group conversation post list --
|
|
47
|
+
m365 entra m365group conversation post list --groupName 'MyGroup' --threadId 'AAQkADkwN2Q2NDg1LWQ3ZGYtNDViZi1iNGRiLTVhYjJmN2Q5NDkxZQAQAOnRAfDf71lIvrdK85FAn5E='
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
## Response
|
|
@@ -21,7 +21,7 @@ m365 aad m365group recyclebinitem list [options]
|
|
|
21
21
|
## Options
|
|
22
22
|
|
|
23
23
|
```md definition-list
|
|
24
|
-
`-d, --
|
|
24
|
+
`-d, --groupName [groupName]`
|
|
25
25
|
: Lists groups with DisplayName starting with the specified value
|
|
26
26
|
|
|
27
27
|
`-m, --groupMailNickname [groupMailNickname]`
|
|
@@ -41,7 +41,7 @@ m365 entra m365group recyclebinitem list
|
|
|
41
41
|
List deleted Microsoft 365 Groups with display name starting with _Project_
|
|
42
42
|
|
|
43
43
|
```sh
|
|
44
|
-
m365 entra m365group recyclebinitem list --
|
|
44
|
+
m365 entra m365group recyclebinitem list --groupName Project
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
List deleted Microsoft 365 Groups mail nick name starting with _team_
|
|
@@ -53,7 +53,7 @@ m365 entra m365group recyclebinitem list --groupMailNickname team
|
|
|
53
53
|
List deleted Microsoft 365 Groups mail nick name starting with _team_ and with display name starting with _Project_
|
|
54
54
|
|
|
55
55
|
```sh
|
|
56
|
-
m365 entra m365group recyclebinitem list --groupMailNickname team --
|
|
56
|
+
m365 entra m365group recyclebinitem list --groupMailNickname team --groupName Project
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
## Response
|
|
@@ -28,7 +28,7 @@ m365 aad m365group user list [options]
|
|
|
28
28
|
: The display name of the Microsoft 365 group. Specify `groupId` or `groupDisplayName` but not both.
|
|
29
29
|
|
|
30
30
|
`-r, --role [role]`
|
|
31
|
-
: Filter the results to only users with the given role. Allowed values: `Owner`, `Member
|
|
31
|
+
: Filter the results to only users with the given role. Allowed values: `Owner`, `Member`.
|
|
32
32
|
|
|
33
33
|
`-p, --properties [properties]`
|
|
34
34
|
: Comma-separated list of properties to retrieve.
|