Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/scripts/conformance-smoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,23 @@ say "Collabora discovery is reachable from the app container"
curl -fsS -X POST "$BASE/api/v1/versions/$VID/sessions" "${AUTH[@]}" \
| python3 -c 'import json,sys; d=json.load(sys.stdin); assert "WOPISrc=" in d["editorUrl"], d; print(" editor url ok")'

say "an oversized body is 413 with the limit named, not a 400 blaming the file"
# Pinned here rather than in the xUnit suite because the limit is Kestrel's and TestServer does not
# enforce MaxRequestBodySize -- a 40MB upload returns 201 under the test fixture. Both ingest routes
# rethrow BadHttpRequestException ahead of their multipart catch precisely so this stays a 413; without
# that rethrow both answer 400 "The multipart body could not be parsed" and never mention the limit.
dd if=/dev/zero of="$WORK/oversize.bin" bs=1048576 count=31 2>/dev/null
for ROUTE in "documents:import" "documents/$DOC_ID/versions"; do
CODE="$(curl -s -o "$WORK/oversize.json" -w '%{http_code}' -X POST "$BASE/api/v1/$ROUTE" "${AUTH[@]}" \
-F "file=@$WORK/oversize.bin;filename=oversize.docx")"
[ "$CODE" = "413" ] || fail "$ROUTE returned $CODE for a 31MB body, expected 413"
python3 -c '
import json, sys
d = json.load(open(sys.argv[1]))
assert d["status"] == 413, d
assert "max request body size" in d["detail"].lower(), d
print(" " + sys.argv[2] + ": 413,", d["detail"])' "$WORK/oversize.json" "$ROUTE"
done
rm -f "$WORK/oversize.bin"

printf '\nCompose-stack conformance smoke passed.\n'
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ descriptions are **document** versions, produced by the versioning engine. They

### Added

- **A document can be imported in one step.** `POST /api/v1/documents:import` takes a multipart body
— a file, an optional `name`, an optional `folderId` — and returns a new document already holding
that file as version `0.0.1`. The dashboard gains an **Import document** control that uses it,
taking the name from the filename and letting you edit it before anything is created. Previously
this was `POST /documents` followed by a separate upload, which meant typing the name by hand and
left an empty document behind if the upload failed.

Omitting `name` derives it from the filename; a filename with no usable stem (`.docx`) is a `400`
rather than a document nobody named.
- **The dashboard's document list can be sorted.** `GET /api/v1/documents` accepts `sort` (`created`,
`updated`, `name`) and `order` (`asc`, `desc`), and the dashboard toolbar gains a sort menu whose
choice lives in the page's address — so it survives a reload and can be shared as a link. The web UI
Expand Down
18 changes: 15 additions & 3 deletions docs-site/docs/api/openapi/v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@
}
}
},
"/api/v1/documents:import": {
"post": {
"tags": [
"Documents"
],
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/api/v1/documents/{id}/merges": {
"post": {
"tags": [
Expand Down Expand Up @@ -2499,6 +2511,9 @@
{
"name": "EasyDocs.Api"
},
{
"name": "Documents"
},
{
"name": "Merging"
},
Expand Down Expand Up @@ -2526,9 +2541,6 @@
{
"name": "Folders"
},
{
"name": "Documents"
},
{
"name": "Versions"
},
Expand Down
2 changes: 2 additions & 0 deletions docs-site/docs/user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ The dashboard is folders on the left, documents on the right.
- **Create a folder** to group documents; folders nest freely, and moving a document never touches
its history or members.
- **Create document** makes an empty document; its first upload becomes version `0.0.1`.
- **Import document** does both at once: pick a `.docx` and you get a document already holding it as
version `0.0.1`. The name comes from the file, and you can change it before importing.
- **Search names & content** — the one search box matches document *names* and, since v1.1, the
*text inside* their current versions. Phrases (`"exact phrase"`) and exclusions (`word -other`)
work. Content lands in the index a few seconds after a save.
Expand Down
Loading
Loading