Describe /files/import's application/x-ndjson response and the start/file/ done/error event schema. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+37
-10
@@ -654,6 +654,13 @@ paths:
|
|||||||
not recursed. A successfully imported file is removed from the import
|
not recursed. A successfully imported file is removed from the import
|
||||||
folder. For files without an EXIF date, the source file's modified time
|
folder. For files without an EXIF date, the source file's modified time
|
||||||
is used as content_datetime.
|
is used as content_datetime.
|
||||||
|
|
||||||
|
|
||||||
|
Progress is streamed as newline-delimited JSON (`application/x-ndjson`):
|
||||||
|
a single `start` event, one `file` event per directory entry as it is
|
||||||
|
processed, and a final `done` event with the tallies. A validation error
|
||||||
|
raised before any file is touched (e.g. import disabled, bad path) is
|
||||||
|
instead returned as a normal JSON error with a 4xx/5xx status.
|
||||||
requestBody:
|
requestBody:
|
||||||
required: true
|
required: true
|
||||||
content:
|
content:
|
||||||
@@ -666,25 +673,45 @@ paths:
|
|||||||
description: Server directory path (uses user's configured import path if omitted)
|
description: Server directory path (uses user's configured import path if omitted)
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: Import result
|
description: >
|
||||||
|
A stream of newline-delimited JSON import progress events. The
|
||||||
|
schema below describes a single event line; the response body is one
|
||||||
|
such object per line.
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/x-ndjson:
|
||||||
schema:
|
schema:
|
||||||
type: object
|
type: object
|
||||||
|
required: [type]
|
||||||
properties:
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
enum: [start, file, done, error]
|
||||||
|
description: Event discriminator.
|
||||||
|
total:
|
||||||
|
type: integer
|
||||||
|
description: Entries to process (start) or processed (done).
|
||||||
|
index:
|
||||||
|
type: integer
|
||||||
|
description: 1-based position of this entry (file events).
|
||||||
|
filename:
|
||||||
|
type: string
|
||||||
|
description: Entry name (file events).
|
||||||
|
status:
|
||||||
|
type: string
|
||||||
|
enum: [imported, skipped, error]
|
||||||
|
description: Outcome for this entry (file events).
|
||||||
|
reason:
|
||||||
|
type: string
|
||||||
|
description: Detail for a skipped/error/warning entry.
|
||||||
imported:
|
imported:
|
||||||
type: integer
|
type: integer
|
||||||
|
description: Total imported (done event).
|
||||||
skipped:
|
skipped:
|
||||||
type: integer
|
type: integer
|
||||||
|
description: Total skipped (done event).
|
||||||
errors:
|
errors:
|
||||||
type: array
|
type: integer
|
||||||
items:
|
description: Total errors (done event).
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
filename:
|
|
||||||
type: string
|
|
||||||
reason:
|
|
||||||
type: string
|
|
||||||
|
|
||||||
# -------------------------------------------------------------------------
|
# -------------------------------------------------------------------------
|
||||||
# Tags
|
# Tags
|
||||||
|
|||||||
Reference in New Issue
Block a user