@pnp/cli-microsoft365 11.4.0-beta.fe9cdb1 → 11.5.0-beta.083a680

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 (144) 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/Auth.js +1 -1
  6. package/dist/AuthServer.js +2 -4
  7. package/dist/Command.js +2 -2
  8. package/dist/cli/cli.js +9 -9
  9. package/dist/m365/adaptivecard/commands/adaptivecard-send.js +10 -11
  10. package/dist/m365/app/commands/app-open.js +3 -4
  11. package/dist/m365/app/commands/permission/permission-add.js +4 -5
  12. package/dist/m365/base/AppCommand.js +3 -3
  13. package/dist/m365/booking/commands/business/business-get.js +6 -8
  14. package/dist/m365/booking/commands/business/business-list.js +2 -1
  15. package/dist/m365/cli/commands/app/app-add.js +5 -7
  16. package/dist/m365/commands/docs.js +1 -1
  17. package/dist/m365/commands/login.js +22 -19
  18. package/dist/m365/commands/logout.js +1 -1
  19. package/dist/m365/commands/status.js +2 -1
  20. package/dist/m365/connection/commands/connection-list.js +2 -1
  21. package/dist/m365/connection/commands/connection-set.js +15 -29
  22. package/dist/m365/context/commands/context-remove.js +4 -6
  23. package/dist/m365/context/commands/option/option-remove.js +5 -7
  24. package/dist/m365/entra/commands/administrativeunit/administrativeunit-add.js +5 -7
  25. package/dist/m365/entra/commands/administrativeunit/administrativeunit-get.js +7 -9
  26. package/dist/m365/entra/commands/administrativeunit/administrativeunit-list.js +4 -5
  27. package/dist/m365/entra/commands/administrativeunit/administrativeunit-remove.js +8 -10
  28. package/dist/m365/entra/commands/license/license-list.js +1 -1
  29. package/dist/m365/entra/commands/m365group/m365group-remove.js +1 -1
  30. package/dist/m365/entra/commands/multitenant/multitenant-add.js +3 -4
  31. package/dist/m365/entra/commands/organization/organization-list.js +4 -6
  32. package/dist/m365/entra/commands/organization/organization-set.js +24 -26
  33. package/dist/m365/entra/commands/roleassignment/roleassignment-add.js +21 -34
  34. package/dist/m365/entra/commands/roledefinition/roledefinition-add.js +8 -10
  35. package/dist/m365/entra/commands/roledefinition/roledefinition-get.js +11 -13
  36. package/dist/m365/entra/commands/roledefinition/roledefinition-list.js +5 -7
  37. package/dist/m365/entra/commands/roledefinition/roledefinition-remove.js +11 -13
  38. package/dist/m365/entra/commands/roledefinition/roledefinition-set.js +15 -17
  39. package/dist/m365/entra/commands/rolepermission/rolepermission-list.js +5 -7
  40. package/dist/m365/entra/commands/user/user-session-revoke.js +9 -13
  41. package/dist/m365/exo/commands/approleassignment/approleassignment-add.js +29 -31
  42. package/dist/m365/external/commands/item/item-add.js +1 -1
  43. package/dist/m365/flow/commands/environment/environment-get.js +5 -7
  44. package/dist/m365/flow/commands/environment/environment-list.js +2 -1
  45. package/dist/m365/flow/commands/recyclebinitem/recyclebinitem-list.js +4 -6
  46. package/dist/m365/flow/commands/recyclebinitem/recyclebinitem-restore.js +5 -11
  47. package/dist/m365/graph/commands/directoryextension/directoryextension-add.js +11 -13
  48. package/dist/m365/graph/commands/directoryextension/directoryextension-get.js +10 -19
  49. package/dist/m365/graph/commands/directoryextension/directoryextension-list.js +6 -12
  50. package/dist/m365/graph/commands/directoryextension/directoryextension-remove.js +11 -20
  51. package/dist/m365/graph/commands/openextension/openextension-add.js +12 -13
  52. package/dist/m365/graph/commands/openextension/openextension-get.js +12 -14
  53. package/dist/m365/graph/commands/openextension/openextension-list.js +11 -13
  54. package/dist/m365/graph/commands/openextension/openextension-remove.js +13 -15
  55. package/dist/m365/graph/commands/openextension/openextension-set.js +16 -17
  56. package/dist/m365/onedrive/commands/onedrive-list.js +2 -1
  57. package/dist/m365/outlook/commands/mail/mail-searchfolder-add.js +9 -14
  58. package/dist/m365/outlook/commands/mailbox/mailbox-settings-get.js +8 -12
  59. package/dist/m365/outlook/commands/mailbox/mailbox-settings-set.js +15 -15
  60. package/dist/m365/outlook/commands/roomlist/roomlist-list.js +2 -1
  61. package/dist/m365/pa/commands/environment/environment-get.js +5 -7
  62. package/dist/m365/pa/commands/environment/environment-list.js +2 -1
  63. package/dist/m365/planner/commands/tenant/tenant-settings-list.js +1 -1
  64. package/dist/m365/pp/commands/environment/environment-get.js +5 -7
  65. package/dist/m365/pp/commands/environment/environment-list.js +3 -4
  66. package/dist/m365/pp/commands/gateway/gateway-list.js +1 -1
  67. package/dist/m365/pp/commands/tenant/tenant-settings-list.js +1 -1
  68. package/dist/m365/pp/commands/website/website-get.js +12 -12
  69. package/dist/m365/purview/commands/retentionevent/retentionevent-list.js +2 -1
  70. package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-list.js +1 -1
  71. package/dist/m365/purview/commands/retentionlabel/retentionlabel-list.js +1 -1
  72. package/dist/m365/spe/commands/container/container-add.js +10 -15
  73. package/dist/m365/spe/commands/container/container-permission-list.js +4 -6
  74. package/dist/m365/spe/commands/container/container-recyclebinitem-list.js +5 -10
  75. package/dist/m365/spe/commands/container/container-recyclebinitem-remove.js +96 -0
  76. package/dist/m365/spe/commands/container/container-recyclebinitem-restore.js +7 -12
  77. package/dist/m365/spe/commands/container/container-remove.js +10 -16
  78. package/dist/m365/spe/commands/containertype/containertype-add.js +15 -20
  79. package/dist/m365/spe/commands/containertype/containertype-get.js +6 -13
  80. package/dist/m365/spe/commands/containertype/containertype-remove.js +7 -14
  81. package/dist/m365/spe/commands.js +1 -0
  82. package/dist/m365/spfx/commands/project/project-doctor/doctor-1.22.2.js +21 -0
  83. package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
  84. package/dist/m365/spfx/commands/project/project-upgrade/rules/DependencyRule.js +56 -14
  85. package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.22.2.js +55 -0
  86. package/dist/m365/spfx/commands/project/project-upgrade.js +7 -8
  87. package/dist/m365/spfx/commands/spfx-doctor.js +23 -8
  88. package/dist/m365/spo/commands/file/file-add.js +49 -11
  89. package/dist/m365/spo/commands/file/file-version-keep.js +10 -14
  90. package/dist/m365/spo/commands/homesite/homesite-add.js +13 -15
  91. package/dist/m365/spo/commands/homesite/homesite-get.js +8 -9
  92. package/dist/m365/spo/commands/homesite/homesite-remove.js +9 -10
  93. package/dist/m365/spo/commands/homesite/homesite-set.js +13 -14
  94. package/dist/m365/spo/commands/list/DefaultColumnValue.js +2 -0
  95. package/dist/m365/spo/commands/list/list-defaultvalue-clear.js +13 -17
  96. package/dist/m365/spo/commands/list/list-defaultvalue-get.js +124 -0
  97. package/dist/m365/spo/commands/list/list-defaultvalue-list.js +13 -37
  98. package/dist/m365/spo/commands/list/list-defaultvalue-remove.js +12 -16
  99. package/dist/m365/spo/commands/list/list-defaultvalue-set.js +11 -15
  100. package/dist/m365/spo/commands/list/list-view-add.js +16 -20
  101. package/dist/m365/spo/commands/listitem/listitem-set.js +1 -1
  102. package/dist/m365/spo/commands/page/page-control-remove.js +11 -15
  103. package/dist/m365/spo/commands/page/page-get.js +10 -11
  104. package/dist/m365/spo/commands/page/page-header-set.js +97 -89
  105. package/dist/m365/spo/commands/page/page-publish.js +9 -10
  106. package/dist/m365/spo/commands/page/page-section-remove.js +11 -12
  107. package/dist/m365/spo/commands/page/page-set.js +26 -26
  108. package/dist/m365/spo/commands/site/site-appcatalog-list.js +4 -6
  109. package/dist/m365/spo/commands/site/site-get.js +6 -8
  110. package/dist/m365/spo/commands/site/site-sharingpermission-set.js +7 -9
  111. package/dist/m365/spo/commands/site/site-versionpolicy-get.js +11 -13
  112. package/dist/m365/spo/commands/web/web-alert-list.js +20 -27
  113. package/dist/m365/spo/commands/web/web-alert-remove.js +15 -20
  114. package/dist/m365/spo/commands.js +1 -0
  115. package/dist/m365/spp/commands/autofillcolumn/autofillcolumn-set.js +166 -0
  116. package/dist/m365/spp/commands/model/model-apply.js +18 -24
  117. package/dist/m365/spp/commands.js +1 -0
  118. package/dist/m365/teams/commands/callrecord/callrecord-list.js +5 -9
  119. package/dist/m365/teams/commands/chat/chat-message-list.js +26 -27
  120. package/dist/m365/teams/commands/chat/chat-message-send.js +12 -3
  121. package/dist/m365/teams/commands/chat/chatUtil.js +1 -1
  122. package/dist/m365/tenant/commands/people/people-pronouns-set.js +4 -6
  123. package/dist/m365/tenant/commands/report/report-settings-set.js +4 -6
  124. package/dist/m365/viva/commands/engage/engage-community-user-add.js +17 -22
  125. package/dist/m365/viva/commands/engage/engage-community-user-list.js +8 -14
  126. package/dist/m365/viva/commands/engage/engage-community-user-remove.js +14 -22
  127. package/dist/m365/viva/commands/engage/engage-role-member-list.js +6 -11
  128. package/dist/utils/spo.js +30 -2
  129. package/dist/utils/zod.js +41 -76
  130. package/docs/docs/cmd/entra/app/app-permission-add.mdx +19 -0
  131. package/docs/docs/cmd/entra/app/app-permission-list.mdx +19 -0
  132. package/docs/docs/cmd/entra/app/app-permission-remove.mdx +21 -0
  133. package/docs/docs/cmd/spe/container/container-recyclebinitem-remove.mdx +79 -0
  134. package/docs/docs/cmd/spfx/project/project-upgrade.mdx +1 -1
  135. package/docs/docs/cmd/spo/file/file-add.mdx +140 -1
  136. package/docs/docs/cmd/spo/list/list-defaultvalue-get.mdx +118 -0
  137. package/docs/docs/cmd/spo/page/page-header-set.mdx +28 -8
  138. package/docs/docs/cmd/spo/page/page-set.mdx +35 -5
  139. package/docs/docs/cmd/spp/autofillcolumn/autofillcolumn-set.mdx +104 -0
  140. package/docs/docs/cmd/teams/chat/chat-message-list.mdx +34 -7
  141. package/docs/docs/cmd/teams/chat/chat-message-send.mdx +23 -1
  142. package/eslint.config.mjs +1 -0
  143. package/npm-shrinkwrap.json +721 -1647
  144. package/package.json +28 -20
@@ -1,23 +1,16 @@
1
- import { validation } from '../../../../utils/validation.js';
2
1
  import commands from '../../commands.js';
3
2
  import { globalOptionsZod } from '../../../../Command.js';
4
3
  import { z } from 'zod';
5
- import { zod } from '../../../../utils/zod.js';
6
4
  import GraphDelegatedCommand from '../../../base/GraphDelegatedCommand.js';
7
5
  import { formatting } from '../../../../utils/formatting.js';
8
6
  import request from '../../../../request.js';
9
7
  import { odata } from '../../../../utils/odata.js';
10
8
  import { cli } from '../../../../cli/cli.js';
11
- const options = globalOptionsZod
12
- .extend({
13
- id: zod.alias('i', z.string()
14
- .refine(id => validation.isValidGuid(id), id => ({
15
- message: `'${id}' is not a valid GUID.`
16
- }))
17
- .optional()),
18
- name: zod.alias('n', z.string().optional())
19
- })
20
- .strict();
9
+ export const options = z.strictObject({
10
+ ...globalOptionsZod.shape,
11
+ id: z.uuid().optional().alias('i'),
12
+ name: z.string().optional().alias('n')
13
+ });
21
14
  class SpeContainerTypeGetCommand extends GraphDelegatedCommand {
22
15
  get name() {
23
16
  return commands.CONTAINERTYPE_GET;
@@ -31,7 +24,7 @@ class SpeContainerTypeGetCommand extends GraphDelegatedCommand {
31
24
  getRefinedSchema(schema) {
32
25
  return schema
33
26
  .refine(options => [options.id, options.name].filter(o => o !== undefined).length === 1, {
34
- message: 'Use one of the following options: id or name.'
27
+ error: 'Use one of the following options: id or name.'
35
28
  });
36
29
  }
37
30
  async commandAction(logger, args) {
@@ -1,25 +1,18 @@
1
1
  import { globalOptionsZod } from '../../../../Command.js';
2
2
  import { z } from 'zod';
3
- import { zod } from '../../../../utils/zod.js';
4
3
  import SpoCommand from '../../../base/SpoCommand.js';
5
4
  import commands from '../../commands.js';
6
5
  import { spo } from '../../../../utils/spo.js';
7
6
  import { cli } from '../../../../cli/cli.js';
8
- import { validation } from '../../../../utils/validation.js';
9
7
  import request from '../../../../request.js';
10
8
  import config from '../../../../config.js';
11
9
  import { formatting } from '../../../../utils/formatting.js';
12
- const options = globalOptionsZod
13
- .extend({
14
- id: zod.alias('i', z.string()
15
- .refine(id => validation.isValidGuid(id), id => ({
16
- message: `'${id}' is not a valid GUID.`
17
- }))
18
- .optional()),
19
- name: zod.alias('n', z.string().optional()),
20
- force: zod.alias('f', z.boolean().optional())
21
- })
22
- .strict();
10
+ export const options = z.strictObject({
11
+ ...globalOptionsZod.shape,
12
+ id: z.uuid().optional().alias('i'),
13
+ name: z.string().optional().alias('n'),
14
+ force: z.boolean().optional().alias('f')
15
+ });
23
16
  class SpeContainerTypeRemoveCommand extends SpoCommand {
24
17
  get name() {
25
18
  return commands.CONTAINERTYPE_REMOVE;
@@ -33,7 +26,7 @@ class SpeContainerTypeRemoveCommand extends SpoCommand {
33
26
  getRefinedSchema(schema) {
34
27
  return schema
35
28
  .refine(options => [options.id, options.name].filter(o => o !== undefined).length === 1, {
36
- message: 'Use one of the following options: id, name.'
29
+ error: 'Use one of the following options: id, name.'
37
30
  });
38
31
  }
39
32
  async commandAction(logger, args) {
@@ -7,6 +7,7 @@ export default {
7
7
  CONTAINER_REMOVE: `${prefix} container remove`,
8
8
  CONTAINER_PERMISSION_LIST: `${prefix} container permission list`,
9
9
  CONTAINER_RECYCLEBINITEM_LIST: `${prefix} container recyclebinitem list`,
10
+ CONTAINER_RECYCLEBINITEM_REMOVE: `${prefix} container recyclebinitem remove`,
10
11
  CONTAINER_RECYCLEBINITEM_RESTORE: `${prefix} container recyclebinitem restore`,
11
12
  CONTAINERTYPE_ADD: `${prefix} containertype add`,
12
13
  CONTAINERTYPE_GET: `${prefix} containertype get`,
@@ -0,0 +1,21 @@
1
+ import { FN002021_DEVDEP_rushstack_eslint_config } from '../project-upgrade/rules/FN002021_DEVDEP_rushstack_eslint_config.js';
2
+ import { FN001008_DEP_react } from './rules/FN001008_DEP_react.js';
3
+ import { FN001009_DEP_react_dom } from './rules/FN001009_DEP_react_dom.js';
4
+ import { FN001035_DEP_fluentui_react } from './rules/FN001035_DEP_fluentui_react.js';
5
+ import { FN002013_DEVDEP_types_webpack_env } from './rules/FN002013_DEVDEP_types_webpack_env.js';
6
+ import { FN002015_DEVDEP_types_react } from './rules/FN002015_DEVDEP_types_react.js';
7
+ import { FN002016_DEVDEP_types_react_dom } from './rules/FN002016_DEVDEP_types_react_dom.js';
8
+ import { FN002022_DEVDEP_typescript } from './rules/FN002022_DEVDEP_typescript.js';
9
+ import { FN021001_PKG_spfx_deps_versions_match_project_version } from './rules/FN021001_PKG_spfx_deps_versions_match_project_version.js';
10
+ export default [
11
+ new FN001008_DEP_react('17'),
12
+ new FN001009_DEP_react_dom('17'),
13
+ new FN001035_DEP_fluentui_react('^8.106.4'),
14
+ new FN002013_DEVDEP_types_webpack_env('~1.15.2'),
15
+ new FN002015_DEVDEP_types_react('17'),
16
+ new FN002016_DEVDEP_types_react_dom('17'),
17
+ new FN002021_DEVDEP_rushstack_eslint_config('4.5.2'),
18
+ new FN002022_DEVDEP_typescript('~5.8.0'),
19
+ new FN021001_PKG_spfx_deps_versions_match_project_version(true)
20
+ ];
21
+ //# sourceMappingURL=doctor-1.22.2.js.map
@@ -75,7 +75,8 @@ class SpfxProjectDoctorCommand extends BaseProjectCommand {
75
75
  '1.21.0',
76
76
  '1.21.1',
77
77
  '1.22.0',
78
- '1.22.1'
78
+ '1.22.1',
79
+ '1.22.2'
79
80
  ];
80
81
  __classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initTelemetry).call(this);
81
82
  __classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initOptions).call(this);
@@ -1,8 +1,15 @@
1
- import { lt, valid, validRange } from 'semver';
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 _DependencyRule_instances, _DependencyRule_needsUpdate, _DependencyRule_getMaxVersion;
7
+ import semver from 'semver';
2
8
  import { JsonRule } from '../../JsonRule.js';
3
9
  export class DependencyRule extends JsonRule {
4
10
  constructor(packageName, packageVersion, isDevDep = false, isOptional = false, add = true) {
5
11
  super();
12
+ _DependencyRule_instances.add(this);
6
13
  this.packageName = packageName;
7
14
  this.packageVersion = packageVersion;
8
15
  this.isDevDep = isDevDep;
@@ -39,23 +46,13 @@ export class DependencyRule extends JsonRule {
39
46
  }
40
47
  const projectDependencies = this.isDevDep ? project.packageJson.devDependencies : project.packageJson.dependencies;
41
48
  const versionEntry = projectDependencies ? projectDependencies[this.packageName] : '';
42
- const packageVersion = valid(versionEntry);
43
- const versionRange = validRange(versionEntry);
44
49
  if (this.add) {
45
50
  let jsonProperty = this.isDevDep ? 'devDependencies' : 'dependencies';
46
51
  if (versionEntry) {
47
52
  jsonProperty += `.${this.packageName}`;
48
- if (packageVersion) {
49
- if (lt(packageVersion, this.packageVersion)) {
50
- const node = this.getAstNodeFromFile(project.packageJson, jsonProperty);
51
- this.addFindingWithPosition(findings, node);
52
- }
53
- }
54
- else {
55
- if (versionRange) {
56
- const node = this.getAstNodeFromFile(project.packageJson, jsonProperty);
57
- this.addFindingWithPosition(findings, node);
58
- }
53
+ if (__classPrivateFieldGet(this, _DependencyRule_instances, "m", _DependencyRule_needsUpdate).call(this, this.packageVersion, versionEntry)) {
54
+ const node = this.getAstNodeFromFile(project.packageJson, jsonProperty);
55
+ this.addFindingWithPosition(findings, node);
59
56
  }
60
57
  }
61
58
  else {
@@ -78,4 +75,49 @@ export class DependencyRule extends JsonRule {
78
75
  }
79
76
  }
80
77
  }
78
+ _DependencyRule_instances = new WeakSet(), _DependencyRule_needsUpdate = function _DependencyRule_needsUpdate(ruleVersion, currentVersion) {
79
+ try {
80
+ // Get minimum versions for both
81
+ const ruleMin = semver.minVersion(ruleVersion);
82
+ const currentMin = semver.minVersion(currentVersion);
83
+ // Check if ranges overlap
84
+ const rangesOverlap = semver.intersects(ruleVersion, currentVersion);
85
+ if (rangesOverlap) {
86
+ // Even if they overlap, update if rule requires a higher minimum version
87
+ if (ruleMin && currentMin && semver.gt(ruleMin, currentMin)) {
88
+ return true;
89
+ }
90
+ return false;
91
+ }
92
+ // Ranges don't overlap - check if rule range is greater
93
+ // Get the maximum version that satisfies the current range
94
+ const currentMax = __classPrivateFieldGet(this, _DependencyRule_instances, "m", _DependencyRule_getMaxVersion).call(this, currentVersion);
95
+ // If rule's minimum is greater than current's maximum, update is needed
96
+ return !!(ruleMin && currentMax && semver.gt(ruleMin, currentMax));
97
+ }
98
+ catch {
99
+ return false;
100
+ }
101
+ }, _DependencyRule_getMaxVersion = function _DependencyRule_getMaxVersion(range) {
102
+ const rangeObj = new semver.Range(range);
103
+ // If it's a specific version (no range operators), return it
104
+ if (semver.valid(range)) {
105
+ return semver.parse(range);
106
+ }
107
+ // For ranges, get the highest version from the set
108
+ // Check the range set to find upper bounds
109
+ let maxVer = null;
110
+ for (const comparatorSet of rangeObj.set) {
111
+ for (const comparator of comparatorSet) {
112
+ if (comparator.operator === '<' || comparator.operator === '<=') {
113
+ const ver = comparator.semver;
114
+ if (!maxVer || semver.gt(ver, maxVer)) {
115
+ maxVer = ver;
116
+ }
117
+ }
118
+ }
119
+ }
120
+ // If no upper bound found, use minVersion as fallback
121
+ return maxVer || semver.minVersion(range);
122
+ };
81
123
  //# sourceMappingURL=DependencyRule.js.map
@@ -0,0 +1,55 @@
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 { FN001011_DEP_microsoft_sp_dialog } from './rules/FN001011_DEP_microsoft_sp_dialog.js';
6
+ import { FN001012_DEP_microsoft_sp_application_base } from './rules/FN001012_DEP_microsoft_sp_application_base.js';
7
+ import { FN001013_DEP_microsoft_decorators } from './rules/FN001013_DEP_microsoft_decorators.js';
8
+ import { FN001014_DEP_microsoft_sp_listview_extensibility } from './rules/FN001014_DEP_microsoft_sp_listview_extensibility.js';
9
+ import { FN001021_DEP_microsoft_sp_property_pane } from './rules/FN001021_DEP_microsoft_sp_property_pane.js';
10
+ import { FN001023_DEP_microsoft_sp_component_base } from './rules/FN001023_DEP_microsoft_sp_component_base.js';
11
+ import { FN001024_DEP_microsoft_sp_diagnostics } from './rules/FN001024_DEP_microsoft_sp_diagnostics.js';
12
+ import { FN001025_DEP_microsoft_sp_dynamic_data } from './rules/FN001025_DEP_microsoft_sp_dynamic_data.js';
13
+ import { FN001026_DEP_microsoft_sp_extension_base } from './rules/FN001026_DEP_microsoft_sp_extension_base.js';
14
+ import { FN001027_DEP_microsoft_sp_http } from './rules/FN001027_DEP_microsoft_sp_http.js';
15
+ import { FN001028_DEP_microsoft_sp_list_subscription } from './rules/FN001028_DEP_microsoft_sp_list_subscription.js';
16
+ import { FN001029_DEP_microsoft_sp_loader } from './rules/FN001029_DEP_microsoft_sp_loader.js';
17
+ import { FN001030_DEP_microsoft_sp_module_interfaces } from './rules/FN001030_DEP_microsoft_sp_module_interfaces.js';
18
+ import { FN001031_DEP_microsoft_sp_odata_types } from './rules/FN001031_DEP_microsoft_sp_odata_types.js';
19
+ import { FN001032_DEP_microsoft_sp_page_context } from './rules/FN001032_DEP_microsoft_sp_page_context.js';
20
+ import { FN001034_DEP_microsoft_sp_adaptive_card_extension_base } from './rules/FN001034_DEP_microsoft_sp_adaptive_card_extension_base.js';
21
+ import { FN002002_DEVDEP_microsoft_sp_module_interfaces } from './rules/FN002002_DEVDEP_microsoft_sp_module_interfaces.js';
22
+ import { FN002022_DEVDEP_microsoft_eslint_plugin_spfx } from './rules/FN002022_DEVDEP_microsoft_eslint_plugin_spfx.js';
23
+ import { FN002023_DEVDEP_microsoft_eslint_config_spfx } from './rules/FN002023_DEVDEP_microsoft_eslint_config_spfx.js';
24
+ import { FN002030_DEVDEP_microsoft_spfx_web_build_rig } from './rules/FN002030_DEVDEP_microsoft_spfx_web_build_rig.js';
25
+ import { FN002034_DEVDEP_microsoft_spfx_heft_plugins } from './rules/FN002034_DEVDEP_microsoft_spfx_heft_plugins.js';
26
+ import { FN010001_YORC_version } from './rules/FN010001_YORC_version.js';
27
+ export default [
28
+ new FN001001_DEP_microsoft_sp_core_library('1.22.2'),
29
+ new FN001002_DEP_microsoft_sp_lodash_subset('1.22.2'),
30
+ new FN001003_DEP_microsoft_sp_office_ui_fabric_core('1.22.2'),
31
+ new FN001004_DEP_microsoft_sp_webpart_base('1.22.2'),
32
+ new FN001011_DEP_microsoft_sp_dialog('1.22.2'),
33
+ new FN001012_DEP_microsoft_sp_application_base('1.22.2'),
34
+ new FN001014_DEP_microsoft_sp_listview_extensibility('1.22.2'),
35
+ new FN001021_DEP_microsoft_sp_property_pane('1.22.2'),
36
+ new FN001023_DEP_microsoft_sp_component_base('1.22.2'),
37
+ new FN001024_DEP_microsoft_sp_diagnostics('1.22.2'),
38
+ new FN001025_DEP_microsoft_sp_dynamic_data('1.22.2'),
39
+ new FN001026_DEP_microsoft_sp_extension_base('1.22.2'),
40
+ new FN001027_DEP_microsoft_sp_http('1.22.2'),
41
+ new FN001028_DEP_microsoft_sp_list_subscription('1.22.2'),
42
+ new FN001029_DEP_microsoft_sp_loader('1.22.2'),
43
+ new FN001030_DEP_microsoft_sp_module_interfaces('1.22.2'),
44
+ new FN001031_DEP_microsoft_sp_odata_types('1.22.2'),
45
+ new FN001032_DEP_microsoft_sp_page_context('1.22.2'),
46
+ new FN001013_DEP_microsoft_decorators('1.22.2'),
47
+ new FN001034_DEP_microsoft_sp_adaptive_card_extension_base('1.22.2'),
48
+ new FN002002_DEVDEP_microsoft_sp_module_interfaces('1.22.2'),
49
+ new FN002022_DEVDEP_microsoft_eslint_plugin_spfx('1.22.2'),
50
+ new FN002023_DEVDEP_microsoft_eslint_config_spfx('1.22.2'),
51
+ new FN002030_DEVDEP_microsoft_spfx_web_build_rig('1.22.2'),
52
+ new FN002034_DEVDEP_microsoft_spfx_heft_plugins('1.22.2'),
53
+ new FN010001_YORC_version('1.22.2')
54
+ ];
55
+ //# sourceMappingURL=upgrade-1.22.2.js.map
@@ -7,19 +7,17 @@ import { z } from 'zod';
7
7
  import { CommandError, globalOptionsZod } from '../../../../Command.js';
8
8
  import { fsUtil } from '../../../../utils/fsUtil.js';
9
9
  import { packageManager } from '../../../../utils/packageManager.js';
10
- import { zod } from '../../../../utils/zod.js';
11
10
  import commands from '../../commands.js';
12
11
  import { BaseProjectCommand } from './base-project-command.js';
13
12
  import { FN017001_MISC_npm_dedupe } from './project-upgrade/rules/FN017001_MISC_npm_dedupe.js';
14
- const options = globalOptionsZod
15
- .extend({
13
+ export const options = z.strictObject({
14
+ ...globalOptionsZod.shape,
16
15
  packageManager: z.enum(['npm', 'pnpm', 'yarn']).default('npm'),
17
16
  preview: z.boolean().optional(),
18
- toVersion: zod.alias('v', z.string().optional()),
17
+ toVersion: z.string().optional().alias('v'),
19
18
  shell: z.enum(['bash', 'powershell', 'cmd']).default('powershell'),
20
- output: z.enum(['json', 'text', 'md', 'tour', 'csv', 'none']).optional()
21
- })
22
- .strict();
19
+ output: z.enum(['json', 'text', 'md', 'tour', 'csv', 'none']).alias('o').optional()
20
+ });
23
21
  class SpfxProjectUpgradeCommand extends BaseProjectCommand {
24
22
  get name() {
25
23
  return commands.PROJECT_UPGRADE;
@@ -86,7 +84,8 @@ class SpfxProjectUpgradeCommand extends BaseProjectCommand {
86
84
  '1.21.0',
87
85
  '1.21.1',
88
86
  '1.22.0',
89
- '1.22.1'
87
+ '1.22.1',
88
+ '1.22.2'
90
89
  ];
91
90
  }
92
91
  async commandAction(logger, args) {
@@ -597,8 +597,8 @@ class SpfxDoctorCommand extends BaseProjectCommand {
597
597
  fix: 'npm i -g gulp-cli@3'
598
598
  },
599
599
  node: {
600
- range: '>=22.14.0 < 23.0.0',
601
- fix: 'Install Node.js >=22.14.0 < 23.0.0'
600
+ range: '>=22.14.0 <23.0.0',
601
+ fix: 'Install Node.js >=22.14.0 <23.0.0'
602
602
  },
603
603
  sp: SharePointVersion.SPO,
604
604
  yo: {
@@ -612,8 +612,8 @@ class SpfxDoctorCommand extends BaseProjectCommand {
612
612
  fix: 'npm i -g gulp-cli@3'
613
613
  },
614
614
  node: {
615
- range: '>=22.14.0 < 23.0.0',
616
- fix: 'Install Node.js >=22.14.0 < 23.0.0'
615
+ range: '>=22.14.0 <23.0.0',
616
+ fix: 'Install Node.js >=22.14.0 <23.0.0'
617
617
  },
618
618
  sp: SharePointVersion.SPO,
619
619
  yo: {
@@ -627,8 +627,8 @@ class SpfxDoctorCommand extends BaseProjectCommand {
627
627
  fix: 'npm i -g @rushstack/heft@1'
628
628
  },
629
629
  node: {
630
- range: '>=22.14.0 < 23.0.0',
631
- fix: 'Install Node.js >=22.14.0 < 23.0.0'
630
+ range: '>=22.14.0 <23.0.0',
631
+ fix: 'Install Node.js >=22.14.0 <23.0.0'
632
632
  },
633
633
  sp: SharePointVersion.SPO,
634
634
  yo: {
@@ -642,8 +642,23 @@ class SpfxDoctorCommand extends BaseProjectCommand {
642
642
  fix: 'npm i -g @rushstack/heft@1'
643
643
  },
644
644
  node: {
645
- range: '>=22.14.0 < 23.0.0',
646
- fix: 'Install Node.js >=22.14.0 < 23.0.0'
645
+ range: '>=22.14.0 <23.0.0',
646
+ fix: 'Install Node.js >=22.14.0 <23.0.0'
647
+ },
648
+ sp: SharePointVersion.SPO,
649
+ yo: {
650
+ range: '^4 || ^5 || ^6',
651
+ fix: 'npm i -g yo@6'
652
+ }
653
+ },
654
+ '1.22.2': {
655
+ heft: {
656
+ range: '^1',
657
+ fix: 'npm i -g @rushstack/heft@1'
658
+ },
659
+ node: {
660
+ range: '>=22.14.0 <23.0.0',
661
+ fix: 'Install Node.js >=22.14.0 <23.0.0'
647
662
  },
648
663
  sp: SharePointVersion.SPO,
649
664
  yo: {
@@ -39,14 +39,38 @@ class SpoFileAddCommand extends SpoCommand {
39
39
  async commandAction(logger, args) {
40
40
  const folderPath = urlUtil.getServerRelativePath(args.options.webUrl, args.options.folder);
41
41
  const fullPath = path.resolve(args.options.path);
42
- const fileName = fsUtil.getSafeFileName(path.basename(fullPath));
42
+ const fileName = fsUtil.getSafeFileName(args.options.fileName ?? path.basename(fullPath));
43
43
  let isCheckedOut = false;
44
44
  let listSettings;
45
45
  if (this.verbose) {
46
46
  await logger.logToStderr(`file name: ${fileName}...`);
47
47
  await logger.logToStderr(`folder path: ${folderPath}...`);
48
48
  }
49
+ if (args.options.overwrite === undefined) {
50
+ await this.warn(logger, 'In the next major version, the --overwrite option will default to false. To avoid this warning, please set the --overwrite option explicitly to true or false.');
51
+ }
49
52
  try {
53
+ if (args.options.overwrite === false) {
54
+ try {
55
+ const requestOptions = {
56
+ url: `${args.options.webUrl}/_api/Web/GetFileByServerRelativePath(DecodedUrl='${formatting.encodeQueryParameter(folderPath + '/' + fileName)}')?$select=Exists`,
57
+ headers: {
58
+ accept: 'application/json;odata=nometadata'
59
+ },
60
+ responseType: 'json'
61
+ };
62
+ await request.get(requestOptions);
63
+ throw `File '${fileName}' already exists in folder '${folderPath}'. To overwrite the file, use the --overwrite option.`;
64
+ }
65
+ catch (err) {
66
+ if (typeof err === 'string') {
67
+ throw err;
68
+ }
69
+ if (this.verbose) {
70
+ await logger.logToStderr(`File '${fileName}' does not exist in folder '${folderPath}'. Proceeding with upload.`);
71
+ }
72
+ }
73
+ }
50
74
  try {
51
75
  if (this.verbose) {
52
76
  await logger.logToStderr('Check if the specified folder exists.');
@@ -78,6 +102,7 @@ class SpoFileAddCommand extends SpoCommand {
78
102
  if (this.verbose) {
79
103
  await logger.logToStderr(`File size is ${fileSize} bytes`);
80
104
  }
105
+ let fileUploadResult;
81
106
  // only up to 250 MB are allowed in a single request
82
107
  if (fileSize > this.fileChunkingThreshold) {
83
108
  const fileChunkCount = Math.ceil(fileSize / this.fileChunkSize);
@@ -106,7 +131,7 @@ class SpoFileAddCommand extends SpoCommand {
106
131
  Size: fileSize
107
132
  };
108
133
  try {
109
- await this.uploadFileChunks(fileUploadInfo, logger);
134
+ fileUploadResult = await this.uploadFileChunks(fileUploadInfo, logger);
110
135
  if (this.verbose) {
111
136
  await logger.logToStderr(`Finished uploading ${fileUploadInfo.Position} bytes in ${fileChunkCount} chunks`);
112
137
  }
@@ -127,7 +152,7 @@ class SpoFileAddCommand extends SpoCommand {
127
152
  throw err;
128
153
  }
129
154
  catch (err) {
130
- if (this.debug) {
155
+ if (this.verbose) {
131
156
  await logger.logToStderr(`Failed to cancel upload session: ${err}`);
132
157
  }
133
158
  throw err;
@@ -145,9 +170,10 @@ class SpoFileAddCommand extends SpoCommand {
145
170
  accept: 'application/json;odata=nometadata',
146
171
  'content-length': bodyLength
147
172
  },
148
- maxBodyLength: this.fileChunkingThreshold
173
+ maxBodyLength: this.fileChunkingThreshold,
174
+ responseType: 'json'
149
175
  };
150
- await request.post(requestOptions);
176
+ fileUploadResult = await request.post(requestOptions);
151
177
  }
152
178
  if (args.options.contentType || args.options.publish || args.options.approve) {
153
179
  listSettings = await this.getFileParentList(fileName, args.options.webUrl, folderPath, logger);
@@ -206,6 +232,7 @@ class SpoFileAddCommand extends SpoCommand {
206
232
  };
207
233
  await request.post(requestOptions);
208
234
  }
235
+ await logger.log(fileUploadResult);
209
236
  }
210
237
  catch (err) {
211
238
  if (isCheckedOut) {
@@ -292,15 +319,16 @@ class SpoFileAddCommand extends SpoCommand {
292
319
  accept: 'application/json;odata=nometadata',
293
320
  'content-length': readCount
294
321
  },
295
- maxBodyLength: this.fileChunkingThreshold
322
+ maxBodyLength: this.fileChunkingThreshold,
323
+ responseType: 'json'
296
324
  };
297
325
  try {
298
- await request.post(requestOptions);
326
+ const uploadResponse = await request.post(requestOptions);
299
327
  if (this.verbose) {
300
328
  await logger.logToStderr(`Uploaded ${info.Position} of ${info.Size} bytes (${Math.round(100 * info.Position / info.Size)}%)`);
301
329
  }
302
330
  if (isLastChunk) {
303
- return;
331
+ return uploadResponse;
304
332
  }
305
333
  else {
306
334
  return this.uploadFileChunks(info, logger);
@@ -407,9 +435,12 @@ class SpoFileAddCommand extends SpoCommand {
407
435
  'approveComment',
408
436
  'publish',
409
437
  'publishComment',
438
+ 'overwrite',
439
+ 'fileName',
410
440
  'debug',
411
441
  'verbose',
412
442
  'output',
443
+ 'query',
413
444
  '_',
414
445
  'u',
415
446
  'p',
@@ -434,7 +465,9 @@ _SpoFileAddCommand_instances = new WeakSet(), _SpoFileAddCommand_initTelemetry =
434
465
  approve: !!args.options.approve,
435
466
  approveComment: typeof args.options.approveComment !== 'undefined',
436
467
  publish: !!args.options.publish,
437
- publishComment: typeof args.options.publishComment !== 'undefined'
468
+ publishComment: typeof args.options.publishComment !== 'undefined',
469
+ overwrite: !!args.options.overwrite,
470
+ fileName: typeof args.options.fileName !== 'undefined'
438
471
  });
439
472
  });
440
473
  }, _SpoFileAddCommand_initOptions = function _SpoFileAddCommand_initOptions() {
@@ -458,6 +491,11 @@ _SpoFileAddCommand_instances = new WeakSet(), _SpoFileAddCommand_initTelemetry =
458
491
  option: '--publish'
459
492
  }, {
460
493
  option: '--publishComment [publishComment]'
494
+ }, {
495
+ option: '--overwrite [overwrite]',
496
+ autocomplete: ['true', 'false']
497
+ }, {
498
+ option: '--fileName [fileName]'
461
499
  });
462
500
  }, _SpoFileAddCommand_initValidators = function _SpoFileAddCommand_initValidators() {
463
501
  this.validators.push(async (args) => {
@@ -477,8 +515,8 @@ _SpoFileAddCommand_instances = new WeakSet(), _SpoFileAddCommand_initTelemetry =
477
515
  return true;
478
516
  });
479
517
  }, _SpoFileAddCommand_initTypes = function _SpoFileAddCommand_initTypes() {
480
- this.types.string.push('webUrl', 'folder', 'path', 'contentType', 'checkInComment', 'approveComment', 'publishComment');
481
- this.types.boolean.push('checkOut', 'approve', 'publish');
518
+ this.types.string.push('webUrl', 'folder', 'path', 'contentType', 'checkInComment', 'approveComment', 'publishComment', 'fileName');
519
+ this.types.boolean.push('checkOut', 'approve', 'publish', 'overwrite');
482
520
  };
483
521
  export default new SpoFileAddCommand();
484
522
  //# sourceMappingURL=file-add.js.map
@@ -2,26 +2,22 @@ import commands from '../../commands.js';
2
2
  import SpoCommand from '../../../base/SpoCommand.js';
3
3
  import { globalOptionsZod } from '../../../../Command.js';
4
4
  import { z } from 'zod';
5
- import { zod } from '../../../../utils/zod.js';
6
5
  import { validation } from '../../../../utils/validation.js';
7
6
  import { urlUtil } from '../../../../utils/urlUtil.js';
8
7
  import request from '../../../../request.js';
9
8
  import { formatting } from '../../../../utils/formatting.js';
10
9
  import { odata } from '../../../../utils/odata.js';
11
- export const options = globalOptionsZod
12
- .extend({
13
- webUrl: zod.alias('u', z.string()
14
- .refine(url => validation.isValidSharePointUrl(url) === true, url => ({
15
- message: `'${url}' is not a valid SharePoint Online site URL.`
16
- }))),
10
+ export const options = z.strictObject({
11
+ ...globalOptionsZod.shape,
12
+ webUrl: z.string()
13
+ .refine(url => validation.isValidSharePointUrl(url) === true, {
14
+ error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
15
+ })
16
+ .alias('u'),
17
17
  fileUrl: z.string().optional(),
18
- fileId: zod.alias('i', z.string()
19
- .refine(id => validation.isValidGuid(id), id => ({
20
- message: `'${id}' is not a valid GUID.`
21
- })).optional()),
18
+ fileId: z.uuid().optional().alias('i'),
22
19
  label: z.string()
23
- })
24
- .strict();
20
+ });
25
21
  class SpoFileVersionKeepCommand extends SpoCommand {
26
22
  get name() {
27
23
  return commands.FILE_VERSION_KEEP;
@@ -35,7 +31,7 @@ class SpoFileVersionKeepCommand extends SpoCommand {
35
31
  getRefinedSchema(schema) {
36
32
  return schema
37
33
  .refine(options => [options.fileUrl, options.fileId].filter(o => o !== undefined).length === 1, {
38
- message: `Specify 'fileUrl' or 'fileId', but not both.`
34
+ error: `Specify 'fileUrl' or 'fileId', but not both.`
39
35
  });
40
36
  }
41
37
  async commandAction(logger, args) {
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
- import { zod } from '../../../../utils/zod.js';
3
2
  import { globalOptionsZod } from '../../../../Command.js';
4
3
  import { spo } from '../../../../utils/spo.js';
5
4
  import { validation } from '../../../../utils/validation.js';
@@ -7,25 +6,24 @@ import SpoCommand from '../../../base/SpoCommand.js';
7
6
  import commands from '../../commands.js';
8
7
  import request from '../../../../request.js';
9
8
  import { entraGroup } from '../../../../utils/entraGroup.js';
10
- const options = globalOptionsZod
11
- .extend({
12
- url: zod.alias('u', z.string()
13
- .refine((url) => validation.isValidSharePointUrl(url) === true, url => ({
14
- message: `'${url}' is not a valid SharePoint Online site URL.`
15
- }))),
9
+ export const options = z.strictObject({
10
+ ...globalOptionsZod.shape,
11
+ url: z.string()
12
+ .refine(url => validation.isValidSharePointUrl(url) === true, {
13
+ error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
14
+ }).alias('u'),
16
15
  audienceIds: z.string()
17
- .refine(audiences => validation.isValidGuidArray(audiences) === true, audiences => ({
18
- message: `The following GUIDs are invalid: ${validation.isValidGuidArray(audiences)}.`
19
- })).optional(),
16
+ .refine(audiences => validation.isValidGuidArray(audiences) === true, {
17
+ error: e => `The following GUIDs are invalid: ${e.input}.`
18
+ }).optional(),
20
19
  audienceNames: z.string().optional(),
21
20
  vivaConnectionsDefaultStart: z.boolean().optional(),
22
21
  isInDraftMode: z.boolean().optional(),
23
22
  order: z.number()
24
- .refine(order => validation.isValidPositiveInteger(order) === true, order => ({
25
- message: `'${order}' is not a positive integer.`
26
- })).optional()
27
- })
28
- .strict();
23
+ .refine(order => validation.isValidPositiveInteger(order) === true, {
24
+ error: e => `'${e.input}' is not a positive integer.`
25
+ }).optional()
26
+ });
29
27
  class SpoHomeSiteAddCommand extends SpoCommand {
30
28
  get name() {
31
29
  return commands.HOMESITE_ADD;
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
- import { zod } from '../../../../utils/zod.js';
3
2
  import { globalOptionsZod } from '../../../../Command.js';
4
3
  import { validation } from '../../../../utils/validation.js';
5
4
  import { spo } from '../../../../utils/spo.js';
@@ -7,14 +6,14 @@ import SpoCommand from '../../../base/SpoCommand.js';
7
6
  import commands from '../../commands.js';
8
7
  import { odata } from '../../../../utils/odata.js';
9
8
  import { urlUtil } from '../../../../utils/urlUtil.js';
10
- const options = globalOptionsZod
11
- .extend({
12
- url: zod.alias('u', z.string()
13
- .refine(url => validation.isValidSharePointUrl(url) === true, url => ({
14
- message: `'${url}' is not a valid SharePoint Online site URL.`
15
- })))
16
- })
17
- .strict();
9
+ export const options = z.strictObject({
10
+ ...globalOptionsZod.shape,
11
+ url: z.string()
12
+ .refine(url => validation.isValidSharePointUrl(url) === true, {
13
+ error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
14
+ })
15
+ .alias('u')
16
+ });
18
17
  class SpoHomeSiteGetCommand extends SpoCommand {
19
18
  get name() {
20
19
  return commands.HOMESITE_GET;