@pnp/cli-microsoft365 7.0.0-beta.99e75a7 → 7.0.0-beta.aa2d71e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +0 -2
- package/dist/GlobalOptions.js +1 -7
- package/dist/cli/Cli.js +19 -2
- package/dist/m365/aad/commands/app/app-add.js +8 -8
- package/dist/m365/aad/commands/app/app-role-add.js +5 -5
- package/dist/m365/aad/commands/app/app-set.js +5 -5
- package/dist/m365/aad/commands/policy/policy-list.js +5 -5
- package/dist/m365/cli/commands/cli-issue.js +5 -5
- package/dist/m365/cli/commands/config/config-get.js +5 -5
- package/dist/m365/cli/commands/config/config-reset.js +5 -5
- package/dist/m365/cli/commands/config/config-set.js +5 -5
- package/dist/m365/commands/login.js +5 -5
- package/dist/m365/commands/request.js +1 -1
- package/dist/m365/flow/commands/owner/owner-ensure.js +5 -5
- package/dist/m365/pa/commands/app/app-owner-set.js +5 -5
- package/dist/m365/pa/commands/app/app-permission-ensure.js +5 -5
- package/dist/m365/pa/commands.js +1 -4
- package/dist/m365/planner/commands/task/task-add.js +17 -11
- package/dist/m365/planner/commands/task/task-get.js +35 -25
- package/dist/m365/planner/commands/task/task-list.js +26 -19
- package/dist/m365/planner/commands/task/task-remove.js +39 -34
- package/dist/m365/planner/commands/task/task-set.js +35 -23
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-add.js +14 -14
- package/dist/m365/spfx/commands/package/package-generate.js +15 -15
- package/dist/m365/spfx/commands/project/DeployWorkflow.js +55 -0
- package/dist/m365/spfx/commands/project/project-doctor/{doctor-1.18.0-beta.1.js → doctor-1.18.0-beta.5.js} +1 -1
- package/dist/m365/spfx/commands/project/project-doctor.js +9 -9
- package/dist/m365/spfx/commands/project/project-github-workflow-add.js +157 -0
- package/dist/m365/spfx/commands/project/project-github-workflow-model.js +2 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.15.2.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/{upgrade-1.18.0-beta.1.js → upgrade-1.18.0-beta.5.js} +26 -26
- package/dist/m365/spfx/commands/project/project-upgrade.js +14 -14
- package/dist/m365/spfx/commands/spfx-doctor.js +3 -3
- package/dist/m365/spfx/commands.js +1 -0
- package/dist/m365/spo/commands/app/SpoAppBaseCommand.js +27 -26
- package/dist/m365/spo/commands/app/app-add.js +9 -9
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-add.js +5 -5
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-list.js +5 -5
- package/dist/m365/spo/commands/commandset/commandset-add.js +11 -11
- package/dist/m365/spo/commands/commandset/commandset-get.js +8 -8
- package/dist/m365/spo/commands/commandset/commandset-list.js +5 -5
- package/dist/m365/spo/commands/commandset/commandset-remove.js +5 -5
- package/dist/m365/spo/commands/commandset/commandset-set.js +11 -11
- package/dist/m365/spo/commands/file/file-move.js +73 -97
- package/dist/m365/spo/commands/file/file-sharinglink-add.js +8 -8
- package/dist/m365/spo/commands/file/file-sharinglink-list.js +5 -5
- package/dist/m365/spo/commands/folder/folder-copy.js +89 -45
- package/dist/m365/spo/commands/folder/folder-move.js +89 -47
- package/dist/m365/spo/commands/list/list-add.js +4 -4
- package/dist/m365/spo/commands/list/list-set.js +4 -4
- package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-add.js +34 -5
- package/dist/m365/spo/commands/page/clientsidepages.js +1 -81
- package/dist/m365/spo/commands/propertybag/propertybag-base.js +63 -59
- package/dist/m365/spo/commands/propertybag/propertybag-remove.js +28 -31
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-set.js +30 -32
- package/dist/m365/spo/commands/site/FlowsPolicy.js +7 -0
- package/dist/m365/spo/commands/site/site-add.js +114 -161
- package/dist/m365/spo/commands/site/site-apppermission-add.js +15 -18
- package/dist/m365/spo/commands/site/site-apppermission-remove.js +34 -38
- package/dist/m365/spo/commands/site/site-apppermission-set.js +11 -14
- package/dist/m365/spo/commands/site/site-ensure.js +14 -67
- package/dist/m365/spo/commands/site/site-hubsite-disconnect.js +22 -22
- package/dist/m365/spo/commands/site/site-list.js +27 -43
- package/dist/m365/spo/commands/site/site-recyclebinitem-list.js +6 -6
- package/dist/m365/spo/commands/site/site-remove.js +166 -210
- package/dist/m365/spo/commands/site/site-set.js +177 -198
- package/dist/m365/spo/commands/tenant/tenant-commandset-add.js +8 -8
- package/dist/m365/spo/commands/tenant/tenant-commandset-set.js +8 -8
- package/dist/m365/spo/commands/tenant/tenant-settings-set.js +4 -4
- package/dist/m365/spo/commands/theme/theme-remove.js +24 -24
- package/dist/m365/spo/commands/theme/theme-set.js +0 -1
- package/dist/m365/spo/commands/user/user-remove.js +27 -27
- package/dist/m365/spo/commands/web/web-reindex.js +35 -42
- package/dist/m365/spo/commands/web/web-remove.js +21 -21
- package/dist/m365/spo/commands/web/web-roleassignment-add.js +16 -31
- package/dist/m365/spo/commands/web/web-roleassignment-remove.js +33 -44
- package/dist/m365/spo/commands/web/web-roleinheritance-break.js +18 -18
- package/dist/m365/spo/commands/web/web-roleinheritance-reset.js +19 -19
- package/dist/m365/spo/commands/web/web-set.js +5 -5
- package/dist/m365/teams/commands/app/app-list.js +5 -5
- package/dist/m365/teams/commands/chat/chat-member-add.js +5 -5
- package/dist/m365/teams/commands/funsettings/funsettings-set.js +4 -4
- package/dist/m365/teams/commands/guestsettings/guestsettings-set.js +4 -4
- package/dist/m365/teams/commands/membersettings/membersettings-set.js +4 -4
- package/dist/m365/teams/commands/messagingsettings/messagingsettings-set.js +5 -5
- package/dist/m365/teams/commands/team/team-set.js +3 -3
- package/dist/m365/todo/commands/task/task-add.js +6 -6
- package/dist/m365/yammer/commands/message/message-like-set.js +27 -28
- package/dist/m365/yammer/commands/message/message-list.js +67 -86
- package/dist/m365/yammer/commands/message/message-remove.js +18 -18
- package/dist/m365/yammer/commands/yammer-search.js +58 -74
- package/dist/utils/aadGroup.js +18 -0
- package/dist/utils/fsUtil.js +5 -0
- package/dist/utils/spo.js +594 -53
- package/dist/utils/validation.js +0 -3
- package/docs/docs/cmd/planner/task/task-add.mdx +22 -7
- package/docs/docs/cmd/planner/task/task-get.mdx +13 -4
- package/docs/docs/cmd/planner/task/task-list.mdx +22 -7
- package/docs/docs/cmd/planner/task/task-remove.mdx +25 -8
- package/docs/docs/cmd/planner/task/task-set.mdx +22 -7
- package/docs/docs/cmd/spfx/project/project-github-workflow-add.mdx +94 -0
- package/docs/docs/cmd/spo/file/file-move.mdx +36 -18
- package/docs/docs/cmd/spo/folder/folder-copy.mdx +39 -12
- package/docs/docs/cmd/spo/folder/folder-move.mdx +40 -13
- package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-add.mdx +14 -1
- package/docs/docs/cmd/spo/site/site-ensure.mdx +1 -1
- package/docs/docs/cmd/spo/site/site-list.mdx +3 -78
- package/npm-shrinkwrap.json +240 -1417
- package/package.json +6 -7
- package/dist/m365/pa/cds-project-mutator.js +0 -91
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/dataset-template/generated/ManifestTypes.d.ts +0 -11
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/dataset-template/template_ControlManifest.Input.xml +0 -31
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/dataset-template/template_index.ts +0 -51
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/field-template/generated/ManifestTypes.d.ts +0 -12
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/field-template/template_ControlManifest.Input.xml +0 -37
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/field-template/template_index.ts +0 -48
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/index.ts +0 -0
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/virtual-dataset-template/template_ControlManifest.Input.xml +0 -31
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/virtual-dataset-template/template_index.tsx +0 -58
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/virtual-field-template/template_ControlManifest.Input.xml +0 -37
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/virtual-field-template/template_index.tsx +0 -55
- package/dist/m365/pa/commands/pcf/pcf-init/assets/package.json +0 -19
- package/dist/m365/pa/commands/pcf/pcf-init/assets/pcfconfig.json +0 -3
- package/dist/m365/pa/commands/pcf/pcf-init/assets/template_.gitignore +0 -14
- package/dist/m365/pa/commands/pcf/pcf-init/assets/template_pcfprojecttype.pcfproj +0 -45
- package/dist/m365/pa/commands/pcf/pcf-init/pcf-init-variables.js +0 -2
- package/dist/m365/pa/commands/pcf/pcf-init.js +0 -120
- package/dist/m365/pa/commands/solution/solution-init/assets/Other/Customizations.xml +0 -18
- package/dist/m365/pa/commands/solution/solution-init/assets/Other/Relationships.xml +0 -2
- package/dist/m365/pa/commands/solution/solution-init/assets/Other/template_Solution.xml +0 -94
- package/dist/m365/pa/commands/solution/solution-init/assets/template_.gitignore +0 -2
- package/dist/m365/pa/commands/solution/solution-init/assets/template_solutionprojecttype.cdsproj +0 -44
- package/dist/m365/pa/commands/solution/solution-init/solution-init-variables.js +0 -2
- package/dist/m365/pa/commands/solution/solution-init.js +0 -126
- package/dist/m365/pa/commands/solution/solution-reference-add.js +0 -88
- package/dist/m365/pa/template-instantiator.js +0 -57
- package/docs/docs/cmd/pa/pcf/pcf-init.mdx +0 -56
- package/docs/docs/cmd/pa/solution/solution-init.mdx +0 -46
- package/docs/docs/cmd/pa/solution/solution-reference-add.mdx +0 -42
|
@@ -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 _SpoCommandSetAddCommand_instances, _SpoCommandSetAddCommand_initTelemetry, _SpoCommandSetAddCommand_initOptions, _SpoCommandSetAddCommand_initValidators;
|
|
6
|
+
var _SpoCommandSetAddCommand_instances, _a, _SpoCommandSetAddCommand_initTelemetry, _SpoCommandSetAddCommand_initOptions, _SpoCommandSetAddCommand_initValidators;
|
|
7
7
|
import commands from '../../commands.js';
|
|
8
8
|
import { validation } from '../../../../utils/validation.js';
|
|
9
9
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
@@ -78,7 +78,7 @@ class SpoCommandSetAddCommand extends SpoCommand {
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
_SpoCommandSetAddCommand_instances = new WeakSet(), _SpoCommandSetAddCommand_initTelemetry = function _SpoCommandSetAddCommand_initTelemetry() {
|
|
81
|
+
_a = SpoCommandSetAddCommand, _SpoCommandSetAddCommand_instances = new WeakSet(), _SpoCommandSetAddCommand_initTelemetry = function _SpoCommandSetAddCommand_initTelemetry() {
|
|
82
82
|
this.telemetry.push((args) => {
|
|
83
83
|
Object.assign(this.telemetryProperties, {
|
|
84
84
|
clientSideComponentProperties: typeof args.options.clientSideComponentProperties !== 'undefined',
|
|
@@ -92,29 +92,29 @@ _SpoCommandSetAddCommand_instances = new WeakSet(), _SpoCommandSetAddCommand_ini
|
|
|
92
92
|
}, {
|
|
93
93
|
option: '-u, --webUrl <webUrl>'
|
|
94
94
|
}, {
|
|
95
|
-
option: '-l, --listType <listType>', autocomplete:
|
|
95
|
+
option: '-l, --listType <listType>', autocomplete: _a.listTypes
|
|
96
96
|
}, {
|
|
97
97
|
option: '-i, --clientSideComponentId <clientSideComponentId>'
|
|
98
98
|
}, {
|
|
99
99
|
option: '--clientSideComponentProperties [clientSideComponentProperties]'
|
|
100
100
|
}, {
|
|
101
|
-
option: '-s, --scope [scope]', autocomplete:
|
|
101
|
+
option: '-s, --scope [scope]', autocomplete: _a.scopes
|
|
102
102
|
}, {
|
|
103
|
-
option: '--location [location]', autocomplete:
|
|
103
|
+
option: '--location [location]', autocomplete: _a.locations
|
|
104
104
|
});
|
|
105
105
|
}, _SpoCommandSetAddCommand_initValidators = function _SpoCommandSetAddCommand_initValidators() {
|
|
106
106
|
this.validators.push(async (args) => {
|
|
107
107
|
if (args.options.clientSideComponentId && !validation.isValidGuid(args.options.clientSideComponentId)) {
|
|
108
108
|
return `${args.options.clientSideComponentId} is not a valid GUID`;
|
|
109
109
|
}
|
|
110
|
-
if (
|
|
111
|
-
return `${args.options.listType} is not a valid list type. Allowed values are ${
|
|
110
|
+
if (_a.listTypes.indexOf(args.options.listType) < 0) {
|
|
111
|
+
return `${args.options.listType} is not a valid list type. Allowed values are ${_a.listTypes.join(', ')}`;
|
|
112
112
|
}
|
|
113
|
-
if (args.options.scope &&
|
|
114
|
-
return `${args.options.scope} is not a valid scope. Allowed values are ${
|
|
113
|
+
if (args.options.scope && _a.scopes.indexOf(args.options.scope) < 0) {
|
|
114
|
+
return `${args.options.scope} is not a valid scope. Allowed values are ${_a.scopes.join(', ')}`;
|
|
115
115
|
}
|
|
116
|
-
if (args.options.location &&
|
|
117
|
-
return `${args.options.location} is not a valid location. Allowed values are ${
|
|
116
|
+
if (args.options.location && _a.locations.indexOf(args.options.location) < 0) {
|
|
117
|
+
return `${args.options.location} is not a valid location. Allowed values are ${_a.locations.join(', ')}`;
|
|
118
118
|
}
|
|
119
119
|
return validation.isValidSharePointUrl(args.options.webUrl);
|
|
120
120
|
});
|
|
@@ -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 _SpoCommandSetGetCommand_instances, _SpoCommandSetGetCommand_initTelemetry, _SpoCommandSetGetCommand_initOptions, _SpoCommandSetGetCommand_initValidators, _SpoCommandSetGetCommand_initOptionSets;
|
|
6
|
+
var _SpoCommandSetGetCommand_instances, _a, _SpoCommandSetGetCommand_initTelemetry, _SpoCommandSetGetCommand_initOptions, _SpoCommandSetGetCommand_initValidators, _SpoCommandSetGetCommand_initOptionSets;
|
|
7
7
|
import os from 'os';
|
|
8
8
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
9
|
import { spo } from '../../../../utils/spo.js';
|
|
@@ -35,7 +35,7 @@ class SpoCommandSetGetCommand extends SpoCommand {
|
|
|
35
35
|
if (commandSet === undefined) {
|
|
36
36
|
throw `Command set with id ${args.options.id} can't be found.`;
|
|
37
37
|
}
|
|
38
|
-
else if (!
|
|
38
|
+
else if (!_a.allowedCommandSetLocations.some(allowedLocation => allowedLocation === commandSet.Location)) {
|
|
39
39
|
throw `Custom action with id ${args.options.id} is not a command set.`;
|
|
40
40
|
}
|
|
41
41
|
await logger.log(commandSet);
|
|
@@ -67,10 +67,10 @@ class SpoCommandSetGetCommand extends SpoCommand {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
getBaseFilter() {
|
|
70
|
-
return `startswith(Location,'${
|
|
70
|
+
return `startswith(Location,'${_a.baseLocation}') and`;
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
_SpoCommandSetGetCommand_instances = new WeakSet(), _SpoCommandSetGetCommand_initTelemetry = function _SpoCommandSetGetCommand_initTelemetry() {
|
|
73
|
+
_a = SpoCommandSetGetCommand, _SpoCommandSetGetCommand_instances = new WeakSet(), _SpoCommandSetGetCommand_initTelemetry = function _SpoCommandSetGetCommand_initTelemetry() {
|
|
74
74
|
this.telemetry.push((args) => {
|
|
75
75
|
Object.assign(this.telemetryProperties, {
|
|
76
76
|
title: typeof args.options.title !== 'undefined',
|
|
@@ -90,7 +90,7 @@ _SpoCommandSetGetCommand_instances = new WeakSet(), _SpoCommandSetGetCommand_ini
|
|
|
90
90
|
option: '-c, --clientSideComponentId [clientSideComponentId]'
|
|
91
91
|
}, {
|
|
92
92
|
option: '-s, --scope [scope]',
|
|
93
|
-
autocomplete:
|
|
93
|
+
autocomplete: _a.scopes
|
|
94
94
|
});
|
|
95
95
|
}, _SpoCommandSetGetCommand_initValidators = function _SpoCommandSetGetCommand_initValidators() {
|
|
96
96
|
this.validators.push(async (args) => {
|
|
@@ -100,8 +100,8 @@ _SpoCommandSetGetCommand_instances = new WeakSet(), _SpoCommandSetGetCommand_ini
|
|
|
100
100
|
if (args.options.clientSideComponentId && !validation.isValidGuid(args.options.clientSideComponentId)) {
|
|
101
101
|
return `${args.options.clientSideComponentId} is not a valid GUID.`;
|
|
102
102
|
}
|
|
103
|
-
if (args.options.scope &&
|
|
104
|
-
return `${args.options.scope} is not a valid scope. Valid scopes are ${
|
|
103
|
+
if (args.options.scope && _a.scopes.indexOf(args.options.scope) < 0) {
|
|
104
|
+
return `${args.options.scope} is not a valid scope. Valid scopes are ${_a.scopes.join(', ')}`;
|
|
105
105
|
}
|
|
106
106
|
return validation.isValidSharePointUrl(args.options.webUrl);
|
|
107
107
|
});
|
|
@@ -110,6 +110,6 @@ _SpoCommandSetGetCommand_instances = new WeakSet(), _SpoCommandSetGetCommand_ini
|
|
|
110
110
|
};
|
|
111
111
|
SpoCommandSetGetCommand.scopes = ['All', 'Site', 'Web'];
|
|
112
112
|
SpoCommandSetGetCommand.baseLocation = 'ClientSideExtension.ListViewCommandSet';
|
|
113
|
-
SpoCommandSetGetCommand.allowedCommandSetLocations = [
|
|
113
|
+
SpoCommandSetGetCommand.allowedCommandSetLocations = [_a.baseLocation, `${_a.baseLocation}.CommandBar`, `${_a.baseLocation}.ContextMenu`];
|
|
114
114
|
export default new SpoCommandSetGetCommand();
|
|
115
115
|
//# sourceMappingURL=commandset-get.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 _SpoCommandSetListCommand_instances, _SpoCommandSetListCommand_initTelemetry, _SpoCommandSetListCommand_initOptions, _SpoCommandSetListCommand_initValidators;
|
|
6
|
+
var _SpoCommandSetListCommand_instances, _a, _SpoCommandSetListCommand_initTelemetry, _SpoCommandSetListCommand_initOptions, _SpoCommandSetListCommand_initValidators;
|
|
7
7
|
import { spo } from '../../../../utils/spo.js';
|
|
8
8
|
import { validation } from '../../../../utils/validation.js';
|
|
9
9
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
@@ -38,7 +38,7 @@ class SpoCommandSetListCommand extends SpoCommand {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
_SpoCommandSetListCommand_instances = new WeakSet(), _SpoCommandSetListCommand_initTelemetry = function _SpoCommandSetListCommand_initTelemetry() {
|
|
41
|
+
_a = SpoCommandSetListCommand, _SpoCommandSetListCommand_instances = new WeakSet(), _SpoCommandSetListCommand_initTelemetry = function _SpoCommandSetListCommand_initTelemetry() {
|
|
42
42
|
this.telemetry.push((args) => {
|
|
43
43
|
Object.assign(this.telemetryProperties, {
|
|
44
44
|
scope: args.options.scope || 'All'
|
|
@@ -49,12 +49,12 @@ _SpoCommandSetListCommand_instances = new WeakSet(), _SpoCommandSetListCommand_i
|
|
|
49
49
|
option: '-u, --webUrl <webUrl>'
|
|
50
50
|
}, {
|
|
51
51
|
option: '-s, --scope [scope]',
|
|
52
|
-
autocomplete:
|
|
52
|
+
autocomplete: _a.scopes
|
|
53
53
|
});
|
|
54
54
|
}, _SpoCommandSetListCommand_initValidators = function _SpoCommandSetListCommand_initValidators() {
|
|
55
55
|
this.validators.push(async (args) => {
|
|
56
|
-
if (args.options.scope &&
|
|
57
|
-
return `${args.options.scope} is not a valid scope. Valid scopes are ${
|
|
56
|
+
if (args.options.scope && _a.scopes.indexOf(args.options.scope) < 0) {
|
|
57
|
+
return `${args.options.scope} is not a valid scope. Valid scopes are ${_a.scopes.join(', ')}`;
|
|
58
58
|
}
|
|
59
59
|
return validation.isValidSharePointUrl(args.options.webUrl);
|
|
60
60
|
});
|
|
@@ -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 _SpoCommandSetRemoveCommand_instances, _SpoCommandSetRemoveCommand_initTelemetry, _SpoCommandSetRemoveCommand_initOptions, _SpoCommandSetRemoveCommand_initValidators, _SpoCommandSetRemoveCommand_initOptionSets;
|
|
6
|
+
var _SpoCommandSetRemoveCommand_instances, _a, _SpoCommandSetRemoveCommand_initTelemetry, _SpoCommandSetRemoveCommand_initOptions, _SpoCommandSetRemoveCommand_initValidators, _SpoCommandSetRemoveCommand_initOptionSets;
|
|
7
7
|
import commands from '../../commands.js';
|
|
8
8
|
import { validation } from '../../../../utils/validation.js';
|
|
9
9
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
@@ -87,7 +87,7 @@ class SpoCommandSetRemoveCommand extends SpoCommand {
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
_SpoCommandSetRemoveCommand_instances = new WeakSet(), _SpoCommandSetRemoveCommand_initTelemetry = function _SpoCommandSetRemoveCommand_initTelemetry() {
|
|
90
|
+
_a = SpoCommandSetRemoveCommand, _SpoCommandSetRemoveCommand_instances = new WeakSet(), _SpoCommandSetRemoveCommand_initTelemetry = function _SpoCommandSetRemoveCommand_initTelemetry() {
|
|
91
91
|
this.telemetry.push((args) => {
|
|
92
92
|
Object.assign(this.telemetryProperties, {
|
|
93
93
|
title: typeof args.options.title !== 'undefined',
|
|
@@ -107,7 +107,7 @@ _SpoCommandSetRemoveCommand_instances = new WeakSet(), _SpoCommandSetRemoveComma
|
|
|
107
107
|
}, {
|
|
108
108
|
option: '-c, --clientSideComponentId [clientSideComponentId]'
|
|
109
109
|
}, {
|
|
110
|
-
option: '-s, --scope [scope]', autocomplete:
|
|
110
|
+
option: '-s, --scope [scope]', autocomplete: _a.scopes
|
|
111
111
|
}, {
|
|
112
112
|
option: '-f, --force'
|
|
113
113
|
});
|
|
@@ -119,8 +119,8 @@ _SpoCommandSetRemoveCommand_instances = new WeakSet(), _SpoCommandSetRemoveComma
|
|
|
119
119
|
if (args.options.clientSideComponentId && !validation.isValidGuid(args.options.clientSideComponentId)) {
|
|
120
120
|
return `${args.options.clientSideComponentId} is not a valid GUID`;
|
|
121
121
|
}
|
|
122
|
-
if (args.options.scope &&
|
|
123
|
-
return `${args.options.scope} is not a valid scope. Allowed values are ${
|
|
122
|
+
if (args.options.scope && _a.scopes.indexOf(args.options.scope) < 0) {
|
|
123
|
+
return `${args.options.scope} is not a valid scope. Allowed values are ${_a.scopes.join(', ')}`;
|
|
124
124
|
}
|
|
125
125
|
return validation.isValidSharePointUrl(args.options.webUrl);
|
|
126
126
|
});
|
|
@@ -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 _SpoCommandSetSetCommand_instances, _SpoCommandSetSetCommand_initTelemetry, _SpoCommandSetSetCommand_initOptions, _SpoCommandSetSetCommand_initValidators, _SpoCommandSetSetCommand_initOptionSets;
|
|
6
|
+
var _SpoCommandSetSetCommand_instances, _a, _SpoCommandSetSetCommand_initTelemetry, _SpoCommandSetSetCommand_initOptions, _SpoCommandSetSetCommand_initValidators, _SpoCommandSetSetCommand_initOptionSets;
|
|
7
7
|
import commands from '../../commands.js';
|
|
8
8
|
import { validation } from '../../../../utils/validation.js';
|
|
9
9
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
@@ -109,7 +109,7 @@ class SpoCommandSetSetCommand extends SpoCommand {
|
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
-
_SpoCommandSetSetCommand_instances = new WeakSet(), _SpoCommandSetSetCommand_initTelemetry = function _SpoCommandSetSetCommand_initTelemetry() {
|
|
112
|
+
_a = SpoCommandSetSetCommand, _SpoCommandSetSetCommand_instances = new WeakSet(), _SpoCommandSetSetCommand_initTelemetry = function _SpoCommandSetSetCommand_initTelemetry() {
|
|
113
113
|
this.telemetry.push((args) => {
|
|
114
114
|
Object.assign(this.telemetryProperties, {
|
|
115
115
|
title: typeof args.options.title !== 'undefined',
|
|
@@ -136,13 +136,13 @@ _SpoCommandSetSetCommand_instances = new WeakSet(), _SpoCommandSetSetCommand_ini
|
|
|
136
136
|
}, {
|
|
137
137
|
option: '--newTitle [newTitle]'
|
|
138
138
|
}, {
|
|
139
|
-
option: '-l, --listType [listType]', autocomplete:
|
|
139
|
+
option: '-l, --listType [listType]', autocomplete: _a.listTypes
|
|
140
140
|
}, {
|
|
141
141
|
option: '--clientSideComponentProperties [clientSideComponentProperties]'
|
|
142
142
|
}, {
|
|
143
|
-
option: '-s, --scope [scope]', autocomplete:
|
|
143
|
+
option: '-s, --scope [scope]', autocomplete: _a.scopes
|
|
144
144
|
}, {
|
|
145
|
-
option: '--location [location]', autocomplete:
|
|
145
|
+
option: '--location [location]', autocomplete: _a.locations
|
|
146
146
|
});
|
|
147
147
|
}, _SpoCommandSetSetCommand_initValidators = function _SpoCommandSetSetCommand_initValidators() {
|
|
148
148
|
this.validators.push(async (args) => {
|
|
@@ -155,14 +155,14 @@ _SpoCommandSetSetCommand_instances = new WeakSet(), _SpoCommandSetSetCommand_ini
|
|
|
155
155
|
if (args.options.newClientSideComponentId && !validation.isValidGuid(args.options.newClientSideComponentId)) {
|
|
156
156
|
return `${args.options.newClientSideComponentId} is not a valid GUID`;
|
|
157
157
|
}
|
|
158
|
-
if (args.options.listType &&
|
|
159
|
-
return `${args.options.listType} is not a valid list type. Allowed values are ${
|
|
158
|
+
if (args.options.listType && _a.listTypes.indexOf(args.options.listType) < 0) {
|
|
159
|
+
return `${args.options.listType} is not a valid list type. Allowed values are ${_a.listTypes.join(', ')}`;
|
|
160
160
|
}
|
|
161
|
-
if (args.options.scope &&
|
|
162
|
-
return `${args.options.scope} is not a valid scope. Allowed values are ${
|
|
161
|
+
if (args.options.scope && _a.scopes.indexOf(args.options.scope) < 0) {
|
|
162
|
+
return `${args.options.scope} is not a valid scope. Allowed values are ${_a.scopes.join(', ')}`;
|
|
163
163
|
}
|
|
164
|
-
if (args.options.location &&
|
|
165
|
-
return `${args.options.location} is not a valid location. Allowed values are ${
|
|
164
|
+
if (args.options.location && _a.locations.indexOf(args.options.location) < 0) {
|
|
165
|
+
return `${args.options.location} is not a valid location. Allowed values are ${_a.locations.join(', ')}`;
|
|
166
166
|
}
|
|
167
167
|
if (!args.options.newTitle && !args.options.listType && !args.options.clientSideComponentProperties && !args.options.location && !args.options.newClientSideComponentId) {
|
|
168
168
|
return `Please specify option to be updated`;
|
|
@@ -3,17 +3,12 @@ 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 _SpoFileMoveCommand_instances, _SpoFileMoveCommand_initTelemetry, _SpoFileMoveCommand_initOptions, _SpoFileMoveCommand_initValidators;
|
|
7
|
-
import url from 'url';
|
|
8
|
-
import { Cli } from '../../../../cli/Cli.js';
|
|
6
|
+
var _SpoFileMoveCommand_instances, _SpoFileMoveCommand_initTelemetry, _SpoFileMoveCommand_initOptions, _SpoFileMoveCommand_initValidators, _SpoFileMoveCommand_initOptionSets;
|
|
9
7
|
import request from '../../../../request.js';
|
|
10
|
-
import { formatting } from '../../../../utils/formatting.js';
|
|
11
|
-
import { spo } from '../../../../utils/spo.js';
|
|
12
8
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
13
9
|
import { validation } from '../../../../utils/validation.js';
|
|
14
10
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
15
11
|
import commands from '../../commands.js';
|
|
16
|
-
import removeCommand from './file-remove.js';
|
|
17
12
|
class SpoFileMoveCommand extends SpoCommand {
|
|
18
13
|
get name() {
|
|
19
14
|
return commands.FILE_MOVE;
|
|
@@ -24,143 +19,124 @@ class SpoFileMoveCommand extends SpoCommand {
|
|
|
24
19
|
constructor() {
|
|
25
20
|
super();
|
|
26
21
|
_SpoFileMoveCommand_instances.add(this);
|
|
22
|
+
this.nameConflictBehaviorOptions = ['fail', 'replace', 'rename'];
|
|
27
23
|
__classPrivateFieldGet(this, _SpoFileMoveCommand_instances, "m", _SpoFileMoveCommand_initTelemetry).call(this);
|
|
28
24
|
__classPrivateFieldGet(this, _SpoFileMoveCommand_instances, "m", _SpoFileMoveCommand_initOptions).call(this);
|
|
29
25
|
__classPrivateFieldGet(this, _SpoFileMoveCommand_instances, "m", _SpoFileMoveCommand_initValidators).call(this);
|
|
26
|
+
__classPrivateFieldGet(this, _SpoFileMoveCommand_instances, "m", _SpoFileMoveCommand_initOptionSets).call(this);
|
|
30
27
|
}
|
|
31
28
|
getExcludedOptionsWithUrls() {
|
|
32
29
|
return ['targetUrl', 'sourceUrl'];
|
|
33
30
|
}
|
|
34
31
|
async commandAction(logger, args) {
|
|
35
|
-
const webUrl = args.options.webUrl;
|
|
36
|
-
const parsedUrl = url.parse(webUrl);
|
|
37
|
-
const tenantUrl = `${parsedUrl.protocol}//${parsedUrl.hostname}`;
|
|
38
32
|
try {
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
//
|
|
50
|
-
|
|
51
|
-
await this.recycleFile(tenantUrl, args.options.targetUrl, filename, logger);
|
|
33
|
+
const sourcePath = await this.getSourcePath(logger, args.options);
|
|
34
|
+
if (this.verbose) {
|
|
35
|
+
await logger.logToStderr(`Moving file ${sourcePath} to ${args.options.targetUrl}...`);
|
|
36
|
+
}
|
|
37
|
+
const absoluteSourcePath = this.getAbsoluteUrl(args.options.webUrl, sourcePath);
|
|
38
|
+
let absoluteTargetPath = this.getAbsoluteUrl(args.options.webUrl, args.options.targetUrl) + '/';
|
|
39
|
+
if (args.options.newName) {
|
|
40
|
+
absoluteTargetPath += args.options.newName;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
// Keep the original file name
|
|
44
|
+
absoluteTargetPath += sourcePath.substring(sourcePath.lastIndexOf('/') + 1);
|
|
52
45
|
}
|
|
53
|
-
// all preconditions met, now create copy job
|
|
54
|
-
const sourceAbsoluteUrl = urlUtil.urlCombine(tenantUrl, serverRelativePath);
|
|
55
|
-
const allowSchemaMismatch = args.options.allowSchemaMismatch || false;
|
|
56
|
-
const requestUrl = urlUtil.urlCombine(webUrl, '/_api/site/CreateCopyJobs');
|
|
57
46
|
const requestOptions = {
|
|
58
|
-
url:
|
|
47
|
+
url: `${args.options.webUrl}/_api/SP.MoveCopyUtil.MoveFileByPath`,
|
|
59
48
|
headers: {
|
|
60
49
|
accept: 'application/json;odata=nometadata'
|
|
61
50
|
},
|
|
51
|
+
responseType: 'json',
|
|
62
52
|
data: {
|
|
63
|
-
|
|
64
|
-
|
|
53
|
+
srcPath: {
|
|
54
|
+
DecodedUrl: absoluteSourcePath
|
|
55
|
+
},
|
|
56
|
+
destPath: {
|
|
57
|
+
DecodedUrl: absoluteTargetPath
|
|
58
|
+
},
|
|
59
|
+
overwrite: args.options.nameConflictBehavior === 'replace',
|
|
65
60
|
options: {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
61
|
+
KeepBoth: args.options.nameConflictBehavior === 'rename',
|
|
62
|
+
ShouldBypassSharedLocks: !!args.options.bypassSharedLock,
|
|
63
|
+
RetainEditorAndModifiedOnMove: !!args.options.retainEditorAndModified
|
|
69
64
|
}
|
|
70
|
-
}
|
|
71
|
-
responseType: 'json'
|
|
65
|
+
}
|
|
72
66
|
};
|
|
73
|
-
|
|
74
|
-
const copyJobInfo = jobInfo.value[0];
|
|
75
|
-
const progressPollInterval = 1800; // 30 * 60; //used previously implemented interval. The API does not provide guidance on what value should be used.
|
|
76
|
-
await new Promise((resolve, reject) => {
|
|
77
|
-
setTimeout(() => {
|
|
78
|
-
spo.waitUntilCopyJobFinished({
|
|
79
|
-
copyJobInfo,
|
|
80
|
-
siteUrl: webUrl,
|
|
81
|
-
pollingInterval: progressPollInterval,
|
|
82
|
-
resolve,
|
|
83
|
-
reject,
|
|
84
|
-
logger,
|
|
85
|
-
debug: this.debug,
|
|
86
|
-
verbose: this.verbose
|
|
87
|
-
});
|
|
88
|
-
}, progressPollInterval);
|
|
89
|
-
});
|
|
67
|
+
await request.post(requestOptions);
|
|
90
68
|
}
|
|
91
69
|
catch (err) {
|
|
92
70
|
this.handleRejectedODataJsonPromise(err);
|
|
93
71
|
}
|
|
94
72
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
73
|
+
async getSourcePath(logger, options) {
|
|
74
|
+
if (options.sourceUrl) {
|
|
75
|
+
return urlUtil.getServerRelativePath(options.webUrl, options.sourceUrl);
|
|
76
|
+
}
|
|
77
|
+
if (this.verbose) {
|
|
78
|
+
await logger.logToStderr(`Retrieving server-relative path for file with ID '${options.sourceId}'...`);
|
|
79
|
+
}
|
|
100
80
|
const requestOptions = {
|
|
101
|
-
url:
|
|
102
|
-
method: 'GET',
|
|
81
|
+
url: `${options.webUrl}/_api/Web/GetFileById('${options.sourceId}')?$select=ServerRelativePath`,
|
|
103
82
|
headers: {
|
|
104
|
-
|
|
83
|
+
accept: 'application/json;odata=nometadata'
|
|
105
84
|
},
|
|
106
85
|
responseType: 'json'
|
|
107
86
|
};
|
|
108
|
-
|
|
87
|
+
const file = await request.get(requestOptions);
|
|
88
|
+
return file.ServerRelativePath.DecodedUrl;
|
|
109
89
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
*/
|
|
113
|
-
async recycleFile(tenantUrl, targetUrl, filename, logger) {
|
|
114
|
-
const targetFolderAbsoluteUrl = urlUtil.urlCombine(tenantUrl, targetUrl);
|
|
115
|
-
// since the target WebFullUrl is unknown we can use getRequestDigest
|
|
116
|
-
// to get it from target folder absolute url.
|
|
117
|
-
// Similar approach used here Microsoft.SharePoint.Client.Web.WebUrlFromFolderUrlDirect
|
|
118
|
-
const contextResponse = await spo.getRequestDigest(targetFolderAbsoluteUrl);
|
|
119
|
-
if (this.debug) {
|
|
120
|
-
await logger.logToStderr(`contextResponse.WebFullUrl: ${contextResponse.WebFullUrl}`);
|
|
121
|
-
}
|
|
122
|
-
const targetFileServerRelativeUrl = `${urlUtil.getServerRelativePath(contextResponse.WebFullUrl, targetUrl)}/${filename}`;
|
|
123
|
-
const removeOptions = {
|
|
124
|
-
webUrl: contextResponse.WebFullUrl,
|
|
125
|
-
url: targetFileServerRelativeUrl,
|
|
126
|
-
recycle: true,
|
|
127
|
-
force: true,
|
|
128
|
-
debug: this.debug,
|
|
129
|
-
verbose: this.verbose
|
|
130
|
-
};
|
|
131
|
-
try {
|
|
132
|
-
await Cli.executeCommand(removeCommand, { options: { ...removeOptions, _: [] } });
|
|
133
|
-
}
|
|
134
|
-
catch (err) {
|
|
135
|
-
if (err !== undefined && err.message !== undefined && err.message.includes('does not exist')) {
|
|
136
|
-
}
|
|
137
|
-
else {
|
|
138
|
-
throw err;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
90
|
+
getAbsoluteUrl(webUrl, url) {
|
|
91
|
+
return url.startsWith('https://') ? url : urlUtil.getAbsoluteUrl(webUrl, url);
|
|
141
92
|
}
|
|
142
93
|
}
|
|
143
94
|
_SpoFileMoveCommand_instances = new WeakSet(), _SpoFileMoveCommand_initTelemetry = function _SpoFileMoveCommand_initTelemetry() {
|
|
144
95
|
this.telemetry.push((args) => {
|
|
145
96
|
Object.assign(this.telemetryProperties, {
|
|
146
|
-
|
|
147
|
-
|
|
97
|
+
sourceUrl: typeof args.options.sourceUrl !== 'undefined',
|
|
98
|
+
sourceId: typeof args.options.sourceId !== 'undefined',
|
|
99
|
+
newName: typeof args.options.newName !== 'undefined',
|
|
100
|
+
nameConflictBehavior: typeof args.options.nameConflictBehavior !== 'undefined',
|
|
101
|
+
retainEditorAndModified: !!args.options.retainEditorAndModified,
|
|
102
|
+
bypassSharedLock: !!args.options.bypassSharedLock
|
|
148
103
|
});
|
|
149
104
|
});
|
|
150
105
|
}, _SpoFileMoveCommand_initOptions = function _SpoFileMoveCommand_initOptions() {
|
|
151
106
|
this.options.unshift({
|
|
152
107
|
option: '-u, --webUrl <webUrl>'
|
|
153
108
|
}, {
|
|
154
|
-
option: '-s, --sourceUrl
|
|
109
|
+
option: '-s, --sourceUrl [sourceUrl]'
|
|
110
|
+
}, {
|
|
111
|
+
option: '-i, --sourceId [sourceId]'
|
|
155
112
|
}, {
|
|
156
113
|
option: '-t, --targetUrl <targetUrl>'
|
|
157
114
|
}, {
|
|
158
|
-
option: '--
|
|
115
|
+
option: '--newName [newName]'
|
|
116
|
+
}, {
|
|
117
|
+
option: '--nameConflictBehavior [nameConflictBehavior]',
|
|
118
|
+
autocomplete: this.nameConflictBehaviorOptions
|
|
159
119
|
}, {
|
|
160
|
-
option: '--
|
|
120
|
+
option: '--retainEditorAndModified'
|
|
121
|
+
}, {
|
|
122
|
+
option: '--bypassSharedLock'
|
|
161
123
|
});
|
|
162
124
|
}, _SpoFileMoveCommand_initValidators = function _SpoFileMoveCommand_initValidators() {
|
|
163
|
-
this.validators.push(async (args) =>
|
|
125
|
+
this.validators.push(async (args) => {
|
|
126
|
+
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
127
|
+
if (isValidSharePointUrl !== true) {
|
|
128
|
+
return isValidSharePointUrl;
|
|
129
|
+
}
|
|
130
|
+
if (args.options.sourceId && !validation.isValidGuid(args.options.sourceId)) {
|
|
131
|
+
return `'${args.options.sourceId}' is not a valid GUID for sourceId.`;
|
|
132
|
+
}
|
|
133
|
+
if (args.options.nameConflictBehavior && this.nameConflictBehaviorOptions.indexOf(args.options.nameConflictBehavior) === -1) {
|
|
134
|
+
return `'${args.options.nameConflictBehavior}' is not a valid value for nameConflictBehavior. Allowed values are: ${this.nameConflictBehaviorOptions.join(', ')}.`;
|
|
135
|
+
}
|
|
136
|
+
return true;
|
|
137
|
+
});
|
|
138
|
+
}, _SpoFileMoveCommand_initOptionSets = function _SpoFileMoveCommand_initOptionSets() {
|
|
139
|
+
this.optionSets.push({ options: ['sourceUrl', 'sourceId'] });
|
|
164
140
|
};
|
|
165
141
|
export default new SpoFileMoveCommand();
|
|
166
142
|
//# sourceMappingURL=file-move.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 _SpoFileSharingLinkAddCommand_instances, _SpoFileSharingLinkAddCommand_initTelemetry, _SpoFileSharingLinkAddCommand_initOptions, _SpoFileSharingLinkAddCommand_initValidators, _SpoFileSharingLinkAddCommand_initOptionSets;
|
|
6
|
+
var _SpoFileSharingLinkAddCommand_instances, _a, _SpoFileSharingLinkAddCommand_initTelemetry, _SpoFileSharingLinkAddCommand_initOptions, _SpoFileSharingLinkAddCommand_initValidators, _SpoFileSharingLinkAddCommand_initOptionSets;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { spo } from '../../../../utils/spo.js';
|
|
9
9
|
import { validation } from '../../../../utils/validation.js';
|
|
@@ -50,7 +50,7 @@ class SpoFileSharingLinkAddCommand extends SpoCommand {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
_SpoFileSharingLinkAddCommand_instances = new WeakSet(), _SpoFileSharingLinkAddCommand_initTelemetry = function _SpoFileSharingLinkAddCommand_initTelemetry() {
|
|
53
|
+
_a = SpoFileSharingLinkAddCommand, _SpoFileSharingLinkAddCommand_instances = new WeakSet(), _SpoFileSharingLinkAddCommand_initTelemetry = function _SpoFileSharingLinkAddCommand_initTelemetry() {
|
|
54
54
|
this.telemetry.push((args) => {
|
|
55
55
|
Object.assign(this.telemetryProperties, {
|
|
56
56
|
fileId: typeof args.options.fileId !== 'undefined',
|
|
@@ -68,12 +68,12 @@ _SpoFileSharingLinkAddCommand_instances = new WeakSet(), _SpoFileSharingLinkAddC
|
|
|
68
68
|
option: '--fileUrl [fileUrl]'
|
|
69
69
|
}, {
|
|
70
70
|
option: '--type <type>',
|
|
71
|
-
autocomplete:
|
|
71
|
+
autocomplete: _a.types
|
|
72
72
|
}, {
|
|
73
73
|
option: '--expirationDateTime [expirationDateTime]'
|
|
74
74
|
}, {
|
|
75
75
|
option: '--scope [scope]',
|
|
76
|
-
autocomplete:
|
|
76
|
+
autocomplete: _a.scopes
|
|
77
77
|
});
|
|
78
78
|
}, _SpoFileSharingLinkAddCommand_initValidators = function _SpoFileSharingLinkAddCommand_initValidators() {
|
|
79
79
|
this.validators.push(async (args) => {
|
|
@@ -84,12 +84,12 @@ _SpoFileSharingLinkAddCommand_instances = new WeakSet(), _SpoFileSharingLinkAddC
|
|
|
84
84
|
if (args.options.fileId && !validation.isValidGuid(args.options.fileId)) {
|
|
85
85
|
return `${args.options.fileId} is not a valid GUID`;
|
|
86
86
|
}
|
|
87
|
-
if (
|
|
88
|
-
return `'${args.options.type}' is not a valid type. Allowed types are ${
|
|
87
|
+
if (_a.types.indexOf(args.options.type) < 0) {
|
|
88
|
+
return `'${args.options.type}' is not a valid type. Allowed types are ${_a.types.join(', ')}`;
|
|
89
89
|
}
|
|
90
90
|
if (args.options.scope &&
|
|
91
|
-
|
|
92
|
-
return `'${args.options.scope}' is not a valid scope. Allowed scopes are ${
|
|
91
|
+
_a.scopes.indexOf(args.options.scope) < 0) {
|
|
92
|
+
return `'${args.options.scope}' is not a valid scope. Allowed scopes are ${_a.scopes.join(', ')}`;
|
|
93
93
|
}
|
|
94
94
|
if (args.options.scope && args.options.scope !== 'anonymous' && args.options.expirationDateTime) {
|
|
95
95
|
return `Option expirationDateTime can only be used for links with scope 'anonymous'.`;
|
|
@@ -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 _SpoFileSharingLinkListCommand_instances, _SpoFileSharingLinkListCommand_initTelemetry, _SpoFileSharingLinkListCommand_initOptions, _SpoFileSharingLinkListCommand_initValidators, _SpoFileSharingLinkListCommand_initOptionSets;
|
|
6
|
+
var _SpoFileSharingLinkListCommand_instances, _a, _SpoFileSharingLinkListCommand_initTelemetry, _SpoFileSharingLinkListCommand_initOptions, _SpoFileSharingLinkListCommand_initValidators, _SpoFileSharingLinkListCommand_initOptionSets;
|
|
7
7
|
import { Cli } from '../../../../cli/Cli.js';
|
|
8
8
|
import { odata } from '../../../../utils/odata.js';
|
|
9
9
|
import { spo } from '../../../../utils/spo.js';
|
|
@@ -59,7 +59,7 @@ class SpoFileSharingLinkListCommand extends SpoCommand {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
_SpoFileSharingLinkListCommand_instances = new WeakSet(), _SpoFileSharingLinkListCommand_initTelemetry = function _SpoFileSharingLinkListCommand_initTelemetry() {
|
|
62
|
+
_a = SpoFileSharingLinkListCommand, _SpoFileSharingLinkListCommand_instances = new WeakSet(), _SpoFileSharingLinkListCommand_initTelemetry = function _SpoFileSharingLinkListCommand_initTelemetry() {
|
|
63
63
|
this.telemetry.push((args) => {
|
|
64
64
|
Object.assign(this.telemetryProperties, {
|
|
65
65
|
fileId: typeof args.options.fileId !== 'undefined',
|
|
@@ -76,7 +76,7 @@ _SpoFileSharingLinkListCommand_instances = new WeakSet(), _SpoFileSharingLinkLis
|
|
|
76
76
|
option: '--fileUrl [fileUrl]'
|
|
77
77
|
}, {
|
|
78
78
|
option: '-s, --scope [scope]',
|
|
79
|
-
autocomplete:
|
|
79
|
+
autocomplete: _a.allowedScopes
|
|
80
80
|
});
|
|
81
81
|
}, _SpoFileSharingLinkListCommand_initValidators = function _SpoFileSharingLinkListCommand_initValidators() {
|
|
82
82
|
this.validators.push(async (args) => {
|
|
@@ -87,8 +87,8 @@ _SpoFileSharingLinkListCommand_instances = new WeakSet(), _SpoFileSharingLinkLis
|
|
|
87
87
|
if (args.options.fileId && !validation.isValidGuid(args.options.fileId)) {
|
|
88
88
|
return `${args.options.fileId} is not a valid GUID`;
|
|
89
89
|
}
|
|
90
|
-
if (args.options.scope &&
|
|
91
|
-
return `'${args.options.scope}' is not a valid scope. Allowed values are: ${
|
|
90
|
+
if (args.options.scope && _a.allowedScopes.indexOf(args.options.scope) === -1) {
|
|
91
|
+
return `'${args.options.scope}' is not a valid scope. Allowed values are: ${_a.allowedScopes.join(',')}`;
|
|
92
92
|
}
|
|
93
93
|
return true;
|
|
94
94
|
});
|