@pnp/cli-microsoft365 12.0.0-beta.c9bd7f3 → 12.0.0-beta.d0b29c1

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 (148) 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/googleAnalytics.js +96 -0
  5. package/dist/m365/entra/commands/m365group/m365group-remove.js +2 -8
  6. package/dist/m365/spfx/commands/SpfxCompatibilityMatrix.js +15 -0
  7. package/dist/m365/spfx/commands/project/project-doctor/doctor-1.24.0-rc.0.js +19 -0
  8. package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
  9. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN012021_TSC_excludeDirectories.js +43 -0
  10. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN027002_OVERRIDES_qs.js +33 -0
  11. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN027003_OVERRIDES_uuid.js +33 -0
  12. package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.24.0-rc.0.js +77 -0
  13. package/dist/m365/spfx/commands/project/project-upgrade.js +12 -11
  14. package/dist/m365/spo/commands/app/app-add.js +35 -56
  15. package/dist/m365/spo/commands/app/app-deploy.js +41 -59
  16. package/dist/m365/spo/commands/app/app-get.js +40 -56
  17. package/dist/m365/spo/commands/app/app-install.js +20 -41
  18. package/dist/m365/spo/commands/app/app-instance-list.js +12 -24
  19. package/dist/m365/spo/commands/app/app-list.js +26 -44
  20. package/dist/m365/spo/commands/app/app-remove.js +32 -52
  21. package/dist/m365/spo/commands/app/app-retract.js +32 -51
  22. package/dist/m365/spo/commands/app/app-teamspackage-download.js +35 -54
  23. package/dist/m365/spo/commands/app/app-uninstall.js +21 -44
  24. package/dist/m365/spo/commands/app/app-upgrade.js +20 -41
  25. package/dist/m365/spo/commands/feature/feature-disable.js +20 -50
  26. package/dist/m365/spo/commands/feature/feature-enable.js +22 -50
  27. package/dist/m365/spo/commands/feature/feature-list.js +11 -36
  28. package/dist/m365/spo/commands/field/field-add.js +33 -62
  29. package/dist/m365/spo/commands/field/field-get.js +30 -57
  30. package/dist/m365/spo/commands/field/field-list.js +21 -46
  31. package/dist/m365/spo/commands/field/field-remove.js +32 -63
  32. package/dist/m365/spo/commands/field/field-set.js +34 -66
  33. package/dist/m365/spo/commands/file/file-get.js +4 -3
  34. package/dist/m365/spo/commands/folder/folder-unarchive.js +90 -0
  35. package/dist/m365/spo/commands/hubsite/hubsite-connect.js +38 -63
  36. package/dist/m365/spo/commands/hubsite/hubsite-data-get.js +11 -27
  37. package/dist/m365/spo/commands/hubsite/hubsite-disconnect.js +25 -47
  38. package/dist/m365/spo/commands/hubsite/hubsite-get.js +25 -37
  39. package/dist/m365/spo/commands/hubsite/hubsite-list.js +12 -24
  40. package/dist/m365/spo/commands/hubsite/hubsite-register.js +10 -18
  41. package/dist/m365/spo/commands/hubsite/hubsite-rights-grant.js +14 -32
  42. package/dist/m365/spo/commands/hubsite/hubsite-rights-revoke.js +12 -29
  43. package/dist/m365/spo/commands/hubsite/hubsite-set.js +19 -46
  44. package/dist/m365/spo/commands/hubsite/hubsite-unregister.js +11 -27
  45. package/dist/m365/spo/commands/listitem/listitem-get.js +1 -12
  46. package/dist/m365/spo/commands/navigation/navigation-node-add.js +74 -120
  47. package/dist/m365/spo/commands/navigation/navigation-node-get.js +4 -13
  48. package/dist/m365/spo/commands/navigation/navigation-node-list.js +6 -4
  49. package/dist/m365/spo/commands/navigation/navigation-node-set.js +53 -114
  50. package/dist/m365/spo/commands/page/page-unpublish.js +53 -0
  51. package/dist/m365/spo/commands/site/site-remove.js +3 -9
  52. package/dist/m365/spo/commands/tenant/tenant-appcatalog-add.js +1 -1
  53. package/dist/m365/spo/commands/web/web-rule-get.js +47 -0
  54. package/dist/m365/spo/commands/web/web-rule-list.js +113 -0
  55. package/dist/m365/spo/commands/web/web-rule-remove.js +54 -0
  56. package/dist/m365/spo/commands.js +6 -1
  57. package/dist/m365/teams/commands/channel/channel-add.js +46 -57
  58. package/dist/m365/teams/commands/channel/channel-get.js +41 -48
  59. package/dist/m365/teams/commands/channel/channel-list.js +28 -42
  60. package/dist/m365/teams/commands/channel/channel-member-add.js +53 -54
  61. package/dist/m365/teams/commands/channel/channel-member-list.js +47 -55
  62. package/dist/m365/teams/commands/channel/channel-member-remove.js +62 -62
  63. package/dist/m365/teams/commands/channel/channel-member-set.js +61 -65
  64. package/dist/m365/teams/commands/channel/channel-remove.js +47 -49
  65. package/dist/m365/teams/commands/channel/channel-set.js +47 -54
  66. package/dist/m365/teams/commands/chat/chat-get.js +30 -45
  67. package/dist/m365/teams/commands/chat/chat-list.js +22 -42
  68. package/dist/m365/teams/commands/chat/chat-member-add.js +43 -64
  69. package/dist/m365/teams/commands/chat/chat-member-list.js +10 -23
  70. package/dist/m365/teams/commands/chat/chat-member-remove.js +28 -50
  71. package/dist/m365/teams/commands/chat/chat-message-send.js +32 -55
  72. package/dist/m365/util/commands/accesstoken/accesstoken-get.js +10 -28
  73. package/dist/telemetry.js +7 -11
  74. package/dist/utils/spo.js +40 -3
  75. package/dist/utils/urlUtil.js +2 -2
  76. package/docs/docs/cmd/entra/m365group/m365group-remove.mdx +0 -3
  77. package/docs/docs/cmd/spo/file/file-archive.mdx +1 -1
  78. package/docs/docs/cmd/spo/file/file-checkin.mdx +2 -2
  79. package/docs/docs/cmd/spo/file/file-checkout-undo.mdx +1 -1
  80. package/docs/docs/cmd/spo/file/file-checkout.mdx +2 -2
  81. package/docs/docs/cmd/spo/file/file-copy.mdx +2 -2
  82. package/docs/docs/cmd/spo/file/file-get.mdx +6 -6
  83. package/docs/docs/cmd/spo/file/file-retentionlabel-ensure.mdx +1 -1
  84. package/docs/docs/cmd/spo/file/file-retentionlabel-remove.mdx +1 -1
  85. package/docs/docs/cmd/spo/file/file-roleassignment-add.mdx +1 -1
  86. package/docs/docs/cmd/spo/file/file-roleassignment-remove.mdx +1 -1
  87. package/docs/docs/cmd/spo/file/file-roleinheritance-break.mdx +3 -3
  88. package/docs/docs/cmd/spo/file/file-roleinheritance-reset.mdx +2 -2
  89. package/docs/docs/cmd/spo/file/file-sharinginfo-get.mdx +2 -2
  90. package/docs/docs/cmd/spo/file/file-sharinglink-add.mdx +22 -1
  91. package/docs/docs/cmd/spo/file/file-sharinglink-clear.mdx +24 -1
  92. package/docs/docs/cmd/spo/file/file-sharinglink-get.mdx +22 -1
  93. package/docs/docs/cmd/spo/file/file-sharinglink-list.mdx +22 -1
  94. package/docs/docs/cmd/spo/file/file-sharinglink-remove.mdx +24 -1
  95. package/docs/docs/cmd/spo/file/file-sharinglink-set.mdx +22 -1
  96. package/docs/docs/cmd/spo/file/file-unarchive.mdx +1 -1
  97. package/docs/docs/cmd/spo/file/file-version-clear.mdx +1 -1
  98. package/docs/docs/cmd/spo/file/file-version-get.mdx +1 -1
  99. package/docs/docs/cmd/spo/file/file-version-keep.mdx +1 -1
  100. package/docs/docs/cmd/spo/file/file-version-list.mdx +1 -1
  101. package/docs/docs/cmd/spo/file/file-version-remove.mdx +1 -1
  102. package/docs/docs/cmd/spo/file/file-version-restore.mdx +1 -1
  103. package/docs/docs/cmd/spo/folder/folder-archive.mdx +1 -1
  104. package/docs/docs/cmd/spo/folder/folder-copy.mdx +1 -1
  105. package/docs/docs/cmd/spo/folder/folder-get.mdx +2 -2
  106. package/docs/docs/cmd/spo/folder/folder-retentionlabel-ensure.mdx +1 -1
  107. package/docs/docs/cmd/spo/folder/folder-retentionlabel-remove.mdx +1 -1
  108. package/docs/docs/cmd/spo/folder/folder-sharinglink-add.mdx +22 -1
  109. package/docs/docs/cmd/spo/folder/folder-sharinglink-clear.mdx +23 -0
  110. package/docs/docs/cmd/spo/folder/folder-sharinglink-get.mdx +21 -0
  111. package/docs/docs/cmd/spo/folder/folder-sharinglink-list.mdx +22 -1
  112. package/docs/docs/cmd/spo/folder/folder-sharinglink-remove.mdx +24 -1
  113. package/docs/docs/cmd/spo/folder/folder-sharinglink-set.mdx +21 -0
  114. package/docs/docs/cmd/spo/folder/folder-unarchive.mdx +76 -0
  115. package/docs/docs/cmd/spo/listitem/listitem-get.mdx +0 -6
  116. package/docs/docs/cmd/spo/navigation/navigation-node-add.mdx +45 -30
  117. package/docs/docs/cmd/spo/navigation/navigation-node-get.mdx +64 -42
  118. package/docs/docs/cmd/spo/navigation/navigation-node-list.mdx +37 -27
  119. package/docs/docs/cmd/spo/navigation/navigation-node-set.mdx +10 -8
  120. package/docs/docs/cmd/spo/page/page-unpublish.mdx +63 -0
  121. package/docs/docs/cmd/spo/site/site-remove.mdx +0 -3
  122. package/docs/docs/cmd/spo/web/web-rule-get.mdx +108 -0
  123. package/docs/docs/cmd/spo/web/web-rule-list.mdx +189 -0
  124. package/docs/docs/cmd/spo/web/web-rule-remove.mdx +65 -0
  125. package/docs/docs/cmd/spp/model/model-get.mdx +1 -1
  126. package/docs/docs/cmd/spp/model/model-remove.mdx +1 -1
  127. package/docs/docs/cmd/teams/tab/tab-add.mdx +19 -0
  128. package/docs/docs/cmd/teams/tab/tab-get.mdx +19 -0
  129. package/docs/docs/cmd/teams/tab/tab-list.mdx +19 -0
  130. package/docs/docs/cmd/teams/tab/tab-remove.mdx +21 -0
  131. package/docs/docs/cmd/tenant/people/people-profilecardproperty-add.mdx +19 -0
  132. package/docs/docs/cmd/tenant/people/people-profilecardproperty-get.mdx +19 -0
  133. package/docs/docs/cmd/tenant/people/people-profilecardproperty-list.mdx +19 -0
  134. package/docs/docs/cmd/tenant/people/people-profilecardproperty-remove.mdx +19 -0
  135. package/docs/docs/cmd/tenant/people/people-profilecardproperty-set.mdx +19 -0
  136. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-get.mdx +19 -0
  137. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-list.mdx +19 -0
  138. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-healthissue-get.mdx +19 -0
  139. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-healthissue-list.mdx +19 -0
  140. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-message-get.mdx +19 -0
  141. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-message-list.mdx +19 -0
  142. package/docs/docs/cmd/viva/engage/engage-message-add.mdx +17 -0
  143. package/docs/docs/cmd/viva/engage/engage-message-get.mdx +17 -0
  144. package/docs/docs/cmd/viva/engage/engage-message-list.mdx +17 -0
  145. package/docs/docs/cmd/viva/engage/engage-message-remove.mdx +19 -0
  146. package/npm-shrinkwrap.json +702 -3230
  147. package/package.json +20 -38
  148. package/dist/appInsights.js +0 -43
@@ -0,0 +1,96 @@
1
+ import Axios from 'axios';
2
+ import Configstore from 'configstore';
3
+ import crypto from 'crypto';
4
+ import fs from 'fs';
5
+ import os from 'os';
6
+ import path from 'path';
7
+ import url from 'url';
8
+ import config from './config.js';
9
+ import { app } from './utils/app.js';
10
+ const measurementId = 'G-4BNT8MQCYT';
11
+ const apiSecret = 'mm_3WD_TRuO-9MKsuZnhDQ';
12
+ const endpoint = 'https://www.google-analytics.com/mp/collect';
13
+ const clientIdSetting = 'telemetryClientId';
14
+ const requestTimeout = 3000;
15
+ const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
16
+ const commonProperties = {
17
+ version: `${app.packageJson().version}${fs.existsSync(path.join(__dirname, `..${path.sep}src`)) ? '-dev' : ''}`,
18
+ node: process.version,
19
+ os: os.platform(),
20
+ env: process.env.CLIMICROSOFT365_ENV ?? '',
21
+ ci: Boolean(process.env.CI).toString()
22
+ };
23
+ function getClientId() {
24
+ const store = new Configstore(config.configstoreName);
25
+ let clientId = store.get(clientIdSetting);
26
+ if (!clientId) {
27
+ clientId = crypto.randomUUID();
28
+ store.set(clientIdSetting, clientId);
29
+ }
30
+ return clientId;
31
+ }
32
+ function getSessionId(sessionId) {
33
+ return parseInt(crypto.createHash('sha256').update(sessionId).digest('hex').substring(0, 12), 16);
34
+ }
35
+ function toEventValue(value) {
36
+ if (typeof value === 'number') {
37
+ return value;
38
+ }
39
+ return String(value);
40
+ }
41
+ function getEvents(commandName, properties, context) {
42
+ const sessionId = getSessionId(context.sessionId);
43
+ const eventProperties = Object.entries(properties).reduce((result, [name, value]) => {
44
+ if (typeof value !== 'undefined') {
45
+ result[name] = toEventValue(value);
46
+ }
47
+ return result;
48
+ }, {});
49
+ return [{
50
+ name: 'command_used',
51
+ params: {
52
+ ['command_name']: commandName,
53
+ ...commonProperties,
54
+ shell: context.shell,
55
+ ...eventProperties,
56
+ ['session_id']: sessionId,
57
+ ['engagement_time_msec']: 1
58
+ }
59
+ }];
60
+ }
61
+ async function sendEvents(events) {
62
+ const clientId = getClientId();
63
+ const response = await Axios.post(`${endpoint}?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
64
+ ['client_id']: clientId,
65
+ events
66
+ }, {
67
+ headers: {
68
+ 'Content-Type': 'application/json'
69
+ },
70
+ timeout: requestTimeout,
71
+ validateStatus: () => true
72
+ });
73
+ if (response.status < 200 || response.status >= 300) {
74
+ throw new Error(`Google Analytics returned ${response.status}`);
75
+ }
76
+ }
77
+ export const googleAnalytics = {
78
+ commonProperties,
79
+ trackEvent: async (commandName, properties, context) => {
80
+ await sendEvents(getEvents(commandName, properties, context));
81
+ },
82
+ trackException: async (exception, context) => {
83
+ const description = exception instanceof Error ? exception.message : String(exception);
84
+ await sendEvents([{
85
+ name: 'exception',
86
+ params: {
87
+ description: description.substring(0, 100),
88
+ ...commonProperties,
89
+ shell: context.shell,
90
+ ['session_id']: getSessionId(context.sessionId),
91
+ ['engagement_time_msec']: 1
92
+ }
93
+ }]);
94
+ }
95
+ };
96
+ //# sourceMappingURL=googleAnalytics.js.map
@@ -32,10 +32,6 @@ class EntraM365GroupRemoveCommand extends GraphCommand {
32
32
  __classPrivateFieldGet(this, _EntraM365GroupRemoveCommand_instances, "m", _EntraM365GroupRemoveCommand_initTypes).call(this);
33
33
  }
34
34
  async commandAction(logger, args) {
35
- if (args.options.skipRecycleBin) {
36
- await this.warn(logger, `Option 'skipRecycleBin' is deprecated. Please use 'permanent' instead.`);
37
- args.options.permanent = true;
38
- }
39
35
  const removeGroup = async () => {
40
36
  if (this.verbose) {
41
37
  await logger.logToStderr(`Removing Microsoft 365 Group: ${args.options.id || args.options.displayName}...`);
@@ -173,7 +169,7 @@ _EntraM365GroupRemoveCommand_instances = new WeakSet(), _EntraM365GroupRemoveCom
173
169
  this.telemetry.push((args) => {
174
170
  Object.assign(this.telemetryProperties, {
175
171
  force: (!(!args.options.force)).toString(),
176
- permanent: !!(args.options.permanent || args.options.skipRecycleBin)
172
+ permanent: !!args.options.permanent
177
173
  });
178
174
  });
179
175
  }, _EntraM365GroupRemoveCommand_initOptions = function _EntraM365GroupRemoveCommand_initOptions() {
@@ -185,8 +181,6 @@ _EntraM365GroupRemoveCommand_instances = new WeakSet(), _EntraM365GroupRemoveCom
185
181
  option: '-f, --force'
186
182
  }, {
187
183
  option: '--permanent'
188
- }, {
189
- option: '--skipRecycleBin'
190
184
  });
191
185
  }, _EntraM365GroupRemoveCommand_initValidators = function _EntraM365GroupRemoveCommand_initValidators() {
192
186
  this.validators.push(async (args) => {
@@ -199,7 +193,7 @@ _EntraM365GroupRemoveCommand_instances = new WeakSet(), _EntraM365GroupRemoveCom
199
193
  this.optionSets.push({ options: ['id', 'displayName'] });
200
194
  }, _EntraM365GroupRemoveCommand_initTypes = function _EntraM365GroupRemoveCommand_initTypes() {
201
195
  this.types.string.push('id', 'displayName');
202
- this.types.boolean.push('permanent', 'skipRecycleBin');
196
+ this.types.boolean.push('permanent');
203
197
  };
204
198
  EntraM365GroupRemoveCommand.maxRetries = 10;
205
199
  export default new EntraM365GroupRemoveCommand();
@@ -653,6 +653,21 @@ export const versions = {
653
653
  range: '^4 || ^5 || ^6 || ^7',
654
654
  fix: 'npm i -g yo@7'
655
655
  }
656
+ },
657
+ '1.24.0-rc.0': {
658
+ heft: {
659
+ range: '^1',
660
+ fix: 'npm i -g @rushstack/heft@1'
661
+ },
662
+ node: {
663
+ range: '>=22.14.0 <23.0.0 || >=24.0.0 <25.0.0 || >=26.0.0 <27.0.0',
664
+ fix: 'Install Node.js >=22.14.0 <23.0.0 || >=24.0.0 <25.0.0 || >=26.0.0 <27.0.0'
665
+ },
666
+ sp: SharePointVersion.SPO,
667
+ yo: {
668
+ range: '^4 || ^5 || ^6 || ^7',
669
+ fix: 'npm i -g yo@7'
670
+ }
656
671
  }
657
672
  };
658
673
  //# sourceMappingURL=SpfxCompatibilityMatrix.js.map
@@ -0,0 +1,19 @@
1
+ import { FN001008_DEP_react } from './rules/FN001008_DEP_react.js';
2
+ import { FN001009_DEP_react_dom } from './rules/FN001009_DEP_react_dom.js';
3
+ import { FN001035_DEP_fluentui_react } from './rules/FN001035_DEP_fluentui_react.js';
4
+ import { FN002013_DEVDEP_types_webpack_env } from './rules/FN002013_DEVDEP_types_webpack_env.js';
5
+ import { FN002015_DEVDEP_types_react } from './rules/FN002015_DEVDEP_types_react.js';
6
+ import { FN002016_DEVDEP_types_react_dom } from './rules/FN002016_DEVDEP_types_react_dom.js';
7
+ import { FN002022_DEVDEP_typescript } from './rules/FN002022_DEVDEP_typescript.js';
8
+ import { FN021001_PKG_spfx_deps_versions_match_project_version } from './rules/FN021001_PKG_spfx_deps_versions_match_project_version.js';
9
+ export default [
10
+ new FN001008_DEP_react({ supportedRange: '18' }),
11
+ new FN001009_DEP_react_dom({ supportedRange: '18' }),
12
+ new FN001035_DEP_fluentui_react({ supportedRange: '^8.106.4' }),
13
+ new FN002013_DEVDEP_types_webpack_env({ supportedRange: '~1.15.2' }),
14
+ new FN002015_DEVDEP_types_react({ supportedRange: '18' }),
15
+ new FN002016_DEVDEP_types_react_dom({ supportedRange: '18' }),
16
+ new FN002022_DEVDEP_typescript({ supportedRange: '~5.8.0' }),
17
+ new FN021001_PKG_spfx_deps_versions_match_project_version({ includeDevDeps: true })
18
+ ];
19
+ //# sourceMappingURL=doctor-1.24.0-rc.0.js.map
@@ -78,7 +78,8 @@ class SpfxProjectDoctorCommand extends BaseProjectCommand {
78
78
  '1.22.1',
79
79
  '1.22.2',
80
80
  '1.23.0',
81
- '1.23.2'
81
+ '1.23.2',
82
+ '1.24.0-rc.0'
82
83
  ];
83
84
  __classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initTelemetry).call(this);
84
85
  __classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initOptions).call(this);
@@ -0,0 +1,43 @@
1
+ import { JsonRule } from '../../JsonRule.js';
2
+ export class FN012021_TSC_excludeDirectories extends JsonRule {
3
+ constructor(options) {
4
+ super();
5
+ this.directories = options.directories;
6
+ }
7
+ get id() {
8
+ return 'FN012021';
9
+ }
10
+ get title() {
11
+ return 'tsconfig.json watchOptions.excludeDirectories property';
12
+ }
13
+ get description() {
14
+ return `Update tsconfig.json watchOptions.excludeDirectories property`;
15
+ }
16
+ get resolution() {
17
+ return `{
18
+ "watchOptions": {
19
+ "excludeDirectories": ${JSON.stringify(this.directories)}
20
+ }
21
+ }`;
22
+ }
23
+ get resolutionType() {
24
+ return 'json';
25
+ }
26
+ get severity() {
27
+ return 'Required';
28
+ }
29
+ get file() {
30
+ return './tsconfig.json';
31
+ }
32
+ visit(project, findings) {
33
+ if (!project.tsConfigJson) {
34
+ return;
35
+ }
36
+ if (!project.tsConfigJson.watchOptions?.excludeDirectories ||
37
+ JSON.stringify(project.tsConfigJson.watchOptions.excludeDirectories) !== JSON.stringify(this.directories)) {
38
+ const node = this.getAstNodeFromFile(project.tsConfigJson, 'watchOptions.excludeDirectories');
39
+ this.addFindingWithPosition(findings, node);
40
+ }
41
+ }
42
+ }
43
+ //# sourceMappingURL=FN012021_TSC_excludeDirectories.js.map
@@ -0,0 +1,33 @@
1
+ import { DependencyRule } from "./DependencyRule.js";
2
+ export class FN027002_OVERRIDES_qs extends DependencyRule {
3
+ constructor(options) {
4
+ super({ packageName: 'qs', packageVersion: options.version, isOverride: true });
5
+ }
6
+ get id() {
7
+ return 'FN027002';
8
+ }
9
+ visit(project, findings) {
10
+ // If an override entry for the package already exists in package.json,
11
+ // emit an extra finding to remove the existing override first. This avoids
12
+ // having to use a separate remove-override rule (e.g. FN027002) in the upgrade scripts.
13
+ if (project.packageJson?.overrides?.[this.packageName] &&
14
+ project.packageJson.overrides[this.packageName] !== this.packageVersion) {
15
+ const node = this.getAstNodeFromFile(project.packageJson, `overrides.${this.packageName}`);
16
+ findings.push({
17
+ id: `${this.id}_REMOVE`,
18
+ title: this.packageName,
19
+ description: `Remove existing SharePoint Framework override dependency package ${this.packageName}`,
20
+ occurrences: [{
21
+ file: this.file,
22
+ resolution: `removeOverride overrides.${this.packageName}`,
23
+ position: this.getPositionFromNode(node)
24
+ }],
25
+ resolutionType: 'cmd',
26
+ severity: 'Required',
27
+ supersedes: []
28
+ });
29
+ }
30
+ super.visit(project, findings);
31
+ }
32
+ }
33
+ //# sourceMappingURL=FN027002_OVERRIDES_qs.js.map
@@ -0,0 +1,33 @@
1
+ import { DependencyRule } from "./DependencyRule.js";
2
+ export class FN027003_OVERRIDES_uuid extends DependencyRule {
3
+ constructor(options) {
4
+ super({ packageName: 'uuid', packageVersion: options.version, isOverride: true });
5
+ }
6
+ get id() {
7
+ return 'FN027003';
8
+ }
9
+ visit(project, findings) {
10
+ // If an override entry for the package already exists in package.json,
11
+ // emit an extra finding to remove the existing override first. This avoids
12
+ // having to use a separate remove-override rule (e.g. FN027003) in the upgrade scripts.
13
+ if (project.packageJson?.overrides?.[this.packageName] &&
14
+ project.packageJson.overrides[this.packageName] !== this.packageVersion) {
15
+ const node = this.getAstNodeFromFile(project.packageJson, `overrides.${this.packageName}`);
16
+ findings.push({
17
+ id: `${this.id}_REMOVE`,
18
+ title: this.packageName,
19
+ description: `Remove existing SharePoint Framework override dependency package ${this.packageName}`,
20
+ occurrences: [{
21
+ file: this.file,
22
+ resolution: `removeOverride overrides.${this.packageName}`,
23
+ position: this.getPositionFromNode(node)
24
+ }],
25
+ resolutionType: 'cmd',
26
+ severity: 'Required',
27
+ supersedes: []
28
+ });
29
+ }
30
+ super.visit(project, findings);
31
+ }
32
+ }
33
+ //# sourceMappingURL=FN027003_OVERRIDES_uuid.js.map
@@ -0,0 +1,77 @@
1
+ import { FN001001_DEP_microsoft_sp_core_library } from './rules/FN001001_DEP_microsoft_sp_core_library.js';
2
+ import { FN001002_DEP_microsoft_sp_lodash_subset } from './rules/FN001002_DEP_microsoft_sp_lodash_subset.js';
3
+ import { FN001003_DEP_microsoft_sp_office_ui_fabric_core } from './rules/FN001003_DEP_microsoft_sp_office_ui_fabric_core.js';
4
+ import { FN001004_DEP_microsoft_sp_webpart_base } from './rules/FN001004_DEP_microsoft_sp_webpart_base.js';
5
+ import { FN001008_DEP_react } from './rules/FN001008_DEP_react.js';
6
+ import { FN001009_DEP_react_dom } from './rules/FN001009_DEP_react_dom.js';
7
+ import { FN001011_DEP_microsoft_sp_dialog } from './rules/FN001011_DEP_microsoft_sp_dialog.js';
8
+ import { FN001012_DEP_microsoft_sp_application_base } from './rules/FN001012_DEP_microsoft_sp_application_base.js';
9
+ import { FN001013_DEP_microsoft_decorators } from './rules/FN001013_DEP_microsoft_decorators.js';
10
+ import { FN001014_DEP_microsoft_sp_listview_extensibility } from './rules/FN001014_DEP_microsoft_sp_listview_extensibility.js';
11
+ import { FN001021_DEP_microsoft_sp_property_pane } from './rules/FN001021_DEP_microsoft_sp_property_pane.js';
12
+ import { FN001023_DEP_microsoft_sp_component_base } from './rules/FN001023_DEP_microsoft_sp_component_base.js';
13
+ import { FN001024_DEP_microsoft_sp_diagnostics } from './rules/FN001024_DEP_microsoft_sp_diagnostics.js';
14
+ import { FN001025_DEP_microsoft_sp_dynamic_data } from './rules/FN001025_DEP_microsoft_sp_dynamic_data.js';
15
+ import { FN001026_DEP_microsoft_sp_extension_base } from './rules/FN001026_DEP_microsoft_sp_extension_base.js';
16
+ import { FN001027_DEP_microsoft_sp_http } from './rules/FN001027_DEP_microsoft_sp_http.js';
17
+ import { FN001028_DEP_microsoft_sp_list_subscription } from './rules/FN001028_DEP_microsoft_sp_list_subscription.js';
18
+ import { FN001029_DEP_microsoft_sp_loader } from './rules/FN001029_DEP_microsoft_sp_loader.js';
19
+ import { FN001030_DEP_microsoft_sp_module_interfaces } from './rules/FN001030_DEP_microsoft_sp_module_interfaces.js';
20
+ import { FN001031_DEP_microsoft_sp_odata_types } from './rules/FN001031_DEP_microsoft_sp_odata_types.js';
21
+ import { FN001032_DEP_microsoft_sp_page_context } from './rules/FN001032_DEP_microsoft_sp_page_context.js';
22
+ import { FN001034_DEP_microsoft_sp_adaptive_card_extension_base } from './rules/FN001034_DEP_microsoft_sp_adaptive_card_extension_base.js';
23
+ import { FN002002_DEVDEP_microsoft_sp_module_interfaces } from './rules/FN002002_DEVDEP_microsoft_sp_module_interfaces.js';
24
+ import { FN002015_DEVDEP_types_react } from './rules/FN002015_DEVDEP_types_react.js';
25
+ import { FN002016_DEVDEP_types_react_dom } from './rules/FN002016_DEVDEP_types_react_dom.js';
26
+ import { FN002022_DEVDEP_microsoft_eslint_plugin_spfx } from './rules/FN002022_DEVDEP_microsoft_eslint_plugin_spfx.js';
27
+ import { FN002023_DEVDEP_microsoft_eslint_config_spfx } from './rules/FN002023_DEVDEP_microsoft_eslint_config_spfx.js';
28
+ import { FN002030_DEVDEP_microsoft_spfx_web_build_rig } from './rules/FN002030_DEVDEP_microsoft_spfx_web_build_rig.js';
29
+ import { FN002031_DEVDEP_rushstack_heft } from './rules/FN002031_DEVDEP_rushstack_heft.js';
30
+ import { FN002034_DEVDEP_microsoft_spfx_heft_plugins } from './rules/FN002034_DEVDEP_microsoft_spfx_heft_plugins.js';
31
+ import { FN010001_YORC_version } from './rules/FN010001_YORC_version.js';
32
+ import { FN012021_TSC_excludeDirectories } from './rules/FN012021_TSC_excludeDirectories.js';
33
+ import { FN020001_RES_types_react } from './rules/FN020001_RES_types_react.js';
34
+ import { FN021003_PKG_engines_node } from './rules/FN021003_PKG_engines_node.js';
35
+ import { FN027001_OVERRIDES_rushstack_heft } from './rules/FN027001_OVERRIDES_rushstack_heft.js';
36
+ import { FN027002_OVERRIDES_qs } from './rules/FN027002_OVERRIDES_qs.js';
37
+ import { FN027003_OVERRIDES_uuid } from './rules/FN027003_OVERRIDES_uuid.js';
38
+ export default [
39
+ new FN001001_DEP_microsoft_sp_core_library({ packageVersion: '1.24.0-rc.0' }),
40
+ new FN001002_DEP_microsoft_sp_lodash_subset({ packageVersion: '1.24.0-rc.0' }),
41
+ new FN001003_DEP_microsoft_sp_office_ui_fabric_core({ packageVersion: '1.24.0-rc.0' }),
42
+ new FN001004_DEP_microsoft_sp_webpart_base({ packageVersion: '1.24.0-rc.0' }),
43
+ new FN001008_DEP_react({ packageVersion: '18.3.1' }),
44
+ new FN001009_DEP_react_dom({ packageVersion: '18.3.1' }),
45
+ new FN001011_DEP_microsoft_sp_dialog({ packageVersion: '1.24.0-rc.0' }),
46
+ new FN001012_DEP_microsoft_sp_application_base({ packageVersion: '1.24.0-rc.0' }),
47
+ new FN001014_DEP_microsoft_sp_listview_extensibility({ packageVersion: '1.24.0-rc.0' }),
48
+ new FN001021_DEP_microsoft_sp_property_pane({ packageVersion: '1.24.0-rc.0' }),
49
+ new FN001023_DEP_microsoft_sp_component_base({ packageVersion: '1.24.0-rc.0' }),
50
+ new FN001024_DEP_microsoft_sp_diagnostics({ packageVersion: '1.24.0-rc.0' }),
51
+ new FN001025_DEP_microsoft_sp_dynamic_data({ packageVersion: '1.24.0-rc.0' }),
52
+ new FN001026_DEP_microsoft_sp_extension_base({ packageVersion: '1.24.0-rc.0' }),
53
+ new FN001027_DEP_microsoft_sp_http({ packageVersion: '1.24.0-rc.0' }),
54
+ new FN001028_DEP_microsoft_sp_list_subscription({ packageVersion: '1.24.0-rc.0' }),
55
+ new FN001029_DEP_microsoft_sp_loader({ packageVersion: '1.24.0-rc.0' }),
56
+ new FN001030_DEP_microsoft_sp_module_interfaces({ packageVersion: '1.24.0-rc.0' }),
57
+ new FN001031_DEP_microsoft_sp_odata_types({ packageVersion: '1.24.0-rc.0' }),
58
+ new FN001032_DEP_microsoft_sp_page_context({ packageVersion: '1.24.0-rc.0' }),
59
+ new FN001013_DEP_microsoft_decorators({ packageVersion: '1.24.0-rc.0' }),
60
+ new FN001034_DEP_microsoft_sp_adaptive_card_extension_base({ packageVersion: '1.24.0-rc.0' }),
61
+ new FN002002_DEVDEP_microsoft_sp_module_interfaces({ packageVersion: '1.24.0-rc.0' }),
62
+ new FN002015_DEVDEP_types_react({ packageVersion: '18.2.79' }),
63
+ new FN002016_DEVDEP_types_react_dom({ packageVersion: '18.2.25' }),
64
+ new FN002022_DEVDEP_microsoft_eslint_plugin_spfx({ packageVersion: '1.24.0-rc.0' }),
65
+ new FN002023_DEVDEP_microsoft_eslint_config_spfx({ packageVersion: '1.24.0-rc.0' }),
66
+ new FN002030_DEVDEP_microsoft_spfx_web_build_rig({ packageVersion: '1.24.0-rc.0' }),
67
+ new FN002031_DEVDEP_rushstack_heft({ packageVersion: '1.3.2' }),
68
+ new FN002034_DEVDEP_microsoft_spfx_heft_plugins({ packageVersion: '1.24.0-rc.0' }),
69
+ new FN010001_YORC_version({ version: '1.24.0-rc.0' }),
70
+ new FN012021_TSC_excludeDirectories({ directories: ['**/teams', '**/temp/copilot'] }),
71
+ new FN020001_RES_types_react({ packageVersion: '18.2.79' }),
72
+ new FN021003_PKG_engines_node({ version: '>=22.14.0 <23.0.0 || >=24.0.0 <25.0.0 || >=26.0.0 <27.0.0' }),
73
+ new FN027001_OVERRIDES_rushstack_heft({ version: '1.3.2' }),
74
+ new FN027002_OVERRIDES_qs({ version: '>=6.15.2' }),
75
+ new FN027003_OVERRIDES_uuid({ version: '>=11.1.1' })
76
+ ];
77
+ //# sourceMappingURL=upgrade-1.24.0-rc.0.js.map
@@ -2,7 +2,7 @@ import fs from 'fs';
2
2
  import os from 'os';
3
3
  import path from 'path';
4
4
  // Uncomment to support upgrading to preview releases
5
- // import { prerelease } from 'semver';
5
+ import { prerelease } from 'semver';
6
6
  import { z } from 'zod';
7
7
  import { CommandError, globalOptionsZod } from '../../../../Command.js';
8
8
  import { fsUtil } from '../../../../utils/fsUtil.js';
@@ -87,7 +87,8 @@ class SpfxProjectUpgradeCommand extends BaseProjectCommand {
87
87
  '1.22.1',
88
88
  '1.22.2',
89
89
  '1.23.0',
90
- '1.23.2'
90
+ '1.23.2',
91
+ '1.24.0-rc.0'
91
92
  ];
92
93
  }
93
94
  async commandAction(logger, args) {
@@ -97,15 +98,15 @@ class SpfxProjectUpgradeCommand extends BaseProjectCommand {
97
98
  }
98
99
  this.toVersion = args.options.toVersion ? args.options.toVersion : this.supportedVersions[this.supportedVersions.length - 1];
99
100
  // Uncomment to support upgrading to preview releases
100
- // if (!args.options.toVersion &&
101
- // !args.options.preview &&
102
- // prerelease(this.toVersion)) {
103
- // // no version and no preview specified while the current version to
104
- // // upgrade to is a prerelease so let's grab the first non-preview version
105
- // // since we're supporting only one preview version, it's sufficient for
106
- // // us to take second to last version
107
- // this.toVersion = this.supportedVersions[this.supportedVersions.length - 2];
108
- // }
101
+ if (!args.options.toVersion &&
102
+ !args.options.preview &&
103
+ prerelease(this.toVersion)) {
104
+ // no version and no preview specified while the current version to
105
+ // upgrade to is a prerelease so let's grab the first non-preview version
106
+ // since we're supporting only one preview version, it's sufficient for
107
+ // us to take second to last version
108
+ this.toVersion = this.supportedVersions[this.supportedVersions.length - 2];
109
+ }
109
110
  this.packageManager = args.options.packageManager || 'npm';
110
111
  this.shell = args.options.shell || 'powershell';
111
112
  if (this.supportedVersions.indexOf(this.toVersion) < 0) {
@@ -1,17 +1,34 @@
1
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
- };
6
- var _SpoAppAddCommand_instances, _SpoAppAddCommand_initTelemetry, _SpoAppAddCommand_initOptions, _SpoAppAddCommand_initValidators;
7
1
  import fs from 'fs';
8
2
  import path from 'path';
3
+ import { z } from 'zod';
9
4
  import { cli } from '../../../../cli/cli.js';
5
+ import { globalOptionsZod } from '../../../../Command.js';
10
6
  import request from '../../../../request.js';
11
7
  import { spo } from '../../../../utils/spo.js';
12
8
  import { validation } from '../../../../utils/validation.js';
9
+ import { zod } from '../../../../utils/zod.js';
13
10
  import commands from '../../commands.js';
14
11
  import { SpoAppBaseCommand } from './SpoAppBaseCommand.js';
12
+ export const options = z.strictObject({
13
+ ...globalOptionsZod.shape,
14
+ filePath: z.string()
15
+ .refine(filePath => fs.existsSync(path.resolve(filePath)), {
16
+ error: e => `File '${path.resolve(e.input)}' not found`,
17
+ abort: true
18
+ })
19
+ .refine(filePath => !fs.lstatSync(path.resolve(filePath)).isDirectory(), {
20
+ error: e => `Path '${path.resolve(e.input)}' points to a directory`
21
+ })
22
+ .alias('p'),
23
+ overwrite: z.boolean().optional(),
24
+ appCatalogScope: zod.coercedEnum({ tenant: 'tenant', sitecollection: 'sitecollection' }).optional().alias('s'),
25
+ appCatalogUrl: z.string()
26
+ .refine(url => validation.isValidSharePointUrl(url) === true, {
27
+ error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
28
+ })
29
+ .optional()
30
+ .alias('u')
31
+ });
15
32
  class SpoAppAddCommand extends SpoAppBaseCommand {
16
33
  get name() {
17
34
  return commands.APP_ADD;
@@ -19,13 +36,18 @@ class SpoAppAddCommand extends SpoAppBaseCommand {
19
36
  get description() {
20
37
  return 'Adds an app to the specified SharePoint Online app catalog';
21
38
  }
22
- constructor() {
23
- super();
24
- _SpoAppAddCommand_instances.add(this);
25
- this.appCatalogScopeOptions = ['tenant', 'sitecollection'];
26
- __classPrivateFieldGet(this, _SpoAppAddCommand_instances, "m", _SpoAppAddCommand_initTelemetry).call(this);
27
- __classPrivateFieldGet(this, _SpoAppAddCommand_instances, "m", _SpoAppAddCommand_initOptions).call(this);
28
- __classPrivateFieldGet(this, _SpoAppAddCommand_instances, "m", _SpoAppAddCommand_initValidators).call(this);
39
+ get schema() {
40
+ return options;
41
+ }
42
+ getRefinedSchema(schema) {
43
+ return schema
44
+ .refine(opts => opts.appCatalogScope !== 'sitecollection' || opts.appCatalogUrl !== undefined, {
45
+ error: 'You must specify appCatalogUrl when appCatalogScope is sitecollection',
46
+ path: ['appCatalogUrl'],
47
+ params: {
48
+ customCode: 'required'
49
+ }
50
+ });
29
51
  }
30
52
  async commandAction(logger, args) {
31
53
  const scope = (args.options.appCatalogScope) ? args.options.appCatalogScope.toLowerCase() : 'tenant';
@@ -60,48 +82,5 @@ class SpoAppAddCommand extends SpoAppBaseCommand {
60
82
  }
61
83
  }
62
84
  }
63
- _SpoAppAddCommand_instances = new WeakSet(), _SpoAppAddCommand_initTelemetry = function _SpoAppAddCommand_initTelemetry() {
64
- this.telemetry.push((args) => {
65
- Object.assign(this.telemetryProperties, {
66
- overwrite: !!args.options.overwrite,
67
- appCatalogScope: args.options.appCatalogScope || 'tenant',
68
- appCatalogUrl: typeof args.options.appCatalogUrl !== 'undefined'
69
- });
70
- });
71
- }, _SpoAppAddCommand_initOptions = function _SpoAppAddCommand_initOptions() {
72
- this.options.unshift({
73
- option: '-p, --filePath <filePath>'
74
- }, {
75
- option: '-s, --appCatalogScope [appCatalogScope]',
76
- autocomplete: this.appCatalogScopeOptions
77
- }, {
78
- option: '-u, --appCatalogUrl [appCatalogUrl]'
79
- }, {
80
- option: '--overwrite [overwrite]'
81
- });
82
- }, _SpoAppAddCommand_initValidators = function _SpoAppAddCommand_initValidators() {
83
- this.validators.push(async (args) => {
84
- if (args.options.appCatalogScope) {
85
- const appCatalogScope = args.options.appCatalogScope.toLowerCase();
86
- if (this.appCatalogScopeOptions.indexOf(appCatalogScope) === -1) {
87
- return `${args.options.appCatalogScope} is not a valid appCatalogScope. Allowed values are: ${this.appCatalogScopeOptions.join(', ')}`;
88
- }
89
- if (appCatalogScope === 'sitecollection' && !args.options.appCatalogUrl) {
90
- return `You must specify appCatalogUrl when appCatalogScope is sitecollection`;
91
- }
92
- }
93
- const fullPath = path.resolve(args.options.filePath);
94
- if (!fs.existsSync(fullPath)) {
95
- return `File '${fullPath}' not found`;
96
- }
97
- if (fs.lstatSync(fullPath).isDirectory()) {
98
- return `Path '${fullPath}' points to a directory`;
99
- }
100
- if (args.options.appCatalogUrl) {
101
- return validation.isValidSharePointUrl(args.options.appCatalogUrl);
102
- }
103
- return true;
104
- });
105
- };
106
85
  export default new SpoAppAddCommand();
107
86
  //# sourceMappingURL=app-add.js.map