@pnp/cli-microsoft365 12.0.0-beta.d654135 → 12.0.0-beta.e3af9f8

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 (241) hide show
  1. package/.devproxy/generate-openapi-spec.json +1 -1
  2. package/allCommands.json +1 -1
  3. package/allCommandsFull.json +1 -1
  4. package/dist/Auth.js +19 -2
  5. package/dist/cli/cli.js +3 -0
  6. package/dist/googleAnalytics.js +96 -0
  7. package/dist/m365/cli/commands/cli-consent.js +9 -2
  8. package/dist/m365/entra/commands/m365group/m365group-add.js +52 -97
  9. package/dist/m365/entra/commands/m365group/m365group-conversation-list.js +20 -33
  10. package/dist/m365/entra/commands/m365group/m365group-conversation-post-list.js +20 -39
  11. package/dist/m365/entra/commands/m365group/m365group-get.js +20 -41
  12. package/dist/m365/entra/commands/m365group/m365group-list.js +11 -31
  13. package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-clear.js +8 -22
  14. package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-list.js +9 -25
  15. package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-remove.js +21 -43
  16. package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-restore.js +21 -41
  17. package/dist/m365/entra/commands/m365group/m365group-remove.js +25 -46
  18. package/dist/m365/entra/commands/m365group/m365group-renew.js +19 -32
  19. package/dist/m365/entra/commands/m365group/m365group-set.js +86 -141
  20. package/dist/m365/entra/commands/m365group/m365group-teamify.js +20 -43
  21. package/dist/m365/entra/commands/m365group/m365group-user-add.js +44 -77
  22. package/dist/m365/entra/commands/m365group/m365group-user-list.js +28 -55
  23. package/dist/m365/entra/commands/m365group/m365group-user-remove.js +37 -74
  24. package/dist/m365/entra/commands/m365group/m365group-user-set.js +45 -77
  25. package/dist/m365/spe/commands/container/container-permission-remove.js +94 -0
  26. package/dist/m365/spe/commands.js +1 -0
  27. package/dist/m365/spfx/commands/SpfxCompatibilityMatrix.js +15 -0
  28. package/dist/m365/spfx/commands/project/project-doctor/doctor-1.24.0.js +19 -0
  29. package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
  30. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN012021_TSC_excludeDirectories.js +43 -0
  31. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN027002_OVERRIDES_qs.js +33 -0
  32. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN027003_OVERRIDES_uuid.js +33 -0
  33. package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.24.0.js +77 -0
  34. package/dist/m365/spfx/commands/project/project-upgrade.js +2 -1
  35. package/dist/m365/spo/commands/app/app-add.js +35 -56
  36. package/dist/m365/spo/commands/app/app-deploy.js +41 -59
  37. package/dist/m365/spo/commands/app/app-get.js +40 -56
  38. package/dist/m365/spo/commands/app/app-install.js +20 -41
  39. package/dist/m365/spo/commands/app/app-instance-list.js +12 -24
  40. package/dist/m365/spo/commands/app/app-list.js +26 -44
  41. package/dist/m365/spo/commands/app/app-remove.js +32 -52
  42. package/dist/m365/spo/commands/app/app-retract.js +32 -51
  43. package/dist/m365/spo/commands/app/app-teamspackage-download.js +35 -54
  44. package/dist/m365/spo/commands/app/app-uninstall.js +21 -44
  45. package/dist/m365/spo/commands/app/app-upgrade.js +20 -41
  46. package/dist/m365/spo/commands/commandset/commandset-add.js +17 -59
  47. package/dist/m365/spo/commands/commandset/commandset-get.js +24 -62
  48. package/dist/m365/spo/commands/commandset/commandset-list.js +11 -34
  49. package/dist/m365/spo/commands/commandset/commandset-remove.js +21 -54
  50. package/dist/m365/spo/commands/commandset/commandset-set.js +30 -83
  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 -79
  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/page/page-unpublish.js +53 -0
  99. package/dist/m365/spo/commands/sitescript/sitescript-add.js +22 -37
  100. package/dist/m365/spo/commands/sitescript/sitescript-get.js +9 -26
  101. package/dist/m365/spo/commands/sitescript/sitescript-list.js +5 -0
  102. package/dist/m365/spo/commands/sitescript/sitescript-remove.js +9 -33
  103. package/dist/m365/spo/commands/sitescript/sitescript-set.js +29 -56
  104. package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-add.js +8 -1
  105. package/dist/m365/spo/commands/tenant/tenant-commandset-add.js +8 -1
  106. package/dist/m365/spo/commands.js +3 -1
  107. package/dist/m365/spp/commands/contentcenter/contentcenter-list.js +5 -0
  108. package/dist/m365/spp/commands/model/model-get.js +25 -45
  109. package/dist/m365/spp/commands/model/model-list.js +12 -23
  110. package/dist/m365/spp/commands/model/model-remove.js +25 -45
  111. package/dist/m365/teams/commands/channel/channel-add.js +46 -57
  112. package/dist/m365/teams/commands/channel/channel-get.js +41 -48
  113. package/dist/m365/teams/commands/channel/channel-list.js +28 -42
  114. package/dist/m365/teams/commands/channel/channel-member-add.js +53 -54
  115. package/dist/m365/teams/commands/channel/channel-member-list.js +47 -55
  116. package/dist/m365/teams/commands/channel/channel-member-remove.js +62 -62
  117. package/dist/m365/teams/commands/channel/channel-member-set.js +61 -65
  118. package/dist/m365/teams/commands/channel/channel-remove.js +47 -49
  119. package/dist/m365/teams/commands/channel/channel-set.js +47 -54
  120. package/dist/m365/teams/commands/chat/chat-get.js +30 -45
  121. package/dist/m365/teams/commands/chat/chat-list.js +22 -42
  122. package/dist/m365/teams/commands/chat/chat-member-add.js +43 -64
  123. package/dist/m365/teams/commands/chat/chat-member-list.js +10 -23
  124. package/dist/m365/teams/commands/chat/chat-member-remove.js +28 -50
  125. package/dist/m365/teams/commands/chat/chat-message-send.js +32 -55
  126. package/dist/m365/teams/commands/meeting/meeting-add.js +57 -68
  127. package/dist/m365/teams/commands/meeting/meeting-attendancereport-get.js +33 -58
  128. package/dist/m365/teams/commands/meeting/meeting-attendancereport-list.js +14 -38
  129. package/dist/m365/teams/commands/meeting/meeting-get.js +14 -38
  130. package/dist/m365/teams/commands/meeting/meeting-list.js +34 -59
  131. package/dist/m365/teams/commands/meeting/meeting-transcript-get.js +34 -58
  132. package/dist/m365/teams/commands/meeting/meeting-transcript-list.js +29 -50
  133. package/dist/m365/teams/commands/message/message-get.js +19 -30
  134. package/dist/m365/teams/commands/message/message-list.js +26 -43
  135. package/dist/m365/teams/commands/message/message-remove.js +43 -58
  136. package/dist/m365/teams/commands/message/message-reply-list.js +19 -30
  137. package/dist/m365/teams/commands/message/message-restore.js +40 -50
  138. package/dist/m365/teams/commands/message/message-send.js +19 -30
  139. package/dist/m365/teams/commands/report/report-deviceusagedistributionusercounts.js +10 -0
  140. package/dist/m365/teams/commands/report/report-deviceusageusercounts.js +10 -0
  141. package/dist/m365/teams/commands/report/report-deviceusageuserdetail.js +22 -0
  142. package/dist/m365/teams/commands/report/report-directroutingcalls.js +19 -39
  143. package/dist/m365/teams/commands/report/report-pstncalls.js +19 -39
  144. package/dist/m365/teams/commands/report/report-useractivitycounts.js +10 -0
  145. package/dist/m365/teams/commands/report/report-useractivityusercounts.js +10 -0
  146. package/dist/m365/teams/commands/report/report-useractivityuserdetail.js +22 -0
  147. package/dist/m365/teams/commands/tab/tab-add.js +23 -49
  148. package/dist/m365/teams/commands/tab/tab-get.js +55 -56
  149. package/dist/m365/teams/commands/tab/tab-list.js +17 -28
  150. package/dist/m365/teams/commands/tab/tab-remove.js +23 -42
  151. package/dist/m365/teams/commands/team/team-add.js +76 -114
  152. package/dist/m365/teams/commands/team/team-app-list.js +23 -36
  153. package/dist/m365/teams/commands/team/team-archive.js +24 -39
  154. package/dist/m365/teams/commands/team/team-clone.js +28 -62
  155. package/dist/m365/teams/commands/team/team-get.js +23 -36
  156. package/dist/m365/teams/commands/team/team-list.js +43 -57
  157. package/dist/m365/teams/commands/team/team-remove.js +24 -37
  158. package/dist/m365/teams/commands/team/team-set.js +23 -52
  159. package/dist/m365/teams/commands/team/team-unarchive.js +23 -28
  160. package/dist/m365/teams/commands/user/user-app-add.js +40 -49
  161. package/dist/m365/teams/commands/user/user-app-list.js +26 -39
  162. package/dist/m365/teams/commands/user/user-app-remove.js +37 -49
  163. package/dist/m365/teams/commands/user/user-app-upgrade.js +36 -52
  164. package/dist/m365/teams/commands/user/user-list.js +17 -39
  165. package/dist/m365/tenant/commands/report/report-activeusercounts.js +2 -1
  166. package/dist/m365/tenant/commands/report/report-activeuserdetail.js +2 -1
  167. package/dist/m365/tenant/commands/report/report-office365activationcounts.js +9 -0
  168. package/dist/m365/tenant/commands/report/report-office365activationsusercounts.js +9 -0
  169. package/dist/m365/tenant/commands/report/report-office365activationsuserdetail.js +9 -0
  170. package/dist/m365/tenant/commands/report/report-servicesusercounts.js +2 -1
  171. package/dist/m365/tenant/commands/report/report-settings-get.js +5 -0
  172. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-health-get.js +9 -20
  173. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-health-list.js +8 -20
  174. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-healthissue-get.js +8 -15
  175. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-healthissue-list.js +8 -15
  176. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-message-get.js +12 -26
  177. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-message-list.js +8 -22
  178. package/dist/m365/util/commands/accesstoken/accesstoken-get.js +10 -28
  179. package/dist/telemetry.js +7 -11
  180. package/dist/utils/spo.js +40 -3
  181. package/dist/utils/urlUtil.js +2 -2
  182. package/dist/utils/zod.js +4 -4
  183. package/docs/docs/cmd/login.mdx +15 -2
  184. package/docs/docs/cmd/spe/container/container-permission-remove.mdx +78 -0
  185. package/docs/docs/cmd/spfx/project/project-upgrade.mdx +1 -1
  186. package/docs/docs/cmd/spo/file/file-archive.mdx +1 -1
  187. package/docs/docs/cmd/spo/file/file-checkin.mdx +2 -2
  188. package/docs/docs/cmd/spo/file/file-checkout-undo.mdx +1 -1
  189. package/docs/docs/cmd/spo/file/file-checkout.mdx +2 -2
  190. package/docs/docs/cmd/spo/file/file-copy.mdx +2 -2
  191. package/docs/docs/cmd/spo/file/file-get.mdx +6 -6
  192. package/docs/docs/cmd/spo/file/file-retentionlabel-ensure.mdx +1 -1
  193. package/docs/docs/cmd/spo/file/file-retentionlabel-remove.mdx +1 -1
  194. package/docs/docs/cmd/spo/file/file-roleassignment-add.mdx +1 -1
  195. package/docs/docs/cmd/spo/file/file-roleassignment-remove.mdx +1 -1
  196. package/docs/docs/cmd/spo/file/file-roleinheritance-break.mdx +3 -3
  197. package/docs/docs/cmd/spo/file/file-roleinheritance-reset.mdx +2 -2
  198. package/docs/docs/cmd/spo/file/file-sharinginfo-get.mdx +2 -2
  199. package/docs/docs/cmd/spo/file/file-sharinglink-add.mdx +22 -1
  200. package/docs/docs/cmd/spo/file/file-sharinglink-clear.mdx +24 -1
  201. package/docs/docs/cmd/spo/file/file-sharinglink-get.mdx +22 -1
  202. package/docs/docs/cmd/spo/file/file-sharinglink-list.mdx +22 -1
  203. package/docs/docs/cmd/spo/file/file-sharinglink-remove.mdx +24 -1
  204. package/docs/docs/cmd/spo/file/file-sharinglink-set.mdx +22 -1
  205. package/docs/docs/cmd/spo/file/file-unarchive.mdx +1 -1
  206. package/docs/docs/cmd/spo/file/file-version-clear.mdx +1 -1
  207. package/docs/docs/cmd/spo/file/file-version-get.mdx +1 -1
  208. package/docs/docs/cmd/spo/file/file-version-keep.mdx +1 -1
  209. package/docs/docs/cmd/spo/file/file-version-list.mdx +1 -1
  210. package/docs/docs/cmd/spo/file/file-version-remove.mdx +1 -1
  211. package/docs/docs/cmd/spo/file/file-version-restore.mdx +1 -1
  212. package/docs/docs/cmd/spo/folder/folder-archive.mdx +1 -1
  213. package/docs/docs/cmd/spo/folder/folder-copy.mdx +1 -1
  214. package/docs/docs/cmd/spo/folder/folder-get.mdx +2 -2
  215. package/docs/docs/cmd/spo/folder/folder-retentionlabel-ensure.mdx +1 -1
  216. package/docs/docs/cmd/spo/folder/folder-retentionlabel-remove.mdx +1 -1
  217. package/docs/docs/cmd/spo/folder/folder-sharinglink-add.mdx +22 -1
  218. package/docs/docs/cmd/spo/folder/folder-sharinglink-clear.mdx +23 -0
  219. package/docs/docs/cmd/spo/folder/folder-sharinglink-get.mdx +21 -0
  220. package/docs/docs/cmd/spo/folder/folder-sharinglink-list.mdx +22 -1
  221. package/docs/docs/cmd/spo/folder/folder-sharinglink-remove.mdx +24 -1
  222. package/docs/docs/cmd/spo/folder/folder-sharinglink-set.mdx +21 -0
  223. package/docs/docs/cmd/spo/folder/folder-unarchive.mdx +76 -0
  224. package/docs/docs/cmd/spo/listitem/listitem-get.mdx +0 -6
  225. package/docs/docs/cmd/spo/navigation/navigation-node-add.mdx +45 -30
  226. package/docs/docs/cmd/spo/navigation/navigation-node-get.mdx +64 -42
  227. package/docs/docs/cmd/spo/navigation/navigation-node-set.mdx +10 -8
  228. package/docs/docs/cmd/spo/page/page-unpublish.mdx +63 -0
  229. package/docs/docs/cmd/spp/model/model-get.mdx +1 -1
  230. package/docs/docs/cmd/spp/model/model-remove.mdx +1 -1
  231. package/docs/docs/cmd/teams/tab/tab-add.mdx +19 -0
  232. package/docs/docs/cmd/teams/tab/tab-get.mdx +19 -0
  233. package/docs/docs/cmd/teams/tab/tab-list.mdx +19 -0
  234. package/docs/docs/cmd/teams/tab/tab-remove.mdx +21 -0
  235. package/docs/docs/cmd/viva/engage/engage-message-add.mdx +17 -0
  236. package/docs/docs/cmd/viva/engage/engage-message-get.mdx +17 -0
  237. package/docs/docs/cmd/viva/engage/engage-message-list.mdx +17 -0
  238. package/docs/docs/cmd/viva/engage/engage-message-remove.mdx +19 -0
  239. package/npm-shrinkwrap.json +324 -3116
  240. package/package.json +18 -35
  241. package/dist/appInsights.js +0 -43
@@ -1,13 +1,24 @@
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 _TeamsMessageGetCommand_instances, _TeamsMessageGetCommand_initOptions, _TeamsMessageGetCommand_initValidators;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import request from '../../../../request.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
+ teamId: z.string()
10
+ .refine(val => validation.isValidGuid(val), {
11
+ message: 'The value is not a valid GUID.'
12
+ })
13
+ .alias('t'),
14
+ channelId: z.string()
15
+ .refine(val => validation.isValidTeamsChannelId(val), {
16
+ message: 'The value is not a valid Teams ChannelId.'
17
+ })
18
+ .alias('c'),
19
+ id: z.string()
20
+ .alias('i')
21
+ });
11
22
  class TeamsMessageGetCommand extends GraphCommand {
12
23
  get name() {
13
24
  return commands.MESSAGE_GET;
@@ -15,11 +26,8 @@ class TeamsMessageGetCommand extends GraphCommand {
15
26
  get description() {
16
27
  return 'Retrieves a message from a channel in a Microsoft Teams team';
17
28
  }
18
- constructor() {
19
- super();
20
- _TeamsMessageGetCommand_instances.add(this);
21
- __classPrivateFieldGet(this, _TeamsMessageGetCommand_instances, "m", _TeamsMessageGetCommand_initOptions).call(this);
22
- __classPrivateFieldGet(this, _TeamsMessageGetCommand_instances, "m", _TeamsMessageGetCommand_initValidators).call(this);
29
+ get schema() {
30
+ return options;
23
31
  }
24
32
  async commandAction(logger, args) {
25
33
  const requestOptions = {
@@ -38,24 +46,5 @@ class TeamsMessageGetCommand extends GraphCommand {
38
46
  }
39
47
  }
40
48
  }
41
- _TeamsMessageGetCommand_instances = new WeakSet(), _TeamsMessageGetCommand_initOptions = function _TeamsMessageGetCommand_initOptions() {
42
- this.options.unshift({
43
- option: '-t, --teamId <teamId>'
44
- }, {
45
- option: '-c, --channelId <channelId>'
46
- }, {
47
- option: '-i, --id <id>'
48
- });
49
- }, _TeamsMessageGetCommand_initValidators = function _TeamsMessageGetCommand_initValidators() {
50
- this.validators.push(async (args) => {
51
- if (!validation.isValidGuid(args.options.teamId)) {
52
- return `${args.options.teamId} is not a valid GUID`;
53
- }
54
- if (!validation.isValidTeamsChannelId(args.options.channelId)) {
55
- return `${args.options.channelId} is not a valid Teams ChannelId`;
56
- }
57
- return true;
58
- });
59
- };
60
49
  export default new TeamsMessageGetCommand();
61
50
  //# sourceMappingURL=message-get.js.map
@@ -1,13 +1,31 @@
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 _TeamsMessageListCommand_instances, _TeamsMessageListCommand_initTelemetry, _TeamsMessageListCommand_initOptions, _TeamsMessageListCommand_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
+ teamId: z.string()
10
+ .refine(val => validation.isValidGuid(val), {
11
+ message: 'The value is not a valid GUID.'
12
+ })
13
+ .alias('i'),
14
+ channelId: z.string()
15
+ .refine(val => validation.isValidTeamsChannelId(val), {
16
+ message: 'The value is not a valid Teams ChannelId.'
17
+ })
18
+ .alias('c'),
19
+ since: z.string()
20
+ .refine(val => validation.isValidISODateDashOnly(val), {
21
+ message: 'The value is not a valid ISO Date (with dash separator).'
22
+ })
23
+ .refine(val => validation.isDateInRange(val, 8), {
24
+ message: 'The value is not in the last 8 months (for delta messages).'
25
+ })
26
+ .optional()
27
+ .alias('s')
28
+ });
11
29
  class TeamsMessageListCommand extends GraphCommand {
12
30
  get name() {
13
31
  return commands.MESSAGE_LIST;
@@ -18,12 +36,8 @@ class TeamsMessageListCommand extends GraphCommand {
18
36
  defaultProperties() {
19
37
  return ['id', 'summary', 'body'];
20
38
  }
21
- constructor() {
22
- super();
23
- _TeamsMessageListCommand_instances.add(this);
24
- __classPrivateFieldGet(this, _TeamsMessageListCommand_instances, "m", _TeamsMessageListCommand_initTelemetry).call(this);
25
- __classPrivateFieldGet(this, _TeamsMessageListCommand_instances, "m", _TeamsMessageListCommand_initOptions).call(this);
26
- __classPrivateFieldGet(this, _TeamsMessageListCommand_instances, "m", _TeamsMessageListCommand_initValidators).call(this);
39
+ get schema() {
40
+ return options;
27
41
  }
28
42
  async commandAction(logger, args) {
29
43
  const deltaExtension = args.options.since !== undefined ? `/delta?$filter=lastModifiedDateTime gt ${args.options.since}` : '';
@@ -42,36 +56,5 @@ class TeamsMessageListCommand extends GraphCommand {
42
56
  }
43
57
  }
44
58
  }
45
- _TeamsMessageListCommand_instances = new WeakSet(), _TeamsMessageListCommand_initTelemetry = function _TeamsMessageListCommand_initTelemetry() {
46
- this.telemetry.push((args) => {
47
- Object.assign(this.telemetryProperties, {
48
- since: typeof args.options.since !== 'undefined'
49
- });
50
- });
51
- }, _TeamsMessageListCommand_initOptions = function _TeamsMessageListCommand_initOptions() {
52
- this.options.unshift({
53
- option: '-i, --teamId <teamId>'
54
- }, {
55
- option: '-c, --channelId <channelId>'
56
- }, {
57
- option: '-s, --since [since]'
58
- });
59
- }, _TeamsMessageListCommand_initValidators = function _TeamsMessageListCommand_initValidators() {
60
- this.validators.push(async (args) => {
61
- if (!validation.isValidGuid(args.options.teamId)) {
62
- return `${args.options.teamId} is not a valid GUID`;
63
- }
64
- if (!validation.isValidTeamsChannelId(args.options.channelId)) {
65
- return `${args.options.channelId} is not a valid Teams ChannelId`;
66
- }
67
- if (args.options.since && !validation.isValidISODateDashOnly(args.options.since)) {
68
- return `${args.options.since} is not a valid ISO Date (with dash separator)`;
69
- }
70
- if (args.options.since && !validation.isDateInRange(args.options.since, 8)) {
71
- return `${args.options.since} is not in the last 8 months (for delta messages)`;
72
- }
73
- return true;
74
- });
75
- };
76
59
  export default new TeamsMessageListCommand();
77
60
  //# sourceMappingURL=message-list.js.map
@@ -1,16 +1,34 @@
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 _TeamsMessageRemoveCommand_instances, _TeamsMessageRemoveCommand_initTelemetry, _TeamsMessageRemoveCommand_initOptions, _TeamsMessageRemoveCommand_initValidators, _TeamsMessageRemoveCommand_initOptionSets, _TeamsMessageRemoveCommand_initTypes;
1
+ import { z } from 'zod';
7
2
  import { cli } from '../../../../cli/cli.js';
3
+ import { globalOptionsZod } from '../../../../Command.js';
8
4
  import request from '../../../../request.js';
9
5
  import { formatting } from '../../../../utils/formatting.js';
10
6
  import { teams } from '../../../../utils/teams.js';
11
7
  import { validation } from '../../../../utils/validation.js';
12
8
  import GraphDelegatedCommand from '../../../base/GraphDelegatedCommand.js';
13
9
  import commands from '../../commands.js';
10
+ export const options = z.strictObject({
11
+ ...globalOptionsZod.shape,
12
+ teamId: z.string()
13
+ .refine(val => !val || validation.isValidGuid(val), {
14
+ message: 'The value is not a valid GUID.'
15
+ })
16
+ .optional(),
17
+ teamName: z.string()
18
+ .optional(),
19
+ channelId: z.string()
20
+ .refine(val => !val || validation.isValidTeamsChannelId(val), {
21
+ message: 'The value is not a valid Teams ChannelId.'
22
+ })
23
+ .optional(),
24
+ channelName: z.string()
25
+ .optional(),
26
+ id: z.string()
27
+ .alias('i'),
28
+ force: z.boolean()
29
+ .optional()
30
+ .alias('f')
31
+ });
14
32
  class TeamsMessageRemoveCommand extends GraphDelegatedCommand {
15
33
  get name() {
16
34
  return commands.MESSAGE_REMOVE;
@@ -18,14 +36,25 @@ class TeamsMessageRemoveCommand extends GraphDelegatedCommand {
18
36
  get description() {
19
37
  return 'Removes a message from a channel in a Microsoft Teams team';
20
38
  }
21
- constructor() {
22
- super();
23
- _TeamsMessageRemoveCommand_instances.add(this);
24
- __classPrivateFieldGet(this, _TeamsMessageRemoveCommand_instances, "m", _TeamsMessageRemoveCommand_initTelemetry).call(this);
25
- __classPrivateFieldGet(this, _TeamsMessageRemoveCommand_instances, "m", _TeamsMessageRemoveCommand_initOptions).call(this);
26
- __classPrivateFieldGet(this, _TeamsMessageRemoveCommand_instances, "m", _TeamsMessageRemoveCommand_initValidators).call(this);
27
- __classPrivateFieldGet(this, _TeamsMessageRemoveCommand_instances, "m", _TeamsMessageRemoveCommand_initOptionSets).call(this);
28
- __classPrivateFieldGet(this, _TeamsMessageRemoveCommand_instances, "m", _TeamsMessageRemoveCommand_initTypes).call(this);
39
+ get schema() {
40
+ return options;
41
+ }
42
+ getRefinedSchema(schema) {
43
+ return schema
44
+ .refine(opts => [opts.teamId, opts.teamName].filter(x => x !== undefined).length === 1, {
45
+ message: 'Specify either teamId or teamName, but not both.',
46
+ params: {
47
+ customCode: 'optionSet',
48
+ options: ['teamId', 'teamName']
49
+ }
50
+ })
51
+ .refine(opts => [opts.channelId, opts.channelName].filter(x => x !== undefined).length === 1, {
52
+ message: 'Specify either channelId or channelName, but not both.',
53
+ params: {
54
+ customCode: 'optionSet',
55
+ options: ['channelId', 'channelName']
56
+ }
57
+ });
29
58
  }
30
59
  async commandAction(logger, args) {
31
60
  const removeTeamMessage = async () => {
@@ -64,49 +93,5 @@ class TeamsMessageRemoveCommand extends GraphDelegatedCommand {
64
93
  }
65
94
  }
66
95
  }
67
- _TeamsMessageRemoveCommand_instances = new WeakSet(), _TeamsMessageRemoveCommand_initTelemetry = function _TeamsMessageRemoveCommand_initTelemetry() {
68
- this.telemetry.push((args) => {
69
- Object.assign(this.telemetryProperties, {
70
- teamId: typeof args.options.teamId !== 'undefined',
71
- teamName: typeof args.options.teamName !== 'undefined',
72
- channelId: typeof args.options.channelId !== 'undefined',
73
- channelName: typeof args.options.channelName !== 'undefined',
74
- force: !!args.options.force
75
- });
76
- });
77
- }, _TeamsMessageRemoveCommand_initOptions = function _TeamsMessageRemoveCommand_initOptions() {
78
- this.options.unshift({
79
- option: '--teamId [teamId]'
80
- }, {
81
- option: '--teamName [teamName]'
82
- }, {
83
- option: '--channelId [channelId]'
84
- }, {
85
- option: '--channelName [channelName]'
86
- }, {
87
- option: '-i, --id <id>'
88
- }, {
89
- option: '-f, --force'
90
- });
91
- }, _TeamsMessageRemoveCommand_initValidators = function _TeamsMessageRemoveCommand_initValidators() {
92
- this.validators.push(async (args) => {
93
- if (args.options.teamId && !validation.isValidGuid(args.options.teamId)) {
94
- return `'${args.options.teamId}' is not a valid GUID for 'teamId'.`;
95
- }
96
- if (args.options.channelId && !validation.isValidTeamsChannelId(args.options.channelId)) {
97
- return `'${args.options.channelId}' is not a valid ID for 'channelId'.`;
98
- }
99
- return true;
100
- });
101
- }, _TeamsMessageRemoveCommand_initOptionSets = function _TeamsMessageRemoveCommand_initOptionSets() {
102
- this.optionSets.push({
103
- options: ['teamId', 'teamName']
104
- }, {
105
- options: ['channelId', 'channelName']
106
- });
107
- }, _TeamsMessageRemoveCommand_initTypes = function _TeamsMessageRemoveCommand_initTypes() {
108
- this.types.string.push('teamId', 'teamName', 'channelId', 'channelName', 'id');
109
- this.types.boolean.push('force');
110
- };
111
96
  export default new TeamsMessageRemoveCommand();
112
97
  //# sourceMappingURL=message-remove.js.map
@@ -1,13 +1,24 @@
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 _TeamsMessageReplyListCommand_instances, _TeamsMessageReplyListCommand_initOptions, _TeamsMessageReplyListCommand_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
+ teamId: z.string()
10
+ .refine(val => validation.isValidGuid(val), {
11
+ message: 'The value is not a valid GUID.'
12
+ })
13
+ .alias('i'),
14
+ channelId: z.string()
15
+ .refine(val => validation.isValidTeamsChannelId(val), {
16
+ message: 'The value is not a valid Teams ChannelId.'
17
+ })
18
+ .alias('c'),
19
+ messageId: z.string()
20
+ .alias('m')
21
+ });
11
22
  class TeamsMessageReplyListCommand extends GraphCommand {
12
23
  get name() {
13
24
  return commands.MESSAGE_REPLY_LIST;
@@ -18,11 +29,8 @@ class TeamsMessageReplyListCommand extends GraphCommand {
18
29
  defaultProperties() {
19
30
  return ['id', 'body'];
20
31
  }
21
- constructor() {
22
- super();
23
- _TeamsMessageReplyListCommand_instances.add(this);
24
- __classPrivateFieldGet(this, _TeamsMessageReplyListCommand_instances, "m", _TeamsMessageReplyListCommand_initOptions).call(this);
25
- __classPrivateFieldGet(this, _TeamsMessageReplyListCommand_instances, "m", _TeamsMessageReplyListCommand_initValidators).call(this);
32
+ get schema() {
33
+ return options;
26
34
  }
27
35
  async commandAction(logger, args) {
28
36
  const endpoint = `${this.resource}/v1.0/teams/${args.options.teamId}/channels/${args.options.channelId}/messages/${args.options.messageId}/replies`;
@@ -40,24 +48,5 @@ class TeamsMessageReplyListCommand extends GraphCommand {
40
48
  }
41
49
  }
42
50
  }
43
- _TeamsMessageReplyListCommand_instances = new WeakSet(), _TeamsMessageReplyListCommand_initOptions = function _TeamsMessageReplyListCommand_initOptions() {
44
- this.options.unshift({
45
- option: '-i, --teamId <teamId>'
46
- }, {
47
- option: '-c, --channelId <channelId>'
48
- }, {
49
- option: '-m, --messageId <messageId>'
50
- });
51
- }, _TeamsMessageReplyListCommand_initValidators = function _TeamsMessageReplyListCommand_initValidators() {
52
- this.validators.push(async (args) => {
53
- if (!validation.isValidGuid(args.options.teamId)) {
54
- return `${args.options.teamId} is not a valid GUID`;
55
- }
56
- if (!validation.isValidTeamsChannelId(args.options.channelId)) {
57
- return `${args.options.channelId} is not a valid Teams ChannelId`;
58
- }
59
- return true;
60
- });
61
- };
62
51
  export default new TeamsMessageReplyListCommand();
63
52
  //# sourceMappingURL=message-reply-list.js.map
@@ -1,14 +1,29 @@
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 _TeamsMessageRestoreCommand_instances, _TeamsMessageRestoreCommand_initTelemetry, _TeamsMessageRestoreCommand_initOptions, _TeamsMessageRestoreCommand_initValidators, _TeamsMessageRestoreCommand_initOptionSets, _TeamsMessageRestoreCommand_initTypes;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import request from '../../../../request.js';
8
4
  import { validation } from '../../../../utils/validation.js';
9
5
  import commands from '../../commands.js';
10
6
  import GraphDelegatedCommand from '../../../base/GraphDelegatedCommand.js';
11
7
  import { teams } from '../../../../utils/teams.js';
8
+ export const options = z.strictObject({
9
+ ...globalOptionsZod.shape,
10
+ teamId: z.string()
11
+ .refine(val => !val || validation.isValidGuid(val), {
12
+ message: 'The value is not a valid GUID.'
13
+ })
14
+ .optional(),
15
+ teamName: z.string()
16
+ .optional(),
17
+ channelId: z.string()
18
+ .refine(val => !val || validation.isValidTeamsChannelId(val), {
19
+ message: 'The value is not a valid Teams ChannelId.'
20
+ })
21
+ .optional(),
22
+ channelName: z.string()
23
+ .optional(),
24
+ id: z.string()
25
+ .alias('i')
26
+ });
12
27
  class TeamsMessageRestoreCommand extends GraphDelegatedCommand {
13
28
  get name() {
14
29
  return commands.MESSAGE_RESTORE;
@@ -16,14 +31,25 @@ class TeamsMessageRestoreCommand extends GraphDelegatedCommand {
16
31
  get description() {
17
32
  return 'Restores a deleted message from a channel in a Microsoft Teams team';
18
33
  }
19
- constructor() {
20
- super();
21
- _TeamsMessageRestoreCommand_instances.add(this);
22
- __classPrivateFieldGet(this, _TeamsMessageRestoreCommand_instances, "m", _TeamsMessageRestoreCommand_initTelemetry).call(this);
23
- __classPrivateFieldGet(this, _TeamsMessageRestoreCommand_instances, "m", _TeamsMessageRestoreCommand_initOptions).call(this);
24
- __classPrivateFieldGet(this, _TeamsMessageRestoreCommand_instances, "m", _TeamsMessageRestoreCommand_initValidators).call(this);
25
- __classPrivateFieldGet(this, _TeamsMessageRestoreCommand_instances, "m", _TeamsMessageRestoreCommand_initOptionSets).call(this);
26
- __classPrivateFieldGet(this, _TeamsMessageRestoreCommand_instances, "m", _TeamsMessageRestoreCommand_initTypes).call(this);
34
+ get schema() {
35
+ return options;
36
+ }
37
+ getRefinedSchema(schema) {
38
+ return schema
39
+ .refine(opts => [opts.teamId, opts.teamName].filter(x => x !== undefined).length === 1, {
40
+ message: 'Specify either teamId or teamName, but not both.',
41
+ params: {
42
+ customCode: 'optionSet',
43
+ options: ['teamId', 'teamName']
44
+ }
45
+ })
46
+ .refine(opts => [opts.channelId, opts.channelName].filter(x => x !== undefined).length === 1, {
47
+ message: 'Specify either channelId or channelName, but not both.',
48
+ params: {
49
+ customCode: 'optionSet',
50
+ options: ['channelId', 'channelName']
51
+ }
52
+ });
27
53
  }
28
54
  async commandAction(logger, args) {
29
55
  try {
@@ -66,41 +92,5 @@ class TeamsMessageRestoreCommand extends GraphDelegatedCommand {
66
92
  return channelId;
67
93
  }
68
94
  }
69
- _TeamsMessageRestoreCommand_instances = new WeakSet(), _TeamsMessageRestoreCommand_initTelemetry = function _TeamsMessageRestoreCommand_initTelemetry() {
70
- this.telemetry.push((args) => {
71
- Object.assign(this.telemetryProperties, {
72
- teamId: typeof args.options.teamId !== 'undefined',
73
- teamName: typeof args.options.teamName !== 'undefined',
74
- channelId: typeof args.options.channelId !== 'undefined',
75
- channelName: typeof args.options.channelName !== 'undefined'
76
- });
77
- });
78
- }, _TeamsMessageRestoreCommand_initOptions = function _TeamsMessageRestoreCommand_initOptions() {
79
- this.options.unshift({
80
- option: '--teamId [teamId]'
81
- }, {
82
- option: '--teamName [teamName]'
83
- }, {
84
- option: '--channelId [channelId]'
85
- }, {
86
- option: '--channelName [channelName]'
87
- }, {
88
- option: '-i, --id <id>'
89
- });
90
- }, _TeamsMessageRestoreCommand_initValidators = function _TeamsMessageRestoreCommand_initValidators() {
91
- this.validators.push(async (args) => {
92
- if (args.options.teamId && !validation.isValidGuid(args.options.teamId)) {
93
- return `'${args.options.teamId}' is not a valid GUID for 'teamId'.`;
94
- }
95
- if (args.options.channelId && !validation.isValidTeamsChannelId(args.options.channelId)) {
96
- return `'${args.options.channelId}' is not a valid ID for 'channelId'.`;
97
- }
98
- return true;
99
- });
100
- }, _TeamsMessageRestoreCommand_initOptionSets = function _TeamsMessageRestoreCommand_initOptionSets() {
101
- this.optionSets.push({ options: ['teamId', 'teamName'] }, { options: ['channelId', 'channelName'] });
102
- }, _TeamsMessageRestoreCommand_initTypes = function _TeamsMessageRestoreCommand_initTypes() {
103
- this.types.string.push('teamId', 'teamName', 'channelId', 'channelName', 'id');
104
- };
105
95
  export default new TeamsMessageRestoreCommand();
106
96
  //# sourceMappingURL=message-restore.js.map
@@ -1,13 +1,24 @@
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 _TeamsMessageSendCommand_instances, _TeamsMessageSendCommand_initOptions, _TeamsMessageSendCommand_initValidators;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import request from '../../../../request.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
+ teamId: z.string()
10
+ .refine(val => validation.isValidGuid(val), {
11
+ message: 'The value is not a valid GUID.'
12
+ })
13
+ .alias('i'),
14
+ channelId: z.string()
15
+ .refine(val => validation.isValidTeamsChannelId(val), {
16
+ message: 'The value is not a valid Teams ChannelId.'
17
+ })
18
+ .alias('c'),
19
+ message: z.string()
20
+ .alias('m')
21
+ });
11
22
  class TeamsMessageSendCommand extends GraphCommand {
12
23
  get name() {
13
24
  return commands.MESSAGE_SEND;
@@ -15,11 +26,8 @@ class TeamsMessageSendCommand extends GraphCommand {
15
26
  get description() {
16
27
  return 'Sends a message to a channel in a Microsoft Teams team';
17
28
  }
18
- constructor() {
19
- super();
20
- _TeamsMessageSendCommand_instances.add(this);
21
- __classPrivateFieldGet(this, _TeamsMessageSendCommand_instances, "m", _TeamsMessageSendCommand_initOptions).call(this);
22
- __classPrivateFieldGet(this, _TeamsMessageSendCommand_instances, "m", _TeamsMessageSendCommand_initValidators).call(this);
29
+ get schema() {
30
+ return options;
23
31
  }
24
32
  async commandAction(logger, args) {
25
33
  try {
@@ -45,24 +53,5 @@ class TeamsMessageSendCommand extends GraphCommand {
45
53
  }
46
54
  }
47
55
  }
48
- _TeamsMessageSendCommand_instances = new WeakSet(), _TeamsMessageSendCommand_initOptions = function _TeamsMessageSendCommand_initOptions() {
49
- this.options.unshift({
50
- option: '-i, --teamId <teamId>'
51
- }, {
52
- option: '-c, --channelId <channelId>'
53
- }, {
54
- option: '-m, --message <message>'
55
- });
56
- }, _TeamsMessageSendCommand_initValidators = function _TeamsMessageSendCommand_initValidators() {
57
- this.validators.push(async (args) => {
58
- if (!validation.isValidGuid(args.options.teamId)) {
59
- return `${args.options.teamId} is not a valid GUID`;
60
- }
61
- if (!validation.isValidTeamsChannelId(args.options.channelId)) {
62
- return `${args.options.channelId} is not a valid Teams ChannelId`;
63
- }
64
- return true;
65
- });
66
- };
67
56
  export default new TeamsMessageSendCommand();
68
57
  //# sourceMappingURL=message-send.js.map
@@ -1,5 +1,12 @@
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
1
3
  import PeriodBasedReport from '../../../base/PeriodBasedReport.js';
2
4
  import commands from '../../commands.js';
5
+ export const options = z.strictObject({
6
+ ...globalOptionsZod.shape,
7
+ output: z.enum(['csv', 'json']).optional().alias('o'),
8
+ period: z.enum(['D7', 'D30', 'D90', 'D180']).alias('p')
9
+ });
3
10
  class TeamsReportDeviceUsageDistributionUserCountsCommand extends PeriodBasedReport {
4
11
  get name() {
5
12
  return commands.REPORT_DEVICEUSAGEDISTRIBUTIONUSERCOUNTS;
@@ -10,6 +17,9 @@ class TeamsReportDeviceUsageDistributionUserCountsCommand extends PeriodBasedRep
10
17
  get description() {
11
18
  return 'Gets the number of Microsoft Teams unique users by device type';
12
19
  }
20
+ get schema() {
21
+ return options;
22
+ }
13
23
  }
14
24
  export default new TeamsReportDeviceUsageDistributionUserCountsCommand();
15
25
  //# sourceMappingURL=report-deviceusagedistributionusercounts.js.map
@@ -1,5 +1,12 @@
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
1
3
  import PeriodBasedReport from '../../../base/PeriodBasedReport.js';
2
4
  import commands from '../../commands.js';
5
+ export const options = z.strictObject({
6
+ ...globalOptionsZod.shape,
7
+ output: z.enum(['csv', 'json']).optional().alias('o'),
8
+ period: z.enum(['D7', 'D30', 'D90', 'D180']).alias('p')
9
+ });
3
10
  class TeamsReportDeviceUsageUserCountsCommand extends PeriodBasedReport {
4
11
  get name() {
5
12
  return commands.REPORT_DEVICEUSAGEUSERCOUNTS;
@@ -10,6 +17,9 @@ class TeamsReportDeviceUsageUserCountsCommand extends PeriodBasedReport {
10
17
  get usageEndpoint() {
11
18
  return 'getTeamsDeviceUsageUserCounts';
12
19
  }
20
+ get schema() {
21
+ return options;
22
+ }
13
23
  }
14
24
  export default new TeamsReportDeviceUsageUserCountsCommand();
15
25
  //# sourceMappingURL=report-deviceusageusercounts.js.map
@@ -1,5 +1,13 @@
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
1
3
  import DateAndPeriodBasedReport from '../../../base/DateAndPeriodBasedReport.js';
2
4
  import commands from '../../commands.js';
5
+ export const options = z.strictObject({
6
+ ...globalOptionsZod.shape,
7
+ output: z.enum(['csv', 'json']).optional().alias('o'),
8
+ period: z.enum(['D7', 'D30', 'D90', 'D180']).optional().alias('p'),
9
+ date: z.string().regex(/^\d{4}-\d{2}-\d{2}$/, 'The supported date format is YYYY-MM-DD').optional().alias('d')
10
+ });
3
11
  class TeamsReportDeviceUsageUserDetailCommand extends DateAndPeriodBasedReport {
4
12
  get name() {
5
13
  return commands.REPORT_DEVICEUSAGEUSERDETAIL;
@@ -10,6 +18,20 @@ class TeamsReportDeviceUsageUserDetailCommand extends DateAndPeriodBasedReport {
10
18
  get usageEndpoint() {
11
19
  return 'getTeamsDeviceUsageUserDetail';
12
20
  }
21
+ get schema() {
22
+ return options;
23
+ }
24
+ getRefinedSchema(schema) {
25
+ return schema
26
+ .refine((opts) => opts.period !== undefined || opts.date !== undefined, {
27
+ message: 'Specify period or date, one is required.',
28
+ params: { customCode: 'optionSet', options: ['period', 'date'] }
29
+ })
30
+ .refine((opts) => !(opts.period !== undefined && opts.date !== undefined), {
31
+ message: 'Specify period or date but not both.',
32
+ params: { customCode: 'optionSet', options: ['period', 'date'] }
33
+ });
34
+ }
13
35
  }
14
36
  export default new TeamsReportDeviceUsageUserDetailCommand();
15
37
  //# sourceMappingURL=report-deviceusageuserdetail.js.map