@pnp/cli-microsoft365 6.0.0-beta.c32757e → 6.0.0-beta.ff232be
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 +2 -2
- package/dist/m365/aad/commands/app/app-remove.js +0 -4
- package/dist/m365/aad/commands/app/app-role-remove.js +0 -4
- package/dist/m365/aad/commands.js +0 -2
- package/dist/m365/base/PowerAppsCommand.js +10 -0
- package/dist/m365/pa/commands/app/app-get.js +3 -5
- package/dist/m365/pa/commands/app/app-list.js +10 -9
- package/dist/m365/pa/commands/app/app-remove.js +3 -3
- package/dist/m365/pa/commands/connector/connector-export.js +3 -3
- package/dist/m365/pa/commands/connector/connector-list.js +10 -9
- package/dist/m365/pa/commands/environment/environment-get.js +3 -3
- package/dist/m365/pa/commands/environment/environment-list.js +4 -4
- package/dist/m365/planner/commands/bucket/bucket-add.js +17 -9
- package/dist/m365/planner/commands/bucket/bucket-get.js +19 -11
- package/dist/m365/planner/commands/bucket/bucket-list.js +17 -9
- package/dist/m365/planner/commands/bucket/bucket-remove.js +19 -11
- package/dist/m365/planner/commands/bucket/bucket-set.js +19 -11
- package/dist/m365/planner/commands/plan/plan-add.js +98 -5
- package/dist/m365/planner/commands/plan/plan-get.js +1 -1
- package/dist/m365/planner/commands/plan/plan-remove.js +1 -1
- package/dist/m365/planner/commands/task/task-add.js +15 -9
- package/dist/m365/planner/commands/task/task-get.js +14 -9
- package/dist/m365/planner/commands/task/task-list.js +19 -11
- package/dist/m365/planner/commands/task/task-remove.js +4 -19
- package/dist/m365/planner/commands/task/task-set.js +15 -9
- package/dist/m365/search/commands/externalconnection/externalconnection-get.js +69 -0
- package/dist/m365/search/commands.js +1 -0
- package/dist/m365/spo/base-permissions.js +9 -0
- package/dist/m365/spo/commands/field/field-set.js +16 -9
- package/dist/m365/spo/commands/group/group-add.js +96 -0
- package/dist/m365/spo/commands/group/group-set.js +167 -0
- package/dist/m365/spo/commands/hubsite/hubsite-get.js +99 -13
- package/dist/m365/spo/commands/listitem/listitem-get.js +9 -9
- package/dist/m365/spo/commands/listitem/listitem-list.js +9 -26
- package/dist/m365/spo/commands/roledefinition/RoleDefinition.js +3 -0
- package/dist/m365/spo/commands/roledefinition/RoleType.js +16 -0
- package/dist/m365/spo/commands/roledefinition/roledefinition-get.js +59 -0
- package/dist/m365/spo/commands.js +3 -0
- package/dist/m365/teams/commands/team/team-archive.js +51 -15
- package/dist/m365/teams/commands/team/team-remove.js +47 -11
- package/dist/m365/teams/commands/team/team-unarchive.js +48 -12
- package/dist/utils/planner.js +6 -6
- package/docs/docs/cmd/aad/app/app-remove.md +0 -6
- package/docs/docs/cmd/aad/app/app-role-remove.md +0 -6
- package/docs/docs/cmd/planner/bucket/bucket-add.md +9 -6
- package/docs/docs/cmd/planner/bucket/bucket-get.md +10 -7
- package/docs/docs/cmd/planner/bucket/bucket-list.md +8 -5
- package/docs/docs/cmd/planner/bucket/bucket-remove.md +8 -5
- package/docs/docs/cmd/planner/bucket/bucket-set.md +9 -6
- package/docs/docs/cmd/planner/plan/plan-add.md +18 -2
- package/docs/docs/cmd/planner/task/task-add.md +11 -8
- package/docs/docs/cmd/planner/task/task-get.md +17 -8
- package/docs/docs/cmd/planner/task/task-list.md +9 -6
- package/docs/docs/cmd/planner/task/task-set.md +9 -6
- package/docs/docs/cmd/search/externalconnection/externalconnection-get.md +33 -0
- package/docs/docs/cmd/spo/field/field-set.md +7 -4
- package/docs/docs/cmd/spo/group/group-add.md +51 -0
- package/docs/docs/cmd/spo/group/group-set.md +69 -0
- package/docs/docs/cmd/spo/hubsite/hubsite-get.md +39 -7
- package/docs/docs/cmd/spo/listitem/listitem-get.md +11 -2
- package/docs/docs/cmd/spo/listitem/listitem-list.md +8 -6
- package/docs/docs/cmd/spo/roledefinition/roledefinition-get.md +27 -0
- package/docs/docs/cmd/teams/team/team-archive.md +20 -5
- package/docs/docs/cmd/teams/team/team-remove.md +19 -5
- package/docs/docs/cmd/teams/team/team-unarchive.md +18 -4
- package/npm-shrinkwrap.json +173 -158
- package/package.json +13 -13
package/dist/Auth.js
CHANGED
|
@@ -535,8 +535,8 @@ class Auth {
|
|
|
535
535
|
if (pos > -1) {
|
|
536
536
|
resource = resource.substr(0, pos);
|
|
537
537
|
}
|
|
538
|
-
if (resource === 'https://api.bap.microsoft.com') {
|
|
539
|
-
// api.bap.microsoft.com
|
|
538
|
+
if (resource === 'https://api.bap.microsoft.com' || resource === 'https://api.powerapps.com') {
|
|
539
|
+
// api.bap.microsoft.com and api.powerapps.com are not valid resources
|
|
540
540
|
// we need to use https://management.azure.com/ instead
|
|
541
541
|
resource = 'https://management.azure.com/';
|
|
542
542
|
}
|
|
@@ -9,9 +9,6 @@ class AadAppRemoveCommand extends GraphCommand_1.default {
|
|
|
9
9
|
get name() {
|
|
10
10
|
return commands_1.default.APP_REMOVE;
|
|
11
11
|
}
|
|
12
|
-
alias() {
|
|
13
|
-
return [commands_1.default.APP_DELETE];
|
|
14
|
-
}
|
|
15
12
|
get description() {
|
|
16
13
|
return 'Removes an Azure AD app registration';
|
|
17
14
|
}
|
|
@@ -24,7 +21,6 @@ class AadAppRemoveCommand extends GraphCommand_1.default {
|
|
|
24
21
|
return telemetryProps;
|
|
25
22
|
}
|
|
26
23
|
commandAction(logger, args, cb) {
|
|
27
|
-
this.showDeprecationWarning(logger, commands_1.default.APP_DELETE, commands_1.default.APP_REMOVE);
|
|
28
24
|
const deleteApp = () => {
|
|
29
25
|
this
|
|
30
26
|
.getObjectId(args, logger)
|
|
@@ -12,9 +12,6 @@ class AadAppRoleRemoveCommand extends GraphCommand_1.default {
|
|
|
12
12
|
get description() {
|
|
13
13
|
return 'Removes role from the specified Azure AD app registration';
|
|
14
14
|
}
|
|
15
|
-
alias() {
|
|
16
|
-
return [commands_1.default.APP_ROLE_DELETE];
|
|
17
|
-
}
|
|
18
15
|
getTelemetryProperties(args) {
|
|
19
16
|
const telemetryProps = super.getTelemetryProperties(args);
|
|
20
17
|
telemetryProps.appId = typeof args.options.appId !== 'undefined';
|
|
@@ -26,7 +23,6 @@ class AadAppRoleRemoveCommand extends GraphCommand_1.default {
|
|
|
26
23
|
return telemetryProps;
|
|
27
24
|
}
|
|
28
25
|
commandAction(logger, args, cb) {
|
|
29
|
-
this.showDeprecationWarning(logger, commands_1.default.APP_ROLE_DELETE, commands_1.default.APP_ROLE_REMOVE);
|
|
30
26
|
const deleteAppRole = () => {
|
|
31
27
|
this
|
|
32
28
|
.processAppRoleDelete(logger, args)
|
|
@@ -3,11 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const prefix = 'aad';
|
|
4
4
|
exports.default = {
|
|
5
5
|
APP_ADD: `${prefix} app add`,
|
|
6
|
-
APP_DELETE: `${prefix} app delete`,
|
|
7
6
|
APP_GET: `${prefix} app get`,
|
|
8
7
|
APP_REMOVE: `${prefix} app remove`,
|
|
9
8
|
APP_ROLE_ADD: `${prefix} app role add`,
|
|
10
|
-
APP_ROLE_DELETE: `${prefix} app role delete`,
|
|
11
9
|
APP_ROLE_LIST: `${prefix} app role list`,
|
|
12
10
|
APP_ROLE_REMOVE: `${prefix} app role remove`,
|
|
13
11
|
APP_SET: `${prefix} app set`,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const Command_1 = require("../../Command");
|
|
4
|
+
class PowerAppsCommand extends Command_1.default {
|
|
5
|
+
get resource() {
|
|
6
|
+
return 'https://api.powerapps.com';
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
exports.default = PowerAppsCommand;
|
|
10
|
+
//# sourceMappingURL=PowerAppsCommand.js.map
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const cli_1 = require("../../../../cli");
|
|
4
4
|
const request_1 = require("../../../../request");
|
|
5
5
|
const utils_1 = require("../../../../utils");
|
|
6
|
-
const
|
|
6
|
+
const PowerAppsCommand_1 = require("../../../base/PowerAppsCommand");
|
|
7
7
|
const commands_1 = require("../../commands");
|
|
8
8
|
const paAppListCommand = require("../app/app-list");
|
|
9
|
-
class PaAppGetCommand extends
|
|
9
|
+
class PaAppGetCommand extends PowerAppsCommand_1.default {
|
|
10
10
|
get name() {
|
|
11
11
|
return commands_1.default.APP_GET;
|
|
12
12
|
}
|
|
@@ -24,10 +24,8 @@ class PaAppGetCommand extends AzmgmtCommand_1.default {
|
|
|
24
24
|
}
|
|
25
25
|
commandAction(logger, args, cb) {
|
|
26
26
|
if (args.options.name) {
|
|
27
|
-
let requestUrl = '';
|
|
28
|
-
requestUrl = `${this.resource}providers/Microsoft.PowerApps/apps/${encodeURIComponent(args.options.name)}?api-version=2016-11-01`;
|
|
29
27
|
const requestOptions = {
|
|
30
|
-
url:
|
|
28
|
+
url: `${this.resource}/providers/Microsoft.PowerApps/apps/${encodeURIComponent(args.options.name)}?api-version=2016-11-01`,
|
|
31
29
|
headers: {
|
|
32
30
|
accept: 'application/json'
|
|
33
31
|
},
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
3
|
+
const utils_1 = require("../../../../utils");
|
|
4
|
+
const PowerAppsCommand_1 = require("../../../base/PowerAppsCommand");
|
|
4
5
|
const commands_1 = require("../../commands");
|
|
5
|
-
class PaAppListCommand extends
|
|
6
|
+
class PaAppListCommand extends PowerAppsCommand_1.default {
|
|
6
7
|
get name() {
|
|
7
8
|
return commands_1.default.APP_LIST;
|
|
8
9
|
}
|
|
@@ -19,15 +20,15 @@ class PaAppListCommand extends AzmgmtItemsListCommand_1.AzmgmtItemsListCommand {
|
|
|
19
20
|
return telemetryProps;
|
|
20
21
|
}
|
|
21
22
|
commandAction(logger, args, cb) {
|
|
22
|
-
const url = `${this.resource}providers/Microsoft.PowerApps${args.options.asAdmin ? '/scopes/admin' : ''}${args.options.environment ? '/environments/' + encodeURIComponent(args.options.environment) : ''}/apps?api-version=2017-08-01`;
|
|
23
|
-
|
|
24
|
-
.getAllItems(url
|
|
25
|
-
.then(() => {
|
|
26
|
-
if (
|
|
27
|
-
|
|
23
|
+
const url = `${this.resource}/providers/Microsoft.PowerApps${args.options.asAdmin ? '/scopes/admin' : ''}${args.options.environment ? '/environments/' + encodeURIComponent(args.options.environment) : ''}/apps?api-version=2017-08-01`;
|
|
24
|
+
utils_1.odata
|
|
25
|
+
.getAllItems(url)
|
|
26
|
+
.then((apps) => {
|
|
27
|
+
if (apps.length > 0) {
|
|
28
|
+
apps.forEach(a => {
|
|
28
29
|
a.displayName = a.properties.displayName;
|
|
29
30
|
});
|
|
30
|
-
logger.log(
|
|
31
|
+
logger.log(apps);
|
|
31
32
|
}
|
|
32
33
|
else {
|
|
33
34
|
if (this.verbose) {
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const cli_1 = require("../../../../cli");
|
|
4
4
|
const request_1 = require("../../../../request");
|
|
5
5
|
const utils_1 = require("../../../../utils");
|
|
6
|
-
const
|
|
6
|
+
const PowerAppsCommand_1 = require("../../../base/PowerAppsCommand");
|
|
7
7
|
const commands_1 = require("../../commands");
|
|
8
|
-
class PaAppRemoveCommand extends
|
|
8
|
+
class PaAppRemoveCommand extends PowerAppsCommand_1.default {
|
|
9
9
|
get name() {
|
|
10
10
|
return commands_1.default.APP_REMOVE;
|
|
11
11
|
}
|
|
@@ -23,7 +23,7 @@ class PaAppRemoveCommand extends AzmgmtCommand_1.default {
|
|
|
23
23
|
}
|
|
24
24
|
const removePaApp = () => {
|
|
25
25
|
const requestOptions = {
|
|
26
|
-
url: `${this.resource}providers/Microsoft.PowerApps/apps/${encodeURIComponent(args.options.name)}?api-version=2017-08-01`,
|
|
26
|
+
url: `${this.resource}/providers/Microsoft.PowerApps/apps/${encodeURIComponent(args.options.name)}?api-version=2017-08-01`,
|
|
27
27
|
resolveWithFullResponse: true,
|
|
28
28
|
headers: {
|
|
29
29
|
accept: 'application/json'
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const fs = require("fs");
|
|
4
4
|
const path = require("path");
|
|
5
5
|
const request_1 = require("../../../../request");
|
|
6
|
-
const
|
|
6
|
+
const PowerAppsCommand_1 = require("../../../base/PowerAppsCommand");
|
|
7
7
|
const commands_1 = require("../../../flow/commands");
|
|
8
8
|
const commands_2 = require("../../commands");
|
|
9
|
-
class PaConnectorExportCommand extends
|
|
9
|
+
class PaConnectorExportCommand extends PowerAppsCommand_1.default {
|
|
10
10
|
get name() {
|
|
11
11
|
return commands_2.default.CONNECTOR_EXPORT;
|
|
12
12
|
}
|
|
@@ -19,7 +19,7 @@ class PaConnectorExportCommand extends AzmgmtCommand_1.default {
|
|
|
19
19
|
commandAction(logger, args, cb) {
|
|
20
20
|
const outputFolder = path.resolve(args.options.outputFolder || '.', args.options.connector);
|
|
21
21
|
const requestOptions = {
|
|
22
|
-
url: `${this.resource}providers/Microsoft.PowerApps/apis/${encodeURIComponent(args.options.connector)}?api-version=2016-11-01&$filter=environment%20eq%20%27${encodeURIComponent(args.options.environment)}%27%20and%20IsCustomApi%20eq%20%27True%27`,
|
|
22
|
+
url: `${this.resource}/providers/Microsoft.PowerApps/apis/${encodeURIComponent(args.options.connector)}?api-version=2016-11-01&$filter=environment%20eq%20%27${encodeURIComponent(args.options.environment)}%27%20and%20IsCustomApi%20eq%20%27True%27`,
|
|
23
23
|
headers: {
|
|
24
24
|
accept: 'application/json'
|
|
25
25
|
},
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
3
|
+
const utils_1 = require("../../../../utils");
|
|
4
|
+
const PowerAppsCommand_1 = require("../../../base/PowerAppsCommand");
|
|
4
5
|
const commands_1 = require("../../../flow/commands");
|
|
5
6
|
const commands_2 = require("../../commands");
|
|
6
|
-
class PaConnectorListCommand extends
|
|
7
|
+
class PaConnectorListCommand extends PowerAppsCommand_1.default {
|
|
7
8
|
get name() {
|
|
8
9
|
return commands_2.default.CONNECTOR_LIST;
|
|
9
10
|
}
|
|
@@ -17,15 +18,15 @@ class PaConnectorListCommand extends AzmgmtItemsListCommand_1.AzmgmtItemsListCom
|
|
|
17
18
|
return ['name', 'displayName'];
|
|
18
19
|
}
|
|
19
20
|
commandAction(logger, args, cb) {
|
|
20
|
-
const url = `${this.resource}providers/Microsoft.PowerApps/apis?api-version=2016-11-01&$filter=environment%20eq%20%27${encodeURIComponent(args.options.environment)}%27%20and%20IsCustomApi%20eq%20%27True%27`;
|
|
21
|
-
|
|
22
|
-
.getAllItems(url
|
|
23
|
-
.then(() => {
|
|
24
|
-
if (
|
|
25
|
-
|
|
21
|
+
const url = `${this.resource}/providers/Microsoft.PowerApps/apis?api-version=2016-11-01&$filter=environment%20eq%20%27${encodeURIComponent(args.options.environment)}%27%20and%20IsCustomApi%20eq%20%27True%27`;
|
|
22
|
+
utils_1.odata
|
|
23
|
+
.getAllItems(url)
|
|
24
|
+
.then((connectors) => {
|
|
25
|
+
if (connectors.length > 0) {
|
|
26
|
+
connectors.forEach(c => {
|
|
26
27
|
c.displayName = c.properties.displayName;
|
|
27
28
|
});
|
|
28
|
-
logger.log(
|
|
29
|
+
logger.log(connectors);
|
|
29
30
|
}
|
|
30
31
|
else {
|
|
31
32
|
if (this.verbose) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const request_1 = require("../../../../request");
|
|
4
|
-
const
|
|
4
|
+
const PowerAppsCommand_1 = require("../../../base/PowerAppsCommand");
|
|
5
5
|
const commands_1 = require("../../commands");
|
|
6
|
-
class PaEnvironmentGetCommand extends
|
|
6
|
+
class PaEnvironmentGetCommand extends PowerAppsCommand_1.default {
|
|
7
7
|
get name() {
|
|
8
8
|
return commands_1.default.ENVIRONMENT_GET;
|
|
9
9
|
}
|
|
@@ -18,7 +18,7 @@ class PaEnvironmentGetCommand extends AzmgmtCommand_1.default {
|
|
|
18
18
|
logger.logToStderr(`Retrieving information about Microsoft Power Apps environment ${args.options.name}...`);
|
|
19
19
|
}
|
|
20
20
|
const requestOptions = {
|
|
21
|
-
url: `${this.resource}providers/Microsoft.PowerApps/environments/${encodeURIComponent(args.options.name)}?api-version=2016-11-01`,
|
|
21
|
+
url: `${this.resource}/providers/Microsoft.PowerApps/environments/${encodeURIComponent(args.options.name)}?api-version=2016-11-01`,
|
|
22
22
|
headers: {
|
|
23
23
|
accept: 'application/json'
|
|
24
24
|
},
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const request_1 = require("../../../../request");
|
|
4
|
-
const
|
|
4
|
+
const PowerAppsCommand_1 = require("../../../base/PowerAppsCommand");
|
|
5
5
|
const commands_1 = require("../../commands");
|
|
6
|
-
class PaEnvironmentListCommand extends
|
|
6
|
+
class PaEnvironmentListCommand extends PowerAppsCommand_1.default {
|
|
7
7
|
get name() {
|
|
8
8
|
return commands_1.default.ENVIRONMENT_LIST;
|
|
9
9
|
}
|
|
@@ -18,7 +18,7 @@ class PaEnvironmentListCommand extends AzmgmtCommand_1.default {
|
|
|
18
18
|
logger.logToStderr(`Retrieving list of Microsoft Power Apps environments...`);
|
|
19
19
|
}
|
|
20
20
|
const requestOptions = {
|
|
21
|
-
url: `${this.resource}providers/Microsoft.PowerApps/environments?api-version=2017-08-01`,
|
|
21
|
+
url: `${this.resource}/providers/Microsoft.PowerApps/environments?api-version=2017-08-01`,
|
|
22
22
|
headers: {
|
|
23
23
|
accept: 'application/json'
|
|
24
24
|
},
|
|
@@ -27,7 +27,7 @@ class PaEnvironmentListCommand extends AzmgmtCommand_1.default {
|
|
|
27
27
|
request_1.default
|
|
28
28
|
.get(requestOptions)
|
|
29
29
|
.then((res) => {
|
|
30
|
-
if (res.value
|
|
30
|
+
if (res.value.length > 0) {
|
|
31
31
|
res.value.forEach(e => {
|
|
32
32
|
e.displayName = e.properties.displayName;
|
|
33
33
|
});
|
|
@@ -18,6 +18,7 @@ class PlannerBucketAddCommand extends GraphCommand_1.default {
|
|
|
18
18
|
const telemetryProps = super.getTelemetryProperties(args);
|
|
19
19
|
telemetryProps.planId = typeof args.options.planId !== 'undefined';
|
|
20
20
|
telemetryProps.planName = typeof args.options.planName !== 'undefined';
|
|
21
|
+
telemetryProps.planTitle = typeof args.options.planTitle !== 'undefined';
|
|
21
22
|
telemetryProps.ownerGroupId = typeof args.options.ownerGroupId !== 'undefined';
|
|
22
23
|
telemetryProps.ownerGroupName = typeof args.options.ownerGroupName !== 'undefined';
|
|
23
24
|
telemetryProps.orderHint = typeof args.options.orderHint !== 'undefined';
|
|
@@ -27,6 +28,10 @@ class PlannerBucketAddCommand extends GraphCommand_1.default {
|
|
|
27
28
|
return ['id', 'name', 'planId', 'orderHint'];
|
|
28
29
|
}
|
|
29
30
|
commandAction(logger, args, cb) {
|
|
31
|
+
if (args.options.planName) {
|
|
32
|
+
args.options.planTitle = args.options.planName;
|
|
33
|
+
this.warn(logger, `Option 'planName' is deprecated. Please use 'planTitle' instead`);
|
|
34
|
+
}
|
|
30
35
|
if (utils_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
|
|
31
36
|
this.handleError('This command does not support application permissions.', logger, cb);
|
|
32
37
|
return;
|
|
@@ -59,7 +64,7 @@ class PlannerBucketAddCommand extends GraphCommand_1.default {
|
|
|
59
64
|
}
|
|
60
65
|
return this
|
|
61
66
|
.getGroupId(args)
|
|
62
|
-
.then(groupId => planner_1.planner.
|
|
67
|
+
.then(groupId => planner_1.planner.getPlanByTitle(args.options.planTitle, groupId))
|
|
63
68
|
.then(plan => plan.id);
|
|
64
69
|
}
|
|
65
70
|
getGroupId(args) {
|
|
@@ -81,6 +86,9 @@ class PlannerBucketAddCommand extends GraphCommand_1.default {
|
|
|
81
86
|
{
|
|
82
87
|
option: "--planName [planName]"
|
|
83
88
|
},
|
|
89
|
+
{
|
|
90
|
+
option: "--planTitle [planTitle]"
|
|
91
|
+
},
|
|
84
92
|
{
|
|
85
93
|
option: "--ownerGroupId [ownerGroupId]"
|
|
86
94
|
},
|
|
@@ -95,17 +103,17 @@ class PlannerBucketAddCommand extends GraphCommand_1.default {
|
|
|
95
103
|
return options.concat(parentOptions);
|
|
96
104
|
}
|
|
97
105
|
validate(args) {
|
|
98
|
-
if (!args.options.planId && !args.options.planName) {
|
|
99
|
-
return 'Specify either planId or
|
|
106
|
+
if (!args.options.planId && !args.options.planName && !args.options.planTitle) {
|
|
107
|
+
return 'Specify either planId or planTitle';
|
|
100
108
|
}
|
|
101
|
-
if (args.options.planId && args.options.planName) {
|
|
102
|
-
return 'Specify either planId or
|
|
109
|
+
if (args.options.planId && (args.options.planName || args.options.planTitle)) {
|
|
110
|
+
return 'Specify either planId or planTitle but not both';
|
|
103
111
|
}
|
|
104
|
-
if (args.options.planName && !args.options.ownerGroupId && !args.options.ownerGroupName) {
|
|
105
|
-
return 'Specify either ownerGroupId or ownerGroupName when using
|
|
112
|
+
if ((args.options.planName || args.options.planTitle) && !args.options.ownerGroupId && !args.options.ownerGroupName) {
|
|
113
|
+
return 'Specify either ownerGroupId or ownerGroupName when using planTitle';
|
|
106
114
|
}
|
|
107
|
-
if (args.options.planName && args.options.ownerGroupId && args.options.ownerGroupName) {
|
|
108
|
-
return 'Specify either ownerGroupId or ownerGroupName when using
|
|
115
|
+
if ((args.options.planName || args.options.planTitle) && args.options.ownerGroupId && args.options.ownerGroupName) {
|
|
116
|
+
return 'Specify either ownerGroupId or ownerGroupName when using planTitle but not both';
|
|
109
117
|
}
|
|
110
118
|
if (args.options.ownerGroupId && !utils_1.validation.isValidGuid(args.options.ownerGroupId)) {
|
|
111
119
|
return `${args.options.ownerGroupId} is not a valid GUID`;
|
|
@@ -29,11 +29,16 @@ class PlannerBucketGetCommand extends GraphCommand_1.default {
|
|
|
29
29
|
telemetryProps.name = typeof args.options.name !== 'undefined';
|
|
30
30
|
telemetryProps.planId = typeof args.options.planId !== 'undefined';
|
|
31
31
|
telemetryProps.planName = typeof args.options.planName !== 'undefined';
|
|
32
|
+
telemetryProps.planTitle = typeof args.options.planTitle !== 'undefined';
|
|
32
33
|
telemetryProps.ownerGroupId = typeof args.options.ownerGroupId !== 'undefined';
|
|
33
34
|
telemetryProps.ownerGroupName = typeof args.options.ownerGroupName !== 'undefined';
|
|
34
35
|
return telemetryProps;
|
|
35
36
|
}
|
|
36
37
|
commandAction(logger, args, cb) {
|
|
38
|
+
if (args.options.planName) {
|
|
39
|
+
args.options.planTitle = args.options.planName;
|
|
40
|
+
this.warn(logger, `Option 'planName' is deprecated. Please use 'planTitle' instead`);
|
|
41
|
+
}
|
|
37
42
|
if (utils_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
|
|
38
43
|
this.handleError('This command does not support application permissions.', logger, cb);
|
|
39
44
|
return;
|
|
@@ -75,13 +80,13 @@ class PlannerBucketGetCommand extends GraphCommand_1.default {
|
|
|
75
80
|
});
|
|
76
81
|
}
|
|
77
82
|
getPlanId(args) {
|
|
78
|
-
const { planId,
|
|
83
|
+
const { planId, planTitle } = args.options;
|
|
79
84
|
if (planId) {
|
|
80
85
|
return Promise.resolve(planId);
|
|
81
86
|
}
|
|
82
87
|
return this
|
|
83
88
|
.getGroupId(args)
|
|
84
|
-
.then(groupId => planner_1.planner.
|
|
89
|
+
.then(groupId => planner_1.planner.getPlanByTitle(planTitle, groupId))
|
|
85
90
|
.then(plan => plan.id);
|
|
86
91
|
}
|
|
87
92
|
getBucketById(id) {
|
|
@@ -119,6 +124,9 @@ class PlannerBucketGetCommand extends GraphCommand_1.default {
|
|
|
119
124
|
{
|
|
120
125
|
option: '--planName [planName]'
|
|
121
126
|
},
|
|
127
|
+
{
|
|
128
|
+
option: "--planTitle [planTitle]"
|
|
129
|
+
},
|
|
122
130
|
{
|
|
123
131
|
option: '--ownerGroupId [ownerGroupId]'
|
|
124
132
|
},
|
|
@@ -131,26 +139,26 @@ class PlannerBucketGetCommand extends GraphCommand_1.default {
|
|
|
131
139
|
}
|
|
132
140
|
validate(args) {
|
|
133
141
|
if (args.options.id) {
|
|
134
|
-
if (args.options.planId || args.options.planName || args.options.ownerGroupId || args.options.ownerGroupName) {
|
|
135
|
-
return 'Don\'t specify planId,
|
|
142
|
+
if (args.options.planId || args.options.planName || args.options.planTitle || args.options.ownerGroupId || args.options.ownerGroupName) {
|
|
143
|
+
return 'Don\'t specify planId, planTitle, ownerGroupId or ownerGroupName when using id';
|
|
136
144
|
}
|
|
137
145
|
if (args.options.name) {
|
|
138
146
|
return 'Specify either id or name';
|
|
139
147
|
}
|
|
140
148
|
}
|
|
141
149
|
if (args.options.name) {
|
|
142
|
-
if (!args.options.planId && !args.options.planName) {
|
|
143
|
-
return 'Specify either planId or
|
|
150
|
+
if (!args.options.planId && !args.options.planName && !args.options.planTitle) {
|
|
151
|
+
return 'Specify either planId or planTitle when using name';
|
|
144
152
|
}
|
|
145
|
-
if (args.options.planId && args.options.planName) {
|
|
146
|
-
return 'Specify either planId or
|
|
153
|
+
if (args.options.planId && (args.options.planName || args.options.planTitle)) {
|
|
154
|
+
return 'Specify either planId or planTitle when using name but not both';
|
|
147
155
|
}
|
|
148
|
-
if (args.options.planName) {
|
|
156
|
+
if (args.options.planName || args.options.planTitle) {
|
|
149
157
|
if (!args.options.ownerGroupId && !args.options.ownerGroupName) {
|
|
150
|
-
return 'Specify either ownerGroupId or ownerGroupName when using
|
|
158
|
+
return 'Specify either ownerGroupId or ownerGroupName when using planTitle';
|
|
151
159
|
}
|
|
152
160
|
if (args.options.ownerGroupId && args.options.ownerGroupName) {
|
|
153
|
-
return 'Specify either ownerGroupId or ownerGroupName when using
|
|
161
|
+
return 'Specify either ownerGroupId or ownerGroupName when using planTitle but not both';
|
|
154
162
|
}
|
|
155
163
|
if (args.options.ownerGroupId && !utils_1.validation.isValidGuid(args.options.ownerGroupId)) {
|
|
156
164
|
return `${args.options.ownerGroupId} is not a valid GUID`;
|
|
@@ -17,6 +17,7 @@ class PlannerBucketListCommand extends GraphCommand_1.default {
|
|
|
17
17
|
const telemetryProps = super.getTelemetryProperties(args);
|
|
18
18
|
telemetryProps.planId = typeof args.options.planId !== 'undefined';
|
|
19
19
|
telemetryProps.planName = typeof args.options.planName !== 'undefined';
|
|
20
|
+
telemetryProps.planTitle = typeof args.options.planTitle !== 'undefined';
|
|
20
21
|
telemetryProps.ownerGroupId = typeof args.options.ownerGroupId !== 'undefined';
|
|
21
22
|
telemetryProps.ownerGroupName = typeof args.options.ownerGroupName !== 'undefined';
|
|
22
23
|
return telemetryProps;
|
|
@@ -25,6 +26,10 @@ class PlannerBucketListCommand extends GraphCommand_1.default {
|
|
|
25
26
|
return ['id', 'name', 'planId', 'orderHint'];
|
|
26
27
|
}
|
|
27
28
|
commandAction(logger, args, cb) {
|
|
29
|
+
if (args.options.planName) {
|
|
30
|
+
args.options.planTitle = args.options.planName;
|
|
31
|
+
this.warn(logger, `Option 'planName' is deprecated. Please use 'planTitle' instead`);
|
|
32
|
+
}
|
|
28
33
|
if (utils_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
|
|
29
34
|
this.handleError('This command does not support application permissions.', logger, cb);
|
|
30
35
|
return;
|
|
@@ -43,7 +48,7 @@ class PlannerBucketListCommand extends GraphCommand_1.default {
|
|
|
43
48
|
}
|
|
44
49
|
return this
|
|
45
50
|
.getGroupId(args)
|
|
46
|
-
.then(groupId => planner_1.planner.
|
|
51
|
+
.then(groupId => planner_1.planner.getPlanByTitle(args.options.planTitle, groupId))
|
|
47
52
|
.then(plan => plan.id);
|
|
48
53
|
}
|
|
49
54
|
getGroupId(args) {
|
|
@@ -62,6 +67,9 @@ class PlannerBucketListCommand extends GraphCommand_1.default {
|
|
|
62
67
|
{
|
|
63
68
|
option: '--planName [planName]'
|
|
64
69
|
},
|
|
70
|
+
{
|
|
71
|
+
option: "--planTitle [planTitle]"
|
|
72
|
+
},
|
|
65
73
|
{
|
|
66
74
|
option: '--ownerGroupId [ownerGroupId]'
|
|
67
75
|
},
|
|
@@ -73,17 +81,17 @@ class PlannerBucketListCommand extends GraphCommand_1.default {
|
|
|
73
81
|
return options.concat(parentOptions);
|
|
74
82
|
}
|
|
75
83
|
validate(args) {
|
|
76
|
-
if (!args.options.planId && !args.options.planName) {
|
|
77
|
-
return 'Specify either planId or
|
|
84
|
+
if (!args.options.planId && !args.options.planName && !args.options.planTitle) {
|
|
85
|
+
return 'Specify either planId or planTitle';
|
|
78
86
|
}
|
|
79
|
-
if (args.options.planId && args.options.planName) {
|
|
80
|
-
return 'Specify either planId or
|
|
87
|
+
if (args.options.planId && (args.options.planName || args.options.planTitle)) {
|
|
88
|
+
return 'Specify either planId or planTitle but not both';
|
|
81
89
|
}
|
|
82
|
-
if (args.options.planName && !args.options.ownerGroupId && !args.options.ownerGroupName) {
|
|
83
|
-
return 'Specify either ownerGroupId or ownerGroupName when using
|
|
90
|
+
if ((args.options.planName || args.options.planTitle) && !args.options.ownerGroupId && !args.options.ownerGroupName) {
|
|
91
|
+
return 'Specify either ownerGroupId or ownerGroupName when using planTitle';
|
|
84
92
|
}
|
|
85
|
-
if (args.options.planName && args.options.ownerGroupId && args.options.ownerGroupName) {
|
|
86
|
-
return 'Specify either ownerGroupId or ownerGroupName when using
|
|
93
|
+
if ((args.options.planName || args.options.planTitle) && args.options.ownerGroupId && args.options.ownerGroupName) {
|
|
94
|
+
return 'Specify either ownerGroupId or ownerGroupName when using planTitle but not both';
|
|
87
95
|
}
|
|
88
96
|
if (args.options.ownerGroupId && !utils_1.validation.isValidGuid(args.options.ownerGroupId)) {
|
|
89
97
|
return `${args.options.ownerGroupId} is not a valid GUID`;
|
|
@@ -21,12 +21,17 @@ class PlannerBucketRemoveCommand extends GraphCommand_1.default {
|
|
|
21
21
|
telemetryProps.name = typeof args.options.name !== 'undefined';
|
|
22
22
|
telemetryProps.planId = typeof args.options.planId !== 'undefined';
|
|
23
23
|
telemetryProps.planName = typeof args.options.planName !== 'undefined';
|
|
24
|
+
telemetryProps.planTitle = typeof args.options.planTitle !== 'undefined';
|
|
24
25
|
telemetryProps.ownerGroupId = typeof args.options.ownerGroupId !== 'undefined';
|
|
25
26
|
telemetryProps.ownerGroupName = typeof args.options.ownerGroupName !== 'undefined';
|
|
26
27
|
telemetryProps.confirm = args.options.confirm || false;
|
|
27
28
|
return telemetryProps;
|
|
28
29
|
}
|
|
29
30
|
commandAction(logger, args, cb) {
|
|
31
|
+
if (args.options.planName) {
|
|
32
|
+
args.options.planTitle = args.options.planName;
|
|
33
|
+
this.warn(logger, `Option 'planName' is deprecated. Please use 'planTitle' instead`);
|
|
34
|
+
}
|
|
30
35
|
if (utils_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
|
|
31
36
|
this.handleError('This command does not support application permissions.', logger, cb);
|
|
32
37
|
return;
|
|
@@ -101,13 +106,13 @@ class PlannerBucketRemoveCommand extends GraphCommand_1.default {
|
|
|
101
106
|
});
|
|
102
107
|
}
|
|
103
108
|
getPlanId(args) {
|
|
104
|
-
const { planId,
|
|
109
|
+
const { planId, planTitle } = args.options;
|
|
105
110
|
if (planId) {
|
|
106
111
|
return Promise.resolve(planId);
|
|
107
112
|
}
|
|
108
113
|
return this
|
|
109
114
|
.getGroupId(args)
|
|
110
|
-
.then(groupId => planner_1.planner.
|
|
115
|
+
.then(groupId => planner_1.planner.getPlanByTitle(planTitle, groupId))
|
|
111
116
|
.then(plan => plan.id);
|
|
112
117
|
}
|
|
113
118
|
getGroupId(args) {
|
|
@@ -133,6 +138,9 @@ class PlannerBucketRemoveCommand extends GraphCommand_1.default {
|
|
|
133
138
|
{
|
|
134
139
|
option: '--planName [planName]'
|
|
135
140
|
},
|
|
141
|
+
{
|
|
142
|
+
option: "--planTitle [planTitle]"
|
|
143
|
+
},
|
|
136
144
|
{
|
|
137
145
|
option: '--ownerGroupId [ownerGroupId]'
|
|
138
146
|
},
|
|
@@ -153,23 +161,23 @@ class PlannerBucketRemoveCommand extends GraphCommand_1.default {
|
|
|
153
161
|
}
|
|
154
162
|
validate(args) {
|
|
155
163
|
if (args.options.id) {
|
|
156
|
-
if (args.options.planId || args.options.planName || args.options.ownerGroupId || args.options.ownerGroupName) {
|
|
157
|
-
return 'Don\'t specify planId,
|
|
164
|
+
if (args.options.planId || args.options.planName || args.options.planTitle || args.options.ownerGroupId || args.options.ownerGroupName) {
|
|
165
|
+
return 'Don\'t specify planId, planTitle, ownerGroupId or ownerGroupName when using id';
|
|
158
166
|
}
|
|
159
167
|
}
|
|
160
168
|
else {
|
|
161
|
-
if (!args.options.planId && !args.options.planName) {
|
|
162
|
-
return 'Specify either planId or
|
|
169
|
+
if (!args.options.planId && !args.options.planName && !args.options.planTitle) {
|
|
170
|
+
return 'Specify either planId or planTitle when using name';
|
|
163
171
|
}
|
|
164
|
-
if (args.options.planId && args.options.planName) {
|
|
165
|
-
return 'Specify either planId or
|
|
172
|
+
if (args.options.planId && (args.options.planName || args.options.planTitle)) {
|
|
173
|
+
return 'Specify either planId or planTitle when using name but not both';
|
|
166
174
|
}
|
|
167
|
-
if (args.options.planName) {
|
|
175
|
+
if (args.options.planName || args.options.planTitle) {
|
|
168
176
|
if (!args.options.ownerGroupId && !args.options.ownerGroupName) {
|
|
169
|
-
return 'Specify either ownerGroupId or ownerGroupName when using
|
|
177
|
+
return 'Specify either ownerGroupId or ownerGroupName when using planTitle';
|
|
170
178
|
}
|
|
171
179
|
if (args.options.ownerGroupId && args.options.ownerGroupName) {
|
|
172
|
-
return 'Specify either ownerGroupId or ownerGroupName when using
|
|
180
|
+
return 'Specify either ownerGroupId or ownerGroupName when using planTitle but not both';
|
|
173
181
|
}
|
|
174
182
|
if (args.options.ownerGroupId && !utils_1.validation.isValidGuid(args.options.ownerGroupId)) {
|
|
175
183
|
return `${args.options.ownerGroupId} is not a valid GUID`;
|
|
@@ -20,6 +20,7 @@ class PlannerBucketSetCommand extends GraphCommand_1.default {
|
|
|
20
20
|
telemetryProps.name = typeof args.options.name !== 'undefined';
|
|
21
21
|
telemetryProps.planId = typeof args.options.planId !== 'undefined';
|
|
22
22
|
telemetryProps.planName = typeof args.options.planName !== 'undefined';
|
|
23
|
+
telemetryProps.planTitle = typeof args.options.planTitle !== 'undefined';
|
|
23
24
|
telemetryProps.ownerGroupId = typeof args.options.ownerGroupId !== 'undefined';
|
|
24
25
|
telemetryProps.ownerGroupName = typeof args.options.ownerGroupName !== 'undefined';
|
|
25
26
|
telemetryProps.newName = typeof args.options.newName !== 'undefined';
|
|
@@ -27,6 +28,10 @@ class PlannerBucketSetCommand extends GraphCommand_1.default {
|
|
|
27
28
|
return telemetryProps;
|
|
28
29
|
}
|
|
29
30
|
commandAction(logger, args, cb) {
|
|
31
|
+
if (args.options.planName) {
|
|
32
|
+
args.options.planTitle = args.options.planName;
|
|
33
|
+
this.warn(logger, `Option 'planName' is deprecated. Please use 'planTitle' instead`);
|
|
34
|
+
}
|
|
30
35
|
if (utils_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
|
|
31
36
|
this.handleError('This command does not support application permissions.', logger, cb);
|
|
32
37
|
return;
|
|
@@ -89,13 +94,13 @@ class PlannerBucketSetCommand extends GraphCommand_1.default {
|
|
|
89
94
|
});
|
|
90
95
|
}
|
|
91
96
|
getPlanId(args) {
|
|
92
|
-
const { planId,
|
|
97
|
+
const { planId, planTitle } = args.options;
|
|
93
98
|
if (planId) {
|
|
94
99
|
return Promise.resolve(planId);
|
|
95
100
|
}
|
|
96
101
|
return this
|
|
97
102
|
.getGroupId(args)
|
|
98
|
-
.then(groupId => planner_1.planner.
|
|
103
|
+
.then(groupId => planner_1.planner.getPlanByTitle(planTitle, groupId))
|
|
99
104
|
.then(plan => plan.id);
|
|
100
105
|
}
|
|
101
106
|
getGroupId(args) {
|
|
@@ -121,6 +126,9 @@ class PlannerBucketSetCommand extends GraphCommand_1.default {
|
|
|
121
126
|
{
|
|
122
127
|
option: '--planName [planName]'
|
|
123
128
|
},
|
|
129
|
+
{
|
|
130
|
+
option: "--planTitle [planTitle]"
|
|
131
|
+
},
|
|
124
132
|
{
|
|
125
133
|
option: '--ownerGroupId [ownerGroupId]'
|
|
126
134
|
},
|
|
@@ -144,23 +152,23 @@ class PlannerBucketSetCommand extends GraphCommand_1.default {
|
|
|
144
152
|
}
|
|
145
153
|
validate(args) {
|
|
146
154
|
if (args.options.id) {
|
|
147
|
-
if (args.options.planId || args.options.planName || args.options.ownerGroupId || args.options.ownerGroupName) {
|
|
148
|
-
return 'Don\'t specify planId,
|
|
155
|
+
if (args.options.planId || args.options.planName || args.options.planTitle || args.options.ownerGroupId || args.options.ownerGroupName) {
|
|
156
|
+
return 'Don\'t specify planId, planTitle, ownerGroupId or ownerGroupName when using id';
|
|
149
157
|
}
|
|
150
158
|
}
|
|
151
159
|
if (args.options.name) {
|
|
152
|
-
if (!args.options.planId && !args.options.planName) {
|
|
153
|
-
return 'Specify either planId or
|
|
160
|
+
if (!args.options.planId && !args.options.planName && !args.options.planTitle) {
|
|
161
|
+
return 'Specify either planId or planTitle when using name';
|
|
154
162
|
}
|
|
155
|
-
if (args.options.planId && args.options.planName) {
|
|
156
|
-
return 'Specify either planId or
|
|
163
|
+
if (args.options.planId && (args.options.planName || args.options.planTitle)) {
|
|
164
|
+
return 'Specify either planId or planTitle when using name but not both';
|
|
157
165
|
}
|
|
158
|
-
if (args.options.planName) {
|
|
166
|
+
if (args.options.planName || args.options.planTitle) {
|
|
159
167
|
if (!args.options.ownerGroupId && !args.options.ownerGroupName) {
|
|
160
|
-
return 'Specify either ownerGroupId or ownerGroupName when using
|
|
168
|
+
return 'Specify either ownerGroupId or ownerGroupName when using planTitle';
|
|
161
169
|
}
|
|
162
170
|
if (args.options.ownerGroupId && args.options.ownerGroupName) {
|
|
163
|
-
return 'Specify either ownerGroupId or ownerGroupName when using
|
|
171
|
+
return 'Specify either ownerGroupId or ownerGroupName when using planTitle but not both';
|
|
164
172
|
}
|
|
165
173
|
if (args.options.ownerGroupId && !utils_1.validation.isValidGuid(args.options.ownerGroupId)) {
|
|
166
174
|
return `${args.options.ownerGroupId} is not a valid GUID`;
|