@pnp/cli-microsoft365 6.3.0-beta.64eb7da → 6.3.0-beta.655c566
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 +4 -0
- package/dist/Command.js +4 -4
- package/dist/m365/context/commands/option/option-list.js +54 -0
- package/dist/m365/context/commands.js +1 -0
- package/dist/m365/planner/commands/plan/plan-remove.js +1 -1
- package/dist/m365/planner/commands/plan/plan-set.js +21 -10
- package/dist/m365/planner/commands/roster/roster-get.js +61 -0
- package/dist/m365/planner/commands/roster/roster-member-add.js +113 -0
- package/dist/m365/planner/commands/roster/roster-member-list.js +54 -0
- package/dist/m365/planner/commands/task/task-add.js +3 -0
- package/dist/m365/planner/commands.js +3 -0
- package/dist/m365/purview/commands/retentionevent/retentionevent-get.js +76 -0
- package/dist/m365/purview/commands/retentionevent/retentionevent-list.js +47 -0
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-add.js +77 -0
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-get.js +8 -8
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-list.js +44 -0
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-remove.js +97 -0
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-set.js +90 -0
- package/dist/m365/purview/commands.js +7 -1
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-add.js +95 -0
- package/dist/m365/spo/commands/file/GraphFileDetails.js +0 -1
- package/dist/m365/spo/commands/file/file-sharinglink-add.js +2 -22
- package/dist/m365/spo/commands/file/file-sharinglink-clear.js +137 -0
- package/dist/m365/spo/commands/file/file-sharinglink-get.js +2 -25
- package/dist/m365/spo/commands/file/file-sharinglink-list.js +7 -28
- package/dist/m365/spo/commands/file/file-sharinglink-remove.js +2 -25
- package/dist/m365/spo/commands/file/file-sharinglink-set.js +104 -0
- package/dist/m365/spo/commands/listitem/listitem-add.js +2 -1
- package/dist/m365/spo/commands/navigation/navigation-node-get.js +73 -0
- package/dist/m365/spo/commands/sitedesign/sitedesign-add.js +6 -0
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-add.js +179 -0
- package/dist/m365/spo/commands.js +5 -0
- package/dist/utils/spo.js +28 -0
- package/docs/docs/cmd/context/option/option-list.md +63 -0
- package/docs/docs/cmd/pa/app/app-get.md +24 -0
- package/docs/docs/cmd/pa/app/app-list.md +21 -0
- package/docs/docs/cmd/pa/connector/connector-list.md +17 -0
- package/docs/docs/cmd/pa/environment/environment-get.md +18 -0
- package/docs/docs/cmd/pa/environment/environment-list.md +19 -0
- package/docs/docs/cmd/planner/plan/plan-set.md +10 -4
- package/docs/docs/cmd/planner/roster/roster-get.md +73 -0
- package/docs/docs/cmd/planner/roster/roster-member-add.md +87 -0
- package/docs/docs/cmd/planner/roster/roster-member-list.md +76 -0
- package/docs/docs/cmd/pp/aibuildermodel/aibuildermodel-get.md +43 -0
- package/docs/docs/cmd/pp/aibuildermodel/aibuildermodel-list.md +43 -0
- package/docs/docs/cmd/pp/card/card-clone.md +12 -0
- package/docs/docs/cmd/pp/card/card-get.md +49 -0
- package/docs/docs/cmd/pp/card/card-list.md +49 -0
- package/docs/docs/cmd/pp/chatbot/chatbot-get.md +55 -0
- package/docs/docs/cmd/pp/chatbot/chatbot-list.md +36 -0
- package/docs/docs/cmd/pp/dataverse/dataverse-table-get.md +30 -0
- package/docs/docs/cmd/pp/dataverse/dataverse-table-list.md +30 -0
- package/docs/docs/cmd/pp/dataverse/dataverse-table-row-list.md +30 -0
- package/docs/docs/cmd/pp/environment/environment-get.md +19 -0
- package/docs/docs/cmd/pp/environment/environment-list.md +19 -0
- package/docs/docs/cmd/pp/gateway/gateway-get.md +19 -0
- package/docs/docs/cmd/pp/gateway/gateway-list.md +19 -0
- package/docs/docs/cmd/pp/managementapp/managementapp-add.md +12 -0
- package/docs/docs/cmd/pp/managementapp/managementapp-list.md +12 -0
- package/docs/docs/cmd/pp/solution/solution-get.md +14 -0
- package/docs/docs/cmd/pp/solution/solution-list.md +14 -0
- package/docs/docs/cmd/pp/solution/solution-publisher-get.md +20 -1
- package/docs/docs/cmd/pp/solution/solution-publisher-list.md +18 -0
- package/docs/docs/cmd/pp/tenant/tenant-settings-list.md +21 -0
- package/docs/docs/cmd/purview/retentionevent/retentionevent-get.md +132 -0
- package/docs/docs/cmd/purview/retentionevent/retentionevent-list.md +107 -0
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-add.md +106 -0
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-list.md +97 -0
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-remove.md +43 -0
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-set.md +43 -0
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-add.md +56 -0
- package/docs/docs/cmd/spo/file/file-sharinglink-clear.md +46 -0
- package/docs/docs/cmd/spo/file/file-sharinglink-list.md +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-set.md +104 -0
- package/docs/docs/cmd/spo/navigation/navigation-node-get.md +91 -0
- package/docs/docs/cmd/spo/sitedesign/sitedesign-add.md +3 -0
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-add.md +59 -0
- package/package.json +1 -1
package/.eslintrc.js
CHANGED
|
@@ -7,6 +7,7 @@ const dictionary = [
|
|
|
7
7
|
'adaptive',
|
|
8
8
|
'ai',
|
|
9
9
|
'app',
|
|
10
|
+
'application',
|
|
10
11
|
'apply',
|
|
11
12
|
'approve',
|
|
12
13
|
'assets',
|
|
@@ -20,8 +21,11 @@ const dictionary = [
|
|
|
20
21
|
'content',
|
|
21
22
|
'conversation',
|
|
22
23
|
'custom',
|
|
24
|
+
'customizer',
|
|
23
25
|
'dataverse',
|
|
24
26
|
'default',
|
|
27
|
+
'event',
|
|
28
|
+
'eventreceiver',
|
|
25
29
|
'external',
|
|
26
30
|
'externalize',
|
|
27
31
|
'fun',
|
package/dist/Command.js
CHANGED
|
@@ -484,15 +484,15 @@ class Command {
|
|
|
484
484
|
const title = this.getLogItemTitle(l);
|
|
485
485
|
const id = this.getLogItemId(l);
|
|
486
486
|
if (title && id) {
|
|
487
|
-
output.push(`## ${title} (${id})
|
|
487
|
+
output.push(`## ${title} (${id})`, os.EOL, os.EOL);
|
|
488
488
|
}
|
|
489
489
|
else if (title) {
|
|
490
|
-
output.push(`## ${title}
|
|
490
|
+
output.push(`## ${title}`, os.EOL, os.EOL);
|
|
491
491
|
}
|
|
492
492
|
else if (id) {
|
|
493
|
-
output.push(`## ${id}
|
|
493
|
+
output.push(`## ${id}`, os.EOL, os.EOL);
|
|
494
494
|
}
|
|
495
|
-
output.push(
|
|
495
|
+
output.push(`Property | Value`, os.EOL, `---------|-------`, os.EOL);
|
|
496
496
|
output.push(Object.keys(l).map(k => {
|
|
497
497
|
const value = l[k];
|
|
498
498
|
let stringValue = value;
|
|
@@ -0,0 +1,54 @@
|
|
|
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 fs = require("fs");
|
|
13
|
+
const Command_1 = require("../../../../Command");
|
|
14
|
+
const ContextCommand_1 = require("../../../base/ContextCommand");
|
|
15
|
+
const commands_1 = require("../../commands");
|
|
16
|
+
class ContextOptionListCommand extends ContextCommand_1.default {
|
|
17
|
+
get name() {
|
|
18
|
+
return commands_1.default.OPTION_LIST;
|
|
19
|
+
}
|
|
20
|
+
get description() {
|
|
21
|
+
return 'List all options added to the context';
|
|
22
|
+
}
|
|
23
|
+
commandAction(logger) {
|
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
if (this.verbose) {
|
|
26
|
+
logger.logToStderr(`Retrieving context options...`);
|
|
27
|
+
}
|
|
28
|
+
const filePath = '.m365rc.json';
|
|
29
|
+
let m365rc = {};
|
|
30
|
+
if (fs.existsSync(filePath)) {
|
|
31
|
+
try {
|
|
32
|
+
if (this.verbose) {
|
|
33
|
+
logger.logToStderr(`Reading context file...`);
|
|
34
|
+
}
|
|
35
|
+
const fileContents = fs.readFileSync(filePath, 'utf8');
|
|
36
|
+
if (fileContents) {
|
|
37
|
+
m365rc = JSON.parse(fileContents);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
catch (e) {
|
|
41
|
+
throw new Command_1.CommandError(`Error reading ${filePath}: ${e}. Please retrieve context options from ${filePath} manually.`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (!m365rc.context) {
|
|
45
|
+
throw new Command_1.CommandError(`No context present`);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
logger.log(m365rc.context);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
module.exports = new ContextOptionListCommand();
|
|
54
|
+
//# sourceMappingURL=option-list.js.map
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const prefix = 'context';
|
|
4
4
|
exports.default = {
|
|
5
5
|
INIT: `${prefix} init`,
|
|
6
|
+
OPTION_LIST: `${prefix} option list`,
|
|
6
7
|
OPTION_REMOVE: `${prefix} option remove`,
|
|
7
8
|
OPTION_SET: `${prefix} option set`,
|
|
8
9
|
REMOVE: `${prefix} remove`
|
|
@@ -79,7 +79,7 @@ class PlannerPlanRemoveCommand extends GraphCommand_1.default {
|
|
|
79
79
|
return planner_1.planner.getPlanById(id, 'minimal');
|
|
80
80
|
}
|
|
81
81
|
const groupId = yield this.getGroupId(args);
|
|
82
|
-
return yield planner_1.planner.getPlanByTitle(title, groupId, 'minimal');
|
|
82
|
+
return yield planner_1.planner.getPlanByTitle(title, groupId, undefined, 'minimal');
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
85
|
getGroupId(args) {
|
|
@@ -59,9 +59,16 @@ class PlannerPlanSetCommand extends GraphCommand_1.default {
|
|
|
59
59
|
if (id) {
|
|
60
60
|
return id;
|
|
61
61
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
let groupId = '';
|
|
63
|
+
if (args.options.rosterId) {
|
|
64
|
+
const plans = yield planner_1.planner.getPlansByRosterId(args.options.rosterId);
|
|
65
|
+
return plans[0].id;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
groupId = yield this.getGroupId(args);
|
|
69
|
+
const plan = yield planner_1.planner.getPlanByTitle(title, groupId);
|
|
70
|
+
return plan.id;
|
|
71
|
+
}
|
|
65
72
|
});
|
|
66
73
|
}
|
|
67
74
|
getUserIds(options) {
|
|
@@ -214,6 +221,7 @@ _PlannerPlanSetCommand_instances = new WeakSet(), _PlannerPlanSetCommand_initTel
|
|
|
214
221
|
title: typeof args.options.title !== 'undefined',
|
|
215
222
|
ownerGroupId: typeof args.options.ownerGroupId !== 'undefined',
|
|
216
223
|
ownerGroupName: typeof args.options.ownerGroupName !== 'undefined',
|
|
224
|
+
rosterId: typeof args.options.rosterId !== 'undefined',
|
|
217
225
|
newTitle: typeof args.options.newTitle !== 'undefined',
|
|
218
226
|
shareWithUserIds: typeof args.options.shareWithUserIds !== 'undefined',
|
|
219
227
|
shareWithUserNames: typeof args.options.shareWithUserNames !== 'undefined'
|
|
@@ -228,6 +236,8 @@ _PlannerPlanSetCommand_instances = new WeakSet(), _PlannerPlanSetCommand_initTel
|
|
|
228
236
|
option: '--ownerGroupId [ownerGroupId]'
|
|
229
237
|
}, {
|
|
230
238
|
option: '--ownerGroupName [ownerGroupName]'
|
|
239
|
+
}, {
|
|
240
|
+
option: '--rosterId [rosterId]'
|
|
231
241
|
}, {
|
|
232
242
|
option: '--newTitle [newTitle]'
|
|
233
243
|
}, {
|
|
@@ -241,12 +251,6 @@ _PlannerPlanSetCommand_instances = new WeakSet(), _PlannerPlanSetCommand_initTel
|
|
|
241
251
|
if (args.options.ownerGroupId && !validation_1.validation.isValidGuid(args.options.ownerGroupId)) {
|
|
242
252
|
return `${args.options.ownerGroupId} is not a valid GUID`;
|
|
243
253
|
}
|
|
244
|
-
if (!args.options.ownerGroupId && !args.options.ownerGroupName) {
|
|
245
|
-
return 'Specify either ownerGroupId or ownerGroupName when using title';
|
|
246
|
-
}
|
|
247
|
-
if (args.options.ownerGroupId && args.options.ownerGroupName) {
|
|
248
|
-
return 'Specify either ownerGroupId or ownerGroupName when using title but not both';
|
|
249
|
-
}
|
|
250
254
|
}
|
|
251
255
|
if (args.options.shareWithUserIds && args.options.shareWithUserNames) {
|
|
252
256
|
return 'Specify either shareWithUserIds or shareWithUserNames but not both';
|
|
@@ -293,7 +297,14 @@ _PlannerPlanSetCommand_instances = new WeakSet(), _PlannerPlanSetCommand_initTel
|
|
|
293
297
|
return true;
|
|
294
298
|
}));
|
|
295
299
|
}, _PlannerPlanSetCommand_initOptionSets = function _PlannerPlanSetCommand_initOptionSets() {
|
|
296
|
-
this.optionSets.push({
|
|
300
|
+
this.optionSets.push({
|
|
301
|
+
options: ['id', 'title', 'rosterId']
|
|
302
|
+
}, {
|
|
303
|
+
options: ['ownerGroupId', 'ownerGroupName'],
|
|
304
|
+
runsWhen: (args) => {
|
|
305
|
+
return args.options.title !== undefined;
|
|
306
|
+
}
|
|
307
|
+
});
|
|
297
308
|
};
|
|
298
309
|
module.exports = new PlannerPlanSetCommand();
|
|
299
310
|
//# sourceMappingURL=plan-set.js.map
|
|
@@ -0,0 +1,61 @@
|
|
|
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 _PlannerRosterGetCommand_instances, _PlannerRosterGetCommand_initOptions;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const request_1 = require("../../../../request");
|
|
19
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
20
|
+
const commands_1 = require("../../commands");
|
|
21
|
+
class PlannerRosterGetCommand extends GraphCommand_1.default {
|
|
22
|
+
get name() {
|
|
23
|
+
return commands_1.default.ROSTER_GET;
|
|
24
|
+
}
|
|
25
|
+
get description() {
|
|
26
|
+
return 'Retrieve information about a specific Microsoft Planner Roster';
|
|
27
|
+
}
|
|
28
|
+
constructor() {
|
|
29
|
+
super();
|
|
30
|
+
_PlannerRosterGetCommand_instances.add(this);
|
|
31
|
+
__classPrivateFieldGet(this, _PlannerRosterGetCommand_instances, "m", _PlannerRosterGetCommand_initOptions).call(this);
|
|
32
|
+
}
|
|
33
|
+
commandAction(logger, args) {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
if (this.verbose) {
|
|
36
|
+
logger.logToStderr(`Retrieving information about Microsoft Planner Roster with id ${args.options.id}`);
|
|
37
|
+
}
|
|
38
|
+
const requestOptions = {
|
|
39
|
+
url: `${this.resource}/beta/planner/rosters/${args.options.id}`,
|
|
40
|
+
headers: {
|
|
41
|
+
'accept': 'application/json;odata.metadata=none'
|
|
42
|
+
},
|
|
43
|
+
responseType: 'json'
|
|
44
|
+
};
|
|
45
|
+
try {
|
|
46
|
+
const response = yield request_1.default.get(requestOptions);
|
|
47
|
+
logger.log(response);
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
this.handleRejectedODataJsonPromise(err);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
_PlannerRosterGetCommand_instances = new WeakSet(), _PlannerRosterGetCommand_initOptions = function _PlannerRosterGetCommand_initOptions() {
|
|
56
|
+
this.options.unshift({
|
|
57
|
+
option: '--id <id>'
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
module.exports = new PlannerRosterGetCommand();
|
|
61
|
+
//# sourceMappingURL=roster-get.js.map
|
|
@@ -0,0 +1,113 @@
|
|
|
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 _PlannerRosterMemberAddCommand_instances, _PlannerRosterMemberAddCommand_initTelemetry, _PlannerRosterMemberAddCommand_initOptions, _PlannerRosterMemberAddCommand_initOptionSets, _PlannerRosterMemberAddCommand_initValidators;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const request_1 = require("../../../../request");
|
|
19
|
+
const validation_1 = require("../../../../utils/validation");
|
|
20
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
21
|
+
const commands_1 = require("../../commands");
|
|
22
|
+
const AadUserGetCommand = require("../../../aad/commands/user/user-get");
|
|
23
|
+
const Cli_1 = require("../../../../cli/Cli");
|
|
24
|
+
class PlannerRosterMemberAddCommand extends GraphCommand_1.default {
|
|
25
|
+
get name() {
|
|
26
|
+
return commands_1.default.ROSTER_MEMBER_ADD;
|
|
27
|
+
}
|
|
28
|
+
get description() {
|
|
29
|
+
return 'Adds a user to a Microsoft Planner Roster';
|
|
30
|
+
}
|
|
31
|
+
constructor() {
|
|
32
|
+
super();
|
|
33
|
+
_PlannerRosterMemberAddCommand_instances.add(this);
|
|
34
|
+
__classPrivateFieldGet(this, _PlannerRosterMemberAddCommand_instances, "m", _PlannerRosterMemberAddCommand_initTelemetry).call(this);
|
|
35
|
+
__classPrivateFieldGet(this, _PlannerRosterMemberAddCommand_instances, "m", _PlannerRosterMemberAddCommand_initOptions).call(this);
|
|
36
|
+
__classPrivateFieldGet(this, _PlannerRosterMemberAddCommand_instances, "m", _PlannerRosterMemberAddCommand_initValidators).call(this);
|
|
37
|
+
__classPrivateFieldGet(this, _PlannerRosterMemberAddCommand_instances, "m", _PlannerRosterMemberAddCommand_initOptionSets).call(this);
|
|
38
|
+
}
|
|
39
|
+
commandAction(logger, args) {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
if (this.verbose) {
|
|
42
|
+
logger.logToStderr('Adding a user to a Microsoft Planner Roster');
|
|
43
|
+
}
|
|
44
|
+
try {
|
|
45
|
+
const userId = yield this.getUserId(logger, args);
|
|
46
|
+
const requestOptions = {
|
|
47
|
+
url: `${this.resource}/beta/planner/rosters/${args.options.rosterId}/members`,
|
|
48
|
+
headers: {
|
|
49
|
+
accept: 'application/json;odata.metadata=none'
|
|
50
|
+
},
|
|
51
|
+
data: {
|
|
52
|
+
userId: userId
|
|
53
|
+
},
|
|
54
|
+
responseType: 'json'
|
|
55
|
+
};
|
|
56
|
+
const response = yield request_1.default.post(requestOptions);
|
|
57
|
+
logger.log(response);
|
|
58
|
+
}
|
|
59
|
+
catch (err) {
|
|
60
|
+
this.handleRejectedODataJsonPromise(err);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
getUserId(logger, args) {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
if (this.verbose) {
|
|
67
|
+
logger.logToStderr("Getting the user ID");
|
|
68
|
+
}
|
|
69
|
+
if (args.options.userId) {
|
|
70
|
+
return args.options.userId;
|
|
71
|
+
}
|
|
72
|
+
const aadUserGetCommandoptions = {
|
|
73
|
+
userName: args.options.userName,
|
|
74
|
+
output: 'json',
|
|
75
|
+
debug: args.options.debug,
|
|
76
|
+
verbose: args.options.verbose
|
|
77
|
+
};
|
|
78
|
+
const aadUserGetOutput = yield Cli_1.Cli.executeCommandWithOutput(AadUserGetCommand, { options: Object.assign(Object.assign({}, aadUserGetCommandoptions), { _: [] }) });
|
|
79
|
+
if (this.verbose) {
|
|
80
|
+
logger.logToStderr(aadUserGetOutput.stderr);
|
|
81
|
+
}
|
|
82
|
+
const aadUserGetJsonOutput = JSON.parse(aadUserGetOutput.stdout);
|
|
83
|
+
return aadUserGetJsonOutput.id;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
_PlannerRosterMemberAddCommand_instances = new WeakSet(), _PlannerRosterMemberAddCommand_initTelemetry = function _PlannerRosterMemberAddCommand_initTelemetry() {
|
|
88
|
+
this.telemetry.push((args) => {
|
|
89
|
+
Object.assign(this.telemetryProperties, {
|
|
90
|
+
userId: typeof args.options.userId !== 'undefined',
|
|
91
|
+
userName: typeof args.options.userName !== 'undefined'
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
}, _PlannerRosterMemberAddCommand_initOptions = function _PlannerRosterMemberAddCommand_initOptions() {
|
|
95
|
+
this.options.unshift({
|
|
96
|
+
option: '--rosterId <rosterId>'
|
|
97
|
+
}, {
|
|
98
|
+
option: '--userId [userId]'
|
|
99
|
+
}, {
|
|
100
|
+
option: '--userName [userName]'
|
|
101
|
+
});
|
|
102
|
+
}, _PlannerRosterMemberAddCommand_initOptionSets = function _PlannerRosterMemberAddCommand_initOptionSets() {
|
|
103
|
+
this.optionSets.push({ options: ['userId', 'userName'] });
|
|
104
|
+
}, _PlannerRosterMemberAddCommand_initValidators = function _PlannerRosterMemberAddCommand_initValidators() {
|
|
105
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
106
|
+
if (args.options.userId && !validation_1.validation.isValidGuid(args.options.userId)) {
|
|
107
|
+
return `${args.options.userId} is not a valid GUID`;
|
|
108
|
+
}
|
|
109
|
+
return true;
|
|
110
|
+
}));
|
|
111
|
+
};
|
|
112
|
+
module.exports = new PlannerRosterMemberAddCommand();
|
|
113
|
+
//# sourceMappingURL=roster-member-add.js.map
|
|
@@ -0,0 +1,54 @@
|
|
|
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 _PlannerRosterMemberListCommand_instances, _PlannerRosterMemberListCommand_initOptions;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const odata_1 = require("../../../../utils/odata");
|
|
19
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
20
|
+
const commands_1 = require("../../commands");
|
|
21
|
+
class PlannerRosterMemberListCommand extends GraphCommand_1.default {
|
|
22
|
+
get name() {
|
|
23
|
+
return commands_1.default.ROSTER_MEMBER_LIST;
|
|
24
|
+
}
|
|
25
|
+
get description() {
|
|
26
|
+
return 'Lists members of the specified Microsoft Planner Roster';
|
|
27
|
+
}
|
|
28
|
+
constructor() {
|
|
29
|
+
super();
|
|
30
|
+
_PlannerRosterMemberListCommand_instances.add(this);
|
|
31
|
+
__classPrivateFieldGet(this, _PlannerRosterMemberListCommand_instances, "m", _PlannerRosterMemberListCommand_initOptions).call(this);
|
|
32
|
+
}
|
|
33
|
+
commandAction(logger, args) {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
if (this.verbose) {
|
|
36
|
+
logger.logToStderr('Retrieving members of the specified Microsoft Planner Roster');
|
|
37
|
+
}
|
|
38
|
+
try {
|
|
39
|
+
const response = yield odata_1.odata.getAllItems(`${this.resource}/beta/planner/rosters/${args.options.rosterId}/members`);
|
|
40
|
+
logger.log(response);
|
|
41
|
+
}
|
|
42
|
+
catch (err) {
|
|
43
|
+
this.handleRejectedODataJsonPromise(err);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
_PlannerRosterMemberListCommand_instances = new WeakSet(), _PlannerRosterMemberListCommand_initOptions = function _PlannerRosterMemberListCommand_initOptions() {
|
|
49
|
+
this.options.unshift({
|
|
50
|
+
option: '--rosterId <rosterId>'
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
module.exports = new PlannerRosterMemberListCommand();
|
|
54
|
+
//# sourceMappingURL=roster-member-list.js.map
|
|
@@ -69,6 +69,9 @@ class PlannerTaskAddCommand extends GraphCommand_1.default {
|
|
|
69
69
|
};
|
|
70
70
|
const newTask = yield request_1.default.post(requestOptions);
|
|
71
71
|
const result = yield this.updateTaskDetails(args.options, newTask);
|
|
72
|
+
if (result.description) {
|
|
73
|
+
result.hasDescription = true;
|
|
74
|
+
}
|
|
72
75
|
logger.log(result);
|
|
73
76
|
}
|
|
74
77
|
catch (err) {
|
|
@@ -13,6 +13,9 @@ exports.default = {
|
|
|
13
13
|
PLAN_REMOVE: `${prefix} plan remove`,
|
|
14
14
|
PLAN_SET: `${prefix} plan set`,
|
|
15
15
|
ROSTER_ADD: `${prefix} roster add`,
|
|
16
|
+
ROSTER_GET: `${prefix} roster get`,
|
|
17
|
+
ROSTER_MEMBER_ADD: `${prefix} roster member add`,
|
|
18
|
+
ROSTER_MEMBER_LIST: `${prefix} roster member list`,
|
|
16
19
|
ROSTER_REMOVE: `${prefix} roster remove`,
|
|
17
20
|
TASK_ADD: `${prefix} task add`,
|
|
18
21
|
TASK_CHECKLISTITEM_ADD: `${prefix} task checklistitem add`,
|
|
@@ -0,0 +1,76 @@
|
|
|
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 _PurviewRetentionEventGetCommand_instances, _PurviewRetentionEventGetCommand_initOptions, _PurviewRetentionEventGetCommand_initValidators;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
19
|
+
const commands_1 = require("../../commands");
|
|
20
|
+
const accessToken_1 = require("../../../../utils/accessToken");
|
|
21
|
+
const Auth_1 = require("../../../../Auth");
|
|
22
|
+
const request_1 = require("../../../../request");
|
|
23
|
+
const validation_1 = require("../../../../utils/validation");
|
|
24
|
+
class PurviewRetentionEventGetCommand extends GraphCommand_1.default {
|
|
25
|
+
get name() {
|
|
26
|
+
return commands_1.default.RETENTIONEVENT_GET;
|
|
27
|
+
}
|
|
28
|
+
get description() {
|
|
29
|
+
return 'Retrieve the specified retention event';
|
|
30
|
+
}
|
|
31
|
+
constructor() {
|
|
32
|
+
super();
|
|
33
|
+
_PurviewRetentionEventGetCommand_instances.add(this);
|
|
34
|
+
__classPrivateFieldGet(this, _PurviewRetentionEventGetCommand_instances, "m", _PurviewRetentionEventGetCommand_initOptions).call(this);
|
|
35
|
+
__classPrivateFieldGet(this, _PurviewRetentionEventGetCommand_instances, "m", _PurviewRetentionEventGetCommand_initValidators).call(this);
|
|
36
|
+
}
|
|
37
|
+
commandAction(logger, args) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
if (this.verbose) {
|
|
40
|
+
logger.logToStderr(`Retrieving retention event with id ${args.options.id}`);
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
const isAppOnlyAccessToken = accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken);
|
|
44
|
+
if (isAppOnlyAccessToken) {
|
|
45
|
+
throw 'This command currently does not support app only permissions.';
|
|
46
|
+
}
|
|
47
|
+
const requestOptions = {
|
|
48
|
+
url: `${this.resource}/beta/security/triggers/retentionEvents/${args.options.id}`,
|
|
49
|
+
headers: {
|
|
50
|
+
accept: 'application/json;odata.metadata=none'
|
|
51
|
+
},
|
|
52
|
+
responseType: 'json'
|
|
53
|
+
};
|
|
54
|
+
const res = yield request_1.default.get(requestOptions);
|
|
55
|
+
logger.log(res);
|
|
56
|
+
}
|
|
57
|
+
catch (err) {
|
|
58
|
+
this.handleRejectedODataJsonPromise(err);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
_PurviewRetentionEventGetCommand_instances = new WeakSet(), _PurviewRetentionEventGetCommand_initOptions = function _PurviewRetentionEventGetCommand_initOptions() {
|
|
64
|
+
this.options.unshift({
|
|
65
|
+
option: '-i, --id <id>'
|
|
66
|
+
});
|
|
67
|
+
}, _PurviewRetentionEventGetCommand_initValidators = function _PurviewRetentionEventGetCommand_initValidators() {
|
|
68
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
if (!validation_1.validation.isValidGuid(args.options.id)) {
|
|
70
|
+
return `'${args.options.id}' is not a valid GUID.`;
|
|
71
|
+
}
|
|
72
|
+
return true;
|
|
73
|
+
}));
|
|
74
|
+
};
|
|
75
|
+
module.exports = new PurviewRetentionEventGetCommand();
|
|
76
|
+
//# sourceMappingURL=retentionevent-get.js.map
|
|
@@ -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 accessToken_1 = require("../../../../utils/accessToken");
|
|
13
|
+
const odata_1 = require("../../../../utils/odata");
|
|
14
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
15
|
+
const commands_1 = require("../../commands");
|
|
16
|
+
const Auth_1 = require("../../../../Auth");
|
|
17
|
+
class PurviewRetentionEventListCommand extends GraphCommand_1.default {
|
|
18
|
+
get name() {
|
|
19
|
+
return commands_1.default.RETENTIONEVENT_LIST;
|
|
20
|
+
}
|
|
21
|
+
get description() {
|
|
22
|
+
return 'Get a list of retention events';
|
|
23
|
+
}
|
|
24
|
+
defaultProperties() {
|
|
25
|
+
return ['id', 'displayName', 'eventTriggerDateTime'];
|
|
26
|
+
}
|
|
27
|
+
commandAction(logger) {
|
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
try {
|
|
30
|
+
const isAppOnlyAccessToken = accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken);
|
|
31
|
+
if (isAppOnlyAccessToken) {
|
|
32
|
+
throw 'This command currently does not support app only permissions.';
|
|
33
|
+
}
|
|
34
|
+
if (this.verbose) {
|
|
35
|
+
logger.logToStderr('Retrieving Purview retention events');
|
|
36
|
+
}
|
|
37
|
+
const items = yield odata_1.odata.getAllItems(`${this.resource}/beta/security/triggers/retentionEvents`);
|
|
38
|
+
logger.log(items);
|
|
39
|
+
}
|
|
40
|
+
catch (err) {
|
|
41
|
+
this.handleRejectedODataJsonPromise(err);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
module.exports = new PurviewRetentionEventListCommand();
|
|
47
|
+
//# sourceMappingURL=retentionevent-list.js.map
|
|
@@ -0,0 +1,77 @@
|
|
|
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 _PurviewRetentionEventTypeAddCommand_instances, _PurviewRetentionEventTypeAddCommand_initTelemetry, _PurviewRetentionEventTypeAddCommand_initOptions;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const Auth_1 = require("../../../../Auth");
|
|
19
|
+
const request_1 = require("../../../../request");
|
|
20
|
+
const accessToken_1 = require("../../../../utils/accessToken");
|
|
21
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
22
|
+
const commands_1 = require("../../commands");
|
|
23
|
+
class PurviewRetentionEventTypeAddCommand extends GraphCommand_1.default {
|
|
24
|
+
get name() {
|
|
25
|
+
return commands_1.default.RETENTIONEVENTTYPE_ADD;
|
|
26
|
+
}
|
|
27
|
+
get description() {
|
|
28
|
+
return 'Create a retention event type';
|
|
29
|
+
}
|
|
30
|
+
constructor() {
|
|
31
|
+
super();
|
|
32
|
+
_PurviewRetentionEventTypeAddCommand_instances.add(this);
|
|
33
|
+
__classPrivateFieldGet(this, _PurviewRetentionEventTypeAddCommand_instances, "m", _PurviewRetentionEventTypeAddCommand_initTelemetry).call(this);
|
|
34
|
+
__classPrivateFieldGet(this, _PurviewRetentionEventTypeAddCommand_instances, "m", _PurviewRetentionEventTypeAddCommand_initOptions).call(this);
|
|
35
|
+
}
|
|
36
|
+
commandAction(logger, args) {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
if (accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
|
|
39
|
+
this.handleError('This command does not support application permissions.');
|
|
40
|
+
}
|
|
41
|
+
const requestBody = {
|
|
42
|
+
displayName: args.options.displayName,
|
|
43
|
+
description: args.options.description
|
|
44
|
+
};
|
|
45
|
+
const requestOptions = {
|
|
46
|
+
url: `${this.resource}/beta/security/triggerTypes/retentionEventTypes`,
|
|
47
|
+
headers: {
|
|
48
|
+
accept: 'application/json;odata.metadata=none'
|
|
49
|
+
},
|
|
50
|
+
data: requestBody,
|
|
51
|
+
responseType: 'json'
|
|
52
|
+
};
|
|
53
|
+
try {
|
|
54
|
+
const response = yield request_1.default.post(requestOptions);
|
|
55
|
+
logger.log(response);
|
|
56
|
+
}
|
|
57
|
+
catch (err) {
|
|
58
|
+
this.handleRejectedODataPromise(err);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
_PurviewRetentionEventTypeAddCommand_instances = new WeakSet(), _PurviewRetentionEventTypeAddCommand_initTelemetry = function _PurviewRetentionEventTypeAddCommand_initTelemetry() {
|
|
64
|
+
this.telemetry.push((args) => {
|
|
65
|
+
Object.assign(this.telemetryProperties, {
|
|
66
|
+
description: typeof args.options.description !== 'undefined'
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
}, _PurviewRetentionEventTypeAddCommand_initOptions = function _PurviewRetentionEventTypeAddCommand_initOptions() {
|
|
70
|
+
this.options.unshift({
|
|
71
|
+
option: '-n, --displayName <displayName>'
|
|
72
|
+
}, {
|
|
73
|
+
option: '-d, --description [description]'
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
module.exports = new PurviewRetentionEventTypeAddCommand();
|
|
77
|
+
//# sourceMappingURL=retentioneventtype-add.js.map
|