@pnp/cli-microsoft365 12.0.0-beta.e4f7675 → 12.0.0-beta.feb621e

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 (188) hide show
  1. package/.devproxy/generate-openapi-spec.json +1 -1
  2. package/allCommands.json +1 -1
  3. package/allCommandsFull.json +1 -1
  4. package/dist/Auth.js +2 -6
  5. package/dist/auth/FileTokenStorage.js +0 -3
  6. package/dist/auth/msalCachePlugin.js +201 -12
  7. package/dist/googleAnalytics.js +96 -0
  8. package/dist/m365/commands/logout.js +2 -4
  9. package/dist/m365/entra/commands/m365group/m365group-remove.js +4 -3
  10. package/dist/m365/spe/commands/container/container-remove.js +6 -7
  11. package/dist/m365/spfx/commands/SpfxCompatibilityMatrix.js +15 -0
  12. package/dist/m365/spfx/commands/project/project-doctor/doctor-1.24.0-rc.0.js +19 -0
  13. package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
  14. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN012021_TSC_excludeDirectories.js +43 -0
  15. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN027002_OVERRIDES_qs.js +33 -0
  16. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN027003_OVERRIDES_uuid.js +33 -0
  17. package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.24.0-rc.0.js +77 -0
  18. package/dist/m365/spfx/commands/project/project-upgrade.js +12 -11
  19. package/dist/m365/spo/commands/app/app-add.js +35 -56
  20. package/dist/m365/spo/commands/app/app-deploy.js +41 -59
  21. package/dist/m365/spo/commands/app/app-get.js +40 -56
  22. package/dist/m365/spo/commands/app/app-install.js +20 -41
  23. package/dist/m365/spo/commands/app/app-instance-list.js +12 -24
  24. package/dist/m365/spo/commands/app/app-list.js +26 -44
  25. package/dist/m365/spo/commands/app/app-remove.js +32 -52
  26. package/dist/m365/spo/commands/app/app-retract.js +32 -51
  27. package/dist/m365/spo/commands/app/app-teamspackage-download.js +35 -54
  28. package/dist/m365/spo/commands/app/app-uninstall.js +21 -44
  29. package/dist/m365/spo/commands/app/app-upgrade.js +20 -41
  30. package/dist/m365/spo/commands/feature/feature-disable.js +20 -50
  31. package/dist/m365/spo/commands/feature/feature-enable.js +22 -50
  32. package/dist/m365/spo/commands/feature/feature-list.js +11 -36
  33. package/dist/m365/spo/commands/field/field-add.js +33 -62
  34. package/dist/m365/spo/commands/field/field-get.js +30 -57
  35. package/dist/m365/spo/commands/field/field-list.js +21 -46
  36. package/dist/m365/spo/commands/field/field-remove.js +32 -63
  37. package/dist/m365/spo/commands/field/field-set.js +34 -66
  38. package/dist/m365/spo/commands/file/file-archive.js +1 -1
  39. package/dist/m365/spo/commands/file/file-get.js +4 -3
  40. package/dist/m365/spo/commands/file/file-remove.js +5 -5
  41. package/dist/m365/spo/commands/file/file-unarchive.js +1 -1
  42. package/dist/m365/spo/commands/folder/folder-archive.js +1 -1
  43. package/dist/m365/spo/commands/folder/folder-remove.js +5 -5
  44. package/dist/m365/spo/commands/folder/folder-unarchive.js +90 -0
  45. package/dist/m365/spo/commands/hidedefaultthemes/hidedefaultthemes-get.js +5 -0
  46. package/dist/m365/spo/commands/hidedefaultthemes/hidedefaultthemes-set.js +8 -26
  47. package/dist/m365/spo/commands/homesite/homesite-list.js +5 -0
  48. package/dist/m365/spo/commands/hubsite/hubsite-connect.js +38 -63
  49. package/dist/m365/spo/commands/hubsite/hubsite-data-get.js +11 -27
  50. package/dist/m365/spo/commands/hubsite/hubsite-disconnect.js +25 -47
  51. package/dist/m365/spo/commands/hubsite/hubsite-get.js +25 -37
  52. package/dist/m365/spo/commands/hubsite/hubsite-list.js +12 -24
  53. package/dist/m365/spo/commands/hubsite/hubsite-register.js +10 -18
  54. package/dist/m365/spo/commands/hubsite/hubsite-rights-grant.js +14 -32
  55. package/dist/m365/spo/commands/hubsite/hubsite-rights-revoke.js +12 -29
  56. package/dist/m365/spo/commands/hubsite/hubsite-set.js +19 -46
  57. package/dist/m365/spo/commands/hubsite/hubsite-unregister.js +11 -27
  58. package/dist/m365/spo/commands/list/list-remove.js +4 -4
  59. package/dist/m365/spo/commands/listitem/listitem-batch-remove.js +5 -4
  60. package/dist/m365/spo/commands/listitem/listitem-get.js +1 -12
  61. package/dist/m365/spo/commands/listitem/listitem-remove.js +8 -5
  62. package/dist/m365/spo/commands/navigation/navigation-node-list.js +6 -4
  63. package/dist/m365/spo/commands/page/page-remove.js +7 -7
  64. package/dist/m365/spo/commands/site/site-remove.js +7 -7
  65. package/dist/m365/spo/commands/spo-get.js +5 -0
  66. package/dist/m365/spo/commands/spo-set.js +10 -21
  67. package/dist/m365/spo/commands/tenant/tenant-appcatalog-add.js +1 -1
  68. package/dist/m365/spo/commands/user/user-ensure.js +24 -60
  69. package/dist/m365/spo/commands/user/user-get.js +25 -65
  70. package/dist/m365/spo/commands/user/user-list.js +10 -18
  71. package/dist/m365/spo/commands/user/user-remove.js +26 -68
  72. package/dist/m365/spo/commands/userprofile/userprofile-get.js +10 -23
  73. package/dist/m365/spo/commands/userprofile/userprofile-set.js +10 -19
  74. package/dist/m365/spo/commands/web/web-add.js +20 -55
  75. package/dist/m365/spo/commands/web/web-clientsidewebpart-list.js +10 -18
  76. package/dist/m365/spo/commands/web/web-get.js +12 -30
  77. package/dist/m365/spo/commands/web/web-installedlanguage-list.js +10 -18
  78. package/dist/m365/spo/commands/web/web-list.js +10 -18
  79. package/dist/m365/spo/commands/web/web-reindex.js +10 -18
  80. package/dist/m365/spo/commands/web/web-remove.js +11 -27
  81. package/dist/m365/spo/commands/web/web-retentionlabel-list.js +10 -18
  82. package/dist/m365/spo/commands/web/web-roleassignment-add.js +40 -64
  83. package/dist/m365/spo/commands/web/web-roleassignment-remove.js +31 -58
  84. package/dist/m365/spo/commands/web/web-roleinheritance-break.js +12 -36
  85. package/dist/m365/spo/commands/web/web-roleinheritance-reset.js +11 -29
  86. package/dist/m365/spo/commands/web/web-rule-get.js +47 -0
  87. package/dist/m365/spo/commands/web/web-rule-list.js +6 -4
  88. package/dist/m365/spo/commands/web/web-rule-remove.js +0 -3
  89. package/dist/m365/spo/commands/web/web-set.js +26 -96
  90. package/dist/m365/spo/commands.js +3 -3
  91. package/dist/m365/teams/commands/channel/channel-add.js +46 -57
  92. package/dist/m365/teams/commands/channel/channel-get.js +41 -48
  93. package/dist/m365/teams/commands/channel/channel-list.js +28 -42
  94. package/dist/m365/teams/commands/channel/channel-member-add.js +53 -54
  95. package/dist/m365/teams/commands/channel/channel-member-list.js +47 -55
  96. package/dist/m365/teams/commands/channel/channel-member-remove.js +62 -62
  97. package/dist/m365/teams/commands/channel/channel-member-set.js +61 -65
  98. package/dist/m365/teams/commands/channel/channel-remove.js +47 -49
  99. package/dist/m365/teams/commands/channel/channel-set.js +47 -54
  100. package/dist/m365/teams/commands/chat/chat-get.js +30 -45
  101. package/dist/m365/teams/commands/chat/chat-list.js +22 -42
  102. package/dist/m365/teams/commands/chat/chat-member-add.js +43 -64
  103. package/dist/m365/teams/commands/chat/chat-member-list.js +10 -23
  104. package/dist/m365/teams/commands/chat/chat-member-remove.js +28 -50
  105. package/dist/m365/teams/commands/chat/chat-message-send.js +32 -55
  106. package/dist/m365/util/commands/accesstoken/accesstoken-get.js +10 -28
  107. package/dist/telemetry.js +7 -11
  108. package/dist/utils/spo.js +1 -3
  109. package/dist/utils/urlUtil.js +2 -2
  110. package/docs/docs/cmd/entra/m365group/m365group-remove.mdx +4 -4
  111. package/docs/docs/cmd/spe/container/container-remove.mdx +5 -5
  112. package/docs/docs/cmd/spo/file/file-archive.mdx +9 -1
  113. package/docs/docs/cmd/spo/file/file-checkin.mdx +2 -2
  114. package/docs/docs/cmd/spo/file/file-checkout-undo.mdx +1 -1
  115. package/docs/docs/cmd/spo/file/file-checkout.mdx +2 -2
  116. package/docs/docs/cmd/spo/file/file-copy.mdx +2 -2
  117. package/docs/docs/cmd/spo/file/file-get.mdx +6 -6
  118. package/docs/docs/cmd/spo/file/file-remove.mdx +4 -4
  119. package/docs/docs/cmd/spo/file/file-retentionlabel-ensure.mdx +1 -1
  120. package/docs/docs/cmd/spo/file/file-retentionlabel-remove.mdx +1 -1
  121. package/docs/docs/cmd/spo/file/file-roleassignment-add.mdx +1 -1
  122. package/docs/docs/cmd/spo/file/file-roleassignment-remove.mdx +1 -1
  123. package/docs/docs/cmd/spo/file/file-roleinheritance-break.mdx +3 -3
  124. package/docs/docs/cmd/spo/file/file-roleinheritance-reset.mdx +2 -2
  125. package/docs/docs/cmd/spo/file/file-sharinginfo-get.mdx +2 -2
  126. package/docs/docs/cmd/spo/file/file-sharinglink-add.mdx +22 -1
  127. package/docs/docs/cmd/spo/file/file-sharinglink-clear.mdx +24 -1
  128. package/docs/docs/cmd/spo/file/file-sharinglink-get.mdx +22 -1
  129. package/docs/docs/cmd/spo/file/file-sharinglink-list.mdx +22 -1
  130. package/docs/docs/cmd/spo/file/file-sharinglink-remove.mdx +24 -1
  131. package/docs/docs/cmd/spo/file/file-sharinglink-set.mdx +22 -1
  132. package/docs/docs/cmd/spo/file/file-unarchive.mdx +9 -1
  133. package/docs/docs/cmd/spo/file/file-version-clear.mdx +1 -1
  134. package/docs/docs/cmd/spo/file/file-version-get.mdx +1 -1
  135. package/docs/docs/cmd/spo/file/file-version-keep.mdx +1 -1
  136. package/docs/docs/cmd/spo/file/file-version-list.mdx +1 -1
  137. package/docs/docs/cmd/spo/file/file-version-remove.mdx +1 -1
  138. package/docs/docs/cmd/spo/file/file-version-restore.mdx +1 -1
  139. package/docs/docs/cmd/spo/folder/folder-archive.mdx +7 -1
  140. package/docs/docs/cmd/spo/folder/folder-copy.mdx +1 -1
  141. package/docs/docs/cmd/spo/folder/folder-get.mdx +2 -2
  142. package/docs/docs/cmd/spo/folder/folder-remove.mdx +4 -4
  143. package/docs/docs/cmd/spo/folder/folder-retentionlabel-ensure.mdx +1 -1
  144. package/docs/docs/cmd/spo/folder/folder-retentionlabel-remove.mdx +1 -1
  145. package/docs/docs/cmd/spo/folder/folder-sharinglink-add.mdx +22 -1
  146. package/docs/docs/cmd/spo/folder/folder-sharinglink-clear.mdx +23 -0
  147. package/docs/docs/cmd/spo/folder/folder-sharinglink-get.mdx +21 -0
  148. package/docs/docs/cmd/spo/folder/folder-sharinglink-list.mdx +22 -1
  149. package/docs/docs/cmd/spo/folder/folder-sharinglink-remove.mdx +24 -1
  150. package/docs/docs/cmd/spo/folder/folder-sharinglink-set.mdx +21 -0
  151. package/docs/docs/cmd/spo/folder/folder-unarchive.mdx +76 -0
  152. package/docs/docs/cmd/spo/list/list-remove.mdx +4 -4
  153. package/docs/docs/cmd/spo/listitem/listitem-batch-remove.mdx +8 -2
  154. package/docs/docs/cmd/spo/listitem/listitem-get.mdx +0 -6
  155. package/docs/docs/cmd/spo/listitem/listitem-remove.mdx +8 -2
  156. package/docs/docs/cmd/spo/navigation/navigation-node-list.mdx +37 -27
  157. package/docs/docs/cmd/spo/page/page-remove.mdx +4 -4
  158. package/docs/docs/cmd/spo/site/site-apppermission-add.mdx +52 -21
  159. package/docs/docs/cmd/spo/site/site-remove.mdx +3 -3
  160. package/docs/docs/cmd/spo/web/web-rule-get.mdx +108 -0
  161. package/docs/docs/cmd/spo/web/web-rule-list.mdx +8 -12
  162. package/docs/docs/cmd/spo/web/web-rule-remove.mdx +0 -6
  163. package/docs/docs/cmd/spp/model/model-get.mdx +1 -1
  164. package/docs/docs/cmd/spp/model/model-remove.mdx +1 -1
  165. package/docs/docs/cmd/teams/app/app-install.mdx +21 -0
  166. package/docs/docs/cmd/teams/app/app-list.mdx +19 -0
  167. package/docs/docs/cmd/teams/app/app-publish.mdx +17 -0
  168. package/docs/docs/cmd/teams/app/app-remove.mdx +19 -0
  169. package/docs/docs/cmd/teams/app/app-uninstall.mdx +21 -0
  170. package/docs/docs/cmd/teams/app/app-update.mdx +19 -0
  171. package/docs/docs/cmd/tenant/people/people-profilecardproperty-add.mdx +19 -0
  172. package/docs/docs/cmd/tenant/people/people-profilecardproperty-get.mdx +19 -0
  173. package/docs/docs/cmd/tenant/people/people-profilecardproperty-list.mdx +19 -0
  174. package/docs/docs/cmd/tenant/people/people-profilecardproperty-remove.mdx +19 -0
  175. package/docs/docs/cmd/tenant/people/people-profilecardproperty-set.mdx +19 -0
  176. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-get.mdx +19 -0
  177. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-list.mdx +19 -0
  178. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-healthissue-get.mdx +19 -0
  179. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-healthissue-list.mdx +19 -0
  180. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-message-get.mdx +19 -0
  181. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-message-list.mdx +19 -0
  182. package/docs/docs/cmd/viva/engage/engage-message-add.mdx +17 -0
  183. package/docs/docs/cmd/viva/engage/engage-message-get.mdx +17 -0
  184. package/docs/docs/cmd/viva/engage/engage-message-list.mdx +17 -0
  185. package/docs/docs/cmd/viva/engage/engage-message-remove.mdx +19 -0
  186. package/npm-shrinkwrap.json +1120 -3216
  187. package/package.json +24 -38
  188. package/dist/appInsights.js +0 -43
@@ -29,9 +29,6 @@ class SpoWebRuleListCommand extends SpoCommand {
29
29
  get description() {
30
30
  return 'Lists all SharePoint list alerts';
31
31
  }
32
- alias() {
33
- return [commands.WEB_ALERT_LIST];
34
- }
35
32
  defaultProperties() {
36
33
  return ['ID', 'Title', 'UserPrincipalName'];
37
34
  }
@@ -75,7 +72,12 @@ class SpoWebRuleListCommand extends SpoCommand {
75
72
  listId = args.options.listId;
76
73
  }
77
74
  else if (args.options.listUrl || args.options.listTitle) {
78
- listId = await spo.getListId(args.options.webUrl, args.options.listTitle, args.options.listUrl, logger, this.verbose);
75
+ try {
76
+ listId = await spo.getListId(args.options.webUrl, args.options.listTitle, args.options.listUrl, logger, this.verbose);
77
+ }
78
+ catch (err) {
79
+ this.handleRejectedODataJsonPromise(err);
80
+ }
79
81
  }
80
82
  if (listId) {
81
83
  filters.push(`List/Id eq guid'${formatting.encodeQueryParameter(listId)}'`);
@@ -22,9 +22,6 @@ class SpoWebRuleRemoveCommand extends SpoCommand {
22
22
  get description() {
23
23
  return 'Removes an alert from a SharePoint list';
24
24
  }
25
- alias() {
26
- return [commands.WEB_ALERT_REMOVE];
27
- }
28
25
  get schema() {
29
26
  return options;
30
27
  }
@@ -1,13 +1,28 @@
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 _SpoWebSetCommand_instances, _a, _SpoWebSetCommand_initTelemetry, _SpoWebSetCommand_initOptions, _SpoWebSetCommand_initTypes, _SpoWebSetCommand_initValidators;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import request from '../../../../request.js';
8
4
  import { validation } from '../../../../utils/validation.js';
9
5
  import SpoCommand from '../../../base/SpoCommand.js';
10
6
  import commands from '../../commands.js';
7
+ export const options = z.looseObject({
8
+ ...globalOptionsZod.shape,
9
+ description: z.string().optional().alias('d'),
10
+ headerEmphasis: z.enum(['0', '1', '2', '3'], {
11
+ error: e => `${e.input} is not a valid value for headerEmphasis. Allowed values are 0|1|2|3`
12
+ }).optional(),
13
+ headerLayout: z.enum(['standard', 'compact']).optional(),
14
+ megaMenuEnabled: z.boolean().optional(),
15
+ quickLaunchEnabled: z.boolean().optional(),
16
+ siteLogoUrl: z.string().optional(),
17
+ title: z.string().optional().alias('t'),
18
+ url: z.string().refine(url => validation.isValidSharePointUrl(url) === true, {
19
+ error: e => `${e.input} is not a valid SharePoint Online site URL.`
20
+ }).alias('u'),
21
+ footerEnabled: z.boolean().optional(),
22
+ navAudienceTargetingEnabled: z.boolean().optional(),
23
+ searchScope: z.preprocess(value => String(value).toLowerCase(), z.enum(['defaultscope', 'tenant', 'hub', 'site'])).optional(),
24
+ welcomePage: z.string().optional()
25
+ });
11
26
  class SpoWebSetCommand extends SpoCommand {
12
27
  get name() {
13
28
  return commands.WEB_SET;
@@ -15,17 +30,12 @@ class SpoWebSetCommand extends SpoCommand {
15
30
  get description() {
16
31
  return 'Updates subsite properties';
17
32
  }
18
- constructor() {
19
- super();
20
- _SpoWebSetCommand_instances.add(this);
21
- __classPrivateFieldGet(this, _SpoWebSetCommand_instances, "m", _SpoWebSetCommand_initTelemetry).call(this);
22
- __classPrivateFieldGet(this, _SpoWebSetCommand_instances, "m", _SpoWebSetCommand_initOptions).call(this);
23
- __classPrivateFieldGet(this, _SpoWebSetCommand_instances, "m", _SpoWebSetCommand_initTypes).call(this);
24
- __classPrivateFieldGet(this, _SpoWebSetCommand_instances, "m", _SpoWebSetCommand_initValidators).call(this);
33
+ get schema() {
34
+ return options;
25
35
  }
26
36
  async commandAction(logger, args) {
27
37
  const payload = {};
28
- this.addUnknownOptionsToPayload(payload, args.options);
38
+ this.addUnknownOptionsToPayloadZod(payload, args.options);
29
39
  if (args.options.title) {
30
40
  payload.Title = args.options.title;
31
41
  }
@@ -39,7 +49,7 @@ class SpoWebSetCommand extends SpoCommand {
39
49
  payload.QuickLaunchEnabled = args.options.quickLaunchEnabled;
40
50
  }
41
51
  if (typeof args.options.headerEmphasis !== 'undefined') {
42
- payload.HeaderEmphasis = args.options.headerEmphasis;
52
+ payload.HeaderEmphasis = Number(args.options.headerEmphasis);
43
53
  }
44
54
  if (typeof args.options.headerLayout !== 'undefined') {
45
55
  payload.HeaderLayout = args.options.headerLayout === 'standard' ? 1 : 2;
@@ -55,7 +65,7 @@ class SpoWebSetCommand extends SpoCommand {
55
65
  }
56
66
  if (typeof args.options.searchScope !== 'undefined') {
57
67
  const searchScope = args.options.searchScope.toLowerCase();
58
- payload.SearchScope = _a.searchScopeOptions.indexOf(searchScope);
68
+ payload.SearchScope = SpoWebSetCommand.searchScopeOptions.indexOf(searchScope);
59
69
  }
60
70
  try {
61
71
  const requestOptions = {
@@ -97,86 +107,6 @@ class SpoWebSetCommand extends SpoCommand {
97
107
  return true;
98
108
  }
99
109
  }
100
- _a = SpoWebSetCommand, _SpoWebSetCommand_instances = new WeakSet(), _SpoWebSetCommand_initTelemetry = function _SpoWebSetCommand_initTelemetry() {
101
- this.telemetry.push((args) => {
102
- Object.assign(this.telemetryProperties, {
103
- description: typeof args.options.description !== 'undefined',
104
- headerEmphasis: typeof args.options.headerEmphasis !== 'undefined',
105
- headerLayout: typeof args.options.headerLayout !== 'undefined',
106
- megaMenuEnabled: typeof args.options.megaMenuEnabled !== 'undefined',
107
- siteLogoUrl: typeof args.options.siteLogoUrl !== 'undefined',
108
- title: typeof args.options.title !== 'undefined',
109
- quickLaunchEnabled: typeof args.options.quickLaunchEnabled !== 'undefined',
110
- footerEnabled: typeof args.options.footerEnabled !== 'undefined',
111
- navAudienceTargetingEnabled: typeof args.options.navAudienceTargetingEnabled !== 'undefined',
112
- searchScope: typeof args.options.searchScope !== 'undefined',
113
- welcomePage: typeof args.options.welcomePage !== 'undefined'
114
- });
115
- this.trackUnknownOptions(this.telemetryProperties, args.options);
116
- });
117
- }, _SpoWebSetCommand_initOptions = function _SpoWebSetCommand_initOptions() {
118
- this.options.unshift({
119
- option: '-u, --url <url>'
120
- }, {
121
- option: '-t, --title [title]'
122
- }, {
123
- option: '-d, --description [description]'
124
- }, {
125
- option: '--siteLogoUrl [siteLogoUrl]'
126
- }, {
127
- option: '--quickLaunchEnabled [quickLaunchEnabled]',
128
- autocomplete: ['true', 'false']
129
- }, {
130
- option: '--headerLayout [headerLayout]',
131
- autocomplete: ['standard', 'compact']
132
- }, {
133
- option: '--headerEmphasis [headerEmphasis]',
134
- autocomplete: ['0', '1', '2', '3']
135
- }, {
136
- option: '--megaMenuEnabled [megaMenuEnabled]',
137
- autocomplete: ['true', 'false']
138
- }, {
139
- option: '--footerEnabled [footerEnabled]',
140
- autocomplete: ['true', 'false']
141
- }, {
142
- option: '--navAudienceTargetingEnabled [navAudienceTargetingEnabled]',
143
- autocomplete: ['true', 'false']
144
- }, {
145
- option: '--searchScope [searchScope]',
146
- autocomplete: _a.searchScopeOptions
147
- }, {
148
- option: '--welcomePage [welcomePage]'
149
- });
150
- }, _SpoWebSetCommand_initTypes = function _SpoWebSetCommand_initTypes() {
151
- this.types.boolean.push('megaMenuEnabled', 'footerEnabled', 'quickLaunchEnabled', 'navAudienceTargetingEnabled');
152
- }, _SpoWebSetCommand_initValidators = function _SpoWebSetCommand_initValidators() {
153
- this.validators.push(async (args) => {
154
- const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.url);
155
- if (isValidSharePointUrl !== true) {
156
- return isValidSharePointUrl;
157
- }
158
- if (typeof args.options.headerEmphasis !== 'undefined') {
159
- if (isNaN(args.options.headerEmphasis)) {
160
- return `${args.options.headerEmphasis} is not a number`;
161
- }
162
- if ([0, 1, 2, 3].indexOf(args.options.headerEmphasis) < 0) {
163
- return `${args.options.headerEmphasis} is not a valid value for headerEmphasis. Allowed values are 0|1|2|3`;
164
- }
165
- }
166
- if (typeof args.options.headerLayout !== 'undefined') {
167
- if (['standard', 'compact'].indexOf(args.options.headerLayout) < 0) {
168
- return `${args.options.headerLayout} is not a valid value for headerLayout. Allowed values are standard|compact`;
169
- }
170
- }
171
- if (typeof args.options.searchScope !== 'undefined') {
172
- const searchScope = args.options.searchScope.toString().toLowerCase();
173
- if (_a.searchScopeOptions.indexOf(searchScope) < 0) {
174
- return `${args.options.searchScope} is not a valid value for searchScope. Allowed values are DefaultScope|Tenant|Hub|Site`;
175
- }
176
- }
177
- return true;
178
- });
179
- };
180
110
  SpoWebSetCommand.searchScopeOptions = ['defaultscope', 'tenant', 'hub', 'site'];
181
111
  export default new SpoWebSetCommand();
182
112
  //# sourceMappingURL=web-set.js.map
@@ -72,6 +72,7 @@ export default {
72
72
  FILE_MOVE: `${prefix} file move`,
73
73
  FILE_REMOVE: `${prefix} file remove`,
74
74
  FILE_RENAME: `${prefix} file rename`,
75
+ FILE_UNARCHIVE: `${prefix} file unarchive`,
75
76
  FILE_RETENTIONLABEL_ENSURE: `${prefix} file retentionlabel ensure`,
76
77
  FILE_RETENTIONLABEL_REMOVE: `${prefix} file retentionlabel remove`,
77
78
  FILE_ROLEASSIGNMENT_ADD: `${prefix} file roleassignment add`,
@@ -85,7 +86,6 @@ export default {
85
86
  FILE_SHARINGLINK_LIST: `${prefix} file sharinglink list`,
86
87
  FILE_SHARINGLINK_REMOVE: `${prefix} file sharinglink remove`,
87
88
  FILE_SHARINGLINK_SET: `${prefix} file sharinglink set`,
88
- FILE_UNARCHIVE: `${prefix} file unarchive`,
89
89
  FILE_VERSION_CLEAR: `${prefix} file version clear`,
90
90
  FILE_VERSION_GET: `${prefix} file version get`,
91
91
  FILE_VERSION_KEEP: `${prefix} file version keep`,
@@ -112,6 +112,7 @@ export default {
112
112
  FOLDER_SHARINGLINK_LIST: `${prefix} folder sharinglink list`,
113
113
  FOLDER_SHARINGLINK_REMOVE: `${prefix} folder sharinglink remove`,
114
114
  FOLDER_SHARINGLINK_SET: `${prefix} folder sharinglink set`,
115
+ FOLDER_UNARCHIVE: `${prefix} folder unarchive`,
115
116
  GET: `${prefix} get`,
116
117
  GROUP_ADD: `${prefix} group add`,
117
118
  GROUP_GET: `${prefix} group get`,
@@ -366,8 +367,6 @@ export default {
366
367
  USERPROFILE_GET: `${prefix} userprofile get`,
367
368
  USERPROFILE_SET: `${prefix} userprofile set`,
368
369
  WEB_ADD: `${prefix} web add`,
369
- WEB_ALERT_LIST: `${prefix} web alert list`,
370
- WEB_ALERT_REMOVE: `${prefix} web alert remove`,
371
370
  WEB_CLIENTSIDEWEBPART_LIST: `${prefix} web clientsidewebpart list`,
372
371
  WEB_GET: `${prefix} web get`,
373
372
  WEB_INSTALLEDLANGUAGE_LIST: `${prefix} web installedlanguage list`,
@@ -379,6 +378,7 @@ export default {
379
378
  WEB_ROLEASSIGNMENT_ADD: `${prefix} web roleassignment add`,
380
379
  WEB_ROLEINHERITANCE_BREAK: `${prefix} web roleinheritance break`,
381
380
  WEB_ROLEINHERITANCE_RESET: `${prefix} web roleinheritance reset`,
381
+ WEB_RULE_GET: `${prefix} web rule get`,
382
382
  WEB_RULE_LIST: `${prefix} web rule list`,
383
383
  WEB_RULE_REMOVE: `${prefix} web rule remove`,
384
384
  WEB_SET: `${prefix} web set`
@@ -1,14 +1,30 @@
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 _TeamsChannelAddCommand_instances, _TeamsChannelAddCommand_initTelemetry, _TeamsChannelAddCommand_initOptions, _TeamsChannelAddCommand_initValidators, _TeamsChannelAddCommand_initOptionSets;
7
1
  import request from '../../../../request.js';
8
2
  import { validation } from '../../../../utils/validation.js';
9
3
  import GraphCommand from "../../../base/GraphCommand.js";
10
4
  import commands from '../../commands.js';
11
5
  import { teams } from '../../../../utils/teams.js';
6
+ import { globalOptionsZod } from '../../../../Command.js';
7
+ import { z } from 'zod';
8
+ export const options = z.strictObject({
9
+ ...globalOptionsZod.shape,
10
+ teamId: z.string()
11
+ .refine(val => validation.isValidGuid(val), {
12
+ message: 'The value must be a valid GUID.'
13
+ })
14
+ .optional()
15
+ .alias('i'),
16
+ teamName: z.string()
17
+ .optional(),
18
+ name: z.string()
19
+ .alias('n'),
20
+ description: z.string()
21
+ .optional()
22
+ .alias('d'),
23
+ type: z.enum(['standard', 'private', 'shared'])
24
+ .optional(),
25
+ owner: z.string()
26
+ .optional()
27
+ });
12
28
  class TeamsChannelAddCommand extends GraphCommand {
13
29
  get name() {
14
30
  return commands.CHANNEL_ADD;
@@ -16,13 +32,30 @@ class TeamsChannelAddCommand extends GraphCommand {
16
32
  get description() {
17
33
  return 'Adds a channel to the specified Microsoft Teams team';
18
34
  }
19
- constructor() {
20
- super();
21
- _TeamsChannelAddCommand_instances.add(this);
22
- __classPrivateFieldGet(this, _TeamsChannelAddCommand_instances, "m", _TeamsChannelAddCommand_initTelemetry).call(this);
23
- __classPrivateFieldGet(this, _TeamsChannelAddCommand_instances, "m", _TeamsChannelAddCommand_initOptions).call(this);
24
- __classPrivateFieldGet(this, _TeamsChannelAddCommand_instances, "m", _TeamsChannelAddCommand_initValidators).call(this);
25
- __classPrivateFieldGet(this, _TeamsChannelAddCommand_instances, "m", _TeamsChannelAddCommand_initOptionSets).call(this);
35
+ get schema() {
36
+ return options;
37
+ }
38
+ getRefinedSchema(schema) {
39
+ return schema
40
+ .refine(opts => [opts.teamId, opts.teamName].filter(x => x !== undefined).length === 1, {
41
+ message: 'Specify either teamId or teamName, but not both.',
42
+ params: {
43
+ customCode: 'optionSet',
44
+ options: ['teamId', 'teamName']
45
+ }
46
+ })
47
+ .refine(opts => !((opts.type === 'private' || opts.type === 'shared') && !opts.owner), {
48
+ message: 'Specify owner when creating a private or shared channel.',
49
+ params: {
50
+ customCode: 'required'
51
+ }
52
+ })
53
+ .refine(opts => !((opts.type !== 'private' && opts.type !== 'shared') && opts.owner), {
54
+ message: 'Specify owner only when creating a private or shared channel.',
55
+ params: {
56
+ customCode: 'required'
57
+ }
58
+ });
26
59
  }
27
60
  async commandAction(logger, args) {
28
61
  try {
@@ -66,49 +99,5 @@ class TeamsChannelAddCommand extends GraphCommand {
66
99
  return request.post(requestOptions);
67
100
  }
68
101
  }
69
- _TeamsChannelAddCommand_instances = new WeakSet(), _TeamsChannelAddCommand_initTelemetry = function _TeamsChannelAddCommand_initTelemetry() {
70
- this.telemetry.push((args) => {
71
- Object.assign(this.telemetryProperties, {
72
- description: typeof args.options.description !== 'undefined',
73
- teamId: typeof args.options.teamId !== 'undefined',
74
- teamName: typeof args.options.teamName !== 'undefined',
75
- type: args.options.type || 'standard',
76
- owner: typeof args.options.owner !== 'undefined'
77
- });
78
- });
79
- }, _TeamsChannelAddCommand_initOptions = function _TeamsChannelAddCommand_initOptions() {
80
- this.options.unshift({
81
- option: '-i, --teamId [teamId]'
82
- }, {
83
- option: '--teamName [teamName]'
84
- }, {
85
- option: '-n, --name <name>'
86
- }, {
87
- option: '-d, --description [description]'
88
- }, {
89
- option: '--type [type]',
90
- autocomplete: ['standard', 'private', 'shared']
91
- }, {
92
- option: '--owner [owner]'
93
- });
94
- }, _TeamsChannelAddCommand_initValidators = function _TeamsChannelAddCommand_initValidators() {
95
- this.validators.push(async (args) => {
96
- if (args.options.teamId && !validation.isValidGuid(args.options.teamId)) {
97
- return `${args.options.teamId} is not a valid GUID`;
98
- }
99
- if (args.options.type && ['standard', 'private', 'shared'].indexOf(args.options.type) === -1) {
100
- return `${args.options.type} is not a valid type value. Allowed values standard|private|shared.`;
101
- }
102
- if ((args.options.type === 'private' || args.options.type === 'shared') && !args.options.owner) {
103
- return `Specify owner when creating a ${args.options.type} channel.`;
104
- }
105
- if ((args.options.type !== 'private' && args.options.type !== 'shared') && args.options.owner) {
106
- return `Specify owner only when creating a private or shared channel.`;
107
- }
108
- return true;
109
- });
110
- }, _TeamsChannelAddCommand_initOptionSets = function _TeamsChannelAddCommand_initOptionSets() {
111
- this.optionSets.push({ options: ['teamId', 'teamName'] });
112
- };
113
102
  export default new TeamsChannelAddCommand();
114
103
  //# sourceMappingURL=channel-add.js.map
@@ -1,14 +1,30 @@
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 _TeamsChannelGetCommand_instances, _TeamsChannelGetCommand_initTelemetry, _TeamsChannelGetCommand_initOptions, _TeamsChannelGetCommand_initValidators, _TeamsChannelGetCommand_initOptionSets;
7
1
  import request from '../../../../request.js';
8
2
  import { validation } from '../../../../utils/validation.js';
9
3
  import GraphCommand from '../../../base/GraphCommand.js';
10
4
  import commands from '../../commands.js';
11
5
  import { teams } from '../../../../utils/teams.js';
6
+ import { globalOptionsZod } from '../../../../Command.js';
7
+ import { z } from 'zod';
8
+ export const options = z.strictObject({
9
+ ...globalOptionsZod.shape,
10
+ teamId: z.string()
11
+ .refine(val => validation.isValidGuid(val), {
12
+ message: 'The value must be a valid GUID.'
13
+ })
14
+ .optional(),
15
+ teamName: z.string()
16
+ .optional(),
17
+ id: z.string()
18
+ .refine(val => validation.isValidTeamsChannelId(val), {
19
+ message: 'The value is not a valid Teams channel id.'
20
+ })
21
+ .optional()
22
+ .alias('i'),
23
+ name: z.string()
24
+ .optional(),
25
+ primary: z.boolean()
26
+ .optional()
27
+ });
12
28
  class TeamsChannelGetCommand extends GraphCommand {
13
29
  get name() {
14
30
  return commands.CHANNEL_GET;
@@ -16,13 +32,25 @@ class TeamsChannelGetCommand extends GraphCommand {
16
32
  get description() {
17
33
  return 'Gets information about the specific Microsoft Teams team channel';
18
34
  }
19
- constructor() {
20
- super();
21
- _TeamsChannelGetCommand_instances.add(this);
22
- __classPrivateFieldGet(this, _TeamsChannelGetCommand_instances, "m", _TeamsChannelGetCommand_initTelemetry).call(this);
23
- __classPrivateFieldGet(this, _TeamsChannelGetCommand_instances, "m", _TeamsChannelGetCommand_initOptions).call(this);
24
- __classPrivateFieldGet(this, _TeamsChannelGetCommand_instances, "m", _TeamsChannelGetCommand_initValidators).call(this);
25
- __classPrivateFieldGet(this, _TeamsChannelGetCommand_instances, "m", _TeamsChannelGetCommand_initOptionSets).call(this);
35
+ get schema() {
36
+ return options;
37
+ }
38
+ getRefinedSchema(schema) {
39
+ return schema
40
+ .refine(opts => [opts.teamId, opts.teamName].filter(x => x !== undefined).length === 1, {
41
+ message: 'Specify either teamId or teamName, but not both.',
42
+ params: {
43
+ customCode: 'optionSet',
44
+ options: ['teamId', 'teamName']
45
+ }
46
+ })
47
+ .refine(opts => [opts.id, opts.name, opts.primary].filter(x => x !== undefined).length === 1, {
48
+ message: 'Specify either id, name, or primary, but not both.',
49
+ params: {
50
+ customCode: 'optionSet',
51
+ options: ['id', 'name', 'primary']
52
+ }
53
+ });
26
54
  }
27
55
  async commandAction(logger, args) {
28
56
  try {
@@ -48,40 +76,5 @@ class TeamsChannelGetCommand extends GraphCommand {
48
76
  }
49
77
  }
50
78
  }
51
- _TeamsChannelGetCommand_instances = new WeakSet(), _TeamsChannelGetCommand_initTelemetry = function _TeamsChannelGetCommand_initTelemetry() {
52
- this.telemetry.push((args) => {
53
- Object.assign(this.telemetryProperties, {
54
- teamId: typeof args.options.teamId !== 'undefined',
55
- teamName: typeof args.options.teamName !== 'undefined',
56
- id: typeof args.options.id !== 'undefined',
57
- name: typeof args.options.name !== 'undefined',
58
- primary: !!args.options.primary
59
- });
60
- });
61
- }, _TeamsChannelGetCommand_initOptions = function _TeamsChannelGetCommand_initOptions() {
62
- this.options.unshift({
63
- option: '--teamId [teamId]'
64
- }, {
65
- option: '--teamName [teamName]'
66
- }, {
67
- option: '-i, --id [id]'
68
- }, {
69
- option: '--name [name]'
70
- }, {
71
- option: '--primary'
72
- });
73
- }, _TeamsChannelGetCommand_initValidators = function _TeamsChannelGetCommand_initValidators() {
74
- this.validators.push(async (args) => {
75
- if (args.options.teamId && !validation.isValidGuid(args.options.teamId)) {
76
- return `${args.options.teamId} is not a valid GUID`;
77
- }
78
- if (args.options.id && !validation.isValidTeamsChannelId(args.options.id)) {
79
- return `${args.options.id} is not a valid Teams channel id`;
80
- }
81
- return true;
82
- });
83
- }, _TeamsChannelGetCommand_initOptionSets = function _TeamsChannelGetCommand_initOptionSets() {
84
- this.optionSets.push({ options: ['teamId', 'teamName'] }, { options: ['id', 'name', 'primary'] });
85
- };
86
79
  export default new TeamsChannelGetCommand();
87
80
  //# sourceMappingURL=channel-get.js.map
@@ -1,14 +1,24 @@
1
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
- };
6
- var _TeamsChannelListCommand_instances, _TeamsChannelListCommand_initTelemetry, _TeamsChannelListCommand_initOptions, _TeamsChannelListCommand_initValidators, _TeamsChannelListCommand_initOptionSets;
7
1
  import { odata } from '../../../../utils/odata.js';
8
2
  import { teams } from '../../../../utils/teams.js';
9
3
  import { validation } from '../../../../utils/validation.js';
10
4
  import GraphCommand from '../../../base/GraphCommand.js';
11
5
  import commands from '../../commands.js';
6
+ import { globalOptionsZod } from '../../../../Command.js';
7
+ import { z } from 'zod';
8
+ export const options = z.strictObject({
9
+ ...globalOptionsZod.shape,
10
+ teamId: z.string()
11
+ .refine(val => validation.isValidGuid(val), {
12
+ message: 'The value must be a valid GUID.'
13
+ })
14
+ .optional()
15
+ .alias('i'),
16
+ teamName: z.string()
17
+ .optional(),
18
+ type: z.enum(['standard', 'private', 'shared'])
19
+ .optional()
20
+ .transform(v => v?.toLowerCase())
21
+ });
12
22
  class TeamsChannelListCommand extends GraphCommand {
13
23
  get name() {
14
24
  return commands.CHANNEL_LIST;
@@ -19,13 +29,18 @@ class TeamsChannelListCommand extends GraphCommand {
19
29
  defaultProperties() {
20
30
  return ['id', 'displayName'];
21
31
  }
22
- constructor() {
23
- super();
24
- _TeamsChannelListCommand_instances.add(this);
25
- __classPrivateFieldGet(this, _TeamsChannelListCommand_instances, "m", _TeamsChannelListCommand_initTelemetry).call(this);
26
- __classPrivateFieldGet(this, _TeamsChannelListCommand_instances, "m", _TeamsChannelListCommand_initOptions).call(this);
27
- __classPrivateFieldGet(this, _TeamsChannelListCommand_instances, "m", _TeamsChannelListCommand_initValidators).call(this);
28
- __classPrivateFieldGet(this, _TeamsChannelListCommand_instances, "m", _TeamsChannelListCommand_initOptionSets).call(this);
32
+ get schema() {
33
+ return options;
34
+ }
35
+ getRefinedSchema(schema) {
36
+ return schema
37
+ .refine(opts => [opts.teamId, opts.teamName].filter(x => x !== undefined).length === 1, {
38
+ message: 'Specify either teamId or teamName, but not both.',
39
+ params: {
40
+ customCode: 'optionSet',
41
+ options: ['teamId', 'teamName']
42
+ }
43
+ });
29
44
  }
30
45
  async getTeamId(args) {
31
46
  if (args.options.teamId) {
@@ -48,34 +63,5 @@ class TeamsChannelListCommand extends GraphCommand {
48
63
  }
49
64
  }
50
65
  }
51
- _TeamsChannelListCommand_instances = new WeakSet(), _TeamsChannelListCommand_initTelemetry = function _TeamsChannelListCommand_initTelemetry() {
52
- this.telemetry.push((args) => {
53
- Object.assign(this.telemetryProperties, {
54
- teamId: typeof args.options.teamId !== 'undefined',
55
- teamName: typeof args.options.teamName !== 'undefined'
56
- });
57
- });
58
- }, _TeamsChannelListCommand_initOptions = function _TeamsChannelListCommand_initOptions() {
59
- this.options.unshift({
60
- option: '-i, --teamId [teamId]'
61
- }, {
62
- option: '--teamName [teamName]'
63
- }, {
64
- option: '--type [type]',
65
- autocomplete: ['standard', 'private', 'shared']
66
- });
67
- }, _TeamsChannelListCommand_initValidators = function _TeamsChannelListCommand_initValidators() {
68
- this.validators.push(async (args) => {
69
- if (args.options.teamId && !validation.isValidGuid(args.options.teamId)) {
70
- return `${args.options.teamId} is not a valid GUID`;
71
- }
72
- if (args.options.type && ['standard', 'private', 'shared'].indexOf(args.options.type.toLowerCase()) === -1) {
73
- return `${args.options.type} is not a valid type value. Allowed values standard|private|shared`;
74
- }
75
- return true;
76
- });
77
- }, _TeamsChannelListCommand_initOptionSets = function _TeamsChannelListCommand_initOptionSets() {
78
- this.optionSets.push({ options: ['teamId', 'teamName'] });
79
- };
80
66
  export default new TeamsChannelListCommand();
81
67
  //# sourceMappingURL=channel-list.js.map