@pnp/cli-microsoft365 6.0.0-beta.f73c4f8 → 6.0.0-beta.f94d570

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.
Files changed (95) hide show
  1. package/dist/Auth.js +2 -2
  2. package/dist/m365/aad/commands/app/app-remove.js +0 -4
  3. package/dist/m365/aad/commands/app/app-role-remove.js +0 -4
  4. package/dist/m365/aad/commands/o365group/o365group-recyclebinitem-restore.js +60 -9
  5. package/dist/m365/aad/commands.js +0 -2
  6. package/dist/m365/base/PowerAppsCommand.js +10 -0
  7. package/dist/m365/pa/commands/app/app-get.js +3 -5
  8. package/dist/m365/pa/commands/app/app-list.js +10 -9
  9. package/dist/m365/pa/commands/app/app-remove.js +3 -3
  10. package/dist/m365/pa/commands/connector/connector-export.js +3 -3
  11. package/dist/m365/pa/commands/connector/connector-list.js +10 -9
  12. package/dist/m365/pa/commands/environment/environment-get.js +3 -3
  13. package/dist/m365/pa/commands/environment/environment-list.js +4 -4
  14. package/dist/m365/planner/commands/bucket/bucket-add.js +4 -12
  15. package/dist/m365/planner/commands/bucket/bucket-get.js +4 -12
  16. package/dist/m365/planner/commands/bucket/bucket-list.js +4 -12
  17. package/dist/m365/planner/commands/bucket/bucket-remove.js +4 -12
  18. package/dist/m365/planner/commands/bucket/bucket-set.js +4 -12
  19. package/dist/m365/planner/commands/plan/plan-add.js +98 -5
  20. package/dist/m365/planner/commands/plan/plan-get.js +0 -4
  21. package/dist/m365/planner/commands/task/task-add.js +4 -10
  22. package/dist/m365/planner/commands/task/task-get.js +4 -19
  23. package/dist/m365/planner/commands/task/task-list.js +4 -12
  24. package/dist/m365/planner/commands/task/task-set.js +4 -10
  25. package/dist/m365/planner/commands.js +0 -2
  26. package/dist/m365/spo/commands/customaction/customaction-get.js +32 -4
  27. package/dist/m365/spo/commands/customaction/customaction-remove.js +43 -8
  28. package/dist/m365/spo/commands/field/field-get.js +14 -5
  29. package/dist/m365/spo/commands/field/field-remove.js +19 -10
  30. package/dist/m365/spo/commands/field/field-set.js +16 -9
  31. package/dist/m365/spo/commands/file/file-rename.js +108 -0
  32. package/dist/m365/spo/commands/group/group-add.js +96 -0
  33. package/dist/m365/spo/commands/group/group-get.js +26 -6
  34. package/dist/m365/spo/commands/group/group-set.js +167 -0
  35. package/dist/m365/spo/commands/hubsite/hubsite-get.js +38 -2
  36. package/dist/m365/spo/commands/list/list-list.js +1 -10
  37. package/dist/m365/spo/commands/listitem/listitem-get.js +9 -9
  38. package/dist/m365/spo/commands/listitem/listitem-list.js +9 -26
  39. package/dist/m365/spo/commands/site/site-apppermission-add.js +3 -6
  40. package/dist/m365/spo/commands/site/site-apppermission-set.js +3 -6
  41. package/dist/m365/spo/commands/site/site-list.js +47 -16
  42. package/dist/m365/spo/commands/site/site-set.js +322 -162
  43. package/dist/m365/spo/commands/tenant/tenant-appcatalog-add.js +9 -6
  44. package/dist/m365/spo/commands.js +3 -3
  45. package/dist/m365/teams/commands/tab/tab-get.js +2 -2
  46. package/dist/m365/teams/commands/team/team-archive.js +51 -15
  47. package/dist/m365/teams/commands/team/team-clone.js +33 -7
  48. package/dist/m365/teams/commands/team/team-remove.js +47 -11
  49. package/dist/m365/teams/commands/team/team-set.js +25 -5
  50. package/dist/m365/teams/commands/team/team-unarchive.js +48 -12
  51. package/docs/docs/cmd/aad/app/app-remove.md +0 -6
  52. package/docs/docs/cmd/aad/app/app-role-remove.md +0 -6
  53. package/docs/docs/cmd/aad/o365group/o365group-recyclebinitem-restore.md +21 -3
  54. package/docs/docs/cmd/planner/bucket/bucket-add.md +0 -3
  55. package/docs/docs/cmd/planner/bucket/bucket-get.md +0 -3
  56. package/docs/docs/cmd/planner/bucket/bucket-list.md +0 -3
  57. package/docs/docs/cmd/planner/bucket/bucket-remove.md +0 -3
  58. package/docs/docs/cmd/planner/bucket/bucket-set.md +0 -3
  59. package/docs/docs/cmd/planner/plan/plan-add.md +18 -2
  60. package/docs/docs/cmd/planner/plan/plan-get.md +0 -6
  61. package/docs/docs/cmd/planner/task/task-add.md +0 -3
  62. package/docs/docs/cmd/planner/task/task-get.md +6 -3
  63. package/docs/docs/cmd/planner/task/task-list.md +0 -3
  64. package/docs/docs/cmd/planner/task/task-set.md +0 -3
  65. package/docs/docs/cmd/spo/customaction/customaction-get.md +15 -2
  66. package/docs/docs/cmd/spo/customaction/customaction-remove.md +33 -2
  67. package/docs/docs/cmd/spo/field/field-get.md +6 -3
  68. package/docs/docs/cmd/spo/field/field-remove.md +9 -6
  69. package/docs/docs/cmd/spo/field/field-set.md +7 -4
  70. package/docs/docs/cmd/spo/file/file-rename.md +43 -0
  71. package/docs/docs/cmd/spo/group/group-add.md +51 -0
  72. package/docs/docs/cmd/spo/group/group-get.md +12 -3
  73. package/docs/docs/cmd/spo/group/group-set.md +69 -0
  74. package/docs/docs/cmd/spo/hubsite/hubsite-get.md +21 -0
  75. package/docs/docs/cmd/spo/list/list-list.md +0 -3
  76. package/docs/docs/cmd/spo/listitem/listitem-get.md +11 -2
  77. package/docs/docs/cmd/spo/listitem/listitem-list.md +8 -6
  78. package/docs/docs/cmd/spo/site/site-apppermission-add.md +1 -1
  79. package/docs/docs/cmd/spo/site/site-apppermission-set.md +1 -1
  80. package/docs/docs/cmd/spo/site/site-list.md +19 -7
  81. package/docs/docs/cmd/spo/site/site-set.md +50 -6
  82. package/docs/docs/cmd/teams/tab/tab-get.md +2 -2
  83. package/docs/docs/cmd/teams/team/team-archive.md +20 -5
  84. package/docs/docs/cmd/teams/team/team-clone.md +11 -5
  85. package/docs/docs/cmd/teams/team/team-remove.md +19 -5
  86. package/docs/docs/cmd/teams/team/team-set.md +10 -4
  87. package/docs/docs/cmd/teams/team/team-unarchive.md +18 -4
  88. package/npm-shrinkwrap.json +173 -158
  89. package/package.json +13 -13
  90. package/dist/m365/spo/commands/site/site-classic-add.js +0 -333
  91. package/dist/m365/spo/commands/site/site-classic-list.js +0 -98
  92. package/dist/m365/spo/commands/site/site-classic-set.js +0 -358
  93. package/docs/docs/cmd/spo/site/site-classic-add.md +0 -93
  94. package/docs/docs/cmd/spo/site/site-classic-list.md +0 -65
  95. package/docs/docs/cmd/spo/site/site-classic-set.md +0 -99
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 is not a valid resource
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)
@@ -14,33 +14,84 @@ class AadO365GroupRecycleBinItemRestoreCommand extends GraphCommand_1.default {
14
14
  alias() {
15
15
  return [commands_1.default.O365GROUP_RESTORE];
16
16
  }
17
+ getTelemetryProperties(args) {
18
+ const telemetryProps = super.getTelemetryProperties(args);
19
+ telemetryProps.id = typeof args.options.id !== 'undefined';
20
+ telemetryProps.displayName = typeof args.options.displayName !== 'undefined';
21
+ telemetryProps.mailNickname = typeof args.options.mailNickname !== 'undefined';
22
+ return telemetryProps;
23
+ }
17
24
  commandAction(logger, args, cb) {
18
25
  if (this.verbose) {
19
- logger.logToStderr(`Restoring Microsoft 365 Group: ${args.options.id}...`);
26
+ logger.logToStderr(`Restoring Microsoft 365 Group: ${args.options.id || args.options.displayName || args.options.mailNickname}...`);
27
+ }
28
+ this
29
+ .getGroupId(args.options)
30
+ .then((groupId) => {
31
+ const requestOptions = {
32
+ url: `${this.resource}/v1.0/directory/deleteditems/${groupId}/restore`,
33
+ headers: {
34
+ accept: 'application/json;odata.metadata=none',
35
+ 'content-type': 'application/json'
36
+ },
37
+ responseType: 'json'
38
+ };
39
+ return request_1.default.post(requestOptions);
40
+ })
41
+ .then(_ => cb(), (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
42
+ }
43
+ getGroupId(options) {
44
+ const { id, displayName, mailNickname } = options;
45
+ if (id) {
46
+ return Promise.resolve(id);
47
+ }
48
+ let filterValue = '';
49
+ if (displayName) {
50
+ filterValue = `displayName eq '${utils_1.formatting.encodeQueryParameter(displayName)}'`;
51
+ }
52
+ if (mailNickname) {
53
+ filterValue = `mailNickname eq '${utils_1.formatting.encodeQueryParameter(mailNickname)}'`;
20
54
  }
21
55
  const requestOptions = {
22
- url: `${this.resource}/v1.0/directory/deleteditems/${args.options.id}/restore/`,
56
+ url: `${this.resource}/v1.0/directory/deletedItems/Microsoft.Graph.Group?$filter=${filterValue}`,
23
57
  headers: {
24
- 'accept': 'application/json;odata.metadata=none',
25
- 'content-type': 'application/json'
58
+ accept: 'application/json;odata.metadata=none'
26
59
  },
27
60
  responseType: 'json'
28
61
  };
29
- request_1.default
30
- .post(requestOptions)
31
- .then(_ => cb(), (rawRes) => this.handleRejectedODataJsonPromise(rawRes, logger, cb));
62
+ return request_1.default
63
+ .get(requestOptions)
64
+ .then((response) => {
65
+ const groups = response.value;
66
+ if (groups.length === 0) {
67
+ return Promise.reject(`The specified group '${displayName || mailNickname}' does not exist.`);
68
+ }
69
+ if (groups.length > 1) {
70
+ return Promise.reject(`Multiple groups with name '${displayName || mailNickname}' found: ${groups.map(x => x.id).join(',')}.`);
71
+ }
72
+ return Promise.resolve(groups[0].id);
73
+ });
74
+ }
75
+ optionSets() {
76
+ return [['id', 'displayName', 'mailNickname']];
32
77
  }
33
78
  options() {
34
79
  const options = [
35
80
  {
36
- option: '-i, --id <id>'
81
+ option: '-i, --id [id]'
82
+ },
83
+ {
84
+ option: '-d, --displayName [displayName]'
85
+ },
86
+ {
87
+ option: '-m, --mailNickname [mailNickname]'
37
88
  }
38
89
  ];
39
90
  const parentOptions = super.options();
40
91
  return options.concat(parentOptions);
41
92
  }
42
93
  validate(args) {
43
- if (!utils_1.validation.isValidGuid(args.options.id)) {
94
+ if (args.options.id && !utils_1.validation.isValidGuid(args.options.id)) {
44
95
  return `${args.options.id} is not a valid GUID`;
45
96
  }
46
97
  return true;
@@ -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 AzmgmtCommand_1 = require("../../../base/AzmgmtCommand");
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 AzmgmtCommand_1.default {
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: requestUrl,
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 AzmgmtItemsListCommand_1 = require("../../../base/AzmgmtItemsListCommand");
3
+ const utils_1 = require("../../../../utils");
4
+ const PowerAppsCommand_1 = require("../../../base/PowerAppsCommand");
4
5
  const commands_1 = require("../../commands");
5
- class PaAppListCommand extends AzmgmtItemsListCommand_1.AzmgmtItemsListCommand {
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
- this
24
- .getAllItems(url, logger, true)
25
- .then(() => {
26
- if (this.items.length > 0) {
27
- this.items.forEach(a => {
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(this.items);
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 AzmgmtCommand_1 = require("../../../base/AzmgmtCommand");
6
+ const PowerAppsCommand_1 = require("../../../base/PowerAppsCommand");
7
7
  const commands_1 = require("../../commands");
8
- class PaAppRemoveCommand extends AzmgmtCommand_1.default {
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 AzmgmtCommand_1 = require("../../../base/AzmgmtCommand");
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 AzmgmtCommand_1.default {
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 AzmgmtItemsListCommand_1 = require("../../../base/AzmgmtItemsListCommand");
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 AzmgmtItemsListCommand_1.AzmgmtItemsListCommand {
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
- this
22
- .getAllItems(url, logger, true)
23
- .then(() => {
24
- if (this.items.length > 0) {
25
- this.items.forEach(c => {
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(this.items);
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 AzmgmtCommand_1 = require("../../../base/AzmgmtCommand");
4
+ const PowerAppsCommand_1 = require("../../../base/PowerAppsCommand");
5
5
  const commands_1 = require("../../commands");
6
- class PaEnvironmentGetCommand extends AzmgmtCommand_1.default {
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 AzmgmtCommand_1 = require("../../../base/AzmgmtCommand");
4
+ const PowerAppsCommand_1 = require("../../../base/PowerAppsCommand");
5
5
  const commands_1 = require("../../commands");
6
- class PaEnvironmentListCommand extends AzmgmtCommand_1.default {
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 && res.value.length > 0) {
30
+ if (res.value.length > 0) {
31
31
  res.value.forEach(e => {
32
32
  e.displayName = e.properties.displayName;
33
33
  });
@@ -17,7 +17,6 @@ class PlannerBucketAddCommand extends GraphCommand_1.default {
17
17
  getTelemetryProperties(args) {
18
18
  const telemetryProps = super.getTelemetryProperties(args);
19
19
  telemetryProps.planId = typeof args.options.planId !== 'undefined';
20
- telemetryProps.planName = typeof args.options.planName !== 'undefined';
21
20
  telemetryProps.planTitle = typeof args.options.planTitle !== 'undefined';
22
21
  telemetryProps.ownerGroupId = typeof args.options.ownerGroupId !== 'undefined';
23
22
  telemetryProps.ownerGroupName = typeof args.options.ownerGroupName !== 'undefined';
@@ -28,10 +27,6 @@ class PlannerBucketAddCommand extends GraphCommand_1.default {
28
27
  return ['id', 'name', 'planId', 'orderHint'];
29
28
  }
30
29
  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
- }
35
30
  if (utils_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
36
31
  this.handleError('This command does not support application permissions.', logger, cb);
37
32
  return;
@@ -83,9 +78,6 @@ class PlannerBucketAddCommand extends GraphCommand_1.default {
83
78
  {
84
79
  option: "--planId [planId]"
85
80
  },
86
- {
87
- option: "--planName [planName]"
88
- },
89
81
  {
90
82
  option: "--planTitle [planTitle]"
91
83
  },
@@ -103,16 +95,16 @@ class PlannerBucketAddCommand extends GraphCommand_1.default {
103
95
  return options.concat(parentOptions);
104
96
  }
105
97
  validate(args) {
106
- if (!args.options.planId && !args.options.planName && !args.options.planTitle) {
98
+ if (!args.options.planId && !args.options.planTitle) {
107
99
  return 'Specify either planId or planTitle';
108
100
  }
109
- if (args.options.planId && (args.options.planName || args.options.planTitle)) {
101
+ if (args.options.planId && args.options.planTitle) {
110
102
  return 'Specify either planId or planTitle but not both';
111
103
  }
112
- if ((args.options.planName || args.options.planTitle) && !args.options.ownerGroupId && !args.options.ownerGroupName) {
104
+ if (args.options.planTitle && !args.options.ownerGroupId && !args.options.ownerGroupName) {
113
105
  return 'Specify either ownerGroupId or ownerGroupName when using planTitle';
114
106
  }
115
- if ((args.options.planName || args.options.planTitle) && args.options.ownerGroupId && args.options.ownerGroupName) {
107
+ if (args.options.planTitle && args.options.ownerGroupId && args.options.ownerGroupName) {
116
108
  return 'Specify either ownerGroupId or ownerGroupName when using planTitle but not both';
117
109
  }
118
110
  if (args.options.ownerGroupId && !utils_1.validation.isValidGuid(args.options.ownerGroupId)) {
@@ -28,17 +28,12 @@ class PlannerBucketGetCommand extends GraphCommand_1.default {
28
28
  telemetryProps.id = typeof args.options.id !== 'undefined';
29
29
  telemetryProps.name = typeof args.options.name !== 'undefined';
30
30
  telemetryProps.planId = typeof args.options.planId !== 'undefined';
31
- telemetryProps.planName = typeof args.options.planName !== 'undefined';
32
31
  telemetryProps.planTitle = typeof args.options.planTitle !== 'undefined';
33
32
  telemetryProps.ownerGroupId = typeof args.options.ownerGroupId !== 'undefined';
34
33
  telemetryProps.ownerGroupName = typeof args.options.ownerGroupName !== 'undefined';
35
34
  return telemetryProps;
36
35
  }
37
36
  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
- }
42
37
  if (utils_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
43
38
  this.handleError('This command does not support application permissions.', logger, cb);
44
39
  return;
@@ -121,9 +116,6 @@ class PlannerBucketGetCommand extends GraphCommand_1.default {
121
116
  {
122
117
  option: '--planId [planId]'
123
118
  },
124
- {
125
- option: '--planName [planName]'
126
- },
127
119
  {
128
120
  option: "--planTitle [planTitle]"
129
121
  },
@@ -139,7 +131,7 @@ class PlannerBucketGetCommand extends GraphCommand_1.default {
139
131
  }
140
132
  validate(args) {
141
133
  if (args.options.id) {
142
- if (args.options.planId || args.options.planName || args.options.planTitle || args.options.ownerGroupId || args.options.ownerGroupName) {
134
+ if (args.options.planId || args.options.planTitle || args.options.ownerGroupId || args.options.ownerGroupName) {
143
135
  return 'Don\'t specify planId, planTitle, ownerGroupId or ownerGroupName when using id';
144
136
  }
145
137
  if (args.options.name) {
@@ -147,13 +139,13 @@ class PlannerBucketGetCommand extends GraphCommand_1.default {
147
139
  }
148
140
  }
149
141
  if (args.options.name) {
150
- if (!args.options.planId && !args.options.planName && !args.options.planTitle) {
142
+ if (!args.options.planId && !args.options.planTitle) {
151
143
  return 'Specify either planId or planTitle when using name';
152
144
  }
153
- if (args.options.planId && (args.options.planName || args.options.planTitle)) {
145
+ if (args.options.planId && args.options.planTitle) {
154
146
  return 'Specify either planId or planTitle when using name but not both';
155
147
  }
156
- if (args.options.planName || args.options.planTitle) {
148
+ if (args.options.planTitle) {
157
149
  if (!args.options.ownerGroupId && !args.options.ownerGroupName) {
158
150
  return 'Specify either ownerGroupId or ownerGroupName when using planTitle';
159
151
  }
@@ -16,7 +16,6 @@ class PlannerBucketListCommand extends GraphCommand_1.default {
16
16
  getTelemetryProperties(args) {
17
17
  const telemetryProps = super.getTelemetryProperties(args);
18
18
  telemetryProps.planId = typeof args.options.planId !== 'undefined';
19
- telemetryProps.planName = typeof args.options.planName !== 'undefined';
20
19
  telemetryProps.planTitle = typeof args.options.planTitle !== 'undefined';
21
20
  telemetryProps.ownerGroupId = typeof args.options.ownerGroupId !== 'undefined';
22
21
  telemetryProps.ownerGroupName = typeof args.options.ownerGroupName !== 'undefined';
@@ -26,10 +25,6 @@ class PlannerBucketListCommand extends GraphCommand_1.default {
26
25
  return ['id', 'name', 'planId', 'orderHint'];
27
26
  }
28
27
  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
- }
33
28
  if (utils_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
34
29
  this.handleError('This command does not support application permissions.', logger, cb);
35
30
  return;
@@ -64,9 +59,6 @@ class PlannerBucketListCommand extends GraphCommand_1.default {
64
59
  {
65
60
  option: '--planId [planId]'
66
61
  },
67
- {
68
- option: '--planName [planName]'
69
- },
70
62
  {
71
63
  option: "--planTitle [planTitle]"
72
64
  },
@@ -81,16 +73,16 @@ class PlannerBucketListCommand extends GraphCommand_1.default {
81
73
  return options.concat(parentOptions);
82
74
  }
83
75
  validate(args) {
84
- if (!args.options.planId && !args.options.planName && !args.options.planTitle) {
76
+ if (!args.options.planId && !args.options.planTitle) {
85
77
  return 'Specify either planId or planTitle';
86
78
  }
87
- if (args.options.planId && (args.options.planName || args.options.planTitle)) {
79
+ if (args.options.planId && args.options.planTitle) {
88
80
  return 'Specify either planId or planTitle but not both';
89
81
  }
90
- if ((args.options.planName || args.options.planTitle) && !args.options.ownerGroupId && !args.options.ownerGroupName) {
82
+ if (args.options.planTitle && !args.options.ownerGroupId && !args.options.ownerGroupName) {
91
83
  return 'Specify either ownerGroupId or ownerGroupName when using planTitle';
92
84
  }
93
- if ((args.options.planName || args.options.planTitle) && args.options.ownerGroupId && args.options.ownerGroupName) {
85
+ if (args.options.planTitle && args.options.ownerGroupId && args.options.ownerGroupName) {
94
86
  return 'Specify either ownerGroupId or ownerGroupName when using planTitle but not both';
95
87
  }
96
88
  if (args.options.ownerGroupId && !utils_1.validation.isValidGuid(args.options.ownerGroupId)) {
@@ -20,7 +20,6 @@ class PlannerBucketRemoveCommand extends GraphCommand_1.default {
20
20
  telemetryProps.id = typeof args.options.id !== 'undefined';
21
21
  telemetryProps.name = typeof args.options.name !== 'undefined';
22
22
  telemetryProps.planId = typeof args.options.planId !== 'undefined';
23
- telemetryProps.planName = typeof args.options.planName !== 'undefined';
24
23
  telemetryProps.planTitle = typeof args.options.planTitle !== 'undefined';
25
24
  telemetryProps.ownerGroupId = typeof args.options.ownerGroupId !== 'undefined';
26
25
  telemetryProps.ownerGroupName = typeof args.options.ownerGroupName !== 'undefined';
@@ -28,10 +27,6 @@ class PlannerBucketRemoveCommand extends GraphCommand_1.default {
28
27
  return telemetryProps;
29
28
  }
30
29
  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
- }
35
30
  if (utils_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
36
31
  this.handleError('This command does not support application permissions.', logger, cb);
37
32
  return;
@@ -135,9 +130,6 @@ class PlannerBucketRemoveCommand extends GraphCommand_1.default {
135
130
  {
136
131
  option: '--planId [planId]'
137
132
  },
138
- {
139
- option: '--planName [planName]'
140
- },
141
133
  {
142
134
  option: "--planTitle [planTitle]"
143
135
  },
@@ -161,18 +153,18 @@ class PlannerBucketRemoveCommand extends GraphCommand_1.default {
161
153
  }
162
154
  validate(args) {
163
155
  if (args.options.id) {
164
- if (args.options.planId || args.options.planName || args.options.planTitle || args.options.ownerGroupId || args.options.ownerGroupName) {
156
+ if (args.options.planId || args.options.planTitle || args.options.ownerGroupId || args.options.ownerGroupName) {
165
157
  return 'Don\'t specify planId, planTitle, ownerGroupId or ownerGroupName when using id';
166
158
  }
167
159
  }
168
160
  else {
169
- if (!args.options.planId && !args.options.planName && !args.options.planTitle) {
161
+ if (!args.options.planId && !args.options.planTitle) {
170
162
  return 'Specify either planId or planTitle when using name';
171
163
  }
172
- if (args.options.planId && (args.options.planName || args.options.planTitle)) {
164
+ if (args.options.planId && args.options.planTitle) {
173
165
  return 'Specify either planId or planTitle when using name but not both';
174
166
  }
175
- if (args.options.planName || args.options.planTitle) {
167
+ if (args.options.planTitle) {
176
168
  if (!args.options.ownerGroupId && !args.options.ownerGroupName) {
177
169
  return 'Specify either ownerGroupId or ownerGroupName when using planTitle';
178
170
  }
@@ -19,7 +19,6 @@ class PlannerBucketSetCommand extends GraphCommand_1.default {
19
19
  telemetryProps.id = typeof args.options.id !== 'undefined';
20
20
  telemetryProps.name = typeof args.options.name !== 'undefined';
21
21
  telemetryProps.planId = typeof args.options.planId !== 'undefined';
22
- telemetryProps.planName = typeof args.options.planName !== 'undefined';
23
22
  telemetryProps.planTitle = typeof args.options.planTitle !== 'undefined';
24
23
  telemetryProps.ownerGroupId = typeof args.options.ownerGroupId !== 'undefined';
25
24
  telemetryProps.ownerGroupName = typeof args.options.ownerGroupName !== 'undefined';
@@ -28,10 +27,6 @@ class PlannerBucketSetCommand extends GraphCommand_1.default {
28
27
  return telemetryProps;
29
28
  }
30
29
  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
- }
35
30
  if (utils_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
36
31
  this.handleError('This command does not support application permissions.', logger, cb);
37
32
  return;
@@ -123,9 +118,6 @@ class PlannerBucketSetCommand extends GraphCommand_1.default {
123
118
  {
124
119
  option: '--planId [planId]'
125
120
  },
126
- {
127
- option: '--planName [planName]'
128
- },
129
121
  {
130
122
  option: "--planTitle [planTitle]"
131
123
  },
@@ -152,18 +144,18 @@ class PlannerBucketSetCommand extends GraphCommand_1.default {
152
144
  }
153
145
  validate(args) {
154
146
  if (args.options.id) {
155
- if (args.options.planId || args.options.planName || args.options.planTitle || args.options.ownerGroupId || args.options.ownerGroupName) {
147
+ if (args.options.planId || args.options.planTitle || args.options.ownerGroupId || args.options.ownerGroupName) {
156
148
  return 'Don\'t specify planId, planTitle, ownerGroupId or ownerGroupName when using id';
157
149
  }
158
150
  }
159
151
  if (args.options.name) {
160
- if (!args.options.planId && !args.options.planName && !args.options.planTitle) {
152
+ if (!args.options.planId && !args.options.planTitle) {
161
153
  return 'Specify either planId or planTitle when using name';
162
154
  }
163
- if (args.options.planId && (args.options.planName || args.options.planTitle)) {
155
+ if (args.options.planId && args.options.planTitle) {
164
156
  return 'Specify either planId or planTitle when using name but not both';
165
157
  }
166
- if (args.options.planName || args.options.planTitle) {
158
+ if (args.options.planTitle) {
167
159
  if (!args.options.ownerGroupId && !args.options.ownerGroupName) {
168
160
  return 'Specify either ownerGroupId or ownerGroupName when using planTitle';
169
161
  }