@pnp/cli-microsoft365 7.0.0-beta.5fdb9e3 → 7.0.0-beta.607e42d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +0 -2
- package/dist/GlobalOptions.js +1 -7
- package/dist/m365/aad/commands/app/app-add.js +8 -8
- package/dist/m365/aad/commands/app/app-role-add.js +5 -5
- package/dist/m365/aad/commands/app/app-set.js +5 -5
- package/dist/m365/aad/commands/group/group-get.js +4 -4
- package/dist/m365/aad/commands/group/group-list.js +1 -23
- package/dist/m365/aad/commands/policy/policy-list.js +5 -5
- package/dist/m365/cli/commands/cli-issue.js +5 -5
- package/dist/m365/cli/commands/config/config-get.js +5 -5
- package/dist/m365/cli/commands/config/config-reset.js +5 -5
- package/dist/m365/cli/commands/config/config-set.js +5 -5
- package/dist/m365/commands/login.js +5 -5
- package/dist/m365/commands/request.js +1 -1
- package/dist/m365/flow/commands/owner/owner-ensure.js +5 -5
- package/dist/m365/pa/commands/app/app-export.js +7 -7
- package/dist/m365/pa/commands/app/app-owner-set.js +5 -5
- package/dist/m365/pa/commands/app/app-permission-ensure.js +5 -5
- package/dist/m365/pa/commands.js +1 -4
- package/dist/m365/planner/commands/task/task-add.js +17 -11
- package/dist/m365/planner/commands/task/task-get.js +35 -25
- package/dist/m365/planner/commands/task/task-list.js +26 -19
- package/dist/m365/planner/commands/task/task-remove.js +39 -34
- package/dist/m365/planner/commands/task/task-set.js +35 -23
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-add.js +14 -14
- package/dist/m365/spfx/commands/package/package-generate.js +15 -15
- package/dist/m365/spfx/commands/project/DeployWorkflow.js +55 -0
- package/dist/m365/spfx/commands/project/project-doctor.js +8 -8
- package/dist/m365/spfx/commands/project/project-github-workflow-add.js +157 -0
- package/dist/m365/spfx/commands/project/project-github-workflow-model.js +2 -0
- package/dist/m365/spfx/commands/project/project-upgrade.js +13 -13
- package/dist/m365/spfx/commands.js +1 -0
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-add.js +5 -5
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-list.js +5 -5
- package/dist/m365/spo/commands/commandset/commandset-add.js +11 -11
- package/dist/m365/spo/commands/commandset/commandset-get.js +8 -8
- package/dist/m365/spo/commands/commandset/commandset-list.js +5 -5
- package/dist/m365/spo/commands/commandset/commandset-remove.js +5 -5
- package/dist/m365/spo/commands/commandset/commandset-set.js +11 -11
- package/dist/m365/spo/commands/file/file-get.js +9 -6
- package/dist/m365/spo/commands/file/file-sharinglink-add.js +8 -8
- package/dist/m365/spo/commands/file/file-sharinglink-list.js +5 -5
- package/dist/m365/spo/commands/list/list-add.js +4 -4
- package/dist/m365/spo/commands/list/list-set.js +4 -4
- package/dist/m365/spo/commands/listitem/listitem-add.js +1 -0
- package/dist/m365/spo/commands/listitem/listitem-set.js +3 -2
- package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-add.js +8 -8
- package/dist/m365/spo/commands/page/clientsidepages.js +1 -81
- package/dist/m365/spo/commands/page/page-get.js +1 -0
- package/dist/m365/spo/commands/page/page-list.js +4 -3
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-set.js +30 -32
- package/dist/m365/spo/commands/site/site-add.js +114 -161
- package/dist/m365/spo/commands/site/site-apppermission-add.js +15 -18
- package/dist/m365/spo/commands/site/site-apppermission-remove.js +34 -38
- package/dist/m365/spo/commands/site/site-apppermission-set.js +11 -14
- package/dist/m365/spo/commands/site/site-ensure.js +13 -66
- package/dist/m365/spo/commands/site/site-list.js +9 -17
- package/dist/m365/spo/commands/site/site-recyclebinitem-list.js +6 -6
- package/dist/m365/spo/commands/site/site-remove.js +166 -210
- package/dist/m365/spo/commands/site/site-set.js +121 -153
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-list.js +3 -2
- package/dist/m365/spo/commands/tenant/tenant-commandset-add.js +8 -8
- package/dist/m365/spo/commands/tenant/tenant-commandset-list.js +3 -2
- package/dist/m365/spo/commands/tenant/tenant-commandset-set.js +8 -8
- package/dist/m365/spo/commands/tenant/tenant-settings-set.js +4 -4
- package/dist/m365/spo/commands/web/web-roleinheritance-break.js +3 -3
- package/dist/m365/spo/commands/web/web-set.js +5 -5
- package/dist/m365/teams/commands/app/app-list.js +5 -5
- package/dist/m365/teams/commands/chat/chat-member-add.js +5 -5
- package/dist/m365/teams/commands/funsettings/funsettings-set.js +4 -4
- package/dist/m365/teams/commands/guestsettings/guestsettings-set.js +4 -4
- package/dist/m365/teams/commands/membersettings/membersettings-set.js +4 -4
- package/dist/m365/teams/commands/messagingsettings/messagingsettings-set.js +5 -5
- package/dist/m365/teams/commands/team/team-set.js +3 -3
- package/dist/m365/todo/commands/task/task-add.js +6 -6
- package/dist/m365/yammer/commands/message/message-list.js +5 -5
- package/dist/m365/yammer/commands/yammer-search.js +5 -5
- package/dist/utils/aadGroup.js +18 -0
- package/dist/utils/fsUtil.js +5 -0
- package/dist/utils/spo.js +582 -0
- package/dist/utils/validation.js +0 -3
- package/docs/docs/cmd/aad/group/group-get.mdx +5 -5
- package/docs/docs/cmd/aad/group/group-list.mdx +0 -11
- package/docs/docs/cmd/pa/app/app-export.mdx +5 -5
- package/docs/docs/cmd/planner/task/task-add.mdx +22 -7
- package/docs/docs/cmd/planner/task/task-get.mdx +13 -4
- package/docs/docs/cmd/planner/task/task-list.mdx +22 -7
- package/docs/docs/cmd/planner/task/task-remove.mdx +25 -8
- package/docs/docs/cmd/planner/task/task-set.mdx +22 -7
- package/docs/docs/cmd/spfx/project/project-github-workflow-add.mdx +94 -0
- package/docs/docs/cmd/spo/listitem/listitem-add.mdx +2 -5
- package/docs/docs/cmd/spo/listitem/listitem-set.mdx +2 -5
- package/docs/docs/cmd/spo/page/page-get.mdx +0 -1
- package/docs/docs/cmd/spo/page/page-list.mdx +0 -1
- package/docs/docs/cmd/spo/site/site-list.mdx +3 -78
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-list.mdx +2 -4
- package/docs/docs/cmd/spo/tenant/tenant-commandset-list.mdx +2 -4
- package/npm-shrinkwrap.json +239 -1416
- package/package.json +6 -12
- package/dist/m365/pa/cds-project-mutator.js +0 -91
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/dataset-template/generated/ManifestTypes.d.ts +0 -11
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/dataset-template/template_ControlManifest.Input.xml +0 -31
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/dataset-template/template_index.ts +0 -51
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/field-template/generated/ManifestTypes.d.ts +0 -12
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/field-template/template_ControlManifest.Input.xml +0 -37
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/field-template/template_index.ts +0 -48
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/index.ts +0 -0
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/virtual-dataset-template/template_ControlManifest.Input.xml +0 -31
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/virtual-dataset-template/template_index.tsx +0 -58
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/virtual-field-template/template_ControlManifest.Input.xml +0 -37
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/virtual-field-template/template_index.tsx +0 -55
- package/dist/m365/pa/commands/pcf/pcf-init/assets/package.json +0 -19
- package/dist/m365/pa/commands/pcf/pcf-init/assets/pcfconfig.json +0 -3
- package/dist/m365/pa/commands/pcf/pcf-init/assets/template_.gitignore +0 -14
- package/dist/m365/pa/commands/pcf/pcf-init/assets/template_pcfprojecttype.pcfproj +0 -45
- package/dist/m365/pa/commands/pcf/pcf-init/pcf-init-variables.js +0 -2
- package/dist/m365/pa/commands/pcf/pcf-init.js +0 -120
- package/dist/m365/pa/commands/solution/solution-init/assets/Other/Customizations.xml +0 -18
- package/dist/m365/pa/commands/solution/solution-init/assets/Other/Relationships.xml +0 -2
- package/dist/m365/pa/commands/solution/solution-init/assets/Other/template_Solution.xml +0 -94
- package/dist/m365/pa/commands/solution/solution-init/assets/template_.gitignore +0 -2
- package/dist/m365/pa/commands/solution/solution-init/assets/template_solutionprojecttype.cdsproj +0 -44
- package/dist/m365/pa/commands/solution/solution-init/solution-init-variables.js +0 -2
- package/dist/m365/pa/commands/solution/solution-init.js +0 -126
- package/dist/m365/pa/commands/solution/solution-reference-add.js +0 -88
- package/dist/m365/pa/template-instantiator.js +0 -57
- package/docs/docs/cmd/pa/pcf/pcf-init.mdx +0 -56
- package/docs/docs/cmd/pa/solution/solution-init.mdx +0 -46
- package/docs/docs/cmd/pa/solution/solution-reference-add.mdx +0 -42
|
@@ -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`;
|
|
@@ -103,6 +103,9 @@ class SpoFileGetCommand extends SpoCommand {
|
|
|
103
103
|
fileProperties.ListItemAllFields.RoleAssignments = response.value;
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
+
if (args.options.asListItem) {
|
|
107
|
+
delete fileProperties.ListItemAllFields.ID;
|
|
108
|
+
}
|
|
106
109
|
await logger.log(args.options.asListItem ? fileProperties.ListItemAllFields : fileProperties);
|
|
107
110
|
}
|
|
108
111
|
}
|
|
@@ -115,12 +118,12 @@ class SpoFileGetCommand extends SpoCommand {
|
|
|
115
118
|
_SpoFileGetCommand_instances = new WeakSet(), _SpoFileGetCommand_initTelemetry = function _SpoFileGetCommand_initTelemetry() {
|
|
116
119
|
this.telemetry.push((args) => {
|
|
117
120
|
Object.assign(this.telemetryProperties, {
|
|
118
|
-
id:
|
|
119
|
-
url:
|
|
120
|
-
asString: args.options.asString
|
|
121
|
-
asListItem: args.options.asListItem
|
|
122
|
-
asFile: args.options.asFile
|
|
123
|
-
path:
|
|
121
|
+
id: typeof args.options.id !== 'undefined',
|
|
122
|
+
url: typeof args.options.url !== 'undefined',
|
|
123
|
+
asString: !!args.options.asString,
|
|
124
|
+
asListItem: !!args.options.asListItem,
|
|
125
|
+
asFile: !!args.options.asFile,
|
|
126
|
+
path: typeof args.options.path !== 'undefined',
|
|
124
127
|
withPermissions: !!args.options.withPermissions
|
|
125
128
|
});
|
|
126
129
|
});
|
|
@@ -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
|
});
|
|
@@ -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 _SpoListAddCommand_instances, _SpoListAddCommand_initTelemetry, _SpoListAddCommand_initOptions, _SpoListAddCommand_initValidators, _SpoListAddCommand_initTypes;
|
|
6
|
+
var _SpoListAddCommand_instances, _a, _SpoListAddCommand_initTelemetry, _SpoListAddCommand_initOptions, _SpoListAddCommand_initValidators, _SpoListAddCommand_initTypes;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { validation } from '../../../../utils/validation.js';
|
|
9
9
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
@@ -275,7 +275,7 @@ class SpoListAddCommand extends SpoCommand {
|
|
|
275
275
|
return requestBody;
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
|
-
_SpoListAddCommand_instances = new WeakSet(), _SpoListAddCommand_initTelemetry = function _SpoListAddCommand_initTelemetry() {
|
|
278
|
+
_a = SpoListAddCommand, _SpoListAddCommand_instances = new WeakSet(), _SpoListAddCommand_initTelemetry = function _SpoListAddCommand_initTelemetry() {
|
|
279
279
|
this.telemetry.push((args) => {
|
|
280
280
|
const telemetryProps = {};
|
|
281
281
|
// add properties with identifiable data
|
|
@@ -298,7 +298,7 @@ _SpoListAddCommand_instances = new WeakSet(), _SpoListAddCommand_initTelemetry =
|
|
|
298
298
|
}
|
|
299
299
|
});
|
|
300
300
|
// add boolean values
|
|
301
|
-
|
|
301
|
+
_a.booleanOptions.forEach(o => {
|
|
302
302
|
const value = args.options[o];
|
|
303
303
|
if (value !== undefined) {
|
|
304
304
|
telemetryProps[o] = value.toString();
|
|
@@ -561,7 +561,7 @@ _SpoListAddCommand_instances = new WeakSet(), _SpoListAddCommand_initTelemetry =
|
|
|
561
561
|
});
|
|
562
562
|
}, _SpoListAddCommand_initTypes = function _SpoListAddCommand_initTypes() {
|
|
563
563
|
this.types.string.push('title', 'baseTemplate', 'webUrl', 'templateFeatureId', 'defaultContentApprovalWorkflowId', 'draftVersionVisibility', 'listExperienceOptions');
|
|
564
|
-
this.types.boolean.push(...
|
|
564
|
+
this.types.boolean.push(..._a.booleanOptions);
|
|
565
565
|
};
|
|
566
566
|
SpoListAddCommand.booleanOptions = [
|
|
567
567
|
'allowDeletion',
|
|
@@ -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 _SpoListSetCommand_instances, _SpoListSetCommand_initTelemetry, _SpoListSetCommand_initOptions, _SpoListSetCommand_initValidators, _SpoListSetCommand_initTypes, _SpoListSetCommand_initOptionSets;
|
|
6
|
+
var _SpoListSetCommand_instances, _a, _SpoListSetCommand_initTelemetry, _SpoListSetCommand_initOptions, _SpoListSetCommand_initValidators, _SpoListSetCommand_initTypes, _SpoListSetCommand_initOptionSets;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
9
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
@@ -277,7 +277,7 @@ class SpoListSetCommand extends SpoCommand {
|
|
|
277
277
|
return requestBody;
|
|
278
278
|
}
|
|
279
279
|
}
|
|
280
|
-
_SpoListSetCommand_instances = new WeakSet(), _SpoListSetCommand_initTelemetry = function _SpoListSetCommand_initTelemetry() {
|
|
280
|
+
_a = SpoListSetCommand, _SpoListSetCommand_instances = new WeakSet(), _SpoListSetCommand_initTelemetry = function _SpoListSetCommand_initTelemetry() {
|
|
281
281
|
this.telemetry.push((args) => {
|
|
282
282
|
const telemetryProps = {};
|
|
283
283
|
// add properties with identifiable data
|
|
@@ -303,7 +303,7 @@ _SpoListSetCommand_instances = new WeakSet(), _SpoListSetCommand_initTelemetry =
|
|
|
303
303
|
}
|
|
304
304
|
});
|
|
305
305
|
// add boolean values
|
|
306
|
-
|
|
306
|
+
_a.booleanOptions.forEach(o => {
|
|
307
307
|
const value = args.options[o];
|
|
308
308
|
if (value !== undefined) {
|
|
309
309
|
telemetryProps[o] = value;
|
|
@@ -565,7 +565,7 @@ _SpoListSetCommand_instances = new WeakSet(), _SpoListSetCommand_initTelemetry =
|
|
|
565
565
|
});
|
|
566
566
|
}, _SpoListSetCommand_initTypes = function _SpoListSetCommand_initTypes() {
|
|
567
567
|
this.types.string.push('webUrl', 'templateFeatureId', 'defaultContentApprovalWorkflowId', 'draftVersionVisibility', 'listExperienceOptions');
|
|
568
|
-
this.types.boolean.push(...
|
|
568
|
+
this.types.boolean.push(..._a.booleanOptions);
|
|
569
569
|
}, _SpoListSetCommand_initOptionSets = function _SpoListSetCommand_initOptionSets() {
|
|
570
570
|
this.optionSets.push({ options: ['id', 'title', 'url'] });
|
|
571
571
|
};
|
|
@@ -188,8 +188,9 @@ class SpoListItemSetCommand extends SpoCommand {
|
|
|
188
188
|
},
|
|
189
189
|
responseType: 'json'
|
|
190
190
|
};
|
|
191
|
-
const
|
|
192
|
-
|
|
191
|
+
const item = await request.get(requestOptionsItems);
|
|
192
|
+
delete item.ID;
|
|
193
|
+
await logger.log(item);
|
|
193
194
|
}
|
|
194
195
|
catch (err) {
|
|
195
196
|
this.handleRejectedODataJsonPromise(err);
|
|
@@ -3,7 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
3
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _SpoOrgAssetsLibraryAddCommand_instances, _SpoOrgAssetsLibraryAddCommand_initTelemetry, _SpoOrgAssetsLibraryAddCommand_initOptions, _SpoOrgAssetsLibraryAddCommand_initValidators;
|
|
6
|
+
var _SpoOrgAssetsLibraryAddCommand_instances, _a, _SpoOrgAssetsLibraryAddCommand_initTelemetry, _SpoOrgAssetsLibraryAddCommand_initOptions, _SpoOrgAssetsLibraryAddCommand_initValidators;
|
|
7
7
|
import config from '../../../../config.js';
|
|
8
8
|
import request from '../../../../request.js';
|
|
9
9
|
import { spo } from '../../../../utils/spo.js';
|
|
@@ -68,7 +68,7 @@ class SpoOrgAssetsLibraryAddCommand extends SpoCommand {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
_SpoOrgAssetsLibraryAddCommand_instances = new WeakSet(), _SpoOrgAssetsLibraryAddCommand_initTelemetry = function _SpoOrgAssetsLibraryAddCommand_initTelemetry() {
|
|
71
|
+
_a = SpoOrgAssetsLibraryAddCommand, _SpoOrgAssetsLibraryAddCommand_instances = new WeakSet(), _SpoOrgAssetsLibraryAddCommand_initTelemetry = function _SpoOrgAssetsLibraryAddCommand_initTelemetry() {
|
|
72
72
|
this.telemetry.push((args) => {
|
|
73
73
|
Object.assign(this.telemetryProperties, {
|
|
74
74
|
cdnType: args.options.cdnType || 'Private',
|
|
@@ -83,10 +83,10 @@ _SpoOrgAssetsLibraryAddCommand_instances = new WeakSet(), _SpoOrgAssetsLibraryAd
|
|
|
83
83
|
option: '--thumbnailUrl [thumbnailUrl]'
|
|
84
84
|
}, {
|
|
85
85
|
option: '--cdnType [cdnType]',
|
|
86
|
-
autocomplete:
|
|
86
|
+
autocomplete: _a.cdnTypes
|
|
87
87
|
}, {
|
|
88
88
|
option: '--orgAssetType [orgAssetType]',
|
|
89
|
-
autocomplete:
|
|
89
|
+
autocomplete: _a.orgAssetTypes
|
|
90
90
|
});
|
|
91
91
|
}, _SpoOrgAssetsLibraryAddCommand_initValidators = function _SpoOrgAssetsLibraryAddCommand_initValidators() {
|
|
92
92
|
this.validators.push(async (args) => {
|
|
@@ -94,11 +94,11 @@ _SpoOrgAssetsLibraryAddCommand_instances = new WeakSet(), _SpoOrgAssetsLibraryAd
|
|
|
94
94
|
if (typeof args.options.thumbnailUrl !== 'undefined' && isValidThumbnailUrl !== true) {
|
|
95
95
|
return isValidThumbnailUrl;
|
|
96
96
|
}
|
|
97
|
-
if (args.options.cdnType &&
|
|
98
|
-
return `${args.options.cdnType} is not a valid value for cdnType. Valid values are ${
|
|
97
|
+
if (args.options.cdnType && _a.cdnTypes.indexOf(args.options.cdnType) < 0) {
|
|
98
|
+
return `${args.options.cdnType} is not a valid value for cdnType. Valid values are ${_a.cdnTypes.join(', ')}`;
|
|
99
99
|
}
|
|
100
|
-
if (args.options.orgAssetType &&
|
|
101
|
-
return `${args.options.orgAssetType} is not a valid value for orgAssetType. Valid values are ${
|
|
100
|
+
if (args.options.orgAssetType && _a.orgAssetTypes.indexOf(args.options.orgAssetType) < 0) {
|
|
101
|
+
return `${args.options.orgAssetType} is not a valid value for orgAssetType. Valid values are ${_a.orgAssetTypes.join(', ')}`;
|
|
102
102
|
}
|
|
103
103
|
return validation.isValidSharePointUrl(args.options.libraryUrl);
|
|
104
104
|
});
|
|
@@ -204,7 +204,6 @@ function reindex(collection) {
|
|
|
204
204
|
export class ClientSidePage {
|
|
205
205
|
constructor() {
|
|
206
206
|
this.sections = [];
|
|
207
|
-
this.commentsDisabled = false;
|
|
208
207
|
}
|
|
209
208
|
/**
|
|
210
209
|
* Converts a json object to an escaped string appropriate for use in attributes when storing client-side controls
|
|
@@ -243,49 +242,6 @@ export class ClientSidePage {
|
|
|
243
242
|
};
|
|
244
243
|
return JSON.parse(unespace(escapedString));
|
|
245
244
|
}
|
|
246
|
-
/**
|
|
247
|
-
* Add a section to this page
|
|
248
|
-
*/
|
|
249
|
-
addSection(sectionTemplate, order) {
|
|
250
|
-
var sectionOrder = typeof order !== 'undefined' ? order : getNextOrder(this.sections);
|
|
251
|
-
var section = new CanvasSection(this, sectionOrder);
|
|
252
|
-
if (sectionTemplate) {
|
|
253
|
-
switch (CanvasSectionTemplate[sectionTemplate].toString()) {
|
|
254
|
-
case CanvasSectionTemplate.OneColumnFullWidth.toString():
|
|
255
|
-
section.addColumn(0);
|
|
256
|
-
break;
|
|
257
|
-
case CanvasSectionTemplate.TwoColumn.toString():
|
|
258
|
-
section.addColumn(6);
|
|
259
|
-
section.addColumn(6);
|
|
260
|
-
break;
|
|
261
|
-
case CanvasSectionTemplate.ThreeColumn.toString():
|
|
262
|
-
section.addColumn(4);
|
|
263
|
-
section.addColumn(4);
|
|
264
|
-
section.addColumn(4);
|
|
265
|
-
break;
|
|
266
|
-
case CanvasSectionTemplate.TwoColumnLeft.toString():
|
|
267
|
-
section.addColumn(8);
|
|
268
|
-
section.addColumn(4);
|
|
269
|
-
break;
|
|
270
|
-
case CanvasSectionTemplate.TwoColumnRight.toString():
|
|
271
|
-
section.addColumn(4);
|
|
272
|
-
section.addColumn(8);
|
|
273
|
-
break;
|
|
274
|
-
case CanvasSectionTemplate.OneColumn.toString():
|
|
275
|
-
default:
|
|
276
|
-
section.addColumn(12);
|
|
277
|
-
break;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
if (typeof order !== undefined) {
|
|
281
|
-
// Insert the sections at the specified order.
|
|
282
|
-
this.sections.splice(sectionOrder - 1, 0, section);
|
|
283
|
-
}
|
|
284
|
-
else {
|
|
285
|
-
this.sections.push(section);
|
|
286
|
-
}
|
|
287
|
-
return section;
|
|
288
|
-
}
|
|
289
245
|
/**
|
|
290
246
|
* Converts this page's content to html markup
|
|
291
247
|
*/
|
|
@@ -341,14 +297,6 @@ export class ClientSidePage {
|
|
|
341
297
|
reindex(page.sections);
|
|
342
298
|
return page;
|
|
343
299
|
}
|
|
344
|
-
/**
|
|
345
|
-
* Finds a control by the specified instance id
|
|
346
|
-
*
|
|
347
|
-
* @param id Instance id of the control to find
|
|
348
|
-
*/
|
|
349
|
-
findControlById(id) {
|
|
350
|
-
return this.findControl((c) => c.id === id);
|
|
351
|
-
}
|
|
352
300
|
/**
|
|
353
301
|
* Finds a control within this page's control tree using the supplied predicate
|
|
354
302
|
*
|
|
@@ -441,7 +389,6 @@ export class CanvasSection {
|
|
|
441
389
|
this.page = page;
|
|
442
390
|
this.order = order;
|
|
443
391
|
this.columns = columns;
|
|
444
|
-
this._memId = getGUID();
|
|
445
392
|
}
|
|
446
393
|
/**
|
|
447
394
|
* Default column (this.columns[0]) for this section
|
|
@@ -460,15 +407,6 @@ export class CanvasSection {
|
|
|
460
407
|
this.columns.push(column);
|
|
461
408
|
return column;
|
|
462
409
|
}
|
|
463
|
-
/**
|
|
464
|
-
* Adds a control to the default column for this section
|
|
465
|
-
*
|
|
466
|
-
* @param control Control to add to the default column
|
|
467
|
-
*/
|
|
468
|
-
addControl(control) {
|
|
469
|
-
this.defaultColumn.addControl(control);
|
|
470
|
-
return this;
|
|
471
|
-
}
|
|
472
410
|
toHtml() {
|
|
473
411
|
const html = [];
|
|
474
412
|
for (let i = 0; i < this.columns.length; i++) {
|
|
@@ -476,15 +414,8 @@ export class CanvasSection {
|
|
|
476
414
|
}
|
|
477
415
|
return html.join("");
|
|
478
416
|
}
|
|
479
|
-
/**
|
|
480
|
-
* Removes this section and all contained columns and controls from the collection
|
|
481
|
-
*/
|
|
482
|
-
remove() {
|
|
483
|
-
this.page.sections = this.page.sections.filter(section => section._memId !== this._memId);
|
|
484
|
-
reindex(this.page.sections);
|
|
485
|
-
}
|
|
486
417
|
}
|
|
487
|
-
|
|
418
|
+
class CanvasControl {
|
|
488
419
|
constructor(controlType, dataVersion, column = undefined, order = 1, id = getGUID(), controlData = null, dynamicDataPaths = null, dynamicDataValues = null) {
|
|
489
420
|
this.controlType = controlType;
|
|
490
421
|
this.dataVersion = dataVersion;
|
|
@@ -534,9 +465,6 @@ export class CanvasColumn extends CanvasControl {
|
|
|
534
465
|
}
|
|
535
466
|
return this;
|
|
536
467
|
}
|
|
537
|
-
getControl(index) {
|
|
538
|
-
return this.controls[index];
|
|
539
|
-
}
|
|
540
468
|
toHtml() {
|
|
541
469
|
const html = [];
|
|
542
470
|
if (this.controls.length < 1) {
|
|
@@ -662,11 +590,6 @@ export class ClientSideWebpart extends ClientSidePart {
|
|
|
662
590
|
this.dynamicDataPaths = dynamicDataPaths;
|
|
663
591
|
this.dynamicDataValues = dynamicDataValues;
|
|
664
592
|
}
|
|
665
|
-
static fromComponentDef(definition) {
|
|
666
|
-
const part = new ClientSideWebpart("");
|
|
667
|
-
part.import(definition);
|
|
668
|
-
return part;
|
|
669
|
-
}
|
|
670
593
|
import(component) {
|
|
671
594
|
this.webPartId = component.Id.replace(/^\{|\}$/g, "").toLowerCase();
|
|
672
595
|
const manifest = JSON.parse(component.Manifest);
|
|
@@ -679,9 +602,6 @@ export class ClientSideWebpart extends ClientSidePart {
|
|
|
679
602
|
this.propertieJson = extend(this.propertieJson, properties);
|
|
680
603
|
return this;
|
|
681
604
|
}
|
|
682
|
-
getProperties() {
|
|
683
|
-
return this.propertieJson;
|
|
684
|
-
}
|
|
685
605
|
toHtml(index) {
|
|
686
606
|
// set our order to the value passed in
|
|
687
607
|
this.order = index;
|
|
@@ -34,9 +34,9 @@ class SpoPageListCommand extends SpoCommand {
|
|
|
34
34
|
if (pagesList && pagesList.length > 0) {
|
|
35
35
|
pages = pagesList;
|
|
36
36
|
}
|
|
37
|
-
const
|
|
38
|
-
if (
|
|
39
|
-
const clientSidePages =
|
|
37
|
+
const files = await odata.getAllItems(`${args.options.webUrl}/_api/web/lists/SitePages/rootfolder/files?$expand=ListItemAllFields/ClientSideApplicationId&$orderby=Name`);
|
|
38
|
+
if (files?.length > 0) {
|
|
39
|
+
const clientSidePages = files.filter(f => f.ListItemAllFields.ClientSideApplicationId === 'b6917cb1-93a0-4b97-a84d-7cf49975d4ec');
|
|
40
40
|
pages = pages.map(p => {
|
|
41
41
|
const clientSidePage = clientSidePages.find(cp => cp && cp.ListItemAllFields && cp.ListItemAllFields.Id === p.Id);
|
|
42
42
|
if (clientSidePage) {
|
|
@@ -47,6 +47,7 @@ class SpoPageListCommand extends SpoCommand {
|
|
|
47
47
|
}
|
|
48
48
|
return p;
|
|
49
49
|
});
|
|
50
|
+
pages.filter(p => p.ListItemAllFields).forEach(page => delete page.ListItemAllFields.ID);
|
|
50
51
|
await logger.log(pages);
|
|
51
52
|
}
|
|
52
53
|
}
|