@pnp/cli-microsoft365 5.3.0-beta.24cd8e4 → 5.3.0-beta.7862300

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 (65) hide show
  1. package/dist/Auth.js +5 -0
  2. package/dist/m365/aad/commands/app/app-add.js +91 -35
  3. package/dist/m365/aad/commands/app/app-role-list.js +1 -1
  4. package/dist/m365/aad/commands/app/app-set.js +91 -0
  5. package/dist/m365/aad/commands/group/group-list.js +1 -1
  6. package/dist/m365/aad/commands/groupsetting/groupsetting-list.js +1 -1
  7. package/dist/m365/aad/commands/groupsettingtemplate/groupsettingtemplate-get.js +1 -1
  8. package/dist/m365/aad/commands/groupsettingtemplate/groupsettingtemplate-list.js +1 -1
  9. package/dist/m365/aad/commands/o365group/o365group-conversation-list.js +1 -1
  10. package/dist/m365/aad/commands/o365group/o365group-conversation-post-list.js +1 -1
  11. package/dist/m365/aad/commands/o365group/o365group-list.js +1 -1
  12. package/dist/m365/aad/commands/o365group/o365group-recyclebinitem-clear.js +3 -3
  13. package/dist/m365/aad/commands/o365group/o365group-recyclebinitem-list.js +1 -1
  14. package/dist/m365/aad/commands/o365group/o365group-user-list.js +2 -2
  15. package/dist/m365/aad/commands/o365group/o365group-user-set.js +2 -2
  16. package/dist/m365/aad/commands/user/user-list.js +1 -1
  17. package/dist/m365/aad/commands/user/user-signin-list.js +1 -1
  18. package/dist/m365/base/PowerBICommand.js +10 -0
  19. package/dist/m365/file/commands/file-list.js +1 -1
  20. package/dist/m365/outlook/commands/message/message-list.js +1 -1
  21. package/dist/m365/outlook/commands/room/room-list.js +1 -1
  22. package/dist/m365/outlook/commands/roomlist/roomlist-list.js +1 -1
  23. package/dist/m365/planner/commands/bucket/bucket-add.js +3 -16
  24. package/dist/m365/planner/commands/bucket/bucket-get.js +3 -20
  25. package/dist/m365/planner/commands/bucket/bucket-list.js +4 -18
  26. package/dist/m365/planner/commands/bucket/bucket-remove.js +3 -20
  27. package/dist/m365/planner/commands/bucket/bucket-set.js +3 -20
  28. package/dist/m365/planner/commands/plan/plan-details-get.js +6 -14
  29. package/dist/m365/planner/commands/plan/plan-get.js +8 -18
  30. package/dist/m365/planner/commands/plan/plan-list.js +4 -12
  31. package/dist/m365/planner/commands/task/task-add.js +3 -16
  32. package/dist/m365/planner/commands/task/task-get.js +3 -21
  33. package/dist/m365/planner/commands/task/task-list.js +9 -23
  34. package/dist/m365/planner/commands/task/task-set.js +3 -17
  35. package/dist/m365/pp/commands/gateway/gateway-list.js +36 -0
  36. package/dist/m365/pp/commands/managementapp/managementapp-list.js +1 -1
  37. package/dist/m365/pp/commands.js +1 -0
  38. package/dist/m365/teams/commands/app/app-list.js +1 -1
  39. package/dist/m365/teams/commands/channel/channel-list.js +1 -1
  40. package/dist/m365/teams/commands/channel/channel-member-add.js +4 -1
  41. package/dist/m365/teams/commands/channel/channel-member-list.js +1 -1
  42. package/dist/m365/teams/commands/channel/channel-member-remove.js +3 -0
  43. package/dist/m365/teams/commands/channel/channel-member-set.js +3 -0
  44. package/dist/m365/teams/commands/chat/chat-get.js +8 -8
  45. package/dist/m365/teams/commands/chat/chat-list.js +1 -1
  46. package/dist/m365/teams/commands/chat/chat-member-list.js +1 -1
  47. package/dist/m365/teams/commands/chat/chat-message-list.js +1 -1
  48. package/dist/m365/teams/commands/chat/chat-message-send.js +6 -6
  49. package/dist/m365/teams/commands/chat/chatUtil.js +4 -4
  50. package/dist/m365/teams/commands/message/message-list.js +1 -1
  51. package/dist/m365/teams/commands/message/message-reply-list.js +1 -1
  52. package/dist/m365/teams/commands/tab/tab-list.js +1 -1
  53. package/dist/m365/teams/commands/team/team-list.js +1 -1
  54. package/dist/m365/teams/commands/user/user-app-list.js +1 -1
  55. package/dist/m365/teams/commands/user/user-list.js +2 -2
  56. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-healthissue-list.js +1 -1
  57. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-message-list.js +1 -1
  58. package/dist/m365/todo/commands/list/list-list.js +1 -1
  59. package/dist/m365/todo/commands/task/task-list.js +1 -1
  60. package/dist/utils/odata.js +2 -2
  61. package/dist/utils/planner.js +65 -0
  62. package/docs/docs/cmd/aad/app/app-add.md +15 -0
  63. package/docs/docs/cmd/aad/app/app-set.md +17 -0
  64. package/docs/docs/cmd/pp/gateway/gateway-list.md +21 -0
  65. package/package.json +1 -1
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const utils_1 = require("../../../../utils");
4
4
  const request_1 = require("../../../../request");
5
+ const planner_1 = require("../../../../utils/planner");
5
6
  const Auth_1 = require("../../../../Auth");
6
7
  const GraphCommand_1 = require("../../../base/GraphCommand");
7
8
  const commands_1 = require("../../commands");
@@ -30,7 +31,7 @@ class PlannerBucketListCommand extends GraphCommand_1.default {
30
31
  }
31
32
  this
32
33
  .getPlanId(args)
33
- .then((planId) => utils_1.odata.getAllItems(`${this.resource}/v1.0/planner/plans/${planId}/buckets`, logger))
34
+ .then((planId) => utils_1.odata.getAllItems(`${this.resource}/v1.0/planner/plans/${planId}/buckets`))
34
35
  .then((buckets) => {
35
36
  logger.log(buckets);
36
37
  cb();
@@ -42,23 +43,8 @@ class PlannerBucketListCommand extends GraphCommand_1.default {
42
43
  }
43
44
  return this
44
45
  .getGroupId(args)
45
- .then((groupId) => {
46
- const requestOptions = {
47
- url: `${this.resource}/v1.0/planner/plans?$filter=(owner eq '${groupId}')`,
48
- headers: {
49
- accept: 'application/json;odata.metadata=none'
50
- },
51
- responseType: 'json'
52
- };
53
- return request_1.default.get(requestOptions);
54
- })
55
- .then(response => {
56
- const plan = response.value.find(val => val.title === args.options.planName);
57
- if (!plan) {
58
- return Promise.reject(`The specified plan does not exist`);
59
- }
60
- return Promise.resolve(plan.id);
61
- });
46
+ .then(groupId => planner_1.planner.getPlanByName(args.options.planName, groupId))
47
+ .then(plan => plan.id);
62
48
  }
63
49
  getGroupId(args) {
64
50
  if (args.options.ownerGroupId) {
@@ -5,6 +5,7 @@ const utils_1 = require("../../../../utils");
5
5
  const request_1 = require("../../../../request");
6
6
  const GraphCommand_1 = require("../../../base/GraphCommand");
7
7
  const commands_1 = require("../../commands");
8
+ const planner_1 = require("../../../../utils/planner");
8
9
  const Auth_1 = require("../../../../Auth");
9
10
  class PlannerBucketRemoveCommand extends GraphCommand_1.default {
10
11
  get name() {
@@ -105,26 +106,8 @@ class PlannerBucketRemoveCommand extends GraphCommand_1.default {
105
106
  }
106
107
  return this
107
108
  .getGroupId(args)
108
- .then(groupId => {
109
- const requestOptions = {
110
- url: `${this.resource}/v1.0/planner/plans?$filter=owner eq '${groupId}'`,
111
- headers: {
112
- accept: 'application/json;odata.metadata=none'
113
- },
114
- responseType: 'json'
115
- };
116
- return request_1.default.get(requestOptions);
117
- })
118
- .then(plans => {
119
- const filteredPlans = plans.value.filter(p => p.title.toLowerCase() === planName.toLowerCase());
120
- if (!filteredPlans.length) {
121
- return Promise.reject(`The specified plan ${planName} does not exist`);
122
- }
123
- if (filteredPlans.length > 1) {
124
- return Promise.reject(`Multiple plans with name ${planName} found: ${filteredPlans.map(x => x.id)}`);
125
- }
126
- return Promise.resolve(filteredPlans[0].id);
127
- });
109
+ .then(groupId => planner_1.planner.getPlanByName(planName, groupId))
110
+ .then(plan => plan.id);
128
111
  }
129
112
  getGroupId(args) {
130
113
  const { ownerGroupId, ownerGroupName } = args.options;
@@ -4,6 +4,7 @@ const utils_1 = require("../../../../utils");
4
4
  const GraphCommand_1 = require("../../../base/GraphCommand");
5
5
  const Auth_1 = require("../../../../Auth");
6
6
  const request_1 = require("../../../../request");
7
+ const planner_1 = require("../../../../utils/planner");
7
8
  const commands_1 = require("../../commands");
8
9
  class PlannerBucketSetCommand extends GraphCommand_1.default {
9
10
  get name() {
@@ -93,26 +94,8 @@ class PlannerBucketSetCommand extends GraphCommand_1.default {
93
94
  }
94
95
  return this
95
96
  .getGroupId(args)
96
- .then(groupId => {
97
- const requestOptions = {
98
- url: `${this.resource}/v1.0/planner/plans?$filter=owner eq '${groupId}'`,
99
- headers: {
100
- accept: 'application/json;odata.metadata=none'
101
- },
102
- responseType: 'json'
103
- };
104
- return request_1.default.get(requestOptions);
105
- })
106
- .then(plans => {
107
- const filteredPlans = plans.value.filter(p => p.title.toLowerCase() === planName.toLowerCase());
108
- if (filteredPlans.length === 0) {
109
- return Promise.reject(`The specified plan ${planName} does not exist`);
110
- }
111
- if (filteredPlans.length > 1) {
112
- return Promise.reject(`Multiple plans with name ${planName} found: ${filteredPlans.map(x => x.id)}`);
113
- }
114
- return Promise.resolve(filteredPlans[0].id);
115
- });
97
+ .then(groupId => planner_1.planner.getPlanByName(planName, groupId))
98
+ .then(plan => plan.id);
116
99
  }
117
100
  getGroupId(args) {
118
101
  const { ownerGroupId, ownerGroupName } = args.options;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const utils_1 = require("../../../../utils");
4
4
  const Auth_1 = require("../../../../Auth");
5
5
  const request_1 = require("../../../../request");
6
+ const planner_1 = require("../../../../utils/planner");
6
7
  const GraphCommand_1 = require("../../../base/GraphCommand");
7
8
  const commands_1 = require("../../commands");
8
9
  class PlannerPlanDetailsGetCommand extends GraphCommand_1.default {
@@ -33,7 +34,7 @@ class PlannerPlanDetailsGetCommand extends GraphCommand_1.default {
33
34
  .getGroupId(args)
34
35
  .then((groupId) => {
35
36
  this.groupId = groupId;
36
- return this.getPlanId(args, logger);
37
+ return this.getPlanId(args);
37
38
  })
38
39
  .then((planId) => {
39
40
  args.options.planId = planId;
@@ -71,22 +72,13 @@ class PlannerPlanDetailsGetCommand extends GraphCommand_1.default {
71
72
  return Promise.resolve(groupItem.id);
72
73
  });
73
74
  }
74
- getPlanId(args, logger) {
75
+ getPlanId(args) {
75
76
  if (args.options.planId) {
76
77
  return Promise.resolve(args.options.planId);
77
78
  }
78
- return utils_1.odata
79
- .getAllItems(`${this.resource}/v1.0/groups/${this.groupId}/planner/plans`, logger)
80
- .then((plans) => {
81
- const plansMatchingName = plans.filter((plan) => plan.title === args.options.planTitle);
82
- if (plansMatchingName && plansMatchingName.length > 0) {
83
- if (plansMatchingName.length > 1) {
84
- return Promise.reject(`Multiple plans with name ${args.options.planTitle} found: ${plansMatchingName.map(x => x.id)}`);
85
- }
86
- return Promise.resolve(plansMatchingName[0].id);
87
- }
88
- return Promise.reject(`The specified plan title does not exist`);
89
- });
79
+ return planner_1.planner
80
+ .getPlanByName(args.options.planTitle, this.groupId)
81
+ .then(plan => plan.id);
90
82
  }
91
83
  getPlanDetails(args) {
92
84
  const requestOptions = {
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const Auth_1 = require("../../../../Auth");
4
3
  const utils_1 = require("../../../../utils");
5
4
  const request_1 = require("../../../../request");
5
+ const planner_1 = require("../../../../utils/planner");
6
6
  const GraphCommand_1 = require("../../../base/GraphCommand");
7
7
  const commands_1 = require("../../commands");
8
+ const Auth_1 = require("../../../../Auth");
8
9
  class PlannerPlanGetCommand extends GraphCommand_1.default {
9
10
  get name() {
10
11
  return commands_1.default.PLAN_GET;
@@ -29,8 +30,8 @@ class PlannerPlanGetCommand extends GraphCommand_1.default {
29
30
  return;
30
31
  }
31
32
  if (args.options.id) {
32
- this
33
- .getPlan(args)
33
+ planner_1.planner
34
+ .getPlanById(args.options.id)
34
35
  .then((res) => {
35
36
  logger.log(res);
36
37
  cb();
@@ -39,11 +40,10 @@ class PlannerPlanGetCommand extends GraphCommand_1.default {
39
40
  else {
40
41
  this
41
42
  .getGroupId(args)
42
- .then((groupId) => utils_1.odata.getAllItems(`${this.resource}/v1.0/groups/${groupId}/planner/plans`, logger, 'minimal'))
43
- .then((plans) => {
44
- const filteredPlan = plans.filter((plan) => plan.title === args.options.title);
45
- if (filteredPlan && filteredPlan.length > 0) {
46
- logger.log(filteredPlan);
43
+ .then(groupId => planner_1.planner.getPlanByName(args.options.title, groupId))
44
+ .then((plan) => {
45
+ if (plan) {
46
+ logger.log(plan);
47
47
  }
48
48
  cb();
49
49
  }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
@@ -70,16 +70,6 @@ class PlannerPlanGetCommand extends GraphCommand_1.default {
70
70
  return Promise.resolve(group.id);
71
71
  });
72
72
  }
73
- getPlan(args) {
74
- const requestOptions = {
75
- url: `${this.resource}/v1.0/planner/plans/${args.options.id}`,
76
- headers: {
77
- 'accept': 'application/json'
78
- },
79
- responseType: 'json'
80
- };
81
- return request_1.default.get(requestOptions);
82
- }
83
73
  options() {
84
74
  const options = [
85
75
  {
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const utils_1 = require("../../../../utils");
4
4
  const Auth_1 = require("../../../../Auth");
5
5
  const request_1 = require("../../../../request");
6
+ const planner_1 = require("../../../../utils/planner");
6
7
  const GraphCommand_1 = require("../../../base/GraphCommand");
7
8
  const commands_1 = require("../../commands");
8
9
  class PlannerPlanListCommand extends GraphCommand_1.default {
@@ -28,19 +29,10 @@ class PlannerPlanListCommand extends GraphCommand_1.default {
28
29
  }
29
30
  this
30
31
  .getGroupId(args)
31
- .then((groupId) => {
32
- const requestOptions = {
33
- url: `${this.resource}/v1.0/groups/${groupId}/planner/plans`,
34
- headers: {
35
- 'accept': 'application/json;odata.metadata=none'
36
- },
37
- responseType: 'json'
38
- };
39
- return request_1.default.get(requestOptions);
40
- })
32
+ .then((groupId) => planner_1.planner.getPlansByGroupId(groupId))
41
33
  .then((res) => {
42
- if (res.value && res.value.length > 0) {
43
- logger.log(res.value);
34
+ if (res && res.length > 0) {
35
+ logger.log(res);
44
36
  }
45
37
  cb();
46
38
  }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const Auth_1 = require("../../../../Auth");
4
4
  const request_1 = require("../../../../request");
5
+ const planner_1 = require("../../../../utils/planner");
5
6
  const utils_1 = require("../../../../utils");
6
7
  const GraphCommand_1 = require("../../../base/GraphCommand");
7
8
  const commands_1 = require("../../commands");
@@ -156,22 +157,8 @@ class PlannerTaskAddCommand extends GraphCommand_1.default {
156
157
  }
157
158
  return this
158
159
  .getGroupId(args)
159
- .then((groupId) => {
160
- const requestOptions = {
161
- url: `${this.resource}/v1.0/planner/plans?$filter=(owner eq '${groupId}')`,
162
- headers: {
163
- accept: 'application/json;odata.metadata=none'
164
- },
165
- responseType: 'json'
166
- };
167
- return request_1.default.get(requestOptions);
168
- }).then((response) => {
169
- const plan = response.value.find(val => val.title === args.options.planName);
170
- if (!plan) {
171
- return Promise.reject(`The specified plan does not exist`);
172
- }
173
- return Promise.resolve(plan.id);
174
- });
160
+ .then((groupId) => planner_1.planner.getPlanByName(args.options.planName, groupId))
161
+ .then(plan => plan.id);
175
162
  }
176
163
  getGroupId(args) {
177
164
  if (args.options.ownerGroupId) {
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const utils_1 = require("../../../../utils");
4
4
  const request_1 = require("../../../../request");
5
5
  const utils_2 = require("../../../../utils");
6
+ const planner_1 = require("../../../../utils/planner");
6
7
  const GraphCommand_1 = require("../../../base/GraphCommand");
7
8
  const commands_1 = require("../../commands");
8
9
  const Auth_1 = require("../../../../Auth");
@@ -97,27 +98,8 @@ class PlannerTaskGetCommand extends GraphCommand_1.default {
97
98
  }
98
99
  return this
99
100
  .getGroupId(options)
100
- .then((groupId) => {
101
- const requestOptions = {
102
- url: `${this.resource}/v1.0/planner/plans?$filter=owner eq '${groupId}'&$select=id,title`,
103
- headers: {
104
- accept: 'application/json;odata.metadata=none'
105
- },
106
- responseType: 'json'
107
- };
108
- return request_1.default.get(requestOptions);
109
- })
110
- .then((response) => {
111
- const planName = options.planName;
112
- const plans = response.value.filter(val => { var _a; return ((_a = val.title) === null || _a === void 0 ? void 0 : _a.toLocaleLowerCase()) === planName.toLocaleLowerCase(); });
113
- if (!plans.length) {
114
- return Promise.reject(`The specified plan ${options.planName} does not exist`);
115
- }
116
- if (plans.length > 1) {
117
- return Promise.reject(`Multiple plans with name ${options.planName} found: ${plans.map(x => x.id)}`);
118
- }
119
- return Promise.resolve(plans[0].id);
120
- });
101
+ .then(groupId => planner_1.planner.getPlanByName(options.planName, groupId))
102
+ .then(plan => plan.id);
121
103
  }
122
104
  getGroupId(options) {
123
105
  if (options.ownerGroupId) {
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const utils_1 = require("../../../../utils");
4
4
  const Auth_1 = require("../../../../Auth");
5
5
  const request_1 = require("../../../../request");
6
+ const planner_1 = require("../../../../utils/planner");
6
7
  const GraphCommand_1 = require("../../../base/GraphCommand");
7
8
  const commands_1 = require("../../commands");
8
9
  class PlannerTaskListCommand extends GraphCommand_1.default {
@@ -40,11 +41,11 @@ class PlannerTaskListCommand extends GraphCommand_1.default {
40
41
  .getBucketId(args)
41
42
  .then((retrievedBucketId) => {
42
43
  bucketId = retrievedBucketId;
43
- return utils_1.odata.getAllItems(`${this.resource}/v1.0/planner/buckets/${bucketId}/tasks`, logger);
44
+ return utils_1.odata.getAllItems(`${this.resource}/v1.0/planner/buckets/${bucketId}/tasks`);
44
45
  })
45
46
  .then((tasks) => {
46
47
  taskItems = tasks;
47
- return utils_1.odata.getAllItems(`${this.resource}/beta/planner/buckets/${bucketId}/tasks`, logger);
48
+ return utils_1.odata.getAllItems(`${this.resource}/beta/planner/buckets/${bucketId}/tasks`);
48
49
  })
49
50
  .then((betaTasks) => {
50
51
  logger.log(this.mergeTaskPriority(taskItems, betaTasks));
@@ -56,11 +57,11 @@ class PlannerTaskListCommand extends GraphCommand_1.default {
56
57
  .getPlanId(args)
57
58
  .then((retrievedPlanId) => {
58
59
  planId = retrievedPlanId;
59
- return utils_1.odata.getAllItems(`${this.resource}/v1.0/planner/plans/${planId}/tasks`, logger);
60
+ return utils_1.odata.getAllItems(`${this.resource}/v1.0/planner/plans/${planId}/tasks`);
60
61
  })
61
62
  .then((tasks) => {
62
63
  taskItems = tasks;
63
- return utils_1.odata.getAllItems(`${this.resource}/beta/planner/plans/${planId}/tasks`, logger);
64
+ return utils_1.odata.getAllItems(`${this.resource}/beta/planner/plans/${planId}/tasks`);
64
65
  })
65
66
  .then((betaTasks) => {
66
67
  logger.log(this.mergeTaskPriority(taskItems, betaTasks));
@@ -69,10 +70,10 @@ class PlannerTaskListCommand extends GraphCommand_1.default {
69
70
  }
70
71
  else {
71
72
  utils_1.odata
72
- .getAllItems(`${this.resource}/v1.0/me/planner/tasks`, logger)
73
+ .getAllItems(`${this.resource}/v1.0/me/planner/tasks`)
73
74
  .then((tasks) => {
74
75
  taskItems = tasks;
75
- return utils_1.odata.getAllItems(`${this.resource}/beta/me/planner/tasks`, logger);
76
+ return utils_1.odata.getAllItems(`${this.resource}/beta/me/planner/tasks`);
76
77
  })
77
78
  .then((betaTasks) => {
78
79
  logger.log(this.mergeTaskPriority(taskItems, betaTasks));
@@ -110,23 +111,8 @@ class PlannerTaskListCommand extends GraphCommand_1.default {
110
111
  }
111
112
  return this
112
113
  .getGroupId(args)
113
- .then((groupId) => {
114
- const requestOptions = {
115
- url: `${this.resource}/v1.0/planner/plans?$filter=(owner eq '${groupId}')`,
116
- headers: {
117
- accept: 'application/json;odata.metadata=none'
118
- },
119
- responseType: 'json'
120
- };
121
- return request_1.default.get(requestOptions);
122
- })
123
- .then(response => {
124
- const plan = response.value.find(val => val.title === args.options.planName);
125
- if (!plan) {
126
- return Promise.reject(`The specified plan does not exist`);
127
- }
128
- return Promise.resolve(plan.id);
129
- });
114
+ .then((groupId) => planner_1.planner.getPlanByName(args.options.planName, groupId))
115
+ .then(plan => plan.id);
130
116
  }
131
117
  getGroupId(args) {
132
118
  if (args.options.ownerGroupId) {
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const utils_1 = require("../../../../utils");
4
4
  const Auth_1 = require("../../../../Auth");
5
5
  const request_1 = require("../../../../request");
6
+ const planner_1 = require("../../../../utils/planner");
6
7
  const GraphCommand_1 = require("../../../base/GraphCommand");
7
8
  const commands_1 = require("../../commands");
8
9
  class PlannerTaskSetCommand extends GraphCommand_1.default {
@@ -222,23 +223,8 @@ class PlannerTaskSetCommand extends GraphCommand_1.default {
222
223
  }
223
224
  return this
224
225
  .getGroupId(options)
225
- .then((groupId) => {
226
- const requestOptions = {
227
- url: `${this.resource}/v1.0/planner/plans?$filter=(owner eq '${groupId}')&$select=id,title`,
228
- headers: {
229
- accept: 'application/json;odata.metadata=none'
230
- },
231
- responseType: 'json'
232
- };
233
- return request_1.default.get(requestOptions);
234
- })
235
- .then((response) => {
236
- const plan = response.value.find(val => val.title === options.planName);
237
- if (!plan) {
238
- return Promise.reject(`The specified plan does not exist`);
239
- }
240
- return Promise.resolve(plan.id);
241
- });
226
+ .then((groupId) => planner_1.planner.getPlanByName(options.planName, groupId))
227
+ .then(plan => plan.id);
242
228
  }
243
229
  getGroupId(options) {
244
230
  if (options.ownerGroupId) {
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const request_1 = require("../../../../request");
4
+ const PowerBICommand_1 = require("../../../base/PowerBICommand");
5
+ const commands_1 = require("../../commands");
6
+ class PpGatewayListCommand extends PowerBICommand_1.default {
7
+ get name() {
8
+ return commands_1.default.GATEWAY_LIST;
9
+ }
10
+ get description() {
11
+ return 'Returns a list of gateways for which the user is an admin';
12
+ }
13
+ defaultProperties() {
14
+ return ['id', 'name'];
15
+ }
16
+ commandAction(logger, args, cb) {
17
+ if (this.verbose) {
18
+ logger.logToStderr(`Retrieving list of gateways for which the user is an admin...`);
19
+ }
20
+ const requestOptions = {
21
+ url: `${this.resource}/v1.0/myorg/gateways`,
22
+ headers: {
23
+ accept: 'application/json;odata.metadata=none'
24
+ },
25
+ responseType: 'json'
26
+ };
27
+ request_1.default
28
+ .get(requestOptions)
29
+ .then((res) => {
30
+ logger.log(res.value);
31
+ cb();
32
+ }, (rawRes) => this.handleRejectedODataJsonPromise(rawRes, logger, cb));
33
+ }
34
+ }
35
+ module.exports = new PpGatewayListCommand();
36
+ //# sourceMappingURL=gateway-list.js.map
@@ -13,7 +13,7 @@ class PpManagementAppListCommand extends PowerPlatformCommand_1.default {
13
13
  commandAction(logger, args, cb) {
14
14
  const endpoint = `${this.resource}/providers/Microsoft.BusinessAppPlatform/adminApplications?api-version=2020-06-01`;
15
15
  utils_1.odata
16
- .getAllItems(endpoint, logger)
16
+ .getAllItems(endpoint)
17
17
  .then((managementApps) => {
18
18
  logger.log(managementApps);
19
19
  cb();
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const prefix = 'pp';
4
4
  exports.default = {
5
5
  ENVIRONMENT_LIST: `${prefix} environment list`,
6
+ GATEWAY_LIST: `${prefix} gateway list`,
6
7
  MANAGEMENTAPP_ADD: `${prefix} managementapp add`,
7
8
  MANAGEMENTAPP_LIST: `${prefix} managementapp list`
8
9
  };
@@ -76,7 +76,7 @@ class TeamsAppListCommand extends GraphCommand_1.default {
76
76
  commandAction(logger, args, cb) {
77
77
  this
78
78
  .getEndpointUrl(args)
79
- .then(endpoint => utils_1.odata.getAllItems(endpoint, logger))
79
+ .then(endpoint => utils_1.odata.getAllItems(endpoint))
80
80
  .then((items) => {
81
81
  if (args.options.teamId || args.options.teamName) {
82
82
  items.forEach(t => {
@@ -53,7 +53,7 @@ class TeamsChannelListCommand extends GraphCommand_1.default {
53
53
  if (args.options.type) {
54
54
  endpoint += `?$filter=membershipType eq '${args.options.type}'`;
55
55
  }
56
- return utils_1.odata.getAllItems(endpoint, logger);
56
+ return utils_1.odata.getAllItems(endpoint);
57
57
  })
58
58
  .then((items) => {
59
59
  logger.log(items);
@@ -153,8 +153,11 @@ class TeamsChannelMemberAddCommand extends GraphCommand_1.default {
153
153
  if (!channelItem) {
154
154
  return Promise.reject(`The specified channel '${args.options.channelName}' does not exist in the Microsoft Teams team with ID '${teamId}'`);
155
155
  }
156
+ if (channelItem.membershipType !== "private") {
157
+ return Promise.reject(`The specified channel is not a private channel`);
158
+ }
156
159
  return Promise.resolve(channelItem.id);
157
- }, err => { return Promise.reject(err); });
160
+ });
158
161
  }
159
162
  getUserId(args) {
160
163
  if (args.options.userId) {
@@ -40,7 +40,7 @@ class TeamsChannelMemberListCommand extends GraphCommand_1.default {
40
40
  })
41
41
  .then((channelId) => {
42
42
  const endpoint = `${this.resource}/v1.0/teams/${this.teamId}/channels/${channelId}/members`;
43
- return utils_1.odata.getAllItems(endpoint, logger);
43
+ return utils_1.odata.getAllItems(endpoint);
44
44
  })
45
45
  .then((memberships) => {
46
46
  if (args.options.role) {
@@ -135,6 +135,9 @@ class TeamsChannelMemberRemoveCommand extends GraphCommand_1.default {
135
135
  if (!channelItem) {
136
136
  return Promise.reject(`The specified channel does not exist in the Microsoft Teams team`);
137
137
  }
138
+ if (channelItem.membershipType !== "private") {
139
+ return Promise.reject(`The specified channel is not a private channel`);
140
+ }
138
141
  return Promise.resolve(channelItem.id);
139
142
  });
140
143
  }
@@ -103,6 +103,9 @@ class TeamsChannelMemberSetCommand extends GraphCommand_1.default {
103
103
  if (!channelItem) {
104
104
  return Promise.reject(`The specified channel does not exist in the Microsoft Teams team`);
105
105
  }
106
+ if (channelItem.membershipType !== "private") {
107
+ return Promise.reject(`The specified channel is not a private channel`);
108
+ }
106
109
  return Promise.resolve(channelItem.id);
107
110
  });
108
111
  }
@@ -33,7 +33,7 @@ class TeamsChatGetCommand extends GraphCommand_1.default {
33
33
  }
34
34
  commandAction(logger, args, cb) {
35
35
  this
36
- .getChatId(logger, args)
36
+ .getChatId(args)
37
37
  .then(chatId => this.getChatDetailsById(chatId))
38
38
  .then((chat) => {
39
39
  logger.log(chat);
@@ -83,14 +83,14 @@ class TeamsChatGetCommand extends GraphCommand_1.default {
83
83
  }
84
84
  return true;
85
85
  }
86
- getChatId(logger, args) {
86
+ getChatId(args) {
87
87
  return __awaiter(this, void 0, void 0, function* () {
88
88
  if (args.options.id) {
89
89
  return args.options.id;
90
90
  }
91
91
  return args.options.participants
92
- ? this.getChatIdByParticipants(args.options.participants, logger)
93
- : this.getChatIdByName(args.options.name, logger);
92
+ ? this.getChatIdByParticipants(args.options.participants)
93
+ : this.getChatIdByName(args.options.name);
94
94
  });
95
95
  }
96
96
  getChatDetailsById(id) {
@@ -105,11 +105,11 @@ class TeamsChatGetCommand extends GraphCommand_1.default {
105
105
  return request_1.default.get(requestOptions);
106
106
  });
107
107
  }
108
- getChatIdByParticipants(participantsString, logger) {
108
+ getChatIdByParticipants(participantsString) {
109
109
  return __awaiter(this, void 0, void 0, function* () {
110
110
  const participants = chatUtil_1.chatUtil.convertParticipantStringToArray(participantsString);
111
111
  const currentUserEmail = accessToken_1.accessToken.getUserNameFromAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken).toLowerCase();
112
- const existingChats = yield chatUtil_1.chatUtil.findExistingChatsByParticipants([currentUserEmail, ...participants], logger);
112
+ const existingChats = yield chatUtil_1.chatUtil.findExistingChatsByParticipants([currentUserEmail, ...participants]);
113
113
  if (!existingChats || existingChats.length === 0) {
114
114
  throw new Error('No chat conversation was found with these participants.');
115
115
  }
@@ -122,9 +122,9 @@ class TeamsChatGetCommand extends GraphCommand_1.default {
122
122
  throw new Error(`Multiple chat conversations with these participants found. Please disambiguate:${os.EOL}${disambiguationText}`);
123
123
  });
124
124
  }
125
- getChatIdByName(name, logger) {
125
+ getChatIdByName(name) {
126
126
  return __awaiter(this, void 0, void 0, function* () {
127
- const existingChats = yield chatUtil_1.chatUtil.findExistingGroupChatsByName(name, logger);
127
+ const existingChats = yield chatUtil_1.chatUtil.findExistingGroupChatsByName(name);
128
128
  if (!existingChats || existingChats.length === 0) {
129
129
  throw new Error('No chat conversation was found with this name.');
130
130
  }
@@ -17,7 +17,7 @@ class TeamsChatListCommand extends GraphCommand_1.default {
17
17
  const filter = args.options.type !== undefined ? `?$filter=chatType eq '${args.options.type}'` : '';
18
18
  const endpoint = `${this.resource}/v1.0/chats${filter}`;
19
19
  utils_1.odata
20
- .getAllItems(endpoint, logger)
20
+ .getAllItems(endpoint)
21
21
  .then((items) => {
22
22
  logger.log(items);
23
23
  cb();
@@ -16,7 +16,7 @@ class TeamsChatMemberListCommand extends GraphCommand_1.default {
16
16
  commandAction(logger, args, cb) {
17
17
  const endpoint = `${this.resource}/v1.0/chats/${args.options.chatId}/members`;
18
18
  utils_1.odata
19
- .getAllItems(endpoint, logger)
19
+ .getAllItems(endpoint)
20
20
  .then((items) => {
21
21
  logger.log(items);
22
22
  cb();
@@ -16,7 +16,7 @@ class TeamsChatMessageListCommand extends GraphCommand_1.default {
16
16
  commandAction(logger, args, cb) {
17
17
  const endpoint = `${this.resource}/v1.0/chats/${args.options.chatId}/messages`;
18
18
  utils_1.odata
19
- .getAllItems(endpoint, logger)
19
+ .getAllItems(endpoint)
20
20
  .then((items) => {
21
21
  if (args.options.output !== 'json') {
22
22
  items.forEach(i => {