Skip to content

feat: add source.copyFolder for recursive folder copy#594

Open
mhaack wants to merge 1 commit into
mainfrom
hlx6fc
Open

feat: add source.copyFolder for recursive folder copy#594
mhaack wants to merge 1 commit into
mainfrom
hlx6fc

Conversation

@mhaack

@mhaack mhaack commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds source.copyFolder to nx2/utils/api.js, mirroring the existing copy/createFolder/deleteFolder conventions so callers can recursively copy a folder rather than a single document.

  • hlx6: normalizes path/destination to a trailing slash before PUTing to the destination URL with ?source=…&collision=… query params.
  • Legacy DA: uses path/destination as-is (no trailing-slash normalization needed — handled by da-admin) and POSTs to /copy/{org}/{site}{path} with a multipart/form-data destination field.

Changes

  • nx2/utils/api.js — new source.copyFolder method.
  • nx2/utils/api.d.ts — type signature + doc comment.
  • nx2/utils/api.md — method table row, URL-shapes row, and usage example.
  • test/nx2/utils/api.test.js — unit tests covering hlx6, legacy, trailing-slash normalization, and path-string calling forms.

Testing

  • npx web-test-runner test/nx2/utils/api.test.js — all tests pass.
  • Full unit suite (npm test) — 1031 passed, 0 failed.

- source.copyFolder mirrors copy/createFolder/deleteFolder conventions
- hlx6 normalizes path/destination to a trailing slash before dispatch
- legacy DA uses path/destination as-is (da-admin doesn't need the slash)
- update api.d.ts and api.md docs
- add unit tests covering hlx6, legacy, and path-string calling forms
@aem-code-sync

aem-code-sync Bot commented Jul 10, 2026

Copy link
Copy Markdown

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch.
In case there are problems, just click the checkbox below to rerun the respective action.

  • Re-sync branch
Commits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant