Skip to content

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

Merged
mhaack merged 3 commits into
mainfrom
hlx6fc
Jul 14, 2026
Merged

feat(hlx6): add source.copyFolder for recursive folder copy#594
mhaack merged 3 commits 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.

This PR is needed for adobe/da-live#1092

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

@mhaack mhaack changed the title feat: add source.copyFolder for recursive folder copy feat(hlx6): add source.copyFolder for recursive folder copy Jul 13, 2026
@mhaack
mhaack merged commit e7692e7 into main Jul 14, 2026
3 checks passed
@mhaack
mhaack deleted the hlx6fc branch July 14, 2026 09:25
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.

3 participants