@pnp/cli-microsoft365 9.0.0-beta.f2c5f82 → 9.1.0-beta.2d61838
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 +17 -16
- package/dist/AuthServer.js +7 -7
- package/dist/Command.js +5 -4
- package/dist/api.js +1 -1
- package/dist/cli/cli.js +57 -8
- package/dist/config.js +61 -5
- package/dist/m365/app/commands/permission/permission-add.js +9 -9
- package/dist/m365/base/PowerAutomateCommand.js +1 -1
- package/dist/m365/base/SpoCommand.js +1 -1
- package/dist/m365/cli/commands/cli-consent.js +9 -5
- package/dist/m365/cli/commands/cli-doctor.js +2 -2
- package/dist/m365/cli/commands/cli-reconsent.js +2 -3
- package/dist/m365/cli/commands/config/config-set.js +12 -3
- package/dist/m365/commands/login.js +38 -14
- package/dist/m365/commands/setup.js +256 -33
- package/dist/m365/commands/status.js +2 -2
- package/dist/m365/connection/commands/connection-list.js +4 -4
- package/dist/m365/entra/commands/app/app-add.js +52 -288
- 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 +9 -6
- package/dist/m365/external/commands/item/item-add.js +2 -5
- package/dist/m365/file/commands/file-move.js +135 -0
- package/dist/m365/file/commands.js +2 -1
- package/dist/m365/flow/commands/environment/environment-get.js +1 -1
- package/dist/m365/flow/commands/environment/environment-list.js +1 -1
- package/dist/m365/flow/commands/flow-disable.js +1 -1
- package/dist/m365/flow/commands/flow-enable.js +1 -1
- package/dist/m365/flow/commands/flow-export.js +17 -16
- package/dist/m365/flow/commands/flow-get.js +1 -1
- package/dist/m365/flow/commands/flow-list.js +1 -1
- package/dist/m365/flow/commands/flow-remove.js +1 -1
- package/dist/m365/flow/commands/owner/owner-ensure.js +1 -1
- package/dist/m365/flow/commands/owner/owner-list.js +1 -1
- package/dist/m365/flow/commands/owner/owner-remove.js +1 -1
- package/dist/m365/flow/commands/recyclebinitem/recyclebinitem-list.js +47 -0
- package/dist/m365/flow/commands/recyclebinitem/recyclebinitem-restore.js +48 -0
- package/dist/m365/flow/commands/run/run-cancel.js +1 -1
- package/dist/m365/flow/commands/run/run-get.js +1 -1
- package/dist/m365/flow/commands/run/run-list.js +1 -1
- package/dist/m365/flow/commands/run/run-resubmit.js +2 -2
- package/dist/m365/flow/commands.js +2 -0
- package/dist/m365/onenote/commands/notebook/notebook-add.js +132 -0
- package/dist/m365/onenote/commands.js +1 -0
- 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-doctor/doctor-1.20.0-rc.1.js +25 -0
- package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
- package/dist/m365/spfx/commands/project/project-github-workflow-add.js +10 -1
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.20.0-rc.1.js +57 -0
- package/dist/m365/spfx/commands/project/project-upgrade.js +16 -13
- package/dist/m365/spfx/commands/spfx-doctor.js +15 -0
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-get.js +1 -0
- package/dist/m365/spo/commands/file/file-copy.js +34 -55
- package/dist/m365/spo/commands/file/file-roleassignment-add.js +17 -54
- package/dist/m365/spo/commands/file/file-roleassignment-remove.js +13 -40
- package/dist/m365/spo/commands/file/file-roleinheritance-break.js +5 -13
- package/dist/m365/spo/commands/file/file-roleinheritance-reset.js +5 -13
- package/dist/m365/spo/commands/folder/folder-set.js +4 -0
- package/dist/m365/spo/commands/folder/folder-sharinglink-add.js +143 -0
- package/dist/m365/spo/commands/folder/folder-sharinglink-clear.js +111 -0
- package/dist/m365/spo/commands/folder/folder-sharinglink-remove.js +95 -0
- package/dist/m365/spo/commands/list/list-get.js +17 -4
- package/dist/m365/spo/commands/list/list-list.js +4 -1
- package/dist/m365/spo/commands/page/page-remove.js +37 -16
- package/dist/m365/spo/commands/page/page-section-add.js +185 -34
- package/dist/m365/spo/commands/site/SiteAdmin.js +2 -0
- package/dist/m365/spo/commands/site/site-admin-add.js +252 -0
- package/dist/m365/spo/commands/site/site-admin-list.js +10 -36
- package/dist/m365/spo/commands/site/site-admin-remove.js +194 -0
- package/dist/m365/spo/commands/site/site-appcatalog-remove.js +24 -48
- package/dist/m365/spo/commands/site/site-get.js +12 -16
- package/dist/m365/spo/commands/site/site-remove.js +7 -1
- package/dist/m365/spo/commands/site/site-sharingpermission-set.js +68 -0
- package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-restore.js +22 -2
- package/dist/m365/spo/commands/user/user-get.js +67 -9
- package/dist/m365/spo/commands.js +7 -0
- package/dist/m365/spp/commands/contentcenter/contentcenter-list.js +56 -0
- package/dist/m365/spp/commands.js +5 -0
- package/dist/m365/teams/MeetingTranscript.js +2 -0
- package/dist/m365/teams/commands/meeting/meeting-transcript-get.js +152 -0
- package/dist/m365/teams/commands.js +1 -0
- 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/engage/engage-group-list.js +5 -0
- package/dist/m365/viva/commands/engage/engage-group-user-add.js +5 -0
- package/dist/m365/viva/commands/engage/engage-group-user-remove.js +5 -0
- package/dist/m365/viva/commands/engage/engage-message-add.js +5 -0
- package/dist/m365/viva/commands/engage/engage-message-get.js +5 -0
- package/dist/m365/viva/commands/engage/engage-message-like-set.js +5 -0
- package/dist/m365/viva/commands/engage/engage-message-list.js +5 -0
- package/dist/m365/viva/commands/engage/engage-message-remove.js +5 -0
- package/dist/m365/viva/commands/engage/engage-network-list.js +5 -0
- package/dist/m365/viva/commands/engage/engage-report-activitycounts.js +8 -0
- package/dist/m365/viva/commands/engage/engage-report-activityusercounts.js +8 -0
- package/dist/m365/viva/commands/engage/engage-report-activityuserdetail.js +8 -0
- package/dist/m365/viva/commands/engage/engage-report-deviceusagedistributionusercounts.js +8 -0
- package/dist/m365/viva/commands/engage/engage-report-deviceusageusercounts.js +8 -0
- package/dist/m365/viva/commands/engage/engage-report-deviceusageuserdetail.js +8 -0
- package/dist/m365/viva/commands/engage/engage-report-groupsactivitycounts.js +8 -0
- package/dist/m365/viva/commands/engage/engage-report-groupsactivitydetail.js +8 -0
- package/dist/m365/viva/commands/engage/engage-report-groupsactivitygroupcounts.js +8 -0
- package/dist/m365/viva/commands/engage/engage-search.js +5 -0
- package/dist/m365/viva/commands/engage/engage-user-get.js +5 -0
- package/dist/m365/viva/commands/engage/engage-user-list.js +5 -0
- package/dist/m365/viva/commands/engage/yammerCommands.js +25 -0
- package/dist/m365/viva/commands.js +1 -0
- package/dist/request.js +46 -61
- package/dist/settingsNames.js +7 -1
- package/dist/utils/driveUtil.js +51 -0
- package/dist/utils/entraApp.js +283 -0
- package/dist/utils/spo.js +58 -66
- package/dist/utils/timersUtil.js +12 -0
- package/dist/utils/urlUtil.js +8 -0
- package/dist/utils/zod.js +1 -1
- package/docs/docs/_clisettings.mdx +6 -0
- package/docs/docs/cmd/app/permission/permission-add.mdx +5 -5
- package/docs/docs/cmd/cli/cli-consent.mdx +1 -1
- 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-report-activitystorage.mdx +2 -2
- package/docs/docs/cmd/entra/m365group/m365group-user-list.mdx +1 -1
- package/docs/docs/cmd/external/item/item-add.mdx +3 -3
- package/docs/docs/cmd/file/file-move.mdx +79 -0
- package/docs/docs/cmd/flow/recyclebinitem/recyclebinitem-list.mdx +132 -0
- package/docs/docs/cmd/flow/recyclebinitem/recyclebinitem-restore.mdx +55 -0
- package/docs/docs/cmd/onenote/notebook/notebook-add.mdx +169 -0
- package/docs/docs/cmd/outlook/message/message-get.mdx +5 -5
- package/docs/docs/cmd/setup.mdx +16 -3
- package/docs/docs/cmd/spfx/project/project-github-workflow-add.mdx +12 -11
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-get.mdx +5 -6
- package/docs/docs/cmd/spo/cdn/cdn-get.mdx +1 -1
- package/docs/docs/cmd/spo/cdn/cdn-origin-add.mdx +1 -1
- package/docs/docs/cmd/spo/cdn/cdn-origin-list.mdx +1 -1
- package/docs/docs/cmd/spo/cdn/cdn-origin-remove.mdx +1 -1
- package/docs/docs/cmd/spo/cdn/cdn-policy-list.mdx +1 -1
- package/docs/docs/cmd/spo/cdn/cdn-policy-set.mdx +1 -1
- package/docs/docs/cmd/spo/externaluser/externaluser-list.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-copy.mdx +12 -119
- package/docs/docs/cmd/spo/folder/folder-set.mdx +6 -0
- package/docs/docs/cmd/spo/folder/folder-sharinglink-add.mdx +125 -0
- package/docs/docs/cmd/spo/folder/folder-sharinglink-clear.mdx +50 -0
- package/docs/docs/cmd/spo/folder/folder-sharinglink-remove.mdx +50 -0
- package/docs/docs/cmd/spo/hidedefaultthemes/hidedefaultthemes-get.mdx +1 -1
- package/docs/docs/cmd/spo/hidedefaultthemes/hidedefaultthemes-set.mdx +1 -1
- package/docs/docs/cmd/spo/homesite/homesite-remove.mdx +1 -1
- package/docs/docs/cmd/spo/knowledgehub/knowledgehub-get.mdx +1 -1
- package/docs/docs/cmd/spo/knowledgehub/knowledgehub-remove.mdx +1 -1
- package/docs/docs/cmd/spo/knowledgehub/knowledgehub-set.mdx +1 -1
- package/docs/docs/cmd/spo/list/list-list.mdx +7 -5
- package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-add.mdx +1 -1
- package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-list.mdx +1 -1
- package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-remove.mdx +1 -1
- package/docs/docs/cmd/spo/orgnewssite/orgnewssite-list.mdx +1 -1
- package/docs/docs/cmd/spo/orgnewssite/orgnewssite-remove.mdx +1 -1
- package/docs/docs/cmd/spo/orgnewssite/orgnewssite-set.mdx +1 -1
- package/docs/docs/cmd/spo/page/page-remove.mdx +30 -12
- package/docs/docs/cmd/spo/page/page-section-add.mdx +57 -2
- package/docs/docs/cmd/spo/site/site-admin-add.mdx +67 -0
- package/docs/docs/cmd/spo/site/site-admin-list.mdx +64 -12
- package/docs/docs/cmd/spo/site/site-admin-remove.mdx +67 -0
- package/docs/docs/cmd/spo/site/site-appcatalog-add.mdx +1 -1
- package/docs/docs/cmd/spo/site/site-appcatalog-remove.mdx +3 -12
- package/docs/docs/cmd/spo/site/site-commsite-enable.mdx +1 -1
- package/docs/docs/cmd/spo/site/site-list.mdx +6 -4
- package/docs/docs/cmd/spo/site/site-remove.mdx +3 -0
- package/docs/docs/cmd/spo/site/site-set.mdx +1 -1
- package/docs/docs/cmd/spo/site/site-sharingpermission-set.mdx +58 -0
- package/docs/docs/cmd/spo/storageentity/storageentity-remove.mdx +1 -1
- package/docs/docs/cmd/spo/storageentity/storageentity-set.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-appcatalog-add.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-appcatalogurl-get.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-recyclebinitem-list.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-recyclebinitem-remove.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-recyclebinitem-restore.mdx +49 -2
- package/docs/docs/cmd/spo/tenant/tenant-settings-list.mdx +1 -1
- package/docs/docs/cmd/spo/theme/theme-apply.mdx +1 -1
- package/docs/docs/cmd/spo/theme/theme-get.mdx +1 -1
- package/docs/docs/cmd/spo/theme/theme-list.mdx +1 -1
- package/docs/docs/cmd/spo/theme/theme-remove.mdx +1 -1
- package/docs/docs/cmd/spo/theme/theme-set.mdx +1 -1
- package/docs/docs/cmd/spo/user/user-get.mdx +35 -9
- package/docs/docs/cmd/spp/contentcenter/contentcenter-list.mdx +287 -0
- package/docs/docs/cmd/teams/meeting/meeting-transcript-get.mdx +132 -0
- package/docs/docs/cmd/viva/engage/engage-community-list.mdx +81 -0
- package/npm-shrinkwrap.json +205 -377
- package/package.json +16 -17
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
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
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
+
};
|
|
6
|
+
var _OneNoteNotebookAddCommand_instances, _OneNoteNotebookAddCommand_initTelemetry, _OneNoteNotebookAddCommand_initOptions, _OneNoteNotebookAddCommand_initValidators, _OneNoteNotebookAddCommand_initOptionSets;
|
|
7
|
+
import request from '../../../../request.js';
|
|
8
|
+
import { entraGroup } from '../../../../utils/entraGroup.js';
|
|
9
|
+
import { validation } from '../../../../utils/validation.js';
|
|
10
|
+
import GraphCommand from '../../../base/GraphCommand.js';
|
|
11
|
+
import commands from '../../commands.js';
|
|
12
|
+
import { spo } from '../../../../utils/spo.js';
|
|
13
|
+
class OneNoteNotebookAddCommand extends GraphCommand {
|
|
14
|
+
get name() {
|
|
15
|
+
return commands.NOTEBOOK_ADD;
|
|
16
|
+
}
|
|
17
|
+
get description() {
|
|
18
|
+
return 'Create a new OneNote notebook';
|
|
19
|
+
}
|
|
20
|
+
constructor() {
|
|
21
|
+
super();
|
|
22
|
+
_OneNoteNotebookAddCommand_instances.add(this);
|
|
23
|
+
__classPrivateFieldGet(this, _OneNoteNotebookAddCommand_instances, "m", _OneNoteNotebookAddCommand_initTelemetry).call(this);
|
|
24
|
+
__classPrivateFieldGet(this, _OneNoteNotebookAddCommand_instances, "m", _OneNoteNotebookAddCommand_initOptions).call(this);
|
|
25
|
+
__classPrivateFieldGet(this, _OneNoteNotebookAddCommand_instances, "m", _OneNoteNotebookAddCommand_initValidators).call(this);
|
|
26
|
+
__classPrivateFieldGet(this, _OneNoteNotebookAddCommand_instances, "m", _OneNoteNotebookAddCommand_initOptionSets).call(this);
|
|
27
|
+
}
|
|
28
|
+
async commandAction(logger, args) {
|
|
29
|
+
try {
|
|
30
|
+
if (this.verbose) {
|
|
31
|
+
await logger.logToStderr(`Creating OneNote notebook ${args.options.name}`);
|
|
32
|
+
}
|
|
33
|
+
const requestUrl = await this.getRequestUrl(args);
|
|
34
|
+
const requestOptions = {
|
|
35
|
+
url: requestUrl,
|
|
36
|
+
headers: {
|
|
37
|
+
accept: 'application/json;odata.metadata=none',
|
|
38
|
+
'content-type': "application/json"
|
|
39
|
+
},
|
|
40
|
+
responseType: 'json',
|
|
41
|
+
data: {
|
|
42
|
+
displayName: args.options.name
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const response = await request.post(requestOptions);
|
|
46
|
+
await logger.log(response);
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
this.handleRejectedODataJsonPromise(err);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
async getRequestUrl(args) {
|
|
53
|
+
let endpoint = `${this.resource}/v1.0/`;
|
|
54
|
+
if (args.options.userId) {
|
|
55
|
+
endpoint += `users/${args.options.userId}`;
|
|
56
|
+
}
|
|
57
|
+
else if (args.options.userName) {
|
|
58
|
+
endpoint += `users/${args.options.userName}`;
|
|
59
|
+
}
|
|
60
|
+
else if (args.options.groupId) {
|
|
61
|
+
endpoint += `groups/${args.options.groupId}`;
|
|
62
|
+
}
|
|
63
|
+
else if (args.options.groupName) {
|
|
64
|
+
const groupId = await entraGroup.getGroupIdByDisplayName(args.options.groupName);
|
|
65
|
+
endpoint += `groups/${groupId}`;
|
|
66
|
+
}
|
|
67
|
+
else if (args.options.webUrl) {
|
|
68
|
+
const siteId = await spo.getSpoGraphSiteId(args.options.webUrl);
|
|
69
|
+
endpoint += `sites/${siteId}`;
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
endpoint += 'me';
|
|
73
|
+
}
|
|
74
|
+
endpoint += '/onenote/notebooks';
|
|
75
|
+
return endpoint;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
_OneNoteNotebookAddCommand_instances = new WeakSet(), _OneNoteNotebookAddCommand_initTelemetry = function _OneNoteNotebookAddCommand_initTelemetry() {
|
|
79
|
+
this.telemetry.push((args) => {
|
|
80
|
+
Object.assign(this.telemetryProperties, {
|
|
81
|
+
userId: typeof args.options.userId !== 'undefined',
|
|
82
|
+
userName: typeof args.options.userName !== 'undefined',
|
|
83
|
+
groupId: typeof args.options.groupId !== 'undefined',
|
|
84
|
+
groupName: typeof args.options.groupName !== 'undefined',
|
|
85
|
+
webUrl: typeof args.options.webUrl !== 'undefined'
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
}, _OneNoteNotebookAddCommand_initOptions = function _OneNoteNotebookAddCommand_initOptions() {
|
|
89
|
+
this.options.unshift({
|
|
90
|
+
option: '-n, --name <name>'
|
|
91
|
+
}, {
|
|
92
|
+
option: '--userId [userId]'
|
|
93
|
+
}, {
|
|
94
|
+
option: '--userName [userName]'
|
|
95
|
+
}, {
|
|
96
|
+
option: '--groupId [groupId]'
|
|
97
|
+
}, {
|
|
98
|
+
option: '--groupName [groupName]'
|
|
99
|
+
}, {
|
|
100
|
+
option: '-u, --webUrl [webUrl]'
|
|
101
|
+
});
|
|
102
|
+
}, _OneNoteNotebookAddCommand_initValidators = function _OneNoteNotebookAddCommand_initValidators() {
|
|
103
|
+
this.validators.push(async (args) => {
|
|
104
|
+
// check name for invalid characters
|
|
105
|
+
if (args.options.name.length > 128) {
|
|
106
|
+
return 'The specified name is too long. It should be less than 128 characters';
|
|
107
|
+
}
|
|
108
|
+
if (/[?*/:<>|'"]/.test(args.options.name)) {
|
|
109
|
+
return `The specified name contains invalid characters. It cannot contain ?*/:<>|'". Please remove them and try again.`;
|
|
110
|
+
}
|
|
111
|
+
if (args.options.userId && !validation.isValidGuid(args.options.userId)) {
|
|
112
|
+
return `${args.options.userId} is not a valid GUID`;
|
|
113
|
+
}
|
|
114
|
+
if (args.options.groupId && !validation.isValidGuid(args.options.groupId)) {
|
|
115
|
+
return `${args.options.groupId} is not a valid GUID`;
|
|
116
|
+
}
|
|
117
|
+
if (args.options.webUrl) {
|
|
118
|
+
return validation.isValidSharePointUrl(args.options.webUrl);
|
|
119
|
+
}
|
|
120
|
+
return true;
|
|
121
|
+
});
|
|
122
|
+
}, _OneNoteNotebookAddCommand_initOptionSets = function _OneNoteNotebookAddCommand_initOptionSets() {
|
|
123
|
+
this.optionSets.push({
|
|
124
|
+
options: ['userId', 'userName', 'groupId', 'groupName', 'webUrl'],
|
|
125
|
+
runsWhen: (args) => {
|
|
126
|
+
const options = [args.options.userId, args.options.userName, args.options.groupId, args.options.groupName, args.options.webUrl];
|
|
127
|
+
return options.some(item => item !== undefined);
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
export default new OneNoteNotebookAddCommand();
|
|
132
|
+
//# sourceMappingURL=notebook-add.js.map
|
|
@@ -30,20 +30,20 @@ class OutlookMessageGetCommand extends GraphCommand {
|
|
|
30
30
|
}
|
|
31
31
|
let requestUrl = '';
|
|
32
32
|
if (isAppOnlyAccessToken) {
|
|
33
|
-
if (!args.options.userId && !args.options.
|
|
34
|
-
throw `The option 'userId' or '
|
|
33
|
+
if (!args.options.userId && !args.options.userPrincipalName) {
|
|
34
|
+
throw `The option 'userId' or 'userPrincipalName' is required when retrieving an email using app only credentials`;
|
|
35
35
|
}
|
|
36
|
-
if (args.options.userId && args.options.
|
|
37
|
-
throw `Both options 'userId' and '
|
|
36
|
+
if (args.options.userId && args.options.userPrincipalName) {
|
|
37
|
+
throw `Both options 'userId' and 'userPrincipalName' cannot be set when retrieving an email using app only credentials`;
|
|
38
38
|
}
|
|
39
|
-
requestUrl += `users/${args.options.userId ? args.options.userId : args.options.
|
|
39
|
+
requestUrl += `users/${args.options.userId ? args.options.userId : args.options.userPrincipalName}`;
|
|
40
40
|
}
|
|
41
41
|
else {
|
|
42
|
-
if (args.options.userId && args.options.
|
|
43
|
-
throw `Both options 'userId' and '
|
|
42
|
+
if (args.options.userId && args.options.userPrincipalName) {
|
|
43
|
+
throw `Both options 'userId' and 'userPrincipalName' cannot be set when retrieving an email using delegated credentials`;
|
|
44
44
|
}
|
|
45
|
-
if (args.options.userId || args.options.
|
|
46
|
-
requestUrl += `users/${args.options.userId ? args.options.userId : args.options.
|
|
45
|
+
if (args.options.userId || args.options.userPrincipalName) {
|
|
46
|
+
requestUrl += `users/${args.options.userId ? args.options.userId : args.options.userPrincipalName}`;
|
|
47
47
|
}
|
|
48
48
|
else {
|
|
49
49
|
requestUrl += 'me';
|
|
@@ -69,7 +69,7 @@ _OutlookMessageGetCommand_instances = new WeakSet(), _OutlookMessageGetCommand_i
|
|
|
69
69
|
this.telemetry.push((args) => {
|
|
70
70
|
Object.assign(this.telemetryProperties, {
|
|
71
71
|
userId: typeof args.options.userId !== 'undefined',
|
|
72
|
-
|
|
72
|
+
userPrincipalName: typeof args.options.userPrincipalName !== 'undefined'
|
|
73
73
|
});
|
|
74
74
|
});
|
|
75
75
|
}, _OutlookMessageGetCommand_initOptions = function _OutlookMessageGetCommand_initOptions() {
|
|
@@ -78,7 +78,7 @@ _OutlookMessageGetCommand_instances = new WeakSet(), _OutlookMessageGetCommand_i
|
|
|
78
78
|
}, {
|
|
79
79
|
option: '--userId [userId]'
|
|
80
80
|
}, {
|
|
81
|
-
option: '--
|
|
81
|
+
option: '--userPrincipalName [userPrincipalName]'
|
|
82
82
|
});
|
|
83
83
|
};
|
|
84
84
|
export default new OutlookMessageGetCommand();
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FN001008_DEP_react } from './rules/FN001008_DEP_react.js';
|
|
2
|
+
import { FN001009_DEP_react_dom } from './rules/FN001009_DEP_react_dom.js';
|
|
3
|
+
import { FN001035_DEP_fluentui_react } from './rules/FN001035_DEP_fluentui_react.js';
|
|
4
|
+
import { FN002004_DEVDEP_gulp } from './rules/FN002004_DEVDEP_gulp.js';
|
|
5
|
+
import { FN002007_DEVDEP_ajv } from './rules/FN002007_DEVDEP_ajv.js';
|
|
6
|
+
import { FN002013_DEVDEP_types_webpack_env } from './rules/FN002013_DEVDEP_types_webpack_env.js';
|
|
7
|
+
import { FN002015_DEVDEP_types_react } from './rules/FN002015_DEVDEP_types_react.js';
|
|
8
|
+
import { FN002016_DEVDEP_types_react_dom } from './rules/FN002016_DEVDEP_types_react_dom.js';
|
|
9
|
+
import { FN002019_DEVDEP_microsoft_rush_stack_compiler } from './rules/FN002019_DEVDEP_microsoft_rush_stack_compiler.js';
|
|
10
|
+
import { FN021001_PKG_spfx_deps_versions_match_project_version } from './rules/FN021001_PKG_spfx_deps_versions_match_project_version.js';
|
|
11
|
+
import { FN021013_PKG_spfx_devdeps_match_version } from './rules/FN021013_PKG_spfx_devdeps_match_version.js';
|
|
12
|
+
export default [
|
|
13
|
+
new FN001008_DEP_react('17'),
|
|
14
|
+
new FN001009_DEP_react_dom('17'),
|
|
15
|
+
new FN001035_DEP_fluentui_react('^8.106.4'),
|
|
16
|
+
new FN002004_DEVDEP_gulp('4.0.2'),
|
|
17
|
+
new FN002007_DEVDEP_ajv('^6.12.5'),
|
|
18
|
+
new FN002013_DEVDEP_types_webpack_env('~1.15.2'),
|
|
19
|
+
new FN002015_DEVDEP_types_react('17'),
|
|
20
|
+
new FN002016_DEVDEP_types_react_dom('17'),
|
|
21
|
+
new FN002019_DEVDEP_microsoft_rush_stack_compiler(['4.7']),
|
|
22
|
+
new FN021001_PKG_spfx_deps_versions_match_project_version(false),
|
|
23
|
+
new FN021013_PKG_spfx_devdeps_match_version('1.20.1')
|
|
24
|
+
];
|
|
25
|
+
//# sourceMappingURL=doctor-1.20.0-rc.1.js.map
|
|
@@ -70,7 +70,8 @@ class SpfxProjectDoctorCommand extends BaseProjectCommand {
|
|
|
70
70
|
'1.18.0',
|
|
71
71
|
'1.18.1',
|
|
72
72
|
'1.18.2',
|
|
73
|
-
'1.19.0'
|
|
73
|
+
'1.19.0',
|
|
74
|
+
'1.20.0-rc.1'
|
|
74
75
|
];
|
|
75
76
|
__classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initTelemetry).call(this);
|
|
76
77
|
__classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initOptions).call(this);
|
|
@@ -33,6 +33,9 @@ class SpfxProjectGithubWorkflowAddCommand extends BaseProjectCommand {
|
|
|
33
33
|
if (this.projectRootPath === null) {
|
|
34
34
|
throw new CommandError(`Couldn't find project root folder`, _a.ERROR_NO_PROJECT_ROOT_FOLDER);
|
|
35
35
|
}
|
|
36
|
+
if (!args.options.overwrite) {
|
|
37
|
+
await this.warn(logger, `We recommend always using the --overwrite option and it will become the default behavior in next major release. Overwriting your sppkg file on every deployment is required to make continuous delivery of the latest version of your app which is the aim of the continuous delivery pipeline.`);
|
|
38
|
+
}
|
|
36
39
|
const solutionPackageJsonFile = path.join(this.projectRootPath, 'package.json');
|
|
37
40
|
const packageJson = fs.readFileSync(solutionPackageJsonFile, 'utf-8');
|
|
38
41
|
const solutionName = JSON.parse(packageJson).name;
|
|
@@ -78,6 +81,9 @@ class SpfxProjectGithubWorkflowAddCommand extends BaseProjectCommand {
|
|
|
78
81
|
if (options.skipFeatureDeployment) {
|
|
79
82
|
this.getDeployAction(workflow).with.SKIP_FEATURE_DEPLOYMENT = true;
|
|
80
83
|
}
|
|
84
|
+
if (options.overwrite) {
|
|
85
|
+
this.getDeployAction(workflow).with.OVERWRITE = true;
|
|
86
|
+
}
|
|
81
87
|
if (options.loginMethod === 'user') {
|
|
82
88
|
const loginAction = this.getLoginAction(workflow);
|
|
83
89
|
loginAction.with = {
|
|
@@ -119,7 +125,8 @@ _a = SpfxProjectGithubWorkflowAddCommand, _SpfxProjectGithubWorkflowAddCommand_i
|
|
|
119
125
|
manuallyTrigger: !!args.options.manuallyTrigger,
|
|
120
126
|
loginMethod: typeof args.options.loginMethod !== 'undefined',
|
|
121
127
|
scope: typeof args.options.scope !== 'undefined',
|
|
122
|
-
skipFeatureDeployment: !!args.options.skipFeatureDeployment
|
|
128
|
+
skipFeatureDeployment: !!args.options.skipFeatureDeployment,
|
|
129
|
+
overwrite: !!args.options.overwrite
|
|
123
130
|
});
|
|
124
131
|
});
|
|
125
132
|
}, _SpfxProjectGithubWorkflowAddCommand_initOptions = function _SpfxProjectGithubWorkflowAddCommand_initOptions() {
|
|
@@ -139,6 +146,8 @@ _a = SpfxProjectGithubWorkflowAddCommand, _SpfxProjectGithubWorkflowAddCommand_i
|
|
|
139
146
|
option: '-u, --siteUrl [siteUrl]'
|
|
140
147
|
}, {
|
|
141
148
|
option: '--skipFeatureDeployment'
|
|
149
|
+
}, {
|
|
150
|
+
option: '--overwrite'
|
|
142
151
|
});
|
|
143
152
|
}, _SpfxProjectGithubWorkflowAddCommand_initValidators = function _SpfxProjectGithubWorkflowAddCommand_initValidators() {
|
|
144
153
|
this.validators.push(async (args) => {
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { FN001001_DEP_microsoft_sp_core_library } from './rules/FN001001_DEP_microsoft_sp_core_library.js';
|
|
2
|
+
import { FN001002_DEP_microsoft_sp_lodash_subset } from './rules/FN001002_DEP_microsoft_sp_lodash_subset.js';
|
|
3
|
+
import { FN001003_DEP_microsoft_sp_office_ui_fabric_core } from './rules/FN001003_DEP_microsoft_sp_office_ui_fabric_core.js';
|
|
4
|
+
import { FN001004_DEP_microsoft_sp_webpart_base } from './rules/FN001004_DEP_microsoft_sp_webpart_base.js';
|
|
5
|
+
import { FN001011_DEP_microsoft_sp_dialog } from './rules/FN001011_DEP_microsoft_sp_dialog.js';
|
|
6
|
+
import { FN001012_DEP_microsoft_sp_application_base } from './rules/FN001012_DEP_microsoft_sp_application_base.js';
|
|
7
|
+
import { FN001013_DEP_microsoft_decorators } from './rules/FN001013_DEP_microsoft_decorators.js';
|
|
8
|
+
import { FN001014_DEP_microsoft_sp_listview_extensibility } from './rules/FN001014_DEP_microsoft_sp_listview_extensibility.js';
|
|
9
|
+
import { FN001021_DEP_microsoft_sp_property_pane } from './rules/FN001021_DEP_microsoft_sp_property_pane.js';
|
|
10
|
+
import { FN001023_DEP_microsoft_sp_component_base } from './rules/FN001023_DEP_microsoft_sp_component_base.js';
|
|
11
|
+
import { FN001024_DEP_microsoft_sp_diagnostics } from './rules/FN001024_DEP_microsoft_sp_diagnostics.js';
|
|
12
|
+
import { FN001025_DEP_microsoft_sp_dynamic_data } from './rules/FN001025_DEP_microsoft_sp_dynamic_data.js';
|
|
13
|
+
import { FN001026_DEP_microsoft_sp_extension_base } from './rules/FN001026_DEP_microsoft_sp_extension_base.js';
|
|
14
|
+
import { FN001027_DEP_microsoft_sp_http } from './rules/FN001027_DEP_microsoft_sp_http.js';
|
|
15
|
+
import { FN001028_DEP_microsoft_sp_list_subscription } from './rules/FN001028_DEP_microsoft_sp_list_subscription.js';
|
|
16
|
+
import { FN001029_DEP_microsoft_sp_loader } from './rules/FN001029_DEP_microsoft_sp_loader.js';
|
|
17
|
+
import { FN001030_DEP_microsoft_sp_module_interfaces } from './rules/FN001030_DEP_microsoft_sp_module_interfaces.js';
|
|
18
|
+
import { FN001031_DEP_microsoft_sp_odata_types } from './rules/FN001031_DEP_microsoft_sp_odata_types.js';
|
|
19
|
+
import { FN001032_DEP_microsoft_sp_page_context } from './rules/FN001032_DEP_microsoft_sp_page_context.js';
|
|
20
|
+
import { FN001034_DEP_microsoft_sp_adaptive_card_extension_base } from './rules/FN001034_DEP_microsoft_sp_adaptive_card_extension_base.js';
|
|
21
|
+
import { FN002001_DEVDEP_microsoft_sp_build_web } from './rules/FN002001_DEVDEP_microsoft_sp_build_web.js';
|
|
22
|
+
import { FN002002_DEVDEP_microsoft_sp_module_interfaces } from './rules/FN002002_DEVDEP_microsoft_sp_module_interfaces.js';
|
|
23
|
+
import { FN002022_DEVDEP_microsoft_eslint_plugin_spfx } from './rules/FN002022_DEVDEP_microsoft_eslint_plugin_spfx.js';
|
|
24
|
+
import { FN002023_DEVDEP_microsoft_eslint_config_spfx } from './rules/FN002023_DEVDEP_microsoft_eslint_config_spfx.js';
|
|
25
|
+
import { FN002024_DEVDEP_eslint } from './rules/FN002024_DEVDEP_eslint.js';
|
|
26
|
+
import { FN010001_YORC_version } from './rules/FN010001_YORC_version.js';
|
|
27
|
+
import { FN010010_YORC_sdkVersions_teams_js } from './rules/FN010010_YORC_sdkVersions_teams_js.js';
|
|
28
|
+
export default [
|
|
29
|
+
new FN001001_DEP_microsoft_sp_core_library('1.20.0-rc.1'),
|
|
30
|
+
new FN001002_DEP_microsoft_sp_lodash_subset('1.20.0-rc.1'),
|
|
31
|
+
new FN001003_DEP_microsoft_sp_office_ui_fabric_core('1.20.0-rc.1'),
|
|
32
|
+
new FN001004_DEP_microsoft_sp_webpart_base('1.20.0-rc.1'),
|
|
33
|
+
new FN001011_DEP_microsoft_sp_dialog('1.20.0-rc.1'),
|
|
34
|
+
new FN001012_DEP_microsoft_sp_application_base('1.20.0-rc.1'),
|
|
35
|
+
new FN001014_DEP_microsoft_sp_listview_extensibility('1.20.0-rc.1'),
|
|
36
|
+
new FN001021_DEP_microsoft_sp_property_pane('1.20.0-rc.1'),
|
|
37
|
+
new FN001023_DEP_microsoft_sp_component_base('1.20.0-rc.1'),
|
|
38
|
+
new FN001024_DEP_microsoft_sp_diagnostics('1.20.0-rc.1'),
|
|
39
|
+
new FN001025_DEP_microsoft_sp_dynamic_data('1.20.0-rc.1'),
|
|
40
|
+
new FN001026_DEP_microsoft_sp_extension_base('1.20.0-rc.1'),
|
|
41
|
+
new FN001027_DEP_microsoft_sp_http('1.20.0-rc.1'),
|
|
42
|
+
new FN001028_DEP_microsoft_sp_list_subscription('1.20.0-rc.1'),
|
|
43
|
+
new FN001029_DEP_microsoft_sp_loader('1.20.0-rc.1'),
|
|
44
|
+
new FN001030_DEP_microsoft_sp_module_interfaces('1.20.0-rc.1'),
|
|
45
|
+
new FN001031_DEP_microsoft_sp_odata_types('1.20.0-rc.1'),
|
|
46
|
+
new FN001032_DEP_microsoft_sp_page_context('1.20.0-rc.1'),
|
|
47
|
+
new FN001013_DEP_microsoft_decorators('1.20.0-rc.1'),
|
|
48
|
+
new FN001034_DEP_microsoft_sp_adaptive_card_extension_base('1.20.0-rc.1'),
|
|
49
|
+
new FN002001_DEVDEP_microsoft_sp_build_web('1.20.1'),
|
|
50
|
+
new FN002002_DEVDEP_microsoft_sp_module_interfaces('1.20.1'),
|
|
51
|
+
new FN002024_DEVDEP_eslint('8.57.0'),
|
|
52
|
+
new FN002022_DEVDEP_microsoft_eslint_plugin_spfx('1.20.1'),
|
|
53
|
+
new FN002023_DEVDEP_microsoft_eslint_config_spfx('1.20.1'),
|
|
54
|
+
new FN010001_YORC_version('1.20.0-rc.1'),
|
|
55
|
+
new FN010010_YORC_sdkVersions_teams_js('2.24.0')
|
|
56
|
+
];
|
|
57
|
+
//# sourceMappingURL=upgrade-1.20.0-rc.1.js.map
|
|
@@ -7,6 +7,8 @@ var _SpfxProjectUpgradeCommand_instances, _a, _SpfxProjectUpgradeCommand_initTel
|
|
|
7
7
|
import fs from 'fs';
|
|
8
8
|
import os from 'os';
|
|
9
9
|
import path from 'path';
|
|
10
|
+
// uncomment to support upgrading to preview releases
|
|
11
|
+
import { prerelease } from 'semver';
|
|
10
12
|
import { CommandError } from '../../../../Command.js';
|
|
11
13
|
import { fsUtil } from '../../../../utils/fsUtil.js';
|
|
12
14
|
import { packageManager } from '../../../../utils/packageManager.js';
|
|
@@ -72,7 +74,8 @@ class SpfxProjectUpgradeCommand extends BaseProjectCommand {
|
|
|
72
74
|
'1.18.0',
|
|
73
75
|
'1.18.1',
|
|
74
76
|
'1.18.2',
|
|
75
|
-
'1.19.0'
|
|
77
|
+
'1.19.0',
|
|
78
|
+
'1.20.0-rc.1'
|
|
76
79
|
];
|
|
77
80
|
__classPrivateFieldGet(this, _SpfxProjectUpgradeCommand_instances, "m", _SpfxProjectUpgradeCommand_initTelemetry).call(this);
|
|
78
81
|
__classPrivateFieldGet(this, _SpfxProjectUpgradeCommand_instances, "m", _SpfxProjectUpgradeCommand_initOptions).call(this);
|
|
@@ -85,15 +88,15 @@ class SpfxProjectUpgradeCommand extends BaseProjectCommand {
|
|
|
85
88
|
}
|
|
86
89
|
this.toVersion = args.options.toVersion ? args.options.toVersion : this.supportedVersions[this.supportedVersions.length - 1];
|
|
87
90
|
// uncomment to support upgrading to preview releases
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
91
|
+
if (!args.options.toVersion &&
|
|
92
|
+
!args.options.preview &&
|
|
93
|
+
prerelease(this.toVersion)) {
|
|
94
|
+
// no version and no preview specified while the current version to
|
|
95
|
+
// upgrade to is a prerelease so let's grab the first non-preview version
|
|
96
|
+
// since we're supporting only one preview version, it's sufficient for
|
|
97
|
+
// us to take second to last version
|
|
98
|
+
this.toVersion = this.supportedVersions[this.supportedVersions.length - 2];
|
|
99
|
+
}
|
|
97
100
|
this.packageManager = args.options.packageManager || 'npm';
|
|
98
101
|
this.shell = args.options.shell || 'bash';
|
|
99
102
|
if (this.supportedVersions.indexOf(this.toVersion) < 0) {
|
|
@@ -482,9 +485,9 @@ _a = SpfxProjectUpgradeCommand, _SpfxProjectUpgradeCommand_instances = new WeakS
|
|
|
482
485
|
preview: args.options.preview
|
|
483
486
|
});
|
|
484
487
|
// uncomment to support upgrading to preview releases
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
+
if (prerelease(this.telemetryProperties.toVersion) && !args.options.preview) {
|
|
489
|
+
this.telemetryProperties.toVersion = this.supportedVersions[this.supportedVersions.length - 2];
|
|
490
|
+
}
|
|
488
491
|
});
|
|
489
492
|
}, _SpfxProjectUpgradeCommand_initOptions = function _SpfxProjectUpgradeCommand_initOptions() {
|
|
490
493
|
this.options.unshift({
|
|
@@ -575,6 +575,21 @@ class SpfxDoctorCommand extends BaseProjectCommand {
|
|
|
575
575
|
range: '^4 || ^5',
|
|
576
576
|
fix: 'npm i -g yo@5'
|
|
577
577
|
}
|
|
578
|
+
},
|
|
579
|
+
'1.20.0-rc.1': {
|
|
580
|
+
gulpCli: {
|
|
581
|
+
range: '^1 || ^2 || ^3',
|
|
582
|
+
fix: 'npm i -g gulp-cli@3'
|
|
583
|
+
},
|
|
584
|
+
node: {
|
|
585
|
+
range: '>=18.17.1 <19.0.0',
|
|
586
|
+
fix: 'Install Node.js >=18.17.1 <19.0.0'
|
|
587
|
+
},
|
|
588
|
+
sp: SharePointVersion.SPO,
|
|
589
|
+
yo: {
|
|
590
|
+
range: '^4 || ^5',
|
|
591
|
+
fix: 'npm i -g yo@5'
|
|
592
|
+
}
|
|
578
593
|
}
|
|
579
594
|
};
|
|
580
595
|
this.output = '';
|
|
@@ -33,6 +33,7 @@ class SpoApplicationCustomizerGetCommand extends SpoCommand {
|
|
|
33
33
|
if (!args.options.clientSideComponentProperties) {
|
|
34
34
|
await logger.log({
|
|
35
35
|
...customAction,
|
|
36
|
+
Rights: JSON.stringify(customAction.Rights),
|
|
36
37
|
Scope: this.humanizeScope(customAction.Scope)
|
|
37
38
|
});
|
|
38
39
|
}
|
|
@@ -5,7 +5,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
5
5
|
};
|
|
6
6
|
var _SpoFileCopyCommand_instances, _SpoFileCopyCommand_initTelemetry, _SpoFileCopyCommand_initOptions, _SpoFileCopyCommand_initValidators, _SpoFileCopyCommand_initOptionSets, _SpoFileCopyCommand_initTypes;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
|
-
import { CreateCopyJobsNameConflictBehavior, spo } from '../../../../utils/spo.js';
|
|
9
8
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
10
9
|
import { validation } from '../../../../utils/validation.js';
|
|
11
10
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
@@ -31,43 +30,39 @@ class SpoFileCopyCommand extends SpoCommand {
|
|
|
31
30
|
try {
|
|
32
31
|
const sourceServerRelativePath = await this.getSourcePath(logger, args.options);
|
|
33
32
|
const sourcePath = this.getAbsoluteUrl(args.options.webUrl, sourceServerRelativePath);
|
|
34
|
-
|
|
35
|
-
if (
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
let newName = args.options.newName;
|
|
39
|
-
// Add original file extension if not provided
|
|
40
|
-
if (newName && !newName.includes('.')) {
|
|
41
|
-
newName += sourceServerRelativePath.substring(sourceServerRelativePath.lastIndexOf('.'));
|
|
33
|
+
let destinationPath = this.getAbsoluteUrl(args.options.webUrl, args.options.targetUrl) + '/';
|
|
34
|
+
if (args.options.newName) {
|
|
35
|
+
destinationPath += args.options.newName;
|
|
42
36
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
ignoreVersionHistory: !!args.options.ignoreVersionHistory,
|
|
47
|
-
newName: newName
|
|
48
|
-
});
|
|
49
|
-
if (args.options.skipWait) {
|
|
50
|
-
return;
|
|
37
|
+
else {
|
|
38
|
+
// Keep the original file name
|
|
39
|
+
destinationPath += sourcePath.substring(sourcePath.lastIndexOf('/') + 1);
|
|
51
40
|
}
|
|
52
41
|
if (this.verbose) {
|
|
53
|
-
await logger.logToStderr(
|
|
42
|
+
await logger.logToStderr(`Copying file '${sourcePath}' to '${destinationPath}'...`);
|
|
54
43
|
}
|
|
55
|
-
const copyJobResult = await spo.getCopyJobResult(args.options.webUrl, copyJobResponse);
|
|
56
|
-
if (this.verbose) {
|
|
57
|
-
await logger.logToStderr('Getting information about the destination file...');
|
|
58
|
-
}
|
|
59
|
-
// Get destination file data
|
|
60
|
-
const siteRelativeDestinationFolder = '/' + copyJobResult.TargetObjectSiteRelativeUrl.substring(0, copyJobResult.TargetObjectSiteRelativeUrl.lastIndexOf('/'));
|
|
61
|
-
const absoluteWebUrl = destinationPath.substring(0, destinationPath.toLowerCase().lastIndexOf(siteRelativeDestinationFolder.toLowerCase()));
|
|
62
44
|
const requestOptions = {
|
|
63
|
-
url: `${
|
|
45
|
+
url: `${args.options.webUrl}/_api/SP.MoveCopyUtil.CopyFileByPath`,
|
|
64
46
|
headers: {
|
|
65
47
|
accept: 'application/json;odata=nometadata'
|
|
66
48
|
},
|
|
67
|
-
responseType: 'json'
|
|
49
|
+
responseType: 'json',
|
|
50
|
+
data: {
|
|
51
|
+
srcPath: {
|
|
52
|
+
DecodedUrl: sourcePath
|
|
53
|
+
},
|
|
54
|
+
destPath: {
|
|
55
|
+
DecodedUrl: destinationPath
|
|
56
|
+
},
|
|
57
|
+
overwrite: args.options.nameConflictBehavior === 'replace',
|
|
58
|
+
options: {
|
|
59
|
+
KeepBoth: args.options.nameConflictBehavior === 'rename',
|
|
60
|
+
ResetAuthorAndCreatedOnCopy: !!args.options.resetAuthorAndCreated,
|
|
61
|
+
ShouldBypassSharedLocks: !!args.options.bypassSharedLock
|
|
62
|
+
}
|
|
63
|
+
}
|
|
68
64
|
};
|
|
69
|
-
|
|
70
|
-
await logger.log(destinationFile);
|
|
65
|
+
await request.post(requestOptions);
|
|
71
66
|
}
|
|
72
67
|
catch (err) {
|
|
73
68
|
this.handleRejectedODataJsonPromise(err);
|
|
@@ -81,30 +76,17 @@ class SpoFileCopyCommand extends SpoCommand {
|
|
|
81
76
|
await logger.logToStderr(`Retrieving server-relative path for file with ID '${options.sourceId}'...`);
|
|
82
77
|
}
|
|
83
78
|
const requestOptions = {
|
|
84
|
-
url: `${options.webUrl}/_api/Web/GetFileById('${options.sourceId}')
|
|
79
|
+
url: `${options.webUrl}/_api/Web/GetFileById('${options.sourceId}')?$select=ServerRelativePath`,
|
|
85
80
|
headers: {
|
|
86
81
|
accept: 'application/json;odata=nometadata'
|
|
87
82
|
},
|
|
88
83
|
responseType: 'json'
|
|
89
84
|
};
|
|
90
85
|
const file = await request.get(requestOptions);
|
|
91
|
-
return file.DecodedUrl;
|
|
92
|
-
}
|
|
93
|
-
getNameConflictBehaviorValue(nameConflictBehavior) {
|
|
94
|
-
switch (nameConflictBehavior?.toLowerCase()) {
|
|
95
|
-
case 'fail':
|
|
96
|
-
return CreateCopyJobsNameConflictBehavior.Fail;
|
|
97
|
-
case 'replace':
|
|
98
|
-
return CreateCopyJobsNameConflictBehavior.Replace;
|
|
99
|
-
case 'rename':
|
|
100
|
-
return CreateCopyJobsNameConflictBehavior.Rename;
|
|
101
|
-
default:
|
|
102
|
-
return CreateCopyJobsNameConflictBehavior.Fail;
|
|
103
|
-
}
|
|
86
|
+
return file.ServerRelativePath.DecodedUrl;
|
|
104
87
|
}
|
|
105
88
|
getAbsoluteUrl(webUrl, url) {
|
|
106
|
-
|
|
107
|
-
return urlUtil.removeTrailingSlashes(result);
|
|
89
|
+
return url.startsWith('https://') ? url : urlUtil.getAbsoluteUrl(webUrl, url);
|
|
108
90
|
}
|
|
109
91
|
}
|
|
110
92
|
_SpoFileCopyCommand_instances = new WeakSet(), _SpoFileCopyCommand_initTelemetry = function _SpoFileCopyCommand_initTelemetry() {
|
|
@@ -113,10 +95,9 @@ _SpoFileCopyCommand_instances = new WeakSet(), _SpoFileCopyCommand_initTelemetry
|
|
|
113
95
|
sourceUrl: typeof args.options.sourceUrl !== 'undefined',
|
|
114
96
|
sourceId: typeof args.options.sourceId !== 'undefined',
|
|
115
97
|
newName: typeof args.options.newName !== 'undefined',
|
|
116
|
-
nameConflictBehavior:
|
|
117
|
-
|
|
118
|
-
bypassSharedLock: !!args.options.bypassSharedLock
|
|
119
|
-
skipWait: !!args.options.skipWait
|
|
98
|
+
nameConflictBehavior: args.options.nameConflictBehavior || false,
|
|
99
|
+
resetAuthorAndCreated: !!args.options.resetAuthorAndCreated,
|
|
100
|
+
bypassSharedLock: !!args.options.bypassSharedLock
|
|
120
101
|
});
|
|
121
102
|
});
|
|
122
103
|
}, _SpoFileCopyCommand_initOptions = function _SpoFileCopyCommand_initOptions() {
|
|
@@ -134,11 +115,9 @@ _SpoFileCopyCommand_instances = new WeakSet(), _SpoFileCopyCommand_initTelemetry
|
|
|
134
115
|
option: '--nameConflictBehavior [nameConflictBehavior]',
|
|
135
116
|
autocomplete: this.nameConflictBehaviorOptions
|
|
136
117
|
}, {
|
|
137
|
-
option: '--
|
|
138
|
-
}, {
|
|
139
|
-
option: '--ignoreVersionHistory'
|
|
118
|
+
option: '--resetAuthorAndCreated'
|
|
140
119
|
}, {
|
|
141
|
-
option: '--
|
|
120
|
+
option: '--bypassSharedLock'
|
|
142
121
|
});
|
|
143
122
|
}, _SpoFileCopyCommand_initValidators = function _SpoFileCopyCommand_initValidators() {
|
|
144
123
|
this.validators.push(async (args) => {
|
|
@@ -149,7 +128,7 @@ _SpoFileCopyCommand_instances = new WeakSet(), _SpoFileCopyCommand_initTelemetry
|
|
|
149
128
|
if (args.options.sourceId && !validation.isValidGuid(args.options.sourceId)) {
|
|
150
129
|
return `${args.options.sourceId} is not a valid GUID for sourceId.`;
|
|
151
130
|
}
|
|
152
|
-
if (args.options.nameConflictBehavior &&
|
|
131
|
+
if (args.options.nameConflictBehavior && this.nameConflictBehaviorOptions.indexOf(args.options.nameConflictBehavior) === -1) {
|
|
153
132
|
return `${args.options.nameConflictBehavior} is not a valid nameConflictBehavior value. Allowed values: ${this.nameConflictBehaviorOptions.join(', ')}.`;
|
|
154
133
|
}
|
|
155
134
|
return true;
|
|
@@ -158,7 +137,7 @@ _SpoFileCopyCommand_instances = new WeakSet(), _SpoFileCopyCommand_initTelemetry
|
|
|
158
137
|
this.optionSets.push({ options: ['sourceUrl', 'sourceId'] });
|
|
159
138
|
}, _SpoFileCopyCommand_initTypes = function _SpoFileCopyCommand_initTypes() {
|
|
160
139
|
this.types.string.push('webUrl', 'sourceUrl', 'sourceId', 'targetUrl', 'newName', 'nameConflictBehavior');
|
|
161
|
-
this.types.boolean.push('
|
|
140
|
+
this.types.boolean.push('resetAuthorAndCreated', 'bypassSharedLock');
|
|
162
141
|
};
|
|
163
142
|
export default new SpoFileCopyCommand();
|
|
164
143
|
//# sourceMappingURL=file-copy.js.map
|