@pnp/cli-microsoft365 12.1.0-beta.79db3d9 → 12.1.0-beta.81e442d

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 (134) hide show
  1. package/allCommands.json +1 -1
  2. package/allCommandsFull.json +1 -1
  3. package/dist/cli/cli.js +12 -7
  4. package/dist/m365/entra/commands/app/app-add.js +106 -150
  5. package/dist/m365/entra/commands/app/app-get.js +22 -38
  6. package/dist/m365/entra/commands/app/app-list.js +10 -22
  7. package/dist/m365/entra/commands/app/app-permission-add.js +36 -50
  8. package/dist/m365/entra/commands/app/app-permission-list.js +29 -48
  9. package/dist/m365/entra/commands/app/app-permission-remove.js +44 -82
  10. package/dist/m365/entra/commands/app/app-remove.js +21 -38
  11. package/dist/m365/entra/commands/app/app-role-add.js +32 -46
  12. package/dist/m365/entra/commands/app/app-role-list.js +20 -25
  13. package/dist/m365/entra/commands/app/app-role-remove.js +33 -41
  14. package/dist/m365/entra/commands/app/app-set.js +46 -69
  15. package/dist/m365/spfx/commands/package/package-generate.js +30 -51
  16. package/dist/m365/spfx/commands/project/project-azuredevops-pipeline-add.js +27 -62
  17. package/dist/m365/spfx/commands/project/project-doctor.js +20 -51
  18. package/dist/m365/spfx/commands/project/project-externalize.js +16 -26
  19. package/dist/m365/spfx/commands/project/project-github-workflow-add.js +28 -65
  20. package/dist/m365/spfx/commands/project/project-permissions-grant.js +4 -2
  21. package/dist/m365/spfx/commands/project/project-rename.js +17 -29
  22. package/dist/m365/spfx/commands/project/project-upgrade.js +0 -3
  23. package/dist/m365/spfx/commands/spfx-doctor.js +23 -47
  24. package/dist/m365/spo/commands/file/file-add.js +51 -77
  25. package/dist/m365/spo/commands/file/file-archive.js +1 -1
  26. package/dist/m365/spo/commands/file/file-checkin.js +35 -64
  27. package/dist/m365/spo/commands/file/file-checkout-undo.js +25 -49
  28. package/dist/m365/spo/commands/file/file-checkout.js +24 -47
  29. package/dist/m365/spo/commands/file/file-copy.js +37 -68
  30. package/dist/m365/spo/commands/file/file-get.js +44 -79
  31. package/dist/m365/spo/commands/file/file-list.js +16 -39
  32. package/dist/m365/spo/commands/file/file-move.js +30 -68
  33. package/dist/m365/spo/commands/file/file-remove.js +27 -56
  34. package/dist/m365/spo/commands/file/file-rename.js +15 -36
  35. package/dist/m365/spo/commands/file/file-retentionlabel-ensure.js +26 -51
  36. package/dist/m365/spo/commands/file/file-retentionlabel-remove.js +25 -50
  37. package/dist/m365/spo/commands/file/file-roleassignment-add.js +47 -75
  38. package/dist/m365/spo/commands/file/file-roleassignment-remove.js +39 -70
  39. package/dist/m365/spo/commands/file/file-roleinheritance-break.js +26 -52
  40. package/dist/m365/spo/commands/file/file-roleinheritance-reset.js +25 -49
  41. package/dist/m365/spo/commands/file/file-sharinginfo-get.js +24 -47
  42. package/dist/m365/spo/commands/file/file-sharinglink-add.js +46 -70
  43. package/dist/m365/spo/commands/file/file-sharinglink-clear.js +33 -57
  44. package/dist/m365/spo/commands/file/file-sharinglink-get.js +25 -47
  45. package/dist/m365/spo/commands/file/file-sharinglink-list.js +32 -53
  46. package/dist/m365/spo/commands/file/file-sharinglink-remove.js +26 -51
  47. package/dist/m365/spo/commands/file/file-sharinglink-set.js +29 -55
  48. package/dist/m365/spo/commands/file/file-unarchive.js +1 -1
  49. package/dist/m365/spo/commands/file/file-version-clear.js +25 -45
  50. package/dist/m365/spo/commands/file/file-version-get.js +25 -43
  51. package/dist/m365/spo/commands/file/file-version-keep.js +1 -1
  52. package/dist/m365/spo/commands/file/file-version-list.js +24 -41
  53. package/dist/m365/spo/commands/file/file-version-remove.js +26 -47
  54. package/dist/m365/spo/commands/file/file-version-restore.js +26 -47
  55. package/dist/m365/spo/commands/folder/folder-add.js +19 -48
  56. package/dist/m365/spo/commands/folder/folder-copy.js +36 -62
  57. package/dist/m365/spo/commands/folder/folder-get.js +30 -51
  58. package/dist/m365/spo/commands/folder/folder-list.js +16 -39
  59. package/dist/m365/spo/commands/folder/folder-move.js +36 -62
  60. package/dist/m365/spo/commands/folder/folder-remove.js +15 -36
  61. package/dist/m365/spo/commands/folder/folder-retentionlabel-ensure.js +30 -48
  62. package/dist/m365/spo/commands/folder/folder-retentionlabel-remove.js +30 -50
  63. package/dist/m365/spo/commands/folder/folder-roleassignment-add.js +49 -79
  64. package/dist/m365/spo/commands/folder/folder-roleassignment-remove.js +37 -67
  65. package/dist/m365/spo/commands/folder/folder-roleinheritance-break.js +15 -36
  66. package/dist/m365/spo/commands/folder/folder-roleinheritance-reset.js +14 -33
  67. package/dist/m365/spo/commands/folder/folder-set.js +28 -48
  68. package/dist/m365/spo/commands/folder/folder-sharinglink-add.js +58 -86
  69. package/dist/m365/spo/commands/folder/folder-sharinglink-clear.js +33 -50
  70. package/dist/m365/spo/commands/folder/folder-sharinglink-get.js +33 -42
  71. package/dist/m365/spo/commands/folder/folder-sharinglink-list.js +32 -47
  72. package/dist/m365/spo/commands/folder/folder-sharinglink-remove.js +34 -41
  73. package/dist/m365/spo/commands/folder/folder-sharinglink-set.js +38 -43
  74. package/dist/m365/spo/commands/page/page-add.js +31 -68
  75. package/dist/m365/spo/commands/page/page-clientsidewebpart-add.js +74 -101
  76. package/dist/m365/spo/commands/page/page-column-get.js +15 -32
  77. package/dist/m365/spo/commands/page/page-column-list.js +14 -27
  78. package/dist/m365/spo/commands/page/page-control-get.js +18 -27
  79. package/dist/m365/spo/commands/page/page-control-list.js +13 -20
  80. package/dist/m365/spo/commands/page/page-control-remove.js +1 -1
  81. package/dist/m365/spo/commands/page/page-control-set.js +51 -61
  82. package/dist/m365/spo/commands/page/page-copy.js +15 -31
  83. package/dist/m365/spo/commands/page/page-header-set.js +25 -89
  84. package/dist/m365/spo/commands/page/page-list.js +12 -18
  85. package/dist/m365/spo/commands/page/page-remove.js +16 -39
  86. package/dist/m365/spo/commands/page/page-section-add.js +108 -173
  87. package/dist/m365/spo/commands/page/page-section-get.js +17 -27
  88. package/dist/m365/spo/commands/page/page-section-list.js +13 -20
  89. package/dist/m365/spo/commands/page/page-section-remove.js +4 -1
  90. package/dist/m365/spo/commands/page/page-set.js +50 -100
  91. package/dist/m365/spo/commands/page/page-template-list.js +12 -18
  92. package/dist/m365/spo/commands/page/page-text-add.js +23 -45
  93. package/dist/m365/viva/commands/connections/connections-app-create.js +36 -42
  94. package/dist/m365/viva/commands/engage/engage-community-add.js +75 -71
  95. package/dist/m365/viva/commands/engage/engage-community-get.js +8 -16
  96. package/dist/m365/viva/commands/engage/engage-community-list.js +5 -0
  97. package/dist/m365/viva/commands/engage/engage-community-remove.js +28 -48
  98. package/dist/m365/viva/commands/engage/engage-community-set.js +43 -66
  99. package/dist/m365/viva/commands/engage/engage-community-user-add.js +7 -12
  100. package/dist/m365/viva/commands/engage/engage-community-user-list.js +1 -1
  101. package/dist/m365/viva/commands/engage/engage-community-user-remove.js +4 -2
  102. package/dist/m365/viva/commands/engage/engage-message-add.js +22 -52
  103. package/dist/m365/viva/commands/engage/engage-message-get.js +8 -23
  104. package/dist/m365/viva/commands/engage/engage-message-like-set.js +10 -39
  105. package/dist/m365/viva/commands/engage/engage-message-list.js +22 -66
  106. package/dist/m365/viva/commands/engage/engage-message-remove.js +9 -32
  107. package/dist/m365/viva/commands/engage/engage-network-list.js +8 -22
  108. package/dist/m365/viva/commands/engage/engage-report-activitycounts.js +2 -1
  109. package/dist/m365/viva/commands/engage/engage-report-activityusercounts.js +2 -1
  110. package/dist/m365/viva/commands/engage/engage-report-activityuserdetail.js +2 -1
  111. package/dist/m365/viva/commands/engage/engage-report-deviceusagedistributionusercounts.js +2 -1
  112. package/dist/m365/viva/commands/engage/engage-report-deviceusageusercounts.js +2 -1
  113. package/dist/m365/viva/commands/engage/engage-report-deviceusageuserdetail.js +2 -1
  114. package/dist/m365/viva/commands/engage/engage-report-groupsactivitycounts.js +2 -1
  115. package/dist/m365/viva/commands/engage/engage-report-groupsactivitydetail.js +2 -1
  116. package/dist/m365/viva/commands/engage/engage-report-groupsactivitygroupcounts.js +2 -1
  117. package/dist/m365/viva/commands/engage/engage-role-list.js +5 -0
  118. package/dist/m365/viva/commands/engage/engage-role-member-add.js +3 -5
  119. package/dist/m365/viva/commands/engage/engage-role-member-list.js +1 -1
  120. package/dist/m365/viva/commands/engage/engage-role-member-remove.js +4 -2
  121. package/dist/m365/viva/commands/engage/engage-search.js +16 -65
  122. package/dist/m365/viva/commands/engage/engage-user-get.js +15 -33
  123. package/dist/m365/viva/commands/engage/engage-user-list.js +22 -57
  124. package/docs/docs/cmd/spo/listitem/listitem-record-declare.mdx +19 -0
  125. package/docs/docs/cmd/spo/listitem/listitem-record-lock.mdx +21 -0
  126. package/docs/docs/cmd/spo/listitem/listitem-record-undeclare.mdx +21 -0
  127. package/docs/docs/cmd/spo/listitem/listitem-record-unlock.mdx +21 -0
  128. package/docs/docs/cmd/spo/page/page-text-add.mdx +1 -1
  129. package/docs/docs/cmd/viva/engage/engage-community-add.mdx +19 -0
  130. package/docs/docs/cmd/viva/engage/engage-community-get.mdx +19 -0
  131. package/docs/docs/cmd/viva/engage/engage-community-remove.mdx +21 -0
  132. package/docs/docs/cmd/viva/engage/engage-community-set.mdx +19 -0
  133. package/npm-shrinkwrap.json +55 -55
  134. package/package.json +1 -1
@@ -1,14 +1,18 @@
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 _VivaEngageCommunitySetCommand_instances, _VivaEngageCommunitySetCommand_initTelemetry, _VivaEngageCommunitySetCommand_initOptions, _VivaEngageCommunitySetCommand_initValidators, _VivaEngageCommunitySetCommand_initTypes, _VivaEngageCommunitySetCommand_initOptionSets;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import request from '../../../../request.js';
8
- import { validation } from '../../../../utils/validation.js';
9
4
  import { vivaEngage } from '../../../../utils/vivaEngage.js';
10
5
  import GraphCommand from '../../../base/GraphCommand.js';
11
6
  import commands from '../../commands.js';
7
+ export const options = z.strictObject({
8
+ ...globalOptionsZod.shape,
9
+ id: z.string().optional().alias('i'),
10
+ displayName: z.string().optional().alias('d'),
11
+ entraGroupId: z.guid().optional(),
12
+ newDisplayName: z.string().optional(),
13
+ description: z.string().optional(),
14
+ privacy: z.string().pipe(z.enum(['public', 'private'])).optional()
15
+ });
12
16
  class VivaEngageCommunitySetCommand extends GraphCommand {
13
17
  get name() {
14
18
  return commands.ENGAGE_COMMUNITY_SET;
@@ -16,15 +20,38 @@ class VivaEngageCommunitySetCommand extends GraphCommand {
16
20
  get description() {
17
21
  return 'Updates an existing Viva Engage community';
18
22
  }
19
- constructor() {
20
- super();
21
- _VivaEngageCommunitySetCommand_instances.add(this);
22
- this.privacyOptions = ['public', 'private'];
23
- __classPrivateFieldGet(this, _VivaEngageCommunitySetCommand_instances, "m", _VivaEngageCommunitySetCommand_initTelemetry).call(this);
24
- __classPrivateFieldGet(this, _VivaEngageCommunitySetCommand_instances, "m", _VivaEngageCommunitySetCommand_initOptions).call(this);
25
- __classPrivateFieldGet(this, _VivaEngageCommunitySetCommand_instances, "m", _VivaEngageCommunitySetCommand_initValidators).call(this);
26
- __classPrivateFieldGet(this, _VivaEngageCommunitySetCommand_instances, "m", _VivaEngageCommunitySetCommand_initTypes).call(this);
27
- __classPrivateFieldGet(this, _VivaEngageCommunitySetCommand_instances, "m", _VivaEngageCommunitySetCommand_initOptionSets).call(this);
23
+ get schema() {
24
+ return options;
25
+ }
26
+ getRefinedSchema(schema) {
27
+ return schema
28
+ .refine(opts => [opts.id, opts.displayName, opts.entraGroupId].some(x => x !== undefined), {
29
+ message: 'Specify either id, displayName, or entraGroupId.',
30
+ params: {
31
+ customCode: 'optionSet',
32
+ options: ['id', 'displayName', 'entraGroupId']
33
+ }
34
+ })
35
+ .refine(opts => [opts.id, opts.displayName, opts.entraGroupId].filter(x => x !== undefined).length <= 1, {
36
+ message: 'Specify either id, displayName, or entraGroupId, but not multiple.',
37
+ params: {
38
+ customCode: 'optionSet',
39
+ options: ['id', 'displayName', 'entraGroupId']
40
+ }
41
+ })
42
+ .refine(opts => !opts.newDisplayName || opts.newDisplayName.length <= 255, {
43
+ message: `The maximum amount of characters for 'newDisplayName' is 255.`
44
+ })
45
+ .refine(opts => !opts.description || opts.description.length <= 1024, {
46
+ message: `The maximum amount of characters for 'description' is 1024.`
47
+ })
48
+ .refine(opts => opts.newDisplayName || opts.description || opts.privacy, {
49
+ message: 'Specify at least newDisplayName, description, or privacy.',
50
+ params: {
51
+ customCode: 'optionSet',
52
+ options: ['newDisplayName', 'description', 'privacy']
53
+ }
54
+ });
28
55
  }
29
56
  async commandAction(logger, args) {
30
57
  let communityId = args.options.id;
@@ -57,55 +84,5 @@ class VivaEngageCommunitySetCommand extends GraphCommand {
57
84
  }
58
85
  }
59
86
  }
60
- _VivaEngageCommunitySetCommand_instances = new WeakSet(), _VivaEngageCommunitySetCommand_initTelemetry = function _VivaEngageCommunitySetCommand_initTelemetry() {
61
- this.telemetry.push((args) => {
62
- Object.assign(this.telemetryProperties, {
63
- id: typeof args.options.id !== 'undefined',
64
- displayName: typeof args.options.displayName !== 'undefined',
65
- entraGroupId: typeof args.options.entraGroupId !== 'undefined',
66
- newDisplayName: typeof args.options.newDisplayName !== 'undefined',
67
- description: typeof args.options.description !== 'undefined',
68
- privacy: typeof args.options.privacy !== 'undefined'
69
- });
70
- });
71
- }, _VivaEngageCommunitySetCommand_initOptions = function _VivaEngageCommunitySetCommand_initOptions() {
72
- this.options.unshift({
73
- option: '-i, --id [id]'
74
- }, {
75
- option: '-d, --displayName [displayName]'
76
- }, {
77
- option: '--entraGroupId [entraGroupId]'
78
- }, {
79
- option: '--newDisplayName [newDisplayName]'
80
- }, {
81
- option: '--description [description]'
82
- }, {
83
- option: '--privacy [privacy]',
84
- autocomplete: this.privacyOptions
85
- });
86
- }, _VivaEngageCommunitySetCommand_initValidators = function _VivaEngageCommunitySetCommand_initValidators() {
87
- this.validators.push(async (args) => {
88
- if (args.options.entraGroupId && !validation.isValidGuid(args.options.entraGroupId)) {
89
- return `${args.options.entraGroupId} is not a valid GUID for the option 'entraGroupId'.`;
90
- }
91
- if (args.options.newDisplayName && args.options.newDisplayName.length > 255) {
92
- return `The maximum amount of characters for 'newDisplayName' is 255.`;
93
- }
94
- if (args.options.description && args.options.description.length > 1024) {
95
- return `The maximum amount of characters for 'description' is 1024.`;
96
- }
97
- if (args.options.privacy && this.privacyOptions.map(x => x.toLowerCase()).indexOf(args.options.privacy.toLowerCase()) === -1) {
98
- return `${args.options.privacy} is not a valid privacy. Allowed values are ${this.privacyOptions.join(', ')}`;
99
- }
100
- if (!args.options.newDisplayName && !args.options.description && !args.options.privacy) {
101
- return 'Specify at least newDisplayName, description, or privacy.';
102
- }
103
- return true;
104
- });
105
- }, _VivaEngageCommunitySetCommand_initTypes = function _VivaEngageCommunitySetCommand_initTypes() {
106
- this.types.string.push('id', 'displayName', 'entraGroupId', 'newDisplayName', 'description', 'privacy');
107
- }, _VivaEngageCommunitySetCommand_initOptionSets = function _VivaEngageCommunitySetCommand_initOptionSets() {
108
- this.optionSets.push({ options: ['id', 'displayName', 'entraGroupId'] });
109
- };
110
87
  export default new VivaEngageCommunitySetCommand();
111
88
  //# sourceMappingURL=engage-community-set.js.map
@@ -14,12 +14,14 @@ export const options = z.strictObject({
14
14
  entraGroupId: z.uuid().optional(),
15
15
  ids: z.string()
16
16
  .refine(ids => validation.isValidGuidArray(ids) === true, {
17
- error: e => `The following GUIDs are invalid: ${e.input}.`
18
- }).optional(),
17
+ error: issue => `The following GUIDs are invalid: ${validation.isValidGuidArray(String(issue.input))}.`
18
+ })
19
+ .optional(),
19
20
  userNames: z.string()
20
21
  .refine(userNames => validation.isValidUserPrincipalNameArray(userNames) === true, {
21
- error: e => `The following user principal names are invalid: ${e.input}.`
22
- }).optional(),
22
+ error: issue => `The following user principal names are invalid: ${validation.isValidUserPrincipalNameArray(String(issue.input))}.`
23
+ })
24
+ .optional(),
23
25
  role: z.enum(['Admin', 'Member']).alias('r')
24
26
  });
25
27
  class VivaEngageCommunityUserAddCommand extends GraphCommand {
@@ -48,14 +50,7 @@ class VivaEngageCommunityUserAddCommand extends GraphCommand {
48
50
  options: ['communityId', 'communityDisplayName', 'entraGroupId']
49
51
  }
50
52
  })
51
- .refine(options => options.ids || options.userNames, {
52
- error: 'Specify either of ids or userNames.',
53
- params: {
54
- customCode: 'optionSet',
55
- options: ['ids', 'userNames']
56
- }
57
- })
58
- .refine(options => typeof options.userNames !== 'undefined' || typeof options.ids !== 'undefined', {
53
+ .refine(options => [options.ids, options.userNames].filter(x => x !== undefined).length === 1, {
59
54
  error: 'Specify either ids or userNames, but not both.',
60
55
  params: {
61
56
  customCode: 'optionSet',
@@ -8,7 +8,7 @@ export const options = z.strictObject({
8
8
  ...globalOptionsZod.shape,
9
9
  communityId: z.string().optional(),
10
10
  communityDisplayName: z.string().optional().alias('n'),
11
- entraGroupId: z.uuid().optional(),
11
+ entraGroupId: z.guid().optional(),
12
12
  role: z.enum(['Admin', 'Member']).optional().alias('r')
13
13
  });
14
14
  class VivaEngageCommunityUserListCommand extends GraphCommand {
@@ -11,8 +11,10 @@ export const options = z.strictObject({
11
11
  ...globalOptionsZod.shape,
12
12
  communityId: z.string().optional(),
13
13
  communityDisplayName: z.string().optional().alias('n'),
14
- entraGroupId: z.uuid().optional(),
15
- id: z.uuid().optional(),
14
+ entraGroupId: z.guid().optional(),
15
+ id: z.string().refine(id => validation.isValidGuid(id), {
16
+ error: e => `'${e.input}' is not a valid GUID.`
17
+ }).optional(),
16
18
  userName: z.string()
17
19
  .refine(userName => validation.isValidUserPrincipalName(userName), {
18
20
  error: e => `'${e.input}' is not a valid user principal name.`
@@ -1,12 +1,16 @@
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 _VivaEngageMessageAddCommand_instances, _VivaEngageMessageAddCommand_initTelemetry, _VivaEngageMessageAddCommand_initOptions, _VivaEngageMessageAddCommand_initValidators;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import request from '../../../../request.js';
8
4
  import VivaEngageCommand from '../../../base/VivaEngageCommand.js';
9
5
  import commands from '../../commands.js';
6
+ export const options = z.strictObject({
7
+ ...globalOptionsZod.shape,
8
+ body: z.string().alias('b'),
9
+ repliedToId: z.coerce.number().optional().alias('r'),
10
+ directToUserIds: z.string().optional().alias('d'),
11
+ groupId: z.coerce.number().optional(),
12
+ networkId: z.coerce.number().optional()
13
+ });
10
14
  class VivaEngageMessageAddCommand extends VivaEngageCommand {
11
15
  get name() {
12
16
  return commands.ENGAGE_MESSAGE_ADD;
@@ -14,12 +18,18 @@ class VivaEngageMessageAddCommand extends VivaEngageCommand {
14
18
  get description() {
15
19
  return 'Posts a Viva Engage network message on behalf of the current user';
16
20
  }
17
- constructor() {
18
- super();
19
- _VivaEngageMessageAddCommand_instances.add(this);
20
- __classPrivateFieldGet(this, _VivaEngageMessageAddCommand_instances, "m", _VivaEngageMessageAddCommand_initTelemetry).call(this);
21
- __classPrivateFieldGet(this, _VivaEngageMessageAddCommand_instances, "m", _VivaEngageMessageAddCommand_initOptions).call(this);
22
- __classPrivateFieldGet(this, _VivaEngageMessageAddCommand_instances, "m", _VivaEngageMessageAddCommand_initValidators).call(this);
21
+ get schema() {
22
+ return options;
23
+ }
24
+ getRefinedSchema(schema) {
25
+ return schema
26
+ .refine(opts => opts.groupId !== undefined || opts.directToUserIds !== undefined || opts.repliedToId !== undefined, {
27
+ message: 'You must either specify groupId, repliedToId or directToUserIds',
28
+ params: {
29
+ customCode: 'optionSet',
30
+ options: ['groupId', 'repliedToId', 'directToUserIds']
31
+ }
32
+ });
23
33
  }
24
34
  async commandAction(logger, args) {
25
35
  const requestOptions = {
@@ -50,45 +60,5 @@ class VivaEngageMessageAddCommand extends VivaEngageCommand {
50
60
  }
51
61
  }
52
62
  }
53
- _VivaEngageMessageAddCommand_instances = new WeakSet(), _VivaEngageMessageAddCommand_initTelemetry = function _VivaEngageMessageAddCommand_initTelemetry() {
54
- this.telemetry.push((args) => {
55
- Object.assign(this.telemetryProperties, {
56
- repliedToId: args.options.repliedToId !== undefined,
57
- directToUserIds: args.options.directToUserIds !== undefined,
58
- groupId: args.options.groupId !== undefined,
59
- networkId: args.options.networkId !== undefined
60
- });
61
- });
62
- }, _VivaEngageMessageAddCommand_initOptions = function _VivaEngageMessageAddCommand_initOptions() {
63
- this.options.unshift({
64
- option: '-b, --body <body>'
65
- }, {
66
- option: '-r, --repliedToId [repliedToId]'
67
- }, {
68
- option: '-d, --directToUserIds [directToUserIds]'
69
- }, {
70
- option: '--groupId [groupId]'
71
- }, {
72
- option: '--networkId [networkId]'
73
- });
74
- }, _VivaEngageMessageAddCommand_initValidators = function _VivaEngageMessageAddCommand_initValidators() {
75
- this.validators.push(async (args) => {
76
- if (args.options.groupId && typeof args.options.groupId !== 'number') {
77
- return `${args.options.groupId} is not a number`;
78
- }
79
- if (args.options.networkId && typeof args.options.networkId !== 'number') {
80
- return `${args.options.networkId} is not a number`;
81
- }
82
- if (args.options.repliedToId && typeof args.options.repliedToId !== 'number') {
83
- return `${args.options.repliedToId} is not a number`;
84
- }
85
- if (args.options.groupId === undefined &&
86
- args.options.directToUserIds === undefined &&
87
- args.options.repliedToId === undefined) {
88
- return "You must either specify groupId, repliedToId or directToUserIds";
89
- }
90
- return true;
91
- });
92
- };
93
63
  export default new VivaEngageMessageAddCommand();
94
64
  //# sourceMappingURL=engage-message-add.js.map
@@ -1,12 +1,12 @@
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 _VivaEngageMessageGetCommand_instances, _VivaEngageMessageGetCommand_initOptions, _VivaEngageMessageGetCommand_initValidators;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import request from '../../../../request.js';
8
4
  import VivaEngageCommand from '../../../base/VivaEngageCommand.js';
9
5
  import commands from '../../commands.js';
6
+ export const options = z.strictObject({
7
+ ...globalOptionsZod.shape,
8
+ id: z.coerce.number()
9
+ });
10
10
  class VivaEngageMessageGetCommand extends VivaEngageCommand {
11
11
  get name() {
12
12
  return commands.ENGAGE_MESSAGE_GET;
@@ -14,11 +14,8 @@ class VivaEngageMessageGetCommand extends VivaEngageCommand {
14
14
  get description() {
15
15
  return 'Returns a Viva Engage message';
16
16
  }
17
- constructor() {
18
- super();
19
- _VivaEngageMessageGetCommand_instances.add(this);
20
- __classPrivateFieldGet(this, _VivaEngageMessageGetCommand_instances, "m", _VivaEngageMessageGetCommand_initOptions).call(this);
21
- __classPrivateFieldGet(this, _VivaEngageMessageGetCommand_instances, "m", _VivaEngageMessageGetCommand_initValidators).call(this);
17
+ get schema() {
18
+ return options;
22
19
  }
23
20
  async commandAction(logger, args) {
24
21
  const requestOptions = {
@@ -38,17 +35,5 @@ class VivaEngageMessageGetCommand extends VivaEngageCommand {
38
35
  }
39
36
  }
40
37
  }
41
- _VivaEngageMessageGetCommand_instances = new WeakSet(), _VivaEngageMessageGetCommand_initOptions = function _VivaEngageMessageGetCommand_initOptions() {
42
- this.options.unshift({
43
- option: '--id <id>'
44
- });
45
- }, _VivaEngageMessageGetCommand_initValidators = function _VivaEngageMessageGetCommand_initValidators() {
46
- this.validators.push(async (args) => {
47
- if (typeof args.options.id !== 'number') {
48
- return `${args.options.id} is not a number`;
49
- }
50
- return true;
51
- });
52
- };
53
38
  export default new VivaEngageMessageGetCommand();
54
39
  //# sourceMappingURL=engage-message-get.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 _VivaEngageMessageLikeSetCommand_instances, _VivaEngageMessageLikeSetCommand_initTelemetry, _VivaEngageMessageLikeSetCommand_initOptions, _VivaEngageMessageLikeSetCommand_initTypes, _VivaEngageMessageLikeSetCommand_initValidators;
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 VivaEngageCommand from '../../../base/VivaEngageCommand.js';
10
6
  import commands from '../../commands.js';
7
+ export const options = z.strictObject({
8
+ ...globalOptionsZod.shape,
9
+ messageId: z.coerce.number(),
10
+ enable: z.boolean().optional().autocomplete(['true', 'false']),
11
+ force: z.boolean().optional().alias('f')
12
+ });
11
13
  class VivaEngageMessageLikeSetCommand extends VivaEngageCommand {
12
14
  get name() {
13
15
  return commands.ENGAGE_MESSAGE_LIKE_SET;
@@ -15,13 +17,8 @@ class VivaEngageMessageLikeSetCommand extends VivaEngageCommand {
15
17
  get description() {
16
18
  return 'Likes or unlikes a Viva Engage message';
17
19
  }
18
- constructor() {
19
- super();
20
- _VivaEngageMessageLikeSetCommand_instances.add(this);
21
- __classPrivateFieldGet(this, _VivaEngageMessageLikeSetCommand_instances, "m", _VivaEngageMessageLikeSetCommand_initTelemetry).call(this);
22
- __classPrivateFieldGet(this, _VivaEngageMessageLikeSetCommand_instances, "m", _VivaEngageMessageLikeSetCommand_initOptions).call(this);
23
- __classPrivateFieldGet(this, _VivaEngageMessageLikeSetCommand_instances, "m", _VivaEngageMessageLikeSetCommand_initTypes).call(this);
24
- __classPrivateFieldGet(this, _VivaEngageMessageLikeSetCommand_instances, "m", _VivaEngageMessageLikeSetCommand_initValidators).call(this);
20
+ get schema() {
21
+ return options;
25
22
  }
26
23
  async commandAction(logger, args) {
27
24
  if (args.options.enable === false) {
@@ -65,31 +62,5 @@ class VivaEngageMessageLikeSetCommand extends VivaEngageCommand {
65
62
  }
66
63
  }
67
64
  }
68
- _VivaEngageMessageLikeSetCommand_instances = new WeakSet(), _VivaEngageMessageLikeSetCommand_initTelemetry = function _VivaEngageMessageLikeSetCommand_initTelemetry() {
69
- this.telemetry.push((args) => {
70
- Object.assign(this.telemetryProperties, {
71
- enable: args.options.enable,
72
- force: (!(!args.options.force)).toString()
73
- });
74
- });
75
- }, _VivaEngageMessageLikeSetCommand_initOptions = function _VivaEngageMessageLikeSetCommand_initOptions() {
76
- this.options.unshift({
77
- option: '--messageId <messageId>'
78
- }, {
79
- option: '--enable [enable]',
80
- autocomplete: ['true', 'false']
81
- }, {
82
- option: '-f, --force'
83
- });
84
- }, _VivaEngageMessageLikeSetCommand_initTypes = function _VivaEngageMessageLikeSetCommand_initTypes() {
85
- this.types.boolean.push('enable');
86
- }, _VivaEngageMessageLikeSetCommand_initValidators = function _VivaEngageMessageLikeSetCommand_initValidators() {
87
- this.validators.push(async (args) => {
88
- if (args.options.messageId && typeof args.options.messageId !== 'number') {
89
- return `${args.options.messageId} is not a number`;
90
- }
91
- return true;
92
- });
93
- };
94
65
  export default new VivaEngageMessageLikeSetCommand();
95
66
  //# sourceMappingURL=engage-message-like-set.js.map
@@ -1,12 +1,17 @@
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 _VivaEngageMessageListCommand_instances, _a, _VivaEngageMessageListCommand_initTelemetry, _VivaEngageMessageListCommand_initOptions, _VivaEngageMessageListCommand_initValidators;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import request from '../../../../request.js';
8
4
  import VivaEngageCommand from '../../../base/VivaEngageCommand.js';
9
5
  import commands from '../../commands.js';
6
+ export const options = z.strictObject({
7
+ ...globalOptionsZod.shape,
8
+ olderThanId: z.coerce.number().optional(),
9
+ threaded: z.boolean().optional(),
10
+ limit: z.coerce.number().optional(),
11
+ feedType: z.enum(['All', 'Top', 'My', 'Following', 'Sent', 'Private', 'Received']).optional(),
12
+ groupId: z.coerce.number().optional(),
13
+ threadId: z.coerce.number().optional()
14
+ });
10
15
  class VivaEngageMessageListCommand extends VivaEngageCommand {
11
16
  get name() {
12
17
  return commands.ENGAGE_MESSAGE_LIST;
@@ -17,13 +22,17 @@ class VivaEngageMessageListCommand extends VivaEngageCommand {
17
22
  defaultProperties() {
18
23
  return ['id', 'replied_to_id', 'thread_id', 'group_id', 'shortBody'];
19
24
  }
20
- constructor() {
21
- super();
22
- _VivaEngageMessageListCommand_instances.add(this);
23
- this.items = [];
24
- __classPrivateFieldGet(this, _VivaEngageMessageListCommand_instances, "m", _VivaEngageMessageListCommand_initTelemetry).call(this);
25
- __classPrivateFieldGet(this, _VivaEngageMessageListCommand_instances, "m", _VivaEngageMessageListCommand_initOptions).call(this);
26
- __classPrivateFieldGet(this, _VivaEngageMessageListCommand_instances, "m", _VivaEngageMessageListCommand_initValidators).call(this);
25
+ get schema() {
26
+ return options;
27
+ }
28
+ getRefinedSchema(schema) {
29
+ return schema
30
+ .refine(opts => !(opts.groupId && opts.threadId), {
31
+ message: 'You cannot specify groupId and threadId at the same time'
32
+ })
33
+ .refine(opts => !(opts.feedType && (opts.groupId || opts.threadId)), {
34
+ message: 'You cannot specify the feedType with groupId or threadId at the same time'
35
+ });
27
36
  }
28
37
  async getAllItems(logger, args, messageId) {
29
38
  let endpoint = `${this.resource}/v1`;
@@ -117,58 +126,5 @@ class VivaEngageMessageListCommand extends VivaEngageCommand {
117
126
  }
118
127
  }
119
128
  }
120
- _a = VivaEngageMessageListCommand, _VivaEngageMessageListCommand_instances = new WeakSet(), _VivaEngageMessageListCommand_initTelemetry = function _VivaEngageMessageListCommand_initTelemetry() {
121
- this.telemetry.push((args) => {
122
- Object.assign(this.telemetryProperties, {
123
- olderThanId: args.options.olderThanId !== undefined,
124
- threaded: args.options.threaded,
125
- limit: args.options.limit !== undefined,
126
- feedType: args.options.feedType !== undefined,
127
- threadId: args.options.threadId !== undefined,
128
- groupId: args.options.groupId !== undefined
129
- });
130
- });
131
- }, _VivaEngageMessageListCommand_initOptions = function _VivaEngageMessageListCommand_initOptions() {
132
- this.options.unshift({
133
- option: '--olderThanId [olderThanId]'
134
- }, {
135
- option: '--feedType [feedType]',
136
- autocomplete: _a.feedTypes
137
- }, {
138
- option: '--groupId [groupId]'
139
- }, {
140
- option: '--threadId [threadId]'
141
- }, {
142
- option: '--threaded'
143
- }, {
144
- option: '--limit [limit]'
145
- });
146
- }, _VivaEngageMessageListCommand_initValidators = function _VivaEngageMessageListCommand_initValidators() {
147
- this.validators.push(async (args) => {
148
- if (args.options.groupId && args.options.threadId) {
149
- return `You cannot specify groupId and threadId at the same time`;
150
- }
151
- if (args.options.feedType && (args.options.groupId || args.options.threadId)) {
152
- return `You cannot specify the feedType with groupId or threadId at the same time`;
153
- }
154
- if (args.options.feedType && _a.feedTypes.indexOf(args.options.feedType) < 0) {
155
- return `${args.options.feedType} is not a valid value for the feedType option. Allowed values are ${_a.feedTypes.join(', ')}`;
156
- }
157
- if (args.options.olderThanId && typeof args.options.olderThanId !== 'number') {
158
- return `${args.options.olderThanId} is not a number`;
159
- }
160
- if (args.options.groupId && typeof args.options.groupId !== 'number') {
161
- return `${args.options.groupId} is not a number`;
162
- }
163
- if (args.options.threadId && typeof args.options.threadId !== 'number') {
164
- return `${args.options.threadId} is not a number`;
165
- }
166
- if (args.options.limit && typeof args.options.limit !== 'number') {
167
- return `${args.options.limit} is not a number`;
168
- }
169
- return true;
170
- });
171
- };
172
- VivaEngageMessageListCommand.feedTypes = ['All', 'Top', 'My', 'Following', 'Sent', 'Private', 'Received'];
173
129
  export default new VivaEngageMessageListCommand();
174
130
  //# sourceMappingURL=engage-message-list.js.map
@@ -1,13 +1,14 @@
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 _VivaEngageMessageRemoveCommand_instances, _VivaEngageMessageRemoveCommand_initTelemetry, _VivaEngageMessageRemoveCommand_initOptions, _VivaEngageMessageRemoveCommand_initValidators;
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 VivaEngageCommand from '../../../base/VivaEngageCommand.js';
10
6
  import commands from '../../commands.js';
7
+ export const options = z.strictObject({
8
+ ...globalOptionsZod.shape,
9
+ id: z.coerce.number(),
10
+ force: z.boolean().optional().alias('f')
11
+ });
11
12
  class VivaEngageMessageRemoveCommand extends VivaEngageCommand {
12
13
  get name() {
13
14
  return commands.ENGAGE_MESSAGE_REMOVE;
@@ -15,12 +16,8 @@ class VivaEngageMessageRemoveCommand extends VivaEngageCommand {
15
16
  get description() {
16
17
  return 'Removes a Viva Engage message';
17
18
  }
18
- constructor() {
19
- super();
20
- _VivaEngageMessageRemoveCommand_instances.add(this);
21
- __classPrivateFieldGet(this, _VivaEngageMessageRemoveCommand_instances, "m", _VivaEngageMessageRemoveCommand_initTelemetry).call(this);
22
- __classPrivateFieldGet(this, _VivaEngageMessageRemoveCommand_instances, "m", _VivaEngageMessageRemoveCommand_initOptions).call(this);
23
- __classPrivateFieldGet(this, _VivaEngageMessageRemoveCommand_instances, "m", _VivaEngageMessageRemoveCommand_initValidators).call(this);
19
+ get schema() {
20
+ return options;
24
21
  }
25
22
  async commandAction(logger, args) {
26
23
  if (args.options.force) {
@@ -50,25 +47,5 @@ class VivaEngageMessageRemoveCommand extends VivaEngageCommand {
50
47
  }
51
48
  }
52
49
  }
53
- _VivaEngageMessageRemoveCommand_instances = new WeakSet(), _VivaEngageMessageRemoveCommand_initTelemetry = function _VivaEngageMessageRemoveCommand_initTelemetry() {
54
- this.telemetry.push((args) => {
55
- Object.assign(this.telemetryProperties, {
56
- force: (!(!args.options.force)).toString()
57
- });
58
- });
59
- }, _VivaEngageMessageRemoveCommand_initOptions = function _VivaEngageMessageRemoveCommand_initOptions() {
60
- this.options.unshift({
61
- option: '--id <id>'
62
- }, {
63
- option: '-f, --force'
64
- });
65
- }, _VivaEngageMessageRemoveCommand_initValidators = function _VivaEngageMessageRemoveCommand_initValidators() {
66
- this.validators.push(async (args) => {
67
- if (typeof args.options.id !== 'number') {
68
- return `${args.options.id} is not a number`;
69
- }
70
- return true;
71
- });
72
- };
73
50
  export default new VivaEngageMessageRemoveCommand();
74
51
  //# sourceMappingURL=engage-message-remove.js.map
@@ -1,12 +1,12 @@
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 _VivaEngageNetworkListCommand_instances, _VivaEngageNetworkListCommand_initTelemetry, _VivaEngageNetworkListCommand_initOptions;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import request from '../../../../request.js';
8
4
  import VivaEngageCommand from '../../../base/VivaEngageCommand.js';
9
5
  import commands from '../../commands.js';
6
+ export const options = z.strictObject({
7
+ ...globalOptionsZod.shape,
8
+ withSuspended: z.boolean().optional()
9
+ });
10
10
  class VivaEngageNetworkListCommand extends VivaEngageCommand {
11
11
  get name() {
12
12
  return commands.ENGAGE_NETWORK_LIST;
@@ -17,11 +17,8 @@ class VivaEngageNetworkListCommand extends VivaEngageCommand {
17
17
  defaultProperties() {
18
18
  return ['id', 'name', 'email', 'community', 'permalink', 'web_url'];
19
19
  }
20
- constructor() {
21
- super();
22
- _VivaEngageNetworkListCommand_instances.add(this);
23
- __classPrivateFieldGet(this, _VivaEngageNetworkListCommand_instances, "m", _VivaEngageNetworkListCommand_initTelemetry).call(this);
24
- __classPrivateFieldGet(this, _VivaEngageNetworkListCommand_instances, "m", _VivaEngageNetworkListCommand_initOptions).call(this);
20
+ get schema() {
21
+ return options;
25
22
  }
26
23
  async commandAction(logger, args) {
27
24
  const requestOptions = {
@@ -44,16 +41,5 @@ class VivaEngageNetworkListCommand extends VivaEngageCommand {
44
41
  }
45
42
  }
46
43
  }
47
- _VivaEngageNetworkListCommand_instances = new WeakSet(), _VivaEngageNetworkListCommand_initTelemetry = function _VivaEngageNetworkListCommand_initTelemetry() {
48
- this.telemetry.push((args) => {
49
- Object.assign(this.telemetryProperties, {
50
- withSuspended: args.options.withSuspended
51
- });
52
- });
53
- }, _VivaEngageNetworkListCommand_initOptions = function _VivaEngageNetworkListCommand_initOptions() {
54
- this.options.unshift({
55
- option: '--withSuspended'
56
- });
57
- };
58
44
  export default new VivaEngageNetworkListCommand();
59
45
  //# sourceMappingURL=engage-network-list.js.map
@@ -1,5 +1,6 @@
1
- import PeriodBasedReport from '../../../base/PeriodBasedReport.js';
1
+ import PeriodBasedReport, { periodBasedReportOptions } from '../../../base/PeriodBasedReport.js';
2
2
  import commands from '../../commands.js';
3
+ export const options = periodBasedReportOptions;
3
4
  class VivaEngageReportActivityCountsCommand extends PeriodBasedReport {
4
5
  get name() {
5
6
  return commands.ENGAGE_REPORT_ACTIVITYCOUNTS;
@@ -1,5 +1,6 @@
1
- import PeriodBasedReport from '../../../base/PeriodBasedReport.js';
1
+ import PeriodBasedReport, { periodBasedReportOptions } from '../../../base/PeriodBasedReport.js';
2
2
  import commands from '../../commands.js';
3
+ export const options = periodBasedReportOptions;
3
4
  class VivaEngageReportActivityUserCountsCommand extends PeriodBasedReport {
4
5
  get name() {
5
6
  return commands.ENGAGE_REPORT_ACTIVITYUSERCOUNTS;