@pnp/cli-microsoft365 10.0.0-beta.66db729 → 10.0.0-beta.67e608f

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 (189) hide show
  1. package/allCommands.json +1 -1
  2. package/allCommandsFull.json +1 -1
  3. package/dist/m365/commands/login.js +122 -69
  4. package/dist/m365/commands/setup.js +1 -1
  5. package/dist/m365/entra/commands/administrativeunit/administrativeunit-add.js +0 -5
  6. package/dist/m365/entra/commands/administrativeunit/administrativeunit-get.js +0 -5
  7. package/dist/m365/entra/commands/administrativeunit/administrativeunit-list.js +0 -5
  8. package/dist/m365/entra/commands/administrativeunit/administrativeunit-member-add.js +0 -5
  9. package/dist/m365/entra/commands/administrativeunit/administrativeunit-member-get.js +0 -5
  10. package/dist/m365/entra/commands/administrativeunit/administrativeunit-member-list.js +0 -5
  11. package/dist/m365/entra/commands/administrativeunit/administrativeunit-remove.js +0 -5
  12. package/dist/m365/entra/commands/app/app-add.js +0 -5
  13. package/dist/m365/entra/commands/app/app-get.js +0 -5
  14. package/dist/m365/entra/commands/app/app-list.js +0 -5
  15. package/dist/m365/entra/commands/app/app-permission-add.js +0 -5
  16. package/dist/m365/entra/commands/app/app-remove.js +0 -5
  17. package/dist/m365/entra/commands/app/app-role-add.js +0 -5
  18. package/dist/m365/entra/commands/app/app-role-list.js +0 -5
  19. package/dist/m365/entra/commands/app/app-role-remove.js +0 -5
  20. package/dist/m365/entra/commands/app/app-set.js +0 -5
  21. package/dist/m365/entra/commands/approleassignment/approleassignment-add.js +0 -5
  22. package/dist/m365/entra/commands/approleassignment/approleassignment-list.js +0 -5
  23. package/dist/m365/entra/commands/approleassignment/approleassignment-remove.js +0 -5
  24. package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-add.js +0 -5
  25. package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-get.js +0 -5
  26. package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-list.js +0 -5
  27. package/dist/m365/entra/commands/group/group-add.js +0 -4
  28. package/dist/m365/entra/commands/group/group-get.js +0 -5
  29. package/dist/m365/entra/commands/group/group-list.js +0 -5
  30. package/dist/m365/entra/commands/group/group-member-list.js +0 -5
  31. package/dist/m365/entra/commands/group/group-remove.js +0 -5
  32. package/dist/m365/entra/commands/groupsetting/groupsetting-add.js +0 -5
  33. package/dist/m365/entra/commands/groupsetting/groupsetting-get.js +0 -5
  34. package/dist/m365/entra/commands/groupsetting/groupsetting-list.js +0 -5
  35. package/dist/m365/entra/commands/groupsetting/groupsetting-remove.js +0 -5
  36. package/dist/m365/entra/commands/groupsetting/groupsetting-set.js +0 -5
  37. package/dist/m365/entra/commands/groupsettingtemplate/groupsettingtemplate-get.js +0 -5
  38. package/dist/m365/entra/commands/groupsettingtemplate/groupsettingtemplate-list.js +0 -5
  39. package/dist/m365/entra/commands/license/license-list.js +0 -5
  40. package/dist/m365/entra/commands/m365group/m365group-add.js +0 -5
  41. package/dist/m365/entra/commands/m365group/m365group-conversation-list.js +0 -5
  42. package/dist/m365/entra/commands/m365group/m365group-conversation-post-list.js +0 -5
  43. package/dist/m365/entra/commands/m365group/m365group-get.js +0 -5
  44. package/dist/m365/entra/commands/m365group/m365group-list.js +0 -5
  45. package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-clear.js +0 -5
  46. package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-list.js +0 -5
  47. package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-remove.js +0 -5
  48. package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-restore.js +0 -5
  49. package/dist/m365/entra/commands/m365group/m365group-remove.js +0 -5
  50. package/dist/m365/entra/commands/m365group/m365group-renew.js +0 -5
  51. package/dist/m365/entra/commands/m365group/m365group-report-activitycounts.js +0 -4
  52. package/dist/m365/entra/commands/m365group/m365group-report-activitydetail.js +0 -4
  53. package/dist/m365/entra/commands/m365group/m365group-report-activityfilecounts.js +0 -4
  54. package/dist/m365/entra/commands/m365group/m365group-report-activitygroupcounts.js +0 -4
  55. package/dist/m365/entra/commands/m365group/m365group-report-activitystorage.js +0 -4
  56. package/dist/m365/entra/commands/m365group/m365group-set.js +138 -73
  57. package/dist/m365/entra/commands/m365group/m365group-teamify.js +0 -5
  58. package/dist/m365/entra/commands/m365group/m365group-user-add.js +0 -6
  59. package/dist/m365/entra/commands/m365group/m365group-user-list.js +0 -5
  60. package/dist/m365/entra/commands/m365group/m365group-user-remove.js +93 -62
  61. package/dist/m365/entra/commands/m365group/m365group-user-set.js +3 -15
  62. package/dist/m365/entra/commands/oauth2grant/oauth2grant-add.js +0 -5
  63. package/dist/m365/entra/commands/oauth2grant/oauth2grant-list.js +0 -5
  64. package/dist/m365/entra/commands/oauth2grant/oauth2grant-remove.js +0 -5
  65. package/dist/m365/entra/commands/oauth2grant/oauth2grant-set.js +0 -5
  66. package/dist/m365/entra/commands/policy/policy-list.js +0 -5
  67. package/dist/m365/entra/commands/siteclassification/siteclassification-disable.js +0 -5
  68. package/dist/m365/entra/commands/siteclassification/siteclassification-enable.js +0 -5
  69. package/dist/m365/entra/commands/siteclassification/siteclassification-get.js +0 -5
  70. package/dist/m365/entra/commands/siteclassification/siteclassification-set.js +0 -5
  71. package/dist/m365/entra/commands/user/user-add.js +0 -5
  72. package/dist/m365/entra/commands/user/user-get.js +0 -5
  73. package/dist/m365/entra/commands/user/user-guest-add.js +0 -5
  74. package/dist/m365/entra/commands/user/user-hibp.js +0 -5
  75. package/dist/m365/entra/commands/user/user-license-add.js +0 -5
  76. package/dist/m365/entra/commands/user/user-license-list.js +0 -5
  77. package/dist/m365/entra/commands/user/user-license-remove.js +0 -5
  78. package/dist/m365/entra/commands/user/user-list.js +0 -5
  79. package/dist/m365/entra/commands/user/user-password-validate.js +0 -5
  80. package/dist/m365/entra/commands/user/user-recyclebinitem-clear.js +0 -5
  81. package/dist/m365/entra/commands/user/user-recyclebinitem-list.js +0 -5
  82. package/dist/m365/entra/commands/user/user-recyclebinitem-remove.js +0 -5
  83. package/dist/m365/entra/commands/user/user-recyclebinitem-restore.js +0 -5
  84. package/dist/m365/entra/commands/user/user-registrationdetails-list.js +0 -4
  85. package/dist/m365/entra/commands/user/user-remove.js +0 -5
  86. package/dist/m365/entra/commands/user/user-set.js +0 -5
  87. package/dist/m365/entra/commands/user/user-signin-list.js +0 -5
  88. package/dist/m365/spo/commands/file/file-copy.js +6 -6
  89. package/dist/m365/spo/commands/file/file-move.js +6 -6
  90. package/dist/m365/spo/commands/folder/folder-move.js +43 -35
  91. package/dist/m365/spo/commands/group/group-member-add.js +3 -23
  92. package/dist/m365/spo/commands/group/group-member-remove.js +1 -18
  93. package/dist/m365/spo/commands/user/user-ensure.js +1 -11
  94. package/dist/utils/spo.js +62 -21
  95. package/dist/utils/timersUtil.js +2 -1
  96. package/dist/utils/zod.js +11 -2
  97. package/docs/docs/cmd/entra/administrativeunit/administrativeunit-add.mdx +0 -6
  98. package/docs/docs/cmd/entra/administrativeunit/administrativeunit-get.mdx +0 -6
  99. package/docs/docs/cmd/entra/administrativeunit/administrativeunit-list.mdx +0 -6
  100. package/docs/docs/cmd/entra/administrativeunit/administrativeunit-member-add.mdx +0 -6
  101. package/docs/docs/cmd/entra/administrativeunit/administrativeunit-member-get.mdx +0 -6
  102. package/docs/docs/cmd/entra/administrativeunit/administrativeunit-member-list.mdx +0 -6
  103. package/docs/docs/cmd/entra/administrativeunit/administrativeunit-remove.mdx +0 -6
  104. package/docs/docs/cmd/entra/app/app-add.mdx +0 -1
  105. package/docs/docs/cmd/entra/app/app-get.mdx +0 -1
  106. package/docs/docs/cmd/entra/app/app-list.mdx +0 -1
  107. package/docs/docs/cmd/entra/app/app-permission-add.mdx +0 -1
  108. package/docs/docs/cmd/entra/app/app-permission-list.mdx +0 -6
  109. package/docs/docs/cmd/entra/app/app-remove.mdx +0 -1
  110. package/docs/docs/cmd/entra/app/app-role-add.mdx +0 -1
  111. package/docs/docs/cmd/entra/app/app-role-list.mdx +0 -1
  112. package/docs/docs/cmd/entra/app/app-role-remove.mdx +0 -1
  113. package/docs/docs/cmd/entra/app/app-set.mdx +0 -1
  114. package/docs/docs/cmd/entra/approleassignment/approleassignment-add.mdx +0 -6
  115. package/docs/docs/cmd/entra/approleassignment/approleassignment-list.mdx +0 -6
  116. package/docs/docs/cmd/entra/approleassignment/approleassignment-remove.mdx +0 -6
  117. package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-add.mdx +0 -1
  118. package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-get.mdx +0 -1
  119. package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-list.mdx +0 -1
  120. package/docs/docs/cmd/entra/group/group-add.mdx +0 -6
  121. package/docs/docs/cmd/entra/group/group-get.mdx +0 -6
  122. package/docs/docs/cmd/entra/group/group-list.mdx +0 -6
  123. package/docs/docs/cmd/entra/group/group-member-list.mdx +0 -6
  124. package/docs/docs/cmd/entra/group/group-remove.mdx +0 -6
  125. package/docs/docs/cmd/entra/groupsetting/groupsetting-add.mdx +0 -6
  126. package/docs/docs/cmd/entra/groupsetting/groupsetting-get.mdx +0 -6
  127. package/docs/docs/cmd/entra/groupsetting/groupsetting-list.mdx +0 -6
  128. package/docs/docs/cmd/entra/groupsetting/groupsetting-remove.mdx +0 -6
  129. package/docs/docs/cmd/entra/groupsetting/groupsetting-set.mdx +0 -6
  130. package/docs/docs/cmd/entra/groupsettingtemplate/groupsettingtemplate-get.mdx +0 -6
  131. package/docs/docs/cmd/entra/groupsettingtemplate/groupsettingtemplate-list.mdx +0 -6
  132. package/docs/docs/cmd/entra/license/license-list.mdx +0 -6
  133. package/docs/docs/cmd/entra/m365group/m365group-add.mdx +0 -6
  134. package/docs/docs/cmd/entra/m365group/m365group-conversation-list.mdx +0 -6
  135. package/docs/docs/cmd/entra/m365group/m365group-conversation-post-list.mdx +0 -6
  136. package/docs/docs/cmd/entra/m365group/m365group-get.mdx +0 -6
  137. package/docs/docs/cmd/entra/m365group/m365group-list.mdx +0 -6
  138. package/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-clear.mdx +0 -6
  139. package/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-list.mdx +0 -6
  140. package/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-remove.mdx +0 -6
  141. package/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-restore.mdx +0 -6
  142. package/docs/docs/cmd/entra/m365group/m365group-remove.mdx +0 -6
  143. package/docs/docs/cmd/entra/m365group/m365group-renew.mdx +0 -6
  144. package/docs/docs/cmd/entra/m365group/m365group-report-activitycounts.mdx +0 -6
  145. package/docs/docs/cmd/entra/m365group/m365group-report-activitydetail.mdx +0 -6
  146. package/docs/docs/cmd/entra/m365group/m365group-report-activityfilecounts.mdx +0 -6
  147. package/docs/docs/cmd/entra/m365group/m365group-report-activitygroupcounts.mdx +2 -8
  148. package/docs/docs/cmd/entra/m365group/m365group-report-activitystorage.mdx +2 -8
  149. package/docs/docs/cmd/entra/m365group/m365group-set.mdx +34 -22
  150. package/docs/docs/cmd/entra/m365group/m365group-teamify.mdx +5 -11
  151. package/docs/docs/cmd/entra/m365group/m365group-user-add.mdx +5 -11
  152. package/docs/docs/cmd/entra/m365group/m365group-user-list.mdx +0 -12
  153. package/docs/docs/cmd/entra/m365group/m365group-user-remove.mdx +29 -21
  154. package/docs/docs/cmd/entra/m365group/m365group-user-set.mdx +4 -17
  155. package/docs/docs/cmd/entra/oauth2grant/oauth2grant-add.mdx +3 -9
  156. package/docs/docs/cmd/entra/oauth2grant/oauth2grant-list.mdx +1 -7
  157. package/docs/docs/cmd/entra/oauth2grant/oauth2grant-remove.mdx +4 -10
  158. package/docs/docs/cmd/entra/oauth2grant/oauth2grant-set.mdx +3 -9
  159. package/docs/docs/cmd/entra/policy/policy-list.mdx +3 -9
  160. package/docs/docs/cmd/entra/siteclassification/siteclassification-disable.mdx +3 -9
  161. package/docs/docs/cmd/entra/siteclassification/siteclassification-enable.mdx +7 -13
  162. package/docs/docs/cmd/entra/siteclassification/siteclassification-get.mdx +1 -7
  163. package/docs/docs/cmd/entra/siteclassification/siteclassification-set.mdx +8 -14
  164. package/docs/docs/cmd/entra/user/user-add.mdx +4 -10
  165. package/docs/docs/cmd/entra/user/user-get.mdx +7 -13
  166. package/docs/docs/cmd/entra/user/user-guest-add.mdx +3 -9
  167. package/docs/docs/cmd/entra/user/user-hibp.mdx +2 -8
  168. package/docs/docs/cmd/entra/user/user-license-add.mdx +0 -6
  169. package/docs/docs/cmd/entra/user/user-license-list.mdx +0 -6
  170. package/docs/docs/cmd/entra/user/user-license-remove.mdx +2 -8
  171. package/docs/docs/cmd/entra/user/user-list.mdx +1 -7
  172. package/docs/docs/cmd/entra/user/user-password-validate.mdx +1 -7
  173. package/docs/docs/cmd/entra/user/user-recyclebinitem-clear.mdx +2 -8
  174. package/docs/docs/cmd/entra/user/user-recyclebinitem-list.mdx +0 -6
  175. package/docs/docs/cmd/entra/user/user-recyclebinitem-remove.mdx +2 -8
  176. package/docs/docs/cmd/entra/user/user-recyclebinitem-restore.mdx +0 -6
  177. package/docs/docs/cmd/entra/user/user-registrationdetails-list.mdx +7 -13
  178. package/docs/docs/cmd/entra/user/user-remove.mdx +2 -8
  179. package/docs/docs/cmd/entra/user/user-set.mdx +0 -6
  180. package/docs/docs/cmd/entra/user/user-signin-list.mdx +9 -15
  181. package/docs/docs/cmd/login.mdx +9 -0
  182. package/docs/docs/cmd/spo/file/file-move.mdx +1 -3
  183. package/docs/docs/cmd/spo/folder/folder-move.mdx +84 -13
  184. package/docs/docs/cmd/spo/group/group-member-add.mdx +8 -14
  185. package/docs/docs/cmd/spo/group/group-member-remove.mdx +5 -11
  186. package/docs/docs/cmd/spo/site/site-sharingpermission-set.mdx +1 -1
  187. package/docs/docs/cmd/spo/user/user-ensure.mdx +2 -5
  188. package/package.json +1 -1
  189. package/dist/m365/entra/aadCommands.js +0 -89
@@ -25,10 +25,6 @@ class SpoUserEnsureCommand extends SpoCommand {
25
25
  __classPrivateFieldGet(this, _SpoUserEnsureCommand_instances, "m", _SpoUserEnsureCommand_initOptionSets).call(this);
26
26
  }
27
27
  async commandAction(logger, args) {
28
- if (args.options.aadId) {
29
- args.options.entraId = args.options.aadId;
30
- await this.warn(logger, `Option 'aadId' is deprecated. Please use 'entraId' instead`);
31
- }
32
28
  if (this.verbose) {
33
29
  await logger.logToStderr(`Ensuring user ${args.options.entraId || args.options.userName} at site ${args.options.webUrl}`);
34
30
  }
@@ -62,7 +58,6 @@ _SpoUserEnsureCommand_instances = new WeakSet(), _SpoUserEnsureCommand_initTelem
62
58
  this.telemetry.push((args) => {
63
59
  Object.assign(this.telemetryProperties, {
64
60
  entraId: typeof args.options.entraId !== 'undefined',
65
- aadId: typeof args.options.aadId !== 'undefined',
66
61
  userName: typeof args.options.userName !== 'undefined'
67
62
  });
68
63
  });
@@ -71,8 +66,6 @@ _SpoUserEnsureCommand_instances = new WeakSet(), _SpoUserEnsureCommand_initTelem
71
66
  option: '-u, --webUrl <webUrl>'
72
67
  }, {
73
68
  option: '--entraId [entraId]'
74
- }, {
75
- option: '--aadId [aadId]'
76
69
  }, {
77
70
  option: '--userName [userName]'
78
71
  });
@@ -85,16 +78,13 @@ _SpoUserEnsureCommand_instances = new WeakSet(), _SpoUserEnsureCommand_initTelem
85
78
  if (args.options.entraId && !validation.isValidGuid(args.options.entraId)) {
86
79
  return `${args.options.entraId} is not a valid GUID.`;
87
80
  }
88
- if (args.options.aadId && !validation.isValidGuid(args.options.aadId)) {
89
- return `${args.options.aadId} is not a valid GUID.`;
90
- }
91
81
  if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) {
92
82
  return `${args.options.userName} is not a valid userName.`;
93
83
  }
94
84
  return true;
95
85
  });
96
86
  }, _SpoUserEnsureCommand_initOptionSets = function _SpoUserEnsureCommand_initOptionSets() {
97
- this.optionSets.push({ options: ['entraId', 'aadId', 'userName'] });
87
+ this.optionSets.push({ options: ['entraId', 'userName'] });
98
88
  };
99
89
  export default new SpoUserEnsureCommand();
100
90
  //# sourceMappingURL=user-ensure.js.map
package/dist/utils/spo.js CHANGED
@@ -11,17 +11,20 @@ import { odata } from './odata.js';
11
11
  import { RoleType } from '../m365/spo/commands/roledefinition/RoleType.js';
12
12
  import { entraGroup } from './entraGroup.js';
13
13
  import { SharingCapabilities } from '../m365/spo/commands/site/SharingCapabilities.js';
14
- import { setTimeout } from 'timers/promises';
15
- export var CreateCopyJobsNameConflictBehavior;
16
- (function (CreateCopyJobsNameConflictBehavior) {
17
- CreateCopyJobsNameConflictBehavior[CreateCopyJobsNameConflictBehavior["Fail"] = 0] = "Fail";
18
- CreateCopyJobsNameConflictBehavior[CreateCopyJobsNameConflictBehavior["Replace"] = 1] = "Replace";
19
- CreateCopyJobsNameConflictBehavior[CreateCopyJobsNameConflictBehavior["Rename"] = 2] = "Rename";
20
- })(CreateCopyJobsNameConflictBehavior || (CreateCopyJobsNameConflictBehavior = {}));
14
+ import { timersUtil } from './timersUtil.js';
15
+ export var CreateFileCopyJobsNameConflictBehavior;
16
+ (function (CreateFileCopyJobsNameConflictBehavior) {
17
+ CreateFileCopyJobsNameConflictBehavior[CreateFileCopyJobsNameConflictBehavior["Fail"] = 0] = "Fail";
18
+ CreateFileCopyJobsNameConflictBehavior[CreateFileCopyJobsNameConflictBehavior["Replace"] = 1] = "Replace";
19
+ CreateFileCopyJobsNameConflictBehavior[CreateFileCopyJobsNameConflictBehavior["Rename"] = 2] = "Rename";
20
+ })(CreateFileCopyJobsNameConflictBehavior || (CreateFileCopyJobsNameConflictBehavior = {}));
21
+ export var CreateFolderCopyJobsNameConflictBehavior;
22
+ (function (CreateFolderCopyJobsNameConflictBehavior) {
23
+ CreateFolderCopyJobsNameConflictBehavior[CreateFolderCopyJobsNameConflictBehavior["Fail"] = 0] = "Fail";
24
+ CreateFolderCopyJobsNameConflictBehavior[CreateFolderCopyJobsNameConflictBehavior["Rename"] = 2] = "Rename";
25
+ })(CreateFolderCopyJobsNameConflictBehavior || (CreateFolderCopyJobsNameConflictBehavior = {}));
21
26
  // Wrapping this into a settings object so we can alter the values in tests
22
- export const settings = {
23
- pollingInterval: 3000
24
- };
27
+ const pollingInterval = 3000;
25
28
  export const spo = {
26
29
  async getRequestDigest(siteUrl) {
27
30
  const requestOptions = {
@@ -79,7 +82,7 @@ export const spo = {
79
82
  }
80
83
  return;
81
84
  }
82
- await setTimeout(operation.PollingInterval);
85
+ await timersUtil.setTimeout(pollingInterval);
83
86
  await spo.waitUntilFinished({
84
87
  operationId: JSON.stringify(operation._ObjectIdentity_),
85
88
  siteUrl,
@@ -691,7 +694,7 @@ export const spo = {
691
694
  if (!wait || isComplete) {
692
695
  return;
693
696
  }
694
- await setTimeout(operation.PollingInterval);
697
+ await timersUtil.setTimeout(pollingInterval);
695
698
  await spo.waitUntilFinished({
696
699
  operationId: JSON.stringify(operation._ObjectIdentity_),
697
700
  siteUrl: spoAdminUrl,
@@ -905,7 +908,7 @@ export const spo = {
905
908
  if (!wait || isComplete) {
906
909
  return;
907
910
  }
908
- await setTimeout(operation.PollingInterval);
911
+ await timersUtil.setTimeout(pollingInterval);
909
912
  await spo.waitUntilFinished({
910
913
  operationId: JSON.stringify(operation._ObjectIdentity_),
911
914
  siteUrl: spoAdminUrl,
@@ -1051,7 +1054,7 @@ export const spo = {
1051
1054
  const operation = json[json.length - 1];
1052
1055
  const isComplete = operation.IsComplete;
1053
1056
  if (!isComplete) {
1054
- await setTimeout(operation.PollingInterval);
1057
+ await timersUtil.setTimeout(pollingInterval);
1055
1058
  await spo.waitUntilFinished({
1056
1059
  operationId: JSON.stringify(operation._ObjectIdentity_),
1057
1060
  siteUrl: spoAdminUrl,
@@ -1551,14 +1554,14 @@ export const spo = {
1551
1554
  return file;
1552
1555
  },
1553
1556
  /**
1554
- * Create a SharePoint copy job to copy a file/folder to another location.
1555
- * @param webUrl Absolute web URL where the source file/folder is located.
1556
- * @param sourceUrl Absolute URL of the source file/folder.
1557
+ * Create a SharePoint copy job to copy a file to another location.
1558
+ * @param webUrl Absolute web URL where the source file is located.
1559
+ * @param sourceUrl Absolute URL of the source file.
1557
1560
  * @param destinationUrl Absolute URL of the destination folder.
1558
1561
  * @param options Options for the copy job.
1559
1562
  * @returns Copy job information. Use {@link spo.getCopyJobResult} to get the result of the copy job.
1560
1563
  */
1561
- async createCopyJob(webUrl, sourceUrl, destinationUrl, options) {
1564
+ async createFileCopyJob(webUrl, sourceUrl, destinationUrl, options) {
1562
1565
  const requestOptions = {
1563
1566
  url: `${webUrl}/_api/Site/CreateCopyJobs`,
1564
1567
  headers: {
@@ -1569,7 +1572,7 @@ export const spo = {
1569
1572
  destinationUri: destinationUrl,
1570
1573
  exportObjectUris: [sourceUrl],
1571
1574
  options: {
1572
- NameConflictBehavior: options?.nameConflictBehavior ?? CreateCopyJobsNameConflictBehavior.Fail,
1575
+ NameConflictBehavior: options?.nameConflictBehavior ?? CreateFileCopyJobsNameConflictBehavior.Fail,
1573
1576
  AllowSchemaMismatch: true,
1574
1577
  BypassSharedLock: !!options?.bypassSharedLock,
1575
1578
  IgnoreVersionHistory: !!options?.ignoreVersionHistory,
@@ -1583,6 +1586,36 @@ export const spo = {
1583
1586
  const response = await request.post(requestOptions);
1584
1587
  return response.value[0];
1585
1588
  },
1589
+ /**
1590
+ * Create a SharePoint copy job to copy a folder to another location.
1591
+ * @param webUrl Absolute web URL where the source folder is located.
1592
+ * @param sourceUrl Absolute URL of the source folder.
1593
+ * @param destinationUrl Absolute URL of the destination folder.
1594
+ * @param options Options for the copy job.
1595
+ * @returns Copy job information. Use {@link spo.getCopyJobResult} to get the result of the copy job.
1596
+ */
1597
+ async createFolderCopyJob(webUrl, sourceUrl, destinationUrl, options) {
1598
+ const requestOptions = {
1599
+ url: `${webUrl}/_api/Site/CreateCopyJobs`,
1600
+ headers: {
1601
+ accept: 'application/json;odata=nometadata'
1602
+ },
1603
+ responseType: 'json',
1604
+ data: {
1605
+ destinationUri: destinationUrl,
1606
+ exportObjectUris: [sourceUrl],
1607
+ options: {
1608
+ NameConflictBehavior: options?.nameConflictBehavior ?? CreateFolderCopyJobsNameConflictBehavior.Fail,
1609
+ AllowSchemaMismatch: true,
1610
+ CustomizedItemName: options?.newName ? [options.newName] : undefined,
1611
+ SameWebCopyMoveOptimization: true,
1612
+ IsMoveMode: options?.operation === 'move'
1613
+ }
1614
+ }
1615
+ };
1616
+ const response = await request.post(requestOptions);
1617
+ return response.value[0];
1618
+ },
1586
1619
  /**
1587
1620
  * Poll until the copy job is finished and return the result.
1588
1621
  * @param webUrl Absolute web URL where the copy job was created.
@@ -1601,12 +1634,20 @@ export const spo = {
1601
1634
  copyJobInfo: copyJobInfo
1602
1635
  }
1603
1636
  };
1637
+ const logs = [];
1604
1638
  let progress = await request.post(requestOptions);
1639
+ const newLogs = progress.Logs?.map(l => JSON.parse(l));
1640
+ if (newLogs?.length > 0) {
1641
+ logs.push(...newLogs);
1642
+ }
1605
1643
  while (progress.JobState !== 0) {
1606
- await setTimeout(settings.pollingInterval);
1644
+ await timersUtil.setTimeout(pollingInterval);
1607
1645
  progress = await request.post(requestOptions);
1646
+ const newLogs = progress.Logs?.map(l => JSON.parse(l));
1647
+ if (newLogs?.length > 0) {
1648
+ logs.push(...newLogs);
1649
+ }
1608
1650
  }
1609
- const logs = progress.Logs.map(l => JSON.parse(l));
1610
1651
  // Check if the job has failed
1611
1652
  const errorLog = logs.find(l => l.Event === 'JobError');
1612
1653
  if (errorLog) {
@@ -4,7 +4,8 @@ export const timersUtil = {
4
4
  * Timeout for a specific duration.
5
5
  * @param duration Duration in milliseconds.
6
6
  */
7
- /* c8 ignore next 3 */
7
+ /* c8 ignore next 4 */
8
+ // Function is created so we can easily mock it in our tests
8
9
  async setTimeout(duration) {
9
10
  return setTimeout(duration);
10
11
  }
package/dist/utils/zod.js CHANGED
@@ -67,7 +67,7 @@ function parseEnum(def, _options, currentOption) {
67
67
  function parseNativeEnum(def, _options, currentOption) {
68
68
  if (currentOption) {
69
69
  currentOption.type = 'string';
70
- currentOption.autocomplete = Object.getOwnPropertyNames(def.values);
70
+ currentOption.autocomplete = Object.values(def.values).map(v => String(v));
71
71
  }
72
72
  return;
73
73
  }
@@ -119,6 +119,15 @@ export const zod = {
119
119
  const options = [];
120
120
  parseDef(schema._def, options);
121
121
  return options;
122
- }
122
+ },
123
+ coercedEnum: (e) => z.preprocess(val => {
124
+ const target = String(val)?.toLowerCase();
125
+ for (const k of Object.values(e)) {
126
+ if (String(k)?.toLowerCase() === target) {
127
+ return k;
128
+ }
129
+ }
130
+ return null;
131
+ }, z.nativeEnum(e))
123
132
  };
124
133
  //# sourceMappingURL=zod.js.map
@@ -12,12 +12,6 @@ Creates a new administrative unit
12
12
  m365 entra administrativeunit add [options]
13
13
  ```
14
14
 
15
- ## Alias
16
-
17
- ```sh
18
- m365 aad administrativeunit add [options]
19
- ```
20
-
21
15
  ## Options
22
16
 
23
17
  ```md definition-list
@@ -12,12 +12,6 @@ Gets information about a specific administrative unit
12
12
  m365 entra administrativeunit get [options]
13
13
  ```
14
14
 
15
- ## Alias
16
-
17
- ```sh
18
- m365 aad administrativeunit get [options]
19
- ```
20
-
21
15
  ## Options
22
16
 
23
17
  ```md definition-list
@@ -12,12 +12,6 @@ Retrieves a list of administrative units
12
12
  m365 entra administrativeunit list [options]
13
13
  ```
14
14
 
15
- ## Alias
16
-
17
- ```sh
18
- m365 aad administrativeunit list [options]
19
- ```
20
-
21
15
  ## Options
22
16
 
23
17
  <Global />
@@ -10,12 +10,6 @@ Add a member (user, group, or device) to an administrative unit
10
10
  m365 entra administrativeunit member add [options]
11
11
  ```
12
12
 
13
- ## Alias
14
-
15
- ```sh
16
- m365 aad administrativeunit member add [options]
17
- ```
18
-
19
13
  ## Options
20
14
 
21
15
  ```md definition-list
@@ -12,12 +12,6 @@ Retrieves info about a specific member of an administrative unit
12
12
  m365 entra administrativeunit member get [options]
13
13
  ```
14
14
 
15
- ## Alias
16
-
17
- ```sh
18
- m365 aad administrativeunit member get [options]
19
- ```
20
-
21
15
  ## Options
22
16
 
23
17
  ```md definition-list
@@ -12,12 +12,6 @@ Retrieves members (users, groups, or devices) of an administrative unit
12
12
  m365 entra administrativeunit member list [options]
13
13
  ```
14
14
 
15
- ## Alias
16
-
17
- ```sh
18
- m365 aad administrativeunit member list [options]
19
- ```
20
-
21
15
  ## Options
22
16
 
23
17
  ```md definition-list
@@ -10,12 +10,6 @@ Removes an administrative unit
10
10
  m365 entra administrativeunit remove [options]
11
11
  ```
12
12
 
13
- ## Alias
14
-
15
- ```sh
16
- m365 aad administrativeunit remove [options]
17
- ```
18
-
19
13
  ## options
20
14
 
21
15
  ```md definition-list
@@ -15,7 +15,6 @@ m365 entra app add [options]
15
15
  ## Alias
16
16
 
17
17
  ```sh
18
- m365 aad app add [options]
19
18
  m365 entra appregistration add [options]
20
19
  ```
21
20
 
@@ -15,7 +15,6 @@ m365 entra app get [options]
15
15
  ## Alias
16
16
 
17
17
  ```sh
18
- m365 aad app get [options]
19
18
  m365 entra appregistration get [options]
20
19
  ```
21
20
 
@@ -15,7 +15,6 @@ m365 entra app list [options]
15
15
  ## Alias
16
16
 
17
17
  ```sh
18
- m365 aad app list [options]
19
18
  m365 entra appregistration list [options]
20
19
  ```
21
20
 
@@ -15,7 +15,6 @@ m365 entra app permission add [options]
15
15
  ## Alias
16
16
 
17
17
  ```sh
18
- m365 aad app permission add [options]
19
18
  m365 entra appregistration permission add [options]
20
19
  ```
21
20
 
@@ -12,12 +12,6 @@ Lists the application and delegated permissions for a specified Entra Applicatio
12
12
  m365 entra app permission list [options]
13
13
  ```
14
14
 
15
- ## Alias
16
-
17
- ```sh
18
- m365 aad app permission list [options]
19
- ```
20
-
21
15
  ## Options
22
16
 
23
17
  ```md definition-list
@@ -13,7 +13,6 @@ m365 entra app remove [options]
13
13
  ## Alias
14
14
 
15
15
  ```sh
16
- m365 aad app remove [options]
17
16
  m365 entra appregistration remove [options]
18
17
  ```
19
18
 
@@ -13,7 +13,6 @@ m365 entra app role add [options]
13
13
  ## Alias
14
14
 
15
15
  ```sh
16
- m365 aad app role add [options]
17
16
  m365 entra appregistration role add [options]
18
17
  ```
19
18
 
@@ -15,7 +15,6 @@ m365 entra app role list [options]
15
15
  ## Alias
16
16
 
17
17
  ```sh
18
- m365 aad app role list [options]
19
18
  m365 entra appregistration role list [options]
20
19
  ```
21
20
 
@@ -13,7 +13,6 @@ m365 entra app role remove [options]
13
13
  ## Alias
14
14
 
15
15
  ```sh
16
- m365 aad app role remove [options]
17
16
  m365 entra appregistration role remove [options]
18
17
  ```
19
18
 
@@ -13,7 +13,6 @@ m365 entra app set [options]
13
13
  ## Alias
14
14
 
15
15
  ```sh
16
- m365 aad app set [options]
17
16
  m365 entra appregistration set [options]
18
17
  ```
19
18
 
@@ -12,12 +12,6 @@ Adds service principal permissions also known as scopes and app role assignments
12
12
  m365 entra approleassignment add [options]
13
13
  ```
14
14
 
15
- ## Alias
16
-
17
- ```sh
18
- m365 aad approleassignment add [options]
19
- ```
20
-
21
15
  ## Options
22
16
 
23
17
  ```md definition-list
@@ -12,12 +12,6 @@ Lists app role assignments for the specified application registration
12
12
  m365 entra approleassignment list [options]
13
13
  ```
14
14
 
15
- ## Alias
16
-
17
- ```sh
18
- m365 aad approleassignment list [options]
19
- ```
20
-
21
15
  ## Options
22
16
 
23
17
  ```md definition-list
@@ -10,12 +10,6 @@ Deletes an app role assignment for the specified Entra application registration
10
10
  m365 entra approleassignment remove [options]
11
11
  ```
12
12
 
13
- ## Alias
14
-
15
- ```sh
16
- m365 aad approleassignment remove [options]
17
- ```
18
-
19
13
  ## Options
20
14
 
21
15
  ```md definition-list
@@ -15,7 +15,6 @@ m365 entra enterpriseapp add [options]
15
15
  ## Alias
16
16
 
17
17
  ```sh
18
- m365 aad sp add [options]
19
18
  m365 entra sp add [options]
20
19
  ```
21
20
 
@@ -15,7 +15,6 @@ m365 entra enterpriseapp get [options]
15
15
  ## Alias
16
16
 
17
17
  ```sh
18
- m365 aad sp get [options]
19
18
  m365 entra sp get [options]
20
19
  ```
21
20
 
@@ -15,7 +15,6 @@ m365 entra enterpriseapp list [options]
15
15
  ## Alias
16
16
 
17
17
  ```sh
18
- m365 aad sp list [options]
19
18
  m365 entra sp list [options]
20
19
  ```
21
20
 
@@ -12,12 +12,6 @@ Creates a Microsoft Entra group
12
12
  m365 entra group add [options]
13
13
  ```
14
14
 
15
- ## Alias
16
-
17
- ```sh
18
- m365 aad group add [options]
19
- ```
20
-
21
15
  ## Options
22
16
 
23
17
  ```md definition-list
@@ -12,12 +12,6 @@ Gets information about the specified Entra group
12
12
  m365 entra group get [options]
13
13
  ```
14
14
 
15
- ## Alias
16
-
17
- ```sh
18
- m365 aad group get [options]
19
- ```
20
-
21
15
  ## Options
22
16
 
23
17
  ```md definition-list
@@ -12,12 +12,6 @@ Lists Entra groups
12
12
  m365 entra group list [options]
13
13
  ```
14
14
 
15
- ## Alias
16
-
17
- ```sh
18
- m365 aad group list [options]
19
- ```
20
-
21
15
  ## Options
22
16
 
23
17
  ```md definition-list
@@ -12,12 +12,6 @@ Lists members of a specific Entra group
12
12
  m365 entra group member list [options]
13
13
  ```
14
14
 
15
- ## Alias
16
-
17
- ```sh
18
- m365 aad group user list [options]
19
- ```
20
-
21
15
  ## Options
22
16
 
23
17
  ```md definition-list
@@ -10,12 +10,6 @@ Removes an Entra group
10
10
  m365 entra group remove [options]
11
11
  ```
12
12
 
13
- ## Alias
14
-
15
- ```sh
16
- m365 aad group remove [options]
17
- ```
18
-
19
13
  ## Options
20
14
 
21
15
  ```md definition-list
@@ -12,12 +12,6 @@ Creates a group setting
12
12
  m365 entra groupsetting add [options]
13
13
  ```
14
14
 
15
- ## Alias
16
-
17
- ```sh
18
- m365 aad groupsetting add [options]
19
- ```
20
-
21
15
  ## Options
22
16
 
23
17
  ```md definition-list
@@ -12,12 +12,6 @@ Gets information about the particular group setting
12
12
  m365 entra groupsetting get [options]
13
13
  ```
14
14
 
15
- ## Alias
16
-
17
- ```sh
18
- m365 aad groupsetting get [options]
19
- ```
20
-
21
15
  ## Options
22
16
 
23
17
  ```md definition-list
@@ -12,12 +12,6 @@ Lists Entra group settings
12
12
  m365 entra groupsetting list [options]
13
13
  ```
14
14
 
15
- ## Alias
16
-
17
- ```sh
18
- m365 aad groupsetting list [options]
19
- ```
20
-
21
15
  ## Options
22
16
 
23
17
  <Global />
@@ -10,12 +10,6 @@ Removes the particular group setting
10
10
  m365 entra groupsetting remove [options]
11
11
  ```
12
12
 
13
- ## Alias
14
-
15
- ```sh
16
- m365 aad groupsetting remove [options]
17
- ```
18
-
19
13
  ## Options
20
14
 
21
15
  ```md definition-list
@@ -10,12 +10,6 @@ Updates the particular group setting
10
10
  m365 entra groupsetting set [options]
11
11
  ```
12
12
 
13
- ## Alias
14
-
15
- ```sh
16
- m365 aad groupsetting set [options]
17
- ```
18
-
19
13
  ## Options
20
14
 
21
15
  ```md definition-list
@@ -12,12 +12,6 @@ Gets information about the specified Entra group settings template
12
12
  m365 entra groupsettingtemplate get [options]
13
13
  ```
14
14
 
15
- ## Alias
16
-
17
- ```sh
18
- m365 aad groupsettingtemplate get [options]
19
- ```
20
-
21
15
  ## Options
22
16
 
23
17
  ```md definition-list
@@ -12,12 +12,6 @@ Lists Entra group settings templates
12
12
  m365 entra groupsettingtemplate list [options]
13
13
  ```
14
14
 
15
- ## Alias
16
-
17
- ```sh
18
- m365 aad groupsettingtemplate list [options]
19
- ```
20
-
21
15
  ## Options
22
16
 
23
17
  <Global />