forked from Alfresco/alfresco-transform-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalfresco-transformer.yaml
224 lines (205 loc) · 6.57 KB
/
alfresco-transformer.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
swagger: '2.0'
info:
description: |
**Alfresco Transform Engines REST API**
Transform Request & Response API to allow a source file to be transformed into a
target file, given a set of transform options.
The new JSON-based Transform Engines API is used by the Alfresco Transform Service (ATS).
ATS provides an independently-scalable transform service, initially used by ACS
Content Repository, as part of the overall Alfresco Digital Business Platform (DBP).
Note: Each kind of Transform Engine implements this Transform Engines API, including:
* ImageMagick
* LibreOffice
* PDF Renderer
* Tika
In the future, this Transform Engines API may form the basis for adding custom Transform Engines.
version: '1'
title: Alfresco Transform Engines REST API
basePath: /alfresco/api/-default-/private/transformer/versions/1
tags:
- name: Transform
description: Transform Engine Request / Respone
paths:
'/transform':
post:
x-alfresco-since: "2.0"
tags:
- Transform
summary: Transform Engines API
description: |
**Note:** available with Alfresco Transform Engines 2.0 and newer versions.
This endpoint supports both JSON and Multipart. The JSON API is used within the
Alfresco Transform Service (eg. ACS 6.1). The Multipart API remains for backwards
compatibility (eg. ACS 6.0).
**Using JSON (application/json -> application/json)**
The ACS Content Repository 6.1 (or higher) provides the option to offload
supported transformations to the Alfresco Transform Service.
The JSON API is used within the Alfresco Transform Service. It relies on the
source and target files being stored and retrieved via the Alfresco Shared File
Store (see also [alfresco-sfs.yaml](https://github.com/Alfresco/alfresco-shared-file-store/blob/master/docs/api-definitions/alfresco-sfs.yaml)).
Here's a pseudo-example transform request:
```JSON
{
"schema": 1,
"requestId": "0aead31c-e3ca-42c9-8e16-c1938ff64c3a",
"clientData": "opaque-client-specific-data-123xyz",
"sourceReference": "598387b8-d85d-4557-816e-50f44c969e04",
"sourceSize": 32713,
"sourceMediaType: "image/jpeg",
"sourceExtension": "jpeg",
"targetMediaType: "image/png",
"targetExtension": "png",
"transformRequestOptions": {
"resizeWidth": "25",
"resizePercentage": "true",
"maintainAspectRatio": "true"
}
}
```
Here's a pseudo-example response of a successful transform:
```JSON
{
"schema": 1,
"status": 201
"requestId": "0aead31c-e3ca-42c9-8e16-c1938ff64c3a",
"clientData": "opaque-client-specific-data-123xyz",
"sourceReference": "598387b8-d85d-4557-816e-50f44c969e04",
"targetReference": "5bc81e48-e17a-4727-bd1c-3a279aa6b421"
}
```
Here's a pseudo-example response of a failed transform:
```JSON
{
"schema": 1,
"status": 400,
"errorDetails": "Lorem ipsum dolor sit amet, ..."
"requestId": "0aead31c-e3ca-42c9-8e16-c1938ff64c3a",
"clientData": "opaque-client-specific-data-123xyz",
"sourceReference": "598387b8-d85d-4557-816e-50f44c969e04"
}
```
**Using Multipart (multipart/form-data -> application/octet-stream)**
The Multipart API remains for backwards compatibility (eg. ACS 6.0). It requires
the source file to be uploaded via multipart/form-data (along with transformation
options). The target file is returned as a binary response (application/octet-steam).
operationId: transformOperation
parameters:
- in: body
name: transformRequest
description: The Transform Request including source reference and transform options
required: true
schema:
$ref: '#/definitions/transformRequest'
consumes:
- application/json
- multipart/form-data
produces:
- application/json
- application/octet-stream
responses:
'201':
description: Successful response
schema:
$ref: '#/definitions/transformReply'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/transformer/options':
get:
tags:
- Transform
description: List transform options
operationId: transformOptions
produces:
- application/json
responses:
200:
description: Successful response
schema:
type: array
xml:
name: transformOptions
wrapped: true
items:
$ref: '#/definitions/transformOption'
definitions:
Error:
type: object
required:
- error
properties:
error:
type: object
required:
- statusCode
- briefSummary
- stackTrace
- descriptionURL
properties:
errorKey:
type: string
statusCode:
type: integer
format: int32
briefSummary:
type: string
stackTrace:
type: string
descriptionURL:
type: string
logId:
type: string
transformRequest:
type: object
properties:
requestId:
type: string
sourceReference:
type: string
sourceMediaType:
type: string
sourceSize:
type: integer
format: int64
sourceExtension:
type: string
targetMediaType:
type: string
targetExtension:
type: string
clientData:
type: string
schema:
type: integer
transformRequestOptions:
type: object
additionalProperties:
type: string
transformReply:
type: object
properties:
status:
type: integer
requestId:
type: string
sourceReference:
type: string
targetReference:
type: string
clientData:
type: string
schema:
type: integer
errorDetails:
type: string
transformOption:
type: object
required:
- required
- name
properties:
required:
type: boolean
name:
type: string