@pnp/cli-microsoft365 6.8.0-beta.74dea8a → 6.8.0-beta.85a1ca9
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/Command.js +6 -0
- package/dist/chili/chili.js +298 -0
- package/dist/chili/index.js +20 -0
- package/dist/cli/Cli.js +2 -2
- package/dist/m365/app/commands/permission/permission-add.js +279 -0
- package/dist/m365/app/commands.js +1 -0
- package/dist/m365/commands/commands.js +1 -0
- package/dist/m365/commands/setup.js +180 -0
- package/dist/m365/commands/setupPresets.js +25 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.15.2.js +2 -0
- package/dist/m365/spfx/commands/spfx-doctor.js +14 -30
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-remove.js +146 -0
- package/dist/m365/spo/commands/listitem/listitem-batch-set.js +308 -0
- package/dist/m365/spo/commands/page/page-section-add.js +2 -3
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-get.js +30 -39
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-list.js +47 -0
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-remove.js +151 -0
- package/dist/m365/spo/commands/tenant/tenant-commandset-remove.js +152 -0
- package/dist/m365/spo/commands/tenant/tenant-commandset-set.js +203 -0
- package/dist/m365/spo/commands.js +6 -0
- package/dist/utils/formatting.js +35 -11
- package/dist/utils/pid.js +5 -0
- package/docs/docs/cmd/app/permission/permission-add.md +53 -0
- package/docs/docs/cmd/flow/environment/environment-list.md +18 -0
- package/docs/docs/cmd/flow/flow-get.md +20 -0
- package/docs/docs/cmd/flow/flow-list.md +17 -0
- package/docs/docs/cmd/planner/plan/plan-get.md +1 -1
- package/docs/docs/cmd/planner/plan/plan-list.md +1 -1
- package/docs/docs/cmd/planner/roster/roster-add.md +2 -1
- package/docs/docs/cmd/planner/roster/roster-get.md +1 -1
- package/docs/docs/cmd/planner/roster/roster-remove.md +2 -1
- package/docs/docs/cmd/planner/task/task-set.md +1 -1
- package/docs/docs/cmd/purview/retentionevent/retentionevent-add.md +6 -7
- package/docs/docs/cmd/purview/retentionevent/retentionevent-get.md +6 -7
- package/docs/docs/cmd/purview/retentionevent/retentionevent-list.md +4 -4
- package/docs/docs/cmd/purview/retentionevent/retentionevent-remove.md +4 -4
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-add.md +10 -10
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-get.md +11 -11
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-list.md +10 -10
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-remove.md +10 -10
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-set.md +10 -10
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-add.md +12 -12
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-get.md +8 -9
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-list.md +8 -9
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-remove.md +8 -8
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-set.md +8 -8
- package/docs/docs/cmd/setup.md +86 -0
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-add.md +1 -1
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-remove.md +77 -0
- package/docs/docs/cmd/spo/commandset/commandset-set.md +1 -1
- package/docs/docs/cmd/spo/contenttype/contenttype-set.md +2 -2
- package/docs/docs/cmd/spo/customaction/customaction-add.md +1 -1
- package/docs/docs/cmd/spo/customaction/customaction-set.md +1 -1
- package/docs/docs/cmd/spo/folder/folder-copy.md +1 -1
- package/docs/docs/cmd/spo/listitem/listitem-batch-set.md +67 -0
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-add.md +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-list.md +103 -0
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-remove.md +49 -0
- package/docs/docs/cmd/spo/tenant/tenant-commandset-remove.md +49 -0
- package/docs/docs/cmd/spo/tenant/tenant-commandset-set.md +57 -0
- package/docs/docs/cmd/teams/tab/tab-remove.md +1 -1
- package/docs/docs/cmd/version.md +1 -1
- package/docs/docs/cmd/yammer/group/group-list.md +42 -0
- package/docs/docs/cmd/yammer/message/message-add.md +32 -0
- package/docs/docs/cmd/yammer/message/message-get.md +32 -0
- package/docs/docs/cmd/yammer/message/message-list.md +34 -0
- package/docs/docs/cmd/yammer/network/network-list.md +70 -0
- package/docs/docs/cmd/yammer/report/report-activitycounts.md +7 -0
- package/docs/docs/cmd/yammer/report/report-activityusercounts.md +7 -0
- package/docs/docs/cmd/yammer/report/report-activityuserdetail.md +7 -0
- package/docs/docs/cmd/yammer/report/report-deviceusagedistributionusercounts.md +7 -0
- package/docs/docs/cmd/yammer/report/report-deviceusageusercounts.md +7 -0
- package/docs/docs/cmd/yammer/report/report-deviceusageuserdetail.md +7 -0
- package/docs/docs/cmd/yammer/report/report-groupsactivitycounts.md +7 -0
- package/docs/docs/cmd/yammer/report/report-groupsactivitydetail.md +7 -0
- package/docs/docs/cmd/yammer/report/report-groupsactivitygroupcounts.md +7 -0
- package/docs/docs/cmd/yammer/user/user-get.md +55 -0
- package/docs/docs/cmd/yammer/user/user-list.md +55 -0
- package/docs/docs/cmd/yammer/yammer-search.md +15 -3
- package/package.json +2 -1
|
@@ -0,0 +1,308 @@
|
|
|
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 __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
17
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
18
|
+
var m = o[Symbol.asyncIterator], i;
|
|
19
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
20
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
21
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
22
|
+
};
|
|
23
|
+
var _SpoListItemBatchSetCommand_instances, _SpoListItemBatchSetCommand_initTelemetry, _SpoListItemBatchSetCommand_initOptions, _SpoListItemBatchSetCommand_initValidators, _SpoListItemBatchSetCommand_initOptionSets;
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
const fs = require("fs");
|
|
26
|
+
const config_1 = require("../../../../config");
|
|
27
|
+
const request_1 = require("../../../../request");
|
|
28
|
+
const formatting_1 = require("../../../../utils/formatting");
|
|
29
|
+
const odata_1 = require("../../../../utils/odata");
|
|
30
|
+
const spo_1 = require("../../../../utils/spo");
|
|
31
|
+
const urlUtil_1 = require("../../../../utils/urlUtil");
|
|
32
|
+
const validation_1 = require("../../../../utils/validation");
|
|
33
|
+
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
34
|
+
const commands_1 = require("../../commands");
|
|
35
|
+
class SpoListItemBatchSetCommand extends SpoCommand_1.default {
|
|
36
|
+
get name() {
|
|
37
|
+
return commands_1.default.LISTITEM_BATCH_SET;
|
|
38
|
+
}
|
|
39
|
+
get description() {
|
|
40
|
+
return 'Updates list items in a batch';
|
|
41
|
+
}
|
|
42
|
+
constructor() {
|
|
43
|
+
super();
|
|
44
|
+
_SpoListItemBatchSetCommand_instances.add(this);
|
|
45
|
+
__classPrivateFieldGet(this, _SpoListItemBatchSetCommand_instances, "m", _SpoListItemBatchSetCommand_initTelemetry).call(this);
|
|
46
|
+
__classPrivateFieldGet(this, _SpoListItemBatchSetCommand_instances, "m", _SpoListItemBatchSetCommand_initOptions).call(this);
|
|
47
|
+
__classPrivateFieldGet(this, _SpoListItemBatchSetCommand_instances, "m", _SpoListItemBatchSetCommand_initValidators).call(this);
|
|
48
|
+
__classPrivateFieldGet(this, _SpoListItemBatchSetCommand_instances, "m", _SpoListItemBatchSetCommand_initOptionSets).call(this);
|
|
49
|
+
}
|
|
50
|
+
commandAction(logger, args) {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
try {
|
|
53
|
+
if (this.verbose) {
|
|
54
|
+
logger.logToStderr(`Starting to create batch items from csv at path ${args.options.filePath}`);
|
|
55
|
+
}
|
|
56
|
+
const csvContent = fs.readFileSync(args.options.filePath, 'utf8');
|
|
57
|
+
const jsonContent = formatting_1.formatting.parseCsvToJson(csvContent);
|
|
58
|
+
const amountOfRows = jsonContent.length;
|
|
59
|
+
const idColumn = args.options.idColumn || 'ID';
|
|
60
|
+
if (!jsonContent[0].hasOwnProperty(idColumn)) {
|
|
61
|
+
throw `The specified value for idColumn does not exist in the array. Specified idColumn is '${args.options.idColumn || 'ID'}'. Please specify the correct value.`;
|
|
62
|
+
}
|
|
63
|
+
const listId = yield this.getListId(args.options, logger);
|
|
64
|
+
const fields = yield this.getListFields(args.options, listId, jsonContent, idColumn, logger);
|
|
65
|
+
const userFields = fields.filter(field => field.TypeAsString === 'UserMulti' || field.TypeAsString === 'User');
|
|
66
|
+
const resolvedUsers = yield this.getUsersFromCsv(args.options.webUrl, jsonContent, userFields);
|
|
67
|
+
const formDigestValue = (yield spo_1.spo.getRequestDigest(args.options.webUrl)).FormDigestValue;
|
|
68
|
+
const objectIdentity = (yield spo_1.spo.getCurrentWebIdentity(args.options.webUrl, formDigestValue)).objectIdentity;
|
|
69
|
+
let counter = 0;
|
|
70
|
+
while (jsonContent.length > 0) {
|
|
71
|
+
const entriesToProcess = jsonContent.splice(0, 50);
|
|
72
|
+
const objectPaths = [], actions = [];
|
|
73
|
+
let index = 1;
|
|
74
|
+
for (const row of entriesToProcess) {
|
|
75
|
+
counter += 1;
|
|
76
|
+
objectPaths.push(`<Identity Id="${index}" Name="${objectIdentity}:list:${listId}:item:${row[idColumn]},1" />`);
|
|
77
|
+
const [actionString, updatedIndex] = this.mapActions(index, row, fields, resolvedUsers, args.options.systemUpdate);
|
|
78
|
+
index = updatedIndex;
|
|
79
|
+
actions.push(actionString);
|
|
80
|
+
}
|
|
81
|
+
if (this.verbose) {
|
|
82
|
+
logger.logToStderr(`Writing away batch of items, currently at: ${counter}/${amountOfRows}.`);
|
|
83
|
+
}
|
|
84
|
+
yield this.sendBatchRequest(args.options.webUrl, this.getRequestBody(objectPaths, actions));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
catch (err) {
|
|
88
|
+
this.handleRejectedODataJsonPromise(err);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
getRequestBody(objectPaths, actions) {
|
|
93
|
+
return `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="${config_1.default.applicationName}" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions>${actions.join('')}</Actions><ObjectPaths>${objectPaths.join('')}</ObjectPaths></Request>`;
|
|
94
|
+
}
|
|
95
|
+
sendBatchRequest(webUrl, requestBody) {
|
|
96
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
97
|
+
const requestOptions = {
|
|
98
|
+
url: `${webUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
99
|
+
headers: {
|
|
100
|
+
'Content-Type': 'text/xml'
|
|
101
|
+
},
|
|
102
|
+
data: requestBody
|
|
103
|
+
};
|
|
104
|
+
const res = yield request_1.default.post(requestOptions);
|
|
105
|
+
const json = JSON.parse(res);
|
|
106
|
+
const response = json[0];
|
|
107
|
+
if (response.ErrorInfo) {
|
|
108
|
+
throw response.ErrorInfo.ErrorMessage + ' - ' + response.ErrorInfo.ErrorValue;
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
mapActions(index, row, fields, users, systemUpdate) {
|
|
113
|
+
const objectPathId = index;
|
|
114
|
+
let actionString = '';
|
|
115
|
+
fields.forEach((field) => {
|
|
116
|
+
if (row[field.InternalName] === undefined || row[field.InternalName] === '') {
|
|
117
|
+
actionString += `<Method Name="ParseAndSetFieldValue" Id="${index += 1}" ObjectPathId="${objectPathId}"><Parameters><Parameter Type="String">${field.InternalName}</Parameter><Parameter Type="String"></Parameter></Parameters></Method>`;
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
switch (field.TypeAsString) {
|
|
121
|
+
case 'User':
|
|
122
|
+
const userDetail = users.find(us => us.email === row[field.InternalName]);
|
|
123
|
+
actionString += `<Method Name="ParseAndSetFieldValue" Id="${index += 1}" ObjectPathId="${objectPathId}"><Parameters><Parameter Type="String">${field.InternalName}</Parameter><Parameter Type="String">${userDetail.id}</Parameter></Parameters></Method>`;
|
|
124
|
+
break;
|
|
125
|
+
case 'UserMulti':
|
|
126
|
+
const userMultiString = row[field.InternalName].toString().split(';').map((element) => {
|
|
127
|
+
const userDetail = users.find(us => us.email === element);
|
|
128
|
+
return `<Object TypeId="{c956ab54-16bd-4c18-89d2-996f57282a6f}"><Property Name="Email" Type="Null" /><Property Name="LookupId" Type="Int32">${userDetail.id}</Property><Property Name="LookupValue" Type="Null" /></Object>`;
|
|
129
|
+
});
|
|
130
|
+
actionString += `<Method Name="SetFieldValue" Id="${index += 1}" ObjectPathId="${objectPathId}"><Parameters><Parameter Type="String">${field.InternalName}</Parameter><Parameter Type="Array">${userMultiString.join('')}</Parameter></Parameters></Method>`;
|
|
131
|
+
break;
|
|
132
|
+
case 'Lookup':
|
|
133
|
+
actionString += `<Method Name="SetFieldValue" Id="${index += 1}" ObjectPathId="${objectPathId}"><Parameters><Parameter Type="String">${field.InternalName}</Parameter><Parameter TypeId="{f1d34cc0-9b50-4a78-be78-d5facfcccfb7}"><Property Name="LookupId" Type="Int32">${row[field.InternalName]}</Property><Property Name="LookupValue" Type="Null"/></Parameter></Parameters></Method>`;
|
|
134
|
+
break;
|
|
135
|
+
case 'LookupMulti':
|
|
136
|
+
const lookupMultiString = row[field.InternalName].toString().split(';').map((element) => {
|
|
137
|
+
return `<Object TypeId="{f1d34cc0-9b50-4a78-be78-d5facfcccfb7}"><Property Name="LookupId" Type="Int32">${element}</Property><Property Name="LookupValue" Type="Null" /></Object>`;
|
|
138
|
+
});
|
|
139
|
+
actionString += `<Method Name="SetFieldValue" Id="${index += 1}" ObjectPathId="${objectPathId}"><Parameters><Parameter Type="String">${field.InternalName}</Parameter><Parameter Type="Array">${lookupMultiString.join('')}</Parameter></Parameters></Method>`;
|
|
140
|
+
break;
|
|
141
|
+
default:
|
|
142
|
+
actionString += `<Method Name="ParseAndSetFieldValue" Id="${index += 1}" ObjectPathId="${objectPathId}"><Parameters><Parameter Type="String">${field.InternalName}</Parameter><Parameter Type="String">${row[field.InternalName].toString()}</Parameter></Parameters></Method>`;
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
actionString += `<Method Name="${systemUpdate ? 'System' : ''}Update" Id="${index += 1}" ObjectPathId="${objectPathId}"/>`;
|
|
148
|
+
return [actionString, index];
|
|
149
|
+
}
|
|
150
|
+
getListFields(options, listId, jsonContent, idColumn, logger) {
|
|
151
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
152
|
+
if (this.verbose) {
|
|
153
|
+
logger.logToStderr(`Retrieving fields for list with id ${listId}`);
|
|
154
|
+
}
|
|
155
|
+
const filterFields = [];
|
|
156
|
+
const objectKeys = Object.keys(jsonContent[0]);
|
|
157
|
+
const index = objectKeys.indexOf(idColumn, 0);
|
|
158
|
+
if (index > -1) {
|
|
159
|
+
objectKeys.splice(index, 1);
|
|
160
|
+
}
|
|
161
|
+
objectKeys.map(objectKey => {
|
|
162
|
+
filterFields.push(`InternalName eq '${objectKey}'`);
|
|
163
|
+
});
|
|
164
|
+
const fields = yield odata_1.odata.getAllItems(`${options.webUrl}/_api/web/lists(guid'${formatting_1.formatting.encodeQueryParameter(listId)}')/fields?$select=InternalName,TypeAsString&$filter=${filterFields.join(' or ')}`);
|
|
165
|
+
if (fields.length !== objectKeys.length) {
|
|
166
|
+
const fieldsThatDontExist = [];
|
|
167
|
+
objectKeys.forEach(key => {
|
|
168
|
+
const field = fields.find(field => field.InternalName === key);
|
|
169
|
+
if (!field) {
|
|
170
|
+
fieldsThatDontExist.push(key);
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
throw `Following fields specified in the csv do not exist on the list: ${fieldsThatDontExist.join(', ')}`;
|
|
174
|
+
}
|
|
175
|
+
return fields;
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
getListId(options, logger) {
|
|
179
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
180
|
+
if (options.listId) {
|
|
181
|
+
return options.listId;
|
|
182
|
+
}
|
|
183
|
+
if (this.verbose) {
|
|
184
|
+
logger.logToStderr('Retrieving list id');
|
|
185
|
+
}
|
|
186
|
+
let listUrl = `${options.webUrl}/_api/web`;
|
|
187
|
+
if (options.listTitle) {
|
|
188
|
+
listUrl += `/lists/getByTitle('${formatting_1.formatting.encodeQueryParameter(options.listTitle)}')`;
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
const listServerRelativeUrl = urlUtil_1.urlUtil.getServerRelativePath(options.webUrl, options.listUrl);
|
|
192
|
+
listUrl += `/GetList('${formatting_1.formatting.encodeQueryParameter(listServerRelativeUrl)}')`;
|
|
193
|
+
}
|
|
194
|
+
const requestOptions = {
|
|
195
|
+
url: `${listUrl}?$select=Id`,
|
|
196
|
+
headers: {
|
|
197
|
+
'accept': 'application/json;odata=nometadata'
|
|
198
|
+
},
|
|
199
|
+
responseType: 'json'
|
|
200
|
+
};
|
|
201
|
+
const listResult = yield request_1.default.get(requestOptions);
|
|
202
|
+
return listResult.Id;
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
getUsersFromCsv(webUrl, jsonContent, userFields) {
|
|
206
|
+
var _a, e_1, _b, _c;
|
|
207
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
208
|
+
if (userFields.length === 0) {
|
|
209
|
+
return [];
|
|
210
|
+
}
|
|
211
|
+
const userFieldValues = [];
|
|
212
|
+
const emailsToResolve = this.getEmailsToEnsure(jsonContent, userFields);
|
|
213
|
+
try {
|
|
214
|
+
for (var _d = true, emailsToResolve_1 = __asyncValues(emailsToResolve), emailsToResolve_1_1; emailsToResolve_1_1 = yield emailsToResolve_1.next(), _a = emailsToResolve_1_1.done, !_a;) {
|
|
215
|
+
_c = emailsToResolve_1_1.value;
|
|
216
|
+
_d = false;
|
|
217
|
+
try {
|
|
218
|
+
const email = _c;
|
|
219
|
+
const requestOptions = {
|
|
220
|
+
url: `${webUrl}/_api/web/ensureUser('${email}')?$select=Id`,
|
|
221
|
+
headers: {
|
|
222
|
+
accept: 'application/json',
|
|
223
|
+
'content-type': 'application/json'
|
|
224
|
+
},
|
|
225
|
+
responseType: 'json'
|
|
226
|
+
};
|
|
227
|
+
const response = yield request_1.default.post(requestOptions);
|
|
228
|
+
userFieldValues.push({ email: email, id: response.Id });
|
|
229
|
+
}
|
|
230
|
+
finally {
|
|
231
|
+
_d = true;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
236
|
+
finally {
|
|
237
|
+
try {
|
|
238
|
+
if (!_d && !_a && (_b = emailsToResolve_1.return)) yield _b.call(emailsToResolve_1);
|
|
239
|
+
}
|
|
240
|
+
finally { if (e_1) throw e_1.error; }
|
|
241
|
+
}
|
|
242
|
+
return userFieldValues;
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
getEmailsToEnsure(jsonContent, userFields) {
|
|
246
|
+
const emailsToResolve = [];
|
|
247
|
+
userFields.forEach((userField) => {
|
|
248
|
+
jsonContent.forEach(row => {
|
|
249
|
+
const fieldValue = row[userField.InternalName];
|
|
250
|
+
if (fieldValue !== undefined && fieldValue !== '') {
|
|
251
|
+
const emailsSplitted = fieldValue.split(';');
|
|
252
|
+
emailsSplitted.forEach((email) => {
|
|
253
|
+
if (!emailsToResolve.some(existingMail => existingMail === email)) {
|
|
254
|
+
emailsToResolve.push(email);
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
return emailsToResolve;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
_SpoListItemBatchSetCommand_instances = new WeakSet(), _SpoListItemBatchSetCommand_initTelemetry = function _SpoListItemBatchSetCommand_initTelemetry() {
|
|
264
|
+
this.telemetry.push((args) => {
|
|
265
|
+
Object.assign(this.telemetryProperties, {
|
|
266
|
+
idColumn: typeof args.options.idColumn !== 'undefined',
|
|
267
|
+
listId: typeof args.options.listId !== 'undefined',
|
|
268
|
+
listTitle: typeof args.options.listTitle !== 'undefined',
|
|
269
|
+
listUrl: typeof args.options.listUrl !== 'undefined',
|
|
270
|
+
systemUpdate: !!args.options.systemUpdate
|
|
271
|
+
});
|
|
272
|
+
});
|
|
273
|
+
}, _SpoListItemBatchSetCommand_initOptions = function _SpoListItemBatchSetCommand_initOptions() {
|
|
274
|
+
this.options.unshift({
|
|
275
|
+
option: '-p, --filePath <filePath>'
|
|
276
|
+
}, {
|
|
277
|
+
option: '-u, --webUrl <webUrl>'
|
|
278
|
+
}, {
|
|
279
|
+
option: '-l, --listId [listId]'
|
|
280
|
+
}, {
|
|
281
|
+
option: '-t, --listTitle [listTitle]'
|
|
282
|
+
}, {
|
|
283
|
+
option: '--listUrl [listUrl]'
|
|
284
|
+
}, {
|
|
285
|
+
option: '--idColumn [idColumn]'
|
|
286
|
+
}, {
|
|
287
|
+
option: '-s, --systemUpdate'
|
|
288
|
+
});
|
|
289
|
+
}, _SpoListItemBatchSetCommand_initValidators = function _SpoListItemBatchSetCommand_initValidators() {
|
|
290
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
291
|
+
const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
292
|
+
if (isValidSharePointUrl !== true) {
|
|
293
|
+
return isValidSharePointUrl;
|
|
294
|
+
}
|
|
295
|
+
if (args.options.listId &&
|
|
296
|
+
!validation_1.validation.isValidGuid(args.options.listId)) {
|
|
297
|
+
return `${args.options.listId} in option listId is not a valid GUID`;
|
|
298
|
+
}
|
|
299
|
+
if (!fs.existsSync(args.options.filePath)) {
|
|
300
|
+
return `File with path ${args.options.filePath} does not exist`;
|
|
301
|
+
}
|
|
302
|
+
return true;
|
|
303
|
+
}));
|
|
304
|
+
}, _SpoListItemBatchSetCommand_initOptionSets = function _SpoListItemBatchSetCommand_initOptionSets() {
|
|
305
|
+
this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] });
|
|
306
|
+
};
|
|
307
|
+
module.exports = new SpoListItemBatchSetCommand();
|
|
308
|
+
//# sourceMappingURL=listitem-batch-set.js.map
|
|
@@ -15,7 +15,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _SpoPageSectionAddCommand_instances, _SpoPageSectionAddCommand_initTelemetry, _SpoPageSectionAddCommand_initOptions, _SpoPageSectionAddCommand_initValidators;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const util_1 = require("util");
|
|
19
18
|
const request_1 = require("../../../../request");
|
|
20
19
|
const formatting_1 = require("../../../../utils/formatting");
|
|
21
20
|
const validation_1 = require("../../../../utils/validation");
|
|
@@ -64,7 +63,7 @@ class SpoPageSectionAddCommand extends SpoCommand_1.default {
|
|
|
64
63
|
},
|
|
65
64
|
responseType: 'json'
|
|
66
65
|
};
|
|
67
|
-
|
|
66
|
+
yield request_1.default.post(requestOptions);
|
|
68
67
|
}
|
|
69
68
|
// get columns
|
|
70
69
|
const columns = canvasContent
|
|
@@ -187,7 +186,7 @@ _SpoPageSectionAddCommand_instances = new WeakSet(), _SpoPageSectionAddCommand_i
|
|
|
187
186
|
return `${args.options.sectionTemplate} is not a valid section template. Allowed values are OneColumn|OneColumnFullWidth|TwoColumn|ThreeColumn|TwoColumnLeft|TwoColumnRight`;
|
|
188
187
|
}
|
|
189
188
|
if (typeof args.options.order !== 'undefined') {
|
|
190
|
-
if (!
|
|
189
|
+
if (!Number.isInteger(args.options.order) || args.options.order < 1) {
|
|
191
190
|
return 'The value of parameter order must be 1 or higher';
|
|
192
191
|
}
|
|
193
192
|
}
|
|
@@ -15,9 +15,8 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _SpoTenantApplicationCustomizerGetCommand_instances, _SpoTenantApplicationCustomizerGetCommand_initTelemetry, _SpoTenantApplicationCustomizerGetCommand_initOptions, _SpoTenantApplicationCustomizerGetCommand_initValidators, _SpoTenantApplicationCustomizerGetCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const Command_1 = require("../../../../Command");
|
|
19
|
-
const request_1 = require("../../../../request");
|
|
20
18
|
const formatting_1 = require("../../../../utils/formatting");
|
|
19
|
+
const odata_1 = require("../../../../utils/odata");
|
|
21
20
|
const spo_1 = require("../../../../utils/spo");
|
|
22
21
|
const urlUtil_1 = require("../../../../utils/urlUtil");
|
|
23
22
|
const validation_1 = require("../../../../utils/validation");
|
|
@@ -40,47 +39,39 @@ class SpoTenantApplicationCustomizerGetCommand extends SpoCommand_1.default {
|
|
|
40
39
|
}
|
|
41
40
|
commandAction(logger, args) {
|
|
42
41
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
const appCatalogUrl = yield spo_1.spo.getTenantAppCatalogUrl(logger, this.debug);
|
|
44
|
-
if (!appCatalogUrl) {
|
|
45
|
-
throw new Command_1.CommandError('No app catalog URL found');
|
|
46
|
-
}
|
|
47
|
-
let filter = '';
|
|
48
|
-
if (args.options.title) {
|
|
49
|
-
filter = `Title eq '${args.options.title}'`;
|
|
50
|
-
}
|
|
51
|
-
else if (args.options.id) {
|
|
52
|
-
filter = `GUID eq '${args.options.id}'`;
|
|
53
|
-
}
|
|
54
|
-
else if (args.options.clientSideComponentId) {
|
|
55
|
-
filter = `TenantWideExtensionComponentId eq '${args.options.clientSideComponentId}'`;
|
|
56
|
-
}
|
|
57
|
-
const listServerRelativeUrl = urlUtil_1.urlUtil.getServerRelativePath(appCatalogUrl, '/lists/TenantWideExtensions');
|
|
58
|
-
const reqOptions = {
|
|
59
|
-
url: `${appCatalogUrl}/_api/web/GetList('${formatting_1.formatting.encodeQueryParameter(listServerRelativeUrl)}')/items?$filter=${filter}`,
|
|
60
|
-
headers: {
|
|
61
|
-
'accept': 'application/json;odata=nometadata'
|
|
62
|
-
},
|
|
63
|
-
responseType: 'json'
|
|
64
|
-
};
|
|
65
|
-
let listItemInstances;
|
|
66
42
|
try {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
43
|
+
const appCatalogUrl = yield spo_1.spo.getTenantAppCatalogUrl(logger, this.debug);
|
|
44
|
+
if (!appCatalogUrl) {
|
|
45
|
+
throw 'No app catalog URL found';
|
|
46
|
+
}
|
|
47
|
+
let filter;
|
|
48
|
+
if (args.options.title) {
|
|
49
|
+
filter = `Title eq '${args.options.title}'`;
|
|
50
|
+
}
|
|
51
|
+
else if (args.options.id) {
|
|
52
|
+
filter = `GUID eq '${args.options.id}'`;
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
filter = `TenantWideExtensionComponentId eq '${args.options.clientSideComponentId}'`;
|
|
75
56
|
}
|
|
76
|
-
|
|
77
|
-
|
|
57
|
+
const listServerRelativeUrl = urlUtil_1.urlUtil.getServerRelativePath(appCatalogUrl, '/lists/TenantWideExtensions');
|
|
58
|
+
const listItemInstances = yield odata_1.odata.getAllItems(`${appCatalogUrl}/_api/web/GetList('${formatting_1.formatting.encodeQueryParameter(listServerRelativeUrl)}')/items?$filter=TenantWideExtensionLocation eq 'ClientSideExtension.ApplicationCustomizer' and ${filter}`);
|
|
59
|
+
if (listItemInstances) {
|
|
60
|
+
if (listItemInstances.length === 0) {
|
|
61
|
+
throw 'The specified application customizer was not found';
|
|
62
|
+
}
|
|
63
|
+
if (listItemInstances.length > 1) {
|
|
64
|
+
throw `Multiple application customizers with ${args.options.title || args.options.clientSideComponentId} were found. Please disambiguate (IDs): ${listItemInstances.map(item => item.GUID).join(', ')}`;
|
|
65
|
+
}
|
|
66
|
+
listItemInstances.forEach(v => delete v['ID']);
|
|
67
|
+
logger.log(listItemInstances[0]);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
throw 'The specified application customizer was not found';
|
|
78
71
|
}
|
|
79
|
-
listItemInstances.value.forEach(v => delete v['ID']);
|
|
80
|
-
logger.log(listItemInstances.value[0]);
|
|
81
72
|
}
|
|
82
|
-
|
|
83
|
-
|
|
73
|
+
catch (err) {
|
|
74
|
+
return this.handleRejectedODataJsonPromise(err);
|
|
84
75
|
}
|
|
85
76
|
});
|
|
86
77
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const Command_1 = require("../../../../Command");
|
|
13
|
+
const formatting_1 = require("../../../../utils/formatting");
|
|
14
|
+
const odata_1 = require("../../../../utils/odata");
|
|
15
|
+
const spo_1 = require("../../../../utils/spo");
|
|
16
|
+
const urlUtil_1 = require("../../../../utils/urlUtil");
|
|
17
|
+
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
18
|
+
const commands_1 = require("../../commands");
|
|
19
|
+
class SpoTenantApplicationCustomizerListCommand extends SpoCommand_1.default {
|
|
20
|
+
get name() {
|
|
21
|
+
return commands_1.default.TENANT_APPLICATIONCUSTOMIZER_LIST;
|
|
22
|
+
}
|
|
23
|
+
get description() {
|
|
24
|
+
return 'Retrieves a list of application customizers that are installed tenant-wide.';
|
|
25
|
+
}
|
|
26
|
+
defaultProperties() {
|
|
27
|
+
return ['Title', 'TenantWideExtensionComponentId', 'TenantWideExtensionWebTemplate'];
|
|
28
|
+
}
|
|
29
|
+
commandAction(logger) {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
const appCatalogUrl = yield spo_1.spo.getTenantAppCatalogUrl(logger, this.debug);
|
|
32
|
+
if (!appCatalogUrl) {
|
|
33
|
+
throw new Command_1.CommandError('No app catalog URL found');
|
|
34
|
+
}
|
|
35
|
+
const listServerRelativeUrl = urlUtil_1.urlUtil.getServerRelativePath(appCatalogUrl, '/lists/TenantWideExtensions');
|
|
36
|
+
try {
|
|
37
|
+
const response = yield odata_1.odata.getAllItems(`${appCatalogUrl}/_api/web/GetList('${formatting_1.formatting.encodeQueryParameter(listServerRelativeUrl)}')/items?$filter=TenantWideExtensionLocation eq 'ClientSideExtension.ApplicationCustomizer'`);
|
|
38
|
+
logger.log(response);
|
|
39
|
+
}
|
|
40
|
+
catch (err) {
|
|
41
|
+
this.handleRejectedODataJsonPromise(err);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
module.exports = new SpoTenantApplicationCustomizerListCommand();
|
|
47
|
+
//# sourceMappingURL=tenant-applicationcustomizer-list.js.map
|
|
@@ -0,0 +1,151 @@
|
|
|
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 _SpoTenantApplicationCustomizerRemoveCommand_instances, _SpoTenantApplicationCustomizerRemoveCommand_initTelemetry, _SpoTenantApplicationCustomizerRemoveCommand_initOptions, _SpoTenantApplicationCustomizerRemoveCommand_initValidators, _SpoTenantApplicationCustomizerRemoveCommand_initOptionSets;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const Cli_1 = require("../../../../cli/Cli");
|
|
19
|
+
const request_1 = require("../../../../request");
|
|
20
|
+
const formatting_1 = require("../../../../utils/formatting");
|
|
21
|
+
const odata_1 = require("../../../../utils/odata");
|
|
22
|
+
const spo_1 = require("../../../../utils/spo");
|
|
23
|
+
const urlUtil_1 = require("../../../../utils/urlUtil");
|
|
24
|
+
const validation_1 = require("../../../../utils/validation");
|
|
25
|
+
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
26
|
+
const commands_1 = require("../../commands");
|
|
27
|
+
class SpoTenantApplicationCustomizerRemoveCommand extends SpoCommand_1.default {
|
|
28
|
+
get name() {
|
|
29
|
+
return commands_1.default.TENANT_APPLICATIONCUSTOMIZER_REMOVE;
|
|
30
|
+
}
|
|
31
|
+
get description() {
|
|
32
|
+
return 'Removes an application customizer that is installed tenant wide.';
|
|
33
|
+
}
|
|
34
|
+
constructor() {
|
|
35
|
+
super();
|
|
36
|
+
_SpoTenantApplicationCustomizerRemoveCommand_instances.add(this);
|
|
37
|
+
__classPrivateFieldGet(this, _SpoTenantApplicationCustomizerRemoveCommand_instances, "m", _SpoTenantApplicationCustomizerRemoveCommand_initTelemetry).call(this);
|
|
38
|
+
__classPrivateFieldGet(this, _SpoTenantApplicationCustomizerRemoveCommand_instances, "m", _SpoTenantApplicationCustomizerRemoveCommand_initOptions).call(this);
|
|
39
|
+
__classPrivateFieldGet(this, _SpoTenantApplicationCustomizerRemoveCommand_instances, "m", _SpoTenantApplicationCustomizerRemoveCommand_initValidators).call(this);
|
|
40
|
+
__classPrivateFieldGet(this, _SpoTenantApplicationCustomizerRemoveCommand_instances, "m", _SpoTenantApplicationCustomizerRemoveCommand_initOptionSets).call(this);
|
|
41
|
+
}
|
|
42
|
+
commandAction(logger, args) {
|
|
43
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
try {
|
|
45
|
+
if (args.options.confirm) {
|
|
46
|
+
return yield this.removeTenantApplicationCustomizer(logger, args);
|
|
47
|
+
}
|
|
48
|
+
const result = yield Cli_1.Cli.prompt({
|
|
49
|
+
type: 'confirm',
|
|
50
|
+
name: 'continue',
|
|
51
|
+
default: false,
|
|
52
|
+
message: `Are you sure you want to remove the tenant applicationcustomizer ${args.options.id || args.options.title || args.options.clientSideComponentId}?`
|
|
53
|
+
});
|
|
54
|
+
if (result.continue) {
|
|
55
|
+
yield this.removeTenantApplicationCustomizer(logger, args);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
catch (err) {
|
|
59
|
+
this.handleRejectedODataJsonPromise(err);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
getTenantApplicationCustomizerId(logger, args, requestUrl) {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
if (this.verbose) {
|
|
66
|
+
logger.logToStderr(`Getting the tenant application customizer ${args.options.id || args.options.title || args.options.clientSideComponentId}`);
|
|
67
|
+
}
|
|
68
|
+
const filter = [`TenantWideExtensionLocation eq 'ClientSideExtension.ApplicationCustomizer'`];
|
|
69
|
+
if (args.options.title) {
|
|
70
|
+
filter.push(`Title eq '${args.options.title}'`);
|
|
71
|
+
}
|
|
72
|
+
else if (args.options.id) {
|
|
73
|
+
filter.push(`Id eq '${args.options.id}'`);
|
|
74
|
+
}
|
|
75
|
+
else if (args.options.clientSideComponentId) {
|
|
76
|
+
filter.push(`TenantWideExtensionComponentId eq '${args.options.clientSideComponentId}'`);
|
|
77
|
+
}
|
|
78
|
+
const listItemInstances = yield odata_1.odata.getAllItems(`${requestUrl}/items?$filter=${filter.join(' and ')}&$select=Id`);
|
|
79
|
+
if (listItemInstances.length === 0) {
|
|
80
|
+
throw 'The specified application customizer was not found';
|
|
81
|
+
}
|
|
82
|
+
if (listItemInstances.length > 1) {
|
|
83
|
+
throw `Multiple application customizers with ${args.options.title || args.options.clientSideComponentId} were found. Please disambiguate (IDs): ${listItemInstances.map(item => item.Id).join(', ')}`;
|
|
84
|
+
}
|
|
85
|
+
return listItemInstances[0].Id;
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
removeTenantApplicationCustomizer(logger, args) {
|
|
89
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
const appCatalogUrl = yield spo_1.spo.getTenantAppCatalogUrl(logger, this.debug);
|
|
91
|
+
if (!appCatalogUrl) {
|
|
92
|
+
throw 'No app catalog URL found';
|
|
93
|
+
}
|
|
94
|
+
const listServerRelativeUrl = urlUtil_1.urlUtil.getServerRelativePath(appCatalogUrl, '/lists/TenantWideExtensions');
|
|
95
|
+
const requestUrl = `${appCatalogUrl}/_api/web/GetList('${formatting_1.formatting.encodeQueryParameter(listServerRelativeUrl)}')`;
|
|
96
|
+
const id = yield this.getTenantApplicationCustomizerId(logger, args, requestUrl);
|
|
97
|
+
if (this.verbose) {
|
|
98
|
+
logger.logToStderr(`Removing tenant application customizer ${args.options.id || args.options.title || args.options.clientSideComponentId}`);
|
|
99
|
+
}
|
|
100
|
+
const requestOptions = {
|
|
101
|
+
url: `${requestUrl}/items(${id})`,
|
|
102
|
+
method: 'POST',
|
|
103
|
+
headers: {
|
|
104
|
+
'X-HTTP-Method': 'DELETE',
|
|
105
|
+
'If-Match': '*',
|
|
106
|
+
'accept': 'application/json;odata=nometadata'
|
|
107
|
+
},
|
|
108
|
+
responseType: 'json'
|
|
109
|
+
};
|
|
110
|
+
yield request_1.default.post(requestOptions);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
_SpoTenantApplicationCustomizerRemoveCommand_instances = new WeakSet(), _SpoTenantApplicationCustomizerRemoveCommand_initTelemetry = function _SpoTenantApplicationCustomizerRemoveCommand_initTelemetry() {
|
|
115
|
+
this.telemetry.push((args) => {
|
|
116
|
+
Object.assign(this.telemetryProperties, {
|
|
117
|
+
title: typeof args.options.title !== 'undefined',
|
|
118
|
+
id: typeof args.options.id !== 'undefined',
|
|
119
|
+
clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined',
|
|
120
|
+
confirm: !!args.options.confirm
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
}, _SpoTenantApplicationCustomizerRemoveCommand_initOptions = function _SpoTenantApplicationCustomizerRemoveCommand_initOptions() {
|
|
124
|
+
this.options.unshift({
|
|
125
|
+
option: '-t, --title [title]'
|
|
126
|
+
}, {
|
|
127
|
+
option: '-i, --id [id]'
|
|
128
|
+
}, {
|
|
129
|
+
option: '-c, --clientSideComponentId [clientSideComponentId]'
|
|
130
|
+
}, {
|
|
131
|
+
option: '--confirm'
|
|
132
|
+
});
|
|
133
|
+
}, _SpoTenantApplicationCustomizerRemoveCommand_initValidators = function _SpoTenantApplicationCustomizerRemoveCommand_initValidators() {
|
|
134
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
135
|
+
if (args.options.id) {
|
|
136
|
+
const id = parseInt(args.options.id);
|
|
137
|
+
if (isNaN(id)) {
|
|
138
|
+
return `${args.options.id} is not a valid list item ID`;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (args.options.clientSideComponentId &&
|
|
142
|
+
!validation_1.validation.isValidGuid(args.options.clientSideComponentId)) {
|
|
143
|
+
return `${args.options.clientSideComponentId} is not a valid GUID`;
|
|
144
|
+
}
|
|
145
|
+
return true;
|
|
146
|
+
}));
|
|
147
|
+
}, _SpoTenantApplicationCustomizerRemoveCommand_initOptionSets = function _SpoTenantApplicationCustomizerRemoveCommand_initOptionSets() {
|
|
148
|
+
this.optionSets.push({ options: ['title', 'id', 'clientSideComponentId'] });
|
|
149
|
+
};
|
|
150
|
+
module.exports = new SpoTenantApplicationCustomizerRemoveCommand();
|
|
151
|
+
//# sourceMappingURL=tenant-applicationcustomizer-remove.js.map
|