@pnp/cli-microsoft365 6.5.0-beta.b69bf55 → 6.5.0-beta.ccd8e85
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.js +2 -0
- package/README.md +3 -3
- package/dist/Command.js +17 -7
- package/dist/cli/Cli.js +15 -11
- package/dist/m365/cli/commands/config/config-set.js +1 -0
- package/dist/m365/flow/commands/flow-export.js +6 -6
- package/dist/m365/pa/commands/app/app-export.js +197 -0
- package/dist/m365/pa/commands.js +1 -0
- package/dist/m365/purview/commands/threatassessment/threatassessment-get.js +79 -0
- package/dist/m365/purview/commands.js +2 -1
- package/dist/m365/spfx/commands/project/project-upgrade/{upgrade-1.17.0-beta.3.js → upgrade-1.17.0.js} +26 -26
- package/dist/m365/spfx/commands/project/project-upgrade.js +13 -15
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-add.js +27 -13
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-list.js +72 -0
- package/dist/m365/spo/commands/commandset/commandset-add.js +2 -1
- package/dist/m365/spo/commands/commandset/commandset-remove.js +12 -9
- package/dist/m365/spo/commands/commandset/commandset-set.js +12 -9
- package/dist/m365/spo/commands/file/file-move.js +1 -1
- package/dist/m365/spo/commands/file/file-retentionlabel-ensure.js +22 -1
- package/dist/m365/spo/commands/listitem/listitem-get.js +21 -6
- package/dist/m365/spo/commands/listitem/listitem-retentionlabel-ensure.js +35 -1
- package/dist/m365/spo/commands/web/web-set.js +33 -13
- package/dist/m365/spo/commands.js +1 -0
- package/dist/m365/teams/commands/team/team-list.js +4 -6
- package/dist/m365/todo/commands/task/task-set.js +25 -1
- package/dist/settingsNames.js +2 -1
- package/dist/utils/md.js +4 -3
- package/docs/docs/_clisettings.md +1 -0
- package/docs/docs/cmd/pa/app/app-export.md +52 -0
- package/docs/docs/cmd/purview/threatassessment/threatassessment-get.md +191 -0
- package/docs/docs/cmd/spfx/project/project-upgrade.md +2 -2
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-add.md +4 -1
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-list.md +109 -0
- package/docs/docs/cmd/spo/file/file-retentionlabel-ensure.md +12 -1
- package/docs/docs/cmd/spo/list/list-view-remove.md +1 -1
- package/docs/docs/cmd/spo/list/list-view-set.md +2 -2
- package/docs/docs/cmd/spo/listitem/listitem-get.md +14 -5
- package/docs/docs/cmd/spo/listitem/listitem-retentionlabel-ensure.md +15 -2
- package/docs/docs/cmd/teams/team/team-list.md +44 -4
- package/docs/docs/cmd/todo/task/task-set.md +50 -0
- package/package.json +2 -1
|
@@ -15,11 +15,10 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _SpoApplicationCustomizerAddCommand_instances, _SpoApplicationCustomizerAddCommand_initOptions, _SpoApplicationCustomizerAddCommand_initTelemetry, _SpoApplicationCustomizerAddCommand_initValidators;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const
|
|
18
|
+
const request_1 = require("../../../../request");
|
|
19
19
|
const validation_1 = require("../../../../utils/validation");
|
|
20
20
|
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
21
21
|
const commands_1 = require("../../commands");
|
|
22
|
-
const spoCustomActionAddCommand = require("../customaction/customaction-add");
|
|
23
22
|
class SpoApplicationCustomizerAddCommand extends SpoCommand_1.default {
|
|
24
23
|
get name() {
|
|
25
24
|
return commands_1.default.APPLICATIONCUSTOMIZER_ADD;
|
|
@@ -39,17 +38,25 @@ class SpoApplicationCustomizerAddCommand extends SpoCommand_1.default {
|
|
|
39
38
|
if (this.verbose) {
|
|
40
39
|
logger.logToStderr(`Adding application customizer with title '${args.options.title}' and clientSideComponentId '${args.options.clientSideComponentId}' to the site`);
|
|
41
40
|
}
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
clientSideComponentProperties: args.options.clientSideComponentProperties || '',
|
|
48
|
-
location: 'ClientSideExtension.ApplicationCustomizer',
|
|
49
|
-
debug: this.debug,
|
|
50
|
-
verbose: this.verbose
|
|
41
|
+
const requestBody = {
|
|
42
|
+
Title: args.options.title,
|
|
43
|
+
Name: args.options.title,
|
|
44
|
+
Location: 'ClientSideExtension.ApplicationCustomizer',
|
|
45
|
+
ClientSideComponentId: args.options.clientSideComponentId
|
|
51
46
|
};
|
|
52
|
-
|
|
47
|
+
if (args.options.clientSideComponentProperties) {
|
|
48
|
+
requestBody.ClientSideComponentProperties = args.options.clientSideComponentProperties;
|
|
49
|
+
}
|
|
50
|
+
const scope = args.options.scope || 'Site';
|
|
51
|
+
const requestOptions = {
|
|
52
|
+
url: `${args.options.webUrl}/_api/${scope}/UserCustomActions`,
|
|
53
|
+
headers: {
|
|
54
|
+
accept: 'application/json;odata=nometadata'
|
|
55
|
+
},
|
|
56
|
+
data: requestBody,
|
|
57
|
+
responseType: 'json'
|
|
58
|
+
};
|
|
59
|
+
yield request_1.default.post(requestOptions);
|
|
53
60
|
});
|
|
54
61
|
}
|
|
55
62
|
}
|
|
@@ -62,11 +69,14 @@ _SpoApplicationCustomizerAddCommand_instances = new WeakSet(), _SpoApplicationCu
|
|
|
62
69
|
option: '-i, --clientSideComponentId <clientSideComponentId>'
|
|
63
70
|
}, {
|
|
64
71
|
option: '--clientSideComponentProperties [clientSideComponentProperties]'
|
|
72
|
+
}, {
|
|
73
|
+
option: '-s, --scope [scope]', autocomplete: SpoApplicationCustomizerAddCommand.scopes
|
|
65
74
|
});
|
|
66
75
|
}, _SpoApplicationCustomizerAddCommand_initTelemetry = function _SpoApplicationCustomizerAddCommand_initTelemetry() {
|
|
67
76
|
this.telemetry.push((args) => {
|
|
68
77
|
Object.assign(this.telemetryProperties, {
|
|
69
|
-
clientSideComponentProperties: typeof args.options.clientSideComponentProperties !== 'undefined'
|
|
78
|
+
clientSideComponentProperties: typeof args.options.clientSideComponentProperties !== 'undefined',
|
|
79
|
+
scope: typeof args.options.scope !== 'undefined'
|
|
70
80
|
});
|
|
71
81
|
});
|
|
72
82
|
}, _SpoApplicationCustomizerAddCommand_initValidators = function _SpoApplicationCustomizerAddCommand_initValidators() {
|
|
@@ -88,8 +98,12 @@ _SpoApplicationCustomizerAddCommand_instances = new WeakSet(), _SpoApplicationCu
|
|
|
88
98
|
return `An error has occurred while parsing clientSideComponentProperties: ${e}`;
|
|
89
99
|
}
|
|
90
100
|
}
|
|
101
|
+
if (args.options.scope && SpoApplicationCustomizerAddCommand.scopes.indexOf(args.options.scope) < 0) {
|
|
102
|
+
return `${args.options.scope} is not a valid value for allowedMembers. Valid values are ${SpoApplicationCustomizerAddCommand.scopes.join(', ')}`;
|
|
103
|
+
}
|
|
91
104
|
return true;
|
|
92
105
|
}));
|
|
93
106
|
};
|
|
107
|
+
SpoApplicationCustomizerAddCommand.scopes = ['Site', 'Web'];
|
|
94
108
|
module.exports = new SpoApplicationCustomizerAddCommand();
|
|
95
109
|
//# sourceMappingURL=applicationcustomizer-add.js.map
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
12
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
13
|
+
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");
|
|
14
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15
|
+
};
|
|
16
|
+
var _SpoApplicationCustomizerListCommand_instances, _SpoApplicationCustomizerListCommand_initOptions, _SpoApplicationCustomizerListCommand_initTelemetry, _SpoApplicationCustomizerListCommand_initValidators;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const spo_1 = require("../../../../utils/spo");
|
|
19
|
+
const validation_1 = require("../../../../utils/validation");
|
|
20
|
+
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
21
|
+
const commands_1 = require("../../commands");
|
|
22
|
+
class SpoApplicationCustomizerListCommand extends SpoCommand_1.default {
|
|
23
|
+
get name() {
|
|
24
|
+
return commands_1.default.APPLICATIONCUSTOMIZER_LIST;
|
|
25
|
+
}
|
|
26
|
+
get description() {
|
|
27
|
+
return 'Get a list of application customizers that are added to a site.';
|
|
28
|
+
}
|
|
29
|
+
defaultProperties() {
|
|
30
|
+
return ['Name', 'Location', 'Scope', 'Id'];
|
|
31
|
+
}
|
|
32
|
+
constructor() {
|
|
33
|
+
super();
|
|
34
|
+
_SpoApplicationCustomizerListCommand_instances.add(this);
|
|
35
|
+
__classPrivateFieldGet(this, _SpoApplicationCustomizerListCommand_instances, "m", _SpoApplicationCustomizerListCommand_initTelemetry).call(this);
|
|
36
|
+
__classPrivateFieldGet(this, _SpoApplicationCustomizerListCommand_instances, "m", _SpoApplicationCustomizerListCommand_initOptions).call(this);
|
|
37
|
+
__classPrivateFieldGet(this, _SpoApplicationCustomizerListCommand_instances, "m", _SpoApplicationCustomizerListCommand_initValidators).call(this);
|
|
38
|
+
}
|
|
39
|
+
commandAction(logger, args) {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
if (this.verbose) {
|
|
42
|
+
logger.logToStderr(`Retrieving application customizers...`);
|
|
43
|
+
}
|
|
44
|
+
const applicationCustomizers = yield spo_1.spo.getCustomActions(args.options.webUrl, args.options.scope, `Location eq 'ClientSideExtension.ApplicationCustomizer'`);
|
|
45
|
+
logger.log(applicationCustomizers);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
_SpoApplicationCustomizerListCommand_instances = new WeakSet(), _SpoApplicationCustomizerListCommand_initOptions = function _SpoApplicationCustomizerListCommand_initOptions() {
|
|
50
|
+
this.options.unshift({
|
|
51
|
+
option: '-u, --webUrl <webUrl>'
|
|
52
|
+
}, {
|
|
53
|
+
option: '-s, --scope [scope]',
|
|
54
|
+
autocomplete: SpoApplicationCustomizerListCommand.scopes
|
|
55
|
+
});
|
|
56
|
+
}, _SpoApplicationCustomizerListCommand_initTelemetry = function _SpoApplicationCustomizerListCommand_initTelemetry() {
|
|
57
|
+
this.telemetry.push((args) => {
|
|
58
|
+
Object.assign(this.telemetryProperties, {
|
|
59
|
+
scope: typeof args.options.scope !== 'undefined'
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
}, _SpoApplicationCustomizerListCommand_initValidators = function _SpoApplicationCustomizerListCommand_initValidators() {
|
|
63
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
if (args.options.scope && SpoApplicationCustomizerListCommand.scopes.indexOf(args.options.scope) < 0) {
|
|
65
|
+
return `${args.options.scope} is not a valid scope. Allowed values are ${SpoApplicationCustomizerListCommand.scopes.join(', ')}`;
|
|
66
|
+
}
|
|
67
|
+
return validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
68
|
+
}));
|
|
69
|
+
};
|
|
70
|
+
SpoApplicationCustomizerListCommand.scopes = ['All', 'Site', 'Web'];
|
|
71
|
+
module.exports = new SpoApplicationCustomizerListCommand();
|
|
72
|
+
//# sourceMappingURL=applicationcustomizer-list.js.map
|
|
@@ -48,7 +48,8 @@ class SpoCommandSetAddCommand extends SpoCommand_1.default {
|
|
|
48
48
|
Title: args.options.title,
|
|
49
49
|
Location: location,
|
|
50
50
|
ClientSideComponentId: args.options.clientSideComponentId,
|
|
51
|
-
RegistrationId: listType
|
|
51
|
+
RegistrationId: listType,
|
|
52
|
+
RegistrationType: 1
|
|
52
53
|
};
|
|
53
54
|
if (args.options.clientSideComponentProperties) {
|
|
54
55
|
requestBody.ClientSideComponentProperties = args.options.clientSideComponentProperties;
|
|
@@ -58,36 +58,39 @@ class SpoCommandSetRemoveCommand extends SpoCommand_1.default {
|
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
|
-
|
|
61
|
+
getCustomAction(options) {
|
|
62
62
|
return __awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
let commandSets = [];
|
|
63
64
|
if (options.id) {
|
|
64
|
-
|
|
65
|
+
const commandSet = yield spo_1.spo.getCustomActionById(options.webUrl, options.id, options.scope);
|
|
66
|
+
if (commandSet) {
|
|
67
|
+
commandSets.push(commandSet);
|
|
68
|
+
}
|
|
65
69
|
}
|
|
66
|
-
|
|
67
|
-
if (options.title) {
|
|
70
|
+
else if (options.title) {
|
|
68
71
|
commandSets = yield spo_1.spo.getCustomActions(options.webUrl, options.scope, `(Title eq '${formatting_1.formatting.encodeQueryParameter(options.title)}') and (startswith(Location,'ClientSideExtension.ListViewCommandSet'))`);
|
|
69
72
|
}
|
|
70
73
|
else {
|
|
71
74
|
commandSets = yield spo_1.spo.getCustomActions(options.webUrl, options.scope, `(ClientSideComponentId eq guid'${options.clientSideComponentId}') and (startswith(Location,'ClientSideExtension.ListViewCommandSet'))`);
|
|
72
75
|
}
|
|
73
76
|
if (commandSets.length === 0) {
|
|
74
|
-
throw `No user commandsets with ${options.title
|
|
77
|
+
throw `No user commandsets with ${options.title && `title '${options.title}'` || options.clientSideComponentId && `ClientSideComponentId '${options.clientSideComponentId}'` || options.id && `id '${options.id}'`} found`;
|
|
75
78
|
}
|
|
76
79
|
if (commandSets.length > 1) {
|
|
77
80
|
throw `Multiple user commandsets with ${options.title ? `title '${options.title}'` : `ClientSideComponentId '${options.clientSideComponentId}'`} found. Please disambiguate using IDs: ${commandSets.map((commandSet) => commandSet.Id).join(', ')}`;
|
|
78
81
|
}
|
|
79
|
-
return commandSets[0]
|
|
82
|
+
return commandSets[0];
|
|
80
83
|
});
|
|
81
84
|
}
|
|
82
85
|
deleteCommandset(args) {
|
|
83
86
|
return __awaiter(this, void 0, void 0, function* () {
|
|
84
87
|
if (!args.options.scope) {
|
|
85
|
-
args.options.scope = '
|
|
88
|
+
args.options.scope = 'All';
|
|
86
89
|
}
|
|
87
90
|
try {
|
|
88
|
-
const
|
|
91
|
+
const customAction = yield this.getCustomAction(args.options);
|
|
89
92
|
const requestOptions = {
|
|
90
|
-
url: `${args.options.webUrl}/_api/${
|
|
93
|
+
url: `${args.options.webUrl}/_api/${customAction.Scope === 3 ? "Web" : "Site"}/UserCustomActions('${formatting_1.formatting.encodeQueryParameter(customAction.Id)}')`,
|
|
91
94
|
headers: {
|
|
92
95
|
accept: 'application/json;odata=nometadata'
|
|
93
96
|
},
|
|
@@ -42,7 +42,7 @@ class SpoCommandSetSetCommand extends SpoCommand_1.default {
|
|
|
42
42
|
logger.logToStderr(`Updating ListView Command Set ${args.options.clientSideComponentId} to site '${args.options.webUrl}'...`);
|
|
43
43
|
}
|
|
44
44
|
if (!args.options.scope) {
|
|
45
|
-
args.options.scope = '
|
|
45
|
+
args.options.scope = 'All';
|
|
46
46
|
}
|
|
47
47
|
const location = this.getLocation(args.options.location ? args.options.location : '');
|
|
48
48
|
try {
|
|
@@ -59,9 +59,9 @@ class SpoCommandSetSetCommand extends SpoCommand_1.default {
|
|
|
59
59
|
if (args.options.clientSideComponentProperties) {
|
|
60
60
|
requestBody.ClientSideComponentProperties = args.options.clientSideComponentProperties;
|
|
61
61
|
}
|
|
62
|
-
const
|
|
62
|
+
const customAction = yield this.getCustomAction(args.options);
|
|
63
63
|
const requestOptions = {
|
|
64
|
-
url: `${args.options.webUrl}/_api/${
|
|
64
|
+
url: `${args.options.webUrl}/_api/${customAction.Scope === 3 ? "Web" : "Site"}/UserCustomActions('${formatting_1.formatting.encodeQueryParameter(customAction.Id)}')`,
|
|
65
65
|
headers: {
|
|
66
66
|
accept: 'application/json;odata=nometadata',
|
|
67
67
|
'X-HTTP-Method': 'MERGE'
|
|
@@ -76,25 +76,28 @@ class SpoCommandSetSetCommand extends SpoCommand_1.default {
|
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
|
-
|
|
79
|
+
getCustomAction(options) {
|
|
80
80
|
return __awaiter(this, void 0, void 0, function* () {
|
|
81
|
+
let commandSets = [];
|
|
81
82
|
if (options.id) {
|
|
82
|
-
|
|
83
|
+
const commandSet = yield spo_1.spo.getCustomActionById(options.webUrl, options.id, options.scope);
|
|
84
|
+
if (commandSet) {
|
|
85
|
+
commandSets.push(commandSet);
|
|
86
|
+
}
|
|
83
87
|
}
|
|
84
|
-
|
|
85
|
-
if (options.title) {
|
|
88
|
+
else if (options.title) {
|
|
86
89
|
commandSets = yield spo_1.spo.getCustomActions(options.webUrl, options.scope, `(Title eq '${formatting_1.formatting.encodeQueryParameter(options.title)}') and (startswith(Location,'ClientSideExtension.ListViewCommandSet'))`);
|
|
87
90
|
}
|
|
88
91
|
else {
|
|
89
92
|
commandSets = yield spo_1.spo.getCustomActions(options.webUrl, options.scope, `(ClientSideComponentId eq guid'${options.clientSideComponentId}') and (startswith(Location,'ClientSideExtension.ListViewCommandSet'))`);
|
|
90
93
|
}
|
|
91
94
|
if (commandSets.length === 0) {
|
|
92
|
-
throw `No user commandsets with ${options.title
|
|
95
|
+
throw `No user commandsets with ${options.title && `title '${options.title}'` || options.clientSideComponentId && `ClientSideComponentId '${options.clientSideComponentId}'` || options.id && `id '${options.id}'`} found`;
|
|
93
96
|
}
|
|
94
97
|
if (commandSets.length > 1) {
|
|
95
98
|
throw `Multiple user commandsets with ${options.title ? `title '${options.title}'` : `ClientSideComponentId '${options.clientSideComponentId}'`} found. Please disambiguate using IDs: ${commandSets.map((commandSet) => commandSet.Id).join(', ')}`;
|
|
96
99
|
}
|
|
97
|
-
return commandSets[0]
|
|
100
|
+
return commandSets[0];
|
|
98
101
|
});
|
|
99
102
|
}
|
|
100
103
|
getLocation(location) {
|
|
@@ -147,7 +147,7 @@ class SpoFileMoveCommand extends SpoCommand_1.default {
|
|
|
147
147
|
yield Cli_1.Cli.executeCommand(removeCommand, { options: Object.assign(Object.assign({}, removeOptions), { _: [] }) });
|
|
148
148
|
}
|
|
149
149
|
catch (err) {
|
|
150
|
-
if (err
|
|
150
|
+
if (err !== undefined && err.message !== undefined && err.message.includes('does not exist')) {
|
|
151
151
|
}
|
|
152
152
|
else {
|
|
153
153
|
throw err;
|
|
@@ -42,6 +42,9 @@ class SpoFileRetentionLabelEnsureCommand extends SpoCommand_1.default {
|
|
|
42
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
43
|
try {
|
|
44
44
|
const fileProperties = yield this.getFileProperties(logger, args);
|
|
45
|
+
if (args.options.assetId) {
|
|
46
|
+
yield this.applyAssetId(args.options.webUrl, fileProperties.ListItemAllFields.ParentList.Id, fileProperties.ListItemAllFields.Id, args.options.assetId);
|
|
47
|
+
}
|
|
45
48
|
const options = {
|
|
46
49
|
webUrl: args.options.webUrl,
|
|
47
50
|
listId: fileProperties.ListItemAllFields.ParentList.Id,
|
|
@@ -84,12 +87,28 @@ class SpoFileRetentionLabelEnsureCommand extends SpoCommand_1.default {
|
|
|
84
87
|
return yield request_1.default.get(requestOptions);
|
|
85
88
|
});
|
|
86
89
|
}
|
|
90
|
+
applyAssetId(webUrl, listId, listItemId, assetId) {
|
|
91
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
+
const requestUrl = `${webUrl}/_api/web/lists(guid'${formatting_1.formatting.encodeQueryParameter(listId)}')`;
|
|
93
|
+
const requestBody = { "formValues": [{ "FieldName": "ComplianceAssetId", "FieldValue": assetId }] };
|
|
94
|
+
const requestOptions = {
|
|
95
|
+
url: `${requestUrl}/items(${listItemId})/ValidateUpdateListItem()`,
|
|
96
|
+
headers: {
|
|
97
|
+
'accept': 'application/json;odata=nometadata'
|
|
98
|
+
},
|
|
99
|
+
data: requestBody,
|
|
100
|
+
responseType: 'json'
|
|
101
|
+
};
|
|
102
|
+
yield request_1.default.post(requestOptions);
|
|
103
|
+
});
|
|
104
|
+
}
|
|
87
105
|
}
|
|
88
106
|
_SpoFileRetentionLabelEnsureCommand_instances = new WeakSet(), _SpoFileRetentionLabelEnsureCommand_initTelemetry = function _SpoFileRetentionLabelEnsureCommand_initTelemetry() {
|
|
89
107
|
this.telemetry.push((args) => {
|
|
90
108
|
Object.assign(this.telemetryProperties, {
|
|
91
109
|
fileUrl: typeof args.options.fileUrl !== 'undefined',
|
|
92
|
-
fileId: typeof args.options.fileId !== 'undefined'
|
|
110
|
+
fileId: typeof args.options.fileId !== 'undefined',
|
|
111
|
+
assetId: typeof args.options.assetId !== 'undefined'
|
|
93
112
|
});
|
|
94
113
|
});
|
|
95
114
|
}, _SpoFileRetentionLabelEnsureCommand_initOptions = function _SpoFileRetentionLabelEnsureCommand_initOptions() {
|
|
@@ -101,6 +120,8 @@ _SpoFileRetentionLabelEnsureCommand_instances = new WeakSet(), _SpoFileRetention
|
|
|
101
120
|
option: '--fileUrl [fileUrl]'
|
|
102
121
|
}, {
|
|
103
122
|
option: '-i, --fileId [fileId]'
|
|
123
|
+
}, {
|
|
124
|
+
option: '-a, --assetId [assetId]'
|
|
104
125
|
});
|
|
105
126
|
}, _SpoFileRetentionLabelEnsureCommand_initValidators = function _SpoFileRetentionLabelEnsureCommand_initValidators() {
|
|
106
127
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -58,8 +58,14 @@ class SpoListItemGetCommand extends SpoCommand_1.default {
|
|
|
58
58
|
const propertiesToExpand = propertiesWithSlash.map(e => e.split('/')[0]);
|
|
59
59
|
const expandPropertiesArray = propertiesToExpand.filter((item, pos) => propertiesToExpand.indexOf(item) === pos);
|
|
60
60
|
const fieldExpand = expandPropertiesArray.length > 0 ? `&$expand=${expandPropertiesArray.join(",")}` : ``;
|
|
61
|
+
if (args.options.id) {
|
|
62
|
+
requestUrl += `/items(${args.options.id})`;
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
requestUrl += `/GetItemByUniqueId(guid'${args.options.uniqueId}')`;
|
|
66
|
+
}
|
|
61
67
|
const requestOptions = {
|
|
62
|
-
url: `${requestUrl}
|
|
68
|
+
url: `${requestUrl}?$select=${formatting_1.formatting.encodeQueryParameter(propertiesSelect.join(","))}${fieldExpand}`,
|
|
63
69
|
headers: {
|
|
64
70
|
'accept': 'application/json;odata=nometadata'
|
|
65
71
|
},
|
|
@@ -68,7 +74,7 @@ class SpoListItemGetCommand extends SpoCommand_1.default {
|
|
|
68
74
|
try {
|
|
69
75
|
const itemProperties = yield request_1.default.get(requestOptions);
|
|
70
76
|
if (args.options.withPermissions) {
|
|
71
|
-
requestOptions.url = `${requestUrl}/
|
|
77
|
+
requestOptions.url = `${requestUrl}/RoleAssignments?$expand=Member,RoleDefinitionBindings`;
|
|
72
78
|
const response = yield request_1.default.get(requestOptions);
|
|
73
79
|
response.value.forEach((r) => {
|
|
74
80
|
r.RoleDefinitionBindings = formatting_1.formatting.setFriendlyPermissions(r.RoleDefinitionBindings);
|
|
@@ -90,6 +96,8 @@ _SpoListItemGetCommand_instances = new WeakSet(), _SpoListItemGetCommand_initTel
|
|
|
90
96
|
listId: typeof args.options.listId !== 'undefined',
|
|
91
97
|
listTitle: typeof args.options.listTitle !== 'undefined',
|
|
92
98
|
listUrl: typeof args.options.listUrl !== 'undefined',
|
|
99
|
+
id: typeof args.options.id !== 'undefined',
|
|
100
|
+
uniqueId: typeof args.options.uniqueId !== 'undefined',
|
|
93
101
|
withPermissions: !!args.options.withPermissions
|
|
94
102
|
});
|
|
95
103
|
});
|
|
@@ -97,7 +105,9 @@ _SpoListItemGetCommand_instances = new WeakSet(), _SpoListItemGetCommand_initTel
|
|
|
97
105
|
this.options.unshift({
|
|
98
106
|
option: '-u, --webUrl <webUrl>'
|
|
99
107
|
}, {
|
|
100
|
-
option: '-i, --id
|
|
108
|
+
option: '-i, --id [id]'
|
|
109
|
+
}, {
|
|
110
|
+
option: '--uniqueId [uniqueId]'
|
|
101
111
|
}, {
|
|
102
112
|
option: '-l, --listId [listId]'
|
|
103
113
|
}, {
|
|
@@ -119,15 +129,20 @@ _SpoListItemGetCommand_instances = new WeakSet(), _SpoListItemGetCommand_initTel
|
|
|
119
129
|
!validation_1.validation.isValidGuid(args.options.listId)) {
|
|
120
130
|
return `${args.options.listId} in option listId is not a valid GUID`;
|
|
121
131
|
}
|
|
122
|
-
if (
|
|
132
|
+
if (args.options.id &&
|
|
133
|
+
isNaN(parseInt(args.options.id))) {
|
|
123
134
|
return `${args.options.id} is not a number`;
|
|
124
135
|
}
|
|
136
|
+
if (args.options.uniqueId &&
|
|
137
|
+
!validation_1.validation.isValidGuid(args.options.uniqueId)) {
|
|
138
|
+
return `${args.options.uniqueId} in option uniqueId is not a valid GUID`;
|
|
139
|
+
}
|
|
125
140
|
return true;
|
|
126
141
|
}));
|
|
127
142
|
}, _SpoListItemGetCommand_initTypes = function _SpoListItemGetCommand_initTypes() {
|
|
128
|
-
this.types.string.push('webUrl', 'listId', 'listTitle', 'id', 'properties');
|
|
143
|
+
this.types.string.push('webUrl', 'listId', 'listTitle', 'id', 'uniqueId', 'properties');
|
|
129
144
|
}, _SpoListItemGetCommand_initOptionSets = function _SpoListItemGetCommand_initOptionSets() {
|
|
130
|
-
this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] });
|
|
145
|
+
this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] }, { options: ['id', 'uniqueId'] });
|
|
131
146
|
};
|
|
132
147
|
module.exports = new SpoListItemGetCommand();
|
|
133
148
|
//# sourceMappingURL=listitem-get.js.map
|
|
@@ -42,6 +42,9 @@ class SpoListItemRetentionLabelEnsureCommand extends SpoCommand_1.default {
|
|
|
42
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
43
|
try {
|
|
44
44
|
const labelInformation = yield this.getLabelInformation(args.options, logger);
|
|
45
|
+
if (args.options.assetId) {
|
|
46
|
+
yield this.applyAssetId(args.options, logger);
|
|
47
|
+
}
|
|
45
48
|
yield this.applyLabel(args.options, labelInformation, logger);
|
|
46
49
|
}
|
|
47
50
|
catch (err) {
|
|
@@ -106,6 +109,34 @@ class SpoListItemRetentionLabelEnsureCommand extends SpoCommand_1.default {
|
|
|
106
109
|
yield request_1.default.post(requestOptions);
|
|
107
110
|
});
|
|
108
111
|
}
|
|
112
|
+
applyAssetId(options, logger) {
|
|
113
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
114
|
+
if (this.verbose) {
|
|
115
|
+
logger.logToStderr(`Applying the asset Id ${options.assetId}...`);
|
|
116
|
+
}
|
|
117
|
+
let requestUrl = `${options.webUrl}/_api/web`;
|
|
118
|
+
if (options.listId) {
|
|
119
|
+
requestUrl += `/lists(guid'${formatting_1.formatting.encodeQueryParameter(options.listId)}')/items(${options.listItemId})/ValidateUpdateListItem()`;
|
|
120
|
+
}
|
|
121
|
+
else if (options.listTitle) {
|
|
122
|
+
requestUrl += `/lists/getByTitle('${formatting_1.formatting.encodeQueryParameter(options.listTitle)}')/items(${options.listItemId})/ValidateUpdateListItem()`;
|
|
123
|
+
}
|
|
124
|
+
else if (options.listUrl) {
|
|
125
|
+
const listServerRelativeUrl = urlUtil_1.urlUtil.getServerRelativePath(options.webUrl, options.listUrl);
|
|
126
|
+
requestUrl += `/GetList(@listUrl)/items(${options.listItemId})/ValidateUpdateListItem()?@listUrl='${formatting_1.formatting.encodeQueryParameter(listServerRelativeUrl)}'`;
|
|
127
|
+
}
|
|
128
|
+
const requestBody = { "formValues": [{ "FieldName": "ComplianceAssetId", "FieldValue": options.assetId }] };
|
|
129
|
+
const requestOptions = {
|
|
130
|
+
url: requestUrl,
|
|
131
|
+
headers: {
|
|
132
|
+
'accept': 'application/json;odata=nometadata'
|
|
133
|
+
},
|
|
134
|
+
data: requestBody,
|
|
135
|
+
responseType: 'json'
|
|
136
|
+
};
|
|
137
|
+
yield request_1.default.post(requestOptions);
|
|
138
|
+
});
|
|
139
|
+
}
|
|
109
140
|
}
|
|
110
141
|
_SpoListItemRetentionLabelEnsureCommand_instances = new WeakSet(), _SpoListItemRetentionLabelEnsureCommand_initTelemetry = function _SpoListItemRetentionLabelEnsureCommand_initTelemetry() {
|
|
111
142
|
this.telemetry.push((args) => {
|
|
@@ -114,7 +145,8 @@ _SpoListItemRetentionLabelEnsureCommand_instances = new WeakSet(), _SpoListItemR
|
|
|
114
145
|
listTitle: typeof args.options.listTitle !== 'undefined',
|
|
115
146
|
listUrl: typeof args.options.listUrl !== 'undefined',
|
|
116
147
|
name: typeof args.options.name !== 'undefined',
|
|
117
|
-
id: typeof args.options.id !== 'undefined'
|
|
148
|
+
id: typeof args.options.id !== 'undefined',
|
|
149
|
+
assetId: typeof args.options.assetId !== 'undefined'
|
|
118
150
|
});
|
|
119
151
|
});
|
|
120
152
|
}, _SpoListItemRetentionLabelEnsureCommand_initOptions = function _SpoListItemRetentionLabelEnsureCommand_initOptions() {
|
|
@@ -132,6 +164,8 @@ _SpoListItemRetentionLabelEnsureCommand_instances = new WeakSet(), _SpoListItemR
|
|
|
132
164
|
option: '-n, --name [name]'
|
|
133
165
|
}, {
|
|
134
166
|
option: '-i, --id [id]'
|
|
167
|
+
}, {
|
|
168
|
+
option: '-a, --assetId [assetId]'
|
|
135
169
|
});
|
|
136
170
|
}, _SpoListItemRetentionLabelEnsureCommand_initValidators = function _SpoListItemRetentionLabelEnsureCommand_initValidators() {
|
|
137
171
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -69,20 +69,37 @@ class SpoWebSetCommand extends SpoCommand_1.default {
|
|
|
69
69
|
const searchScope = args.options.searchScope.toLowerCase();
|
|
70
70
|
payload.SearchScope = SpoWebSetCommand.searchScopeOptions.indexOf(searchScope);
|
|
71
71
|
}
|
|
72
|
-
const requestOptions = {
|
|
73
|
-
url: `${args.options.url}/_api/web`,
|
|
74
|
-
headers: {
|
|
75
|
-
'content-type': 'application/json;odata=nometadata',
|
|
76
|
-
accept: 'application/json;odata=nometadata'
|
|
77
|
-
},
|
|
78
|
-
responseType: 'json',
|
|
79
|
-
data: payload
|
|
80
|
-
};
|
|
81
|
-
if (this.verbose) {
|
|
82
|
-
logger.logToStderr(`Updating properties of subsite ${args.options.url}...`);
|
|
83
|
-
}
|
|
84
72
|
try {
|
|
73
|
+
const requestOptions = {
|
|
74
|
+
url: `${args.options.url}/_api/web`,
|
|
75
|
+
headers: {
|
|
76
|
+
'content-type': 'application/json;odata=nometadata',
|
|
77
|
+
accept: 'application/json;odata=nometadata'
|
|
78
|
+
},
|
|
79
|
+
responseType: 'json',
|
|
80
|
+
data: payload
|
|
81
|
+
};
|
|
82
|
+
if (this.verbose) {
|
|
83
|
+
logger.logToStderr(`Updating properties of subsite ${args.options.url}...`);
|
|
84
|
+
}
|
|
85
85
|
yield request_1.default.patch(requestOptions);
|
|
86
|
+
if (typeof args.options.welcomePage !== 'undefined') {
|
|
87
|
+
if (this.verbose) {
|
|
88
|
+
logger.logToStderr(`Setting welcome page to: ${args.options.welcomePage}...`);
|
|
89
|
+
}
|
|
90
|
+
const requestOptions = {
|
|
91
|
+
url: `${args.options.url}/_api/web/RootFolder`,
|
|
92
|
+
headers: {
|
|
93
|
+
'content-type': 'application/json;odata=nometadata',
|
|
94
|
+
accept: 'application/json;odata=nometadata'
|
|
95
|
+
},
|
|
96
|
+
responseType: 'json',
|
|
97
|
+
data: {
|
|
98
|
+
WelcomePage: args.options.welcomePage
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
yield request_1.default.patch(requestOptions);
|
|
102
|
+
}
|
|
86
103
|
}
|
|
87
104
|
catch (err) {
|
|
88
105
|
this.handleRejectedODataJsonPromise(err);
|
|
@@ -105,7 +122,8 @@ _SpoWebSetCommand_instances = new WeakSet(), _SpoWebSetCommand_initTelemetry = f
|
|
|
105
122
|
quickLaunchEnabled: typeof args.options.quickLaunchEnabled !== 'undefined',
|
|
106
123
|
footerEnabled: typeof args.options.footerEnabled !== 'undefined',
|
|
107
124
|
navAudienceTargetingEnabled: typeof args.options.navAudienceTargetingEnabled !== 'undefined',
|
|
108
|
-
searchScope: args.options.searchScope !== 'undefined'
|
|
125
|
+
searchScope: typeof args.options.searchScope !== 'undefined',
|
|
126
|
+
welcomePage: typeof args.options.welcomePage !== 'undefined'
|
|
109
127
|
});
|
|
110
128
|
this.trackUnknownOptions(this.telemetryProperties, args.options);
|
|
111
129
|
});
|
|
@@ -139,6 +157,8 @@ _SpoWebSetCommand_instances = new WeakSet(), _SpoWebSetCommand_initTelemetry = f
|
|
|
139
157
|
}, {
|
|
140
158
|
option: '--searchScope [searchScope]',
|
|
141
159
|
autocomplete: SpoWebSetCommand.searchScopeOptions
|
|
160
|
+
}, {
|
|
161
|
+
option: '--welcomePage [welcomePage]'
|
|
142
162
|
});
|
|
143
163
|
}, _SpoWebSetCommand_initTypes = function _SpoWebSetCommand_initTypes() {
|
|
144
164
|
this.types.boolean.push('megaMenuEnabled', 'footerEnabled', 'quickLaunchEnabled', 'navAudienceTargetingEnabled');
|
|
@@ -14,6 +14,7 @@ exports.default = {
|
|
|
14
14
|
APP_UNINSTALL: `${prefix} app uninstall`,
|
|
15
15
|
APP_UPGRADE: `${prefix} app upgrade`,
|
|
16
16
|
APPLICATIONCUSTOMIZER_ADD: `${prefix} applicationcustomizer add`,
|
|
17
|
+
APPLICATIONCUSTOMIZER_LIST: `${prefix} applicationcustomizer list`,
|
|
17
18
|
APPPAGE_ADD: `${prefix} apppage add`,
|
|
18
19
|
APPPAGE_SET: `${prefix} apppage set`,
|
|
19
20
|
CDN_GET: `${prefix} cdn get`,
|
|
@@ -26,6 +26,9 @@ class TeamsTeamListCommand extends GraphCommand_1.default {
|
|
|
26
26
|
get description() {
|
|
27
27
|
return 'Lists Microsoft Teams in the current tenant';
|
|
28
28
|
}
|
|
29
|
+
defaultProperties() {
|
|
30
|
+
return ['id', 'displayName', 'isArchived', 'description'];
|
|
31
|
+
}
|
|
29
32
|
constructor() {
|
|
30
33
|
super();
|
|
31
34
|
_TeamsTeamListCommand_instances.add(this);
|
|
@@ -67,12 +70,7 @@ class TeamsTeamListCommand extends GraphCommand_1.default {
|
|
|
67
70
|
request_1.default
|
|
68
71
|
.get(requestOptions)
|
|
69
72
|
.then((res) => {
|
|
70
|
-
resolve(
|
|
71
|
-
id: group.id,
|
|
72
|
-
displayName: group.displayName,
|
|
73
|
-
isArchived: res.isArchived,
|
|
74
|
-
description: group.description
|
|
75
|
-
});
|
|
73
|
+
resolve(res);
|
|
76
74
|
}, (err) => {
|
|
77
75
|
// If the user is not member of the team he/she cannot access it
|
|
78
76
|
if (err.statusCode === 403) {
|
|
@@ -108,6 +108,15 @@ class TodoTaskSetCommand extends GraphCommand_1.default {
|
|
|
108
108
|
if (options.reminderDateTime) {
|
|
109
109
|
requestBody.reminderDateTime = this.getDateTimeTimeZone(options.reminderDateTime);
|
|
110
110
|
}
|
|
111
|
+
if (options.categories) {
|
|
112
|
+
requestBody.categories = options.categories.split(',');
|
|
113
|
+
}
|
|
114
|
+
if (options.completedDateTime) {
|
|
115
|
+
requestBody.completedDateTime = this.getDateTimeTimeZone(options.completedDateTime);
|
|
116
|
+
}
|
|
117
|
+
if (options.startDateTime) {
|
|
118
|
+
requestBody.startDateTime = this.getDateTimeTimeZone(options.startDateTime);
|
|
119
|
+
}
|
|
111
120
|
return requestBody;
|
|
112
121
|
}
|
|
113
122
|
}
|
|
@@ -122,7 +131,10 @@ _TodoTaskSetCommand_instances = new WeakSet(), _TodoTaskSetCommand_initTelemetry
|
|
|
122
131
|
bodyContentType: args.options.bodyContentType,
|
|
123
132
|
dueDateTime: typeof args.options.dueDateTime !== 'undefined',
|
|
124
133
|
importance: args.options.importance,
|
|
125
|
-
reminderDateTime: typeof args.options.reminderDateTime !== 'undefined'
|
|
134
|
+
reminderDateTime: typeof args.options.reminderDateTime !== 'undefined',
|
|
135
|
+
categories: typeof args.options.categories !== 'undefined',
|
|
136
|
+
completedDateTime: typeof args.options.completedDateTime !== 'undefined',
|
|
137
|
+
startDateTime: typeof args.options.startDateTime !== 'undefined'
|
|
126
138
|
});
|
|
127
139
|
});
|
|
128
140
|
}, _TodoTaskSetCommand_initOptions = function _TodoTaskSetCommand_initOptions() {
|
|
@@ -149,6 +161,12 @@ _TodoTaskSetCommand_instances = new WeakSet(), _TodoTaskSetCommand_initTelemetry
|
|
|
149
161
|
autocomplete: ['low', 'normal', 'high']
|
|
150
162
|
}, {
|
|
151
163
|
option: '--reminderDateTime [reminderDateTime]'
|
|
164
|
+
}, {
|
|
165
|
+
option: '--categories [categories]'
|
|
166
|
+
}, {
|
|
167
|
+
option: '--completedDateTime [completedDateTime]'
|
|
168
|
+
}, {
|
|
169
|
+
option: '--startDateTime [startDateTime]'
|
|
152
170
|
});
|
|
153
171
|
}, _TodoTaskSetCommand_initValidators = function _TodoTaskSetCommand_initValidators() {
|
|
154
172
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -172,6 +190,12 @@ _TodoTaskSetCommand_instances = new WeakSet(), _TodoTaskSetCommand_initTelemetry
|
|
|
172
190
|
if (args.options.reminderDateTime && !validation_1.validation.isValidISODateTime(args.options.reminderDateTime)) {
|
|
173
191
|
return `'${args.options.reminderDateTime}' is not a valid ISO date string`;
|
|
174
192
|
}
|
|
193
|
+
if (args.options.completedDateTime && !validation_1.validation.isValidISODateTime(args.options.completedDateTime)) {
|
|
194
|
+
return `'${args.options.completedDateTime}' is not a valid datetime.`;
|
|
195
|
+
}
|
|
196
|
+
if (args.options.startDateTime && !validation_1.validation.isValidISODateTime(args.options.startDateTime)) {
|
|
197
|
+
return `'${args.options.startDateTime}' is not a valid datetime.`;
|
|
198
|
+
}
|
|
175
199
|
return true;
|
|
176
200
|
}));
|
|
177
201
|
}, _TodoTaskSetCommand_initOptionSets = function _TodoTaskSetCommand_initOptionSets() {
|
package/dist/settingsNames.js
CHANGED
|
@@ -15,7 +15,8 @@ const settingsNames = {
|
|
|
15
15
|
output: 'output',
|
|
16
16
|
printErrorsAsPlainText: 'printErrorsAsPlainText',
|
|
17
17
|
prompt: 'prompt',
|
|
18
|
-
showHelpOnFailure: 'showHelpOnFailure'
|
|
18
|
+
showHelpOnFailure: 'showHelpOnFailure',
|
|
19
|
+
showSpinner: 'showSpinner'
|
|
19
20
|
};
|
|
20
21
|
exports.settingsNames = settingsNames;
|
|
21
22
|
//# sourceMappingURL=settingsNames.js.map
|