@pnp/cli-microsoft365 11.4.0-beta.13d597c → 11.4.0-beta.312ca0b

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 (113) hide show
  1. package/.devproxy/api-specs/sharepoint.yaml +43 -0
  2. package/allCommands.json +1 -1
  3. package/allCommandsFull.json +1 -1
  4. package/dist/Command.js +2 -2
  5. package/dist/cli/cli.js +8 -8
  6. package/dist/m365/adaptivecard/commands/adaptivecard-send.js +10 -11
  7. package/dist/m365/app/commands/app-open.js +3 -4
  8. package/dist/m365/app/commands/permission/permission-add.js +4 -5
  9. package/dist/m365/base/AppCommand.js +3 -3
  10. package/dist/m365/booking/commands/business/business-get.js +6 -8
  11. package/dist/m365/booking/commands/business/business-list.js +2 -1
  12. package/dist/m365/cli/commands/app/app-add.js +5 -7
  13. package/dist/m365/commands/docs.js +1 -1
  14. package/dist/m365/commands/login.js +17 -18
  15. package/dist/m365/commands/logout.js +1 -1
  16. package/dist/m365/commands/status.js +2 -1
  17. package/dist/m365/connection/commands/connection-list.js +2 -1
  18. package/dist/m365/context/commands/context-remove.js +4 -6
  19. package/dist/m365/context/commands/option/option-remove.js +5 -7
  20. package/dist/m365/entra/commands/administrativeunit/administrativeunit-add.js +5 -7
  21. package/dist/m365/entra/commands/administrativeunit/administrativeunit-get.js +7 -9
  22. package/dist/m365/entra/commands/administrativeunit/administrativeunit-list.js +4 -5
  23. package/dist/m365/entra/commands/administrativeunit/administrativeunit-remove.js +8 -10
  24. package/dist/m365/entra/commands/license/license-list.js +1 -1
  25. package/dist/m365/entra/commands/multitenant/multitenant-add.js +3 -4
  26. package/dist/m365/entra/commands/organization/organization-list.js +4 -6
  27. package/dist/m365/entra/commands/organization/organization-set.js +24 -26
  28. package/dist/m365/entra/commands/roleassignment/roleassignment-add.js +21 -34
  29. package/dist/m365/entra/commands/roledefinition/roledefinition-add.js +8 -10
  30. package/dist/m365/entra/commands/roledefinition/roledefinition-get.js +11 -13
  31. package/dist/m365/entra/commands/roledefinition/roledefinition-list.js +5 -7
  32. package/dist/m365/entra/commands/roledefinition/roledefinition-remove.js +11 -13
  33. package/dist/m365/entra/commands/roledefinition/roledefinition-set.js +15 -17
  34. package/dist/m365/entra/commands/rolepermission/rolepermission-list.js +5 -7
  35. package/dist/m365/entra/commands/user/user-session-revoke.js +9 -13
  36. package/dist/m365/exo/commands/approleassignment/approleassignment-add.js +29 -31
  37. package/dist/m365/flow/commands/environment/environment-get.js +5 -7
  38. package/dist/m365/flow/commands/environment/environment-list.js +2 -1
  39. package/dist/m365/flow/commands/recyclebinitem/recyclebinitem-list.js +4 -6
  40. package/dist/m365/flow/commands/recyclebinitem/recyclebinitem-restore.js +5 -11
  41. package/dist/m365/graph/commands/directoryextension/directoryextension-add.js +11 -13
  42. package/dist/m365/graph/commands/directoryextension/directoryextension-get.js +10 -19
  43. package/dist/m365/graph/commands/directoryextension/directoryextension-list.js +6 -12
  44. package/dist/m365/graph/commands/directoryextension/directoryextension-remove.js +11 -20
  45. package/dist/m365/graph/commands/openextension/openextension-add.js +12 -13
  46. package/dist/m365/graph/commands/openextension/openextension-get.js +12 -14
  47. package/dist/m365/graph/commands/openextension/openextension-list.js +11 -13
  48. package/dist/m365/graph/commands/openextension/openextension-remove.js +13 -15
  49. package/dist/m365/graph/commands/openextension/openextension-set.js +16 -17
  50. package/dist/m365/onedrive/commands/onedrive-list.js +2 -1
  51. package/dist/m365/outlook/commands/mail/mail-searchfolder-add.js +9 -14
  52. package/dist/m365/outlook/commands/mailbox/mailbox-settings-get.js +8 -12
  53. package/dist/m365/outlook/commands/mailbox/mailbox-settings-set.js +15 -15
  54. package/dist/m365/outlook/commands/roomlist/roomlist-list.js +2 -1
  55. package/dist/m365/pa/commands/environment/environment-get.js +5 -7
  56. package/dist/m365/pa/commands/environment/environment-list.js +2 -1
  57. package/dist/m365/planner/commands/tenant/tenant-settings-list.js +1 -1
  58. package/dist/m365/pp/commands/environment/environment-get.js +5 -7
  59. package/dist/m365/pp/commands/environment/environment-list.js +3 -4
  60. package/dist/m365/pp/commands/gateway/gateway-list.js +1 -1
  61. package/dist/m365/pp/commands/tenant/tenant-settings-list.js +1 -1
  62. package/dist/m365/pp/commands/website/website-get.js +12 -12
  63. package/dist/m365/purview/commands/retentionevent/retentionevent-list.js +2 -1
  64. package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-list.js +1 -1
  65. package/dist/m365/purview/commands/retentionlabel/retentionlabel-list.js +1 -1
  66. package/dist/m365/spe/commands/container/container-add.js +10 -15
  67. package/dist/m365/spe/commands/container/container-permission-list.js +4 -6
  68. package/dist/m365/spe/commands/container/container-recyclebinitem-list.js +5 -10
  69. package/dist/m365/spe/commands/container/container-recyclebinitem-restore.js +7 -12
  70. package/dist/m365/spe/commands/container/container-remove.js +10 -16
  71. package/dist/m365/spe/commands/containertype/containertype-add.js +15 -20
  72. package/dist/m365/spe/commands/containertype/containertype-get.js +6 -13
  73. package/dist/m365/spe/commands/containertype/containertype-remove.js +7 -14
  74. package/dist/m365/spfx/commands/project/project-upgrade.js +4 -6
  75. package/dist/m365/spo/commands/file/file-version-keep.js +10 -14
  76. package/dist/m365/spo/commands/homesite/homesite-add.js +13 -15
  77. package/dist/m365/spo/commands/homesite/homesite-get.js +8 -9
  78. package/dist/m365/spo/commands/homesite/homesite-remove.js +9 -10
  79. package/dist/m365/spo/commands/homesite/homesite-set.js +13 -14
  80. package/dist/m365/spo/commands/list/DefaultColumnValue.js +2 -0
  81. package/dist/m365/spo/commands/list/list-defaultvalue-clear.js +13 -17
  82. package/dist/m365/spo/commands/list/list-defaultvalue-get.js +124 -0
  83. package/dist/m365/spo/commands/list/list-defaultvalue-list.js +13 -37
  84. package/dist/m365/spo/commands/list/list-defaultvalue-remove.js +12 -16
  85. package/dist/m365/spo/commands/list/list-defaultvalue-set.js +11 -15
  86. package/dist/m365/spo/commands/list/list-view-add.js +16 -20
  87. package/dist/m365/spo/commands/page/page-control-remove.js +11 -15
  88. package/dist/m365/spo/commands/page/page-get.js +10 -11
  89. package/dist/m365/spo/commands/page/page-publish.js +9 -10
  90. package/dist/m365/spo/commands/page/page-section-remove.js +11 -12
  91. package/dist/m365/spo/commands/site/site-appcatalog-list.js +4 -6
  92. package/dist/m365/spo/commands/site/site-get.js +6 -8
  93. package/dist/m365/spo/commands/site/site-sharingpermission-set.js +7 -9
  94. package/dist/m365/spo/commands/site/site-versionpolicy-get.js +11 -13
  95. package/dist/m365/spo/commands/web/web-alert-list.js +20 -27
  96. package/dist/m365/spo/commands/web/web-alert-remove.js +15 -20
  97. package/dist/m365/spo/commands.js +1 -0
  98. package/dist/m365/spp/commands/model/model-apply.js +18 -24
  99. package/dist/m365/teams/commands/callrecord/callrecord-list.js +5 -9
  100. package/dist/m365/tenant/commands/people/people-pronouns-set.js +4 -6
  101. package/dist/m365/tenant/commands/report/report-settings-set.js +4 -6
  102. package/dist/m365/viva/commands/engage/engage-community-user-add.js +17 -22
  103. package/dist/m365/viva/commands/engage/engage-community-user-list.js +8 -14
  104. package/dist/m365/viva/commands/engage/engage-community-user-remove.js +14 -22
  105. package/dist/m365/viva/commands/engage/engage-role-member-list.js +6 -11
  106. package/dist/utils/spo.js +29 -0
  107. package/dist/utils/zod.js +41 -76
  108. package/docs/docs/cmd/entra/app/app-permission-add.mdx +19 -0
  109. package/docs/docs/cmd/entra/app/app-permission-list.mdx +19 -0
  110. package/docs/docs/cmd/entra/app/app-permission-remove.mdx +21 -0
  111. package/docs/docs/cmd/spo/list/list-defaultvalue-get.mdx +118 -0
  112. package/npm-shrinkwrap.json +4 -11
  113. package/package.json +2 -2
@@ -3,27 +3,23 @@ import { z } from 'zod';
3
3
  import commands from '../../commands.js';
4
4
  import { validation } from '../../../../utils/validation.js';
5
5
  import SpoCommand from '../../../base/SpoCommand.js';
6
- import { zod } from '../../../../utils/zod.js';
7
6
  import { cli } from '../../../../cli/cli.js';
8
7
  import request from '../../../../request.js';
9
8
  import { formatting } from '../../../../utils/formatting.js';
10
9
  import { Page } from './Page.js';
11
10
  import { urlUtil } from '../../../../utils/urlUtil.js';
12
- const options = globalOptionsZod
13
- .extend({
14
- webUrl: zod.alias('u', z.string())
15
- .refine(url => validation.isValidSharePointUrl(url) === true, url => ({
16
- message: `'${url}' is not a valid SharePoint URL.`
17
- })),
18
- pageName: zod.alias('n', z.string()),
19
- id: zod.alias('i', z.string())
20
- .refine(id => validation.isValidGuid(id), id => ({
21
- message: `'${id}' is not a valid GUID.`
22
- })),
11
+ export const options = z.strictObject({
12
+ ...globalOptionsZod.shape,
13
+ webUrl: z.string()
14
+ .refine(url => validation.isValidSharePointUrl(url) === true, {
15
+ error: e => `'${e.input}' is not a valid SharePoint URL.`
16
+ })
17
+ .alias('u'),
18
+ pageName: z.string().alias('n'),
19
+ id: z.uuid().alias('i'),
23
20
  draft: z.boolean().optional(),
24
- force: zod.alias('f', z.boolean().optional())
25
- })
26
- .strict();
21
+ force: z.boolean().optional().alias('f')
22
+ });
27
23
  class SpoPageControlRemoveCommand extends SpoCommand {
28
24
  get name() {
29
25
  return commands.PAGE_CONTROL_REMOVE;
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
- import { zod } from '../../../../utils/zod.js';
3
2
  import { globalOptionsZod } from '../../../../Command.js';
4
3
  import request from '../../../../request.js';
5
4
  import { formatting } from '../../../../utils/formatting.js';
@@ -7,17 +6,17 @@ import { urlUtil } from '../../../../utils/urlUtil.js';
7
6
  import { validation } from '../../../../utils/validation.js';
8
7
  import SpoCommand from '../../../base/SpoCommand.js';
9
8
  import commands from '../../commands.js';
10
- const options = globalOptionsZod
11
- .extend({
12
- webUrl: zod.alias('u', z.string()
13
- .refine(url => validation.isValidSharePointUrl(url) === true, url => ({
14
- message: `'${url}' is not a valid SharePoint Online site URL.`
15
- }))),
16
- name: zod.alias('n', z.string()).optional(),
9
+ export const options = z.strictObject({
10
+ ...globalOptionsZod.shape,
11
+ webUrl: z.string()
12
+ .refine(url => validation.isValidSharePointUrl(url) === true, {
13
+ error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
14
+ })
15
+ .alias('u'),
16
+ name: z.string().optional().alias('n'),
17
17
  default: z.boolean().optional(),
18
18
  metadataOnly: z.boolean().optional()
19
- })
20
- .strict();
19
+ });
21
20
  class SpoPageGetCommand extends SpoCommand {
22
21
  get name() {
23
22
  return commands.PAGE_GET;
@@ -31,7 +30,7 @@ class SpoPageGetCommand extends SpoCommand {
31
30
  getRefinedSchema(schema) {
32
31
  return schema
33
32
  .refine(options => [options.name, options.default].filter(x => x !== undefined).length === 1, {
34
- message: `Specify either name or default, but not both.`
33
+ error: `Specify either name or default, but not both.`
35
34
  });
36
35
  }
37
36
  async commandAction(logger, args) {
@@ -1,20 +1,19 @@
1
1
  import { z } from 'zod';
2
- import { zod } from '../../../../utils/zod.js';
3
2
  import { globalOptionsZod } from '../../../../Command.js';
4
3
  import { urlUtil } from '../../../../utils/urlUtil.js';
5
4
  import { validation } from '../../../../utils/validation.js';
6
5
  import SpoCommand from '../../../base/SpoCommand.js';
7
6
  import commands from '../../commands.js';
8
7
  import { Page } from './Page.js';
9
- const options = globalOptionsZod
10
- .extend({
11
- webUrl: zod.alias('u', z.string()
12
- .refine(url => validation.isValidSharePointUrl(url) === true, url => ({
13
- message: `'${url}' is not a valid SharePoint Online site URL.`
14
- }))),
15
- name: zod.alias('n', z.string())
16
- })
17
- .strict();
8
+ export const options = z.strictObject({
9
+ ...globalOptionsZod.shape,
10
+ webUrl: z.string()
11
+ .refine(url => validation.isValidSharePointUrl(url) === true, {
12
+ error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
13
+ })
14
+ .alias('u'),
15
+ name: z.string().alias('n')
16
+ });
18
17
  class SpoPagePublishCommand extends SpoCommand {
19
18
  get name() {
20
19
  return commands.PAGE_PUBLISH;
@@ -8,18 +8,17 @@ import commands from '../../commands.js';
8
8
  import { Page } from './Page.js';
9
9
  import { z } from 'zod';
10
10
  import { globalOptionsZod } from '../../../../Command.js';
11
- import { zod } from '../../../../utils/zod.js';
12
- const options = globalOptionsZod
13
- .extend({
14
- webUrl: zod.alias('u', z.string()
15
- .refine(url => validation.isValidSharePointUrl(url) === true, url => ({
16
- message: `'${url}' is not a valid SharePoint Online site URL.`
17
- }))),
18
- pageName: zod.alias('n', z.string()),
19
- section: zod.alias('s', z.number()),
20
- force: zod.alias('f', z.boolean().optional())
21
- })
22
- .strict();
11
+ export const options = z.strictObject({
12
+ ...globalOptionsZod.shape,
13
+ webUrl: 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
+ pageName: z.string().alias('n'),
19
+ section: z.number().alias('s'),
20
+ force: z.boolean().optional().alias('f')
21
+ });
23
22
  class SpoPageSectionRemoveCommand extends SpoCommand {
24
23
  get name() {
25
24
  return commands.PAGE_SECTION_REMOVE;
@@ -1,15 +1,13 @@
1
1
  import { z } from 'zod';
2
2
  import { globalOptionsZod } from '../../../../Command.js';
3
- import { zod } from '../../../../utils/zod.js';
4
3
  import { odata } from '../../../../utils/odata.js';
5
4
  import { spo } from '../../../../utils/spo.js';
6
5
  import SpoCommand from '../../../base/SpoCommand.js';
7
6
  import commands from '../../commands.js';
8
- const options = globalOptionsZod
9
- .extend({
10
- excludeDeletedSites: zod.alias('excludeDeletedSites', z.boolean().optional())
11
- })
12
- .strict();
7
+ export const options = z.strictObject({
8
+ ...globalOptionsZod.shape,
9
+ excludeDeletedSites: z.boolean().optional()
10
+ });
13
11
  class SpoSiteAppCatalogListCommand extends SpoCommand {
14
12
  get name() {
15
13
  return commands.SITE_APPCATALOG_LIST;
@@ -2,16 +2,14 @@ import { z } from 'zod';
2
2
  import { globalOptionsZod } from '../../../../Command.js';
3
3
  import request from '../../../../request.js';
4
4
  import { validation } from '../../../../utils/validation.js';
5
- import { zod } from '../../../../utils/zod.js';
6
5
  import SpoCommand from '../../../base/SpoCommand.js';
7
6
  import commands from '../../commands.js';
8
- const options = globalOptionsZod
9
- .extend({
10
- url: zod.alias('u', z.string().refine(url => validation.isValidSharePointUrl(url) === true, {
11
- message: 'Specify a valid SharePoint site URL'
12
- }))
13
- })
14
- .strict();
7
+ export const options = z.strictObject({
8
+ ...globalOptionsZod.shape,
9
+ url: z.string().refine(url => validation.isValidSharePointUrl(url) === true, {
10
+ error: 'Specify a valid SharePoint site URL'
11
+ }).alias('u')
12
+ });
15
13
  class SpoSiteGetCommand extends SpoCommand {
16
14
  get name() {
17
15
  return commands.SITE_GET;
@@ -1,19 +1,17 @@
1
1
  import SpoCommand from '../../../base/SpoCommand.js';
2
2
  import { globalOptionsZod } from '../../../../Command.js';
3
3
  import { z } from 'zod';
4
- import { zod } from '../../../../utils/zod.js';
5
4
  import commands from '../../commands.js';
6
5
  import { validation } from '../../../../utils/validation.js';
7
6
  import request from '../../../../request.js';
8
- const options = globalOptionsZod
9
- .extend({
10
- siteUrl: zod.alias('u', z.string()
11
- .refine(url => validation.isValidSharePointUrl(url) === true, url => ({
12
- message: `'${url}' is not a valid SharePoint Online site URL.`
13
- }))),
7
+ export const options = z.strictObject({
8
+ ...globalOptionsZod.shape,
9
+ siteUrl: z.string()
10
+ .refine(url => validation.isValidSharePointUrl(url) === true, {
11
+ error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
12
+ }).alias('u'),
14
13
  capability: z.enum(['full', 'limited', 'ownersOnly'])
15
- })
16
- .strict();
14
+ });
17
15
  class SpoSiteSharingPermissionSetCommand extends SpoCommand {
18
16
  get name() {
19
17
  return commands.SITE_SHARINGPERMISSION_SET;
@@ -1,18 +1,16 @@
1
- import commands from '../../commands.js';
2
- import SpoCommand from '../../../base/SpoCommand.js';
3
- import { globalOptionsZod } from '../../../../Command.js';
4
1
  import { z } from 'zod';
5
- import { zod } from '../../../../utils/zod.js';
6
- import { validation } from '../../../../utils/validation.js';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import request from '../../../../request.js';
8
- export const options = globalOptionsZod
9
- .extend({
10
- siteUrl: zod.alias('u', z.string()
11
- .refine(url => validation.isValidSharePointUrl(url) === true, url => ({
12
- message: `'${url}' is not a valid SharePoint Online site URL.`
13
- })))
14
- })
15
- .strict();
4
+ import { validation } from '../../../../utils/validation.js';
5
+ import SpoCommand from '../../../base/SpoCommand.js';
6
+ import commands from '../../commands.js';
7
+ export const options = z.strictObject({
8
+ ...globalOptionsZod.shape,
9
+ siteUrl: z.string().alias('u')
10
+ .refine(url => validation.isValidSharePointUrl(url) === true, {
11
+ error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
12
+ })
13
+ });
16
14
  class SpoSiteVersionpolicyGetCommand extends SpoCommand {
17
15
  get name() {
18
16
  return commands.SITE_VERSIONPOLICY_GET;
@@ -1,34 +1,27 @@
1
- import commands from '../../commands.js';
2
- import SpoCommand from '../../../base/SpoCommand.js';
3
- import { globalOptionsZod } from '../../../../Command.js';
4
1
  import { z } from 'zod';
5
- import { zod } from '../../../../utils/zod.js';
6
- import { validation } from '../../../../utils/validation.js';
7
- import { spo } from '../../../../utils/spo.js';
2
+ import { cli } from '../../../../cli/cli.js';
3
+ import { globalOptionsZod } from '../../../../Command.js';
8
4
  import { entraUser } from '../../../../utils/entraUser.js';
9
5
  import { formatting } from '../../../../utils/formatting.js';
10
6
  import { odata } from '../../../../utils/odata.js';
11
- import { cli } from '../../../../cli/cli.js';
12
- export const options = globalOptionsZod
13
- .extend({
14
- webUrl: zod.alias('u', z.string()
15
- .refine(url => validation.isValidSharePointUrl(url) === true, url => ({
16
- message: `'${url}' is not a valid SharePoint site URL.`
17
- }))),
18
- listId: z.string()
19
- .refine(id => validation.isValidGuid(id), id => ({
20
- message: `'${id}' is not a valid GUID.`
21
- })).optional(),
7
+ import { spo } from '../../../../utils/spo.js';
8
+ import { validation } from '../../../../utils/validation.js';
9
+ import SpoCommand from '../../../base/SpoCommand.js';
10
+ import commands from '../../commands.js';
11
+ export const options = z.strictObject({
12
+ ...globalOptionsZod.shape,
13
+ webUrl: z.string().alias('u')
14
+ .refine(url => validation.isValidSharePointUrl(url) === true, {
15
+ error: e => `'${e.input}' is not a valid SharePoint site URL.`
16
+ }),
17
+ listId: z.uuid().optional(),
22
18
  listUrl: z.string().optional(),
23
19
  listTitle: z.string().optional(),
24
- userName: z.string().refine(upn => validation.isValidUserPrincipalName(upn), upn => ({
25
- message: `'${upn}' is not a valid UPN.`
26
- })).optional(),
27
- userId: z.string().refine(id => validation.isValidGuid(id), id => ({
28
- message: `'${id}' is not a valid GUID.`
29
- })).optional()
30
- })
31
- .strict();
20
+ userName: z.string().optional().refine(upn => typeof upn === 'undefined' || validation.isValidUserPrincipalName(upn), {
21
+ error: e => `'${e.input}' is not a valid UPN.`
22
+ }),
23
+ userId: z.uuid().optional()
24
+ });
32
25
  class SpoWebAlertListCommand extends SpoCommand {
33
26
  get name() {
34
27
  return commands.WEB_ALERT_LIST;
@@ -45,10 +38,10 @@ class SpoWebAlertListCommand extends SpoCommand {
45
38
  getRefinedSchema(schema) {
46
39
  return schema
47
40
  .refine(options => [options.listId, options.listUrl, options.listTitle].filter(x => x !== undefined).length <= 1, {
48
- message: `Specify either listId, listUrl, or listTitle, but not more than one.`
41
+ error: `Specify either listId, listUrl, or listTitle, but not more than one.`
49
42
  })
50
43
  .refine(options => [options.userName, options.userId].filter(x => x !== undefined).length <= 1, {
51
- message: `Specify either userName or userId, but not both.`
44
+ error: `Specify either userName or userId, but not both.`
52
45
  });
53
46
  }
54
47
  async commandAction(logger, args) {
@@ -1,25 +1,20 @@
1
- import commands from '../../commands.js';
2
- import SpoCommand from '../../../base/SpoCommand.js';
3
- import { globalOptionsZod } from '../../../../Command.js';
4
1
  import { z } from 'zod';
5
- import { zod } from '../../../../utils/zod.js';
6
- import { validation } from '../../../../utils/validation.js';
7
- import { formatting } from '../../../../utils/formatting.js';
8
- import request from '../../../../request.js';
9
2
  import { cli } from '../../../../cli/cli.js';
10
- const options = globalOptionsZod
11
- .extend({
12
- webUrl: zod.alias('u', z.string()
13
- .refine(url => validation.isValidSharePointUrl(url) === true, url => ({
14
- message: `'${url}' is not a valid SharePoint URL.`
15
- }))),
16
- id: z.string()
17
- .refine(id => validation.isValidGuid(id), id => ({
18
- message: `'${id}' is not a valid GUID.`
19
- })),
20
- force: zod.alias('f', z.boolean().optional())
21
- })
22
- .strict();
3
+ import { globalOptionsZod } from '../../../../Command.js';
4
+ import request from '../../../../request.js';
5
+ import { formatting } from '../../../../utils/formatting.js';
6
+ import { validation } from '../../../../utils/validation.js';
7
+ import SpoCommand from '../../../base/SpoCommand.js';
8
+ import commands from '../../commands.js';
9
+ const options = z.strictObject({
10
+ ...globalOptionsZod.shape,
11
+ webUrl: z.string().alias('u')
12
+ .refine(url => validation.isValidSharePointUrl(url) === true, {
13
+ error: e => `'${e.input}' is not a valid SharePoint URL.`
14
+ }),
15
+ id: z.uuid(),
16
+ force: z.boolean().optional().alias('f')
17
+ });
23
18
  class SpoWebAlertRemoveCommand extends SpoCommand {
24
19
  get name() {
25
20
  return commands.WEB_ALERT_REMOVE;
@@ -141,6 +141,7 @@ export default {
141
141
  LIST_CONTENTTYPE_REMOVE: `${prefix} list contenttype remove`,
142
142
  LIST_CONTENTTYPE_DEFAULT_SET: `${prefix} list contenttype default set`,
143
143
  LIST_DEFAULTVALUE_CLEAR: `${prefix} list defaultvalue clear`,
144
+ LIST_DEFAULTVALUE_GET: `${prefix} list defaultvalue get`,
144
145
  LIST_DEFAULTVALUE_LIST: `${prefix} list defaultvalue list`,
145
146
  LIST_DEFAULTVALUE_REMOVE: `${prefix} list defaultvalue remove`,
146
147
  LIST_DEFAULTVALUE_SET: `${prefix} list defaultvalue set`,
@@ -7,31 +7,25 @@ import SpoCommand from '../../../base/SpoCommand.js';
7
7
  import commands from '../../commands.js';
8
8
  import { z } from 'zod';
9
9
  import { globalOptionsZod } from '../../../../Command.js';
10
- import { zod } from '../../../../utils/zod.js';
11
- const options = globalOptionsZod
12
- .extend({
13
- contentCenterUrl: zod.alias('c', z.string()
14
- .refine(url => validation.isValidSharePointUrl(url) === true, url => ({
15
- message: `'${url}' is not a valid SharePoint Online site URL.`
16
- }))),
17
- webUrl: zod.alias('u', z.string()
18
- .refine(url => validation.isValidSharePointUrl(url) === true, url => ({
19
- message: `'${url}' is not a valid SharePoint Online site URL.`
20
- }))),
21
- id: zod.alias('i', z.string()
22
- .refine(id => validation.isValidGuid(id) === true, id => ({
23
- message: `${id} is not a valid GUID.`
24
- })).optional()),
25
- title: zod.alias('t', z.string()).optional(),
10
+ export const options = z.strictObject({
11
+ ...globalOptionsZod.shape,
12
+ contentCenterUrl: z.string()
13
+ .refine(url => validation.isValidSharePointUrl(url) === true, {
14
+ error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
15
+ })
16
+ .alias('c'),
17
+ webUrl: z.string()
18
+ .refine(url => validation.isValidSharePointUrl(url) === true, {
19
+ error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
20
+ })
21
+ .alias('u'),
22
+ id: z.uuid().optional().alias('i'),
23
+ title: z.string().optional().alias('t'),
26
24
  listTitle: z.string().optional(),
27
- listId: z.string()
28
- .refine(listId => validation.isValidGuid(listId) === true, listId => ({
29
- message: `${listId} is not a valid GUID.`
30
- })).optional(),
25
+ listId: z.uuid().optional(),
31
26
  listUrl: z.string().optional(),
32
27
  viewOption: z.enum(['NewViewAsDefault', 'DoNotChangeDefault', 'TileViewAsDefault']).optional()
33
- })
34
- .strict();
28
+ });
35
29
  class SppModelApplyCommand extends SpoCommand {
36
30
  get name() {
37
31
  return commands.MODEL_APPLY;
@@ -45,10 +39,10 @@ class SppModelApplyCommand extends SpoCommand {
45
39
  getRefinedSchema(schema) {
46
40
  return schema
47
41
  .refine(options => [options.id, options.title].filter(x => x !== undefined).length === 1, {
48
- message: `Specify exactly one of the following options: 'id' or 'title'.`
42
+ error: `Specify exactly one of the following options: 'id' or 'title'.`
49
43
  })
50
44
  .refine(options => [options.listTitle, options.listId, options.listUrl].filter(x => x !== undefined).length === 1, {
51
- message: `Specify exactly one of the following options: 'listTitle', 'listId' or 'listUrl'.`
45
+ error: `Specify exactly one of the following options: 'listTitle', 'listId' or 'listUrl'.`
52
46
  });
53
47
  }
54
48
  async commandAction(logger, args) {
@@ -5,12 +5,9 @@ import GraphApplicationCommand from '../../../base/GraphApplicationCommand.js';
5
5
  import { validation } from '../../../../utils/validation.js';
6
6
  import { entraUser } from '../../../../utils/entraUser.js';
7
7
  import { odata } from '../../../../utils/odata.js';
8
- const options = globalOptionsZod
9
- .extend({
10
- userId: z.string()
11
- .refine((val) => validation.isValidGuid(val), {
12
- message: 'Invalid GUID.'
13
- }).optional(),
8
+ export const options = z.strictObject({
9
+ ...globalOptionsZod.shape,
10
+ userId: z.uuid().optional(),
14
11
  userName: z.string()
15
12
  .refine((val) => validation.isValidUserPrincipalName(val), {
16
13
  message: 'Invalid user principal name.'
@@ -41,8 +38,7 @@ const options = globalOptionsZod
41
38
  }, {
42
39
  message: 'Date must be a valid ISO date within the last 30 days and not in the future.'
43
40
  }).optional()
44
- })
45
- .strict();
41
+ });
46
42
  class TeamsCallRecordListCommand extends GraphApplicationCommand {
47
43
  get name() {
48
44
  return commands.CALLRECORD_LIST;
@@ -59,7 +55,7 @@ class TeamsCallRecordListCommand extends GraphApplicationCommand {
59
55
  getRefinedSchema(schema) {
60
56
  return schema
61
57
  .refine((options) => [options.userId, options.userName].filter(o => o !== undefined).length <= 1, {
62
- message: 'Use one of the following options: userId or userName but not both.'
58
+ error: 'Use one of the following options: userId or userName but not both.'
63
59
  })
64
60
  .refine((options) => [options.startDateTime, options.endDateTime].filter(o => o !== undefined).length <= 1 || new Date(options.startDateTime) < new Date(options.endDateTime), {
65
61
  message: 'Value of startDateTime, must be before endDateTime.'
@@ -1,14 +1,12 @@
1
1
  import { z } from 'zod';
2
2
  import { globalOptionsZod } from '../../../../Command.js';
3
3
  import request from '../../../../request.js';
4
- import { zod } from '../../../../utils/zod.js';
5
4
  import GraphCommand from '../../../base/GraphCommand.js';
6
5
  import commands from '../../commands.js';
7
- const options = globalOptionsZod
8
- .extend({
9
- enabled: zod.alias('e', z.boolean())
10
- })
11
- .strict();
6
+ export const options = z.strictObject({
7
+ ...globalOptionsZod.shape,
8
+ enabled: z.boolean().alias('e')
9
+ });
12
10
  class TenantPeoplePronounsSetCommand extends GraphCommand {
13
11
  get name() {
14
12
  return commands.PEOPLE_PRONOUNS_SET;
@@ -3,12 +3,10 @@ import GraphCommand from '../../../base/GraphCommand.js';
3
3
  import commands from '../../commands.js';
4
4
  import { z } from 'zod';
5
5
  import { globalOptionsZod } from '../../../../Command.js';
6
- import { zod } from '../../../../utils/zod.js';
7
- const options = globalOptionsZod
8
- .extend({
9
- displayConcealedNames: zod.alias('d', z.boolean())
10
- })
11
- .strict();
6
+ export const options = z.strictObject({
7
+ ...globalOptionsZod.shape,
8
+ displayConcealedNames: z.boolean().alias('d')
9
+ });
12
10
  class TenantReportSettingsSetCommand extends GraphCommand {
13
11
  get name() {
14
12
  return commands.REPORT_SETTINGS_SET;
@@ -1,6 +1,5 @@
1
1
  import { z } from 'zod';
2
2
  import { globalOptionsZod } from '../../../../Command.js';
3
- import { zod } from '../../../../utils/zod.js';
4
3
  import GraphCommand from '../../../base/GraphCommand.js';
5
4
  import commands from '../../commands.js';
6
5
  import { validation } from '../../../../utils/validation.js';
@@ -8,25 +7,21 @@ import { vivaEngage } from '../../../../utils/vivaEngage.js';
8
7
  import request from '../../../../request.js';
9
8
  import { entraUser } from '../../../../utils/entraUser.js';
10
9
  import { formatting } from '../../../../utils/formatting.js';
11
- const options = globalOptionsZod
12
- .extend({
10
+ export const options = z.strictObject({
11
+ ...globalOptionsZod.shape,
13
12
  communityId: z.string().optional(),
14
- communityDisplayName: zod.alias('n', z.string().optional()),
15
- entraGroupId: z.string()
16
- .refine(id => validation.isValidGuid(id), id => ({
17
- message: `'${id}' is not a valid GUID.`
18
- })).optional(),
13
+ communityDisplayName: z.string().optional().alias('n'),
14
+ entraGroupId: z.uuid().optional(),
19
15
  ids: z.string()
20
- .refine(ids => validation.isValidGuidArray(ids) === true, invalidIds => ({
21
- message: `The following GUIDs are invalid: ${invalidIds}.`
22
- })).optional(),
16
+ .refine(ids => validation.isValidGuidArray(ids) === true, {
17
+ error: e => `The following GUIDs are invalid: ${e.input}.`
18
+ }).optional(),
23
19
  userNames: z.string()
24
- .refine(userNames => validation.isValidUserPrincipalNameArray(userNames) === true, invalidUserNames => ({
25
- message: `The following user principal names are invalid: ${invalidUserNames}.`
26
- })).optional(),
27
- role: zod.alias('r', z.enum(['Admin', 'Member']))
28
- })
29
- .strict();
20
+ .refine(userNames => validation.isValidUserPrincipalNameArray(userNames) === true, {
21
+ error: e => `The following user principal names are invalid: ${e.input}.`
22
+ }).optional(),
23
+ role: z.enum(['Admin', 'Member']).alias('r')
24
+ });
30
25
  class VivaEngageCommunityUserAddCommand extends GraphCommand {
31
26
  get name() {
32
27
  return commands.ENGAGE_COMMUNITY_USER_ADD;
@@ -40,16 +35,16 @@ class VivaEngageCommunityUserAddCommand extends GraphCommand {
40
35
  getRefinedSchema(schema) {
41
36
  return schema
42
37
  .refine(options => [options.communityId, options.communityDisplayName, options.entraGroupId].filter(x => x !== undefined).length === 1, {
43
- message: 'Specify either communityId, communityDisplayName, or entraGroupId, but not multiple.'
38
+ error: 'Specify either communityId, communityDisplayName, or entraGroupId, but not multiple.'
44
39
  })
45
40
  .refine(options => options.communityId || options.communityDisplayName || options.entraGroupId, {
46
- message: 'Specify at least one of communityId, communityDisplayName, or entraGroupId.'
41
+ error: 'Specify at least one of communityId, communityDisplayName, or entraGroupId.'
47
42
  })
48
43
  .refine(options => options.ids || options.userNames, {
49
- message: 'Specify either of ids or userNames.'
44
+ error: 'Specify either of ids or userNames.'
50
45
  })
51
- .refine(options => options.userNames !== undefined || options.ids !== undefined, {
52
- message: 'Specify either ids or userNames, but not both.'
46
+ .refine(options => typeof options.userNames !== 'undefined' || typeof options.ids !== 'undefined', {
47
+ error: 'Specify either ids or userNames, but not both.'
53
48
  });
54
49
  }
55
50
  async commandAction(logger, args) {
@@ -1,22 +1,16 @@
1
1
  import { z } from 'zod';
2
2
  import { globalOptionsZod } from '../../../../Command.js';
3
- import { zod } from '../../../../utils/zod.js';
4
3
  import GraphCommand from '../../../base/GraphCommand.js';
5
4
  import commands from '../../commands.js';
6
- import { validation } from '../../../../utils/validation.js';
7
5
  import { vivaEngage } from '../../../../utils/vivaEngage.js';
8
6
  import { odata } from '../../../../utils/odata.js';
9
- const options = globalOptionsZod
10
- .extend({
7
+ export const options = z.strictObject({
8
+ ...globalOptionsZod.shape,
11
9
  communityId: z.string().optional(),
12
- communityDisplayName: zod.alias('n', z.string().optional()),
13
- entraGroupId: z.string()
14
- .refine(name => validation.isValidGuid(name), name => ({
15
- message: `'${name}' is not a valid GUID.`
16
- })).optional(),
17
- role: zod.alias('r', z.enum(['Admin', 'Member']).optional())
18
- })
19
- .strict();
10
+ communityDisplayName: z.string().optional().alias('n'),
11
+ entraGroupId: z.uuid().optional(),
12
+ role: z.enum(['Admin', 'Member']).optional().alias('r')
13
+ });
20
14
  class VivaEngageCommunityUserListCommand extends GraphCommand {
21
15
  get name() {
22
16
  return commands.ENGAGE_COMMUNITY_USER_LIST;
@@ -30,10 +24,10 @@ class VivaEngageCommunityUserListCommand extends GraphCommand {
30
24
  getRefinedSchema(schema) {
31
25
  return schema
32
26
  .refine(options => [options.communityId, options.communityDisplayName, options.entraGroupId].filter(x => x !== undefined).length === 1, {
33
- message: 'Specify either communityId, communityDisplayName, or entraGroupId, but not multiple.'
27
+ error: 'Specify either communityId, communityDisplayName, or entraGroupId, but not multiple.'
34
28
  })
35
29
  .refine(options => options.communityId || options.communityDisplayName || options.entraGroupId, {
36
- message: 'Specify at least one of communityId, communityDisplayName, or entraGroupId.'
30
+ error: 'Specify at least one of communityId, communityDisplayName, or entraGroupId.'
37
31
  });
38
32
  }
39
33
  defaultProperties() {