@pnp/cli-microsoft365 6.3.0 → 6.4.0-beta.39e5130

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 (185) hide show
  1. package/.eslintrc.js +1 -0
  2. package/README.md +12 -1
  3. package/dist/Command.js +1 -0
  4. package/dist/m365/aad/commands/user/user-get.js +3 -0
  5. package/dist/m365/aad/commands/user/user-license-remove.js +2 -1
  6. package/dist/m365/aad/commands/user/user-recyclebinitem-restore.js +2 -9
  7. package/dist/m365/aad/commands/user/user-set.js +3 -0
  8. package/dist/m365/aad/commands/user/user-signin-list.js +3 -0
  9. package/dist/m365/flow/commands/flow-disable.js +9 -2
  10. package/dist/m365/flow/commands/flow-enable.js +9 -2
  11. package/dist/m365/flow/commands/flow-get.js +9 -2
  12. package/dist/m365/flow/commands/flow-list.js +1 -1
  13. package/dist/m365/flow/commands/flow-remove.js +2 -2
  14. package/dist/m365/flow/commands/owner/owner-add.js +147 -0
  15. package/dist/m365/flow/commands/owner/owner-list.js +89 -0
  16. package/dist/m365/flow/commands/owner/owner-remove.js +147 -0
  17. package/dist/m365/flow/commands/run/run-cancel.js +9 -2
  18. package/dist/m365/flow/commands/run/run-list.js +5 -2
  19. package/dist/m365/flow/commands.js +3 -0
  20. package/dist/m365/planner/commands/roster/roster-member-add.js +3 -0
  21. package/dist/m365/planner/commands/roster/roster-member-get.js +98 -0
  22. package/dist/m365/planner/commands.js +1 -0
  23. package/dist/m365/spfx/commands/spfx-doctor.js +43 -29
  24. package/dist/m365/spo/commands/customaction/customaction-get.js +27 -7
  25. package/dist/m365/spo/commands/file/file-move.js +1 -1
  26. package/dist/m365/spo/commands/group/group-member-add.js +54 -95
  27. package/dist/m365/spo/commands/list/list-add.js +11 -8
  28. package/dist/m365/spo/commands/list/list-set.js +3 -3
  29. package/dist/m365/spo/commands/navigation/navigation-node-add.js +5 -4
  30. package/dist/m365/spo/commands/navigation/navigation-node-set.js +5 -1
  31. package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-get.js +118 -0
  32. package/dist/m365/spo/commands/term/term-get.js +68 -48
  33. package/dist/m365/spo/commands.js +1 -0
  34. package/dist/utils/aadGroup.js +18 -0
  35. package/dist/utils/aadUser.js +20 -0
  36. package/dist/utils/md.js +7 -0
  37. package/dist/utils/spo.js +32 -0
  38. package/docs/docs/cmd/aad/approleassignment/approleassignment-add.md +5 -5
  39. package/docs/docs/cmd/aad/approleassignment/approleassignment-remove.md +3 -3
  40. package/docs/docs/cmd/aad/user/user-remove.md +1 -1
  41. package/docs/docs/cmd/cli/completion/completion-clink-update.md +4 -4
  42. package/docs/docs/cmd/flow/owner/owner-add.md +61 -0
  43. package/docs/docs/cmd/flow/owner/owner-list.md +90 -0
  44. package/docs/docs/cmd/flow/owner/owner-remove.md +67 -0
  45. package/docs/docs/cmd/flow/run/run-list.md +28 -0
  46. package/docs/docs/cmd/onenote/page/page-list.md +1 -1
  47. package/docs/docs/cmd/outlook/mail/mail-send.md +7 -3
  48. package/docs/docs/cmd/outlook/message/message-get.md +143 -0
  49. package/docs/docs/cmd/outlook/message/message-list.md +119 -0
  50. package/docs/docs/cmd/outlook/message/message-move.md +4 -0
  51. package/docs/docs/cmd/outlook/report/report-mailactivitycounts.md +40 -0
  52. package/docs/docs/cmd/outlook/report/report-mailactivityusercounts.md +40 -0
  53. package/docs/docs/cmd/outlook/report/report-mailactivityuserdetail.md +45 -0
  54. package/docs/docs/cmd/outlook/report/report-mailappusageappsusercounts.md +43 -0
  55. package/docs/docs/cmd/outlook/report/report-mailappusageusercounts.md +44 -0
  56. package/docs/docs/cmd/outlook/report/report-mailappusageuserdetail.md +48 -0
  57. package/docs/docs/cmd/outlook/report/report-mailappusageversionsusercounts.md +41 -0
  58. package/docs/docs/cmd/outlook/report/report-mailboxusagedetail.md +49 -0
  59. package/docs/docs/cmd/outlook/report/report-mailboxusagemailboxcount.md +37 -0
  60. package/docs/docs/cmd/outlook/report/report-mailboxusagequotastatusmailboxcounts.md +40 -0
  61. package/docs/docs/cmd/outlook/report/report-mailboxusagestorage.md +36 -0
  62. package/docs/docs/cmd/outlook/room/room-list.md +81 -0
  63. package/docs/docs/cmd/outlook/roomlist/roomlist-list.md +58 -0
  64. package/docs/docs/cmd/planner/plan/plan-add.md +3 -3
  65. package/docs/docs/cmd/planner/plan/plan-set.md +73 -7
  66. package/docs/docs/cmd/planner/roster/roster-add.md +16 -1
  67. package/docs/docs/cmd/planner/roster/roster-member-get.md +87 -0
  68. package/docs/docs/cmd/planner/task/task-add.md +230 -0
  69. package/docs/docs/cmd/planner/task/task-checklistitem-add.md +55 -0
  70. package/docs/docs/cmd/planner/task/task-checklistitem-list.md +55 -0
  71. package/docs/docs/cmd/planner/task/task-checklistitem-remove.md +4 -0
  72. package/docs/docs/cmd/planner/task/task-get.md +131 -0
  73. package/docs/docs/cmd/planner/task/task-list.md +92 -0
  74. package/docs/docs/cmd/planner/task/task-reference-add.md +46 -0
  75. package/docs/docs/cmd/planner/task/task-reference-list.md +46 -0
  76. package/docs/docs/cmd/planner/task/task-reference-remove.md +4 -0
  77. package/docs/docs/cmd/planner/task/task-remove.md +4 -0
  78. package/docs/docs/cmd/planner/task/task-set.md +230 -0
  79. package/docs/docs/cmd/planner/tenant/tenant-settings-list.md +55 -0
  80. package/docs/docs/cmd/planner/tenant/tenant-settings-set.md +55 -0
  81. package/docs/docs/cmd/pp/card/card-get.md +2 -2
  82. package/docs/docs/cmd/pp/card/card-list.md +2 -2
  83. package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-add.md +7 -7
  84. package/docs/docs/cmd/skype/report/report-activitycounts.md +38 -0
  85. package/docs/docs/cmd/skype/report/report-activityusercounts.md +38 -0
  86. package/docs/docs/cmd/skype/report/report-activityuserdetail.md +67 -0
  87. package/docs/docs/cmd/spfx/project/project-doctor.md +3 -3
  88. package/docs/docs/cmd/spfx/project/project-externalize.md +3 -3
  89. package/docs/docs/cmd/spfx/project/project-upgrade.md +3 -3
  90. package/docs/docs/cmd/spfx/spfx-doctor.md +3 -3
  91. package/docs/docs/cmd/spo/cdn/cdn-get.md +6 -6
  92. package/docs/docs/cmd/spo/cdn/cdn-origin-add.md +3 -3
  93. package/docs/docs/cmd/spo/cdn/cdn-origin-list.md +3 -3
  94. package/docs/docs/cmd/spo/cdn/cdn-origin-remove.md +3 -3
  95. package/docs/docs/cmd/spo/cdn/cdn-policy-list.md +3 -3
  96. package/docs/docs/cmd/spo/cdn/cdn-policy-set.md +3 -3
  97. package/docs/docs/cmd/spo/cdn/cdn-set.md +3 -3
  98. package/docs/docs/cmd/spo/customaction/customaction-get.md +113 -11
  99. package/docs/docs/cmd/spo/externaluser/externaluser-list.md +2 -0
  100. package/docs/docs/cmd/spo/group/group-member-add.md +26 -4
  101. package/docs/docs/cmd/spo/hidedefaultthemes/hidedefaultthemes-get.md +2 -0
  102. package/docs/docs/cmd/spo/hidedefaultthemes/hidedefaultthemes-set.md +2 -0
  103. package/docs/docs/cmd/spo/homesite/homesite-remove.md +2 -0
  104. package/docs/docs/cmd/spo/homesite/homesite-set.md +2 -0
  105. package/docs/docs/cmd/spo/knowledgehub/knowledgehub-get.md +2 -0
  106. package/docs/docs/cmd/spo/knowledgehub/knowledgehub-remove.md +2 -0
  107. package/docs/docs/cmd/spo/knowledgehub/knowledgehub-set.md +3 -3
  108. package/docs/docs/cmd/spo/list/list-add.md +2 -2
  109. package/docs/docs/cmd/spo/list/list-set.md +2 -2
  110. package/docs/docs/cmd/spo/listitem/listitem-add.md +1 -1
  111. package/docs/docs/cmd/spo/listitem/listitem-batch-add.md +1 -1
  112. package/docs/docs/cmd/spo/listitem/listitem-set.md +1 -1
  113. package/docs/docs/cmd/spo/navigation/navigation-node-add.md +3 -3
  114. package/docs/docs/cmd/spo/navigation/navigation-node-set.md +2 -2
  115. package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-add.md +2 -0
  116. package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-list.md +2 -0
  117. package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-remove.md +2 -0
  118. package/docs/docs/cmd/spo/orgnewssite/orgnewssite-list.md +2 -0
  119. package/docs/docs/cmd/spo/orgnewssite/orgnewssite-remove.md +2 -0
  120. package/docs/docs/cmd/spo/orgnewssite/orgnewssite-set.md +3 -3
  121. package/docs/docs/cmd/spo/site/site-appcatalog-add.md +2 -0
  122. package/docs/docs/cmd/spo/site/site-appcatalog-remove.md +3 -3
  123. package/docs/docs/cmd/spo/site/site-commsite-enable.md +2 -0
  124. package/docs/docs/cmd/spo/site/site-list.md +3 -3
  125. package/docs/docs/cmd/spo/site/site-remove.md +3 -3
  126. package/docs/docs/cmd/spo/site/site-rename.md +3 -3
  127. package/docs/docs/cmd/spo/site/site-set.md +5 -5
  128. package/docs/docs/cmd/spo/storageentity/storageentity-remove.md +3 -3
  129. package/docs/docs/cmd/spo/storageentity/storageentity-set.md +3 -3
  130. package/docs/docs/cmd/spo/tenant/tenant-appcatalog-add.md +3 -3
  131. package/docs/docs/cmd/spo/tenant/tenant-appcatalogurl-get.md +2 -0
  132. package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-add.md +3 -3
  133. package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-get.md +142 -0
  134. package/docs/docs/cmd/spo/tenant/tenant-recyclebinitem-list.md +2 -0
  135. package/docs/docs/cmd/spo/tenant/tenant-recyclebinitem-remove.md +3 -3
  136. package/docs/docs/cmd/spo/tenant/tenant-recyclebinitem-restore.md +3 -3
  137. package/docs/docs/cmd/spo/tenant/tenant-settings-list.md +2 -0
  138. package/docs/docs/cmd/spo/tenant/tenant-settings-set.md +28 -26
  139. package/docs/docs/cmd/spo/term/term-add.md +3 -3
  140. package/docs/docs/cmd/spo/term/term-get.md +3 -3
  141. package/docs/docs/cmd/spo/term/term-group-add.md +2 -0
  142. package/docs/docs/cmd/spo/term/term-group-get.md +2 -0
  143. package/docs/docs/cmd/spo/term/term-group-list.md +2 -0
  144. package/docs/docs/cmd/spo/term/term-list.md +3 -1
  145. package/docs/docs/cmd/spo/term/term-set-add.md +3 -3
  146. package/docs/docs/cmd/spo/term/term-set-get.md +2 -0
  147. package/docs/docs/cmd/spo/term/term-set-list.md +2 -0
  148. package/docs/docs/cmd/spo/theme/theme-apply.md +3 -3
  149. package/docs/docs/cmd/spo/theme/theme-get.md +2 -0
  150. package/docs/docs/cmd/spo/theme/theme-list.md +2 -0
  151. package/docs/docs/cmd/spo/theme/theme-remove.md +2 -0
  152. package/docs/docs/cmd/spo/theme/theme-set.md +3 -3
  153. package/docs/docs/cmd/teams/channel/channel-get.md +1 -1
  154. package/docs/docs/cmd/teams/channel/channel-member-add.md +2 -2
  155. package/docs/docs/cmd/teams/message/message-get.md +39 -4
  156. package/docs/docs/cmd/teams/message/message-list.md +41 -6
  157. package/docs/docs/cmd/teams/message/message-reply-list.md +39 -4
  158. package/docs/docs/cmd/teams/messagingsettings/messagingsettings-list.md +20 -2
  159. package/docs/docs/cmd/teams/messagingsettings/messagingsettings-set.md +8 -8
  160. package/docs/docs/cmd/teams/report/report-deviceusagedistributionusercounts.md +12 -5
  161. package/docs/docs/cmd/teams/report/report-deviceusageusercounts.md +13 -6
  162. package/docs/docs/cmd/teams/report/report-deviceusageuserdetail.md +14 -7
  163. package/docs/docs/cmd/teams/report/report-directroutingcalls.md +13 -6
  164. package/docs/docs/cmd/teams/report/report-pstncalls.md +13 -6
  165. package/docs/docs/cmd/teams/report/report-useractivitycounts.md +13 -6
  166. package/docs/docs/cmd/teams/report/report-useractivityusercounts.md +13 -6
  167. package/docs/docs/cmd/teams/report/report-useractivityuserdetail.md +13 -6
  168. package/docs/docs/cmd/teams/tab/tab-add.md +16 -0
  169. package/docs/docs/cmd/teams/tab/tab-get.md +17 -0
  170. package/docs/docs/cmd/teams/tab/tab-list.md +19 -0
  171. package/docs/docs/cmd/teams/team/team-add.md +77 -8
  172. package/docs/docs/cmd/teams/team/team-app-list.md +18 -2
  173. package/docs/docs/cmd/teams/team/team-archive.md +2 -2
  174. package/docs/docs/cmd/teams/team/team-clone.md +8 -8
  175. package/docs/docs/cmd/teams/team/team-get.md +34 -4
  176. package/docs/docs/cmd/teams/team/team-list.md +34 -3
  177. package/docs/docs/cmd/teams/team/team-remove.md +3 -3
  178. package/docs/docs/cmd/teams/team/team-set.md +8 -8
  179. package/docs/docs/cmd/teams/team/team-unarchive.md +3 -2
  180. package/docs/docs/cmd/teams/user/user-app-add.md +3 -3
  181. package/docs/docs/cmd/teams/user/user-app-list.md +18 -2
  182. package/docs/docs/cmd/teams/user/user-app-remove.md +4 -4
  183. package/docs/docs/cmd/teams/user/user-list.md +21 -4
  184. package/npm-shrinkwrap.json +279 -194
  185. package/package.json +14 -14
@@ -13,7 +13,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
13
13
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
14
14
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
15
15
  };
16
- var _FlowRunCancelCommand_instances, _FlowRunCancelCommand_initOptions, _FlowRunCancelCommand_initValidators;
16
+ var _FlowRunCancelCommand_instances, _FlowRunCancelCommand_initTelemetry, _FlowRunCancelCommand_initOptions, _FlowRunCancelCommand_initValidators;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  const Cli_1 = require("../../../../cli/Cli");
19
19
  const request_1 = require("../../../../request");
@@ -31,6 +31,7 @@ class FlowRunCancelCommand extends AzmgmtCommand_1.default {
31
31
  constructor() {
32
32
  super();
33
33
  _FlowRunCancelCommand_instances.add(this);
34
+ __classPrivateFieldGet(this, _FlowRunCancelCommand_instances, "m", _FlowRunCancelCommand_initTelemetry).call(this);
34
35
  __classPrivateFieldGet(this, _FlowRunCancelCommand_instances, "m", _FlowRunCancelCommand_initOptions).call(this);
35
36
  __classPrivateFieldGet(this, _FlowRunCancelCommand_instances, "m", _FlowRunCancelCommand_initValidators).call(this);
36
37
  }
@@ -71,7 +72,13 @@ class FlowRunCancelCommand extends AzmgmtCommand_1.default {
71
72
  });
72
73
  }
73
74
  }
74
- _FlowRunCancelCommand_instances = new WeakSet(), _FlowRunCancelCommand_initOptions = function _FlowRunCancelCommand_initOptions() {
75
+ _FlowRunCancelCommand_instances = new WeakSet(), _FlowRunCancelCommand_initTelemetry = function _FlowRunCancelCommand_initTelemetry() {
76
+ this.telemetry.push((args) => {
77
+ Object.assign(this.telemetryProperties, {
78
+ confirm: !!args.options.confirm
79
+ });
80
+ });
81
+ }, _FlowRunCancelCommand_initOptions = function _FlowRunCancelCommand_initOptions() {
75
82
  this.options.unshift({
76
83
  option: '-n, --name <name>'
77
84
  }, {
@@ -42,7 +42,7 @@ class FlowRunListCommand extends AzmgmtItemsListCommand_1.AzmgmtItemsListCommand
42
42
  if (this.verbose) {
43
43
  logger.logToStderr(`Retrieving list of runs for Microsoft Flow ${args.options.flowName}...`);
44
44
  }
45
- let url = `${this.resource}providers/Microsoft.ProcessSimple/environments/${formatting_1.formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting_1.formatting.encodeQueryParameter(args.options.flowName)}/runs?api-version=2016-11-01`;
45
+ let url = `${this.resource}providers/Microsoft.ProcessSimple/${args.options.asAdmin ? 'scopes/admin/' : ''}environments/${formatting_1.formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting_1.formatting.encodeQueryParameter(args.options.flowName)}/runs?api-version=2016-11-01`;
46
46
  const filters = this.getFilters(args.options);
47
47
  if (filters.length > 0) {
48
48
  url += `&$filter=${filters.join(' and ')}`;
@@ -86,7 +86,8 @@ _FlowRunListCommand_instances = new WeakSet(), _FlowRunListCommand_initTelemetry
86
86
  Object.assign(this.telemetryProperties, {
87
87
  status: typeof args.options.status !== 'undefined',
88
88
  triggerStartTime: typeof args.options.triggerStartTime !== 'undefined',
89
- triggerEndTime: typeof args.options.triggerEndTime !== 'undefined'
89
+ triggerEndTime: typeof args.options.triggerEndTime !== 'undefined',
90
+ asAdmin: !!args.options.asAdmin
90
91
  });
91
92
  });
92
93
  }, _FlowRunListCommand_initOptions = function _FlowRunListCommand_initOptions() {
@@ -101,6 +102,8 @@ _FlowRunListCommand_instances = new WeakSet(), _FlowRunListCommand_initTelemetry
101
102
  option: '--triggerStartTime [triggerStartTime]'
102
103
  }, {
103
104
  option: '--triggerEndTime [triggerEndTime]'
105
+ }, {
106
+ option: '--asAdmin'
104
107
  });
105
108
  }, _FlowRunListCommand_initValidators = function _FlowRunListCommand_initValidators() {
106
109
  this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
@@ -11,6 +11,9 @@ exports.default = {
11
11
  EXPORT: `${prefix} export`,
12
12
  GET: `${prefix} get`,
13
13
  LIST: `${prefix} list`,
14
+ OWNER_ADD: `${prefix} owner add`,
15
+ OWNER_LIST: `${prefix} owner list`,
16
+ OWNER_REMOVE: `${prefix} owner remove`,
14
17
  REMOVE: `${prefix} remove`,
15
18
  RUN_CANCEL: `${prefix} run cancel`,
16
19
  RUN_GET: `${prefix} run get`,
@@ -106,6 +106,9 @@ _PlannerRosterMemberAddCommand_instances = new WeakSet(), _PlannerRosterMemberAd
106
106
  if (args.options.userId && !validation_1.validation.isValidGuid(args.options.userId)) {
107
107
  return `${args.options.userId} is not a valid GUID`;
108
108
  }
109
+ if (args.options.userName && !validation_1.validation.isValidUserPrincipalName(args.options.userName)) {
110
+ return `${args.options.userName} is not a valid user principal name (UPN)`;
111
+ }
109
112
  return true;
110
113
  }));
111
114
  };
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
12
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
13
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
14
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
15
+ };
16
+ var _PlannerRosterMemberGetCommand_instances, _PlannerRosterMemberGetCommand_initTelemetry, _PlannerRosterMemberGetCommand_initOptions, _PlannerRosterMemberGetCommand_initOptionSets, _PlannerRosterMemberGetCommand_initValidators;
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const request_1 = require("../../../../request");
19
+ const validation_1 = require("../../../../utils/validation");
20
+ const GraphCommand_1 = require("../../../base/GraphCommand");
21
+ const commands_1 = require("../../commands");
22
+ const aadUser_1 = require("../../../../utils/aadUser");
23
+ class PlannerRosterMemberGetCommand extends GraphCommand_1.default {
24
+ get name() {
25
+ return commands_1.default.ROSTER_MEMBER_GET;
26
+ }
27
+ get description() {
28
+ return 'Gets a member of the specified Microsoft Planner Roster';
29
+ }
30
+ constructor() {
31
+ super();
32
+ _PlannerRosterMemberGetCommand_instances.add(this);
33
+ __classPrivateFieldGet(this, _PlannerRosterMemberGetCommand_instances, "m", _PlannerRosterMemberGetCommand_initTelemetry).call(this);
34
+ __classPrivateFieldGet(this, _PlannerRosterMemberGetCommand_instances, "m", _PlannerRosterMemberGetCommand_initOptions).call(this);
35
+ __classPrivateFieldGet(this, _PlannerRosterMemberGetCommand_instances, "m", _PlannerRosterMemberGetCommand_initValidators).call(this);
36
+ __classPrivateFieldGet(this, _PlannerRosterMemberGetCommand_instances, "m", _PlannerRosterMemberGetCommand_initOptionSets).call(this);
37
+ }
38
+ commandAction(logger, args) {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ if (this.verbose) {
41
+ logger.logToStderr(`Retrieving member ${args.options.userName || args.options.userId} from the Microsoft Planner Roster`);
42
+ }
43
+ try {
44
+ const userId = yield this.getUserId(args);
45
+ const requestOptions = {
46
+ url: `${this.resource}/beta/planner/rosters/${args.options.rosterId}/members/${userId}`,
47
+ headers: {
48
+ accept: 'application/json;odata.metadata=none'
49
+ },
50
+ responseType: 'json'
51
+ };
52
+ const response = yield request_1.default.get(requestOptions);
53
+ logger.log(response);
54
+ }
55
+ catch (err) {
56
+ this.handleRejectedODataJsonPromise(err);
57
+ }
58
+ });
59
+ }
60
+ getUserId(args) {
61
+ return __awaiter(this, void 0, void 0, function* () {
62
+ if (args.options.userId) {
63
+ return args.options.userId;
64
+ }
65
+ return aadUser_1.aadUser.getUserIdByUpn(args.options.userName);
66
+ });
67
+ }
68
+ }
69
+ _PlannerRosterMemberGetCommand_instances = new WeakSet(), _PlannerRosterMemberGetCommand_initTelemetry = function _PlannerRosterMemberGetCommand_initTelemetry() {
70
+ this.telemetry.push((args) => {
71
+ Object.assign(this.telemetryProperties, {
72
+ userId: typeof args.options.userId !== 'undefined',
73
+ userName: typeof args.options.userName !== 'undefined'
74
+ });
75
+ });
76
+ }, _PlannerRosterMemberGetCommand_initOptions = function _PlannerRosterMemberGetCommand_initOptions() {
77
+ this.options.unshift({
78
+ option: '--rosterId <rosterId>'
79
+ }, {
80
+ option: '--userId [userId]'
81
+ }, {
82
+ option: '--userName [userName]'
83
+ });
84
+ }, _PlannerRosterMemberGetCommand_initOptionSets = function _PlannerRosterMemberGetCommand_initOptionSets() {
85
+ this.optionSets.push({ options: ['userId', 'userName'] });
86
+ }, _PlannerRosterMemberGetCommand_initValidators = function _PlannerRosterMemberGetCommand_initValidators() {
87
+ this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
88
+ if (args.options.userId && !validation_1.validation.isValidGuid(args.options.userId)) {
89
+ return `${args.options.userId} is not a valid GUID`;
90
+ }
91
+ if (args.options.userName && !validation_1.validation.isValidUserPrincipalName(args.options.userName)) {
92
+ return `${args.options.userName} is not a valid userName`;
93
+ }
94
+ return true;
95
+ }));
96
+ };
97
+ module.exports = new PlannerRosterMemberGetCommand();
98
+ //# sourceMappingURL=roster-member-get.js.map
@@ -15,6 +15,7 @@ exports.default = {
15
15
  ROSTER_ADD: `${prefix} roster add`,
16
16
  ROSTER_GET: `${prefix} roster get`,
17
17
  ROSTER_MEMBER_ADD: `${prefix} roster member add`,
18
+ ROSTER_MEMBER_GET: `${prefix} roster member get`,
18
19
  ROSTER_MEMBER_LIST: `${prefix} roster member list`,
19
20
  ROSTER_MEMBER_REMOVE: `${prefix} roster member remove`,
20
21
  ROSTER_REMOVE: `${prefix} roster remove`,
@@ -18,8 +18,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  const chalk = require("chalk");
19
19
  const child_process = require("child_process");
20
20
  const semver_1 = require("semver");
21
- const AnonymousCommand_1 = require("../../base/AnonymousCommand");
22
21
  const commands_1 = require("../commands");
22
+ const base_project_command_1 = require("./project/base-project-command");
23
23
  /**
24
24
  * Has the particular check passed or failed
25
25
  */
@@ -64,7 +64,7 @@ var SharePointVersion;
64
64
  SharePointVersion[SharePointVersion["SPO"] = 4] = "SPO";
65
65
  SharePointVersion[SharePointVersion["All"] = 7] = "All";
66
66
  })(SharePointVersion || (SharePointVersion = {}));
67
- class SpfxDoctorCommand extends AnonymousCommand_1.default {
67
+ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
68
68
  get allowedOutputs() {
69
69
  return ['text'];
70
70
  }
@@ -479,6 +479,7 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
479
479
  if (!args.options.output) {
480
480
  args.options.output = 'text';
481
481
  }
482
+ this.projectRootPath = this.getProjectRoot(process.cwd());
482
483
  logger.log(' ');
483
484
  logger.log('CLI for Microsoft 365 SharePoint Framework doctor');
484
485
  logger.log('Verifying configuration of your system for working with the SharePoint Framework');
@@ -557,9 +558,11 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
557
558
  });
558
559
  }
559
560
  checkSharePointFrameworkVersion(spfxVersionRequested, fixes, logger) {
560
- return this
561
- .getPackageVersion('@microsoft/generator-sharepoint', PackageSearchMode.GlobalOnly, HandlePromise.Continue, logger)
562
- .then((spfxVersionDetected) => {
561
+ return __awaiter(this, void 0, void 0, function* () {
562
+ let spfxVersionDetected = this.getSPFxVersionFromYoRcFile(logger);
563
+ if (!spfxVersionDetected) {
564
+ spfxVersionDetected = yield this.getPackageVersion('@microsoft/generator-sharepoint', PackageSearchMode.GlobalOnly, HandlePromise.Continue, logger);
565
+ }
563
566
  const versionCheck = {
564
567
  range: spfxVersionRequested,
565
568
  fix: `npm i -g @microsoft/generator-sharepoint@${spfxVersionRequested}`
@@ -625,39 +628,50 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
625
628
  spVersionStringToEnum(sp) {
626
629
  return SharePointVersion[sp.toUpperCase()];
627
630
  }
631
+ getSPFxVersionFromYoRcFile(logger) {
632
+ if (this.projectRootPath !== null) {
633
+ const spfxVersion = this.getProjectVersion();
634
+ if (spfxVersion) {
635
+ if (this.debug) {
636
+ logger.logToStderr(`SPFx version retrieved from .yo-rc.json file. Retrieved version: ${spfxVersion}`);
637
+ }
638
+ return spfxVersion;
639
+ }
640
+ }
641
+ return undefined;
642
+ }
628
643
  getSharePointFrameworkVersion(logger) {
629
- return new Promise((resolve, reject) => {
630
- if (this.debug) {
631
- logger.logToStderr('Detecting SharePoint Framework version based on @microsoft/sp-core-library local...');
644
+ return __awaiter(this, void 0, void 0, function* () {
645
+ let spfxVersion = this.getSPFxVersionFromYoRcFile(logger);
646
+ if (spfxVersion) {
647
+ return spfxVersion;
632
648
  }
633
- this
634
- .getPackageVersion('@microsoft/sp-core-library', PackageSearchMode.LocalOnly, HandlePromise.Fail, logger)
635
- .then((version) => {
649
+ try {
650
+ spfxVersion = yield this.getPackageVersion('@microsoft/sp-core-library', PackageSearchMode.LocalOnly, HandlePromise.Fail, logger);
636
651
  if (this.debug) {
637
- logger.logToStderr(`Found @microsoft/sp-core-library@${version}`);
652
+ logger.logToStderr(`Found @microsoft/sp-core-library@${spfxVersion}`);
638
653
  }
639
- return Promise.resolve(version);
640
- })
641
- .catch(() => {
654
+ return spfxVersion;
655
+ }
656
+ catch (_a) {
642
657
  if (this.debug) {
643
658
  logger.logToStderr(`@microsoft/sp-core-library not found. Search for @microsoft/generator-sharepoint local or global...`);
644
659
  }
645
- return this.getPackageVersion('@microsoft/generator-sharepoint', PackageSearchMode.LocalAndGlobal, HandlePromise.Fail, logger);
646
- })
647
- .then((version) => {
648
- resolve(version);
649
- })
650
- .catch((error) => {
651
- if (this.debug) {
652
- logger.logToStderr('@microsoft/generator-sharepoint not found');
653
- }
654
- if (error && error.indexOf('ENOENT') > -1) {
655
- reject('npm not found');
660
+ try {
661
+ return yield this.getPackageVersion('@microsoft/generator-sharepoint', PackageSearchMode.LocalAndGlobal, HandlePromise.Fail, logger);
656
662
  }
657
- else {
658
- resolve('');
663
+ catch (error) {
664
+ if (this.debug) {
665
+ logger.logToStderr('@microsoft/generator-sharepoint not found');
666
+ }
667
+ if (error && error.indexOf('ENOENT') > -1) {
668
+ throw 'npm not found';
669
+ }
670
+ else {
671
+ return '';
672
+ }
659
673
  }
660
- });
674
+ }
661
675
  });
662
676
  }
663
677
  getPackageVersion(packageName, searchMode, handlePromise, logger) {
@@ -77,14 +77,26 @@ class SpoCustomActionGetCommand extends SpoCommand_1.default {
77
77
  }
78
78
  return customAction;
79
79
  }
80
- const customActions = yield spo_1.spo.getCustomActions(options.webUrl, options.scope, `Title eq '${formatting_1.formatting.encodeQueryParameter(options.title)}'`);
81
- if (customActions.length === 1) {
82
- return customActions[0];
80
+ else if (options.title) {
81
+ const customActions = yield spo_1.spo.getCustomActions(options.webUrl, options.scope, `Title eq '${formatting_1.formatting.encodeQueryParameter(options.title)}'`);
82
+ if (customActions.length === 1) {
83
+ return customActions[0];
84
+ }
85
+ if (customActions.length === 0) {
86
+ throw `No user custom action with title '${options.title}' found`;
87
+ }
88
+ throw `Multiple user custom actions with title '${options.title}' found. Please disambiguate using IDs: ${customActions.map(a => a.Id).join(', ')}`;
83
89
  }
84
- if (customActions.length === 0) {
85
- throw `No user custom action with title '${options.title}' found`;
90
+ else {
91
+ const customActions = yield spo_1.spo.getCustomActions(options.webUrl, options.scope, `ClientSideComponentId eq guid'${options.clientSideComponentId}'`);
92
+ if (customActions.length === 0) {
93
+ throw `No user custom action with ClientSideComponentId '${options.clientSideComponentId}' found`;
94
+ }
95
+ if (customActions.length > 1) {
96
+ throw `Multiple user custom actions with ClientSideComponentId '${options.clientSideComponentId}' found. Please disambiguate using IDs: ${customActions.map((customAction) => customAction.Id).join(', ')}`;
97
+ }
98
+ return customActions[0];
86
99
  }
87
- throw `Multiple user custom actions with title '${options.title}' found. Please disambiguate using IDs: ${customActions.map(a => a.Id).join(', ')}`;
88
100
  });
89
101
  }
90
102
  humanizeScope(scope) {
@@ -100,6 +112,9 @@ class SpoCustomActionGetCommand extends SpoCommand_1.default {
100
112
  _SpoCustomActionGetCommand_instances = new WeakSet(), _SpoCustomActionGetCommand_initTelemetry = function _SpoCustomActionGetCommand_initTelemetry() {
101
113
  this.telemetry.push((args) => {
102
114
  Object.assign(this.telemetryProperties, {
115
+ id: typeof args.options.id !== 'undefined',
116
+ title: typeof args.options.title !== 'undefined',
117
+ clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined',
103
118
  scope: args.options.scope || 'All'
104
119
  });
105
120
  });
@@ -108,6 +123,8 @@ _SpoCustomActionGetCommand_instances = new WeakSet(), _SpoCustomActionGetCommand
108
123
  option: '-i, --id [id]'
109
124
  }, {
110
125
  option: '-t, --title [title]'
126
+ }, {
127
+ option: '-c, --clientSideComponentId [clientSideComponentId]'
111
128
  }, {
112
129
  option: '-u, --webUrl <webUrl>'
113
130
  }, {
@@ -130,10 +147,13 @@ _SpoCustomActionGetCommand_instances = new WeakSet(), _SpoCustomActionGetCommand
130
147
  return `${args.options.scope} is not a valid custom action scope. Allowed values are Site|Web|All`;
131
148
  }
132
149
  }
150
+ if (args.options.clientSideComponentId && validation_1.validation.isValidGuid(args.options.clientSideComponentId) === false) {
151
+ return `${args.options.clientSideComponentId} is not a valid GUID.`;
152
+ }
133
153
  return true;
134
154
  }));
135
155
  }, _SpoCustomActionGetCommand_initOptionSets = function _SpoCustomActionGetCommand_initOptionSets() {
136
- this.optionSets.push({ options: ['id', 'title'] });
156
+ this.optionSets.push({ options: ['id', 'title', 'clientSideComponentId'] });
137
157
  };
138
158
  module.exports = new SpoCustomActionGetCommand();
139
159
  //# sourceMappingURL=customaction-get.js.map
@@ -55,7 +55,7 @@ class SpoFileMoveCommand extends SpoCommand_1.default {
55
55
  // A user might enter folder instead of file as source url by mistake
56
56
  // then there are edge cases when deleteIfAlreadyExists flag is set
57
57
  // the user can receive misleading error message.
58
- this.fileExists(tenantUrl, webUrl, args.options.sourceUrl);
58
+ yield this.fileExists(tenantUrl, webUrl, args.options.sourceUrl);
59
59
  if (args.options.deleteIfAlreadyExists) {
60
60
  // try delete target file, if deleteIfAlreadyExists flag is set
61
61
  const filename = args.options.sourceUrl.replace(/^.*[\\\/]/, '');
@@ -15,15 +15,14 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
15
15
  };
16
16
  var _SpoGroupMemberAddCommand_instances, _SpoGroupMemberAddCommand_initTelemetry, _SpoGroupMemberAddCommand_initOptions, _SpoGroupMemberAddCommand_initValidators, _SpoGroupMemberAddCommand_initOptionSets;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- const Cli_1 = require("../../../../cli/Cli");
19
18
  const request_1 = require("../../../../request");
20
19
  const formatting_1 = require("../../../../utils/formatting");
21
20
  const validation_1 = require("../../../../utils/validation");
22
- const AadUserGetCommand = require("../../../aad/commands/user/user-get");
23
- const AadGroupGetCommand = require("../../../aad/commands/group/group-get");
24
- const SpoUserGetCommand = require("../user/user-get");
25
21
  const SpoCommand_1 = require("../../../base/SpoCommand");
26
22
  const commands_1 = require("../../commands");
23
+ const aadUser_1 = require("../../../../utils/aadUser");
24
+ const aadGroup_1 = require("../../../../utils/aadGroup");
25
+ const spo_1 = require("../../../../utils/spo");
27
26
  class SpoGroupMemberAddCommand extends SpoCommand_1.default {
28
27
  get name() {
29
28
  return commands_1.default.GROUP_MEMBER_ADD;
@@ -48,21 +47,20 @@ class SpoGroupMemberAddCommand extends SpoCommand_1.default {
48
47
  const groupId = yield this.getGroupId(args, logger);
49
48
  const resolvedUsernameList = yield this.getValidUsers(args, logger);
50
49
  if (this.verbose) {
51
- logger.logToStderr(`Adding user(s) to SharePoint Group ${args.options.groupId || args.options.groupName}`);
50
+ logger.logToStderr(`Adding resource(s) to SharePoint Group ${args.options.groupId || args.options.groupName}`);
52
51
  }
53
- const data = {
54
- url: args.options.webUrl,
55
- peoplePickerInput: this.getFormattedUserList(resolvedUsernameList),
56
- roleValue: `group:${groupId}`
57
- };
58
52
  const requestOptions = {
59
53
  url: `${args.options.webUrl}/_api/SP.Web.ShareObject`,
60
54
  headers: {
61
- 'Accept': 'application/json;odata=nometadata',
62
- 'Content-type': 'application/json;odata=verbose'
55
+ accept: 'application/json;odata=nometadata',
56
+ 'content-type': 'application/json;odata=nometadata'
63
57
  },
64
- data: data,
65
- responseType: 'json'
58
+ responseType: 'json',
59
+ data: {
60
+ url: args.options.webUrl,
61
+ peoplePickerInput: this.getFormattedUserList(resolvedUsernameList),
62
+ roleValue: `group:${groupId}`
63
+ }
66
64
  };
67
65
  const sharingResult = yield request_1.default.post(requestOptions);
68
66
  if (sharingResult.ErrorMessage !== null) {
@@ -83,7 +81,7 @@ class SpoGroupMemberAddCommand extends SpoCommand_1.default {
83
81
  `GetByName('${formatting_1.formatting.encodeQueryParameter(args.options.groupName)}')` :
84
82
  `GetById('${args.options.groupId}')`;
85
83
  const requestOptions = {
86
- url: `${args.options.webUrl}/_api/web/sitegroups/${getGroupMethod}`,
84
+ url: `${args.options.webUrl}/_api/web/sitegroups/${getGroupMethod}?$select=Id`,
87
85
  headers: {
88
86
  'accept': 'application/json;odata=nometadata'
89
87
  },
@@ -91,91 +89,52 @@ class SpoGroupMemberAddCommand extends SpoCommand_1.default {
91
89
  };
92
90
  return request_1.default
93
91
  .get(requestOptions)
94
- .then(response => {
95
- const groupId = response.Id;
96
- if (!groupId) {
97
- return Promise.reject(`The specified group does not exist in the SharePoint site`);
98
- }
99
- return groupId;
100
- });
92
+ .then(response => response.Id);
101
93
  }
102
94
  getValidUsers(args, logger) {
103
- if (this.verbose) {
104
- logger.logToStderr(`Checking if the specified users exist`);
105
- }
106
- const validUserNames = [];
107
- const invalidUserNames = [];
108
- const userIdentifiers = args.options.userName || args.options.email || args.options.aadGroupId || args.options.aadGroupName || args.options.userId.toString();
109
- return Promise
110
- .all(userIdentifiers.split(',').map((userIdentifier) => __awaiter(this, void 0, void 0, function* () {
111
- const user = userIdentifier.trim();
112
- try {
113
- if (args.options.userId) {
114
- yield this.spoUserGet(args.options, user, logger, validUserNames);
115
- }
116
- else if (args.options.aadGroupId || args.options.aadGroupName) {
117
- yield this.aadGroupGet(args.options, user, logger, validUserNames);
118
- }
119
- else {
120
- yield this.aadUserGet(args.options, user, logger, validUserNames);
121
- }
122
- }
123
- catch (err) {
124
- logger.logToStderr(err.stderr);
125
- invalidUserNames.push(userIdentifier);
126
- return err;
127
- }
128
- })))
129
- .then(() => {
130
- if (invalidUserNames.length > 0) {
131
- return Promise.reject(`Users not added to the group because the following users don't exist: ${invalidUserNames.join(', ')}`);
132
- }
133
- return Promise.resolve(validUserNames);
134
- });
135
- }
136
- aadUserGet(options, userIdentifier, logger, validUserNames) {
95
+ var _a, _b, _c, _d;
137
96
  return __awaiter(this, void 0, void 0, function* () {
138
97
  if (this.verbose) {
139
- logger.logToStderr(`Get UPN from Azure AD for user ${userIdentifier}`);
98
+ logger.logToStderr('Checking if the specified users and groups exist');
140
99
  }
141
- const aadUserGetCommandoptions = Object.assign(Object.assign(Object.assign({}, (options.userName && { userName: userIdentifier })), (options.email && { email: userIdentifier })), { output: 'json', debug: options.debug, verbose: options.verbose });
142
- const aadUserGetOutput = yield Cli_1.Cli.executeCommandWithOutput(AadUserGetCommand, { options: Object.assign(Object.assign({}, aadUserGetCommandoptions), { _: [] }) });
143
- if (this.debug) {
144
- logger.logToStderr(aadUserGetOutput.stderr);
145
- }
146
- validUserNames.push(JSON.parse(aadUserGetOutput.stdout).userPrincipalName);
147
- });
148
- }
149
- aadGroupGet(options, userIdentifier, logger, validUserNames) {
150
- return __awaiter(this, void 0, void 0, function* () {
151
- if (this.verbose) {
152
- logger.logToStderr(`Get UPN from Azure AD for group ${userIdentifier}`);
153
- }
154
- const aadUserGetCommandoptions = Object.assign(Object.assign(Object.assign({}, (options.aadGroupId && { id: userIdentifier })), (options.aadGroupName && { title: userIdentifier })), { output: 'json', debug: options.debug, verbose: options.verbose });
155
- const aadGroupGetOutput = yield Cli_1.Cli.executeCommandWithOutput(AadGroupGetCommand, { options: Object.assign(Object.assign({}, aadUserGetCommandoptions), { _: [] }) });
156
- if (this.debug) {
157
- logger.logToStderr(aadGroupGetOutput.stderr);
158
- }
159
- validUserNames.push(JSON.parse(aadGroupGetOutput.stdout).mail);
160
- });
161
- }
162
- spoUserGet(options, userIdentifier, logger, validUserNames) {
163
- return __awaiter(this, void 0, void 0, function* () {
164
- if (this.verbose) {
165
- logger.logToStderr(`Get UPN from SharePoint for user ${userIdentifier}`);
166
- }
167
- const spoUserGetCommandoptions = {
168
- id: userIdentifier,
169
- webUrl: options.webUrl,
170
- output: 'json',
171
- debug: options.debug,
172
- verbose: options.verbose
173
- };
174
- const spoUserGetOutput = yield Cli_1.Cli.executeCommandWithOutput(SpoUserGetCommand, { options: Object.assign(Object.assign({}, spoUserGetCommandoptions), { _: [] }) });
175
- if (this.debug) {
176
- logger.logToStderr(spoUserGetOutput.stderr);
177
- }
178
- validUserNames.push(JSON.parse(spoUserGetOutput.stdout).UserPrincipalName);
100
+ const validUserNames = [];
101
+ const identifiers = (_d = (_c = (_b = (_a = args.options.userName) !== null && _a !== void 0 ? _a : args.options.email) !== null && _b !== void 0 ? _b : args.options.aadGroupId) !== null && _c !== void 0 ? _c : args.options.aadGroupName) !== null && _d !== void 0 ? _d : args.options.userId.toString();
102
+ yield Promise.all(identifiers.split(',').map((identifier) => __awaiter(this, void 0, void 0, function* () {
103
+ const trimmedIdentifier = identifier.trim();
104
+ try {
105
+ if (args.options.userId) {
106
+ if (this.verbose) {
107
+ logger.logToStderr(`Getting AAD ID of user with ID ${trimmedIdentifier}`);
108
+ }
109
+ const spoUserAzureId = yield spo_1.spo.getUserAzureIdBySpoId(args.options.webUrl, trimmedIdentifier);
110
+ validUserNames.push(spoUserAzureId);
111
+ }
112
+ else if (args.options.userName) {
113
+ validUserNames.push(trimmedIdentifier);
114
+ }
115
+ else if (args.options.aadGroupId) {
116
+ validUserNames.push(trimmedIdentifier);
117
+ }
118
+ else if (args.options.aadGroupName) {
119
+ if (this.verbose) {
120
+ logger.logToStderr(`Getting ID of Azure AD group ${trimmedIdentifier}`);
121
+ }
122
+ const groupId = yield aadGroup_1.aadGroup.getGroupIdByDisplayName(trimmedIdentifier);
123
+ validUserNames.push(groupId);
124
+ }
125
+ else {
126
+ if (this.verbose) {
127
+ logger.logToStderr(`Getting Azure AD ID for user ${trimmedIdentifier}`);
128
+ }
129
+ const upn = yield aadUser_1.aadUser.getUserIdByEmail(trimmedIdentifier);
130
+ validUserNames.push(upn);
131
+ }
132
+ }
133
+ catch (err) {
134
+ throw `Resource '${trimmedIdentifier}' does not exist.`;
135
+ }
136
+ })));
137
+ return validUserNames;
179
138
  });
180
139
  }
181
140
  getFormattedUserList(activeUserList) {
@@ -106,7 +106,7 @@ class SpoListAddCommand extends SpoCommand_1.default {
106
106
  mapRequestBody(options) {
107
107
  const requestBody = {
108
108
  Title: options.title,
109
- BaseTemplate: ListTemplateType_1.ListTemplateType[options.baseTemplate.trim()].valueOf()
109
+ BaseTemplate: options.baseTemplate ? ListTemplateType_1.ListTemplateType[options.baseTemplate.trim()].valueOf() : ListTemplateType_1.ListTemplateType.GenericList
110
110
  };
111
111
  if (options.description) {
112
112
  requestBody.Description = options.description;
@@ -148,7 +148,7 @@ class SpoListAddCommand extends SpoCommand_1.default {
148
148
  requestBody.DisableGridEditing = options.disableGridEditing;
149
149
  }
150
150
  if (options.draftVersionVisibility) {
151
- requestBody.DraftVersionVisibility = options.draftVersionVisibility;
151
+ requestBody.DraftVersionVisibility = DraftVisibilityType_1.DraftVisibilityType[options.draftVersionVisibility.trim()];
152
152
  }
153
153
  if (options.emailAlias) {
154
154
  requestBody.EmailAlias = options.emailAlias;
@@ -226,7 +226,7 @@ class SpoListAddCommand extends SpoCommand_1.default {
226
226
  requestBody.IsApplicationList = options.isApplicationList;
227
227
  }
228
228
  if (options.listExperienceOptions) {
229
- requestBody.ListExperienceOptions = options.listExperienceOptions;
229
+ requestBody.ListExperienceOptions = ListExperience_1.ListExperience[options.listExperienceOptions.trim()];
230
230
  }
231
231
  if (options.majorVersionLimit) {
232
232
  requestBody.MajorVersionLimit = options.majorVersionLimit;
@@ -296,6 +296,7 @@ _SpoListAddCommand_instances = new WeakSet(), _SpoListAddCommand_initTelemetry =
296
296
  const telemetryProps = {};
297
297
  // add properties with identifiable data
298
298
  [
299
+ 'baseTemplate',
299
300
  'description',
300
301
  'templateFeatureId',
301
302
  'schemaXml',
@@ -342,7 +343,7 @@ _SpoListAddCommand_instances = new WeakSet(), _SpoListAddCommand_initTelemetry =
342
343
  this.options.unshift({
343
344
  option: '-t, --title <title>'
344
345
  }, {
345
- option: '--baseTemplate <baseTemplate>',
346
+ option: '--baseTemplate [baseTemplate]',
346
347
  autocomplete: this.listTemplateTypeMap
347
348
  }, {
348
349
  option: '-u, --webUrl <webUrl>'
@@ -520,9 +521,11 @@ _SpoListAddCommand_instances = new WeakSet(), _SpoListAddCommand_initTelemetry =
520
521
  if (isValidSharePointUrl !== true) {
521
522
  return isValidSharePointUrl;
522
523
  }
523
- const template = ListTemplateType_1.ListTemplateType[args.options.baseTemplate.trim()];
524
- if (!template) {
525
- return `${args.options.baseTemplate} is not a valid baseTemplate value`;
524
+ if (args.options.baseTemplate) {
525
+ const template = ListTemplateType_1.ListTemplateType[args.options.baseTemplate.trim()];
526
+ if (!template) {
527
+ return `${args.options.baseTemplate} is not a valid baseTemplate value`;
528
+ }
526
529
  }
527
530
  if (args.options.templateFeatureId &&
528
531
  !validation_1.validation.isValidGuid(args.options.templateFeatureId)) {
@@ -538,7 +541,7 @@ _SpoListAddCommand_instances = new WeakSet(), _SpoListAddCommand_initTelemetry =
538
541
  }
539
542
  if (args.options.draftVersionVisibility) {
540
543
  const draftType = DraftVisibilityType_1.DraftVisibilityType[args.options.draftVersionVisibility.trim()];
541
- if (!draftType) {
544
+ if (draftType === undefined) {
542
545
  return `${args.options.draftVersionVisibility} is not a valid draftVisibilityType value`;
543
546
  }
544
547
  }