@pnp/cli-microsoft365 6.0.0-beta.ed1cc4a → 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 (170) hide show
  1. package/dist/cli/Cli.js +1 -1
  2. package/dist/m365/aad/commands/app/app-add.js +4 -4
  3. package/dist/m365/aad/commands/app/app-get.js +4 -11
  4. package/dist/m365/aad/commands/app/app-remove.js +4 -11
  5. package/dist/m365/aad/commands/app/app-role-add.js +5 -10
  6. package/dist/m365/aad/commands/app/app-role-list.js +4 -24
  7. package/dist/m365/aad/commands/app/app-role-remove.js +4 -22
  8. package/dist/m365/aad/commands/app/app-set.js +4 -11
  9. package/dist/m365/aad/commands/approleassignment/approleassignment-add.js +4 -8
  10. package/dist/m365/aad/commands/approleassignment/approleassignment-list.js +4 -11
  11. package/dist/m365/aad/commands/approleassignment/approleassignment-remove.js +4 -8
  12. package/dist/m365/aad/commands/groupsettingtemplate/groupsettingtemplate-get.js +4 -7
  13. package/dist/m365/aad/commands/o365group/o365group-conversation-post-list.js +4 -8
  14. package/dist/m365/aad/commands/o365group/o365group-recyclebinitem-restore.js +0 -3
  15. package/dist/m365/aad/commands/o365group/o365group-teamify.js +4 -7
  16. package/dist/m365/aad/commands/o365group/o365group-user-add.js +4 -7
  17. package/dist/m365/aad/commands/o365group/o365group-user-remove.js +4 -7
  18. package/dist/m365/aad/commands/o365group/o365group-user-set.js +4 -7
  19. package/dist/m365/aad/commands/sp/sp-add.js +4 -8
  20. package/dist/m365/aad/commands/sp/sp-get.js +4 -8
  21. package/dist/m365/aad/commands/user/user-get.js +4 -9
  22. package/dist/m365/aad/commands/user/user-list.js +13 -2
  23. package/dist/m365/aad/commands/user/user-set.js +4 -7
  24. package/dist/m365/aad/commands.js +0 -1
  25. package/dist/m365/commands/commands.js +1 -0
  26. package/dist/m365/commands/request.js +153 -0
  27. package/dist/m365/graph/Changelog.js +3 -0
  28. package/dist/m365/graph/commands/changelog/changelog-list.js +160 -0
  29. package/dist/m365/graph/commands.js +1 -0
  30. package/dist/m365/onenote/commands/notebook/notebook-list.js +139 -0
  31. package/dist/m365/onenote/commands.js +7 -0
  32. package/dist/m365/outlook/commands/mail/mail-send.js +22 -6
  33. package/dist/m365/outlook/commands/message/message-list.js +4 -23
  34. package/dist/m365/outlook/commands/message/message-move.js +4 -31
  35. package/dist/m365/outlook/commands.js +1 -2
  36. package/dist/m365/pa/commands/app/app-get.js +4 -7
  37. package/dist/m365/planner/commands/bucket/bucket-add.js +4 -7
  38. package/dist/m365/planner/commands/bucket/bucket-list.js +4 -7
  39. package/dist/m365/planner/commands/plan/plan-add.js +4 -7
  40. package/dist/m365/planner/commands/plan/plan-list.js +4 -7
  41. package/dist/m365/planner/commands/task/task-add.js +4 -13
  42. package/dist/m365/planner/commands/task/task-get.js +7 -0
  43. package/dist/m365/pp/commands/environment/environment-list.js +1 -1
  44. package/dist/m365/pp/commands/managementapp/managementapp-add.js +4 -11
  45. package/dist/m365/spfx/commands/project/project-doctor/doctor-1.16.0-beta.1.js +23 -0
  46. package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
  47. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN010008_YORC_nodeVersion.js +47 -0
  48. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN021003_PKG_engines_node.js +48 -0
  49. package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.16.0-beta.1.js +61 -0
  50. package/dist/m365/spfx/commands/project/project-upgrade.js +16 -13
  51. package/dist/m365/spfx/commands/spfx-doctor.js +90 -79
  52. package/dist/m365/spo/commands/app/app-deploy.js +4 -7
  53. package/dist/m365/spo/commands/app/app-get.js +4 -7
  54. package/dist/m365/spo/commands/contenttype/contenttype-get.js +4 -7
  55. package/dist/m365/spo/commands/contenttype/contenttype-remove.js +5 -14
  56. package/dist/m365/spo/commands/field/field-set.js +2 -9
  57. package/dist/m365/spo/commands/file/file-checkin.js +4 -7
  58. package/dist/m365/spo/commands/file/file-checkout.js +4 -7
  59. package/dist/m365/spo/commands/file/file-get.js +4 -7
  60. package/dist/m365/spo/commands/file/file-remove.js +4 -7
  61. package/dist/m365/spo/commands/file/file-sharinginfo-get.js +4 -7
  62. package/dist/m365/spo/commands/group/group-remove.js +4 -7
  63. package/dist/m365/spo/commands/group/group-user-add.js +4 -13
  64. package/dist/m365/spo/commands/group/group-user-list.js +4 -7
  65. package/dist/m365/spo/commands/group/group-user-remove.js +4 -7
  66. package/dist/m365/spo/commands/hubsite/hubsite-unregister.js +1 -1
  67. package/dist/m365/spo/commands/list/list-contenttype-add.js +4 -7
  68. package/dist/m365/spo/commands/list/list-contenttype-default-set.js +4 -7
  69. package/dist/m365/spo/commands/list/list-contenttype-list.js +4 -7
  70. package/dist/m365/spo/commands/list/list-contenttype-remove.js +4 -7
  71. package/dist/m365/spo/commands/list/list-get.js +4 -7
  72. package/dist/m365/spo/commands/list/list-label-get.js +4 -7
  73. package/dist/m365/spo/commands/list/list-label-set.js +4 -4
  74. package/dist/m365/spo/commands/list/list-remove.js +4 -7
  75. package/dist/m365/spo/commands/list/list-roleassignment-add.js +9 -0
  76. package/dist/m365/spo/commands/list/list-roleassignment-remove.js +57 -28
  77. package/dist/m365/spo/commands/list/list-roleinheritance-break.js +46 -21
  78. package/dist/m365/spo/commands/list/list-roleinheritance-reset.js +42 -17
  79. package/dist/m365/spo/commands/list/list-sitescript-get.js +4 -7
  80. package/dist/m365/spo/commands/list/list-view-field-add.js +4 -19
  81. package/dist/m365/spo/commands/list/list-view-field-remove.js +4 -19
  82. package/dist/m365/spo/commands/list/list-view-field-set.js +4 -19
  83. package/dist/m365/spo/commands/list/list-view-get.js +4 -10
  84. package/dist/m365/spo/commands/list/list-view-list.js +4 -7
  85. package/dist/m365/spo/commands/list/list-view-remove.js +4 -13
  86. package/dist/m365/spo/commands/list/list-view-set.js +4 -13
  87. package/dist/m365/spo/commands/list/list-webhook-add.js +4 -7
  88. package/dist/m365/spo/commands/list/list-webhook-get.js +4 -7
  89. package/dist/m365/spo/commands/list/list-webhook-remove.js +4 -7
  90. package/dist/m365/spo/commands/list/list-webhook-set.js +4 -7
  91. package/dist/m365/spo/commands/listitem/listitem-add.js +4 -7
  92. package/dist/m365/spo/commands/listitem/listitem-attachment-list.js +4 -7
  93. package/dist/m365/spo/commands/listitem/listitem-get.js +4 -7
  94. package/dist/m365/spo/commands/listitem/listitem-isrecord.js +4 -7
  95. package/dist/m365/spo/commands/listitem/listitem-record-declare.js +4 -7
  96. package/dist/m365/spo/commands/listitem/listitem-record-undeclare.js +4 -7
  97. package/dist/m365/spo/commands/listitem/listitem-remove.js +4 -7
  98. package/dist/m365/spo/commands/listitem/listitem-roleassignment-remove.js +206 -0
  99. package/dist/m365/spo/commands/listitem/listitem-roleinheritance-break.js +46 -21
  100. package/dist/m365/spo/commands/listitem/listitem-roleinheritance-reset.js +45 -17
  101. package/dist/m365/spo/commands/listitem/listitem-set.js +4 -7
  102. package/dist/m365/spo/commands/site/site-apppermission-add.js +4 -4
  103. package/dist/m365/spo/commands/site/site-apppermission-remove.js +4 -9
  104. package/dist/m365/spo/commands/site/site-apppermission-set.js +4 -4
  105. package/dist/m365/spo/commands/term/term-add.js +4 -7
  106. package/dist/m365/spo/commands/term/term-get.js +4 -7
  107. package/dist/m365/spo/commands/term/term-group-get.js +4 -7
  108. package/dist/m365/spo/commands/term/term-list.js +4 -13
  109. package/dist/m365/spo/commands/term/term-set-add.js +4 -7
  110. package/dist/m365/spo/commands/term/term-set-get.js +4 -13
  111. package/dist/m365/spo/commands/term/term-set-list.js +4 -7
  112. package/dist/m365/spo/commands/user/user-get.js +4 -9
  113. package/dist/m365/spo/commands/user/user-remove.js +4 -7
  114. package/dist/m365/spo/commands/web/web-roleassignment-add.js +187 -0
  115. package/dist/m365/spo/commands/web/web-roleassignment-remove.js +170 -0
  116. package/dist/m365/spo/commands/web/web-roleinheritance-reset.js +43 -13
  117. package/dist/m365/spo/commands.js +3 -0
  118. package/dist/m365/teams/commands/app/app-install.js +4 -11
  119. package/dist/m365/teams/commands/app/app-update.js +4 -7
  120. package/dist/m365/teams/commands/channel/channel-add.js +4 -7
  121. package/dist/m365/teams/commands/channel/channel-get.js +4 -22
  122. package/dist/m365/teams/commands/channel/channel-list.js +4 -7
  123. package/dist/m365/teams/commands/channel/channel-member-add.js +0 -4
  124. package/dist/m365/teams/commands/channel/channel-member-list.js +4 -17
  125. package/dist/m365/teams/commands/channel/channel-member-remove.js +0 -4
  126. package/dist/m365/teams/commands/channel/channel-member-set.js +4 -21
  127. package/dist/m365/teams/commands/channel/channel-remove.js +4 -7
  128. package/dist/m365/teams/commands/chat/chat-get.js +4 -17
  129. package/dist/m365/teams/commands/chat/chat-message-send.js +4 -17
  130. package/dist/m365/teams/commands/tab/tab-get.js +6 -21
  131. package/dist/m365/teams/commands/team/team-get.js +4 -7
  132. package/dist/m365/teams/commands/user/user-app-list.js +4 -7
  133. package/dist/m365/teams/commands.js +0 -3
  134. package/dist/m365/todo/commands/list/list-remove.js +4 -21
  135. package/dist/m365/todo/commands/list/list-set.js +4 -21
  136. package/dist/m365/todo/commands/task/task-add.js +4 -21
  137. package/dist/m365/todo/commands/task/task-list.js +4 -21
  138. package/dist/m365/todo/commands/task/task-remove.js +4 -21
  139. package/dist/m365/todo/commands/task/task-set.js +4 -7
  140. package/dist/request.js +6 -2
  141. package/dist/utils/fsUtil.js +2 -4
  142. package/dist/utils/md.js +1 -1
  143. package/docs/docs/cmd/aad/o365group/o365group-recyclebinitem-restore.md +1 -7
  144. package/docs/docs/cmd/adaptivecard/adaptivecard-send.md +0 -20
  145. package/docs/docs/cmd/graph/changelog/changelog-list.md +53 -0
  146. package/docs/docs/cmd/onenote/notebook/notebook-list.md +70 -0
  147. package/docs/docs/cmd/outlook/mail/mail-send.md +45 -8
  148. package/docs/docs/cmd/pp/environment/environment-list.md +1 -1
  149. package/docs/docs/cmd/request.md +76 -0
  150. package/docs/docs/cmd/spfx/project/project-upgrade.md +1 -1
  151. package/docs/docs/cmd/spfx/spfx-doctor.md +3 -3
  152. package/docs/docs/cmd/spo/field/field-set.md +0 -3
  153. package/docs/docs/cmd/spo/hubsite/hubsite-unregister.md +2 -2
  154. package/docs/docs/cmd/spo/list/list-roleassignment-add.md +2 -2
  155. package/docs/docs/cmd/spo/list/list-roleassignment-remove.md +5 -2
  156. package/docs/docs/cmd/spo/list/list-roleinheritance-break.md +9 -0
  157. package/docs/docs/cmd/spo/list/list-roleinheritance-reset.md +9 -0
  158. package/docs/docs/cmd/spo/listitem/listitem-roleassignment-remove.md +67 -0
  159. package/docs/docs/cmd/spo/listitem/listitem-roleinheritance-break.md +15 -6
  160. package/docs/docs/cmd/spo/listitem/listitem-roleinheritance-reset.md +9 -0
  161. package/docs/docs/cmd/spo/site/site-add.md +2 -2
  162. package/docs/docs/cmd/spo/site/site-groupify.md +0 -6
  163. package/docs/docs/cmd/spo/web/web-roleassignment-add.md +57 -0
  164. package/docs/docs/cmd/spo/web/web-roleassignment-remove.md +54 -0
  165. package/docs/docs/cmd/spo/web/web-roleinheritance-reset.md +9 -0
  166. package/docs/docs/cmd/teams/channel/channel-member-add.md +0 -6
  167. package/docs/docs/cmd/teams/channel/channel-member-list.md +0 -6
  168. package/docs/docs/cmd/teams/channel/channel-member-remove.md +0 -6
  169. package/package.json +2 -1
  170. package/scripts/Register-CLIM365Completion.ps1 +1 -1
@@ -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 _SpoListContentTypeListCommand_instances, _SpoListContentTypeListCommand_initTelemetry, _SpoListContentTypeListCommand_initOptions, _SpoListContentTypeListCommand_initValidators;
16
+ var _SpoListContentTypeListCommand_instances, _SpoListContentTypeListCommand_initTelemetry, _SpoListContentTypeListCommand_initOptions, _SpoListContentTypeListCommand_initValidators, _SpoListContentTypeListCommand_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 SpoListContentTypeListCommand extends SpoCommand_1.default {
26
26
  __classPrivateFieldGet(this, _SpoListContentTypeListCommand_instances, "m", _SpoListContentTypeListCommand_initTelemetry).call(this);
27
27
  __classPrivateFieldGet(this, _SpoListContentTypeListCommand_instances, "m", _SpoListContentTypeListCommand_initOptions).call(this);
28
28
  __classPrivateFieldGet(this, _SpoListContentTypeListCommand_instances, "m", _SpoListContentTypeListCommand_initValidators).call(this);
29
+ __classPrivateFieldGet(this, _SpoListContentTypeListCommand_instances, "m", _SpoListContentTypeListCommand_initOptionSets).call(this);
29
30
  }
30
31
  get name() {
31
32
  return commands_1.default.LIST_CONTENTTYPE_LIST;
@@ -90,14 +91,10 @@ _SpoListContentTypeListCommand_instances = new WeakSet(), _SpoListContentTypeLis
90
91
  return `${args.options.listId} is not a valid GUID`;
91
92
  }
92
93
  }
93
- if (args.options.listId && args.options.listTitle) {
94
- return 'Specify listId or listTitle, but not both';
95
- }
96
- if (!args.options.listId && !args.options.listTitle) {
97
- return 'Specify listId or listTitle, one is required';
98
- }
99
94
  return true;
100
95
  }));
96
+ }, _SpoListContentTypeListCommand_initOptionSets = function _SpoListContentTypeListCommand_initOptionSets() {
97
+ this.optionSets.push(['listId', 'listTitle']);
101
98
  };
102
99
  module.exports = new SpoListContentTypeListCommand();
103
100
  //# sourceMappingURL=list-contenttype-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 _SpoListContentTypeRemoveCommand_instances, _SpoListContentTypeRemoveCommand_initTelemetry, _SpoListContentTypeRemoveCommand_initOptions, _SpoListContentTypeRemoveCommand_initValidators, _SpoListContentTypeRemoveCommand_initTypes;
16
+ var _SpoListContentTypeRemoveCommand_instances, _SpoListContentTypeRemoveCommand_initTelemetry, _SpoListContentTypeRemoveCommand_initOptions, _SpoListContentTypeRemoveCommand_initValidators, _SpoListContentTypeRemoveCommand_initTypes, _SpoListContentTypeRemoveCommand_initOptionSets;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  const cli_1 = require("../../../../cli");
19
19
  const request_1 = require("../../../../request");
@@ -28,6 +28,7 @@ class SpoListContentTypeRemoveCommand extends SpoCommand_1.default {
28
28
  __classPrivateFieldGet(this, _SpoListContentTypeRemoveCommand_instances, "m", _SpoListContentTypeRemoveCommand_initOptions).call(this);
29
29
  __classPrivateFieldGet(this, _SpoListContentTypeRemoveCommand_instances, "m", _SpoListContentTypeRemoveCommand_initValidators).call(this);
30
30
  __classPrivateFieldGet(this, _SpoListContentTypeRemoveCommand_instances, "m", _SpoListContentTypeRemoveCommand_initTypes).call(this);
31
+ __classPrivateFieldGet(this, _SpoListContentTypeRemoveCommand_instances, "m", _SpoListContentTypeRemoveCommand_initOptionSets).call(this);
31
32
  }
32
33
  get name() {
33
34
  return commands_1.default.LIST_CONTENTTYPE_REMOVE;
@@ -115,16 +116,12 @@ _SpoListContentTypeRemoveCommand_instances = new WeakSet(), _SpoListContentTypeR
115
116
  return `${args.options.listId} is not a valid GUID`;
116
117
  }
117
118
  }
118
- if (args.options.listId && args.options.listTitle) {
119
- return 'Specify listId or listTitle, but not both';
120
- }
121
- if (!args.options.listId && !args.options.listTitle) {
122
- return 'Specify listId or listTitle, one is required';
123
- }
124
119
  return true;
125
120
  }));
126
121
  }, _SpoListContentTypeRemoveCommand_initTypes = function _SpoListContentTypeRemoveCommand_initTypes() {
127
122
  this.types.string.push('id', 'i');
123
+ }, _SpoListContentTypeRemoveCommand_initOptionSets = function _SpoListContentTypeRemoveCommand_initOptionSets() {
124
+ this.optionSets.push(['listId', 'listTitle']);
128
125
  };
129
126
  module.exports = new SpoListContentTypeRemoveCommand();
130
127
  //# sourceMappingURL=list-contenttype-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 _SpoListGetCommand_instances, _SpoListGetCommand_initTelemetry, _SpoListGetCommand_initOptions, _SpoListGetCommand_initValidators;
16
+ var _SpoListGetCommand_instances, _SpoListGetCommand_initTelemetry, _SpoListGetCommand_initOptions, _SpoListGetCommand_initValidators, _SpoListGetCommand_initOptionSets;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  const request_1 = require("../../../../request");
19
19
  const utils_1 = require("../../../../utils");
@@ -27,6 +27,7 @@ class SpoListGetCommand extends SpoCommand_1.default {
27
27
  __classPrivateFieldGet(this, _SpoListGetCommand_instances, "m", _SpoListGetCommand_initTelemetry).call(this);
28
28
  __classPrivateFieldGet(this, _SpoListGetCommand_instances, "m", _SpoListGetCommand_initOptions).call(this);
29
29
  __classPrivateFieldGet(this, _SpoListGetCommand_instances, "m", _SpoListGetCommand_initValidators).call(this);
30
+ __classPrivateFieldGet(this, _SpoListGetCommand_instances, "m", _SpoListGetCommand_initOptionSets).call(this);
30
31
  }
31
32
  get name() {
32
33
  return commands_1.default.LIST_GET;
@@ -99,14 +100,10 @@ _SpoListGetCommand_instances = new WeakSet(), _SpoListGetCommand_initTelemetry =
99
100
  return `${args.options.id} is not a valid GUID`;
100
101
  }
101
102
  }
102
- if (args.options.id && args.options.title) {
103
- return 'Specify id or title, but not both';
104
- }
105
- if (!args.options.id && !args.options.title) {
106
- return 'Specify id or title, one is required';
107
- }
108
103
  return true;
109
104
  }));
105
+ }, _SpoListGetCommand_initOptionSets = function _SpoListGetCommand_initOptionSets() {
106
+ this.optionSets.push(['id', 'title']);
110
107
  };
111
108
  module.exports = new SpoListGetCommand();
112
109
  //# sourceMappingURL=list-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 _SpoListLabelGetCommand_instances, _SpoListLabelGetCommand_initTelemetry, _SpoListLabelGetCommand_initOptions, _SpoListLabelGetCommand_initValidators;
16
+ var _SpoListLabelGetCommand_instances, _SpoListLabelGetCommand_initTelemetry, _SpoListLabelGetCommand_initOptions, _SpoListLabelGetCommand_initValidators, _SpoListLabelGetCommand_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 SpoListLabelGetCommand extends SpoCommand_1.default {
26
26
  __classPrivateFieldGet(this, _SpoListLabelGetCommand_instances, "m", _SpoListLabelGetCommand_initTelemetry).call(this);
27
27
  __classPrivateFieldGet(this, _SpoListLabelGetCommand_instances, "m", _SpoListLabelGetCommand_initOptions).call(this);
28
28
  __classPrivateFieldGet(this, _SpoListLabelGetCommand_instances, "m", _SpoListLabelGetCommand_initValidators).call(this);
29
+ __classPrivateFieldGet(this, _SpoListLabelGetCommand_instances, "m", _SpoListLabelGetCommand_initOptionSets).call(this);
29
30
  }
30
31
  get name() {
31
32
  return commands_1.default.LIST_LABEL_GET;
@@ -112,14 +113,10 @@ _SpoListLabelGetCommand_instances = new WeakSet(), _SpoListLabelGetCommand_initT
112
113
  return `${args.options.listId} is not a valid GUID`;
113
114
  }
114
115
  }
115
- if (args.options.listId && args.options.listTitle) {
116
- return 'Specify listId or listTitle, but not both';
117
- }
118
- if (!args.options.listId && !args.options.listTitle) {
119
- return 'Specify listId or listTitle, one is required';
120
- }
121
116
  return true;
122
117
  }));
118
+ }, _SpoListLabelGetCommand_initOptionSets = function _SpoListLabelGetCommand_initOptionSets() {
119
+ this.optionSets.push(['listId', 'listTitle']);
123
120
  };
124
121
  module.exports = new SpoListLabelGetCommand();
125
122
  //# sourceMappingURL=list-label-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 _SpoListLabelSetCommand_instances, _SpoListLabelSetCommand_initTelemetry, _SpoListLabelSetCommand_initOptions, _SpoListLabelSetCommand_initValidators;
16
+ var _SpoListLabelSetCommand_instances, _SpoListLabelSetCommand_initTelemetry, _SpoListLabelSetCommand_initOptions, _SpoListLabelSetCommand_initValidators, _SpoListLabelSetCommand_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 SpoListLabelSetCommand extends SpoCommand_1.default {
26
26
  __classPrivateFieldGet(this, _SpoListLabelSetCommand_instances, "m", _SpoListLabelSetCommand_initTelemetry).call(this);
27
27
  __classPrivateFieldGet(this, _SpoListLabelSetCommand_instances, "m", _SpoListLabelSetCommand_initOptions).call(this);
28
28
  __classPrivateFieldGet(this, _SpoListLabelSetCommand_instances, "m", _SpoListLabelSetCommand_initValidators).call(this);
29
+ __classPrivateFieldGet(this, _SpoListLabelSetCommand_instances, "m", _SpoListLabelSetCommand_initOptionSets).call(this);
29
30
  }
30
31
  get name() {
31
32
  return commands_1.default.LIST_LABEL_SET;
@@ -112,14 +113,13 @@ _SpoListLabelSetCommand_instances = new WeakSet(), _SpoListLabelSetCommand_initT
112
113
  });
113
114
  }, _SpoListLabelSetCommand_initValidators = function _SpoListLabelSetCommand_initValidators() {
114
115
  this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
115
- if (!args.options.listId && !args.options.listTitle && !args.options.listUrl) {
116
- return `Specify listId or listTitle or listUrl.`;
117
- }
118
116
  if (args.options.listId && !utils_1.validation.isValidGuid(args.options.listId)) {
119
117
  return `${args.options.listId} is not a valid GUID`;
120
118
  }
121
119
  return utils_1.validation.isValidSharePointUrl(args.options.webUrl);
122
120
  }));
121
+ }, _SpoListLabelSetCommand_initOptionSets = function _SpoListLabelSetCommand_initOptionSets() {
122
+ this.optionSets.push(['listId', 'listTitle', 'listUrl']);
123
123
  };
124
124
  module.exports = new SpoListLabelSetCommand();
125
125
  //# sourceMappingURL=list-label-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 _SpoListRemoveCommand_instances, _SpoListRemoveCommand_initTelemetry, _SpoListRemoveCommand_initOptions, _SpoListRemoveCommand_initValidators;
16
+ var _SpoListRemoveCommand_instances, _SpoListRemoveCommand_initTelemetry, _SpoListRemoveCommand_initOptions, _SpoListRemoveCommand_initValidators, _SpoListRemoveCommand_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 SpoListRemoveCommand extends SpoCommand_1.default {
27
27
  __classPrivateFieldGet(this, _SpoListRemoveCommand_instances, "m", _SpoListRemoveCommand_initTelemetry).call(this);
28
28
  __classPrivateFieldGet(this, _SpoListRemoveCommand_instances, "m", _SpoListRemoveCommand_initOptions).call(this);
29
29
  __classPrivateFieldGet(this, _SpoListRemoveCommand_instances, "m", _SpoListRemoveCommand_initValidators).call(this);
30
+ __classPrivateFieldGet(this, _SpoListRemoveCommand_instances, "m", _SpoListRemoveCommand_initOptionSets).call(this);
30
31
  }
31
32
  get name() {
32
33
  return commands_1.default.LIST_REMOVE;
@@ -111,14 +112,10 @@ _SpoListRemoveCommand_instances = new WeakSet(), _SpoListRemoveCommand_initTelem
111
112
  !utils_1.validation.isValidGuid(args.options.id)) {
112
113
  return `${args.options.id} is not a valid GUID`;
113
114
  }
114
- if (args.options.id && args.options.title) {
115
- return 'Specify id or title, but not both';
116
- }
117
- if (!args.options.id && !args.options.title) {
118
- return 'Specify id or title';
119
- }
120
115
  return true;
121
116
  }));
117
+ }, _SpoListRemoveCommand_initOptionSets = function _SpoListRemoveCommand_initOptionSets() {
118
+ this.optionSets.push(['id', 'title']);
122
119
  };
123
120
  module.exports = new SpoListRemoveCommand();
124
121
  //# sourceMappingURL=list-remove.js.map
@@ -193,14 +193,23 @@ _SpoListRoleAssignmentAddCommand_instances = new WeakSet(), _SpoListRoleAssignme
193
193
  if (listOptions.some(item => item !== undefined) && listOptions.filter(item => item !== undefined).length > 1) {
194
194
  return `Specify either list id or title or list url`;
195
195
  }
196
+ if (listOptions.filter(item => item !== undefined).length === 0) {
197
+ return `Specify at least list id or title or list url`;
198
+ }
196
199
  const principalOptions = [args.options.principalId, args.options.upn, args.options.groupName];
197
200
  if (principalOptions.some(item => item !== undefined) && principalOptions.filter(item => item !== undefined).length > 1) {
198
201
  return `Specify either principalId id or upn or groupName`;
199
202
  }
203
+ if (principalOptions.filter(item => item !== undefined).length === 0) {
204
+ return `Specify at least principalId id or upn or groupName`;
205
+ }
200
206
  const roleDefinitionOptions = [args.options.roleDefinitionId, args.options.roleDefinitionName];
201
207
  if (roleDefinitionOptions.some(item => item !== undefined) && roleDefinitionOptions.filter(item => item !== undefined).length > 1) {
202
208
  return `Specify either roleDefinitionId id or roleDefinitionName`;
203
209
  }
210
+ if (roleDefinitionOptions.filter(item => item !== undefined).length === 0) {
211
+ return `Specify at least roleDefinitionId id or roleDefinitionName`;
212
+ }
204
213
  return true;
205
214
  }));
206
215
  };
@@ -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