@pnp/cli-microsoft365 6.9.0-beta.91abae4 → 6.9.0-beta.eff4ea7
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/dist/cli/Cli.js +16 -0
- package/dist/m365/cli/commands/config/config-set.js +1 -0
- package/dist/m365/planner/commands/bucket/bucket-add.js +15 -13
- package/dist/m365/planner/commands/bucket/bucket-get.js +27 -28
- package/dist/m365/planner/commands/bucket/bucket-list.js +15 -13
- package/dist/m365/planner/commands/bucket/bucket-remove.js +33 -34
- package/dist/m365/planner/commands/bucket/bucket-set.js +33 -34
- package/dist/m365/planner/commands/plan/plan-add.js +49 -52
- package/dist/m365/planner/commands/plan/plan-set.js +19 -20
- package/dist/m365/planner/commands/task/task-add.js +75 -78
- package/dist/m365/planner/commands/task/task-checklistitem-add.js +11 -10
- package/dist/m365/planner/commands/task/task-checklistitem-remove.js +10 -8
- package/dist/m365/planner/commands/task/task-get.js +53 -56
- package/dist/m365/planner/commands/task/task-list.js +23 -24
- package/dist/m365/planner/commands/task/task-reference-add.js +11 -10
- package/dist/m365/planner/commands/task/task-reference-remove.js +13 -14
- package/dist/m365/planner/commands/task/task-remove.js +44 -48
- package/dist/m365/planner/commands/task/task-set.js +83 -87
- package/dist/m365/pp/commands/card/card-get.js +6 -1
- package/dist/m365/purview/commands/retentionevent/retentionevent-add.js +0 -5
- package/dist/m365/purview/commands/retentionevent/retentionevent-get.js +0 -5
- package/dist/m365/purview/commands/retentionevent/retentionevent-list.js +0 -5
- package/dist/m365/purview/commands/retentionevent/retentionevent-remove.js +0 -5
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-add.js +0 -5
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-get.js +0 -5
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-list.js +0 -5
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-remove.js +0 -5
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-set.js +0 -5
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-add.js +0 -5
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-get.js +0 -5
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-list.js +0 -5
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-remove.js +19 -22
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-set.js +0 -5
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-set.js +154 -0
- package/dist/m365/spo/commands/commandset/commandset-set.js +11 -2
- package/dist/m365/spo/commands/list/list-sensitivitylabel-ensure.js +127 -0
- package/dist/m365/spo/commands/navigation/navigation-node-add.js +31 -1
- package/dist/m365/spo/commands/navigation/navigation-node-set.js +31 -2
- package/dist/m365/spo/commands/tenant/Solution.js +3 -0
- package/dist/m365/spo/commands/tenant/tenant-commandset-add.js +215 -0
- package/dist/m365/spo/commands/tenant/tenant-commandset-get.js +114 -0
- package/dist/m365/spo/commands/tenant/tenant-commandset-list.js +50 -0
- package/dist/m365/spo/commands/tenant/tenant-commandset-set.js +1 -1
- package/dist/m365/spo/commands.js +5 -0
- package/dist/settingsNames.js +1 -0
- package/dist/utils/spo.js +60 -0
- package/docs/docs/cmd/purview/retentionevent/retentionevent-add.mdx +0 -6
- package/docs/docs/cmd/purview/retentionevent/retentionevent-get.mdx +0 -6
- package/docs/docs/cmd/purview/retentionevent/retentionevent-list.mdx +0 -7
- package/docs/docs/cmd/purview/retentionevent/retentionevent-remove.mdx +0 -6
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-add.mdx +0 -6
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-get.mdx +0 -6
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-list.mdx +0 -6
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-remove.mdx +0 -6
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-set.mdx +0 -6
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-add.mdx +0 -6
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-get.mdx +0 -6
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-list.mdx +0 -6
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-remove.mdx +0 -6
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-set.mdx +0 -6
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-set.mdx +72 -0
- package/docs/docs/cmd/spo/commandset/commandset-set.mdx +12 -3
- package/docs/docs/cmd/spo/list/list-sensitivitylabel-ensure.mdx +64 -0
- package/docs/docs/cmd/spo/navigation/navigation-node-add.mdx +7 -4
- package/docs/docs/cmd/spo/navigation/navigation-node-set.mdx +9 -0
- package/docs/docs/cmd/spo/tenant/tenant-commandset-add.mdx +183 -0
- package/docs/docs/cmd/spo/tenant/tenant-commandset-get.mdx +155 -0
- package/docs/docs/cmd/spo/tenant/tenant-commandset-list.mdx +114 -0
- package/docs/docs/cmd/spo/tenant/tenant-commandset-set.mdx +1 -1
- package/package.json +1 -1
|
@@ -9,8 +9,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const Auth_1 = require("../../../../Auth");
|
|
13
|
-
const accessToken_1 = require("../../../../utils/accessToken");
|
|
14
12
|
const odata_1 = require("../../../../utils/odata");
|
|
15
13
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
16
14
|
const commands_1 = require("../../commands");
|
|
@@ -26,9 +24,6 @@ class PurviewRetentionLabelListCommand extends GraphCommand_1.default {
|
|
|
26
24
|
}
|
|
27
25
|
commandAction(logger) {
|
|
28
26
|
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
-
if (accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
|
|
30
|
-
this.handleError('This command does not support application permissions.');
|
|
31
|
-
}
|
|
32
27
|
try {
|
|
33
28
|
const items = yield odata_1.odata.getAllItems(`${this.resource}/beta/security/labels/retentionLabels`);
|
|
34
29
|
logger.log(items);
|
|
@@ -15,13 +15,11 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _PurviewRetentionLabelRemoveCommand_instances, _PurviewRetentionLabelRemoveCommand_initTelemetry, _PurviewRetentionLabelRemoveCommand_initOptions, _PurviewRetentionLabelRemoveCommand_initValidators;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const Auth_1 = require("../../../../Auth");
|
|
19
18
|
const Cli_1 = require("../../../../cli/Cli");
|
|
20
19
|
const validation_1 = require("../../../../utils/validation");
|
|
21
20
|
const request_1 = require("../../../../request");
|
|
22
21
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
23
22
|
const commands_1 = require("../../commands");
|
|
24
|
-
const accessToken_1 = require("../../../../utils/accessToken");
|
|
25
23
|
class PurviewRetentionLabelRemoveCommand extends GraphCommand_1.default {
|
|
26
24
|
get name() {
|
|
27
25
|
return commands_1.default.RETENTIONLABEL_REMOVE;
|
|
@@ -38,26 +36,8 @@ class PurviewRetentionLabelRemoveCommand extends GraphCommand_1.default {
|
|
|
38
36
|
}
|
|
39
37
|
commandAction(logger, args) {
|
|
40
38
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
if (accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
|
|
42
|
-
this.handleError('This command does not support application permissions.');
|
|
43
|
-
}
|
|
44
|
-
const removeRetentionLabel = () => __awaiter(this, void 0, void 0, function* () {
|
|
45
|
-
try {
|
|
46
|
-
const requestOptions = {
|
|
47
|
-
url: `${this.resource}/beta/security/labels/retentionLabels/${args.options.id}`,
|
|
48
|
-
headers: {
|
|
49
|
-
accept: 'application/json;odata.metadata=none'
|
|
50
|
-
},
|
|
51
|
-
responseType: 'json'
|
|
52
|
-
};
|
|
53
|
-
yield request_1.default.delete(requestOptions);
|
|
54
|
-
}
|
|
55
|
-
catch (err) {
|
|
56
|
-
this.handleRejectedODataJsonPromise(err);
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
39
|
if (args.options.confirm) {
|
|
60
|
-
yield removeRetentionLabel();
|
|
40
|
+
yield this.removeRetentionLabel(args);
|
|
61
41
|
}
|
|
62
42
|
else {
|
|
63
43
|
const result = yield Cli_1.Cli.prompt({
|
|
@@ -67,11 +47,28 @@ class PurviewRetentionLabelRemoveCommand extends GraphCommand_1.default {
|
|
|
67
47
|
message: `Are you sure you want to remove the retention label ${args.options.id}?`
|
|
68
48
|
});
|
|
69
49
|
if (result.continue) {
|
|
70
|
-
yield removeRetentionLabel();
|
|
50
|
+
yield this.removeRetentionLabel(args);
|
|
71
51
|
}
|
|
72
52
|
}
|
|
73
53
|
});
|
|
74
54
|
}
|
|
55
|
+
removeRetentionLabel(args) {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
try {
|
|
58
|
+
const requestOptions = {
|
|
59
|
+
url: `${this.resource}/beta/security/labels/retentionLabels/${args.options.id}`,
|
|
60
|
+
headers: {
|
|
61
|
+
accept: 'application/json;odata.metadata=none'
|
|
62
|
+
},
|
|
63
|
+
responseType: 'json'
|
|
64
|
+
};
|
|
65
|
+
yield request_1.default.delete(requestOptions);
|
|
66
|
+
}
|
|
67
|
+
catch (err) {
|
|
68
|
+
this.handleRejectedODataJsonPromise(err);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
75
72
|
}
|
|
76
73
|
_PurviewRetentionLabelRemoveCommand_instances = new WeakSet(), _PurviewRetentionLabelRemoveCommand_initTelemetry = function _PurviewRetentionLabelRemoveCommand_initTelemetry() {
|
|
77
74
|
this.telemetry.push((args) => {
|
|
@@ -15,12 +15,10 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _PurviewRetentionLabelSetCommand_instances, _PurviewRetentionLabelSetCommand_initTelemetry, _PurviewRetentionLabelSetCommand_initOptions, _PurviewRetentionLabelSetCommand_initValidators;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const Auth_1 = require("../../../../Auth");
|
|
19
18
|
const validation_1 = require("../../../../utils/validation");
|
|
20
19
|
const request_1 = require("../../../../request");
|
|
21
20
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
22
21
|
const commands_1 = require("../../commands");
|
|
23
|
-
const accessToken_1 = require("../../../../utils/accessToken");
|
|
24
22
|
class PurviewRetentionLabelSetCommand extends GraphCommand_1.default {
|
|
25
23
|
get name() {
|
|
26
24
|
return commands_1.default.RETENTIONLABEL_SET;
|
|
@@ -41,9 +39,6 @@ class PurviewRetentionLabelSetCommand extends GraphCommand_1.default {
|
|
|
41
39
|
}
|
|
42
40
|
commandAction(logger, args) {
|
|
43
41
|
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
-
if (accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
|
|
45
|
-
this.handleError('This command does not support application permissions.');
|
|
46
|
-
}
|
|
47
42
|
if (this.verbose) {
|
|
48
43
|
logger.log(`Starting to update retention label with id ${args.options.id}`);
|
|
49
44
|
}
|
|
@@ -0,0 +1,154 @@
|
|
|
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 _SpoApplicationCustomizerSetCommand_instances, _SpoApplicationCustomizerSetCommand_initOptions, _SpoApplicationCustomizerSetCommand_initTelemetry, _SpoApplicationCustomizerSetCommand_initValidators, _SpoApplicationCustomizerSetCommand_initOptionSets;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const request_1 = require("../../../../request");
|
|
19
|
+
const validation_1 = require("../../../../utils/validation");
|
|
20
|
+
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
21
|
+
const commands_1 = require("../../commands");
|
|
22
|
+
const spo_1 = require("../../../../utils/spo");
|
|
23
|
+
const formatting_1 = require("../../../../utils/formatting");
|
|
24
|
+
const os = require("os");
|
|
25
|
+
class SpoApplicationCustomizerSetCommand extends SpoCommand_1.default {
|
|
26
|
+
get name() {
|
|
27
|
+
return commands_1.default.APPLICATIONCUSTOMIZER_SET;
|
|
28
|
+
}
|
|
29
|
+
get description() {
|
|
30
|
+
return 'Updates an existing Application Customizer on a site';
|
|
31
|
+
}
|
|
32
|
+
constructor() {
|
|
33
|
+
super();
|
|
34
|
+
_SpoApplicationCustomizerSetCommand_instances.add(this);
|
|
35
|
+
this.allowedScopes = ['Site', 'Web', 'All'];
|
|
36
|
+
__classPrivateFieldGet(this, _SpoApplicationCustomizerSetCommand_instances, "m", _SpoApplicationCustomizerSetCommand_initTelemetry).call(this);
|
|
37
|
+
__classPrivateFieldGet(this, _SpoApplicationCustomizerSetCommand_instances, "m", _SpoApplicationCustomizerSetCommand_initOptions).call(this);
|
|
38
|
+
__classPrivateFieldGet(this, _SpoApplicationCustomizerSetCommand_instances, "m", _SpoApplicationCustomizerSetCommand_initValidators).call(this);
|
|
39
|
+
__classPrivateFieldGet(this, _SpoApplicationCustomizerSetCommand_instances, "m", _SpoApplicationCustomizerSetCommand_initOptionSets).call(this);
|
|
40
|
+
}
|
|
41
|
+
commandAction(logger, args) {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
try {
|
|
44
|
+
const appCustomizer = yield this.getAppCustomizerToUpdate(logger, args.options);
|
|
45
|
+
yield this.updateAppCustomizer(logger, args.options, appCustomizer);
|
|
46
|
+
}
|
|
47
|
+
catch (err) {
|
|
48
|
+
this.handleRejectedODataJsonPromise(err);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
updateAppCustomizer(logger, options, appCustomizer) {
|
|
53
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
const { clientSideComponentProperties, webUrl, newTitle } = options;
|
|
55
|
+
if (this.verbose) {
|
|
56
|
+
logger.logToStderr(`Updating application customizer with ID '${appCustomizer.Id}' on the site '${webUrl}'...`);
|
|
57
|
+
}
|
|
58
|
+
const requestBody = {};
|
|
59
|
+
if (newTitle) {
|
|
60
|
+
requestBody.Title = newTitle;
|
|
61
|
+
}
|
|
62
|
+
if (clientSideComponentProperties !== undefined) {
|
|
63
|
+
requestBody.ClientSideComponentProperties = clientSideComponentProperties;
|
|
64
|
+
}
|
|
65
|
+
const requestOptions = {
|
|
66
|
+
url: `${webUrl}/_api/${appCustomizer.Scope.toString() === '2' ? 'Site' : 'Web'}/UserCustomActions('${appCustomizer.Id}')`,
|
|
67
|
+
headers: {
|
|
68
|
+
accept: 'application/json;odata=nometadata',
|
|
69
|
+
'X-HTTP-Method': 'MERGE'
|
|
70
|
+
},
|
|
71
|
+
data: requestBody,
|
|
72
|
+
responseType: 'json'
|
|
73
|
+
};
|
|
74
|
+
yield request_1.default.post(requestOptions);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
getAppCustomizerToUpdate(logger, options) {
|
|
78
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
const { id, webUrl, title, clientSideComponentId, scope } = options;
|
|
80
|
+
const resolvedScope = scope || 'All';
|
|
81
|
+
if (this.verbose) {
|
|
82
|
+
logger.logToStderr(`Getting application customizer ${title || clientSideComponentId || id} to update...`);
|
|
83
|
+
}
|
|
84
|
+
let appCustomizers = [];
|
|
85
|
+
if (id) {
|
|
86
|
+
const appCustomizer = yield spo_1.spo.getCustomActionById(webUrl, id, resolvedScope);
|
|
87
|
+
if (appCustomizer && appCustomizer.Location === 'ClientSideExtension.ApplicationCustomizer') {
|
|
88
|
+
appCustomizers.push(appCustomizer);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
else if (title) {
|
|
92
|
+
appCustomizers = yield spo_1.spo.getCustomActions(webUrl, resolvedScope, `(Title eq '${formatting_1.formatting.encodeQueryParameter(title)}') and (startswith(Location,'ClientSideExtension.ApplicationCustomizer'))`);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
appCustomizers = yield spo_1.spo.getCustomActions(webUrl, resolvedScope, `(ClientSideComponentId eq guid'${clientSideComponentId}') and (startswith(Location,'ClientSideExtension.ApplicationCustomizer'))`);
|
|
96
|
+
}
|
|
97
|
+
if (appCustomizers.length === 0) {
|
|
98
|
+
throw `No application customizer with ${title && `title '${title}'` || clientSideComponentId && `ClientSideComponentId '${clientSideComponentId}'` || id && `id '${id}'`} found`;
|
|
99
|
+
}
|
|
100
|
+
if (appCustomizers.length > 1) {
|
|
101
|
+
throw `Multiple application customizer with ${title ? `title '${title}'` : `ClientSideComponentId '${clientSideComponentId}'`} found. Please disambiguate using IDs: ${os.EOL}${appCustomizers.map(a => `- ${a.Id}`).join(os.EOL)}`;
|
|
102
|
+
}
|
|
103
|
+
return appCustomizers[0];
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
_SpoApplicationCustomizerSetCommand_instances = new WeakSet(), _SpoApplicationCustomizerSetCommand_initOptions = function _SpoApplicationCustomizerSetCommand_initOptions() {
|
|
108
|
+
this.options.unshift({
|
|
109
|
+
option: '-u, --webUrl <webUrl>'
|
|
110
|
+
}, {
|
|
111
|
+
option: '-t, --title [title]'
|
|
112
|
+
}, {
|
|
113
|
+
option: '-i, --id [id]'
|
|
114
|
+
}, {
|
|
115
|
+
option: '-c, --clientSideComponentId [clientSideComponentId]'
|
|
116
|
+
}, {
|
|
117
|
+
option: '--newTitle [newTitle]'
|
|
118
|
+
}, {
|
|
119
|
+
option: '-p, --clientSideComponentProperties [clientSideComponentProperties]'
|
|
120
|
+
}, {
|
|
121
|
+
option: '-s, --scope [scope]', autocomplete: this.allowedScopes
|
|
122
|
+
});
|
|
123
|
+
}, _SpoApplicationCustomizerSetCommand_initTelemetry = function _SpoApplicationCustomizerSetCommand_initTelemetry() {
|
|
124
|
+
this.telemetry.push((args) => {
|
|
125
|
+
Object.assign(this.telemetryProperties, {
|
|
126
|
+
title: typeof args.options.title !== 'undefined',
|
|
127
|
+
id: typeof args.options.id !== 'undefined',
|
|
128
|
+
clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined',
|
|
129
|
+
newTitle: typeof args.options.newTitle !== 'undefined',
|
|
130
|
+
clientSideComponentProperties: typeof args.options.clientSideComponentProperties !== 'undefined',
|
|
131
|
+
scope: typeof args.options.scope !== 'undefined'
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
}, _SpoApplicationCustomizerSetCommand_initValidators = function _SpoApplicationCustomizerSetCommand_initValidators() {
|
|
135
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
136
|
+
if (args.options.id && !validation_1.validation.isValidGuid(args.options.id)) {
|
|
137
|
+
return `${args.options.id} is not a valid GUID`;
|
|
138
|
+
}
|
|
139
|
+
if (args.options.clientSideComponentId && !validation_1.validation.isValidGuid(args.options.clientSideComponentId)) {
|
|
140
|
+
return `${args.options.clientSideComponentId} is not a valid GUID`;
|
|
141
|
+
}
|
|
142
|
+
if (args.options.scope && this.allowedScopes.indexOf(args.options.scope) === -1) {
|
|
143
|
+
return `'${args.options.scope}' is not a valid application customizer scope. Allowed values are: ${this.allowedScopes.join(',')}`;
|
|
144
|
+
}
|
|
145
|
+
if (!args.options.newTitle && !args.options.clientSideComponentProperties) {
|
|
146
|
+
return `Please specify an option to be updated`;
|
|
147
|
+
}
|
|
148
|
+
return validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
149
|
+
}));
|
|
150
|
+
}, _SpoApplicationCustomizerSetCommand_initOptionSets = function _SpoApplicationCustomizerSetCommand_initOptionSets() {
|
|
151
|
+
this.optionSets.push({ options: ['id', 'title', 'clientSideComponentId'] });
|
|
152
|
+
};
|
|
153
|
+
module.exports = new SpoApplicationCustomizerSetCommand();
|
|
154
|
+
//# sourceMappingURL=applicationcustomizer-set.js.map
|
|
@@ -39,7 +39,7 @@ class SpoCommandSetSetCommand extends SpoCommand_1.default {
|
|
|
39
39
|
commandAction(logger, args) {
|
|
40
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41
41
|
if (this.verbose) {
|
|
42
|
-
logger.logToStderr(`Updating ListView Command Set ${args.options.clientSideComponentId} to site '${args.options.webUrl}'...`);
|
|
42
|
+
logger.logToStderr(`Updating ListView Command Set ${args.options.id || args.options.title || args.options.clientSideComponentId} to site '${args.options.webUrl}'...`);
|
|
43
43
|
}
|
|
44
44
|
if (!args.options.scope) {
|
|
45
45
|
args.options.scope = 'All';
|
|
@@ -59,6 +59,9 @@ class SpoCommandSetSetCommand extends SpoCommand_1.default {
|
|
|
59
59
|
if (args.options.clientSideComponentProperties) {
|
|
60
60
|
requestBody.ClientSideComponentProperties = args.options.clientSideComponentProperties;
|
|
61
61
|
}
|
|
62
|
+
if (args.options.newClientSideComponentId) {
|
|
63
|
+
requestBody.ClientSideComponentId = args.options.newClientSideComponentId;
|
|
64
|
+
}
|
|
62
65
|
const customAction = yield this.getCustomAction(args.options);
|
|
63
66
|
const requestOptions = {
|
|
64
67
|
url: `${args.options.webUrl}/_api/${customAction.Scope === 3 ? "Web" : "Site"}/UserCustomActions('${formatting_1.formatting.encodeQueryParameter(customAction.Id)}')`,
|
|
@@ -127,6 +130,7 @@ _SpoCommandSetSetCommand_instances = new WeakSet(), _SpoCommandSetSetCommand_ini
|
|
|
127
130
|
title: typeof args.options.title !== 'undefined',
|
|
128
131
|
id: typeof args.options.id !== 'undefined',
|
|
129
132
|
clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined',
|
|
133
|
+
newClientSideComponentId: typeof args.options.newClientSideComponentId !== 'undefined',
|
|
130
134
|
listType: typeof args.options.listType !== 'undefined',
|
|
131
135
|
clientSideComponentProperties: typeof args.options.clientSideComponentProperties !== 'undefined',
|
|
132
136
|
scope: typeof args.options.scope !== 'undefined',
|
|
@@ -142,6 +146,8 @@ _SpoCommandSetSetCommand_instances = new WeakSet(), _SpoCommandSetSetCommand_ini
|
|
|
142
146
|
option: '-i, --id [id]'
|
|
143
147
|
}, {
|
|
144
148
|
option: '-c, --clientSideComponentId [clientSideComponentId]'
|
|
149
|
+
}, {
|
|
150
|
+
option: '--newClientSideComponentId [newClientSideComponentId]'
|
|
145
151
|
}, {
|
|
146
152
|
option: '--newTitle [newTitle]'
|
|
147
153
|
}, {
|
|
@@ -161,6 +167,9 @@ _SpoCommandSetSetCommand_instances = new WeakSet(), _SpoCommandSetSetCommand_ini
|
|
|
161
167
|
if (args.options.clientSideComponentId && !validation_1.validation.isValidGuid(args.options.clientSideComponentId)) {
|
|
162
168
|
return `${args.options.clientSideComponentId} is not a valid GUID`;
|
|
163
169
|
}
|
|
170
|
+
if (args.options.newClientSideComponentId && !validation_1.validation.isValidGuid(args.options.newClientSideComponentId)) {
|
|
171
|
+
return `${args.options.newClientSideComponentId} is not a valid GUID`;
|
|
172
|
+
}
|
|
164
173
|
if (args.options.listType && SpoCommandSetSetCommand.listTypes.indexOf(args.options.listType) < 0) {
|
|
165
174
|
return `${args.options.listType} is not a valid list type. Allowed values are ${SpoCommandSetSetCommand.listTypes.join(', ')}`;
|
|
166
175
|
}
|
|
@@ -170,7 +179,7 @@ _SpoCommandSetSetCommand_instances = new WeakSet(), _SpoCommandSetSetCommand_ini
|
|
|
170
179
|
if (args.options.location && SpoCommandSetSetCommand.locations.indexOf(args.options.location) < 0) {
|
|
171
180
|
return `${args.options.location} is not a valid location. Allowed values are ${SpoCommandSetSetCommand.locations.join(', ')}`;
|
|
172
181
|
}
|
|
173
|
-
if (!args.options.newTitle && !args.options.listType && !args.options.clientSideComponentProperties && !args.options.location) {
|
|
182
|
+
if (!args.options.newTitle && !args.options.listType && !args.options.clientSideComponentProperties && !args.options.location && !args.options.newClientSideComponentId) {
|
|
174
183
|
return `Please specify option to be updated`;
|
|
175
184
|
}
|
|
176
185
|
return validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
@@ -0,0 +1,127 @@
|
|
|
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 _SpoListSensitivityLabelEnsureCommand_instances, _SpoListSensitivityLabelEnsureCommand_initTelemetry, _SpoListSensitivityLabelEnsureCommand_initOptions, _SpoListSensitivityLabelEnsureCommand_initValidators, _SpoListSensitivityLabelEnsureCommand_initOptionSets;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const request_1 = require("../../../../request");
|
|
19
|
+
const formatting_1 = require("../../../../utils/formatting");
|
|
20
|
+
const urlUtil_1 = require("../../../../utils/urlUtil");
|
|
21
|
+
const validation_1 = require("../../../../utils/validation");
|
|
22
|
+
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
23
|
+
const commands_1 = require("../../commands");
|
|
24
|
+
class SpoListSensitivityLabelEnsureCommand extends SpoCommand_1.default {
|
|
25
|
+
get name() {
|
|
26
|
+
return commands_1.default.LIST_SENSITIVITYLABEL_ENSURE;
|
|
27
|
+
}
|
|
28
|
+
get description() {
|
|
29
|
+
return 'Applies a default sensitivity label to the specified document library';
|
|
30
|
+
}
|
|
31
|
+
constructor() {
|
|
32
|
+
super();
|
|
33
|
+
_SpoListSensitivityLabelEnsureCommand_instances.add(this);
|
|
34
|
+
__classPrivateFieldGet(this, _SpoListSensitivityLabelEnsureCommand_instances, "m", _SpoListSensitivityLabelEnsureCommand_initTelemetry).call(this);
|
|
35
|
+
__classPrivateFieldGet(this, _SpoListSensitivityLabelEnsureCommand_instances, "m", _SpoListSensitivityLabelEnsureCommand_initOptions).call(this);
|
|
36
|
+
__classPrivateFieldGet(this, _SpoListSensitivityLabelEnsureCommand_instances, "m", _SpoListSensitivityLabelEnsureCommand_initValidators).call(this);
|
|
37
|
+
__classPrivateFieldGet(this, _SpoListSensitivityLabelEnsureCommand_instances, "m", _SpoListSensitivityLabelEnsureCommand_initOptionSets).call(this);
|
|
38
|
+
}
|
|
39
|
+
commandAction(logger, args) {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
try {
|
|
42
|
+
const sensitivityLabelId = yield this.getSensitivityLabelId(args, logger);
|
|
43
|
+
if (this.verbose) {
|
|
44
|
+
logger.logToStderr(`Applying a sensitivity label ${sensitivityLabelId} to the document library...`);
|
|
45
|
+
}
|
|
46
|
+
let requestUrl = `${args.options.webUrl}/_api/web`;
|
|
47
|
+
if (args.options.listId) {
|
|
48
|
+
requestUrl += `/lists(guid'${formatting_1.formatting.encodeQueryParameter(args.options.listId)}')`;
|
|
49
|
+
}
|
|
50
|
+
else if (args.options.listTitle) {
|
|
51
|
+
requestUrl += `/lists/getByTitle('${formatting_1.formatting.encodeQueryParameter(args.options.listTitle)}')`;
|
|
52
|
+
}
|
|
53
|
+
else if (args.options.listUrl) {
|
|
54
|
+
const listServerRelativeUrl = urlUtil_1.urlUtil.getServerRelativePath(args.options.webUrl, args.options.listUrl);
|
|
55
|
+
requestUrl += `/GetList('${formatting_1.formatting.encodeQueryParameter(listServerRelativeUrl)}')`;
|
|
56
|
+
}
|
|
57
|
+
const requestOptions = {
|
|
58
|
+
url: requestUrl,
|
|
59
|
+
headers: {
|
|
60
|
+
accept: 'application/json;odata=nometadata',
|
|
61
|
+
'content-type': 'application/json;odata=nometadata',
|
|
62
|
+
'if-match': '*'
|
|
63
|
+
},
|
|
64
|
+
data: { 'DefaultSensitivityLabelForLibrary': sensitivityLabelId },
|
|
65
|
+
responseType: 'json'
|
|
66
|
+
};
|
|
67
|
+
yield request_1.default.patch(requestOptions);
|
|
68
|
+
}
|
|
69
|
+
catch (err) {
|
|
70
|
+
this.handleRejectedODataJsonPromise(err);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
getSensitivityLabelId(args, logger) {
|
|
75
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
const { name } = args.options;
|
|
77
|
+
if (this.verbose) {
|
|
78
|
+
logger.logToStderr(`Retrieving sensitivity label id of ${name}...`);
|
|
79
|
+
}
|
|
80
|
+
const requestOptions = {
|
|
81
|
+
url: `https://graph.microsoft.com/beta/security/informationProtection/sensitivityLabels?$filter=name eq '${formatting_1.formatting.encodeQueryParameter(name)}'&$select=id`,
|
|
82
|
+
headers: {
|
|
83
|
+
accept: 'application/json;odata.metadata=none'
|
|
84
|
+
},
|
|
85
|
+
responseType: 'json'
|
|
86
|
+
};
|
|
87
|
+
const res = yield request_1.default.get(requestOptions);
|
|
88
|
+
const sensitivityLabelItem = res.value[0];
|
|
89
|
+
if (!sensitivityLabelItem) {
|
|
90
|
+
throw Error(`The specified sensitivity label does not exist`);
|
|
91
|
+
}
|
|
92
|
+
return sensitivityLabelItem.id;
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
_SpoListSensitivityLabelEnsureCommand_instances = new WeakSet(), _SpoListSensitivityLabelEnsureCommand_initTelemetry = function _SpoListSensitivityLabelEnsureCommand_initTelemetry() {
|
|
97
|
+
this.telemetry.push((args) => {
|
|
98
|
+
Object.assign(this.telemetryProperties, {
|
|
99
|
+
listId: typeof args.options.listId !== 'undefined',
|
|
100
|
+
listTitle: typeof args.options.listTitle !== 'undefined',
|
|
101
|
+
listUrl: typeof args.options.listUrl !== 'undefined'
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
}, _SpoListSensitivityLabelEnsureCommand_initOptions = function _SpoListSensitivityLabelEnsureCommand_initOptions() {
|
|
105
|
+
this.options.unshift({
|
|
106
|
+
option: '-u, --webUrl <webUrl>'
|
|
107
|
+
}, {
|
|
108
|
+
option: '-n, --name <name>'
|
|
109
|
+
}, {
|
|
110
|
+
option: '-t, --listTitle [listTitle]'
|
|
111
|
+
}, {
|
|
112
|
+
option: '-l, --listId [listId]'
|
|
113
|
+
}, {
|
|
114
|
+
option: '--listUrl [listUrl]'
|
|
115
|
+
});
|
|
116
|
+
}, _SpoListSensitivityLabelEnsureCommand_initValidators = function _SpoListSensitivityLabelEnsureCommand_initValidators() {
|
|
117
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
118
|
+
if (args.options.listId && !validation_1.validation.isValidGuid(args.options.listId)) {
|
|
119
|
+
return `${args.options.listId} is not a valid GUID`;
|
|
120
|
+
}
|
|
121
|
+
return validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
122
|
+
}));
|
|
123
|
+
}, _SpoListSensitivityLabelEnsureCommand_initOptionSets = function _SpoListSensitivityLabelEnsureCommand_initOptionSets() {
|
|
124
|
+
this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] });
|
|
125
|
+
};
|
|
126
|
+
module.exports = new SpoListSensitivityLabelEnsureCommand();
|
|
127
|
+
//# sourceMappingURL=list-sensitivitylabel-ensure.js.map
|
|
@@ -16,6 +16,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
16
16
|
var _SpoNavigationNodeAddCommand_instances, _SpoNavigationNodeAddCommand_initTelemetry, _SpoNavigationNodeAddCommand_initOptions, _SpoNavigationNodeAddCommand_initValidators, _SpoNavigationNodeAddCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const request_1 = require("../../../../request");
|
|
19
|
+
const spo_1 = require("../../../../utils/spo");
|
|
19
20
|
const validation_1 = require("../../../../utils/validation");
|
|
20
21
|
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
21
22
|
const commands_1 = require("../../commands");
|
|
@@ -62,6 +63,20 @@ class SpoNavigationNodeAddCommand extends SpoCommand_1.default {
|
|
|
62
63
|
};
|
|
63
64
|
try {
|
|
64
65
|
const res = yield request_1.default.post(requestOptions);
|
|
66
|
+
if (args.options.openInNewWindow) {
|
|
67
|
+
if (this.verbose) {
|
|
68
|
+
logger.logToStderr(`Making sure that the newly added navigation node opens in a new window.`);
|
|
69
|
+
}
|
|
70
|
+
const id = res.Id.toString();
|
|
71
|
+
let menuState = args.options.location === 'TopNavigationBar' ? yield spo_1.spo.getTopNavigationMenuState(args.options.webUrl) : yield spo_1.spo.getQuickLaunchMenuState(args.options.webUrl);
|
|
72
|
+
let menuStateItem = this.getMenuStateNode(menuState.Nodes, id);
|
|
73
|
+
if (args.options.parentNodeId && !menuStateItem) {
|
|
74
|
+
menuState = yield spo_1.spo.getTopNavigationMenuState(args.options.webUrl);
|
|
75
|
+
menuStateItem = this.getMenuStateNode(menuState.Nodes, id);
|
|
76
|
+
}
|
|
77
|
+
menuStateItem.OpenInNewWindow = true;
|
|
78
|
+
yield spo_1.spo.saveMenuState(args.options.webUrl, menuState);
|
|
79
|
+
}
|
|
65
80
|
logger.log(res);
|
|
66
81
|
}
|
|
67
82
|
catch (err) {
|
|
@@ -69,6 +84,18 @@ class SpoNavigationNodeAddCommand extends SpoCommand_1.default {
|
|
|
69
84
|
}
|
|
70
85
|
});
|
|
71
86
|
}
|
|
87
|
+
getMenuStateNode(nodes, id) {
|
|
88
|
+
let menuNode = nodes.find((node) => node.Key !== null && node.Key === id);
|
|
89
|
+
if (menuNode === undefined) {
|
|
90
|
+
for (const node of nodes.filter(node => node.Nodes.length > 0)) {
|
|
91
|
+
menuNode = this.getMenuStateNode(node.Nodes, id);
|
|
92
|
+
if (menuNode) {
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return menuNode;
|
|
98
|
+
}
|
|
72
99
|
}
|
|
73
100
|
_SpoNavigationNodeAddCommand_instances = new WeakSet(), _SpoNavigationNodeAddCommand_initTelemetry = function _SpoNavigationNodeAddCommand_initTelemetry() {
|
|
74
101
|
this.telemetry.push((args) => {
|
|
@@ -77,7 +104,8 @@ _SpoNavigationNodeAddCommand_instances = new WeakSet(), _SpoNavigationNodeAddCom
|
|
|
77
104
|
location: typeof args.options.location !== 'undefined',
|
|
78
105
|
parentNodeId: typeof args.options.parentNodeId !== 'undefined',
|
|
79
106
|
audienceIds: typeof args.options.audienceIds !== 'undefined',
|
|
80
|
-
url: typeof args.options.url !== 'undefined'
|
|
107
|
+
url: typeof args.options.url !== 'undefined',
|
|
108
|
+
openInNewWindow: !!args.options.openInNewWindow
|
|
81
109
|
});
|
|
82
110
|
});
|
|
83
111
|
}, _SpoNavigationNodeAddCommand_initOptions = function _SpoNavigationNodeAddCommand_initOptions() {
|
|
@@ -96,6 +124,8 @@ _SpoNavigationNodeAddCommand_instances = new WeakSet(), _SpoNavigationNodeAddCom
|
|
|
96
124
|
option: '--isExternal'
|
|
97
125
|
}, {
|
|
98
126
|
option: '--audienceIds [audienceIds]'
|
|
127
|
+
}, {
|
|
128
|
+
option: '--openInNewWindow'
|
|
99
129
|
});
|
|
100
130
|
}, _SpoNavigationNodeAddCommand_initValidators = function _SpoNavigationNodeAddCommand_initValidators() {
|
|
101
131
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -16,6 +16,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
16
16
|
var _SpoNavigationNodeSetCommand_instances, _SpoNavigationNodeSetCommand_initTelemetry, _SpoNavigationNodeSetCommand_initTypes, _SpoNavigationNodeSetCommand_initOptions, _SpoNavigationNodeSetCommand_initValidators;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const request_1 = require("../../../../request");
|
|
19
|
+
const spo_1 = require("../../../../utils/spo");
|
|
19
20
|
const validation_1 = require("../../../../utils/validation");
|
|
20
21
|
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
21
22
|
const commands_1 = require("../../commands");
|
|
@@ -65,12 +66,37 @@ class SpoNavigationNodeSetCommand extends SpoCommand_1.default {
|
|
|
65
66
|
if (response['odata.null'] === true) {
|
|
66
67
|
throw `Navigation node does not exist.`;
|
|
67
68
|
}
|
|
69
|
+
if (args.options.openInNewWindow !== undefined) {
|
|
70
|
+
if (this.verbose) {
|
|
71
|
+
logger.logToStderr(`Making sure that the navigation node opens in a new window.`);
|
|
72
|
+
}
|
|
73
|
+
let menuState = yield spo_1.spo.getQuickLaunchMenuState(args.options.webUrl);
|
|
74
|
+
let menuStateItem = this.getMenuStateNode(menuState.Nodes, args.options.id);
|
|
75
|
+
if (!menuStateItem) {
|
|
76
|
+
menuState = yield spo_1.spo.getTopNavigationMenuState(args.options.webUrl);
|
|
77
|
+
menuStateItem = this.getMenuStateNode(menuState.Nodes, args.options.id);
|
|
78
|
+
}
|
|
79
|
+
menuStateItem.OpenInNewWindow = args.options.openInNewWindow;
|
|
80
|
+
yield spo_1.spo.saveMenuState(args.options.webUrl, menuState);
|
|
81
|
+
}
|
|
68
82
|
}
|
|
69
83
|
catch (err) {
|
|
70
84
|
this.handleRejectedODataJsonPromise(err);
|
|
71
85
|
}
|
|
72
86
|
});
|
|
73
87
|
}
|
|
88
|
+
getMenuStateNode(nodes, id) {
|
|
89
|
+
let menuNode = nodes.find((node) => node.Key.toString() === id.toString());
|
|
90
|
+
if (menuNode === undefined) {
|
|
91
|
+
for (const node of nodes.filter(node => node.Nodes.length > 0)) {
|
|
92
|
+
menuNode = this.getMenuStateNode(node.Nodes, id);
|
|
93
|
+
if (menuNode) {
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return menuNode;
|
|
99
|
+
}
|
|
74
100
|
}
|
|
75
101
|
_SpoNavigationNodeSetCommand_instances = new WeakSet(), _SpoNavigationNodeSetCommand_initTelemetry = function _SpoNavigationNodeSetCommand_initTelemetry() {
|
|
76
102
|
this.telemetry.push((args) => {
|
|
@@ -78,7 +104,8 @@ _SpoNavigationNodeSetCommand_instances = new WeakSet(), _SpoNavigationNodeSetCom
|
|
|
78
104
|
title: typeof args.options.title !== 'undefined',
|
|
79
105
|
url: typeof args.options.url !== 'undefined',
|
|
80
106
|
isExternal: typeof args.options.isExternal !== 'undefined',
|
|
81
|
-
audienceIds: typeof args.options.audienceIds !== 'undefined'
|
|
107
|
+
audienceIds: typeof args.options.audienceIds !== 'undefined',
|
|
108
|
+
openInNewWindow: typeof args.options.openInNewWindow !== 'undefined'
|
|
82
109
|
});
|
|
83
110
|
});
|
|
84
111
|
}, _SpoNavigationNodeSetCommand_initTypes = function _SpoNavigationNodeSetCommand_initTypes() {
|
|
@@ -96,6 +123,8 @@ _SpoNavigationNodeSetCommand_instances = new WeakSet(), _SpoNavigationNodeSetCom
|
|
|
96
123
|
option: '--audienceIds [audienceIds]'
|
|
97
124
|
}, {
|
|
98
125
|
option: '--isExternal [isExternal]'
|
|
126
|
+
}, {
|
|
127
|
+
option: '--openInNewWindow [openInNewWindow]'
|
|
99
128
|
});
|
|
100
129
|
}, _SpoNavigationNodeSetCommand_initValidators = function _SpoNavigationNodeSetCommand_initValidators() {
|
|
101
130
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -103,7 +132,7 @@ _SpoNavigationNodeSetCommand_instances = new WeakSet(), _SpoNavigationNodeSetCom
|
|
|
103
132
|
if (isValidSharePointUrl !== true) {
|
|
104
133
|
return isValidSharePointUrl;
|
|
105
134
|
}
|
|
106
|
-
if (args.options.audienceIds === undefined && !args.options.url && args.options.isExternal === undefined && !args.options.title) {
|
|
135
|
+
if (args.options.audienceIds === undefined && !args.options.url && args.options.isExternal === undefined && !args.options.title && args.options.openInNewWindow === undefined) {
|
|
107
136
|
return `Please specify atleast one property to update.`;
|
|
108
137
|
}
|
|
109
138
|
if (args.options.audienceIds) {
|