@pnp/cli-microsoft365 12.0.0-beta.792164a → 12.0.0-beta.93e11fb

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 (232) hide show
  1. package/allCommands.json +1 -1
  2. package/allCommandsFull.json +1 -1
  3. package/dist/Auth.js +19 -2
  4. package/dist/cli/cli.js +3 -0
  5. package/dist/m365/cli/commands/cli-consent.js +9 -2
  6. package/dist/m365/entra/commands/m365group/m365group-add.js +52 -97
  7. package/dist/m365/entra/commands/m365group/m365group-conversation-list.js +20 -33
  8. package/dist/m365/entra/commands/m365group/m365group-conversation-post-list.js +20 -39
  9. package/dist/m365/entra/commands/m365group/m365group-get.js +20 -41
  10. package/dist/m365/entra/commands/m365group/m365group-list.js +11 -31
  11. package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-clear.js +8 -22
  12. package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-list.js +9 -25
  13. package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-remove.js +21 -43
  14. package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-restore.js +21 -41
  15. package/dist/m365/entra/commands/m365group/m365group-remove.js +25 -46
  16. package/dist/m365/entra/commands/m365group/m365group-renew.js +19 -32
  17. package/dist/m365/entra/commands/m365group/m365group-set.js +86 -141
  18. package/dist/m365/entra/commands/m365group/m365group-teamify.js +20 -43
  19. package/dist/m365/entra/commands/m365group/m365group-user-add.js +44 -77
  20. package/dist/m365/entra/commands/m365group/m365group-user-list.js +28 -55
  21. package/dist/m365/entra/commands/m365group/m365group-user-remove.js +37 -74
  22. package/dist/m365/entra/commands/m365group/m365group-user-set.js +45 -77
  23. package/dist/m365/graph/commands/schemaextension/schemaextension-list.js +14 -16
  24. package/dist/m365/spe/commands/container/container-permission-remove.js +94 -0
  25. package/dist/m365/spe/commands.js +1 -0
  26. package/dist/m365/spfx/commands/SpfxCompatibilityMatrix.js +15 -0
  27. package/dist/m365/spfx/commands/project/project-doctor/doctor-1.24.0.js +19 -0
  28. package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
  29. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN012021_TSC_excludeDirectories.js +43 -0
  30. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN027002_OVERRIDES_qs.js +33 -0
  31. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN027003_OVERRIDES_uuid.js +33 -0
  32. package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.24.0.js +77 -0
  33. package/dist/m365/spfx/commands/project/project-upgrade.js +2 -1
  34. package/dist/m365/spo/commands/app/app-add.js +35 -56
  35. package/dist/m365/spo/commands/app/app-deploy.js +41 -59
  36. package/dist/m365/spo/commands/app/app-get.js +40 -56
  37. package/dist/m365/spo/commands/app/app-install.js +20 -41
  38. package/dist/m365/spo/commands/app/app-instance-list.js +12 -24
  39. package/dist/m365/spo/commands/app/app-list.js +26 -44
  40. package/dist/m365/spo/commands/app/app-remove.js +32 -52
  41. package/dist/m365/spo/commands/app/app-retract.js +32 -51
  42. package/dist/m365/spo/commands/app/app-teamspackage-download.js +35 -54
  43. package/dist/m365/spo/commands/app/app-uninstall.js +21 -44
  44. package/dist/m365/spo/commands/app/app-upgrade.js +20 -41
  45. package/dist/m365/spo/commands/commandset/commandset-add.js +17 -59
  46. package/dist/m365/spo/commands/commandset/commandset-get.js +24 -62
  47. package/dist/m365/spo/commands/commandset/commandset-list.js +11 -34
  48. package/dist/m365/spo/commands/commandset/commandset-remove.js +21 -54
  49. package/dist/m365/spo/commands/commandset/commandset-set.js +30 -83
  50. package/dist/m365/spo/commands/externaluser/externaluser-list.js +5 -14
  51. package/dist/m365/spo/commands/feature/feature-disable.js +20 -50
  52. package/dist/m365/spo/commands/feature/feature-enable.js +22 -50
  53. package/dist/m365/spo/commands/feature/feature-list.js +11 -36
  54. package/dist/m365/spo/commands/field/field-add.js +33 -62
  55. package/dist/m365/spo/commands/field/field-get.js +30 -57
  56. package/dist/m365/spo/commands/field/field-list.js +21 -46
  57. package/dist/m365/spo/commands/field/field-remove.js +32 -63
  58. package/dist/m365/spo/commands/field/field-set.js +34 -66
  59. package/dist/m365/spo/commands/file/file-get.js +4 -3
  60. package/dist/m365/spo/commands/folder/folder-unarchive.js +90 -0
  61. package/dist/m365/spo/commands/hubsite/hubsite-connect.js +38 -63
  62. package/dist/m365/spo/commands/hubsite/hubsite-data-get.js +11 -27
  63. package/dist/m365/spo/commands/hubsite/hubsite-disconnect.js +25 -47
  64. package/dist/m365/spo/commands/hubsite/hubsite-get.js +25 -37
  65. package/dist/m365/spo/commands/hubsite/hubsite-list.js +12 -24
  66. package/dist/m365/spo/commands/hubsite/hubsite-register.js +10 -18
  67. package/dist/m365/spo/commands/hubsite/hubsite-rights-grant.js +14 -32
  68. package/dist/m365/spo/commands/hubsite/hubsite-rights-revoke.js +12 -29
  69. package/dist/m365/spo/commands/hubsite/hubsite-set.js +19 -46
  70. package/dist/m365/spo/commands/hubsite/hubsite-unregister.js +11 -27
  71. package/dist/m365/spo/commands/listitem/listitem-add.js +27 -55
  72. package/dist/m365/spo/commands/listitem/listitem-attachment-add.js +30 -58
  73. package/dist/m365/spo/commands/listitem/listitem-attachment-get.js +27 -52
  74. package/dist/m365/spo/commands/listitem/listitem-attachment-list.js +26 -50
  75. package/dist/m365/spo/commands/listitem/listitem-attachment-remove.js +28 -55
  76. package/dist/m365/spo/commands/listitem/listitem-attachment-set.js +30 -57
  77. package/dist/m365/spo/commands/listitem/listitem-batch-add.js +36 -58
  78. package/dist/m365/spo/commands/listitem/listitem-batch-remove.js +68 -92
  79. package/dist/m365/spo/commands/listitem/listitem-batch-set.js +37 -57
  80. package/dist/m365/spo/commands/listitem/listitem-get.js +45 -68
  81. package/dist/m365/spo/commands/listitem/listitem-isrecord.js +31 -55
  82. package/dist/m365/spo/commands/listitem/listitem-list.js +47 -81
  83. package/dist/m365/spo/commands/listitem/listitem-record-declare.js +37 -60
  84. package/dist/m365/spo/commands/listitem/listitem-record-lock.js +30 -52
  85. package/dist/m365/spo/commands/listitem/listitem-record-undeclare.js +31 -52
  86. package/dist/m365/spo/commands/listitem/listitem-record-unlock.js +30 -52
  87. package/dist/m365/spo/commands/listitem/listitem-remove.js +33 -61
  88. package/dist/m365/spo/commands/listitem/listitem-retentionlabel-ensure.js +46 -67
  89. package/dist/m365/spo/commands/listitem/listitem-retentionlabel-remove.js +33 -56
  90. package/dist/m365/spo/commands/listitem/listitem-roleassignment-add.js +55 -98
  91. package/dist/m365/spo/commands/listitem/listitem-roleassignment-remove.js +48 -74
  92. package/dist/m365/spo/commands/listitem/listitem-roleinheritance-break.js +33 -56
  93. package/dist/m365/spo/commands/listitem/listitem-roleinheritance-reset.js +31 -53
  94. package/dist/m365/spo/commands/listitem/listitem-set.js +33 -58
  95. package/dist/m365/spo/commands/navigation/navigation-node-add.js +74 -120
  96. package/dist/m365/spo/commands/navigation/navigation-node-get.js +4 -13
  97. package/dist/m365/spo/commands/navigation/navigation-node-set.js +53 -114
  98. package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-list.js +1 -1
  99. package/dist/m365/spo/commands/page/page-column-list.js +7 -8
  100. package/dist/m365/spo/commands/page/page-section-list.js +15 -17
  101. package/dist/m365/spo/commands/page/page-unpublish.js +53 -0
  102. package/dist/m365/spo/commands/sitescript/sitescript-add.js +22 -37
  103. package/dist/m365/spo/commands/sitescript/sitescript-get.js +9 -26
  104. package/dist/m365/spo/commands/sitescript/sitescript-list.js +5 -0
  105. package/dist/m365/spo/commands/sitescript/sitescript-remove.js +9 -33
  106. package/dist/m365/spo/commands/sitescript/sitescript-set.js +29 -56
  107. package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-add.js +8 -1
  108. package/dist/m365/spo/commands/tenant/tenant-commandset-add.js +8 -1
  109. package/dist/m365/spo/commands/term/term-group-list.js +7 -8
  110. package/dist/m365/spo/commands/term/term-set-list.js +6 -9
  111. package/dist/m365/spo/commands.js +3 -1
  112. package/dist/m365/spp/commands/contentcenter/contentcenter-list.js +5 -0
  113. package/dist/m365/spp/commands/model/model-get.js +25 -45
  114. package/dist/m365/spp/commands/model/model-list.js +12 -23
  115. package/dist/m365/spp/commands/model/model-remove.js +25 -45
  116. package/dist/m365/teams/commands/chat/chat-get.js +30 -45
  117. package/dist/m365/teams/commands/chat/chat-list.js +22 -42
  118. package/dist/m365/teams/commands/chat/chat-member-add.js +43 -64
  119. package/dist/m365/teams/commands/chat/chat-member-list.js +10 -23
  120. package/dist/m365/teams/commands/chat/chat-member-remove.js +28 -50
  121. package/dist/m365/teams/commands/chat/chat-message-send.js +32 -55
  122. package/dist/m365/teams/commands/meeting/meeting-add.js +57 -68
  123. package/dist/m365/teams/commands/meeting/meeting-attendancereport-get.js +33 -58
  124. package/dist/m365/teams/commands/meeting/meeting-attendancereport-list.js +14 -38
  125. package/dist/m365/teams/commands/meeting/meeting-get.js +14 -38
  126. package/dist/m365/teams/commands/meeting/meeting-list.js +34 -59
  127. package/dist/m365/teams/commands/meeting/meeting-transcript-get.js +34 -58
  128. package/dist/m365/teams/commands/meeting/meeting-transcript-list.js +29 -50
  129. package/dist/m365/teams/commands/message/message-get.js +19 -30
  130. package/dist/m365/teams/commands/message/message-list.js +26 -43
  131. package/dist/m365/teams/commands/message/message-remove.js +43 -58
  132. package/dist/m365/teams/commands/message/message-reply-list.js +19 -30
  133. package/dist/m365/teams/commands/message/message-restore.js +40 -50
  134. package/dist/m365/teams/commands/message/message-send.js +19 -30
  135. package/dist/m365/teams/commands/report/report-deviceusagedistributionusercounts.js +10 -0
  136. package/dist/m365/teams/commands/report/report-deviceusageusercounts.js +10 -0
  137. package/dist/m365/teams/commands/report/report-deviceusageuserdetail.js +22 -0
  138. package/dist/m365/teams/commands/report/report-directroutingcalls.js +19 -39
  139. package/dist/m365/teams/commands/report/report-pstncalls.js +19 -39
  140. package/dist/m365/teams/commands/report/report-useractivitycounts.js +10 -0
  141. package/dist/m365/teams/commands/report/report-useractivityusercounts.js +10 -0
  142. package/dist/m365/teams/commands/report/report-useractivityuserdetail.js +22 -0
  143. package/dist/m365/teams/commands/tab/tab-add.js +23 -49
  144. package/dist/m365/teams/commands/tab/tab-get.js +55 -56
  145. package/dist/m365/teams/commands/tab/tab-list.js +17 -28
  146. package/dist/m365/teams/commands/tab/tab-remove.js +23 -42
  147. package/dist/m365/teams/commands/team/team-add.js +76 -114
  148. package/dist/m365/teams/commands/team/team-app-list.js +23 -36
  149. package/dist/m365/teams/commands/team/team-archive.js +24 -39
  150. package/dist/m365/teams/commands/team/team-clone.js +28 -62
  151. package/dist/m365/teams/commands/team/team-get.js +23 -36
  152. package/dist/m365/teams/commands/team/team-list.js +43 -57
  153. package/dist/m365/teams/commands/team/team-remove.js +24 -37
  154. package/dist/m365/teams/commands/team/team-set.js +23 -52
  155. package/dist/m365/teams/commands/team/team-unarchive.js +23 -28
  156. package/dist/m365/teams/commands/user/user-app-add.js +40 -49
  157. package/dist/m365/teams/commands/user/user-app-list.js +26 -39
  158. package/dist/m365/teams/commands/user/user-app-remove.js +37 -49
  159. package/dist/m365/teams/commands/user/user-app-upgrade.js +36 -52
  160. package/dist/m365/teams/commands/user/user-list.js +17 -39
  161. package/dist/m365/tenant/commands/report/report-activeusercounts.js +2 -1
  162. package/dist/m365/tenant/commands/report/report-activeuserdetail.js +2 -1
  163. package/dist/m365/tenant/commands/report/report-office365activationcounts.js +9 -0
  164. package/dist/m365/tenant/commands/report/report-office365activationsusercounts.js +9 -0
  165. package/dist/m365/tenant/commands/report/report-office365activationsuserdetail.js +9 -0
  166. package/dist/m365/tenant/commands/report/report-servicesusercounts.js +2 -1
  167. package/dist/m365/tenant/commands/report/report-settings-get.js +5 -0
  168. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-health-get.js +9 -20
  169. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-health-list.js +8 -20
  170. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-healthissue-get.js +8 -15
  171. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-healthissue-list.js +8 -15
  172. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-message-get.js +12 -26
  173. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-message-list.js +8 -22
  174. package/dist/utils/formatting.js +16 -0
  175. package/dist/utils/pid.js +7 -16
  176. package/dist/utils/spo.js +39 -0
  177. package/dist/utils/zod.js +4 -4
  178. package/docs/docs/cmd/login.mdx +15 -2
  179. package/docs/docs/cmd/spe/container/container-permission-remove.mdx +78 -0
  180. package/docs/docs/cmd/spfx/project/project-upgrade.mdx +1 -1
  181. package/docs/docs/cmd/spo/externaluser/externaluser-list.mdx +17 -30
  182. package/docs/docs/cmd/spo/file/file-archive.mdx +1 -1
  183. package/docs/docs/cmd/spo/file/file-checkin.mdx +2 -2
  184. package/docs/docs/cmd/spo/file/file-checkout-undo.mdx +1 -1
  185. package/docs/docs/cmd/spo/file/file-checkout.mdx +2 -2
  186. package/docs/docs/cmd/spo/file/file-copy.mdx +2 -2
  187. package/docs/docs/cmd/spo/file/file-get.mdx +6 -6
  188. package/docs/docs/cmd/spo/file/file-retentionlabel-ensure.mdx +1 -1
  189. package/docs/docs/cmd/spo/file/file-retentionlabel-remove.mdx +1 -1
  190. package/docs/docs/cmd/spo/file/file-roleassignment-add.mdx +1 -1
  191. package/docs/docs/cmd/spo/file/file-roleassignment-remove.mdx +1 -1
  192. package/docs/docs/cmd/spo/file/file-roleinheritance-break.mdx +3 -3
  193. package/docs/docs/cmd/spo/file/file-roleinheritance-reset.mdx +2 -2
  194. package/docs/docs/cmd/spo/file/file-sharinginfo-get.mdx +2 -2
  195. package/docs/docs/cmd/spo/file/file-sharinglink-add.mdx +1 -1
  196. package/docs/docs/cmd/spo/file/file-sharinglink-clear.mdx +1 -1
  197. package/docs/docs/cmd/spo/file/file-sharinglink-get.mdx +1 -1
  198. package/docs/docs/cmd/spo/file/file-sharinglink-list.mdx +1 -1
  199. package/docs/docs/cmd/spo/file/file-sharinglink-remove.mdx +1 -1
  200. package/docs/docs/cmd/spo/file/file-sharinglink-set.mdx +1 -1
  201. package/docs/docs/cmd/spo/file/file-unarchive.mdx +1 -1
  202. package/docs/docs/cmd/spo/file/file-version-clear.mdx +1 -1
  203. package/docs/docs/cmd/spo/file/file-version-get.mdx +1 -1
  204. package/docs/docs/cmd/spo/file/file-version-keep.mdx +1 -1
  205. package/docs/docs/cmd/spo/file/file-version-list.mdx +1 -1
  206. package/docs/docs/cmd/spo/file/file-version-remove.mdx +1 -1
  207. package/docs/docs/cmd/spo/file/file-version-restore.mdx +1 -1
  208. package/docs/docs/cmd/spo/folder/folder-archive.mdx +1 -1
  209. package/docs/docs/cmd/spo/folder/folder-copy.mdx +1 -1
  210. package/docs/docs/cmd/spo/folder/folder-get.mdx +2 -2
  211. package/docs/docs/cmd/spo/folder/folder-retentionlabel-ensure.mdx +1 -1
  212. package/docs/docs/cmd/spo/folder/folder-retentionlabel-remove.mdx +1 -1
  213. package/docs/docs/cmd/spo/folder/folder-sharinglink-add.mdx +1 -1
  214. package/docs/docs/cmd/spo/folder/folder-sharinglink-list.mdx +1 -1
  215. package/docs/docs/cmd/spo/folder/folder-sharinglink-remove.mdx +1 -1
  216. package/docs/docs/cmd/spo/folder/folder-unarchive.mdx +76 -0
  217. package/docs/docs/cmd/spo/navigation/navigation-node-add.mdx +45 -30
  218. package/docs/docs/cmd/spo/navigation/navigation-node-get.mdx +64 -42
  219. package/docs/docs/cmd/spo/navigation/navigation-node-set.mdx +10 -8
  220. package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-list.mdx +0 -21
  221. package/docs/docs/cmd/spo/page/page-unpublish.mdx +63 -0
  222. package/docs/docs/cmd/spp/model/model-get.mdx +1 -1
  223. package/docs/docs/cmd/spp/model/model-remove.mdx +1 -1
  224. package/docs/docs/cmd/teams/tab/tab-add.mdx +19 -0
  225. package/docs/docs/cmd/teams/tab/tab-get.mdx +19 -0
  226. package/docs/docs/cmd/teams/tab/tab-list.mdx +19 -0
  227. package/docs/docs/cmd/teams/tab/tab-remove.mdx +21 -0
  228. package/docs/docs/cmd/viva/engage/engage-message-add.mdx +17 -0
  229. package/docs/docs/cmd/viva/engage/engage-message-get.mdx +17 -0
  230. package/docs/docs/cmd/viva/engage/engage-message-list.mdx +17 -0
  231. package/docs/docs/cmd/viva/engage/engage-message-remove.mdx +19 -0
  232. package/package.json +4 -6
@@ -1,9 +1,5 @@
1
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
- 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");
4
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
- };
6
- var _SppModelRemoveCommand_instances, _SppModelRemoveCommand_initTelemetry, _SppModelRemoveCommand_initOptions, _SppModelRemoveCommand_initValidators, _SppModelRemoveCommand_initOptionSets, _SppModelRemoveCommand_initTypes;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import { cli } from '../../../../cli/cli.js';
8
4
  import request from '../../../../request.js';
9
5
  import { formatting } from '../../../../utils/formatting.js';
@@ -12,6 +8,17 @@ import { urlUtil } from '../../../../utils/urlUtil.js';
12
8
  import { validation } from '../../../../utils/validation.js';
13
9
  import SpoCommand from '../../../base/SpoCommand.js';
14
10
  import commands from '../../commands.js';
11
+ export const options = z.strictObject({
12
+ ...globalOptionsZod.shape,
13
+ siteUrl: z.string()
14
+ .refine(url => validation.isValidSharePointUrl(url) === true, {
15
+ error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
16
+ })
17
+ .alias('u'),
18
+ id: z.guid().optional().alias('i'),
19
+ title: z.string().optional().alias('t'),
20
+ force: z.boolean().optional().alias('f')
21
+ });
15
22
  class SppModelRemoveCommand extends SpoCommand {
16
23
  get name() {
17
24
  return commands.MODEL_REMOVE;
@@ -19,14 +26,18 @@ class SppModelRemoveCommand extends SpoCommand {
19
26
  get description() {
20
27
  return 'Deletes a document understanding model';
21
28
  }
22
- constructor() {
23
- super();
24
- _SppModelRemoveCommand_instances.add(this);
25
- __classPrivateFieldGet(this, _SppModelRemoveCommand_instances, "m", _SppModelRemoveCommand_initTelemetry).call(this);
26
- __classPrivateFieldGet(this, _SppModelRemoveCommand_instances, "m", _SppModelRemoveCommand_initOptions).call(this);
27
- __classPrivateFieldGet(this, _SppModelRemoveCommand_instances, "m", _SppModelRemoveCommand_initValidators).call(this);
28
- __classPrivateFieldGet(this, _SppModelRemoveCommand_instances, "m", _SppModelRemoveCommand_initOptionSets).call(this);
29
- __classPrivateFieldGet(this, _SppModelRemoveCommand_instances, "m", _SppModelRemoveCommand_initTypes).call(this);
29
+ get schema() {
30
+ return options;
31
+ }
32
+ getRefinedSchema(schema) {
33
+ return schema
34
+ .refine(opts => [opts.id, opts.title].filter(x => x !== undefined).length === 1, {
35
+ message: `Specify either 'id' or 'title', but not both.`,
36
+ params: {
37
+ customCode: 'optionSet',
38
+ options: ['id', 'title']
39
+ }
40
+ });
30
41
  }
31
42
  async commandAction(logger, args) {
32
43
  try {
@@ -70,36 +81,5 @@ class SppModelRemoveCommand extends SpoCommand {
70
81
  }
71
82
  }
72
83
  }
73
- _SppModelRemoveCommand_instances = new WeakSet(), _SppModelRemoveCommand_initTelemetry = function _SppModelRemoveCommand_initTelemetry() {
74
- this.telemetry.push((args) => {
75
- Object.assign(this.telemetryProperties, {
76
- id: typeof args.options.id !== 'undefined',
77
- title: typeof args.options.title !== 'undefined',
78
- force: !!args.options.force
79
- });
80
- });
81
- }, _SppModelRemoveCommand_initOptions = function _SppModelRemoveCommand_initOptions() {
82
- this.options.unshift({
83
- option: '-u, --siteUrl <siteUrl>'
84
- }, {
85
- option: '-i, --id [id]'
86
- }, {
87
- option: '-t, --title [title]'
88
- }, {
89
- option: '-f, --force'
90
- });
91
- }, _SppModelRemoveCommand_initValidators = function _SppModelRemoveCommand_initValidators() {
92
- this.validators.push(async (args) => {
93
- if (args.options.id && !validation.isValidGuid(args.options.id)) {
94
- return `${args.options.id} is not a valid GUID for option 'id'.`;
95
- }
96
- return validation.isValidSharePointUrl(args.options.siteUrl);
97
- });
98
- }, _SppModelRemoveCommand_initOptionSets = function _SppModelRemoveCommand_initOptionSets() {
99
- this.optionSets.push({ options: ['id', 'title'] });
100
- }, _SppModelRemoveCommand_initTypes = function _SppModelRemoveCommand_initTypes() {
101
- this.types.string.push('siteUrl', 'id', 'title');
102
- this.types.boolean.push('force');
103
- };
104
84
  export default new SppModelRemoveCommand();
105
85
  //# sourceMappingURL=model-remove.js.map
@@ -1,10 +1,6 @@
1
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
- 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");
4
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
- };
6
- var _TeamsChatGetCommand_instances, _TeamsChatGetCommand_initTelemetry, _TeamsChatGetCommand_initOptions, _TeamsChatGetCommand_initValidators, _TeamsChatGetCommand_initOptionSets;
1
+ import { z } from 'zod';
7
2
  import auth from '../../../../Auth.js';
3
+ import { globalOptionsZod } from '../../../../Command.js';
8
4
  import request from '../../../../request.js';
9
5
  import { accessToken } from '../../../../utils/accessToken.js';
10
6
  import { formatting } from '../../../../utils/formatting.js';
@@ -13,6 +9,22 @@ import GraphCommand from '../../../base/GraphCommand.js';
13
9
  import commands from '../../commands.js';
14
10
  import { chatUtil } from './chatUtil.js';
15
11
  import { cli } from '../../../../cli/cli.js';
12
+ export const options = z.strictObject({
13
+ ...globalOptionsZod.shape,
14
+ id: z.string().refine(val => validation.isValidTeamsChatId(val), {
15
+ message: 'The value is not a valid Teams ChatId.'
16
+ }).alias('i').optional(),
17
+ participants: z.string().refine(val => {
18
+ const participants = val.trim().toLowerCase().split(',').filter(e => e && e !== '');
19
+ if (!participants || participants.length === 0) {
20
+ return false;
21
+ }
22
+ return participants.every(e => validation.isValidUserPrincipalName(e));
23
+ }, {
24
+ message: 'The option participants contains one or more invalid email addresses.'
25
+ }).alias('p').optional(),
26
+ name: z.string().alias('n').optional()
27
+ });
16
28
  class TeamsChatGetCommand extends GraphCommand {
17
29
  get name() {
18
30
  return commands.CHAT_GET;
@@ -20,13 +32,18 @@ class TeamsChatGetCommand extends GraphCommand {
20
32
  get description() {
21
33
  return 'Gets a Microsoft Teams chat conversation by id, participants or chat name.';
22
34
  }
23
- constructor() {
24
- super();
25
- _TeamsChatGetCommand_instances.add(this);
26
- __classPrivateFieldGet(this, _TeamsChatGetCommand_instances, "m", _TeamsChatGetCommand_initTelemetry).call(this);
27
- __classPrivateFieldGet(this, _TeamsChatGetCommand_instances, "m", _TeamsChatGetCommand_initOptions).call(this);
28
- __classPrivateFieldGet(this, _TeamsChatGetCommand_instances, "m", _TeamsChatGetCommand_initValidators).call(this);
29
- __classPrivateFieldGet(this, _TeamsChatGetCommand_instances, "m", _TeamsChatGetCommand_initOptionSets).call(this);
35
+ get schema() {
36
+ return options;
37
+ }
38
+ getRefinedSchema(schema) {
39
+ return schema
40
+ .refine(opts => [opts.id, opts.participants, opts.name].filter(x => x !== undefined).length === 1, {
41
+ message: 'Specify one of id, participants or name, but not more than one.',
42
+ params: {
43
+ customCode: 'optionSet',
44
+ options: ['id', 'participants', 'name']
45
+ }
46
+ });
30
47
  }
31
48
  async commandAction(logger, args) {
32
49
  try {
@@ -83,37 +100,5 @@ class TeamsChatGetCommand extends GraphCommand {
83
100
  return result.id;
84
101
  }
85
102
  }
86
- _TeamsChatGetCommand_instances = new WeakSet(), _TeamsChatGetCommand_initTelemetry = function _TeamsChatGetCommand_initTelemetry() {
87
- this.telemetry.push((args) => {
88
- Object.assign(this.telemetryProperties, {
89
- id: typeof args.options.id !== 'undefined',
90
- participants: typeof args.options.participants !== 'undefined',
91
- name: typeof args.options.name !== 'undefined'
92
- });
93
- });
94
- }, _TeamsChatGetCommand_initOptions = function _TeamsChatGetCommand_initOptions() {
95
- this.options.unshift({
96
- option: '-i, --id [id]'
97
- }, {
98
- option: '-p, --participants [participants]'
99
- }, {
100
- option: '-n, --name [name]'
101
- });
102
- }, _TeamsChatGetCommand_initValidators = function _TeamsChatGetCommand_initValidators() {
103
- this.validators.push(async (args) => {
104
- if (args.options.id && !validation.isValidTeamsChatId(args.options.id)) {
105
- return `${args.options.id} is not a valid Teams ChatId.`;
106
- }
107
- if (args.options.participants) {
108
- const participants = args.options.participants.trim().toLowerCase().split(',').filter(e => e && e !== '');
109
- if (!participants || participants.length === 0 || participants.some(e => !validation.isValidUserPrincipalName(e))) {
110
- return `${args.options.participants} contains one or more invalid email addresses.`;
111
- }
112
- }
113
- return true;
114
- });
115
- }, _TeamsChatGetCommand_initOptionSets = function _TeamsChatGetCommand_initOptionSets() {
116
- this.optionSets.push({ options: ['id', 'participants', 'name'] });
117
- };
118
103
  export default new TeamsChatGetCommand();
119
104
  //# sourceMappingURL=chat-get.js.map
@@ -1,15 +1,19 @@
1
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
- 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");
4
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
- };
6
- var _TeamsChatListCommand_instances, _TeamsChatListCommand_initTelemetry, _TeamsChatListCommand_initOptions, _TeamsChatListCommand_initValidators;
1
+ import { z } from 'zod';
7
2
  import auth from '../../../../Auth.js';
3
+ import { globalOptionsZod } from '../../../../Command.js';
8
4
  import { accessToken } from '../../../../utils/accessToken.js';
9
5
  import { odata } from '../../../../utils/odata.js';
10
6
  import { validation } from '../../../../utils/validation.js';
11
7
  import GraphCommand from '../../../base/GraphCommand.js';
12
8
  import commands from '../../commands.js';
9
+ export const options = z.strictObject({
10
+ ...globalOptionsZod.shape,
11
+ type: z.enum(['oneOnOne', 'group', 'meeting']).alias('t').optional(),
12
+ userId: z.string().refine(val => validation.isValidGuid(val), {
13
+ message: 'The value of the option userId must be a valid GUID.'
14
+ }).optional(),
15
+ userName: z.string().optional()
16
+ });
13
17
  class TeamsChatListCommand extends GraphCommand {
14
18
  get name() {
15
19
  return commands.CHAT_LIST;
@@ -20,13 +24,18 @@ class TeamsChatListCommand extends GraphCommand {
20
24
  defaultProperties() {
21
25
  return ['id', 'topic', 'chatType'];
22
26
  }
23
- constructor() {
24
- super();
25
- _TeamsChatListCommand_instances.add(this);
26
- this.supportedTypes = ['oneOnOne', 'group', 'meeting'];
27
- __classPrivateFieldGet(this, _TeamsChatListCommand_instances, "m", _TeamsChatListCommand_initTelemetry).call(this);
28
- __classPrivateFieldGet(this, _TeamsChatListCommand_instances, "m", _TeamsChatListCommand_initOptions).call(this);
29
- __classPrivateFieldGet(this, _TeamsChatListCommand_instances, "m", _TeamsChatListCommand_initValidators).call(this);
27
+ get schema() {
28
+ return options;
29
+ }
30
+ getRefinedSchema(schema) {
31
+ return schema
32
+ .refine(opts => !(opts.userId && opts.userName), {
33
+ message: 'You can only specify either userId or userName.',
34
+ params: {
35
+ customCode: 'optionSet',
36
+ options: ['userId', 'userName']
37
+ }
38
+ });
30
39
  }
31
40
  async commandAction(logger, args) {
32
41
  const isAppOnlyAccessToken = accessToken.isAppOnlyAccessToken(auth.connection.accessTokens[this.resource].accessToken);
@@ -49,34 +58,5 @@ class TeamsChatListCommand extends GraphCommand {
49
58
  }
50
59
  }
51
60
  }
52
- _TeamsChatListCommand_instances = new WeakSet(), _TeamsChatListCommand_initTelemetry = function _TeamsChatListCommand_initTelemetry() {
53
- this.telemetry.push((args) => {
54
- Object.assign(this.telemetryProperties, {
55
- type: args.options.type
56
- });
57
- });
58
- }, _TeamsChatListCommand_initOptions = function _TeamsChatListCommand_initOptions() {
59
- this.options.unshift({
60
- option: '-t, --type [type]',
61
- autocomplete: this.supportedTypes
62
- }, {
63
- option: '--userId [userId]'
64
- }, {
65
- option: '--userName [userName]'
66
- });
67
- }, _TeamsChatListCommand_initValidators = function _TeamsChatListCommand_initValidators() {
68
- this.validators.push(async (args) => {
69
- if (args.options.type !== undefined && this.supportedTypes.indexOf(args.options.type) === -1) {
70
- return `${args.options.type} is not a valid chatType. Accepted values are ${this.supportedTypes.join(', ')}`;
71
- }
72
- if (args.options.userId && args.options.userName) {
73
- return `You can only specify either 'userId' or 'userName'`;
74
- }
75
- if (args.options.userId && !validation.isValidGuid(args.options.userId)) {
76
- return `${args.options.userId} is not a valid GUID`;
77
- }
78
- return true;
79
- });
80
- };
81
61
  export default new TeamsChatListCommand();
82
62
  //# sourceMappingURL=chat-list.js.map
@@ -1,14 +1,27 @@
1
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
- 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");
4
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
- };
6
- var _TeamsChatMemberAddCommand_instances, _a, _TeamsChatMemberAddCommand_initTelemetry, _TeamsChatMemberAddCommand_initOptions, _TeamsChatMemberAddCommand_initValidators, _TeamsChatMemberAddCommand_initOptionSets;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import request from '../../../../request.js';
8
4
  import { formatting } from '../../../../utils/formatting.js';
9
5
  import { validation } from '../../../../utils/validation.js';
10
6
  import GraphCommand from '../../../base/GraphCommand.js';
11
7
  import commands from '../../commands.js';
8
+ export const options = z.strictObject({
9
+ ...globalOptionsZod.shape,
10
+ chatId: z.string().refine(val => validation.isValidTeamsChatId(val), {
11
+ message: 'The value of the option chatId must be a valid Teams ChatId.'
12
+ }).alias('i'),
13
+ userId: z.string().refine(val => validation.isValidGuid(val), {
14
+ message: 'The value of the option userId must be a valid GUID.'
15
+ }).optional(),
16
+ userName: z.string().refine(val => validation.isValidUserPrincipalName(val), {
17
+ message: 'The value of the option userName must be a valid user principal name.'
18
+ }).optional(),
19
+ role: z.enum(['owner', 'guest']).optional(),
20
+ visibleHistoryStartDateTime: z.string().refine(val => validation.isValidISODateTime(val), {
21
+ message: 'The value of the option visibleHistoryStartDateTime is not a valid ISO date.'
22
+ }).optional(),
23
+ withAllHistory: z.boolean().optional()
24
+ });
12
25
  class TeamsChatMemberAddCommand extends GraphCommand {
13
26
  get name() {
14
27
  return commands.CHAT_MEMBER_ADD;
@@ -16,13 +29,30 @@ class TeamsChatMemberAddCommand extends GraphCommand {
16
29
  get description() {
17
30
  return 'Adds a member to a Microsoft Teams chat conversation.';
18
31
  }
19
- constructor() {
20
- super();
21
- _TeamsChatMemberAddCommand_instances.add(this);
22
- __classPrivateFieldGet(this, _TeamsChatMemberAddCommand_instances, "m", _TeamsChatMemberAddCommand_initTelemetry).call(this);
23
- __classPrivateFieldGet(this, _TeamsChatMemberAddCommand_instances, "m", _TeamsChatMemberAddCommand_initOptions).call(this);
24
- __classPrivateFieldGet(this, _TeamsChatMemberAddCommand_instances, "m", _TeamsChatMemberAddCommand_initValidators).call(this);
25
- __classPrivateFieldGet(this, _TeamsChatMemberAddCommand_instances, "m", _TeamsChatMemberAddCommand_initOptionSets).call(this);
32
+ get schema() {
33
+ return options;
34
+ }
35
+ getRefinedSchema(schema) {
36
+ return schema
37
+ .refine(opts => [opts.userId, opts.userName].filter(x => x !== undefined).length === 1, {
38
+ message: 'Specify either userId or userName, but not both.',
39
+ params: {
40
+ customCode: 'optionSet',
41
+ options: ['userId', 'userName']
42
+ }
43
+ })
44
+ .refine(opts => {
45
+ if (opts.visibleHistoryStartDateTime && opts.withAllHistory) {
46
+ return false;
47
+ }
48
+ return true;
49
+ }, {
50
+ message: 'Specify either visibleHistoryStartDateTime or withAllHistory, but not both.',
51
+ params: {
52
+ customCode: 'optionSet',
53
+ options: ['visibleHistoryStartDateTime', 'withAllHistory']
54
+ }
55
+ });
26
56
  }
27
57
  async commandAction(logger, args) {
28
58
  try {
@@ -49,56 +79,5 @@ class TeamsChatMemberAddCommand extends GraphCommand {
49
79
  }
50
80
  }
51
81
  }
52
- _a = TeamsChatMemberAddCommand, _TeamsChatMemberAddCommand_instances = new WeakSet(), _TeamsChatMemberAddCommand_initTelemetry = function _TeamsChatMemberAddCommand_initTelemetry() {
53
- this.telemetry.push((args) => {
54
- Object.assign(this.telemetryProperties, {
55
- userId: typeof args.options.userId !== 'undefined',
56
- userName: typeof args.options.userName !== 'undefined',
57
- role: typeof args.options.role !== 'undefined',
58
- visibleHistoryStartDateTime: typeof args.options.visibleHistoryStartDateTime !== 'undefined',
59
- withAllHistory: !!args.options.withAllHistory
60
- });
61
- });
62
- }, _TeamsChatMemberAddCommand_initOptions = function _TeamsChatMemberAddCommand_initOptions() {
63
- this.options.unshift({
64
- option: '-i, --chatId <chatId>'
65
- }, {
66
- option: '--userId [userId]'
67
- }, {
68
- option: '--userName [userName]'
69
- }, {
70
- option: '--role [role]',
71
- autocomplete: _a.roles
72
- }, {
73
- option: '--visibleHistoryStartDateTime [visibleHistoryStartDateTime]'
74
- }, {
75
- option: '--withAllHistory'
76
- });
77
- }, _TeamsChatMemberAddCommand_initValidators = function _TeamsChatMemberAddCommand_initValidators() {
78
- this.validators.push(async (args) => {
79
- if (!validation.isValidTeamsChatId(args.options.chatId)) {
80
- return `${args.options.chatId} is not a valid chatId.`;
81
- }
82
- if (args.options.userId && !validation.isValidGuid(args.options.userId)) {
83
- return `${args.options.userId} is not a valid userId.`;
84
- }
85
- if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) {
86
- return `${args.options.userName} is not a valid userName.`;
87
- }
88
- if (args.options.role && _a.roles.indexOf(args.options.role) < 0) {
89
- return `${args.options.role} is not a valid role. Allowed values are ${_a.roles.join(', ')}`;
90
- }
91
- if (args.options.visibleHistoryStartDateTime && !validation.isValidISODateTime(args.options.visibleHistoryStartDateTime)) {
92
- return `'${args.options.visibleHistoryStartDateTime}' is not a valid visibleHistoryStartDateTime.`;
93
- }
94
- return true;
95
- });
96
- }, _TeamsChatMemberAddCommand_initOptionSets = function _TeamsChatMemberAddCommand_initOptionSets() {
97
- this.optionSets.push({ options: ['userId', 'userName'] }, {
98
- options: ['visibleHistoryStartDateTime', 'withAllHistory'],
99
- runsWhen: (args) => args.options.visibleHistoryStartDateTime || args.options.withAllHistory
100
- });
101
- };
102
- TeamsChatMemberAddCommand.roles = ['owner', 'guest'];
103
82
  export default new TeamsChatMemberAddCommand();
104
83
  //# sourceMappingURL=chat-member-add.js.map
@@ -1,13 +1,15 @@
1
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
- 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");
4
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
- };
6
- var _TeamsChatMemberListCommand_instances, _TeamsChatMemberListCommand_initOptions, _TeamsChatMemberListCommand_initValidators;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import { odata } from '../../../../utils/odata.js';
8
4
  import { validation } from '../../../../utils/validation.js';
9
5
  import GraphCommand from '../../../base/GraphCommand.js';
10
6
  import commands from '../../commands.js';
7
+ export const options = z.strictObject({
8
+ ...globalOptionsZod.shape,
9
+ chatId: z.string().refine(val => validation.isValidTeamsChatId(val), {
10
+ message: 'The value of the option chatId must be a valid Teams ChatId.'
11
+ }).alias('i')
12
+ });
11
13
  class TeamsChatMemberListCommand extends GraphCommand {
12
14
  get name() {
13
15
  return commands.CHAT_MEMBER_LIST;
@@ -18,11 +20,8 @@ class TeamsChatMemberListCommand extends GraphCommand {
18
20
  defaultProperties() {
19
21
  return ['userId', 'displayName', 'email'];
20
22
  }
21
- constructor() {
22
- super();
23
- _TeamsChatMemberListCommand_instances.add(this);
24
- __classPrivateFieldGet(this, _TeamsChatMemberListCommand_instances, "m", _TeamsChatMemberListCommand_initOptions).call(this);
25
- __classPrivateFieldGet(this, _TeamsChatMemberListCommand_instances, "m", _TeamsChatMemberListCommand_initValidators).call(this);
23
+ get schema() {
24
+ return options;
26
25
  }
27
26
  async commandAction(logger, args) {
28
27
  const endpoint = `${this.resource}/v1.0/chats/${args.options.chatId}/members`;
@@ -35,17 +34,5 @@ class TeamsChatMemberListCommand extends GraphCommand {
35
34
  }
36
35
  }
37
36
  }
38
- _TeamsChatMemberListCommand_instances = new WeakSet(), _TeamsChatMemberListCommand_initOptions = function _TeamsChatMemberListCommand_initOptions() {
39
- this.options.unshift({
40
- option: '-i, --chatId <chatId>'
41
- });
42
- }, _TeamsChatMemberListCommand_initValidators = function _TeamsChatMemberListCommand_initValidators() {
43
- this.validators.push(async (args) => {
44
- if (!validation.isValidTeamsChatId(args.options.chatId)) {
45
- return `${args.options.chatId} is not a valid Teams ChatId`;
46
- }
47
- return true;
48
- });
49
- };
50
37
  export default new TeamsChatMemberListCommand();
51
38
  //# sourceMappingURL=chat-member-list.js.map
@@ -1,15 +1,25 @@
1
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
- 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");
4
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
- };
6
- var _TeamsChatMemberRemoveCommand_instances, _TeamsChatMemberRemoveCommand_initTelemetry, _TeamsChatMemberRemoveCommand_initOptions, _TeamsChatMemberRemoveCommand_initValidators, _TeamsChatMemberRemoveCommand_initOptionSets;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import { odata } from '../../../../utils/odata.js';
8
4
  import { validation } from '../../../../utils/validation.js';
9
5
  import GraphCommand from '../../../base/GraphCommand.js';
10
6
  import commands from '../../commands.js';
11
7
  import { cli } from '../../../../cli/cli.js';
12
8
  import request from '../../../../request.js';
9
+ export const options = z.strictObject({
10
+ ...globalOptionsZod.shape,
11
+ chatId: z.string().refine(val => validation.isValidTeamsChatId(val), {
12
+ message: 'The value of the option chatId must be a valid Teams ChatId.'
13
+ }).alias('i'),
14
+ id: z.string().optional(),
15
+ userId: z.string().refine(val => validation.isValidGuid(val), {
16
+ message: 'The value of the option userId must be a valid GUID.'
17
+ }).optional(),
18
+ userName: z.string().refine(val => validation.isValidUserPrincipalName(val), {
19
+ message: 'The value of the option userName must be a valid user principal name.'
20
+ }).optional(),
21
+ force: z.boolean().optional().alias('f')
22
+ });
13
23
  class TeamsChatMemberRemoveCommand extends GraphCommand {
14
24
  get name() {
15
25
  return commands.CHAT_MEMBER_REMOVE;
@@ -17,13 +27,18 @@ class TeamsChatMemberRemoveCommand extends GraphCommand {
17
27
  get description() {
18
28
  return 'Removes a member from a Microsoft Teams chat conversation';
19
29
  }
20
- constructor() {
21
- super();
22
- _TeamsChatMemberRemoveCommand_instances.add(this);
23
- __classPrivateFieldGet(this, _TeamsChatMemberRemoveCommand_instances, "m", _TeamsChatMemberRemoveCommand_initTelemetry).call(this);
24
- __classPrivateFieldGet(this, _TeamsChatMemberRemoveCommand_instances, "m", _TeamsChatMemberRemoveCommand_initOptions).call(this);
25
- __classPrivateFieldGet(this, _TeamsChatMemberRemoveCommand_instances, "m", _TeamsChatMemberRemoveCommand_initValidators).call(this);
26
- __classPrivateFieldGet(this, _TeamsChatMemberRemoveCommand_instances, "m", _TeamsChatMemberRemoveCommand_initOptionSets).call(this);
30
+ get schema() {
31
+ return options;
32
+ }
33
+ getRefinedSchema(schema) {
34
+ return schema
35
+ .refine(opts => [opts.id, opts.userId, opts.userName].filter(x => x !== undefined).length === 1, {
36
+ message: 'Specify one of id, userId or userName, but not more than one.',
37
+ params: {
38
+ customCode: 'optionSet',
39
+ options: ['id', 'userId', 'userName']
40
+ }
41
+ });
27
42
  }
28
43
  async commandAction(logger, args) {
29
44
  const removeUserFromChat = async () => {
@@ -76,42 +91,5 @@ class TeamsChatMemberRemoveCommand extends GraphCommand {
76
91
  }
77
92
  }
78
93
  }
79
- _TeamsChatMemberRemoveCommand_instances = new WeakSet(), _TeamsChatMemberRemoveCommand_initTelemetry = function _TeamsChatMemberRemoveCommand_initTelemetry() {
80
- this.telemetry.push((args) => {
81
- Object.assign(this.telemetryProperties, {
82
- id: typeof args.options.id !== 'undefined',
83
- userId: typeof args.options.userId !== 'undefined',
84
- userName: typeof args.options.userName !== 'undefined',
85
- force: !!args.options.force
86
- });
87
- });
88
- }, _TeamsChatMemberRemoveCommand_initOptions = function _TeamsChatMemberRemoveCommand_initOptions() {
89
- this.options.unshift({
90
- option: '-i, --chatId <chatId>'
91
- }, {
92
- option: '--id [id]'
93
- }, {
94
- option: '--userId [userId]'
95
- }, {
96
- option: '--userName [userName]'
97
- }, {
98
- option: '-f, --force'
99
- });
100
- }, _TeamsChatMemberRemoveCommand_initValidators = function _TeamsChatMemberRemoveCommand_initValidators() {
101
- this.validators.push(async (args) => {
102
- if (!validation.isValidTeamsChatId(args.options.chatId)) {
103
- return `${args.options.chatId} is not a valid Teams chatId.`;
104
- }
105
- if (args.options.userId && !validation.isValidGuid(args.options.userId)) {
106
- return `${args.options.userId} is not a valid userId.`;
107
- }
108
- if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) {
109
- return `${args.options.userName} is not a valid user principal name.`;
110
- }
111
- return true;
112
- });
113
- }, _TeamsChatMemberRemoveCommand_initOptionSets = function _TeamsChatMemberRemoveCommand_initOptionSets() {
114
- this.optionSets.push({ options: ['id', 'userId', 'userName'] });
115
- };
116
94
  export default new TeamsChatMemberRemoveCommand();
117
95
  //# sourceMappingURL=chat-member-remove.js.map