@pnp/cli-microsoft365 6.0.0-beta.22bbec5 → 6.0.0-beta.27b9708

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 (135) 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/onenote/commands/notebook/notebook-list.js +139 -0
  25. package/dist/m365/onenote/commands.js +7 -0
  26. package/dist/m365/outlook/commands/message/message-list.js +4 -23
  27. package/dist/m365/outlook/commands/message/message-move.js +4 -31
  28. package/dist/m365/pa/commands/app/app-get.js +4 -7
  29. package/dist/m365/planner/commands/bucket/bucket-add.js +4 -7
  30. package/dist/m365/planner/commands/bucket/bucket-list.js +4 -7
  31. package/dist/m365/planner/commands/plan/plan-add.js +4 -7
  32. package/dist/m365/planner/commands/plan/plan-list.js +4 -7
  33. package/dist/m365/planner/commands/task/task-add.js +4 -13
  34. package/dist/m365/planner/commands/task/task-get.js +7 -0
  35. package/dist/m365/pp/commands/managementapp/managementapp-add.js +4 -11
  36. package/dist/m365/spfx/commands/project/project-doctor/doctor-1.16.0-beta.1.js +23 -0
  37. package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
  38. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN010008_YORC_nodeVersion.js +47 -0
  39. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN021003_PKG_engines_node.js +48 -0
  40. package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.16.0-beta.1.js +61 -0
  41. package/dist/m365/spfx/commands/project/project-upgrade.js +16 -13
  42. package/dist/m365/spfx/commands/spfx-doctor.js +90 -79
  43. package/dist/m365/spo/commands/app/app-deploy.js +4 -7
  44. package/dist/m365/spo/commands/app/app-get.js +4 -7
  45. package/dist/m365/spo/commands/contenttype/contenttype-get.js +4 -7
  46. package/dist/m365/spo/commands/contenttype/contenttype-remove.js +5 -14
  47. package/dist/m365/spo/commands/file/file-checkin.js +4 -7
  48. package/dist/m365/spo/commands/file/file-checkout.js +4 -7
  49. package/dist/m365/spo/commands/file/file-get.js +4 -7
  50. package/dist/m365/spo/commands/file/file-remove.js +4 -7
  51. package/dist/m365/spo/commands/file/file-sharinginfo-get.js +4 -7
  52. package/dist/m365/spo/commands/group/group-remove.js +4 -7
  53. package/dist/m365/spo/commands/group/group-user-add.js +4 -13
  54. package/dist/m365/spo/commands/group/group-user-list.js +4 -7
  55. package/dist/m365/spo/commands/group/group-user-remove.js +4 -7
  56. package/dist/m365/spo/commands/hubsite/hubsite-unregister.js +1 -1
  57. package/dist/m365/spo/commands/list/list-contenttype-add.js +4 -7
  58. package/dist/m365/spo/commands/list/list-contenttype-default-set.js +4 -7
  59. package/dist/m365/spo/commands/list/list-contenttype-list.js +4 -7
  60. package/dist/m365/spo/commands/list/list-contenttype-remove.js +4 -7
  61. package/dist/m365/spo/commands/list/list-get.js +4 -7
  62. package/dist/m365/spo/commands/list/list-label-get.js +4 -7
  63. package/dist/m365/spo/commands/list/list-label-set.js +4 -4
  64. package/dist/m365/spo/commands/list/list-remove.js +4 -7
  65. package/dist/m365/spo/commands/list/list-roleassignment-add.js +9 -0
  66. package/dist/m365/spo/commands/list/list-roleassignment-remove.js +57 -28
  67. package/dist/m365/spo/commands/list/list-sitescript-get.js +4 -7
  68. package/dist/m365/spo/commands/list/list-view-field-add.js +4 -19
  69. package/dist/m365/spo/commands/list/list-view-field-remove.js +4 -19
  70. package/dist/m365/spo/commands/list/list-view-field-set.js +4 -19
  71. package/dist/m365/spo/commands/list/list-view-get.js +4 -10
  72. package/dist/m365/spo/commands/list/list-view-list.js +4 -7
  73. package/dist/m365/spo/commands/list/list-view-remove.js +4 -13
  74. package/dist/m365/spo/commands/list/list-view-set.js +4 -13
  75. package/dist/m365/spo/commands/list/list-webhook-add.js +4 -7
  76. package/dist/m365/spo/commands/list/list-webhook-get.js +4 -7
  77. package/dist/m365/spo/commands/list/list-webhook-remove.js +4 -7
  78. package/dist/m365/spo/commands/list/list-webhook-set.js +4 -7
  79. package/dist/m365/spo/commands/listitem/listitem-add.js +4 -7
  80. package/dist/m365/spo/commands/listitem/listitem-attachment-list.js +4 -7
  81. package/dist/m365/spo/commands/listitem/listitem-get.js +4 -7
  82. package/dist/m365/spo/commands/listitem/listitem-isrecord.js +4 -7
  83. package/dist/m365/spo/commands/listitem/listitem-record-declare.js +4 -7
  84. package/dist/m365/spo/commands/listitem/listitem-record-undeclare.js +4 -7
  85. package/dist/m365/spo/commands/listitem/listitem-remove.js +4 -7
  86. package/dist/m365/spo/commands/listitem/listitem-roleassignment-remove.js +206 -0
  87. package/dist/m365/spo/commands/listitem/listitem-set.js +4 -7
  88. package/dist/m365/spo/commands/site/site-apppermission-add.js +4 -4
  89. package/dist/m365/spo/commands/site/site-apppermission-remove.js +4 -9
  90. package/dist/m365/spo/commands/site/site-apppermission-set.js +4 -4
  91. package/dist/m365/spo/commands/term/term-add.js +4 -7
  92. package/dist/m365/spo/commands/term/term-get.js +4 -7
  93. package/dist/m365/spo/commands/term/term-group-get.js +4 -7
  94. package/dist/m365/spo/commands/term/term-list.js +4 -13
  95. package/dist/m365/spo/commands/term/term-set-add.js +4 -7
  96. package/dist/m365/spo/commands/term/term-set-get.js +4 -13
  97. package/dist/m365/spo/commands/term/term-set-list.js +4 -7
  98. package/dist/m365/spo/commands/user/user-get.js +4 -9
  99. package/dist/m365/spo/commands/user/user-remove.js +4 -7
  100. package/dist/m365/spo/commands/web/web-roleassignment-add.js +187 -0
  101. package/dist/m365/spo/commands/web/web-roleassignment-remove.js +170 -0
  102. package/dist/m365/spo/commands.js +3 -0
  103. package/dist/m365/teams/commands/app/app-install.js +4 -11
  104. package/dist/m365/teams/commands/app/app-update.js +4 -7
  105. package/dist/m365/teams/commands/channel/channel-add.js +4 -7
  106. package/dist/m365/teams/commands/channel/channel-get.js +4 -22
  107. package/dist/m365/teams/commands/channel/channel-list.js +4 -7
  108. package/dist/m365/teams/commands/channel/channel-member-list.js +4 -13
  109. package/dist/m365/teams/commands/channel/channel-member-set.js +4 -21
  110. package/dist/m365/teams/commands/channel/channel-remove.js +4 -7
  111. package/dist/m365/teams/commands/chat/chat-get.js +4 -17
  112. package/dist/m365/teams/commands/chat/chat-message-send.js +4 -17
  113. package/dist/m365/teams/commands/tab/tab-get.js +6 -21
  114. package/dist/m365/teams/commands/team/team-get.js +4 -7
  115. package/dist/m365/teams/commands/user/user-app-list.js +4 -7
  116. package/dist/m365/todo/commands/list/list-remove.js +4 -21
  117. package/dist/m365/todo/commands/list/list-set.js +4 -21
  118. package/dist/m365/todo/commands/task/task-add.js +4 -21
  119. package/dist/m365/todo/commands/task/task-list.js +4 -21
  120. package/dist/m365/todo/commands/task/task-remove.js +4 -21
  121. package/dist/m365/todo/commands/task/task-set.js +4 -7
  122. package/dist/request.js +6 -2
  123. package/docs/docs/cmd/adaptivecard/adaptivecard-send.md +0 -20
  124. package/docs/docs/cmd/onenote/notebook/notebook-list.md +70 -0
  125. package/docs/docs/cmd/request.md +76 -0
  126. package/docs/docs/cmd/spfx/project/project-upgrade.md +1 -1
  127. package/docs/docs/cmd/spfx/spfx-doctor.md +3 -3
  128. package/docs/docs/cmd/spo/hubsite/hubsite-unregister.md +2 -2
  129. package/docs/docs/cmd/spo/list/list-roleassignment-remove.md +3 -0
  130. package/docs/docs/cmd/spo/listitem/listitem-roleassignment-remove.md +67 -0
  131. package/docs/docs/cmd/spo/listitem/listitem-roleinheritance-break.md +6 -6
  132. package/docs/docs/cmd/spo/web/web-roleassignment-add.md +57 -0
  133. package/docs/docs/cmd/spo/web/web-roleassignment-remove.md +54 -0
  134. package/package.json +2 -1
  135. 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 _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
@@ -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 _SpoSiteAppPermissionAddCommand_instances, _SpoSiteAppPermissionAddCommand_initTelemetry, _SpoSiteAppPermissionAddCommand_initOptions, _SpoSiteAppPermissionAddCommand_initValidators;
16
+ var _SpoSiteAppPermissionAddCommand_instances, _SpoSiteAppPermissionAddCommand_initTelemetry, _SpoSiteAppPermissionAddCommand_initOptions, _SpoSiteAppPermissionAddCommand_initValidators, _SpoSiteAppPermissionAddCommand_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 SpoSiteAppPermissionAddCommand extends GraphCommand_1.default {
27
27
  __classPrivateFieldGet(this, _SpoSiteAppPermissionAddCommand_instances, "m", _SpoSiteAppPermissionAddCommand_initTelemetry).call(this);
28
28
  __classPrivateFieldGet(this, _SpoSiteAppPermissionAddCommand_instances, "m", _SpoSiteAppPermissionAddCommand_initOptions).call(this);
29
29
  __classPrivateFieldGet(this, _SpoSiteAppPermissionAddCommand_instances, "m", _SpoSiteAppPermissionAddCommand_initValidators).call(this);
30
+ __classPrivateFieldGet(this, _SpoSiteAppPermissionAddCommand_instances, "m", _SpoSiteAppPermissionAddCommand_initOptionSets).call(this);
30
31
  }
31
32
  get name() {
32
33
  return commands_1.default.SITE_APPPERMISSION_ADD;
@@ -137,9 +138,6 @@ _SpoSiteAppPermissionAddCommand_instances = new WeakSet(), _SpoSiteAppPermission
137
138
  });
138
139
  }, _SpoSiteAppPermissionAddCommand_initValidators = function _SpoSiteAppPermissionAddCommand_initValidators() {
139
140
  this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
140
- if (!args.options.appId && !args.options.appDisplayName) {
141
- return `Specify appId or appDisplayName, one is required`;
142
- }
143
141
  if (args.options.appId && !utils_1.validation.isValidGuid(args.options.appId)) {
144
142
  return `${args.options.appId} is not a valid GUID`;
145
143
  }
@@ -148,6 +146,8 @@ _SpoSiteAppPermissionAddCommand_instances = new WeakSet(), _SpoSiteAppPermission
148
146
  }
149
147
  return utils_1.validation.isValidSharePointUrl(args.options.siteUrl);
150
148
  }));
149
+ }, _SpoSiteAppPermissionAddCommand_initOptionSets = function _SpoSiteAppPermissionAddCommand_initOptionSets() {
150
+ this.optionSets.push(['appId', 'appDisplayName']);
151
151
  };
152
152
  module.exports = new SpoSiteAppPermissionAddCommand();
153
153
  //# sourceMappingURL=site-apppermission-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 _SpoSiteAppPermissionRemoveCommand_instances, _SpoSiteAppPermissionRemoveCommand_initTelemetry, _SpoSiteAppPermissionRemoveCommand_initOptions, _SpoSiteAppPermissionRemoveCommand_initValidators;
16
+ var _SpoSiteAppPermissionRemoveCommand_instances, _SpoSiteAppPermissionRemoveCommand_initTelemetry, _SpoSiteAppPermissionRemoveCommand_initOptions, _SpoSiteAppPermissionRemoveCommand_initValidators, _SpoSiteAppPermissionRemoveCommand_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 SpoSiteAppPermissionRemoveCommand extends GraphCommand_1.default {
28
28
  __classPrivateFieldGet(this, _SpoSiteAppPermissionRemoveCommand_instances, "m", _SpoSiteAppPermissionRemoveCommand_initTelemetry).call(this);
29
29
  __classPrivateFieldGet(this, _SpoSiteAppPermissionRemoveCommand_instances, "m", _SpoSiteAppPermissionRemoveCommand_initOptions).call(this);
30
30
  __classPrivateFieldGet(this, _SpoSiteAppPermissionRemoveCommand_instances, "m", _SpoSiteAppPermissionRemoveCommand_initValidators).call(this);
31
+ __classPrivateFieldGet(this, _SpoSiteAppPermissionRemoveCommand_instances, "m", _SpoSiteAppPermissionRemoveCommand_initOptionSets).call(this);
31
32
  }
32
33
  get name() {
33
34
  return commands_1.default.SITE_APPPERMISSION_REMOVE;
@@ -156,19 +157,13 @@ _SpoSiteAppPermissionRemoveCommand_instances = new WeakSet(), _SpoSiteAppPermiss
156
157
  });
157
158
  }, _SpoSiteAppPermissionRemoveCommand_initValidators = function _SpoSiteAppPermissionRemoveCommand_initValidators() {
158
159
  this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
159
- if (!args.options.appId && !args.options.appDisplayName && !args.options.id) {
160
- return `Specify appId, appDisplayName, or id. One is required`;
161
- }
162
- if ((args.options.appId && args.options.appDisplayName) ||
163
- (args.options.appId && args.options.id) ||
164
- (args.options.id && args.options.appDisplayName)) {
165
- return 'Use either appId, appDisplayName, or id, but not multiple';
166
- }
167
160
  if (args.options.appId && !utils_1.validation.isValidGuid(args.options.appId)) {
168
161
  return `${args.options.appId} is not a valid GUID`;
169
162
  }
170
163
  return utils_1.validation.isValidSharePointUrl(args.options.siteUrl);
171
164
  }));
165
+ }, _SpoSiteAppPermissionRemoveCommand_initOptionSets = function _SpoSiteAppPermissionRemoveCommand_initOptionSets() {
166
+ this.optionSets.push(['appId', 'appDisplayName', 'id']);
172
167
  };
173
168
  module.exports = new SpoSiteAppPermissionRemoveCommand();
174
169
  //# sourceMappingURL=site-apppermission-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 _SpoSiteAppPermissionSetCommand_instances, _SpoSiteAppPermissionSetCommand_initTelemetry, _SpoSiteAppPermissionSetCommand_initOptions, _SpoSiteAppPermissionSetCommand_initValidators;
16
+ var _SpoSiteAppPermissionSetCommand_instances, _SpoSiteAppPermissionSetCommand_initTelemetry, _SpoSiteAppPermissionSetCommand_initOptions, _SpoSiteAppPermissionSetCommand_initValidators, _SpoSiteAppPermissionSetCommand_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 SpoSiteAppPermissionSetCommand extends GraphCommand_1.default {
27
27
  __classPrivateFieldGet(this, _SpoSiteAppPermissionSetCommand_instances, "m", _SpoSiteAppPermissionSetCommand_initTelemetry).call(this);
28
28
  __classPrivateFieldGet(this, _SpoSiteAppPermissionSetCommand_instances, "m", _SpoSiteAppPermissionSetCommand_initOptions).call(this);
29
29
  __classPrivateFieldGet(this, _SpoSiteAppPermissionSetCommand_instances, "m", _SpoSiteAppPermissionSetCommand_initValidators).call(this);
30
+ __classPrivateFieldGet(this, _SpoSiteAppPermissionSetCommand_instances, "m", _SpoSiteAppPermissionSetCommand_initOptionSets).call(this);
30
31
  }
31
32
  get name() {
32
33
  return commands_1.default.SITE_APPPERMISSION_SET;
@@ -129,9 +130,6 @@ _SpoSiteAppPermissionSetCommand_instances = new WeakSet(), _SpoSiteAppPermission
129
130
  });
130
131
  }, _SpoSiteAppPermissionSetCommand_initValidators = function _SpoSiteAppPermissionSetCommand_initValidators() {
131
132
  this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
132
- if (!args.options.id && !args.options.appId && !args.options.appDisplayName) {
133
- return `Specify id, appId or appDisplayName, one is required`;
134
- }
135
133
  if (args.options.appId && !utils_1.validation.isValidGuid(args.options.appId)) {
136
134
  return `${args.options.appId} is not a valid GUID`;
137
135
  }
@@ -140,6 +138,8 @@ _SpoSiteAppPermissionSetCommand_instances = new WeakSet(), _SpoSiteAppPermission
140
138
  }
141
139
  return utils_1.validation.isValidSharePointUrl(args.options.siteUrl);
142
140
  }));
141
+ }, _SpoSiteAppPermissionSetCommand_initOptionSets = function _SpoSiteAppPermissionSetCommand_initOptionSets() {
142
+ this.optionSets.push(['id', 'appId', 'appDisplayName']);
143
143
  };
144
144
  module.exports = new SpoSiteAppPermissionSetCommand();
145
145
  //# sourceMappingURL=site-apppermission-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 _SpoTermAddCommand_instances, _SpoTermAddCommand_initTelemetry, _SpoTermAddCommand_initOptions, _SpoTermAddCommand_initValidators;
16
+ var _SpoTermAddCommand_instances, _SpoTermAddCommand_initTelemetry, _SpoTermAddCommand_initOptions, _SpoTermAddCommand_initValidators, _SpoTermAddCommand_initOptionSets;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  const uuid_1 = require("uuid");
19
19
  const Command_1 = require("../../../../Command");
@@ -29,6 +29,7 @@ class SpoTermAddCommand extends SpoCommand_1.default {
29
29
  __classPrivateFieldGet(this, _SpoTermAddCommand_instances, "m", _SpoTermAddCommand_initTelemetry).call(this);
30
30
  __classPrivateFieldGet(this, _SpoTermAddCommand_instances, "m", _SpoTermAddCommand_initOptions).call(this);
31
31
  __classPrivateFieldGet(this, _SpoTermAddCommand_instances, "m", _SpoTermAddCommand_initValidators).call(this);
32
+ __classPrivateFieldGet(this, _SpoTermAddCommand_instances, "m", _SpoTermAddCommand_initOptionSets).call(this);
32
33
  }
33
34
  get name() {
34
35
  return commands_1.default.TERM_ADD;
@@ -191,12 +192,6 @@ _SpoTermAddCommand_instances = new WeakSet(), _SpoTermAddCommand_initTelemetry =
191
192
  return 'Specify either parentTermId, termSetId or termSetName but not both';
192
193
  }
193
194
  }
194
- if (!args.options.termGroupId && !args.options.termGroupName) {
195
- return 'Specify termGroupId or termGroupName';
196
- }
197
- if (args.options.termGroupId && args.options.termGroupName) {
198
- return 'Specify termGroupId or termGroupName but not both';
199
- }
200
195
  if (args.options.termGroupId) {
201
196
  if (!utils_1.validation.isValidGuid(args.options.termGroupId)) {
202
197
  return `${args.options.termGroupId} is not a valid GUID`;
@@ -231,6 +226,8 @@ _SpoTermAddCommand_instances = new WeakSet(), _SpoTermAddCommand_initTelemetry =
231
226
  }
232
227
  return true;
233
228
  }));
229
+ }, _SpoTermAddCommand_initOptionSets = function _SpoTermAddCommand_initOptionSets() {
230
+ this.optionSets.push(['termGroupId', 'termGroupName']);
234
231
  };
235
232
  module.exports = new SpoTermAddCommand();
236
233
  //# sourceMappingURL=term-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 _SpoTermGetCommand_instances, _SpoTermGetCommand_initTelemetry, _SpoTermGetCommand_initOptions, _SpoTermGetCommand_initValidators;
16
+ var _SpoTermGetCommand_instances, _SpoTermGetCommand_initTelemetry, _SpoTermGetCommand_initOptions, _SpoTermGetCommand_initValidators, _SpoTermGetCommand_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 SpoTermGetCommand extends SpoCommand_1.default {
28
28
  __classPrivateFieldGet(this, _SpoTermGetCommand_instances, "m", _SpoTermGetCommand_initTelemetry).call(this);
29
29
  __classPrivateFieldGet(this, _SpoTermGetCommand_instances, "m", _SpoTermGetCommand_initOptions).call(this);
30
30
  __classPrivateFieldGet(this, _SpoTermGetCommand_instances, "m", _SpoTermGetCommand_initValidators).call(this);
31
+ __classPrivateFieldGet(this, _SpoTermGetCommand_instances, "m", _SpoTermGetCommand_initOptionSets).call(this);
31
32
  }
32
33
  get name() {
33
34
  return commands_1.default.TERM_GET;
@@ -114,12 +115,6 @@ _SpoTermGetCommand_instances = new WeakSet(), _SpoTermGetCommand_initTelemetry =
114
115
  });
115
116
  }, _SpoTermGetCommand_initValidators = function _SpoTermGetCommand_initValidators() {
116
117
  this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
117
- if (!args.options.id && !args.options.name) {
118
- return 'Specify either id or name';
119
- }
120
- if (args.options.id && args.options.name) {
121
- return 'Specify either id or name but not both';
122
- }
123
118
  if (args.options.id) {
124
119
  if (!utils_1.validation.isValidGuid(args.options.id)) {
125
120
  return `${args.options.id} is not a valid GUID`;
@@ -151,6 +146,8 @@ _SpoTermGetCommand_instances = new WeakSet(), _SpoTermGetCommand_initTelemetry =
151
146
  }
152
147
  return true;
153
148
  }));
149
+ }, _SpoTermGetCommand_initOptionSets = function _SpoTermGetCommand_initOptionSets() {
150
+ this.optionSets.push(['id', 'name']);
154
151
  };
155
152
  module.exports = new SpoTermGetCommand();
156
153
  //# sourceMappingURL=term-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 _SpoTermGroupGetCommand_instances, _SpoTermGroupGetCommand_initTelemetry, _SpoTermGroupGetCommand_initOptions, _SpoTermGroupGetCommand_initValidators;
16
+ var _SpoTermGroupGetCommand_instances, _SpoTermGroupGetCommand_initTelemetry, _SpoTermGroupGetCommand_initOptions, _SpoTermGroupGetCommand_initValidators, _SpoTermGroupGetCommand_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 SpoTermGroupGetCommand extends SpoCommand_1.default {
28
28
  __classPrivateFieldGet(this, _SpoTermGroupGetCommand_instances, "m", _SpoTermGroupGetCommand_initTelemetry).call(this);
29
29
  __classPrivateFieldGet(this, _SpoTermGroupGetCommand_instances, "m", _SpoTermGroupGetCommand_initOptions).call(this);
30
30
  __classPrivateFieldGet(this, _SpoTermGroupGetCommand_instances, "m", _SpoTermGroupGetCommand_initValidators).call(this);
31
+ __classPrivateFieldGet(this, _SpoTermGroupGetCommand_instances, "m", _SpoTermGroupGetCommand_initOptionSets).call(this);
31
32
  }
32
33
  get name() {
33
34
  return commands_1.default.TERM_GROUP_GET;
@@ -90,12 +91,6 @@ _SpoTermGroupGetCommand_instances = new WeakSet(), _SpoTermGroupGetCommand_initT
90
91
  });
91
92
  }, _SpoTermGroupGetCommand_initValidators = function _SpoTermGroupGetCommand_initValidators() {
92
93
  this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
93
- if (!args.options.id && !args.options.name) {
94
- return 'Specify either id or name';
95
- }
96
- if (args.options.id && args.options.name) {
97
- return 'Specify either id or name but not both';
98
- }
99
94
  if (args.options.id) {
100
95
  if (!utils_1.validation.isValidGuid(args.options.id)) {
101
96
  return `${args.options.id} is not a valid GUID`;
@@ -103,6 +98,8 @@ _SpoTermGroupGetCommand_instances = new WeakSet(), _SpoTermGroupGetCommand_initT
103
98
  }
104
99
  return true;
105
100
  }));
101
+ }, _SpoTermGroupGetCommand_initOptionSets = function _SpoTermGroupGetCommand_initOptionSets() {
102
+ this.optionSets.push(['id', 'name']);
106
103
  };
107
104
  module.exports = new SpoTermGroupGetCommand();
108
105
  //# sourceMappingURL=term-group-get.js.map