@pnp/cli-microsoft365 11.4.0-beta.13d597c → 11.4.0-beta.40f818c

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 (121) hide show
  1. package/.devproxy/api-specs/sharepoint.yaml +43 -0
  2. package/README.md +1 -1
  3. package/allCommands.json +1 -1
  4. package/allCommandsFull.json +1 -1
  5. package/dist/AuthServer.js +2 -4
  6. package/dist/Command.js +2 -2
  7. package/dist/cli/cli.js +8 -8
  8. package/dist/m365/adaptivecard/commands/adaptivecard-send.js +10 -11
  9. package/dist/m365/app/commands/app-open.js +3 -4
  10. package/dist/m365/app/commands/permission/permission-add.js +4 -5
  11. package/dist/m365/base/AppCommand.js +3 -3
  12. package/dist/m365/booking/commands/business/business-get.js +6 -8
  13. package/dist/m365/booking/commands/business/business-list.js +2 -1
  14. package/dist/m365/cli/commands/app/app-add.js +5 -7
  15. package/dist/m365/commands/docs.js +1 -1
  16. package/dist/m365/commands/login.js +17 -18
  17. package/dist/m365/commands/logout.js +1 -1
  18. package/dist/m365/commands/status.js +2 -1
  19. package/dist/m365/connection/commands/connection-list.js +2 -1
  20. package/dist/m365/context/commands/context-remove.js +4 -6
  21. package/dist/m365/context/commands/option/option-remove.js +5 -7
  22. package/dist/m365/entra/commands/administrativeunit/administrativeunit-add.js +5 -7
  23. package/dist/m365/entra/commands/administrativeunit/administrativeunit-get.js +7 -9
  24. package/dist/m365/entra/commands/administrativeunit/administrativeunit-list.js +4 -5
  25. package/dist/m365/entra/commands/administrativeunit/administrativeunit-remove.js +8 -10
  26. package/dist/m365/entra/commands/license/license-list.js +1 -1
  27. package/dist/m365/entra/commands/m365group/m365group-remove.js +1 -1
  28. package/dist/m365/entra/commands/multitenant/multitenant-add.js +3 -4
  29. package/dist/m365/entra/commands/organization/organization-list.js +4 -6
  30. package/dist/m365/entra/commands/organization/organization-set.js +24 -26
  31. package/dist/m365/entra/commands/roleassignment/roleassignment-add.js +21 -34
  32. package/dist/m365/entra/commands/roledefinition/roledefinition-add.js +8 -10
  33. package/dist/m365/entra/commands/roledefinition/roledefinition-get.js +11 -13
  34. package/dist/m365/entra/commands/roledefinition/roledefinition-list.js +5 -7
  35. package/dist/m365/entra/commands/roledefinition/roledefinition-remove.js +11 -13
  36. package/dist/m365/entra/commands/roledefinition/roledefinition-set.js +15 -17
  37. package/dist/m365/entra/commands/rolepermission/rolepermission-list.js +5 -7
  38. package/dist/m365/entra/commands/user/user-session-revoke.js +9 -13
  39. package/dist/m365/exo/commands/approleassignment/approleassignment-add.js +29 -31
  40. package/dist/m365/flow/commands/environment/environment-get.js +5 -7
  41. package/dist/m365/flow/commands/environment/environment-list.js +2 -1
  42. package/dist/m365/flow/commands/recyclebinitem/recyclebinitem-list.js +4 -6
  43. package/dist/m365/flow/commands/recyclebinitem/recyclebinitem-restore.js +5 -11
  44. package/dist/m365/graph/commands/directoryextension/directoryextension-add.js +11 -13
  45. package/dist/m365/graph/commands/directoryextension/directoryextension-get.js +10 -19
  46. package/dist/m365/graph/commands/directoryextension/directoryextension-list.js +6 -12
  47. package/dist/m365/graph/commands/directoryextension/directoryextension-remove.js +11 -20
  48. package/dist/m365/graph/commands/openextension/openextension-add.js +12 -13
  49. package/dist/m365/graph/commands/openextension/openextension-get.js +12 -14
  50. package/dist/m365/graph/commands/openextension/openextension-list.js +11 -13
  51. package/dist/m365/graph/commands/openextension/openextension-remove.js +13 -15
  52. package/dist/m365/graph/commands/openextension/openextension-set.js +16 -17
  53. package/dist/m365/onedrive/commands/onedrive-list.js +2 -1
  54. package/dist/m365/outlook/commands/mail/mail-searchfolder-add.js +9 -14
  55. package/dist/m365/outlook/commands/mailbox/mailbox-settings-get.js +8 -12
  56. package/dist/m365/outlook/commands/mailbox/mailbox-settings-set.js +15 -15
  57. package/dist/m365/outlook/commands/roomlist/roomlist-list.js +2 -1
  58. package/dist/m365/pa/commands/environment/environment-get.js +5 -7
  59. package/dist/m365/pa/commands/environment/environment-list.js +2 -1
  60. package/dist/m365/planner/commands/tenant/tenant-settings-list.js +1 -1
  61. package/dist/m365/pp/commands/environment/environment-get.js +5 -7
  62. package/dist/m365/pp/commands/environment/environment-list.js +3 -4
  63. package/dist/m365/pp/commands/gateway/gateway-list.js +1 -1
  64. package/dist/m365/pp/commands/tenant/tenant-settings-list.js +1 -1
  65. package/dist/m365/pp/commands/website/website-get.js +12 -12
  66. package/dist/m365/purview/commands/retentionevent/retentionevent-list.js +2 -1
  67. package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-list.js +1 -1
  68. package/dist/m365/purview/commands/retentionlabel/retentionlabel-list.js +1 -1
  69. package/dist/m365/spe/commands/container/container-add.js +10 -15
  70. package/dist/m365/spe/commands/container/container-permission-list.js +4 -6
  71. package/dist/m365/spe/commands/container/container-recyclebinitem-list.js +5 -10
  72. package/dist/m365/spe/commands/container/container-recyclebinitem-restore.js +7 -12
  73. package/dist/m365/spe/commands/container/container-remove.js +10 -16
  74. package/dist/m365/spe/commands/containertype/containertype-add.js +15 -20
  75. package/dist/m365/spe/commands/containertype/containertype-get.js +6 -13
  76. package/dist/m365/spe/commands/containertype/containertype-remove.js +7 -14
  77. package/dist/m365/spfx/commands/project/project-upgrade.js +4 -6
  78. package/dist/m365/spo/commands/file/file-version-keep.js +10 -14
  79. package/dist/m365/spo/commands/homesite/homesite-add.js +13 -15
  80. package/dist/m365/spo/commands/homesite/homesite-get.js +8 -9
  81. package/dist/m365/spo/commands/homesite/homesite-remove.js +9 -10
  82. package/dist/m365/spo/commands/homesite/homesite-set.js +13 -14
  83. package/dist/m365/spo/commands/list/DefaultColumnValue.js +2 -0
  84. package/dist/m365/spo/commands/list/list-defaultvalue-clear.js +13 -17
  85. package/dist/m365/spo/commands/list/list-defaultvalue-get.js +124 -0
  86. package/dist/m365/spo/commands/list/list-defaultvalue-list.js +13 -37
  87. package/dist/m365/spo/commands/list/list-defaultvalue-remove.js +12 -16
  88. package/dist/m365/spo/commands/list/list-defaultvalue-set.js +11 -15
  89. package/dist/m365/spo/commands/list/list-view-add.js +16 -20
  90. package/dist/m365/spo/commands/page/page-control-remove.js +11 -15
  91. package/dist/m365/spo/commands/page/page-get.js +10 -11
  92. package/dist/m365/spo/commands/page/page-publish.js +9 -10
  93. package/dist/m365/spo/commands/page/page-section-remove.js +11 -12
  94. package/dist/m365/spo/commands/site/site-appcatalog-list.js +4 -6
  95. package/dist/m365/spo/commands/site/site-get.js +6 -8
  96. package/dist/m365/spo/commands/site/site-sharingpermission-set.js +7 -9
  97. package/dist/m365/spo/commands/site/site-versionpolicy-get.js +11 -13
  98. package/dist/m365/spo/commands/web/web-alert-list.js +20 -27
  99. package/dist/m365/spo/commands/web/web-alert-remove.js +15 -20
  100. package/dist/m365/spo/commands.js +1 -0
  101. package/dist/m365/spp/commands/model/model-apply.js +18 -24
  102. package/dist/m365/teams/commands/callrecord/callrecord-list.js +5 -9
  103. package/dist/m365/teams/commands/chat/chat-message-list.js +26 -27
  104. package/dist/m365/teams/commands/chat/chat-message-send.js +12 -3
  105. package/dist/m365/teams/commands/chat/chatUtil.js +1 -1
  106. package/dist/m365/tenant/commands/people/people-pronouns-set.js +4 -6
  107. package/dist/m365/tenant/commands/report/report-settings-set.js +4 -6
  108. package/dist/m365/viva/commands/engage/engage-community-user-add.js +17 -22
  109. package/dist/m365/viva/commands/engage/engage-community-user-list.js +8 -14
  110. package/dist/m365/viva/commands/engage/engage-community-user-remove.js +14 -22
  111. package/dist/m365/viva/commands/engage/engage-role-member-list.js +6 -11
  112. package/dist/utils/spo.js +29 -0
  113. package/dist/utils/zod.js +41 -76
  114. package/docs/docs/cmd/entra/app/app-permission-add.mdx +19 -0
  115. package/docs/docs/cmd/entra/app/app-permission-list.mdx +19 -0
  116. package/docs/docs/cmd/entra/app/app-permission-remove.mdx +21 -0
  117. package/docs/docs/cmd/spo/list/list-defaultvalue-get.mdx +118 -0
  118. package/docs/docs/cmd/teams/chat/chat-message-list.mdx +34 -7
  119. package/docs/docs/cmd/teams/chat/chat-message-send.mdx +23 -1
  120. package/npm-shrinkwrap.json +274 -248
  121. package/package.json +11 -11
@@ -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() {
@@ -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,18 @@ import { vivaEngage } from '../../../../utils/vivaEngage.js';
8
7
  import request from '../../../../request.js';
9
8
  import { entraUser } from '../../../../utils/entraUser.js';
10
9
  import { cli } from '../../../../cli/cli.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(),
19
- id: z.string()
20
- .refine(id => validation.isValidGuid(id), id => ({
21
- message: `'${id}' is not a valid GUID.`
22
- })).optional(),
13
+ communityDisplayName: z.string().optional().alias('n'),
14
+ entraGroupId: z.uuid().optional(),
15
+ id: z.uuid().optional(),
23
16
  userName: z.string()
24
- .refine(userName => validation.isValidUserPrincipalName(userName), userName => ({
25
- message: `'${userName}' is not a valid user principal name.`
26
- })).optional(),
17
+ .refine(userName => validation.isValidUserPrincipalName(userName), {
18
+ error: e => `'${e.input}' is not a valid user principal name.`
19
+ }).optional(),
27
20
  force: z.boolean().optional()
28
- })
29
- .strict();
21
+ });
30
22
  class VivaEngageCommunityUserRemoveCommand extends GraphCommand {
31
23
  get name() {
32
24
  return commands.ENGAGE_COMMUNITY_USER_REMOVE;
@@ -40,16 +32,16 @@ class VivaEngageCommunityUserRemoveCommand extends GraphCommand {
40
32
  getRefinedSchema(schema) {
41
33
  return schema
42
34
  .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.'
35
+ error: 'Specify either communityId, communityDisplayName, or entraGroupId, but not multiple.'
44
36
  })
45
37
  .refine(options => options.communityId || options.communityDisplayName || options.entraGroupId, {
46
- message: 'Specify at least one of communityId, communityDisplayName, or entraGroupId.'
38
+ error: 'Specify at least one of communityId, communityDisplayName, or entraGroupId.'
47
39
  })
48
40
  .refine(options => options.id || options.userName, {
49
- message: 'Specify either of id or userName.'
41
+ error: 'Specify either of id or userName.'
50
42
  })
51
- .refine(options => options.userName !== undefined || options.id !== undefined, {
52
- message: 'Specify either id or userName, but not both.'
43
+ .refine(options => typeof options.userName !== 'undefined' || typeof options.id !== 'undefined', {
44
+ error: 'Specify either id or userName, but not both.'
53
45
  });
54
46
  }
55
47
  async commandAction(logger, args) {
@@ -1,19 +1,14 @@
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 GraphCommand from '../../../base/GraphCommand.js';
6
5
  import commands from '../../commands.js';
7
- import { validation } from '../../../../utils/validation.js';
8
6
  import { vivaEngage } from '../../../../utils/vivaEngage.js';
9
- const options = globalOptionsZod
10
- .extend({
11
- roleId: zod.alias('i', z.string().refine(name => validation.isValidGuid(name), name => ({
12
- message: `'${name}' is not a valid GUID.`
13
- })).optional()),
14
- roleName: zod.alias('n', z.string().optional())
15
- })
16
- .strict();
7
+ export const options = z.strictObject({
8
+ ...globalOptionsZod.shape,
9
+ roleId: z.uuid().optional().alias('i'),
10
+ roleName: z.string().optional().alias('n')
11
+ });
17
12
  class VivaEngageRoleMemberListCommand extends GraphCommand {
18
13
  get name() {
19
14
  return commands.ENGAGE_ROLE_MEMBER_LIST;
@@ -27,7 +22,7 @@ class VivaEngageRoleMemberListCommand extends GraphCommand {
27
22
  getRefinedSchema(schema) {
28
23
  return schema
29
24
  .refine(options => [options.roleId, options.roleName].filter(x => x !== undefined).length === 1, {
30
- message: 'Specify either roleId, or roleName, but not both.'
25
+ error: 'Specify either roleId, or roleName, but not both.'
31
26
  });
32
27
  }
33
28
  defaultProperties() {
package/dist/utils/spo.js CHANGED
@@ -11,6 +11,7 @@ import { RoleType } from '../m365/spo/commands/roledefinition/RoleType.js';
11
11
  import { entraGroup } from './entraGroup.js';
12
12
  import { SharingCapabilities } from '../m365/spo/commands/site/SharingCapabilities.js';
13
13
  import { timersUtil } from './timersUtil.js';
14
+ import { DOMParser } from '@xmldom/xmldom';
14
15
  export var CreateFileCopyJobsNameConflictBehavior;
15
16
  (function (CreateFileCopyJobsNameConflictBehavior) {
16
17
  CreateFileCopyJobsNameConflictBehavior[CreateFileCopyJobsNameConflictBehavior["Fail"] = 0] = "Fail";
@@ -1847,6 +1848,34 @@ export const spo = {
1847
1848
  roleDefinition.BasePermissionsValue = permissions.parse();
1848
1849
  roleDefinition.RoleTypeKindValue = RoleType[roleDefinition.RoleTypeKind];
1849
1850
  return roleDefinition;
1851
+ },
1852
+ /**
1853
+ * Converts SharePoint default column values XML to a structured JSON array.
1854
+ * Parses the XML content from client_LocationBasedDefaults.html file and extracts
1855
+ * default field values configured for folders in a SharePoint document library.
1856
+ *
1857
+ * @param xml The XML string containing default column value definitions
1858
+ * @returns An array of default column values with field names, values, and associated folder URLs
1859
+ */
1860
+ convertDefaultColumnXmlToJson(xml) {
1861
+ const results = [];
1862
+ const parser = new DOMParser();
1863
+ const doc = parser.parseFromString(xml, 'application/xml');
1864
+ const folderLinks = doc.getElementsByTagName('a');
1865
+ for (let i = 0; i < folderLinks.length; i++) {
1866
+ const folderUrl = folderLinks[i].getAttribute('href');
1867
+ const defaultValues = folderLinks[i].getElementsByTagName('DefaultValue');
1868
+ for (let j = 0; j < defaultValues.length; j++) {
1869
+ const fieldName = defaultValues[j].getAttribute('FieldName');
1870
+ const fieldValue = defaultValues[j].textContent;
1871
+ results.push({
1872
+ fieldName: fieldName,
1873
+ fieldValue: fieldValue,
1874
+ folderUrl: decodeURIComponent(folderUrl)
1875
+ });
1876
+ }
1877
+ }
1878
+ return results;
1850
1879
  }
1851
1880
  };
1852
1881
  //# sourceMappingURL=spo.js.map
package/dist/utils/zod.js CHANGED
@@ -1,114 +1,74 @@
1
1
  import { z } from 'zod';
2
- function parseEffect(def, _options, _currentOption) {
3
- return def.schema._def;
4
- }
5
- function parseIntersection(def, _options, _currentOption) {
6
- if (def.left._def.typeName !== z.ZodFirstPartyTypeKind.ZodAny) {
7
- return def.left._def;
8
- }
9
- if (def.right._def.typeName !== z.ZodFirstPartyTypeKind.ZodAny) {
10
- return def.right._def;
11
- }
12
- return;
13
- }
14
- function parseObject(def, options, _currentOption) {
15
- const properties = def.shape();
16
- for (const key in properties) {
17
- const property = properties[key];
2
+ z.ZodType.prototype.alias = function (name) {
3
+ this.def.alias = name;
4
+ return this;
5
+ };
6
+ function parseObject(schema, options, _currentOption) {
7
+ for (const key in schema.properties) {
8
+ const property = schema.properties[key];
18
9
  const option = {
19
10
  name: key,
20
11
  long: key,
21
- short: property._def.alias,
22
- required: true,
12
+ short: property['x-alias'],
13
+ required: schema.required?.includes(key) && property.default === undefined || false,
23
14
  type: 'string'
24
15
  };
25
- parseDef(property._def, options, option);
16
+ parseJSONSchema(property, options, option);
26
17
  options.push(option);
27
18
  }
28
19
  return;
29
20
  }
30
- function parseString(_def, _options, currentOption) {
21
+ function parseString(schema, _options, currentOption) {
31
22
  if (currentOption) {
32
23
  currentOption.type = 'string';
24
+ if (schema.enum) {
25
+ currentOption.autocomplete = schema.enum.map(e => String(e));
26
+ }
33
27
  }
34
28
  return;
35
29
  }
36
- function parseNumber(_def, _options, currentOption) {
30
+ function parseNumber(schema, _options, currentOption) {
37
31
  if (currentOption) {
38
32
  currentOption.type = 'number';
39
33
  }
40
34
  return;
41
35
  }
42
- function parseBoolean(_def, _options, currentOption) {
36
+ function parseBoolean(schema, _options, currentOption) {
43
37
  if (currentOption) {
44
38
  currentOption.type = 'boolean';
45
39
  }
46
40
  return;
47
41
  }
48
- function parseOptional(def, _options, currentOption) {
49
- if (currentOption) {
50
- currentOption.required = false;
51
- }
52
- return def.innerType._def;
53
- }
54
- function parseDefault(def, _options, currentOption) {
55
- if (currentOption) {
56
- currentOption.required = false;
57
- }
58
- return def.innerType._def;
59
- }
60
- function parseEnum(def, _options, currentOption) {
61
- if (currentOption) {
62
- currentOption.type = 'string';
63
- currentOption.autocomplete = [...def.values];
64
- }
65
- return;
66
- }
67
- function parseNativeEnum(def, _options, currentOption) {
68
- if (currentOption) {
69
- currentOption.type = 'string';
70
- currentOption.autocomplete = Object.values(def.values).map(v => String(v));
71
- }
72
- return;
73
- }
74
42
  function getParseFn(typeName) {
75
43
  switch (typeName) {
76
- case z.ZodFirstPartyTypeKind.ZodEffects:
77
- return parseEffect;
78
- case z.ZodFirstPartyTypeKind.ZodObject:
44
+ case 'object':
79
45
  return parseObject;
80
- case z.ZodFirstPartyTypeKind.ZodOptional:
81
- return parseOptional;
82
- case z.ZodFirstPartyTypeKind.ZodString:
46
+ case 'string':
83
47
  return parseString;
84
- case z.ZodFirstPartyTypeKind.ZodNumber:
48
+ case 'number':
49
+ case 'integer':
85
50
  return parseNumber;
86
- case z.ZodFirstPartyTypeKind.ZodBoolean:
51
+ case 'boolean':
87
52
  return parseBoolean;
88
- case z.ZodFirstPartyTypeKind.ZodEnum:
89
- return parseEnum;
90
- case z.ZodFirstPartyTypeKind.ZodNativeEnum:
91
- return parseNativeEnum;
92
- case z.ZodFirstPartyTypeKind.ZodDefault:
93
- return parseDefault;
94
- case z.ZodFirstPartyTypeKind.ZodIntersection:
95
- return parseIntersection;
96
53
  default:
97
54
  return;
98
55
  }
99
56
  }
100
- function parseDef(def, options, currentOption) {
101
- let parsedDef = def;
57
+ function parseJSONSchema(jsonSchema, options, currentOption) {
58
+ let parsedSchema = jsonSchema;
102
59
  do {
103
- const parse = getParseFn(parsedDef.typeName);
60
+ if (parsedSchema.allOf) {
61
+ parsedSchema.allOf.forEach(s => parseJSONSchema(s, options, currentOption));
62
+ }
63
+ const parse = getParseFn(parsedSchema.type);
104
64
  if (!parse) {
105
65
  break;
106
66
  }
107
- parsedDef = parse(parsedDef, options, currentOption);
108
- if (!parsedDef) {
67
+ parsedSchema = parse(parsedSchema, options, currentOption);
68
+ if (!parsedSchema) {
109
69
  break;
110
70
  }
111
- } while (parsedDef);
71
+ } while (parsedSchema);
112
72
  }
113
73
  function optionToString(optionInfo) {
114
74
  let s = '';
@@ -126,13 +86,18 @@ function optionToString(optionInfo) {
126
86
  }
127
87
  ;
128
88
  export const zod = {
129
- alias(alias, type) {
130
- type._def.alias = alias;
131
- return type;
132
- },
133
89
  schemaToOptionInfo(schema) {
90
+ const jsonSchema = z.toJSONSchema(schema, {
91
+ override: s => {
92
+ const alias = s.zodSchema.def.alias;
93
+ if (alias) {
94
+ s.jsonSchema['x-alias'] = alias;
95
+ }
96
+ },
97
+ unrepresentable: 'any'
98
+ });
134
99
  const options = [];
135
- parseDef(schema._def, options);
100
+ parseJSONSchema(jsonSchema, options);
136
101
  return options;
137
102
  },
138
103
  schemaToOptions(schema) {
@@ -153,6 +118,6 @@ export const zod = {
153
118
  }
154
119
  }
155
120
  return null;
156
- }, z.nativeEnum(e))
121
+ }, z.enum(e))
157
122
  };
158
123
  //# sourceMappingURL=zod.js.map
@@ -46,6 +46,25 @@ m365 entra appregistration permission add [options]
46
46
 
47
47
  Scopes/Roles to grant must be fully-qualified so that we can disambiguate them between the different resources.
48
48
 
49
+ ## Permissions
50
+
51
+ <Tabs>
52
+ <TabItem value="Delegated">
53
+
54
+ | Resource | Permissions |
55
+ |------------------|---------------------------|
56
+ | Microsoft Graph | Application.ReadWrite.All |
57
+
58
+ </TabItem>
59
+ <TabItem value="Application">
60
+
61
+ | Resource | Permissions |
62
+ |------------------|---------------------------|
63
+ | Microsoft Graph | Application.ReadWrite.All |
64
+
65
+ </TabItem>
66
+ </Tabs>
67
+
49
68
  ## Examples
50
69
 
51
70
  Grant multiple delegated API permissions to a Microsoft Entra app specified by client id.
@@ -34,6 +34,25 @@ m365 entra app permission list [options]
34
34
 
35
35
  For best performance use the `objectId` option to reference the Entra application registration to get. If you use `appId`, this command will first need to find the corresponding object ID for that application.
36
36
 
37
+ ## Permissions
38
+
39
+ <Tabs>
40
+ <TabItem value="Delegated">
41
+
42
+ | Resource | Permissions |
43
+ |------------------|----------------------|
44
+ | Microsoft Graph | Application.Read.All |
45
+
46
+ </TabItem>
47
+ <TabItem value="Application">
48
+
49
+ | Resource | Permissions |
50
+ |------------------|----------------------|
51
+ | Microsoft Graph | Application.Read.All |
52
+
53
+ </TabItem>
54
+ </Tabs>
55
+
37
56
  ## Examples
38
57
 
39
58
  Retrieves all permissions for an Entra application registration specified by client id.
@@ -1,4 +1,6 @@
1
1
  import Global from '/docs/cmd/_global.mdx';
2
+ import Tabs from '@theme/Tabs';
3
+ import TabItem from '@theme/TabItem';
2
4
 
3
5
  # entra app permission remove
4
6
 
@@ -41,6 +43,25 @@ m365 entra app permission remove [options]
41
43
 
42
44
  Removing permissions on App Registrations does not immediately remove consent given by an administrator. Explicitly instruct the CLI to revoke consent by using the `--revokeAdminConsent` flag.
43
45
 
46
+ ## Permissions
47
+
48
+ <Tabs>
49
+ <TabItem value="Delegated">
50
+
51
+ | Resource | Permissions |
52
+ |------------------|---------------------------|
53
+ | Microsoft Graph | Application.ReadWrite.All |
54
+
55
+ </TabItem>
56
+ <TabItem value="Application">
57
+
58
+ | Resource | Permissions |
59
+ |------------------|---------------------------|
60
+ | Microsoft Graph | Application.ReadWrite.All |
61
+
62
+ </TabItem>
63
+ </Tabs>
64
+
44
65
  ## Examples
45
66
 
46
67
  Remove multiple delegated API permissions from an Entra app registration
@@ -0,0 +1,118 @@
1
+ import Global from '/docs/cmd/_global.mdx';
2
+ import Tabs from '@theme/Tabs';
3
+ import TabItem from '@theme/TabItem';
4
+
5
+ # spo list defaultvalue get
6
+
7
+ Gets a specific default column value from a specific document library
8
+
9
+ ## Usage
10
+
11
+ ```sh
12
+ m365 spo list defaultvalue get [options]
13
+ ```
14
+
15
+ ## Options
16
+
17
+ ```md definition-list
18
+ `-u, --webUrl <webUrl>`
19
+ : URL of the site where the list is located.
20
+
21
+ `-i, --listId [listId]`
22
+ : ID of the list. Specify either `listTitle`, `listId`, or `listUrl`.
23
+
24
+ `-t, --listTitle [listTitle]`
25
+ : Title of the list. Specify either `listTitle`, `listId`, or `listUrl`.
26
+
27
+ `--listUrl [listUrl]`
28
+ : Server- or site-relative URL of the list. Specify either `listTitle`, `listId`, or `listUrl`.
29
+
30
+ `--fieldName <fieldName>`
31
+ : Internal name of the field.
32
+
33
+ `--folderUrl [folderUrl]`
34
+ : Get a specific field of a specific folder by specifying a server- or site-relative URL.
35
+ ```
36
+
37
+ <Global />
38
+
39
+ ## Permissions
40
+
41
+ <Tabs>
42
+ <TabItem value="Delegated">
43
+
44
+ | Resource | Permissions |
45
+ |------------|---------------|
46
+ | SharePoint | AllSites.Read |
47
+
48
+ </TabItem>
49
+ <TabItem value="Application">
50
+
51
+ | Resource | Permissions |
52
+ |------------|----------------|
53
+ | SharePoint | Sites.Read.All |
54
+
55
+ </TabItem>
56
+ </Tabs>
57
+
58
+ ## Examples
59
+
60
+ Get default column value from the root folder of the list
61
+
62
+ ```sh
63
+ m365 spo list defaultvalue get --webUrl https://contoso.sharepoint.com/sites/Marketing --listTitle Logos --fieldName Company
64
+ ```
65
+
66
+ Get default column value from a specific folder of the list
67
+
68
+ ```sh
69
+ m365 spo list defaultvalue get --webUrl https://contoso.sharepoint.com/sites/Marketing --listTitle Logos --fieldName Company --folderUrl "/sites/Marketing/Logos/Contoso"
70
+ ```
71
+
72
+ ## Response
73
+
74
+ <Tabs>
75
+ <TabItem value="JSON">
76
+
77
+ ```json
78
+ {
79
+ "fieldName": "Company",
80
+ "fieldValue": "Contoso",
81
+ "folderUrl": "sites/Marketing/Logos"
82
+ }
83
+ ```
84
+
85
+ </TabItem>
86
+ <TabItem value="Text">
87
+
88
+ ```text
89
+ fieldName : Company
90
+ fieldValue: Contoso
91
+ folderUrl : sites/Marketing/Logos
92
+ ```
93
+
94
+ </TabItem>
95
+ <TabItem value="CSV">
96
+
97
+ ```csv
98
+ fieldName,fieldValue,folderUrl
99
+ Company,Contoso,sites/Marketing/Logos
100
+ ```
101
+
102
+ </TabItem>
103
+ <TabItem value="Markdown">
104
+
105
+ ```md
106
+ # spo list defaultvalue get --webUrl "https://contoso.sharepoint.com/sites/Marketing" --listTitle "Logos" --fieldName "Company"
107
+
108
+ Date: 2/20/2023
109
+
110
+ Property | Value
111
+ ---------|-------
112
+ fieldName | Company
113
+ fieldValue | Contoso
114
+ folderUrl | sites/Marketing/Logos
115
+ ```
116
+
117
+ </TabItem>
118
+ </Tabs>