mirror of
https://github.com/Dictionarry-Hub/profilarr.git
synced 2026-04-18 21:08:05 -04:00
104 lines
3.0 KiB
YAML
104 lines
3.0 KiB
YAML
export:
|
|
get:
|
|
operationId: exportEntity
|
|
summary: Export a portable entity
|
|
description: |
|
|
Serializes a PCD entity into its portable JSON representation.
|
|
|
|
The portable format strips database IDs and timestamps, producing a
|
|
self-contained snapshot suitable for clipboard copy, file export, or
|
|
cross-database import.
|
|
tags:
|
|
- PCD
|
|
parameters:
|
|
- name: databaseId
|
|
in: query
|
|
required: true
|
|
description: The PCD database ID to export from
|
|
schema:
|
|
type: integer
|
|
- name: entityType
|
|
in: query
|
|
required: true
|
|
description: The entity type to export
|
|
schema:
|
|
$ref: '../schemas/pcd.yaml#/EntityType'
|
|
- name: name
|
|
in: query
|
|
required: true
|
|
description: The entity name to export
|
|
schema:
|
|
type: string
|
|
responses:
|
|
'200':
|
|
description: Portable entity JSON
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '../schemas/pcd.yaml#/ExportResponse'
|
|
'400':
|
|
description: Missing or invalid parameters
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '../schemas/pcd.yaml#/PcdErrorResponse'
|
|
'404':
|
|
description: Entity not found
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '../schemas/pcd.yaml#/PcdErrorResponse'
|
|
'500':
|
|
description: Database cache not available
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '../schemas/pcd.yaml#/PcdErrorResponse'
|
|
|
|
import:
|
|
post:
|
|
operationId: importEntity
|
|
summary: Import a portable entity
|
|
description: |
|
|
Deserializes a portable entity into PCD operations, creating the entity
|
|
in the target database and layer.
|
|
|
|
The request body matches the export response format (`entityType` + `data`),
|
|
plus `databaseId` and `layer` to specify the target.
|
|
|
|
Name uniqueness is validated — importing an entity with a name that already
|
|
exists will return a 400 error.
|
|
tags:
|
|
- PCD
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '../schemas/pcd.yaml#/ImportRequest'
|
|
responses:
|
|
'200':
|
|
description: Entity created successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '../schemas/pcd.yaml#/ImportResponse'
|
|
'400':
|
|
description: Validation error (missing fields, duplicate name, invalid data)
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '../schemas/pcd.yaml#/PcdErrorResponse'
|
|
'403':
|
|
description: Cannot write to base layer
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '../schemas/pcd.yaml#/PcdErrorResponse'
|
|
'500':
|
|
description: Database cache not available
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '../schemas/pcd.yaml#/PcdErrorResponse'
|