@pnp/cli-microsoft365 5.7.0 → 5.8.0-beta.29e39ab

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 (143) hide show
  1. package/dist/cli/Cli.js +1 -1
  2. package/dist/m365/aad/commands/app/app-get.js +4 -11
  3. package/dist/m365/aad/commands/app/app-remove.js +4 -11
  4. package/dist/m365/aad/commands/app/app-role-add.js +5 -10
  5. package/dist/m365/aad/commands/app/app-role-list.js +4 -24
  6. package/dist/m365/aad/commands/app/app-role-remove.js +4 -22
  7. package/dist/m365/aad/commands/app/app-set.js +4 -11
  8. package/dist/m365/aad/commands/approleassignment/approleassignment-add.js +4 -8
  9. package/dist/m365/aad/commands/approleassignment/approleassignment-list.js +4 -11
  10. package/dist/m365/aad/commands/approleassignment/approleassignment-remove.js +4 -8
  11. package/dist/m365/aad/commands/groupsettingtemplate/groupsettingtemplate-get.js +4 -7
  12. package/dist/m365/aad/commands/o365group/o365group-conversation-post-list.js +4 -8
  13. package/dist/m365/aad/commands/o365group/o365group-teamify.js +4 -7
  14. package/dist/m365/aad/commands/o365group/o365group-user-add.js +4 -7
  15. package/dist/m365/aad/commands/o365group/o365group-user-remove.js +4 -7
  16. package/dist/m365/aad/commands/o365group/o365group-user-set.js +4 -7
  17. package/dist/m365/aad/commands/sp/sp-add.js +4 -8
  18. package/dist/m365/aad/commands/sp/sp-get.js +4 -8
  19. package/dist/m365/aad/commands/user/user-get.js +4 -9
  20. package/dist/m365/aad/commands/user/user-list.js +13 -2
  21. package/dist/m365/aad/commands/user/user-set.js +4 -7
  22. package/dist/m365/commands/commands.js +1 -0
  23. package/dist/m365/commands/request.js +153 -0
  24. package/dist/m365/graph/Changelog.js +3 -0
  25. package/dist/m365/graph/commands/changelog/changelog-list.js +160 -0
  26. package/dist/m365/graph/commands.js +1 -0
  27. package/dist/m365/onenote/commands/notebook/notebook-list.js +139 -0
  28. package/dist/m365/onenote/commands.js +7 -0
  29. package/dist/m365/outlook/commands/message/message-list.js +4 -23
  30. package/dist/m365/outlook/commands/message/message-move.js +4 -31
  31. package/dist/m365/pa/commands/app/app-get.js +4 -7
  32. package/dist/m365/planner/commands/bucket/bucket-add.js +4 -7
  33. package/dist/m365/planner/commands/bucket/bucket-list.js +4 -7
  34. package/dist/m365/planner/commands/plan/plan-add.js +4 -7
  35. package/dist/m365/planner/commands/plan/plan-list.js +4 -7
  36. package/dist/m365/planner/commands/task/task-add.js +4 -13
  37. package/dist/m365/planner/commands/task/task-get.js +7 -0
  38. package/dist/m365/pp/commands/environment/environment-list.js +1 -1
  39. package/dist/m365/pp/commands/managementapp/managementapp-add.js +4 -11
  40. package/dist/m365/spfx/commands/project/project-doctor/doctor-1.16.0-beta.1.js +23 -0
  41. package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
  42. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN010008_YORC_nodeVersion.js +47 -0
  43. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN021003_PKG_engines_node.js +48 -0
  44. package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.16.0-beta.1.js +61 -0
  45. package/dist/m365/spfx/commands/project/project-upgrade.js +16 -13
  46. package/dist/m365/spfx/commands/spfx-doctor.js +90 -79
  47. package/dist/m365/spo/commands/app/app-deploy.js +4 -7
  48. package/dist/m365/spo/commands/app/app-get.js +4 -7
  49. package/dist/m365/spo/commands/contenttype/contenttype-get.js +4 -7
  50. package/dist/m365/spo/commands/contenttype/contenttype-remove.js +5 -14
  51. package/dist/m365/spo/commands/file/file-checkin.js +4 -7
  52. package/dist/m365/spo/commands/file/file-checkout.js +4 -7
  53. package/dist/m365/spo/commands/file/file-get.js +4 -7
  54. package/dist/m365/spo/commands/file/file-remove.js +4 -7
  55. package/dist/m365/spo/commands/file/file-sharinginfo-get.js +4 -7
  56. package/dist/m365/spo/commands/group/group-remove.js +4 -7
  57. package/dist/m365/spo/commands/group/group-user-add.js +4 -13
  58. package/dist/m365/spo/commands/group/group-user-list.js +4 -7
  59. package/dist/m365/spo/commands/group/group-user-remove.js +4 -7
  60. package/dist/m365/spo/commands/hubsite/hubsite-unregister.js +1 -1
  61. package/dist/m365/spo/commands/list/list-contenttype-add.js +4 -7
  62. package/dist/m365/spo/commands/list/list-contenttype-default-set.js +4 -7
  63. package/dist/m365/spo/commands/list/list-contenttype-list.js +4 -7
  64. package/dist/m365/spo/commands/list/list-contenttype-remove.js +4 -7
  65. package/dist/m365/spo/commands/list/list-get.js +4 -7
  66. package/dist/m365/spo/commands/list/list-label-get.js +4 -7
  67. package/dist/m365/spo/commands/list/list-label-set.js +4 -4
  68. package/dist/m365/spo/commands/list/list-remove.js +4 -7
  69. package/dist/m365/spo/commands/list/list-roleassignment-add.js +9 -0
  70. package/dist/m365/spo/commands/list/list-roleassignment-remove.js +57 -28
  71. package/dist/m365/spo/commands/list/list-sitescript-get.js +4 -7
  72. package/dist/m365/spo/commands/list/list-view-field-add.js +4 -19
  73. package/dist/m365/spo/commands/list/list-view-field-remove.js +4 -19
  74. package/dist/m365/spo/commands/list/list-view-field-set.js +4 -19
  75. package/dist/m365/spo/commands/list/list-view-get.js +4 -10
  76. package/dist/m365/spo/commands/list/list-view-list.js +4 -7
  77. package/dist/m365/spo/commands/list/list-view-remove.js +4 -13
  78. package/dist/m365/spo/commands/list/list-view-set.js +4 -13
  79. package/dist/m365/spo/commands/list/list-webhook-add.js +4 -7
  80. package/dist/m365/spo/commands/list/list-webhook-get.js +4 -7
  81. package/dist/m365/spo/commands/list/list-webhook-remove.js +4 -7
  82. package/dist/m365/spo/commands/list/list-webhook-set.js +4 -7
  83. package/dist/m365/spo/commands/listitem/listitem-add.js +4 -7
  84. package/dist/m365/spo/commands/listitem/listitem-attachment-list.js +4 -7
  85. package/dist/m365/spo/commands/listitem/listitem-get.js +4 -7
  86. package/dist/m365/spo/commands/listitem/listitem-isrecord.js +4 -7
  87. package/dist/m365/spo/commands/listitem/listitem-record-declare.js +4 -7
  88. package/dist/m365/spo/commands/listitem/listitem-record-undeclare.js +4 -7
  89. package/dist/m365/spo/commands/listitem/listitem-remove.js +4 -7
  90. package/dist/m365/spo/commands/listitem/listitem-roleassignment-remove.js +206 -0
  91. package/dist/m365/spo/commands/listitem/listitem-set.js +4 -7
  92. package/dist/m365/spo/commands/site/site-apppermission-add.js +4 -4
  93. package/dist/m365/spo/commands/site/site-apppermission-remove.js +4 -9
  94. package/dist/m365/spo/commands/site/site-apppermission-set.js +4 -4
  95. package/dist/m365/spo/commands/term/term-add.js +4 -7
  96. package/dist/m365/spo/commands/term/term-get.js +4 -7
  97. package/dist/m365/spo/commands/term/term-group-get.js +4 -7
  98. package/dist/m365/spo/commands/term/term-list.js +4 -13
  99. package/dist/m365/spo/commands/term/term-set-add.js +4 -7
  100. package/dist/m365/spo/commands/term/term-set-get.js +4 -13
  101. package/dist/m365/spo/commands/term/term-set-list.js +4 -7
  102. package/dist/m365/spo/commands/user/user-get.js +4 -9
  103. package/dist/m365/spo/commands/user/user-remove.js +4 -7
  104. package/dist/m365/spo/commands/web/web-roleassignment-add.js +187 -0
  105. package/dist/m365/spo/commands/web/web-roleassignment-remove.js +170 -0
  106. package/dist/m365/spo/commands.js +3 -0
  107. package/dist/m365/teams/commands/app/app-install.js +4 -11
  108. package/dist/m365/teams/commands/app/app-update.js +4 -7
  109. package/dist/m365/teams/commands/channel/channel-add.js +4 -7
  110. package/dist/m365/teams/commands/channel/channel-get.js +4 -22
  111. package/dist/m365/teams/commands/channel/channel-list.js +4 -7
  112. package/dist/m365/teams/commands/channel/channel-member-list.js +4 -13
  113. package/dist/m365/teams/commands/channel/channel-member-set.js +4 -21
  114. package/dist/m365/teams/commands/channel/channel-remove.js +4 -7
  115. package/dist/m365/teams/commands/chat/chat-get.js +4 -17
  116. package/dist/m365/teams/commands/chat/chat-message-send.js +4 -17
  117. package/dist/m365/teams/commands/tab/tab-get.js +4 -19
  118. package/dist/m365/teams/commands/team/team-get.js +4 -7
  119. package/dist/m365/teams/commands/user/user-app-list.js +4 -7
  120. package/dist/m365/todo/commands/list/list-remove.js +4 -21
  121. package/dist/m365/todo/commands/list/list-set.js +4 -21
  122. package/dist/m365/todo/commands/task/task-add.js +4 -21
  123. package/dist/m365/todo/commands/task/task-list.js +4 -21
  124. package/dist/m365/todo/commands/task/task-remove.js +4 -21
  125. package/dist/m365/todo/commands/task/task-set.js +4 -7
  126. package/dist/request.js +6 -2
  127. package/docs/docs/cmd/adaptivecard/adaptivecard-send.md +0 -20
  128. package/docs/docs/cmd/graph/changelog/changelog-list.md +53 -0
  129. package/docs/docs/cmd/onenote/notebook/notebook-list.md +70 -0
  130. package/docs/docs/cmd/pp/environment/environment-list.md +1 -1
  131. package/docs/docs/cmd/request.md +76 -0
  132. package/docs/docs/cmd/spfx/project/project-upgrade.md +1 -1
  133. package/docs/docs/cmd/spfx/spfx-doctor.md +3 -3
  134. package/docs/docs/cmd/spo/hubsite/hubsite-unregister.md +2 -2
  135. package/docs/docs/cmd/spo/list/list-roleassignment-add.md +2 -2
  136. package/docs/docs/cmd/spo/list/list-roleassignment-remove.md +5 -2
  137. package/docs/docs/cmd/spo/listitem/listitem-roleassignment-remove.md +67 -0
  138. package/docs/docs/cmd/spo/listitem/listitem-roleinheritance-break.md +6 -6
  139. package/docs/docs/cmd/spo/web/web-roleassignment-add.md +57 -0
  140. package/docs/docs/cmd/spo/web/web-roleassignment-remove.md +54 -0
  141. package/npm-shrinkwrap.json +2 -2
  142. package/package.json +3 -2
  143. 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 _SpoListWebhookGetCommand_instances, _SpoListWebhookGetCommand_initTelemetry, _SpoListWebhookGetCommand_initOptions, _SpoListWebhookGetCommand_initValidators;
16
+ var _SpoListWebhookGetCommand_instances, _SpoListWebhookGetCommand_initTelemetry, _SpoListWebhookGetCommand_initOptions, _SpoListWebhookGetCommand_initValidators, _SpoListWebhookGetCommand_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 SpoListWebhookGetCommand extends SpoCommand_1.default {
26
26
  __classPrivateFieldGet(this, _SpoListWebhookGetCommand_instances, "m", _SpoListWebhookGetCommand_initTelemetry).call(this);
27
27
  __classPrivateFieldGet(this, _SpoListWebhookGetCommand_instances, "m", _SpoListWebhookGetCommand_initOptions).call(this);
28
28
  __classPrivateFieldGet(this, _SpoListWebhookGetCommand_instances, "m", _SpoListWebhookGetCommand_initValidators).call(this);
29
+ __classPrivateFieldGet(this, _SpoListWebhookGetCommand_instances, "m", _SpoListWebhookGetCommand_initOptionSets).call(this);
29
30
  }
30
31
  get name() {
31
32
  return commands_1.default.LIST_WEBHOOK_GET;
@@ -98,14 +99,10 @@ _SpoListWebhookGetCommand_instances = new WeakSet(), _SpoListWebhookGetCommand_i
98
99
  return `${args.options.listId} is not a valid GUID`;
99
100
  }
100
101
  }
101
- if (args.options.listId && args.options.listTitle) {
102
- return 'Specify listId or listTitle, but not both';
103
- }
104
- if (!args.options.listId && !args.options.listTitle) {
105
- return 'Specify listId or listTitle, one is required';
106
- }
107
102
  return true;
108
103
  }));
104
+ }, _SpoListWebhookGetCommand_initOptionSets = function _SpoListWebhookGetCommand_initOptionSets() {
105
+ this.optionSets.push(['listId', 'listTitle']);
109
106
  };
110
107
  module.exports = new SpoListWebhookGetCommand();
111
108
  //# sourceMappingURL=list-webhook-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 _SpoListWebhookRemoveCommand_instances, _SpoListWebhookRemoveCommand_initTelemetry, _SpoListWebhookRemoveCommand_initOptions, _SpoListWebhookRemoveCommand_initValidators;
16
+ var _SpoListWebhookRemoveCommand_instances, _SpoListWebhookRemoveCommand_initTelemetry, _SpoListWebhookRemoveCommand_initOptions, _SpoListWebhookRemoveCommand_initValidators, _SpoListWebhookRemoveCommand_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 SpoListWebhookRemoveCommand extends SpoCommand_1.default {
27
27
  __classPrivateFieldGet(this, _SpoListWebhookRemoveCommand_instances, "m", _SpoListWebhookRemoveCommand_initTelemetry).call(this);
28
28
  __classPrivateFieldGet(this, _SpoListWebhookRemoveCommand_instances, "m", _SpoListWebhookRemoveCommand_initOptions).call(this);
29
29
  __classPrivateFieldGet(this, _SpoListWebhookRemoveCommand_instances, "m", _SpoListWebhookRemoveCommand_initValidators).call(this);
30
+ __classPrivateFieldGet(this, _SpoListWebhookRemoveCommand_instances, "m", _SpoListWebhookRemoveCommand_initOptionSets).call(this);
30
31
  }
31
32
  get name() {
32
33
  return commands_1.default.LIST_WEBHOOK_REMOVE;
@@ -119,14 +120,10 @@ _SpoListWebhookRemoveCommand_instances = new WeakSet(), _SpoListWebhookRemoveCom
119
120
  return `${args.options.listId} is not a valid GUID`;
120
121
  }
121
122
  }
122
- if (args.options.listId && args.options.listTitle) {
123
- return 'Specify listId or listTitle, but not both';
124
- }
125
- if (!args.options.listId && !args.options.listTitle) {
126
- return 'Specify listId or listTitle, one is required';
127
- }
128
123
  return true;
129
124
  }));
125
+ }, _SpoListWebhookRemoveCommand_initOptionSets = function _SpoListWebhookRemoveCommand_initOptionSets() {
126
+ this.optionSets.push(['listId', 'listTitle']);
130
127
  };
131
128
  module.exports = new SpoListWebhookRemoveCommand();
132
129
  //# sourceMappingURL=list-webhook-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 _SpoListWebhookSetCommand_instances, _SpoListWebhookSetCommand_initTelemetry, _SpoListWebhookSetCommand_initOptions, _SpoListWebhookSetCommand_initValidators;
16
+ var _SpoListWebhookSetCommand_instances, _SpoListWebhookSetCommand_initTelemetry, _SpoListWebhookSetCommand_initOptions, _SpoListWebhookSetCommand_initValidators, _SpoListWebhookSetCommand_initOptionSets;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  const chalk = require("chalk");
19
19
  const request_1 = require("../../../../request");
@@ -27,6 +27,7 @@ class SpoListWebhookSetCommand extends SpoCommand_1.default {
27
27
  __classPrivateFieldGet(this, _SpoListWebhookSetCommand_instances, "m", _SpoListWebhookSetCommand_initTelemetry).call(this);
28
28
  __classPrivateFieldGet(this, _SpoListWebhookSetCommand_instances, "m", _SpoListWebhookSetCommand_initOptions).call(this);
29
29
  __classPrivateFieldGet(this, _SpoListWebhookSetCommand_instances, "m", _SpoListWebhookSetCommand_initValidators).call(this);
30
+ __classPrivateFieldGet(this, _SpoListWebhookSetCommand_instances, "m", _SpoListWebhookSetCommand_initOptionSets).call(this);
30
31
  }
31
32
  get name() {
32
33
  return commands_1.default.LIST_WEBHOOK_SET;
@@ -108,12 +109,6 @@ _SpoListWebhookSetCommand_instances = new WeakSet(), _SpoListWebhookSetCommand_i
108
109
  return `${args.options.listId} is not a valid GUID`;
109
110
  }
110
111
  }
111
- if (args.options.listId && args.options.listTitle) {
112
- return 'Specify listId or listTitle, but not both';
113
- }
114
- if (!args.options.listId && !args.options.listTitle) {
115
- return 'Specify listId or listTitle, one is required';
116
- }
117
112
  if (!args.options.notificationUrl && !args.options.expirationDateTime) {
118
113
  return 'Specify notificationUrl, expirationDateTime or both, at least one is required';
119
114
  }
@@ -127,6 +122,8 @@ _SpoListWebhookSetCommand_instances = new WeakSet(), _SpoListWebhookSetCommand_i
127
122
  }
128
123
  return true;
129
124
  }));
125
+ }, _SpoListWebhookSetCommand_initOptionSets = function _SpoListWebhookSetCommand_initOptionSets() {
126
+ this.optionSets.push(['listId', 'listTitle']);
130
127
  };
131
128
  module.exports = new SpoListWebhookSetCommand();
132
129
  //# sourceMappingURL=list-webhook-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 _SpoListItemAddCommand_instances, _SpoListItemAddCommand_initTelemetry, _SpoListItemAddCommand_initOptions, _SpoListItemAddCommand_initValidators, _SpoListItemAddCommand_initTypes;
16
+ var _SpoListItemAddCommand_instances, _SpoListItemAddCommand_initTelemetry, _SpoListItemAddCommand_initOptions, _SpoListItemAddCommand_initValidators, _SpoListItemAddCommand_initTypes, _SpoListItemAddCommand_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 SpoListItemAddCommand extends SpoCommand_1.default {
27
27
  __classPrivateFieldGet(this, _SpoListItemAddCommand_instances, "m", _SpoListItemAddCommand_initOptions).call(this);
28
28
  __classPrivateFieldGet(this, _SpoListItemAddCommand_instances, "m", _SpoListItemAddCommand_initValidators).call(this);
29
29
  __classPrivateFieldGet(this, _SpoListItemAddCommand_instances, "m", _SpoListItemAddCommand_initTypes).call(this);
30
+ __classPrivateFieldGet(this, _SpoListItemAddCommand_instances, "m", _SpoListItemAddCommand_initOptionSets).call(this);
30
31
  }
31
32
  allowUnknownOptions() {
32
33
  return true;
@@ -211,12 +212,6 @@ _SpoListItemAddCommand_instances = new WeakSet(), _SpoListItemAddCommand_initTel
211
212
  if (isValidSharePointUrl !== true) {
212
213
  return isValidSharePointUrl;
213
214
  }
214
- if (!args.options.listId && !args.options.listTitle) {
215
- return `Specify listId or listTitle`;
216
- }
217
- if (args.options.listId && args.options.listTitle) {
218
- return `Specify listId or listTitle but not both`;
219
- }
220
215
  if (args.options.listId &&
221
216
  !utils_1.validation.isValidGuid(args.options.listId)) {
222
217
  return `${args.options.listId} in option listId is not a valid GUID`;
@@ -225,6 +220,8 @@ _SpoListItemAddCommand_instances = new WeakSet(), _SpoListItemAddCommand_initTel
225
220
  }));
226
221
  }, _SpoListItemAddCommand_initTypes = function _SpoListItemAddCommand_initTypes() {
227
222
  this.types.string.push('webUrl', 'listId', 'listTitle', 'contentType', 'folder');
223
+ }, _SpoListItemAddCommand_initOptionSets = function _SpoListItemAddCommand_initOptionSets() {
224
+ this.optionSets.push(['listId', 'listTitle']);
228
225
  };
229
226
  module.exports = new SpoListItemAddCommand();
230
227
  //# sourceMappingURL=listitem-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 _SpoListItemAttachmentListCommand_instances, _SpoListItemAttachmentListCommand_initTelemetry, _SpoListItemAttachmentListCommand_initOptions, _SpoListItemAttachmentListCommand_initValidators;
16
+ var _SpoListItemAttachmentListCommand_instances, _SpoListItemAttachmentListCommand_initTelemetry, _SpoListItemAttachmentListCommand_initOptions, _SpoListItemAttachmentListCommand_initValidators, _SpoListItemAttachmentListCommand_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 SpoListItemAttachmentListCommand extends SpoCommand_1.default {
26
26
  __classPrivateFieldGet(this, _SpoListItemAttachmentListCommand_instances, "m", _SpoListItemAttachmentListCommand_initTelemetry).call(this);
27
27
  __classPrivateFieldGet(this, _SpoListItemAttachmentListCommand_instances, "m", _SpoListItemAttachmentListCommand_initOptions).call(this);
28
28
  __classPrivateFieldGet(this, _SpoListItemAttachmentListCommand_instances, "m", _SpoListItemAttachmentListCommand_initValidators).call(this);
29
+ __classPrivateFieldGet(this, _SpoListItemAttachmentListCommand_instances, "m", _SpoListItemAttachmentListCommand_initOptionSets).call(this);
29
30
  }
30
31
  get name() {
31
32
  return commands_1.default.LISTITEM_ATTACHMENT_LIST;
@@ -88,12 +89,6 @@ _SpoListItemAttachmentListCommand_instances = new WeakSet(), _SpoListItemAttachm
88
89
  if (isValidSharePointUrl !== true) {
89
90
  return isValidSharePointUrl;
90
91
  }
91
- if (!args.options.listId && !args.options.listTitle) {
92
- return `Specify listId or listTitle`;
93
- }
94
- if (args.options.listId && args.options.listTitle) {
95
- return `Specify listId or listTitle but not both`;
96
- }
97
92
  if (args.options.listId && !utils_1.validation.isValidGuid(args.options.listId)) {
98
93
  return `${args.options.listId} in option listId is not a valid GUID`;
99
94
  }
@@ -102,6 +97,8 @@ _SpoListItemAttachmentListCommand_instances = new WeakSet(), _SpoListItemAttachm
102
97
  }
103
98
  return true;
104
99
  }));
100
+ }, _SpoListItemAttachmentListCommand_initOptionSets = function _SpoListItemAttachmentListCommand_initOptionSets() {
101
+ this.optionSets.push(['listId', 'listTitle']);
105
102
  };
106
103
  module.exports = new SpoListItemAttachmentListCommand();
107
104
  //# sourceMappingURL=listitem-attachment-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 _SpoListItemGetCommand_instances, _SpoListItemGetCommand_initTelemetry, _SpoListItemGetCommand_initOptions, _SpoListItemGetCommand_initValidators, _SpoListItemGetCommand_initTypes;
16
+ var _SpoListItemGetCommand_instances, _SpoListItemGetCommand_initTelemetry, _SpoListItemGetCommand_initOptions, _SpoListItemGetCommand_initValidators, _SpoListItemGetCommand_initTypes, _SpoListItemGetCommand_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 SpoListItemGetCommand extends SpoCommand_1.default {
27
27
  __classPrivateFieldGet(this, _SpoListItemGetCommand_instances, "m", _SpoListItemGetCommand_initOptions).call(this);
28
28
  __classPrivateFieldGet(this, _SpoListItemGetCommand_instances, "m", _SpoListItemGetCommand_initValidators).call(this);
29
29
  __classPrivateFieldGet(this, _SpoListItemGetCommand_instances, "m", _SpoListItemGetCommand_initTypes).call(this);
30
+ __classPrivateFieldGet(this, _SpoListItemGetCommand_instances, "m", _SpoListItemGetCommand_initOptionSets).call(this);
30
31
  }
31
32
  allowUnknownOptions() {
32
33
  return true;
@@ -89,12 +90,6 @@ _SpoListItemGetCommand_instances = new WeakSet(), _SpoListItemGetCommand_initTel
89
90
  if (isValidSharePointUrl !== true) {
90
91
  return isValidSharePointUrl;
91
92
  }
92
- if (!args.options.listId && !args.options.listTitle) {
93
- return `Specify listId or listTitle`;
94
- }
95
- if (args.options.listId && args.options.listTitle) {
96
- return `Specify listId or listTitle but not both`;
97
- }
98
93
  if (args.options.listId &&
99
94
  !utils_1.validation.isValidGuid(args.options.listId)) {
100
95
  return `${args.options.listId} in option listId is not a valid GUID`;
@@ -106,6 +101,8 @@ _SpoListItemGetCommand_instances = new WeakSet(), _SpoListItemGetCommand_initTel
106
101
  }));
107
102
  }, _SpoListItemGetCommand_initTypes = function _SpoListItemGetCommand_initTypes() {
108
103
  this.types.string.push('webUrl', 'listId', 'listTitle', 'id', 'properties');
104
+ }, _SpoListItemGetCommand_initOptionSets = function _SpoListItemGetCommand_initOptionSets() {
105
+ this.optionSets.push(['listId', 'listTitle']);
109
106
  };
110
107
  module.exports = new SpoListItemGetCommand();
111
108
  //# sourceMappingURL=listitem-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 _SpoListItemIsRecordCommand_instances, _SpoListItemIsRecordCommand_initTelemetry, _SpoListItemIsRecordCommand_initOptions, _SpoListItemIsRecordCommand_initValidators;
16
+ var _SpoListItemIsRecordCommand_instances, _SpoListItemIsRecordCommand_initTelemetry, _SpoListItemIsRecordCommand_initOptions, _SpoListItemIsRecordCommand_initValidators, _SpoListItemIsRecordCommand_initOptionSets;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  const Auth_1 = require("../../../../Auth");
19
19
  const Command_1 = require("../../../../Command");
@@ -29,6 +29,7 @@ class SpoListItemIsRecordCommand extends SpoCommand_1.default {
29
29
  __classPrivateFieldGet(this, _SpoListItemIsRecordCommand_instances, "m", _SpoListItemIsRecordCommand_initTelemetry).call(this);
30
30
  __classPrivateFieldGet(this, _SpoListItemIsRecordCommand_instances, "m", _SpoListItemIsRecordCommand_initOptions).call(this);
31
31
  __classPrivateFieldGet(this, _SpoListItemIsRecordCommand_instances, "m", _SpoListItemIsRecordCommand_initValidators).call(this);
32
+ __classPrivateFieldGet(this, _SpoListItemIsRecordCommand_instances, "m", _SpoListItemIsRecordCommand_initOptionSets).call(this);
32
33
  }
33
34
  get name() {
34
35
  return commands_1.default.LISTITEM_ISRECORD;
@@ -148,18 +149,14 @@ _SpoListItemIsRecordCommand_instances = new WeakSet(), _SpoListItemIsRecordComma
148
149
  if (isValidSharePointUrl !== true) {
149
150
  return isValidSharePointUrl;
150
151
  }
151
- if (!args.options.listId && !args.options.listTitle) {
152
- return `Specify listId or listTitle`;
153
- }
154
- if (args.options.listId && args.options.listTitle) {
155
- return `Specify listId or listTitle but not both`;
156
- }
157
152
  if (args.options.listId &&
158
153
  !utils_1.validation.isValidGuid(args.options.listId)) {
159
154
  return `${args.options.listId} in option listId is not a valid GUID`;
160
155
  }
161
156
  return true;
162
157
  }));
158
+ }, _SpoListItemIsRecordCommand_initOptionSets = function _SpoListItemIsRecordCommand_initOptionSets() {
159
+ this.optionSets.push(['listId', 'listTitle']);
163
160
  };
164
161
  module.exports = new SpoListItemIsRecordCommand();
165
162
  //# sourceMappingURL=listitem-isrecord.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 _SpoListItemRecordDeclareCommand_instances, _SpoListItemRecordDeclareCommand_initTelemetry, _SpoListItemRecordDeclareCommand_initOptions, _SpoListItemRecordDeclareCommand_initValidators;
16
+ var _SpoListItemRecordDeclareCommand_instances, _SpoListItemRecordDeclareCommand_initTelemetry, _SpoListItemRecordDeclareCommand_initOptions, _SpoListItemRecordDeclareCommand_initValidators, _SpoListItemRecordDeclareCommand_initOptionSets;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  const Command_1 = require("../../../../Command");
19
19
  const config_1 = require("../../../../config");
@@ -28,6 +28,7 @@ class SpoListItemRecordDeclareCommand extends SpoCommand_1.default {
28
28
  __classPrivateFieldGet(this, _SpoListItemRecordDeclareCommand_instances, "m", _SpoListItemRecordDeclareCommand_initTelemetry).call(this);
29
29
  __classPrivateFieldGet(this, _SpoListItemRecordDeclareCommand_instances, "m", _SpoListItemRecordDeclareCommand_initOptions).call(this);
30
30
  __classPrivateFieldGet(this, _SpoListItemRecordDeclareCommand_instances, "m", _SpoListItemRecordDeclareCommand_initValidators).call(this);
31
+ __classPrivateFieldGet(this, _SpoListItemRecordDeclareCommand_instances, "m", _SpoListItemRecordDeclareCommand_initOptionSets).call(this);
31
32
  }
32
33
  get name() {
33
34
  return commands_1.default.LISTITEM_RECORD_DECLARE;
@@ -125,12 +126,6 @@ _SpoListItemRecordDeclareCommand_instances = new WeakSet(), _SpoListItemRecordDe
125
126
  if (isValidSharePointUrl !== true) {
126
127
  return isValidSharePointUrl;
127
128
  }
128
- if (!args.options.listId && !args.options.listTitle) {
129
- return `Specify listId or listTitle`;
130
- }
131
- if (args.options.listId && args.options.listTitle) {
132
- return `Specify listId or listTitle but not both`;
133
- }
134
129
  if (args.options.listId && !utils_1.validation.isValidGuid(args.options.listId)) {
135
130
  return `${args.options.listId} in option listId is not a valid GUID`;
136
131
  }
@@ -146,6 +141,8 @@ _SpoListItemRecordDeclareCommand_instances = new WeakSet(), _SpoListItemRecordDe
146
141
  }
147
142
  return true;
148
143
  }));
144
+ }, _SpoListItemRecordDeclareCommand_initOptionSets = function _SpoListItemRecordDeclareCommand_initOptionSets() {
145
+ this.optionSets.push(['listId', 'listTitle']);
149
146
  };
150
147
  module.exports = new SpoListItemRecordDeclareCommand();
151
148
  //# sourceMappingURL=listitem-record-declare.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 _SpoListItemRecordUndeclareCommand_instances, _SpoListItemRecordUndeclareCommand_initTelemetry, _SpoListItemRecordUndeclareCommand_initOptions, _SpoListItemRecordUndeclareCommand_initValidators;
16
+ var _SpoListItemRecordUndeclareCommand_instances, _SpoListItemRecordUndeclareCommand_initTelemetry, _SpoListItemRecordUndeclareCommand_initOptions, _SpoListItemRecordUndeclareCommand_initValidators, _SpoListItemRecordUndeclareCommand_initOptionSets;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  const config_1 = require("../../../../config");
19
19
  const request_1 = require("../../../../request");
@@ -27,6 +27,7 @@ class SpoListItemRecordUndeclareCommand extends SpoCommand_1.default {
27
27
  __classPrivateFieldGet(this, _SpoListItemRecordUndeclareCommand_instances, "m", _SpoListItemRecordUndeclareCommand_initTelemetry).call(this);
28
28
  __classPrivateFieldGet(this, _SpoListItemRecordUndeclareCommand_instances, "m", _SpoListItemRecordUndeclareCommand_initOptions).call(this);
29
29
  __classPrivateFieldGet(this, _SpoListItemRecordUndeclareCommand_instances, "m", _SpoListItemRecordUndeclareCommand_initValidators).call(this);
30
+ __classPrivateFieldGet(this, _SpoListItemRecordUndeclareCommand_instances, "m", _SpoListItemRecordUndeclareCommand_initOptionSets).call(this);
30
31
  }
31
32
  get name() {
32
33
  return commands_1.default.LISTITEM_RECORD_UNDECLARE;
@@ -116,18 +117,14 @@ _SpoListItemRecordUndeclareCommand_instances = new WeakSet(), _SpoListItemRecord
116
117
  if (isValidSharePointUrl !== true) {
117
118
  return isValidSharePointUrl;
118
119
  }
119
- if (!args.options.listId && !args.options.listTitle) {
120
- return `Specify listId or listTitle`;
121
- }
122
- if (args.options.listId && args.options.listTitle) {
123
- return `Specify listId or listTitle but not both`;
124
- }
125
120
  if (args.options.listId &&
126
121
  !utils_1.validation.isValidGuid(args.options.listId)) {
127
122
  return `${args.options.listId} in option listId is not a valid GUID`;
128
123
  }
129
124
  return true;
130
125
  }));
126
+ }, _SpoListItemRecordUndeclareCommand_initOptionSets = function _SpoListItemRecordUndeclareCommand_initOptionSets() {
127
+ this.optionSets.push(['listId', 'listTitle']);
131
128
  };
132
129
  module.exports = new SpoListItemRecordUndeclareCommand();
133
130
  //# sourceMappingURL=listitem-record-undeclare.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 _SpoListItemRemoveCommand_instances, _SpoListItemRemoveCommand_initTelemetry, _SpoListItemRemoveCommand_initOptions, _SpoListItemRemoveCommand_initValidators;
16
+ var _SpoListItemRemoveCommand_instances, _SpoListItemRemoveCommand_initTelemetry, _SpoListItemRemoveCommand_initOptions, _SpoListItemRemoveCommand_initValidators, _SpoListItemRemoveCommand_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 SpoListItemRemoveCommand extends SpoCommand_1.default {
27
27
  __classPrivateFieldGet(this, _SpoListItemRemoveCommand_instances, "m", _SpoListItemRemoveCommand_initTelemetry).call(this);
28
28
  __classPrivateFieldGet(this, _SpoListItemRemoveCommand_instances, "m", _SpoListItemRemoveCommand_initOptions).call(this);
29
29
  __classPrivateFieldGet(this, _SpoListItemRemoveCommand_instances, "m", _SpoListItemRemoveCommand_initValidators).call(this);
30
+ __classPrivateFieldGet(this, _SpoListItemRemoveCommand_instances, "m", _SpoListItemRemoveCommand_initOptionSets).call(this);
30
31
  }
31
32
  get name() {
32
33
  return commands_1.default.LISTITEM_REMOVE;
@@ -124,14 +125,10 @@ _SpoListItemRemoveCommand_instances = new WeakSet(), _SpoListItemRemoveCommand_i
124
125
  !utils_1.validation.isValidGuid(args.options.listId)) {
125
126
  return `${args.options.listId} is not a valid GUID`;
126
127
  }
127
- if (args.options.listId && args.options.listTitle) {
128
- return 'Specify id or title, but not both';
129
- }
130
- if (!args.options.listId && !args.options.listTitle) {
131
- return 'Specify id or title';
132
- }
133
128
  return true;
134
129
  }));
130
+ }, _SpoListItemRemoveCommand_initOptionSets = function _SpoListItemRemoveCommand_initOptionSets() {
131
+ this.optionSets.push(['listId', 'listTitle']);
135
132
  };
136
133
  module.exports = new SpoListItemRemoveCommand();
137
134
  //# sourceMappingURL=listitem-remove.js.map
@@ -0,0 +1,206 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
12
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
13
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
14
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
15
+ };
16
+ var _SpoListItemRoleAssignmentRemoveCommand_instances, _SpoListItemRoleAssignmentRemoveCommand_initTelemetry, _SpoListItemRoleAssignmentRemoveCommand_initOptions, _SpoListItemRoleAssignmentRemoveCommand_initValidators;
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const cli_1 = require("../../../../cli");
19
+ const request_1 = require("../../../../request");
20
+ const utils_1 = require("../../../../utils");
21
+ const SpoCommand_1 = require("../../../base/SpoCommand");
22
+ const commands_1 = require("../../commands");
23
+ const SpoUserGetCommand = require("../user/user-get");
24
+ const SpoGroupGetCommand = require("../group/group-get");
25
+ class SpoListItemRoleAssignmentRemoveCommand extends SpoCommand_1.default {
26
+ constructor() {
27
+ super();
28
+ _SpoListItemRoleAssignmentRemoveCommand_instances.add(this);
29
+ __classPrivateFieldGet(this, _SpoListItemRoleAssignmentRemoveCommand_instances, "m", _SpoListItemRoleAssignmentRemoveCommand_initTelemetry).call(this);
30
+ __classPrivateFieldGet(this, _SpoListItemRoleAssignmentRemoveCommand_instances, "m", _SpoListItemRoleAssignmentRemoveCommand_initOptions).call(this);
31
+ __classPrivateFieldGet(this, _SpoListItemRoleAssignmentRemoveCommand_instances, "m", _SpoListItemRoleAssignmentRemoveCommand_initValidators).call(this);
32
+ }
33
+ get name() {
34
+ return commands_1.default.LISTITEM_ROLEASSIGNMENT_REMOVE;
35
+ }
36
+ get description() {
37
+ return 'Removes a role assignment from list item permissions';
38
+ }
39
+ commandAction(logger, args, cb) {
40
+ const removeRoleAssignment = () => {
41
+ if (this.verbose) {
42
+ logger.logToStderr(`Removing role assignment from listitem 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
+ requestUrl += `items(${args.options.listItemId})/`;
56
+ if (args.options.upn) {
57
+ this.GetUserPrincipalId(args.options)
58
+ .then((userPrincipalId) => {
59
+ args.options.principalId = userPrincipalId;
60
+ this.RemoveRoleAssignment(requestUrl, logger, args.options, cb);
61
+ }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
62
+ }
63
+ else if (args.options.groupName) {
64
+ this.GetGroupPrincipalId(args.options)
65
+ .then((groupPrincipalId) => {
66
+ args.options.principalId = groupPrincipalId;
67
+ this.RemoveRoleAssignment(requestUrl, logger, args.options, cb);
68
+ }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
69
+ }
70
+ else {
71
+ this.RemoveRoleAssignment(requestUrl, logger, args.options, cb);
72
+ }
73
+ };
74
+ if (args.options.confirm) {
75
+ removeRoleAssignment();
76
+ }
77
+ else {
78
+ cli_1.Cli.prompt({
79
+ type: 'confirm',
80
+ name: 'continue',
81
+ default: false,
82
+ message: `Are you sure you want to remove role assignment from listitem ${args.options.listItemId} from list ${args.options.listId || args.options.listTitle} from site ${args.options.webUrl}?`
83
+ }, (result) => {
84
+ if (!result.continue) {
85
+ cb();
86
+ }
87
+ else {
88
+ removeRoleAssignment();
89
+ }
90
+ });
91
+ }
92
+ }
93
+ RemoveRoleAssignment(requestUrl, logger, options, cb) {
94
+ const requestOptions = {
95
+ url: `${requestUrl}roleassignments/removeroleassignment(principalid='${options.principalId}')`,
96
+ method: 'POST',
97
+ headers: {
98
+ 'accept': 'application/json;odata=nometadata',
99
+ 'content-type': 'application/json'
100
+ },
101
+ responseType: 'json'
102
+ };
103
+ request_1.default
104
+ .post(requestOptions)
105
+ .then(_ => cb(), (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
106
+ }
107
+ GetGroupPrincipalId(options) {
108
+ const groupGetCommandOptions = {
109
+ webUrl: options.webUrl,
110
+ name: options.groupName,
111
+ output: 'json',
112
+ debug: this.debug,
113
+ verbose: this.verbose
114
+ };
115
+ return cli_1.Cli.executeCommandWithOutput(SpoGroupGetCommand, { options: Object.assign(Object.assign({}, groupGetCommandOptions), { _: [] }) })
116
+ .then((output) => {
117
+ const getGroupOutput = JSON.parse(output.stdout);
118
+ return Promise.resolve(getGroupOutput.Id);
119
+ }, (err) => {
120
+ return Promise.reject(err);
121
+ });
122
+ }
123
+ GetUserPrincipalId(options) {
124
+ const userGetCommandOptions = {
125
+ webUrl: options.webUrl,
126
+ email: options.upn,
127
+ id: undefined,
128
+ output: 'json',
129
+ debug: this.debug,
130
+ verbose: this.verbose
131
+ };
132
+ return cli_1.Cli.executeCommandWithOutput(SpoUserGetCommand, { options: Object.assign(Object.assign({}, userGetCommandOptions), { _: [] }) })
133
+ .then((output) => {
134
+ const getUserOutput = JSON.parse(output.stdout);
135
+ return Promise.resolve(getUserOutput.Id);
136
+ }, (err) => {
137
+ return Promise.reject(err);
138
+ });
139
+ }
140
+ }
141
+ _SpoListItemRoleAssignmentRemoveCommand_instances = new WeakSet(), _SpoListItemRoleAssignmentRemoveCommand_initTelemetry = function _SpoListItemRoleAssignmentRemoveCommand_initTelemetry() {
142
+ this.telemetry.push((args) => {
143
+ Object.assign(this.telemetryProperties, {
144
+ listId: typeof args.options.listId !== 'undefined',
145
+ listTitle: typeof args.options.listTitle !== 'undefined',
146
+ listUrl: typeof args.options.listUrl !== 'undefined',
147
+ principalId: typeof args.options.principalId !== 'undefined',
148
+ upn: typeof args.options.upn !== 'undefined',
149
+ groupName: typeof args.options.groupName !== 'undefined',
150
+ confirm: (!(!args.options.confirm)).toString()
151
+ });
152
+ });
153
+ }, _SpoListItemRoleAssignmentRemoveCommand_initOptions = function _SpoListItemRoleAssignmentRemoveCommand_initOptions() {
154
+ this.options.unshift({
155
+ option: '-u, --webUrl <webUrl>'
156
+ }, {
157
+ option: '-i, --listId [listId]'
158
+ }, {
159
+ option: '-t, --listTitle [listTitle]'
160
+ }, {
161
+ option: '--listUrl [listUrl]'
162
+ }, {
163
+ option: '--listItemId <listItemId>'
164
+ }, {
165
+ option: '--principalId [principalId]'
166
+ }, {
167
+ option: '--upn [upn]'
168
+ }, {
169
+ option: '--groupName [groupName]'
170
+ }, {
171
+ option: '--confirm'
172
+ });
173
+ }, _SpoListItemRoleAssignmentRemoveCommand_initValidators = function _SpoListItemRoleAssignmentRemoveCommand_initValidators() {
174
+ this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
175
+ const isValidSharePointUrl = utils_1.validation.isValidSharePointUrl(args.options.webUrl);
176
+ if (isValidSharePointUrl !== true) {
177
+ return isValidSharePointUrl;
178
+ }
179
+ if (args.options.listId && !utils_1.validation.isValidGuid(args.options.listId)) {
180
+ return `${args.options.listId} is not a valid GUID`;
181
+ }
182
+ if (args.options.listItemId && isNaN(args.options.listItemId)) {
183
+ return `Specified listItemId ${args.options.listItemId} is not a number`;
184
+ }
185
+ if (args.options.principalId && isNaN(args.options.principalId)) {
186
+ return `Specified principalId ${args.options.principalId} is not a number`;
187
+ }
188
+ const listOptions = [args.options.listId, args.options.listTitle, args.options.listUrl];
189
+ if (listOptions.some(item => item !== undefined) && listOptions.filter(item => item !== undefined).length > 1) {
190
+ return `Specify either list id or title or list url`;
191
+ }
192
+ if (listOptions.filter(item => item !== undefined).length === 0) {
193
+ return `Specify at least list id or title or list url`;
194
+ }
195
+ const principalOptions = [args.options.principalId, args.options.upn, args.options.groupName];
196
+ if (principalOptions.some(item => item !== undefined) && principalOptions.filter(item => item !== undefined).length > 1) {
197
+ return `Specify either principalId id or upn or groupName`;
198
+ }
199
+ if (principalOptions.filter(item => item !== undefined).length === 0) {
200
+ return `Specify at least principalId id or upn or groupName`;
201
+ }
202
+ return true;
203
+ }));
204
+ };
205
+ module.exports = new SpoListItemRoleAssignmentRemoveCommand();
206
+ //# sourceMappingURL=listitem-roleassignment-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 _SpoListItemSetCommand_instances, _SpoListItemSetCommand_initTelemetry, _SpoListItemSetCommand_initOptions, _SpoListItemSetCommand_initValidators, _SpoListItemSetCommand_initTypes;
16
+ var _SpoListItemSetCommand_instances, _SpoListItemSetCommand_initTelemetry, _SpoListItemSetCommand_initOptions, _SpoListItemSetCommand_initValidators, _SpoListItemSetCommand_initTypes, _SpoListItemSetCommand_initOptionSets;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  const config_1 = require("../../../../config");
19
19
  const request_1 = require("../../../../request");
@@ -28,6 +28,7 @@ class SpoListItemSetCommand extends SpoCommand_1.default {
28
28
  __classPrivateFieldGet(this, _SpoListItemSetCommand_instances, "m", _SpoListItemSetCommand_initOptions).call(this);
29
29
  __classPrivateFieldGet(this, _SpoListItemSetCommand_instances, "m", _SpoListItemSetCommand_initValidators).call(this);
30
30
  __classPrivateFieldGet(this, _SpoListItemSetCommand_instances, "m", _SpoListItemSetCommand_initTypes).call(this);
31
+ __classPrivateFieldGet(this, _SpoListItemSetCommand_instances, "m", _SpoListItemSetCommand_initOptionSets).call(this);
31
32
  }
32
33
  allowUnknownOptions() {
33
34
  return true;
@@ -320,12 +321,6 @@ _SpoListItemSetCommand_instances = new WeakSet(), _SpoListItemSetCommand_initTel
320
321
  if (isValidSharePointUrl !== true) {
321
322
  return isValidSharePointUrl;
322
323
  }
323
- if (!args.options.listId && !args.options.listTitle) {
324
- return `Specify listId or listTitle`;
325
- }
326
- if (args.options.listId && args.options.listTitle) {
327
- return `Specify listId or listTitle but not both`;
328
- }
329
324
  if (args.options.listId &&
330
325
  !utils_1.validation.isValidGuid(args.options.listId)) {
331
326
  return `${args.options.listId} in option listId is not a valid GUID`;
@@ -335,6 +330,8 @@ _SpoListItemSetCommand_instances = new WeakSet(), _SpoListItemSetCommand_initTel
335
330
  }, _SpoListItemSetCommand_initTypes = function _SpoListItemSetCommand_initTypes() {
336
331
  this.types.string.push('webUrl', 'listId', 'listTitle', 'id', 'contentType');
337
332
  this.types.boolean.push('systemUpdate');
333
+ }, _SpoListItemSetCommand_initOptionSets = function _SpoListItemSetCommand_initOptionSets() {
334
+ this.optionSets.push(['listId', 'listTitle']);
338
335
  };
339
336
  module.exports = new SpoListItemSetCommand();
340
337
  //# sourceMappingURL=listitem-set.js.map