@pnp/cli-microsoft365 6.0.0-beta.e9e0f02 → 6.0.0-beta.f1889e3

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 (191) hide show
  1. package/dist/Auth.js +1 -2
  2. package/dist/cli/Cli.js +1 -1
  3. package/dist/m365/aad/commands/app/app-add.js +4 -4
  4. package/dist/m365/aad/commands/app/app-get.js +4 -11
  5. package/dist/m365/aad/commands/app/app-remove.js +4 -11
  6. package/dist/m365/aad/commands/app/app-role-add.js +5 -10
  7. package/dist/m365/aad/commands/app/app-role-list.js +4 -24
  8. package/dist/m365/aad/commands/app/app-role-remove.js +4 -22
  9. package/dist/m365/aad/commands/app/app-set.js +4 -11
  10. package/dist/m365/aad/commands/approleassignment/approleassignment-add.js +4 -8
  11. package/dist/m365/aad/commands/approleassignment/approleassignment-list.js +4 -11
  12. package/dist/m365/aad/commands/approleassignment/approleassignment-remove.js +4 -8
  13. package/dist/m365/aad/commands/groupsettingtemplate/groupsettingtemplate-get.js +4 -7
  14. package/dist/m365/aad/commands/o365group/o365group-conversation-post-list.js +4 -8
  15. package/dist/m365/aad/commands/o365group/o365group-recyclebinitem-restore.js +0 -3
  16. package/dist/m365/aad/commands/o365group/o365group-teamify.js +4 -7
  17. package/dist/m365/aad/commands/o365group/o365group-user-add.js +4 -7
  18. package/dist/m365/aad/commands/o365group/o365group-user-remove.js +4 -7
  19. package/dist/m365/aad/commands/o365group/o365group-user-set.js +4 -7
  20. package/dist/m365/aad/commands/sp/sp-add.js +4 -8
  21. package/dist/m365/aad/commands/sp/sp-get.js +4 -8
  22. package/dist/m365/aad/commands/user/user-get.js +4 -9
  23. package/dist/m365/aad/commands/user/user-list.js +13 -2
  24. package/dist/m365/aad/commands/user/user-set.js +4 -7
  25. package/dist/m365/aad/commands.js +0 -1
  26. package/dist/m365/booking/commands/business/business-get.js +86 -0
  27. package/dist/m365/booking/commands/business/business-list.js +30 -0
  28. package/dist/m365/booking/commands.js +8 -0
  29. package/dist/m365/cli/commands/config/config-set.js +0 -1
  30. package/dist/m365/commands/commands.js +1 -0
  31. package/dist/m365/commands/request.js +153 -0
  32. package/dist/m365/graph/Changelog.js +3 -0
  33. package/dist/m365/graph/commands/changelog/changelog-list.js +160 -0
  34. package/dist/m365/graph/commands.js +1 -0
  35. package/dist/m365/onenote/commands/notebook/notebook-list.js +139 -0
  36. package/dist/m365/onenote/commands.js +7 -0
  37. package/dist/m365/outlook/commands/mail/mail-send.js +22 -6
  38. package/dist/m365/outlook/commands/message/message-list.js +4 -23
  39. package/dist/m365/outlook/commands/message/message-move.js +4 -31
  40. package/dist/m365/outlook/commands.js +1 -2
  41. package/dist/m365/pa/commands/app/app-get.js +4 -7
  42. package/dist/m365/planner/commands/bucket/bucket-add.js +4 -7
  43. package/dist/m365/planner/commands/bucket/bucket-list.js +4 -7
  44. package/dist/m365/planner/commands/plan/plan-add.js +4 -7
  45. package/dist/m365/planner/commands/plan/plan-list.js +4 -7
  46. package/dist/m365/planner/commands/task/task-add.js +4 -13
  47. package/dist/m365/planner/commands/task/task-get.js +7 -0
  48. package/dist/m365/pp/commands/environment/environment-list.js +1 -1
  49. package/dist/m365/pp/commands/managementapp/managementapp-add.js +4 -11
  50. package/dist/m365/search/commands/externalconnection/externalconnection-remove.js +101 -0
  51. package/dist/m365/search/commands.js +2 -1
  52. package/dist/m365/spfx/commands/project/project-doctor/doctor-1.16.0-beta.1.js +23 -0
  53. package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
  54. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN010008_YORC_nodeVersion.js +47 -0
  55. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN021003_PKG_engines_node.js +48 -0
  56. package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.16.0-beta.1.js +61 -0
  57. package/dist/m365/spfx/commands/project/project-upgrade.js +16 -13
  58. package/dist/m365/spfx/commands/spfx-doctor.js +90 -79
  59. package/dist/m365/spo/commands/app/app-deploy.js +4 -7
  60. package/dist/m365/spo/commands/app/app-get.js +4 -7
  61. package/dist/m365/spo/commands/contenttype/contenttype-get.js +4 -7
  62. package/dist/m365/spo/commands/contenttype/contenttype-remove.js +5 -14
  63. package/dist/m365/spo/commands/field/field-set.js +2 -9
  64. package/dist/m365/spo/commands/file/file-checkin.js +4 -7
  65. package/dist/m365/spo/commands/file/file-checkout.js +4 -7
  66. package/dist/m365/spo/commands/file/file-get.js +4 -7
  67. package/dist/m365/spo/commands/file/file-remove.js +4 -7
  68. package/dist/m365/spo/commands/file/file-sharinginfo-get.js +4 -7
  69. package/dist/m365/spo/commands/group/group-remove.js +4 -7
  70. package/dist/m365/spo/commands/group/group-user-add.js +4 -13
  71. package/dist/m365/spo/commands/group/group-user-list.js +4 -7
  72. package/dist/m365/spo/commands/group/group-user-remove.js +4 -7
  73. package/dist/m365/spo/commands/hubsite/hubsite-unregister.js +1 -1
  74. package/dist/m365/spo/commands/list/list-contenttype-add.js +4 -7
  75. package/dist/m365/spo/commands/list/list-contenttype-default-set.js +4 -7
  76. package/dist/m365/spo/commands/list/list-contenttype-list.js +4 -7
  77. package/dist/m365/spo/commands/list/list-contenttype-remove.js +4 -7
  78. package/dist/m365/spo/commands/list/list-get.js +4 -7
  79. package/dist/m365/spo/commands/list/list-label-get.js +4 -7
  80. package/dist/m365/spo/commands/list/list-label-set.js +4 -4
  81. package/dist/m365/spo/commands/list/list-remove.js +4 -7
  82. package/dist/m365/spo/commands/list/list-roleassignment-add.js +9 -0
  83. package/dist/m365/spo/commands/list/list-roleassignment-remove.js +57 -28
  84. package/dist/m365/spo/commands/list/list-roleinheritance-break.js +46 -21
  85. package/dist/m365/spo/commands/list/list-roleinheritance-reset.js +42 -17
  86. package/dist/m365/spo/commands/list/list-sitescript-get.js +4 -7
  87. package/dist/m365/spo/commands/list/list-view-field-add.js +4 -19
  88. package/dist/m365/spo/commands/list/list-view-field-remove.js +4 -19
  89. package/dist/m365/spo/commands/list/list-view-field-set.js +4 -19
  90. package/dist/m365/spo/commands/list/list-view-get.js +4 -10
  91. package/dist/m365/spo/commands/list/list-view-list.js +4 -7
  92. package/dist/m365/spo/commands/list/list-view-remove.js +4 -13
  93. package/dist/m365/spo/commands/list/list-view-set.js +4 -13
  94. package/dist/m365/spo/commands/list/list-webhook-add.js +4 -7
  95. package/dist/m365/spo/commands/list/list-webhook-get.js +4 -7
  96. package/dist/m365/spo/commands/list/list-webhook-remove.js +4 -7
  97. package/dist/m365/spo/commands/list/list-webhook-set.js +4 -7
  98. package/dist/m365/spo/commands/listitem/listitem-add.js +4 -7
  99. package/dist/m365/spo/commands/listitem/listitem-attachment-list.js +4 -7
  100. package/dist/m365/spo/commands/listitem/listitem-get.js +4 -7
  101. package/dist/m365/spo/commands/listitem/listitem-isrecord.js +4 -7
  102. package/dist/m365/spo/commands/listitem/listitem-record-declare.js +4 -7
  103. package/dist/m365/spo/commands/listitem/listitem-record-undeclare.js +4 -7
  104. package/dist/m365/spo/commands/listitem/listitem-remove.js +4 -7
  105. package/dist/m365/spo/commands/listitem/listitem-roleassignment-remove.js +206 -0
  106. package/dist/m365/spo/commands/listitem/listitem-roleinheritance-break.js +46 -21
  107. package/dist/m365/spo/commands/listitem/listitem-roleinheritance-reset.js +45 -17
  108. package/dist/m365/spo/commands/listitem/listitem-set.js +4 -7
  109. package/dist/m365/spo/commands/site/site-apppermission-add.js +4 -4
  110. package/dist/m365/spo/commands/site/site-apppermission-remove.js +4 -9
  111. package/dist/m365/spo/commands/site/site-apppermission-set.js +4 -4
  112. package/dist/m365/spo/commands/term/term-add.js +4 -7
  113. package/dist/m365/spo/commands/term/term-get.js +4 -7
  114. package/dist/m365/spo/commands/term/term-group-get.js +4 -7
  115. package/dist/m365/spo/commands/term/term-list.js +4 -13
  116. package/dist/m365/spo/commands/term/term-set-add.js +4 -7
  117. package/dist/m365/spo/commands/term/term-set-get.js +4 -13
  118. package/dist/m365/spo/commands/term/term-set-list.js +4 -7
  119. package/dist/m365/spo/commands/user/user-get.js +4 -9
  120. package/dist/m365/spo/commands/user/user-remove.js +4 -7
  121. package/dist/m365/spo/commands/web/web-roleassignment-add.js +187 -0
  122. package/dist/m365/spo/commands/web/web-roleassignment-remove.js +170 -0
  123. package/dist/m365/spo/commands/web/web-roleinheritance-reset.js +43 -13
  124. package/dist/m365/spo/commands.js +3 -0
  125. package/dist/m365/teams/commands/app/app-install.js +4 -11
  126. package/dist/m365/teams/commands/app/app-update.js +4 -7
  127. package/dist/m365/teams/commands/channel/channel-add.js +4 -7
  128. package/dist/m365/teams/commands/channel/channel-get.js +4 -22
  129. package/dist/m365/teams/commands/channel/channel-list.js +4 -7
  130. package/dist/m365/teams/commands/channel/channel-member-add.js +0 -4
  131. package/dist/m365/teams/commands/channel/channel-member-list.js +4 -17
  132. package/dist/m365/teams/commands/channel/channel-member-remove.js +0 -4
  133. package/dist/m365/teams/commands/channel/channel-member-set.js +4 -21
  134. package/dist/m365/teams/commands/channel/channel-remove.js +4 -7
  135. package/dist/m365/teams/commands/chat/chat-get.js +4 -17
  136. package/dist/m365/teams/commands/chat/chat-message-send.js +4 -17
  137. package/dist/m365/teams/commands/tab/tab-get.js +6 -21
  138. package/dist/m365/teams/commands/team/team-get.js +4 -7
  139. package/dist/m365/teams/commands/team/team-remove.js +5 -8
  140. package/dist/m365/teams/commands/team/team-unarchive.js +4 -7
  141. package/dist/m365/teams/commands/user/user-app-list.js +4 -7
  142. package/dist/m365/teams/commands.js +0 -3
  143. package/dist/m365/todo/commands/list/list-remove.js +4 -21
  144. package/dist/m365/todo/commands/list/list-set.js +4 -21
  145. package/dist/m365/todo/commands/task/task-add.js +4 -21
  146. package/dist/m365/todo/commands/task/task-list.js +4 -21
  147. package/dist/m365/todo/commands/task/task-remove.js +4 -21
  148. package/dist/m365/todo/commands/task/task-set.js +4 -7
  149. package/dist/request.js +6 -2
  150. package/dist/settingsNames.js +0 -1
  151. package/dist/utils/fsUtil.js +2 -4
  152. package/dist/utils/md.js +1 -1
  153. package/docs/docs/cmd/aad/app/app-add.md +1 -1
  154. package/docs/docs/cmd/aad/app/app-set.md +1 -1
  155. package/docs/docs/cmd/aad/o365group/o365group-recyclebinitem-restore.md +1 -7
  156. package/docs/docs/cmd/adaptivecard/adaptivecard-send.md +0 -20
  157. package/docs/docs/cmd/booking/business/business-get.md +33 -0
  158. package/docs/docs/cmd/booking/business/business-list.md +21 -0
  159. package/docs/docs/cmd/cli/completion/completion-clink-update.md +1 -1
  160. package/docs/docs/cmd/cli/completion/completion-pwsh-setup.md +1 -1
  161. package/docs/docs/cmd/cli/completion/completion-pwsh-update.md +1 -1
  162. package/docs/docs/cmd/cli/completion/completion-sh-setup.md +1 -1
  163. package/docs/docs/cmd/cli/completion/completion-sh-update.md +1 -1
  164. package/docs/docs/cmd/graph/changelog/changelog-list.md +53 -0
  165. package/docs/docs/cmd/onenote/notebook/notebook-list.md +70 -0
  166. package/docs/docs/cmd/outlook/mail/mail-send.md +45 -8
  167. package/docs/docs/cmd/pp/environment/environment-list.md +1 -1
  168. package/docs/docs/cmd/request.md +76 -0
  169. package/docs/docs/cmd/search/externalconnection/externalconnection-remove.md +40 -0
  170. package/docs/docs/cmd/spfx/project/project-upgrade.md +1 -1
  171. package/docs/docs/cmd/spfx/spfx-doctor.md +3 -3
  172. package/docs/docs/cmd/spo/field/field-set.md +0 -3
  173. package/docs/docs/cmd/spo/hubsite/hubsite-unregister.md +2 -2
  174. package/docs/docs/cmd/spo/list/list-roleassignment-add.md +2 -2
  175. package/docs/docs/cmd/spo/list/list-roleassignment-remove.md +5 -2
  176. package/docs/docs/cmd/spo/list/list-roleinheritance-break.md +9 -0
  177. package/docs/docs/cmd/spo/list/list-roleinheritance-reset.md +9 -0
  178. package/docs/docs/cmd/spo/listitem/listitem-roleassignment-remove.md +67 -0
  179. package/docs/docs/cmd/spo/listitem/listitem-roleinheritance-break.md +15 -6
  180. package/docs/docs/cmd/spo/listitem/listitem-roleinheritance-reset.md +9 -0
  181. package/docs/docs/cmd/spo/site/site-add.md +2 -2
  182. package/docs/docs/cmd/spo/site/site-groupify.md +0 -6
  183. package/docs/docs/cmd/spo/web/web-roleassignment-add.md +57 -0
  184. package/docs/docs/cmd/spo/web/web-roleassignment-remove.md +54 -0
  185. package/docs/docs/cmd/spo/web/web-roleinheritance-reset.md +9 -0
  186. package/docs/docs/cmd/teams/channel/channel-member-add.md +0 -6
  187. package/docs/docs/cmd/teams/channel/channel-member-list.md +0 -6
  188. package/docs/docs/cmd/teams/channel/channel-member-remove.md +0 -6
  189. package/npm-shrinkwrap.json +200 -161
  190. package/package.json +11 -10
  191. package/scripts/Register-CLIM365Completion.ps1 +1 -1
@@ -37,36 +37,56 @@ class SpoListRoleAssignmentRemoveCommand extends SpoCommand_1.default {
37
37
  return 'Removes a role assignment from list permissions';
38
38
  }
39
39
  commandAction(logger, args, cb) {
40
- if (this.verbose) {
41
- logger.logToStderr(`Removing role assignment frm list in site at ${args.options.webUrl}...`);
42
- }
43
- let requestUrl = `${args.options.webUrl}/_api/web/`;
44
- if (args.options.listId) {
45
- requestUrl += `lists(guid'${utils_1.formatting.encodeQueryParameter(args.options.listId)}')/`;
46
- }
47
- else if (args.options.listTitle) {
48
- requestUrl += `lists/getByTitle('${utils_1.formatting.encodeQueryParameter(args.options.listTitle)}')/`;
49
- }
50
- else if (args.options.listUrl) {
51
- const listServerRelativeUrl = utils_1.urlUtil.getServerRelativePath(args.options.webUrl, args.options.listUrl);
52
- requestUrl += `GetList('${utils_1.formatting.encodeQueryParameter(listServerRelativeUrl)}')/`;
53
- }
54
- if (args.options.upn) {
55
- this.GetUserPrincipalId(args.options)
56
- .then((userPrincipalId) => {
57
- args.options.principalId = userPrincipalId;
58
- this.RemoveRoleAssignment(requestUrl, logger, args.options, cb);
59
- }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
60
- }
61
- else if (args.options.groupName) {
62
- this.GetGroupPrincipalId(args.options)
63
- .then((groupPrincipalId) => {
64
- args.options.principalId = groupPrincipalId;
40
+ const removeRoleAssignment = () => {
41
+ if (this.verbose) {
42
+ logger.logToStderr(`Removing role assignment from list in site at ${args.options.webUrl}...`);
43
+ }
44
+ let requestUrl = `${args.options.webUrl}/_api/web/`;
45
+ if (args.options.listId) {
46
+ requestUrl += `lists(guid'${utils_1.formatting.encodeQueryParameter(args.options.listId)}')/`;
47
+ }
48
+ else if (args.options.listTitle) {
49
+ requestUrl += `lists/getByTitle('${utils_1.formatting.encodeQueryParameter(args.options.listTitle)}')/`;
50
+ }
51
+ else if (args.options.listUrl) {
52
+ const listServerRelativeUrl = utils_1.urlUtil.getServerRelativePath(args.options.webUrl, args.options.listUrl);
53
+ requestUrl += `GetList('${utils_1.formatting.encodeQueryParameter(listServerRelativeUrl)}')/`;
54
+ }
55
+ if (args.options.upn) {
56
+ this.GetUserPrincipalId(args.options)
57
+ .then((userPrincipalId) => {
58
+ args.options.principalId = userPrincipalId;
59
+ this.RemoveRoleAssignment(requestUrl, logger, args.options, cb);
60
+ }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
61
+ }
62
+ else if (args.options.groupName) {
63
+ this.GetGroupPrincipalId(args.options)
64
+ .then((groupPrincipalId) => {
65
+ args.options.principalId = groupPrincipalId;
66
+ this.RemoveRoleAssignment(requestUrl, logger, args.options, cb);
67
+ }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
68
+ }
69
+ else {
65
70
  this.RemoveRoleAssignment(requestUrl, logger, args.options, cb);
66
- }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
71
+ }
72
+ };
73
+ if (args.options.confirm) {
74
+ removeRoleAssignment();
67
75
  }
68
76
  else {
69
- this.RemoveRoleAssignment(requestUrl, logger, args.options, cb);
77
+ cli_1.Cli.prompt({
78
+ type: 'confirm',
79
+ name: 'continue',
80
+ default: false,
81
+ message: `Are you sure you want to remove role assignment from list ${args.options.listId || args.options.listTitle} from site ${args.options.webUrl}?`
82
+ }, (result) => {
83
+ if (!result.continue) {
84
+ cb();
85
+ }
86
+ else {
87
+ removeRoleAssignment();
88
+ }
89
+ });
70
90
  }
71
91
  }
72
92
  RemoveRoleAssignment(requestUrl, logger, options, cb) {
@@ -125,7 +145,8 @@ _SpoListRoleAssignmentRemoveCommand_instances = new WeakSet(), _SpoListRoleAssig
125
145
  listUrl: typeof args.options.listUrl !== 'undefined',
126
146
  principalId: typeof args.options.principalId !== 'undefined',
127
147
  upn: typeof args.options.upn !== 'undefined',
128
- groupName: typeof args.options.groupName !== 'undefined'
148
+ groupName: typeof args.options.groupName !== 'undefined',
149
+ confirm: (!(!args.options.confirm)).toString()
129
150
  });
130
151
  });
131
152
  }, _SpoListRoleAssignmentRemoveCommand_initOptions = function _SpoListRoleAssignmentRemoveCommand_initOptions() {
@@ -143,6 +164,8 @@ _SpoListRoleAssignmentRemoveCommand_instances = new WeakSet(), _SpoListRoleAssig
143
164
  option: '--upn [upn]'
144
165
  }, {
145
166
  option: '--groupName [groupName]'
167
+ }, {
168
+ option: '--confirm'
146
169
  });
147
170
  }, _SpoListRoleAssignmentRemoveCommand_initValidators = function _SpoListRoleAssignmentRemoveCommand_initValidators() {
148
171
  this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
@@ -160,10 +183,16 @@ _SpoListRoleAssignmentRemoveCommand_instances = new WeakSet(), _SpoListRoleAssig
160
183
  if (listOptions.some(item => item !== undefined) && listOptions.filter(item => item !== undefined).length > 1) {
161
184
  return `Specify either list id or title or list url`;
162
185
  }
186
+ if (listOptions.filter(item => item !== undefined).length === 0) {
187
+ return `Specify at least list id or title or list url`;
188
+ }
163
189
  const principalOptions = [args.options.principalId, args.options.upn, args.options.groupName];
164
190
  if (principalOptions.some(item => item !== undefined) && principalOptions.filter(item => item !== undefined).length > 1) {
165
191
  return `Specify either principalId id or upn or groupName`;
166
192
  }
193
+ if (principalOptions.filter(item => item !== undefined).length === 0) {
194
+ return `Specify at least principalId id or upn or groupName`;
195
+ }
167
196
  return true;
168
197
  }));
169
198
  };
@@ -15,6 +15,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
15
15
  };
16
16
  var _SpoListRoleInheritanceBreakCommand_instances, _SpoListRoleInheritanceBreakCommand_initTelemetry, _SpoListRoleInheritanceBreakCommand_initOptions, _SpoListRoleInheritanceBreakCommand_initValidators, _SpoListRoleInheritanceBreakCommand_initOptionSets;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
+ const cli_1 = require("../../../../cli");
18
19
  const request_1 = require("../../../../request");
19
20
  const utils_1 = require("../../../../utils");
20
21
  const SpoCommand_1 = require("../../../base/SpoCommand");
@@ -35,32 +36,53 @@ class SpoListRoleInheritanceBreakCommand extends SpoCommand_1.default {
35
36
  return 'Breaks role inheritance on list or library';
36
37
  }
37
38
  commandAction(logger, args, cb) {
39
+ var _a;
38
40
  if (this.verbose) {
39
41
  logger.logToStderr(`Breaking role inheritance of list in site at ${args.options.webUrl}...`);
40
42
  }
41
- let requestUrl = `${args.options.webUrl}/_api/web/lists`;
42
- if (args.options.listId) {
43
- requestUrl += `(guid'${utils_1.formatting.encodeQueryParameter(args.options.listId)}')`;
43
+ const breakListRoleInheritance = () => {
44
+ let requestUrl = `${args.options.webUrl}/_api/web/lists`;
45
+ if (args.options.listId) {
46
+ requestUrl += `(guid'${utils_1.formatting.encodeQueryParameter(args.options.listId)}')`;
47
+ }
48
+ else {
49
+ requestUrl += `/getbytitle('${utils_1.formatting.encodeQueryParameter(args.options.listTitle)}')`;
50
+ }
51
+ let keepExistingPermissions = true;
52
+ if (args.options.clearExistingPermissions) {
53
+ keepExistingPermissions = !args.options.clearExistingPermissions;
54
+ }
55
+ const requestOptions = {
56
+ url: `${requestUrl}/breakroleinheritance(${keepExistingPermissions})`,
57
+ method: 'POST',
58
+ headers: {
59
+ 'accept': 'application/json;odata=nometadata',
60
+ 'content-type': 'application/json'
61
+ },
62
+ responseType: 'json'
63
+ };
64
+ request_1.default
65
+ .post(requestOptions)
66
+ .then(_ => cb(), (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
67
+ };
68
+ if (args.options.confirm) {
69
+ breakListRoleInheritance();
44
70
  }
45
71
  else {
46
- requestUrl += `/getbytitle('${utils_1.formatting.encodeQueryParameter(args.options.listTitle)}')`;
47
- }
48
- let keepExistingPermissions = true;
49
- if (args.options.clearExistingPermissions) {
50
- keepExistingPermissions = !args.options.clearExistingPermissions;
72
+ cli_1.Cli.prompt({
73
+ type: 'confirm',
74
+ name: 'continue',
75
+ default: false,
76
+ message: `Are you sure you want to break the role inheritance of ${(_a = args.options.listId) !== null && _a !== void 0 ? _a : args.options.listTitle}?`
77
+ }, (result) => {
78
+ if (!result.continue) {
79
+ cb();
80
+ }
81
+ else {
82
+ breakListRoleInheritance();
83
+ }
84
+ });
51
85
  }
52
- const requestOptions = {
53
- url: `${requestUrl}/breakroleinheritance(${keepExistingPermissions})`,
54
- method: 'POST',
55
- headers: {
56
- 'accept': 'application/json;odata=nometadata',
57
- 'content-type': 'application/json'
58
- },
59
- responseType: 'json'
60
- };
61
- request_1.default
62
- .post(requestOptions)
63
- .then(_ => cb(), (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
64
86
  }
65
87
  }
66
88
  _SpoListRoleInheritanceBreakCommand_instances = new WeakSet(), _SpoListRoleInheritanceBreakCommand_initTelemetry = function _SpoListRoleInheritanceBreakCommand_initTelemetry() {
@@ -68,7 +90,8 @@ _SpoListRoleInheritanceBreakCommand_instances = new WeakSet(), _SpoListRoleInher
68
90
  Object.assign(this.telemetryProperties, {
69
91
  listId: typeof args.options.listId !== 'undefined',
70
92
  listTitle: typeof args.options.listTitle !== 'undefined',
71
- clearExistingPermissions: args.options.clearExistingPermissions === true
93
+ clearExistingPermissions: args.options.clearExistingPermissions === true,
94
+ confirm: (!(!args.options.confirm)).toString()
72
95
  });
73
96
  });
74
97
  }, _SpoListRoleInheritanceBreakCommand_initOptions = function _SpoListRoleInheritanceBreakCommand_initOptions() {
@@ -80,6 +103,8 @@ _SpoListRoleInheritanceBreakCommand_instances = new WeakSet(), _SpoListRoleInher
80
103
  option: '-t, --listTitle [listTitle]'
81
104
  }, {
82
105
  option: '-c, --clearExistingPermissions'
106
+ }, {
107
+ option: '--confirm'
83
108
  });
84
109
  }, _SpoListRoleInheritanceBreakCommand_initValidators = function _SpoListRoleInheritanceBreakCommand_initValidators() {
85
110
  this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
@@ -15,6 +15,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
15
15
  };
16
16
  var _SpoListRoleInheritanceResetCommand_instances, _SpoListRoleInheritanceResetCommand_initTelemetry, _SpoListRoleInheritanceResetCommand_initOptions, _SpoListRoleInheritanceResetCommand_initValidators, _SpoListRoleInheritanceResetCommand_initOptionSets;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
+ const cli_1 = require("../../../../cli");
18
19
  const request_1 = require("../../../../request");
19
20
  const utils_1 = require("../../../../utils");
20
21
  const SpoCommand_1 = require("../../../base/SpoCommand");
@@ -35,35 +36,57 @@ class SpoListRoleInheritanceResetCommand extends SpoCommand_1.default {
35
36
  return 'Restores role inheritance on list or library';
36
37
  }
37
38
  commandAction(logger, args, cb) {
39
+ var _a;
38
40
  if (this.verbose) {
39
41
  logger.logToStderr(`Restore role inheritance of list in site at ${args.options.webUrl}...`);
40
42
  }
41
- let requestUrl = `${args.options.webUrl}/_api/web/lists`;
42
- if (args.options.listId) {
43
- requestUrl += `(guid'${utils_1.formatting.encodeQueryParameter(args.options.listId)}')`;
43
+ const resetListRoleInheritance = () => {
44
+ let requestUrl = `${args.options.webUrl}/_api/web/lists`;
45
+ if (args.options.listId) {
46
+ requestUrl += `(guid'${utils_1.formatting.encodeQueryParameter(args.options.listId)}')`;
47
+ }
48
+ else {
49
+ requestUrl += `/getbytitle('${utils_1.formatting.encodeQueryParameter(args.options.listTitle)}')`;
50
+ }
51
+ const requestOptions = {
52
+ url: `${requestUrl}/resetroleinheritance`,
53
+ method: 'POST',
54
+ headers: {
55
+ 'accept': 'application/json;odata=nometadata',
56
+ 'content-type': 'application/json'
57
+ },
58
+ responseType: 'json'
59
+ };
60
+ request_1.default
61
+ .post(requestOptions)
62
+ .then(_ => cb(), (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
63
+ };
64
+ if (args.options.confirm) {
65
+ resetListRoleInheritance();
44
66
  }
45
67
  else {
46
- requestUrl += `/getbytitle('${utils_1.formatting.encodeQueryParameter(args.options.listTitle)}')`;
68
+ cli_1.Cli.prompt({
69
+ type: 'confirm',
70
+ name: 'continue',
71
+ default: false,
72
+ message: `Are you sure you want to reset the role inheritance of ${(_a = args.options.listId) !== null && _a !== void 0 ? _a : args.options.listTitle}?`
73
+ }, (result) => {
74
+ if (!result.continue) {
75
+ cb();
76
+ }
77
+ else {
78
+ resetListRoleInheritance();
79
+ }
80
+ });
47
81
  }
48
- const requestOptions = {
49
- url: `${requestUrl}/resetroleinheritance`,
50
- method: 'POST',
51
- headers: {
52
- 'accept': 'application/json;odata=nometadata',
53
- 'content-type': 'application/json'
54
- },
55
- responseType: 'json'
56
- };
57
- request_1.default
58
- .post(requestOptions)
59
- .then(_ => cb(), (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
60
82
  }
61
83
  }
62
84
  _SpoListRoleInheritanceResetCommand_instances = new WeakSet(), _SpoListRoleInheritanceResetCommand_initTelemetry = function _SpoListRoleInheritanceResetCommand_initTelemetry() {
63
85
  this.telemetry.push((args) => {
64
86
  Object.assign(this.telemetryProperties, {
65
87
  listId: typeof args.options.listId !== 'undefined',
66
- listTitle: typeof args.options.listTitle !== 'undefined'
88
+ listTitle: typeof args.options.listTitle !== 'undefined',
89
+ confirm: (!(!args.options.confirm)).toString()
67
90
  });
68
91
  });
69
92
  }, _SpoListRoleInheritanceResetCommand_initOptions = function _SpoListRoleInheritanceResetCommand_initOptions() {
@@ -73,6 +96,8 @@ _SpoListRoleInheritanceResetCommand_instances = new WeakSet(), _SpoListRoleInher
73
96
  option: '-i, --listId [listId]'
74
97
  }, {
75
98
  option: '-t, --listTitle [listTitle]'
99
+ }, {
100
+ option: '--confirm'
76
101
  });
77
102
  }, _SpoListRoleInheritanceResetCommand_initValidators = function _SpoListRoleInheritanceResetCommand_initValidators() {
78
103
  this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
@@ -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 _SpoListSiteScriptGetCommand_instances, _SpoListSiteScriptGetCommand_initTelemetry, _SpoListSiteScriptGetCommand_initOptions, _SpoListSiteScriptGetCommand_initValidators;
16
+ var _SpoListSiteScriptGetCommand_instances, _SpoListSiteScriptGetCommand_initTelemetry, _SpoListSiteScriptGetCommand_initOptions, _SpoListSiteScriptGetCommand_initValidators, _SpoListSiteScriptGetCommand_initOptionSets;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  const Command_1 = require("../../../../Command");
19
19
  const request_1 = require("../../../../request");
@@ -27,6 +27,7 @@ class SpoListSiteScriptGetCommand extends SpoCommand_1.default {
27
27
  __classPrivateFieldGet(this, _SpoListSiteScriptGetCommand_instances, "m", _SpoListSiteScriptGetCommand_initTelemetry).call(this);
28
28
  __classPrivateFieldGet(this, _SpoListSiteScriptGetCommand_instances, "m", _SpoListSiteScriptGetCommand_initOptions).call(this);
29
29
  __classPrivateFieldGet(this, _SpoListSiteScriptGetCommand_instances, "m", _SpoListSiteScriptGetCommand_initValidators).call(this);
30
+ __classPrivateFieldGet(this, _SpoListSiteScriptGetCommand_instances, "m", _SpoListSiteScriptGetCommand_initOptionSets).call(this);
30
31
  }
31
32
  get name() {
32
33
  return commands_1.default.LIST_SITESCRIPT_GET;
@@ -116,14 +117,10 @@ _SpoListSiteScriptGetCommand_instances = new WeakSet(), _SpoListSiteScriptGetCom
116
117
  return `${args.options.listId} is not a valid GUID`;
117
118
  }
118
119
  }
119
- if (args.options.listId && args.options.listTitle) {
120
- return 'Specify listId or listTitle, but not both';
121
- }
122
- if (!args.options.listId && !args.options.listTitle) {
123
- return 'Specify listId or listTitle, one is required';
124
- }
125
120
  return true;
126
121
  }));
122
+ }, _SpoListSiteScriptGetCommand_initOptionSets = function _SpoListSiteScriptGetCommand_initOptionSets() {
123
+ this.optionSets.push(['listId', 'listTitle']);
127
124
  };
128
125
  module.exports = new SpoListSiteScriptGetCommand();
129
126
  //# sourceMappingURL=list-sitescript-get.js.map
@@ -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 _SpoListViewFieldAddCommand_instances, _SpoListViewFieldAddCommand_initTelemetry, _SpoListViewFieldAddCommand_initOptions, _SpoListViewFieldAddCommand_initValidators;
16
+ var _SpoListViewFieldAddCommand_instances, _SpoListViewFieldAddCommand_initTelemetry, _SpoListViewFieldAddCommand_initOptions, _SpoListViewFieldAddCommand_initValidators, _SpoListViewFieldAddCommand_initOptionSets;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  const request_1 = require("../../../../request");
19
19
  const utils_1 = require("../../../../utils");
@@ -26,6 +26,7 @@ class SpoListViewFieldAddCommand extends SpoCommand_1.default {
26
26
  __classPrivateFieldGet(this, _SpoListViewFieldAddCommand_instances, "m", _SpoListViewFieldAddCommand_initTelemetry).call(this);
27
27
  __classPrivateFieldGet(this, _SpoListViewFieldAddCommand_instances, "m", _SpoListViewFieldAddCommand_initOptions).call(this);
28
28
  __classPrivateFieldGet(this, _SpoListViewFieldAddCommand_instances, "m", _SpoListViewFieldAddCommand_initValidators).call(this);
29
+ __classPrivateFieldGet(this, _SpoListViewFieldAddCommand_instances, "m", _SpoListViewFieldAddCommand_initOptionSets).call(this);
29
30
  }
30
31
  get name() {
31
32
  return commands_1.default.LIST_VIEW_FIELD_ADD;
@@ -158,26 +159,10 @@ _SpoListViewFieldAddCommand_instances = new WeakSet(), _SpoListViewFieldAddComma
158
159
  return `${args.options.position} is not a number`;
159
160
  }
160
161
  }
161
- if (args.options.listId && args.options.listTitle) {
162
- return 'Specify listId or listTitle, but not both';
163
- }
164
- if (!args.options.listId && !args.options.listTitle) {
165
- return 'Specify listId or listTitle, one is required';
166
- }
167
- if (args.options.viewId && args.options.viewTitle) {
168
- return 'Specify viewId or viewTitle, but not both';
169
- }
170
- if (!args.options.viewId && !args.options.viewTitle) {
171
- return 'Specify viewId or viewTitle, one is required';
172
- }
173
- if (args.options.id && args.options.title) {
174
- return 'Specify id or title, but not both';
175
- }
176
- if (!args.options.id && !args.options.title) {
177
- return 'Specify id or title, one is required';
178
- }
179
162
  return true;
180
163
  }));
164
+ }, _SpoListViewFieldAddCommand_initOptionSets = function _SpoListViewFieldAddCommand_initOptionSets() {
165
+ this.optionSets.push(['listId', 'listTitle'], ['viewId', 'viewTitle'], ['id', 'title']);
181
166
  };
182
167
  module.exports = new SpoListViewFieldAddCommand();
183
168
  //# sourceMappingURL=list-view-field-add.js.map
@@ -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 _SpoListViewFieldRemoveCommand_instances, _SpoListViewFieldRemoveCommand_initTelemetry, _SpoListViewFieldRemoveCommand_initOptions, _SpoListViewFieldRemoveCommand_initValidators;
16
+ var _SpoListViewFieldRemoveCommand_instances, _SpoListViewFieldRemoveCommand_initTelemetry, _SpoListViewFieldRemoveCommand_initOptions, _SpoListViewFieldRemoveCommand_initValidators, _SpoListViewFieldRemoveCommand_initOptionSets;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  const cli_1 = require("../../../../cli");
19
19
  const request_1 = require("../../../../request");
@@ -27,6 +27,7 @@ class SpoListViewFieldRemoveCommand extends SpoCommand_1.default {
27
27
  __classPrivateFieldGet(this, _SpoListViewFieldRemoveCommand_instances, "m", _SpoListViewFieldRemoveCommand_initTelemetry).call(this);
28
28
  __classPrivateFieldGet(this, _SpoListViewFieldRemoveCommand_instances, "m", _SpoListViewFieldRemoveCommand_initOptions).call(this);
29
29
  __classPrivateFieldGet(this, _SpoListViewFieldRemoveCommand_instances, "m", _SpoListViewFieldRemoveCommand_initValidators).call(this);
30
+ __classPrivateFieldGet(this, _SpoListViewFieldRemoveCommand_instances, "m", _SpoListViewFieldRemoveCommand_initOptionSets).call(this);
30
31
  }
31
32
  get name() {
32
33
  return commands_1.default.LIST_VIEW_FIELD_REMOVE;
@@ -145,26 +146,10 @@ _SpoListViewFieldRemoveCommand_instances = new WeakSet(), _SpoListViewFieldRemov
145
146
  return `${args.options.viewId} is not a valid GUID`;
146
147
  }
147
148
  }
148
- if (args.options.listId && args.options.listTitle) {
149
- return 'Specify listId or listTitle, but not both';
150
- }
151
- if (!args.options.listId && !args.options.listTitle) {
152
- return 'Specify listId or listTitle, one is required';
153
- }
154
- if (args.options.viewId && args.options.viewTitle) {
155
- return 'Specify viewId or viewTitle, but not both';
156
- }
157
- if (!args.options.viewId && !args.options.viewTitle) {
158
- return 'Specify viewId or viewTitle, one is required';
159
- }
160
- if (args.options.id && args.options.title) {
161
- return 'Specify id or title, but not both';
162
- }
163
- if (!args.options.id && !args.options.title) {
164
- return 'Specify id or title, one is required';
165
- }
166
149
  return true;
167
150
  }));
151
+ }, _SpoListViewFieldRemoveCommand_initOptionSets = function _SpoListViewFieldRemoveCommand_initOptionSets() {
152
+ this.optionSets.push(['listId', 'listTitle'], ['viewId', 'viewTitle'], ['id', 'title']);
168
153
  };
169
154
  module.exports = new SpoListViewFieldRemoveCommand();
170
155
  //# sourceMappingURL=list-view-field-remove.js.map
@@ -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 _SpoListViewFieldSetCommand_instances, _SpoListViewFieldSetCommand_initTelemetry, _SpoListViewFieldSetCommand_initOptions, _SpoListViewFieldSetCommand_initValidators;
16
+ var _SpoListViewFieldSetCommand_instances, _SpoListViewFieldSetCommand_initTelemetry, _SpoListViewFieldSetCommand_initOptions, _SpoListViewFieldSetCommand_initValidators, _SpoListViewFieldSetCommand_initOptionSets;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  const request_1 = require("../../../../request");
19
19
  const utils_1 = require("../../../../utils");
@@ -26,6 +26,7 @@ class SpoListViewFieldSetCommand extends SpoCommand_1.default {
26
26
  __classPrivateFieldGet(this, _SpoListViewFieldSetCommand_instances, "m", _SpoListViewFieldSetCommand_initTelemetry).call(this);
27
27
  __classPrivateFieldGet(this, _SpoListViewFieldSetCommand_instances, "m", _SpoListViewFieldSetCommand_initOptions).call(this);
28
28
  __classPrivateFieldGet(this, _SpoListViewFieldSetCommand_instances, "m", _SpoListViewFieldSetCommand_initValidators).call(this);
29
+ __classPrivateFieldGet(this, _SpoListViewFieldSetCommand_instances, "m", _SpoListViewFieldSetCommand_initOptionSets).call(this);
29
30
  }
30
31
  get name() {
31
32
  return commands_1.default.LIST_VIEW_FIELD_SET;
@@ -128,26 +129,10 @@ _SpoListViewFieldSetCommand_instances = new WeakSet(), _SpoListViewFieldSetComma
128
129
  if (isNaN(position)) {
129
130
  return `${args.options.position} is not a number`;
130
131
  }
131
- if (args.options.listId && args.options.listTitle) {
132
- return 'Specify listId or listTitle, but not both';
133
- }
134
- if (!args.options.listId && !args.options.listTitle) {
135
- return 'Specify listId or listTitle, one is required';
136
- }
137
- if (args.options.viewId && args.options.viewTitle) {
138
- return 'Specify viewId or viewTitle, but not both';
139
- }
140
- if (!args.options.viewId && !args.options.viewTitle) {
141
- return 'Specify viewId or viewTitle, one is required';
142
- }
143
- if (args.options.id && args.options.title) {
144
- return 'Specify id or title, but not both';
145
- }
146
- if (!args.options.id && !args.options.title) {
147
- return 'Specify id or title, one is required';
148
- }
149
132
  return true;
150
133
  }));
134
+ }, _SpoListViewFieldSetCommand_initOptionSets = function _SpoListViewFieldSetCommand_initOptionSets() {
135
+ this.optionSets.push(['listId', 'listTitle'], ['viewId', 'viewTitle'], ['id', 'title']);
151
136
  };
152
137
  module.exports = new SpoListViewFieldSetCommand();
153
138
  //# sourceMappingURL=list-view-field-set.js.map
@@ -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 _SpoListViewGetCommand_instances, _SpoListViewGetCommand_initTelemetry, _SpoListViewGetCommand_initOptions, _SpoListViewGetCommand_initValidators;
16
+ var _SpoListViewGetCommand_instances, _SpoListViewGetCommand_initTelemetry, _SpoListViewGetCommand_initOptions, _SpoListViewGetCommand_initValidators, _SpoListViewGetCommand_initOptionSets;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  const request_1 = require("../../../../request");
19
19
  const utils_1 = require("../../../../utils");
@@ -26,6 +26,7 @@ class SpoListViewGetCommand extends SpoCommand_1.default {
26
26
  __classPrivateFieldGet(this, _SpoListViewGetCommand_instances, "m", _SpoListViewGetCommand_initTelemetry).call(this);
27
27
  __classPrivateFieldGet(this, _SpoListViewGetCommand_instances, "m", _SpoListViewGetCommand_initOptions).call(this);
28
28
  __classPrivateFieldGet(this, _SpoListViewGetCommand_instances, "m", _SpoListViewGetCommand_initValidators).call(this);
29
+ __classPrivateFieldGet(this, _SpoListViewGetCommand_instances, "m", _SpoListViewGetCommand_initOptionSets).call(this);
29
30
  }
30
31
  get name() {
31
32
  return commands_1.default.LIST_VIEW_GET;
@@ -92,25 +93,18 @@ _SpoListViewGetCommand_instances = new WeakSet(), _SpoListViewGetCommand_initTel
92
93
  if (isValidSharePointUrl !== true) {
93
94
  return isValidSharePointUrl;
94
95
  }
95
- if (!args.options.listId && !args.options.listTitle && !args.options.listUrl) {
96
- return `Specify listId, listTitle or listUrl`;
97
- }
98
96
  if (args.options.listId &&
99
97
  !utils_1.validation.isValidGuid(args.options.listId)) {
100
98
  return `${args.options.listId} in option listId is not a valid GUID`;
101
99
  }
102
- if (!args.options.id && !args.options.title) {
103
- return `Specify id or title`;
104
- }
105
- if (args.options.id && args.options.title) {
106
- return `Specify id or title but not both`;
107
- }
108
100
  if (args.options.id &&
109
101
  !utils_1.validation.isValidGuid(args.options.id)) {
110
102
  return `${args.options.id} in option id is not a valid GUID`;
111
103
  }
112
104
  return true;
113
105
  }));
106
+ }, _SpoListViewGetCommand_initOptionSets = function _SpoListViewGetCommand_initOptionSets() {
107
+ this.optionSets.push(['listId', 'listTitle', 'listUrl'], ['id', 'title']);
114
108
  };
115
109
  module.exports = new SpoListViewGetCommand();
116
110
  //# sourceMappingURL=list-view-get.js.map
@@ -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 _SpoListViewListCommand_instances, _SpoListViewListCommand_initTelemetry, _SpoListViewListCommand_initOptions, _SpoListViewListCommand_initValidators;
16
+ var _SpoListViewListCommand_instances, _SpoListViewListCommand_initTelemetry, _SpoListViewListCommand_initOptions, _SpoListViewListCommand_initValidators, _SpoListViewListCommand_initOptionSets;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  const request_1 = require("../../../../request");
19
19
  const utils_1 = require("../../../../utils");
@@ -26,6 +26,7 @@ class SpoListViewListCommand extends SpoCommand_1.default {
26
26
  __classPrivateFieldGet(this, _SpoListViewListCommand_instances, "m", _SpoListViewListCommand_initTelemetry).call(this);
27
27
  __classPrivateFieldGet(this, _SpoListViewListCommand_instances, "m", _SpoListViewListCommand_initOptions).call(this);
28
28
  __classPrivateFieldGet(this, _SpoListViewListCommand_instances, "m", _SpoListViewListCommand_initValidators).call(this);
29
+ __classPrivateFieldGet(this, _SpoListViewListCommand_instances, "m", _SpoListViewListCommand_initOptionSets).call(this);
29
30
  }
30
31
  get name() {
31
32
  return commands_1.default.LIST_VIEW_LIST;
@@ -89,14 +90,10 @@ _SpoListViewListCommand_instances = new WeakSet(), _SpoListViewListCommand_initT
89
90
  return `${args.options.listId} is not a valid GUID`;
90
91
  }
91
92
  }
92
- if (args.options.listId && args.options.listTitle) {
93
- return 'Specify listId or listTitle, but not both';
94
- }
95
- if (!args.options.listId && !args.options.listTitle) {
96
- return 'Specify listId or listTitle, one is required';
97
- }
98
93
  return true;
99
94
  }));
95
+ }, _SpoListViewListCommand_initOptionSets = function _SpoListViewListCommand_initOptionSets() {
96
+ this.optionSets.push(['listId', 'listTitle']);
100
97
  };
101
98
  module.exports = new SpoListViewListCommand();
102
99
  //# sourceMappingURL=list-view-list.js.map
@@ -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 _SpoListViewRemoveCommand_instances, _SpoListViewRemoveCommand_initTelemetry, _SpoListViewRemoveCommand_initOptions, _SpoListViewRemoveCommand_initValidators;
16
+ var _SpoListViewRemoveCommand_instances, _SpoListViewRemoveCommand_initTelemetry, _SpoListViewRemoveCommand_initOptions, _SpoListViewRemoveCommand_initValidators, _SpoListViewRemoveCommand_initOptionSets;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  const cli_1 = require("../../../../cli");
19
19
  const request_1 = require("../../../../request");
@@ -27,6 +27,7 @@ class SpoListViewRemoveCommand extends SpoCommand_1.default {
27
27
  __classPrivateFieldGet(this, _SpoListViewRemoveCommand_instances, "m", _SpoListViewRemoveCommand_initTelemetry).call(this);
28
28
  __classPrivateFieldGet(this, _SpoListViewRemoveCommand_instances, "m", _SpoListViewRemoveCommand_initOptions).call(this);
29
29
  __classPrivateFieldGet(this, _SpoListViewRemoveCommand_instances, "m", _SpoListViewRemoveCommand_initValidators).call(this);
30
+ __classPrivateFieldGet(this, _SpoListViewRemoveCommand_instances, "m", _SpoListViewRemoveCommand_initOptionSets).call(this);
30
31
  }
31
32
  get name() {
32
33
  return commands_1.default.LIST_VIEW_REMOVE;
@@ -120,20 +121,10 @@ _SpoListViewRemoveCommand_instances = new WeakSet(), _SpoListViewRemoveCommand_i
120
121
  return `${args.options.id} is not a valid GUID`;
121
122
  }
122
123
  }
123
- if (args.options.listId && args.options.listTitle) {
124
- return 'Specify listId or listTitle, but not both';
125
- }
126
- if (!args.options.listId && !args.options.listTitle) {
127
- return 'Specify listId or listTitle, one is required';
128
- }
129
- if (args.options.id && args.options.title) {
130
- return 'Specify id or title, but not both';
131
- }
132
- if (!args.options.id && !args.options.title) {
133
- return 'Specify id or title, one is required';
134
- }
135
124
  return true;
136
125
  }));
126
+ }, _SpoListViewRemoveCommand_initOptionSets = function _SpoListViewRemoveCommand_initOptionSets() {
127
+ this.optionSets.push(['listId', 'listTitle'], ['id', 'title']);
137
128
  };
138
129
  module.exports = new SpoListViewRemoveCommand();
139
130
  //# sourceMappingURL=list-view-remove.js.map