@pnp/cli-microsoft365 6.2.0-beta.edaa477 → 6.3.0-beta.1140b31
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/Auth.js +0 -18
- package/dist/m365/context/commands/option/option-remove.js +105 -0
- package/dist/m365/context/commands/option/option-set.js +84 -0
- package/dist/m365/context/commands.js +2 -0
- package/dist/m365/file/commands/convert/convert-pdf.js +7 -6
- package/dist/m365/onenote/commands/notebook/notebook-list.js +2 -16
- package/dist/m365/onenote/commands/page/page-list.js +2 -16
- package/dist/m365/outlook/commands/mail/mail-send.js +3 -2
- package/dist/m365/outlook/commands/message/message-get.js +4 -3
- package/dist/m365/planner/commands/bucket/bucket-add.js +0 -6
- package/dist/m365/planner/commands/bucket/bucket-get.js +0 -6
- package/dist/m365/planner/commands/bucket/bucket-list.js +0 -6
- package/dist/m365/planner/commands/bucket/bucket-remove.js +0 -6
- package/dist/m365/planner/commands/bucket/bucket-set.js +0 -6
- package/dist/m365/planner/commands/plan/plan-add.js +0 -6
- package/dist/m365/planner/commands/plan/plan-get.js +0 -6
- package/dist/m365/planner/commands/plan/plan-list.js +0 -6
- package/dist/m365/planner/commands/plan/plan-remove.js +0 -6
- package/dist/m365/planner/commands/plan/plan-set.js +0 -6
- package/dist/m365/planner/commands/task/task-add.js +0 -6
- package/dist/m365/planner/commands/task/task-checklistitem-add.js +0 -6
- package/dist/m365/planner/commands/task/task-checklistitem-list.js +0 -6
- package/dist/m365/planner/commands/task/task-get.js +0 -6
- package/dist/m365/planner/commands/task/task-list.js +0 -6
- package/dist/m365/planner/commands/task/task-reference-list.js +0 -6
- package/dist/m365/planner/commands/task/task-set.js +0 -6
- package/dist/m365/pp/commands/aibuildermodel/aibuildermodel-get.js +110 -0
- package/dist/m365/pp/commands/aibuildermodel/aibuildermodel-remove.js +130 -0
- package/dist/m365/pp/commands/solution/solution-publish.js +156 -0
- package/dist/m365/pp/commands.js +3 -0
- package/dist/m365/spo/commands/file/file-retentionlabel-ensure.js +121 -0
- package/dist/m365/spo/commands/file/file-retentionlabel-remove.js +141 -0
- package/dist/m365/spo/commands/file/file-sharinglink-add.js +141 -0
- package/dist/m365/spo/commands/file/file-sharinglink-list.js +2 -2
- package/dist/m365/spo/commands/folder/folder-retentionlabel-ensure.js +138 -0
- package/dist/m365/spo/commands/folder/folder-retentionlabel-remove.js +157 -0
- package/dist/m365/spo/commands/list/list-add.js +3 -0
- package/dist/m365/spo/commands/list/list-retentionlabel-remove.js +146 -0
- package/dist/m365/spo/commands/list/list-set.js +3 -0
- package/dist/m365/spo/commands/listitem/listitem-list.js +1 -1
- package/dist/m365/spo/commands/listitem/listitem-retentionlabel-remove.js +2 -2
- package/dist/m365/spo/commands/site/site-apppermission-add.js +2 -14
- package/dist/m365/spo/commands/site/site-apppermission-get.js +2 -14
- package/dist/m365/spo/commands/site/site-apppermission-list.js +2 -14
- package/dist/m365/spo/commands/site/site-apppermission-remove.js +2 -14
- package/dist/m365/spo/commands/site/site-apppermission-set.js +2 -14
- package/dist/m365/spo/commands.js +6 -0
- package/dist/m365/teams/commands/chat/chat-list.js +4 -4
- package/dist/m365/teams/commands/meeting/meeting-attendancereport-list.js +5 -5
- package/dist/m365/teams/commands/meeting/meeting-get.js +5 -5
- package/dist/m365/teams/commands/meeting/meeting-list.js +4 -3
- package/dist/m365/teams/commands/message/message-send.js +81 -0
- package/dist/m365/teams/commands.js +1 -0
- package/dist/utils/accessToken.js +1 -1
- package/dist/utils/formatting.js +22 -0
- package/dist/utils/spo.js +27 -0
- package/docs/docs/cmd/aad/app/app-remove.md +11 -7
- package/docs/docs/cmd/context/option/option-remove.md +37 -0
- package/docs/docs/cmd/context/option/option-set.md +31 -0
- package/docs/docs/cmd/pp/aibuildermodel/aibuildermodel-get.md +99 -0
- package/docs/docs/cmd/pp/aibuildermodel/aibuildermodel-remove.md +53 -0
- package/docs/docs/cmd/pp/solution/solution-publish.md +52 -0
- package/docs/docs/cmd/spo/cdn/cdn-get.md +1 -1
- package/docs/docs/cmd/spo/cdn/cdn-origin-add.md +1 -1
- package/docs/docs/cmd/spo/cdn/cdn-origin-list.md +1 -1
- package/docs/docs/cmd/spo/cdn/cdn-origin-remove.md +1 -1
- package/docs/docs/cmd/spo/cdn/cdn-policy-list.md +1 -1
- package/docs/docs/cmd/spo/cdn/cdn-policy-set.md +1 -1
- package/docs/docs/cmd/spo/cdn/cdn-set.md +1 -1
- package/docs/docs/cmd/spo/file/file-retentionlabel-ensure.md +47 -0
- package/docs/docs/cmd/spo/file/file-retentionlabel-remove.md +43 -0
- package/docs/docs/cmd/spo/file/file-sharinglink-add.md +89 -0
- package/docs/docs/cmd/spo/file/file-sharinglink-list.md +2 -2
- package/docs/docs/cmd/spo/folder/folder-retentionlabel-ensure.md +47 -0
- package/docs/docs/cmd/spo/folder/folder-retentionlabel-remove.md +43 -0
- package/docs/docs/cmd/spo/list/list-add.md +3 -9
- package/docs/docs/cmd/spo/list/list-retentionlabel-remove.md +52 -0
- package/docs/docs/cmd/spo/list/list-set.md +3 -3
- package/docs/docs/cmd/spo/listitem/listitem-get.md +11 -12
- package/docs/docs/cmd/spo/listitem/listitem-list.md +5 -5
- package/docs/docs/cmd/teams/message/message-send.md +119 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/Auth.js
CHANGED
|
@@ -573,24 +573,6 @@ class Auth {
|
|
|
573
573
|
getMsalCacheStorage() {
|
|
574
574
|
return new FileTokenStorage_1.FileTokenStorage(FileTokenStorage_1.FileTokenStorage.msalCacheFilePath());
|
|
575
575
|
}
|
|
576
|
-
static isAppOnlyAuth(accessToken) {
|
|
577
|
-
let isAppOnlyAuth;
|
|
578
|
-
if (!accessToken || accessToken.length === 0) {
|
|
579
|
-
return isAppOnlyAuth;
|
|
580
|
-
}
|
|
581
|
-
const chunks = accessToken.split('.');
|
|
582
|
-
if (chunks.length !== 3) {
|
|
583
|
-
return isAppOnlyAuth;
|
|
584
|
-
}
|
|
585
|
-
const tokenString = Buffer.from(chunks[1], 'base64').toString();
|
|
586
|
-
try {
|
|
587
|
-
const token = JSON.parse(tokenString);
|
|
588
|
-
isAppOnlyAuth = !token.upn;
|
|
589
|
-
}
|
|
590
|
-
catch (_a) {
|
|
591
|
-
}
|
|
592
|
-
return isAppOnlyAuth;
|
|
593
|
-
}
|
|
594
576
|
}
|
|
595
577
|
exports.Auth = Auth;
|
|
596
578
|
exports.default = new Auth();
|
|
@@ -0,0 +1,105 @@
|
|
|
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 _ContextOptionRemoveCommand_instances, _ContextOptionRemoveCommand_initTelemetry, _ContextOptionRemoveCommand_initOptions;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const fs = require("fs");
|
|
19
|
+
const Cli_1 = require("../../../../cli/Cli");
|
|
20
|
+
const Command_1 = require("../../../../Command");
|
|
21
|
+
const ContextCommand_1 = require("../../../base/ContextCommand");
|
|
22
|
+
const commands_1 = require("../../commands");
|
|
23
|
+
class ContextOptionRemoveCommand extends ContextCommand_1.default {
|
|
24
|
+
get name() {
|
|
25
|
+
return commands_1.default.OPTION_REMOVE;
|
|
26
|
+
}
|
|
27
|
+
get description() {
|
|
28
|
+
return 'Removes an already available name from local context file.';
|
|
29
|
+
}
|
|
30
|
+
constructor() {
|
|
31
|
+
super();
|
|
32
|
+
_ContextOptionRemoveCommand_instances.add(this);
|
|
33
|
+
__classPrivateFieldGet(this, _ContextOptionRemoveCommand_instances, "m", _ContextOptionRemoveCommand_initOptions).call(this);
|
|
34
|
+
__classPrivateFieldGet(this, _ContextOptionRemoveCommand_instances, "m", _ContextOptionRemoveCommand_initTelemetry).call(this);
|
|
35
|
+
}
|
|
36
|
+
commandAction(logger, args) {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
if (this.verbose) {
|
|
39
|
+
logger.logToStderr(`Removing context option '${args.options.name}'...`);
|
|
40
|
+
}
|
|
41
|
+
if (args.options.confirm) {
|
|
42
|
+
this.removeContextOption(args.options.name, logger);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
const result = yield Cli_1.Cli.prompt({
|
|
46
|
+
type: 'confirm',
|
|
47
|
+
name: 'continue',
|
|
48
|
+
default: false,
|
|
49
|
+
message: `Are you sure you want to remove the context option ${args.options.name}?`
|
|
50
|
+
});
|
|
51
|
+
if (result.continue) {
|
|
52
|
+
this.removeContextOption(args.options.name, logger);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
removeContextOption(name, logger) {
|
|
58
|
+
const filePath = '.m365rc.json';
|
|
59
|
+
let m365rc = {};
|
|
60
|
+
if (fs.existsSync(filePath)) {
|
|
61
|
+
try {
|
|
62
|
+
if (this.verbose) {
|
|
63
|
+
logger.logToStderr(`Reading context file...`);
|
|
64
|
+
}
|
|
65
|
+
const fileContents = fs.readFileSync(filePath, 'utf8');
|
|
66
|
+
if (fileContents) {
|
|
67
|
+
m365rc = JSON.parse(fileContents);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
catch (e) {
|
|
71
|
+
throw new Command_1.CommandError(`Error reading ${filePath}: ${e}. Please remove context option ${name} from ${filePath} manually.`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (!m365rc.context || !m365rc.context[name]) {
|
|
75
|
+
throw new Command_1.CommandError(`There is no option ${name} in the context info`);
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
try {
|
|
79
|
+
if (this.verbose) {
|
|
80
|
+
logger.logToStderr(`Removing context option ${name} from the context file...`);
|
|
81
|
+
}
|
|
82
|
+
delete m365rc.context[name];
|
|
83
|
+
fs.writeFileSync(filePath, JSON.stringify(m365rc, null, 2));
|
|
84
|
+
}
|
|
85
|
+
catch (e) {
|
|
86
|
+
throw new Command_1.CommandError(`Error writing ${filePath}: ${e}. Please remove context option ${name} from ${filePath} manually.`);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
_ContextOptionRemoveCommand_instances = new WeakSet(), _ContextOptionRemoveCommand_initTelemetry = function _ContextOptionRemoveCommand_initTelemetry() {
|
|
92
|
+
this.telemetry.push((args) => {
|
|
93
|
+
Object.assign(this.telemetryProperties, {
|
|
94
|
+
confirm: !!args.options.confirm
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
}, _ContextOptionRemoveCommand_initOptions = function _ContextOptionRemoveCommand_initOptions() {
|
|
98
|
+
this.options.unshift({
|
|
99
|
+
option: '-n, --name <name>'
|
|
100
|
+
}, {
|
|
101
|
+
option: '--confirm'
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
module.exports = new ContextOptionRemoveCommand();
|
|
105
|
+
//# sourceMappingURL=option-remove.js.map
|
|
@@ -0,0 +1,84 @@
|
|
|
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 _ContextOptionSetCommand_instances, _ContextOptionSetCommand_initOptions;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const fs = require("fs");
|
|
19
|
+
const Command_1 = require("../../../../Command");
|
|
20
|
+
const ContextCommand_1 = require("../../../base/ContextCommand");
|
|
21
|
+
const commands_1 = require("../../commands");
|
|
22
|
+
class ContextOptionSetCommand extends ContextCommand_1.default {
|
|
23
|
+
get name() {
|
|
24
|
+
return commands_1.default.OPTION_SET;
|
|
25
|
+
}
|
|
26
|
+
get description() {
|
|
27
|
+
return 'Allows to add a new name for the option and value to the local context file.';
|
|
28
|
+
}
|
|
29
|
+
constructor() {
|
|
30
|
+
super();
|
|
31
|
+
_ContextOptionSetCommand_instances.add(this);
|
|
32
|
+
__classPrivateFieldGet(this, _ContextOptionSetCommand_instances, "m", _ContextOptionSetCommand_initOptions).call(this);
|
|
33
|
+
}
|
|
34
|
+
commandAction(logger, args) {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
const filePath = '.m365rc.json';
|
|
37
|
+
if (this.verbose) {
|
|
38
|
+
logger.logToStderr(`Saving ${args.options.name} with value ${args.options.value} to the ${filePath} file...`);
|
|
39
|
+
}
|
|
40
|
+
let m365rc = {};
|
|
41
|
+
if (fs.existsSync(filePath)) {
|
|
42
|
+
try {
|
|
43
|
+
if (this.verbose) {
|
|
44
|
+
logger.logToStderr(`Reading existing ${filePath}...`);
|
|
45
|
+
}
|
|
46
|
+
const fileContents = fs.readFileSync(filePath, 'utf8');
|
|
47
|
+
if (fileContents) {
|
|
48
|
+
m365rc = JSON.parse(fileContents);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
catch (e) {
|
|
52
|
+
throw new Command_1.CommandError(`Error reading ${filePath}: ${e}. Please add ${args.options.name} to ${filePath} manually.`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (m365rc.context) {
|
|
56
|
+
m365rc.context[args.options.name] = args.options.value;
|
|
57
|
+
try {
|
|
58
|
+
if (this.verbose) {
|
|
59
|
+
logger.logToStderr(`Creating option ${args.options.name} with value ${args.options.value} in existing context...`);
|
|
60
|
+
}
|
|
61
|
+
fs.writeFileSync(filePath, JSON.stringify(m365rc, null, 2));
|
|
62
|
+
}
|
|
63
|
+
catch (e) {
|
|
64
|
+
throw new Command_1.CommandError(`Error writing ${filePath}: ${e}. Please add ${args.options.name} to ${filePath} manually.`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
if (this.verbose) {
|
|
69
|
+
logger.logToStderr(`Context doesn't exist. Initializing the context and creating option ${args.options.name} with value ${args.options.value}...`);
|
|
70
|
+
}
|
|
71
|
+
this.saveContextInfo({ [args.options.name]: args.options.value });
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
_ContextOptionSetCommand_instances = new WeakSet(), _ContextOptionSetCommand_initOptions = function _ContextOptionSetCommand_initOptions() {
|
|
77
|
+
this.options.unshift({
|
|
78
|
+
option: '-n, --name <name>'
|
|
79
|
+
}, {
|
|
80
|
+
option: '-v, --value <value>'
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
module.exports = new ContextOptionSetCommand();
|
|
84
|
+
//# sourceMappingURL=option-set.js.map
|
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const prefix = 'context';
|
|
4
4
|
exports.default = {
|
|
5
5
|
INIT: `${prefix} init`,
|
|
6
|
+
OPTION_REMOVE: `${prefix} option remove`,
|
|
7
|
+
OPTION_SET: `${prefix} option set`,
|
|
6
8
|
REMOVE: `${prefix} remove`
|
|
7
9
|
};
|
|
8
10
|
//# sourceMappingURL=commands.js.map
|
|
@@ -23,6 +23,7 @@ const uuid_1 = require("uuid");
|
|
|
23
23
|
const Auth_1 = require("../../../../Auth");
|
|
24
24
|
const Command_1 = require("../../../../Command");
|
|
25
25
|
const request_1 = require("../../../../request");
|
|
26
|
+
const accessToken_1 = require("../../../../utils/accessToken");
|
|
26
27
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
27
28
|
const commands_1 = require("../../commands");
|
|
28
29
|
class FileConvertPdfCommand extends GraphCommand_1.default {
|
|
@@ -46,8 +47,8 @@ class FileConvertPdfCommand extends GraphCommand_1.default {
|
|
|
46
47
|
let sourceIsLocalFile = true;
|
|
47
48
|
let targetIsLocalFile = true;
|
|
48
49
|
let error;
|
|
49
|
-
const
|
|
50
|
-
if (typeof
|
|
50
|
+
const isAppOnlyAccessToken = accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[Auth_1.default.defaultResource].accessToken);
|
|
51
|
+
if (typeof isAppOnlyAccessToken === 'undefined') {
|
|
51
52
|
throw 'Unable to determine authentication type';
|
|
52
53
|
}
|
|
53
54
|
if (args.options.sourceFile.toLowerCase().startsWith('https://')) {
|
|
@@ -62,7 +63,7 @@ class FileConvertPdfCommand extends GraphCommand_1.default {
|
|
|
62
63
|
}
|
|
63
64
|
try {
|
|
64
65
|
try {
|
|
65
|
-
sourceFileUrl = yield this.getSourceFileUrl(logger, args,
|
|
66
|
+
sourceFileUrl = yield this.getSourceFileUrl(logger, args, isAppOnlyAccessToken);
|
|
66
67
|
const graphFileUrl = yield this.getGraphFileUrl(logger, sourceFileUrl, this.sourceFileGraphUrl);
|
|
67
68
|
const fileResponse = yield this.convertFile(logger, graphFileUrl);
|
|
68
69
|
yield this.writeFileToDisk(logger, fileResponse, localTargetFilePath);
|
|
@@ -114,17 +115,17 @@ class FileConvertPdfCommand extends GraphCommand_1.default {
|
|
|
114
115
|
* file to the user's OneDrive for Business
|
|
115
116
|
* @param logger Logger instance
|
|
116
117
|
* @param args Command args
|
|
117
|
-
* @param
|
|
118
|
+
* @param isAppOnlyAccessToken True if CLI is authenticated in app-only mode
|
|
118
119
|
* @returns Web URL of the file to upload
|
|
119
120
|
*/
|
|
120
|
-
getSourceFileUrl(logger, args,
|
|
121
|
+
getSourceFileUrl(logger, args, isAppOnlyAccessToken) {
|
|
121
122
|
if (args.options.sourceFile.toLowerCase().startsWith('https://')) {
|
|
122
123
|
return Promise.resolve(args.options.sourceFile);
|
|
123
124
|
}
|
|
124
125
|
if (this.verbose) {
|
|
125
126
|
logger.logToStderr('Uploading local file temporarily for conversion...');
|
|
126
127
|
}
|
|
127
|
-
const driveUrl = `${this.resource}/v1.0/${
|
|
128
|
+
const driveUrl = `${this.resource}/v1.0/${isAppOnlyAccessToken ? 'drive/root' : 'me/drive/root'}`;
|
|
128
129
|
// we need the original file extension because otherwise Graph won't be able
|
|
129
130
|
// to convert the file to PDF
|
|
130
131
|
this.sourceFileGraphUrl = `${driveUrl}:/${(0, uuid_1.v4)()}${path.extname(args.options.sourceFile)}`;
|
|
@@ -15,12 +15,12 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _OneNoteNotebookListCommand_instances, _OneNoteNotebookListCommand_initTelemetry, _OneNoteNotebookListCommand_initOptions, _OneNoteNotebookListCommand_initValidators;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const request_1 = require("../../../../request");
|
|
19
18
|
const odata_1 = require("../../../../utils/odata");
|
|
20
19
|
const validation_1 = require("../../../../utils/validation");
|
|
21
20
|
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
22
21
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
23
22
|
const commands_1 = require("../../commands");
|
|
23
|
+
const spo_1 = require("../../../../utils/spo");
|
|
24
24
|
class OneNoteNotebookListCommand extends GraphCommand_1.default {
|
|
25
25
|
get name() {
|
|
26
26
|
return commands_1.default.NOTEBOOK_LIST;
|
|
@@ -62,8 +62,7 @@ class OneNoteNotebookListCommand extends GraphCommand_1.default {
|
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
64
|
else if (args.options.webUrl) {
|
|
65
|
-
|
|
66
|
-
.getSpoSiteId(args)
|
|
65
|
+
spo_1.spo.getSpoGraphSiteId(args.options.webUrl)
|
|
67
66
|
.then((siteId) => {
|
|
68
67
|
endpoint = `${this.resource}/v1.0/sites/${siteId}/onenote/notebooks`;
|
|
69
68
|
return resolve(endpoint);
|
|
@@ -85,19 +84,6 @@ class OneNoteNotebookListCommand extends GraphCommand_1.default {
|
|
|
85
84
|
.getGroupByDisplayName(args.options.groupName)
|
|
86
85
|
.then(group => group.id);
|
|
87
86
|
}
|
|
88
|
-
getSpoSiteId(args) {
|
|
89
|
-
const url = new URL(args.options.webUrl);
|
|
90
|
-
const requestOptions = {
|
|
91
|
-
url: `${this.resource}/v1.0/sites/${url.hostname}:${url.pathname}`,
|
|
92
|
-
headers: {
|
|
93
|
-
accept: 'application/json;odata.metadata=none'
|
|
94
|
-
},
|
|
95
|
-
responseType: 'json'
|
|
96
|
-
};
|
|
97
|
-
return request_1.default
|
|
98
|
-
.get(requestOptions)
|
|
99
|
-
.then((site) => site.id);
|
|
100
|
-
}
|
|
101
87
|
commandAction(logger, args) {
|
|
102
88
|
return __awaiter(this, void 0, void 0, function* () {
|
|
103
89
|
try {
|
|
@@ -15,12 +15,12 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _OneNotePageListCommand_instances, _OneNotePageListCommand_initTelemetry, _OneNotePageListCommand_initOptions, _OneNotePageListCommand_initValidators, _OneNotePageListCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const request_1 = require("../../../../request");
|
|
19
18
|
const odata_1 = require("../../../../utils/odata");
|
|
20
19
|
const validation_1 = require("../../../../utils/validation");
|
|
21
20
|
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
22
21
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
23
22
|
const commands_1 = require("../../commands");
|
|
23
|
+
const spo_1 = require("../../../../utils/spo");
|
|
24
24
|
class OneNotePageListCommand extends GraphCommand_1.default {
|
|
25
25
|
get name() {
|
|
26
26
|
return commands_1.default.PAGE_LIST;
|
|
@@ -56,7 +56,7 @@ class OneNotePageListCommand extends GraphCommand_1.default {
|
|
|
56
56
|
endpoint += `groups/${groupId}`;
|
|
57
57
|
}
|
|
58
58
|
else if (args.options.webUrl) {
|
|
59
|
-
const siteId = yield
|
|
59
|
+
const siteId = yield spo_1.spo.getSpoGraphSiteId(args.options.webUrl);
|
|
60
60
|
endpoint += `sites/${siteId}`;
|
|
61
61
|
}
|
|
62
62
|
else {
|
|
@@ -72,20 +72,6 @@ class OneNotePageListCommand extends GraphCommand_1.default {
|
|
|
72
72
|
return group.id;
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
|
-
getSpoSiteId(webUrl) {
|
|
76
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
-
const url = new URL(webUrl);
|
|
78
|
-
const requestOptions = {
|
|
79
|
-
url: `${this.resource}/v1.0/sites/${url.hostname}:${url.pathname}`,
|
|
80
|
-
headers: {
|
|
81
|
-
accept: 'application/json;odata.metadata=none'
|
|
82
|
-
},
|
|
83
|
-
responseType: 'json'
|
|
84
|
-
};
|
|
85
|
-
const site = yield request_1.default.get(requestOptions);
|
|
86
|
-
return site.id;
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
75
|
commandAction(logger, args) {
|
|
90
76
|
return __awaiter(this, void 0, void 0, function* () {
|
|
91
77
|
try {
|
|
@@ -22,6 +22,7 @@ const request_1 = require("../../../../request");
|
|
|
22
22
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
23
23
|
const commands_1 = require("../../commands");
|
|
24
24
|
const formatting_1 = require("../../../../utils/formatting");
|
|
25
|
+
const accessToken_1 = require("../../../../utils/accessToken");
|
|
25
26
|
class OutlookMailSendCommand extends GraphCommand_1.default {
|
|
26
27
|
get name() {
|
|
27
28
|
return commands_1.default.MAIL_SEND;
|
|
@@ -40,8 +41,8 @@ class OutlookMailSendCommand extends GraphCommand_1.default {
|
|
|
40
41
|
commandAction(logger, args) {
|
|
41
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42
43
|
try {
|
|
43
|
-
const
|
|
44
|
-
if (
|
|
44
|
+
const isAppOnlyAccessToken = accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken);
|
|
45
|
+
if (isAppOnlyAccessToken === true && !args.options.sender) {
|
|
45
46
|
throw `Specify a upn or user id in the 'sender' option when using app only authentication.`;
|
|
46
47
|
}
|
|
47
48
|
const requestOptions = {
|
|
@@ -17,6 +17,7 @@ var _OutlookMessageGetCommand_instances, _OutlookMessageGetCommand_initTelemetry
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const Auth_1 = require("../../../../Auth");
|
|
19
19
|
const request_1 = require("../../../../request");
|
|
20
|
+
const accessToken_1 = require("../../../../utils/accessToken");
|
|
20
21
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
21
22
|
const commands_1 = require("../../commands");
|
|
22
23
|
class OutlookMessageGetCommand extends GraphCommand_1.default {
|
|
@@ -35,12 +36,12 @@ class OutlookMessageGetCommand extends GraphCommand_1.default {
|
|
|
35
36
|
commandAction(logger, args) {
|
|
36
37
|
return __awaiter(this, void 0, void 0, function* () {
|
|
37
38
|
try {
|
|
38
|
-
const
|
|
39
|
+
const isAppOnlyAccessToken = accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken);
|
|
39
40
|
if (this.verbose) {
|
|
40
|
-
logger.logToStderr(`Retrieving message with id ${args.options.id} using ${
|
|
41
|
+
logger.logToStderr(`Retrieving message with id ${args.options.id} using ${isAppOnlyAccessToken ? 'app only permissions' : 'delegated permissions'}`);
|
|
41
42
|
}
|
|
42
43
|
let requestUrl = '';
|
|
43
|
-
if (
|
|
44
|
+
if (isAppOnlyAccessToken) {
|
|
44
45
|
if (!args.options.userId && !args.options.userPrincipalName) {
|
|
45
46
|
throw `The option 'userId' or 'userPrincipalName' is required when retrieving an email using app only credentials`;
|
|
46
47
|
}
|
|
@@ -15,9 +15,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _PlannerBucketAddCommand_instances, _PlannerBucketAddCommand_initTelemetry, _PlannerBucketAddCommand_initOptions, _PlannerBucketAddCommand_initValidators, _PlannerBucketAddCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const Auth_1 = require("../../../../Auth");
|
|
19
18
|
const request_1 = require("../../../../request");
|
|
20
|
-
const accessToken_1 = require("../../../../utils/accessToken");
|
|
21
19
|
const validation_1 = require("../../../../utils/validation");
|
|
22
20
|
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
23
21
|
const planner_1 = require("../../../../utils/planner");
|
|
@@ -43,10 +41,6 @@ class PlannerBucketAddCommand extends GraphCommand_1.default {
|
|
|
43
41
|
}
|
|
44
42
|
commandAction(logger, args) {
|
|
45
43
|
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
-
if (accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
|
|
47
|
-
this.handleError('This command does not support application permissions.');
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
44
|
try {
|
|
51
45
|
const planId = yield this.getPlanId(args);
|
|
52
46
|
const requestOptions = {
|
|
@@ -15,9 +15,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _PlannerBucketGetCommand_instances, _PlannerBucketGetCommand_initTelemetry, _PlannerBucketGetCommand_initOptions, _PlannerBucketGetCommand_initValidators, _PlannerBucketGetCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const Auth_1 = require("../../../../Auth");
|
|
19
18
|
const request_1 = require("../../../../request");
|
|
20
|
-
const accessToken_1 = require("../../../../utils/accessToken");
|
|
21
19
|
const validation_1 = require("../../../../utils/validation");
|
|
22
20
|
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
23
21
|
const planner_1 = require("../../../../utils/planner");
|
|
@@ -40,10 +38,6 @@ class PlannerBucketGetCommand extends GraphCommand_1.default {
|
|
|
40
38
|
}
|
|
41
39
|
commandAction(logger, args) {
|
|
42
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
if (accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
|
|
44
|
-
this.handleError('This command does not support application permissions.');
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
41
|
try {
|
|
48
42
|
const bucketId = yield this.getBucketId(args);
|
|
49
43
|
const bucket = yield this.getBucketById(bucketId);
|
|
@@ -15,8 +15,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _PlannerBucketListCommand_instances, _PlannerBucketListCommand_initTelemetry, _PlannerBucketListCommand_initOptions, _PlannerBucketListCommand_initValidators, _PlannerBucketListCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const Auth_1 = require("../../../../Auth");
|
|
19
|
-
const accessToken_1 = require("../../../../utils/accessToken");
|
|
20
18
|
const odata_1 = require("../../../../utils/odata");
|
|
21
19
|
const validation_1 = require("../../../../utils/validation");
|
|
22
20
|
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
@@ -43,10 +41,6 @@ class PlannerBucketListCommand extends GraphCommand_1.default {
|
|
|
43
41
|
}
|
|
44
42
|
commandAction(logger, args) {
|
|
45
43
|
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
-
if (accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
|
|
47
|
-
this.handleError('This command does not support application permissions.');
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
44
|
try {
|
|
51
45
|
const planId = yield this.getPlanId(args);
|
|
52
46
|
const buckets = yield odata_1.odata.getAllItems(`${this.resource}/v1.0/planner/plans/${planId}/buckets`);
|
|
@@ -15,10 +15,8 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _PlannerBucketRemoveCommand_instances, _PlannerBucketRemoveCommand_initTelemetry, _PlannerBucketRemoveCommand_initOptions, _PlannerBucketRemoveCommand_initValidators, _PlannerBucketRemoveCommand_initOptionSets;
|
|
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 request_1 = require("../../../../request");
|
|
21
|
-
const accessToken_1 = require("../../../../utils/accessToken");
|
|
22
20
|
const validation_1 = require("../../../../utils/validation");
|
|
23
21
|
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
24
22
|
const planner_1 = require("../../../../utils/planner");
|
|
@@ -41,10 +39,6 @@ class PlannerBucketRemoveCommand 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
|
-
return;
|
|
47
|
-
}
|
|
48
42
|
const removeBucket = () => __awaiter(this, void 0, void 0, function* () {
|
|
49
43
|
try {
|
|
50
44
|
const bucket = yield this.getBucket(args);
|
|
@@ -15,9 +15,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _PlannerBucketSetCommand_instances, _PlannerBucketSetCommand_initTelemetry, _PlannerBucketSetCommand_initOptions, _PlannerBucketSetCommand_initValidators, _PlannerBucketSetCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const Auth_1 = require("../../../../Auth");
|
|
19
18
|
const request_1 = require("../../../../request");
|
|
20
|
-
const accessToken_1 = require("../../../../utils/accessToken");
|
|
21
19
|
const validation_1 = require("../../../../utils/validation");
|
|
22
20
|
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
23
21
|
const planner_1 = require("../../../../utils/planner");
|
|
@@ -40,10 +38,6 @@ class PlannerBucketSetCommand extends GraphCommand_1.default {
|
|
|
40
38
|
}
|
|
41
39
|
commandAction(logger, args) {
|
|
42
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
if (accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
|
|
44
|
-
this.handleError('This command does not support application permissions.');
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
41
|
try {
|
|
48
42
|
const bucket = yield this.getBucket(args);
|
|
49
43
|
const requestOptions = {
|
|
@@ -15,10 +15,8 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _PlannerPlanAddCommand_instances, _PlannerPlanAddCommand_initTelemetry, _PlannerPlanAddCommand_initOptions, _PlannerPlanAddCommand_initValidators, _PlannerPlanAddCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const Auth_1 = require("../../../../Auth");
|
|
19
18
|
const request_1 = require("../../../../request");
|
|
20
19
|
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
21
|
-
const accessToken_1 = require("../../../../utils/accessToken");
|
|
22
20
|
const formatting_1 = require("../../../../utils/formatting");
|
|
23
21
|
const validation_1 = require("../../../../utils/validation");
|
|
24
22
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
@@ -43,10 +41,6 @@ class PlannerPlanAddCommand extends GraphCommand_1.default {
|
|
|
43
41
|
}
|
|
44
42
|
commandAction(logger, args) {
|
|
45
43
|
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
-
if (accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
|
|
47
|
-
this.handleError('This command does not support application permissions.');
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
44
|
try {
|
|
51
45
|
const groupId = yield this.getGroupId(args);
|
|
52
46
|
const requestOptions = {
|
|
@@ -15,9 +15,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _PlannerPlanGetCommand_instances, _PlannerPlanGetCommand_initTelemetry, _PlannerPlanGetCommand_initOptions, _PlannerPlanGetCommand_initValidators, _PlannerPlanGetCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const Auth_1 = require("../../../../Auth");
|
|
19
18
|
const request_1 = require("../../../../request");
|
|
20
|
-
const accessToken_1 = require("../../../../utils/accessToken");
|
|
21
19
|
const validation_1 = require("../../../../utils/validation");
|
|
22
20
|
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
23
21
|
const planner_1 = require("../../../../utils/planner");
|
|
@@ -43,10 +41,6 @@ class PlannerPlanGetCommand extends GraphCommand_1.default {
|
|
|
43
41
|
}
|
|
44
42
|
commandAction(logger, args) {
|
|
45
43
|
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
-
if (accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
|
|
47
|
-
this.handleError('This command does not support application permissions.');
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
44
|
try {
|
|
51
45
|
if (args.options.id) {
|
|
52
46
|
const plan = yield planner_1.planner.getPlanById(args.options.id);
|
|
@@ -15,8 +15,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _PlannerPlanListCommand_instances, _PlannerPlanListCommand_initTelemetry, _PlannerPlanListCommand_initOptions, _PlannerPlanListCommand_initValidators, _PlannerPlanListCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const Auth_1 = require("../../../../Auth");
|
|
19
|
-
const accessToken_1 = require("../../../../utils/accessToken");
|
|
20
18
|
const validation_1 = require("../../../../utils/validation");
|
|
21
19
|
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
22
20
|
const planner_1 = require("../../../../utils/planner");
|
|
@@ -42,10 +40,6 @@ class PlannerPlanListCommand extends GraphCommand_1.default {
|
|
|
42
40
|
}
|
|
43
41
|
commandAction(logger, args) {
|
|
44
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
-
if (accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
|
|
46
|
-
this.handleError('This command does not support application permissions.');
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
43
|
try {
|
|
50
44
|
const groupId = yield this.getGroupId(args);
|
|
51
45
|
const result = yield planner_1.planner.getPlansByGroupId(groupId);
|
|
@@ -15,10 +15,8 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _PlannerPlanRemoveCommand_instances, _PlannerPlanRemoveCommand_initTelemetry, _PlannerPlanRemoveCommand_initOptions, _PlannerPlanRemoveCommand_initValidators, _PlannerPlanRemoveCommand_initOptionSets;
|
|
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 request_1 = require("../../../../request");
|
|
21
|
-
const accessToken_1 = require("../../../../utils/accessToken");
|
|
22
20
|
const validation_1 = require("../../../../utils/validation");
|
|
23
21
|
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
24
22
|
const planner_1 = require("../../../../utils/planner");
|
|
@@ -41,10 +39,6 @@ class PlannerPlanRemoveCommand 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
|
-
return;
|
|
47
|
-
}
|
|
48
42
|
const removePlan = () => __awaiter(this, void 0, void 0, function* () {
|
|
49
43
|
try {
|
|
50
44
|
const plan = yield this.getPlan(args);
|
|
@@ -15,9 +15,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _PlannerPlanSetCommand_instances, _PlannerPlanSetCommand_initTelemetry, _PlannerPlanSetCommand_initOptions, _PlannerPlanSetCommand_initValidators, _PlannerPlanSetCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const Auth_1 = require("../../../../Auth");
|
|
19
18
|
const request_1 = require("../../../../request");
|
|
20
|
-
const accessToken_1 = require("../../../../utils/accessToken");
|
|
21
19
|
const formatting_1 = require("../../../../utils/formatting");
|
|
22
20
|
const validation_1 = require("../../../../utils/validation");
|
|
23
21
|
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
@@ -182,10 +180,6 @@ class PlannerPlanSetCommand extends GraphCommand_1.default {
|
|
|
182
180
|
}
|
|
183
181
|
commandAction(logger, args) {
|
|
184
182
|
return __awaiter(this, void 0, void 0, function* () {
|
|
185
|
-
if (accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
|
|
186
|
-
this.handleError('This command does not support application permissions.');
|
|
187
|
-
return;
|
|
188
|
-
}
|
|
189
183
|
try {
|
|
190
184
|
const planId = yield this.getPlanId(args);
|
|
191
185
|
if (args.options.newTitle) {
|