@pnp/cli-microsoft365 5.3.0-beta.4bf3837 → 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 (70) 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/spo/commands/listitem/listitem-roleinheritance-break.js +83 -0
  39. package/dist/m365/spo/commands/listitem/listitem-roleinheritance-reset.js +79 -0
  40. package/dist/m365/spo/commands.js +2 -0
  41. package/dist/m365/teams/commands/app/app-list.js +1 -1
  42. package/dist/m365/teams/commands/channel/channel-list.js +1 -1
  43. package/dist/m365/teams/commands/channel/channel-member-add.js +4 -1
  44. package/dist/m365/teams/commands/channel/channel-member-list.js +1 -1
  45. package/dist/m365/teams/commands/channel/channel-member-remove.js +3 -0
  46. package/dist/m365/teams/commands/channel/channel-member-set.js +3 -0
  47. package/dist/m365/teams/commands/chat/chat-get.js +8 -8
  48. package/dist/m365/teams/commands/chat/chat-list.js +1 -1
  49. package/dist/m365/teams/commands/chat/chat-member-list.js +1 -1
  50. package/dist/m365/teams/commands/chat/chat-message-list.js +1 -1
  51. package/dist/m365/teams/commands/chat/chat-message-send.js +6 -6
  52. package/dist/m365/teams/commands/chat/chatUtil.js +4 -4
  53. package/dist/m365/teams/commands/message/message-list.js +1 -1
  54. package/dist/m365/teams/commands/message/message-reply-list.js +1 -1
  55. package/dist/m365/teams/commands/tab/tab-list.js +1 -1
  56. package/dist/m365/teams/commands/team/team-list.js +1 -1
  57. package/dist/m365/teams/commands/user/user-app-list.js +1 -1
  58. package/dist/m365/teams/commands/user/user-list.js +2 -2
  59. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-healthissue-list.js +1 -1
  60. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-message-list.js +1 -1
  61. package/dist/m365/todo/commands/list/list-list.js +1 -1
  62. package/dist/m365/todo/commands/task/task-list.js +1 -1
  63. package/dist/utils/odata.js +2 -2
  64. package/dist/utils/planner.js +65 -0
  65. package/docs/docs/cmd/aad/app/app-add.md +15 -0
  66. package/docs/docs/cmd/aad/app/app-set.md +17 -0
  67. package/docs/docs/cmd/pp/gateway/gateway-list.md +21 -0
  68. package/docs/docs/cmd/spo/listitem/listitem-roleinheritance-break.md +58 -0
  69. package/docs/docs/cmd/spo/listitem/listitem-roleinheritance-reset.md +39 -0
  70. 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
  };
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const request_1 = require("../../../../request");
4
+ const utils_1 = require("../../../../utils");
5
+ const SpoCommand_1 = require("../../../base/SpoCommand");
6
+ const commands_1 = require("../../commands");
7
+ class SpoListItemRoleInheritanceBreakCommand extends SpoCommand_1.default {
8
+ get name() {
9
+ return commands_1.default.LISTITEM_ROLEINHERITANCE_BREAK;
10
+ }
11
+ get description() {
12
+ return 'Break inheritance of list item';
13
+ }
14
+ optionSets() {
15
+ return [
16
+ ['listId', 'listTitle']
17
+ ];
18
+ }
19
+ commandAction(logger, args, cb) {
20
+ if (this.verbose) {
21
+ logger.logToStderr(`Breaking role inheritance of list item in site at ${args.options.webUrl}...`);
22
+ }
23
+ let requestUrl = `${args.options.webUrl}/_api/web/lists`;
24
+ if (args.options.listId) {
25
+ requestUrl += `(guid'${encodeURIComponent(args.options.listId)}')`;
26
+ }
27
+ else {
28
+ requestUrl += `/getbytitle('${encodeURIComponent(args.options.listTitle)}')`;
29
+ }
30
+ let keepExistingPermissions = true;
31
+ if (args.options.clearExistingPermissions) {
32
+ keepExistingPermissions = !args.options.clearExistingPermissions;
33
+ }
34
+ const requestOptions = {
35
+ url: `${requestUrl}/items(${args.options.listItemId})/breakroleinheritance(${keepExistingPermissions})`,
36
+ method: 'POST',
37
+ headers: {
38
+ 'accept': 'application/json;odata=nometadata',
39
+ 'content-type': 'application/json'
40
+ },
41
+ responseType: 'json'
42
+ };
43
+ request_1.default
44
+ .post(requestOptions)
45
+ .then(_ => cb(), (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
46
+ }
47
+ options() {
48
+ const options = [
49
+ {
50
+ option: '-u, --webUrl <webUrl>'
51
+ },
52
+ {
53
+ option: '--listItemId <listItemId>'
54
+ },
55
+ {
56
+ option: '-l, --listId [listId]'
57
+ },
58
+ {
59
+ option: '-t, --listTitle [listTitle]'
60
+ },
61
+ {
62
+ option: '-c, --clearExistingPermissions'
63
+ }
64
+ ];
65
+ const parentOptions = super.options();
66
+ return options.concat(parentOptions);
67
+ }
68
+ validate(args) {
69
+ const isValidSharePointUrl = utils_1.validation.isValidSharePointUrl(args.options.webUrl);
70
+ if (isValidSharePointUrl !== true) {
71
+ return isValidSharePointUrl;
72
+ }
73
+ if (args.options.listId && !utils_1.validation.isValidGuid(args.options.listId)) {
74
+ return `${args.options.listId} is not a valid GUID`;
75
+ }
76
+ if (isNaN(args.options.listItemId)) {
77
+ return `${args.options.listItemId} is not a number`;
78
+ }
79
+ return true;
80
+ }
81
+ }
82
+ module.exports = new SpoListItemRoleInheritanceBreakCommand();
83
+ //# sourceMappingURL=listitem-roleinheritance-break.js.map
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const request_1 = require("../../../../request");
4
+ const utils_1 = require("../../../../utils");
5
+ const SpoCommand_1 = require("../../../base/SpoCommand");
6
+ const commands_1 = require("../../commands");
7
+ class SpoListItemRoleInheritanceResetCommand extends SpoCommand_1.default {
8
+ get name() {
9
+ return commands_1.default.LISTITEM_ROLEINHERITANCE_RESET;
10
+ }
11
+ get description() {
12
+ return 'Restores the role inheritance of list item, file, or folder';
13
+ }
14
+ getTelemetryProperties(args) {
15
+ const telemetryProps = super.getTelemetryProperties(args);
16
+ telemetryProps.listId = typeof args.options.listId !== 'undefined';
17
+ telemetryProps.listTitle = typeof args.options.listTitle !== 'undefined';
18
+ return telemetryProps;
19
+ }
20
+ commandAction(logger, args, cb) {
21
+ let requestUrl = `${args.options.webUrl}/_api/web/lists`;
22
+ if (args.options.listId) {
23
+ requestUrl += `(guid'${encodeURIComponent(args.options.listId)}')`;
24
+ }
25
+ else {
26
+ requestUrl += `/getbytitle('${encodeURIComponent(args.options.listTitle)}')`;
27
+ }
28
+ const requestOptions = {
29
+ url: `${requestUrl}/items(${args.options.listItemId})/resetroleinheritance`,
30
+ method: 'POST',
31
+ headers: {
32
+ 'accept': 'application/json;odata=nometadata',
33
+ 'content-type': 'application/json'
34
+ },
35
+ responseType: 'json'
36
+ };
37
+ request_1.default
38
+ .post(requestOptions)
39
+ .then(_ => cb(), (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
40
+ }
41
+ optionSets() {
42
+ return [
43
+ ['listId', 'listTitle']
44
+ ];
45
+ }
46
+ options() {
47
+ const options = [
48
+ {
49
+ option: '-u, --webUrl <webUrl>'
50
+ },
51
+ {
52
+ option: '--listItemId <listItemId>'
53
+ },
54
+ {
55
+ option: '--listId [listId]'
56
+ },
57
+ {
58
+ option: '--listTitle [listTitle]'
59
+ }
60
+ ];
61
+ const parentOptions = super.options();
62
+ return options.concat(parentOptions);
63
+ }
64
+ validate(args) {
65
+ const isValidSharePointUrl = utils_1.validation.isValidSharePointUrl(args.options.webUrl);
66
+ if (isValidSharePointUrl !== true) {
67
+ return isValidSharePointUrl;
68
+ }
69
+ if (args.options.listId && !utils_1.validation.isValidGuid(args.options.listId)) {
70
+ return `${args.options.listId} is not a valid GUID`;
71
+ }
72
+ if (isNaN(args.options.listItemId)) {
73
+ return `${args.options.listItemId} is not a number`;
74
+ }
75
+ return true;
76
+ }
77
+ }
78
+ module.exports = new SpoListItemRoleInheritanceResetCommand();
79
+ //# sourceMappingURL=listitem-roleinheritance-reset.js.map
@@ -120,6 +120,8 @@ exports.default = {
120
120
  LISTITEM_RECORD_DECLARE: `${prefix} listitem record declare`,
121
121
  LISTITEM_RECORD_UNDECLARE: `${prefix} listitem record undeclare`,
122
122
  LISTITEM_REMOVE: `${prefix} listitem remove`,
123
+ LISTITEM_ROLEINHERITANCE_BREAK: `${prefix} listitem roleinheritance break`,
124
+ LISTITEM_ROLEINHERITANCE_RESET: `${prefix} listitem roleinheritance reset`,
123
125
  LISTITEM_SET: `${prefix} listitem set`,
124
126
  MAIL_SEND: `${prefix} mail send`,
125
127
  NAVIGATION_NODE_ADD: `${prefix} navigation node add`,