[PR #5721] [MERGED] API: ZIP Import/Export #6553

Closed
opened 2026-02-05 10:35:23 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/BookStackApp/BookStack/pull/5721
Author: @ssddanbrown
Created: 7/18/2025
Status: Merged
Merged: 7/18/2025
Merged by: @ssddanbrown

Base: developmentHead: zip_export_api_endpoints


📝 Commits (8)

  • c61ce8d Implement functionality to export a book, along with its pages and chapters, as a ZIP file.
  • 5fa728f Develop functionality to import ZIP files. Create an API controller and define a route entry for handling the import process. Implement logic to read the list of files within the ZIP, process the directory structure, and automatically create associated pages, chapters, and books based on the ZIP file's contents.
  • 64da80c added routes for zip export
  • 3626a22 Merge branch 'development' of github.com:LM-Nishant/BookStack into LM-Nishant-development
  • d15eb12 API: Initial review pass of zip import/export endpoints
  • d556845 API: Added zip export tests, reorganised tests
  • 7302571 ZIP Imports: Added API test cases
  • 32ba3a5 ZIP Imports: Added API examples, finished testing

📊 Changes

26 files changed (+733 additions, -224 deletions)

View changed files

📝 app/Entities/Controllers/ChapterApiController.php (+1 -2)
📝 app/Entities/Controllers/PageApiController.php (+1 -1)
📝 app/Exports/Controllers/BookExportApiController.php (+12 -0)
📝 app/Exports/Controllers/ChapterExportApiController.php (+9 -0)
app/Exports/Controllers/ImportApiController.php (+144 -0)
📝 app/Exports/Controllers/PageExportApiController.php (+9 -0)
📝 app/Exports/Import.php (+2 -0)
📝 app/Exports/ImportRepo.php (+7 -1)
📝 app/Http/ApiController.php (+1 -1)
📝 app/Permissions/ContentPermissionApiController.php (+1 -1)
📝 app/Search/SearchApiController.php (+1 -1)
📝 app/Users/Controllers/RoleApiController.php (+1 -1)
📝 database/factories/Exports/ImportFactory.php (+1 -0)
dev/api/requests/imports-run.json (+4 -0)
dev/api/responses/imports-create.json (+10 -0)
dev/api/responses/imports-list.json (+23 -0)
dev/api/responses/imports-read.json (+51 -0)
dev/api/responses/imports-run.json (+14 -0)
📝 routes/api.php (+9 -0)
📝 tests/Api/BooksApiTest.php (+0 -58)

...and 6 more files

📄 Description

Continuation & review of #5592.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/BookStackApp/BookStack/pull/5721 **Author:** [@ssddanbrown](https://github.com/ssddanbrown) **Created:** 7/18/2025 **Status:** ✅ Merged **Merged:** 7/18/2025 **Merged by:** [@ssddanbrown](https://github.com/ssddanbrown) **Base:** `development` ← **Head:** `zip_export_api_endpoints` --- ### 📝 Commits (8) - [`c61ce8d`](https://github.com/BookStackApp/BookStack/commit/c61ce8dee4ea474b16564c3d3337bac25fba1f46) Implement functionality to export a book, along with its pages and chapters, as a ZIP file. - [`5fa728f`](https://github.com/BookStackApp/BookStack/commit/5fa728f28a0c4f09649da7b653dd66260e49a596) Develop functionality to import ZIP files. Create an API controller and define a route entry for handling the import process. Implement logic to read the list of files within the ZIP, process the directory structure, and automatically create associated pages, chapters, and books based on the ZIP file's contents. - [`64da80c`](https://github.com/BookStackApp/BookStack/commit/64da80cbf4611f0e6a1700e6e2fa399389ee50da) added routes for zip export - [`3626a22`](https://github.com/BookStackApp/BookStack/commit/3626a2265b8f4acdbbcff82bd4c1dcdef6cadd40) Merge branch 'development' of github.com:LM-Nishant/BookStack into LM-Nishant-development - [`d15eb12`](https://github.com/BookStackApp/BookStack/commit/d15eb129b0a372181ec77e9f7c3897e80a525613) API: Initial review pass of zip import/export endpoints - [`d556845`](https://github.com/BookStackApp/BookStack/commit/d55684531f56fc1f029aeb473b9bccee8edc841e) API: Added zip export tests, reorganised tests - [`7302571`](https://github.com/BookStackApp/BookStack/commit/73025719a4bc06457de1d753aa6e6fefd0ba8777) ZIP Imports: Added API test cases - [`32ba3a5`](https://github.com/BookStackApp/BookStack/commit/32ba3a591f982ddd99aa44e4f67b1ee6e20d91ba) ZIP Imports: Added API examples, finished testing ### 📊 Changes **26 files changed** (+733 additions, -224 deletions) <details> <summary>View changed files</summary> 📝 `app/Entities/Controllers/ChapterApiController.php` (+1 -2) 📝 `app/Entities/Controllers/PageApiController.php` (+1 -1) 📝 `app/Exports/Controllers/BookExportApiController.php` (+12 -0) 📝 `app/Exports/Controllers/ChapterExportApiController.php` (+9 -0) ➕ `app/Exports/Controllers/ImportApiController.php` (+144 -0) 📝 `app/Exports/Controllers/PageExportApiController.php` (+9 -0) 📝 `app/Exports/Import.php` (+2 -0) 📝 `app/Exports/ImportRepo.php` (+7 -1) 📝 `app/Http/ApiController.php` (+1 -1) 📝 `app/Permissions/ContentPermissionApiController.php` (+1 -1) 📝 `app/Search/SearchApiController.php` (+1 -1) 📝 `app/Users/Controllers/RoleApiController.php` (+1 -1) 📝 `database/factories/Exports/ImportFactory.php` (+1 -0) ➕ `dev/api/requests/imports-run.json` (+4 -0) ➕ `dev/api/responses/imports-create.json` (+10 -0) ➕ `dev/api/responses/imports-list.json` (+23 -0) ➕ `dev/api/responses/imports-read.json` (+51 -0) ➕ `dev/api/responses/imports-run.json` (+14 -0) 📝 `routes/api.php` (+9 -0) 📝 `tests/Api/BooksApiTest.php` (+0 -58) _...and 6 more files_ </details> ### 📄 Description Continuation & review of #5592. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 10:35:23 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#6553