@cloudpdf/contract 3.0.0-next.14 → 3.0.0-next.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +12489 -2751
- package/dist/index.js +315 -173
- package/dist/index.js.map +1 -1
- package/dist/openapi.js +343 -177
- package/dist/openapi.js.map +1 -1
- package/openapi.json +22045 -18234
- package/package.json +2 -2
package/dist/openapi.js
CHANGED
|
@@ -1,31 +1,64 @@
|
|
|
1
1
|
// src/openapi.ts
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
AnnotationWireComponents,
|
|
4
|
+
AttachmentWireComponents,
|
|
5
|
+
ChangeWireComponents,
|
|
6
|
+
DocumentWireComponents,
|
|
7
|
+
EngineErrorPayloadSchema as EngineErrorPayloadSchema2,
|
|
8
|
+
FormWireComponents,
|
|
9
|
+
OutlineWireComponents,
|
|
10
|
+
PdfActionWireComponents
|
|
11
|
+
} from "@embedpdf/engine-core/wire";
|
|
3
12
|
import { z as z2 } from "zod";
|
|
4
13
|
import { ignoreOverride, zodToJsonSchema } from "zod-to-json-schema";
|
|
5
14
|
|
|
6
15
|
// src/index.ts
|
|
7
16
|
import {
|
|
17
|
+
ChangeRequestSchema,
|
|
18
|
+
ChangeResponseSchema,
|
|
8
19
|
PageScaleInputSchema,
|
|
9
20
|
PageScaleResultSchema,
|
|
10
|
-
|
|
21
|
+
PageMeasurementViewportListSchema
|
|
11
22
|
} from "@embedpdf/engine-core/wire";
|
|
12
23
|
import {
|
|
13
|
-
|
|
14
|
-
|
|
24
|
+
AnnotationCreateResultSchema,
|
|
25
|
+
AnnotationDeleteResultSchema,
|
|
26
|
+
AnnotationFlattenResultSchema,
|
|
27
|
+
AnnotationListSchema,
|
|
28
|
+
AnnotationReorderBodySchema,
|
|
29
|
+
AnnotationReorderResultSchema,
|
|
30
|
+
AnnotationUpdateResultSchema,
|
|
15
31
|
DocumentHeadSchema,
|
|
16
32
|
DocumentManifestSchema,
|
|
33
|
+
CustomMetadataSchema,
|
|
17
34
|
DocumentMetadataSchema,
|
|
35
|
+
DocumentOutlineSchema,
|
|
18
36
|
EngineErrorPayloadSchema,
|
|
37
|
+
FormResetBodySchema,
|
|
38
|
+
FormWidgetDeleteResultSchema,
|
|
39
|
+
FormWidgetUpdateBodySchema,
|
|
40
|
+
FormWidgetUpdateResultSchema,
|
|
41
|
+
FormWidgetsReorderBodySchema,
|
|
42
|
+
FormWidgetsReorderResultSchema,
|
|
43
|
+
FormCalculationsReorderBodySchema,
|
|
44
|
+
FormCalculationsReorderResultSchema,
|
|
45
|
+
FormResetResultSchema,
|
|
46
|
+
FormSetValueResultSchema,
|
|
19
47
|
FormSnapshotSchema,
|
|
20
|
-
|
|
48
|
+
IdentitySchema,
|
|
49
|
+
PageFlattenResultSchema,
|
|
50
|
+
PageNameResultSchema,
|
|
51
|
+
RedactionApplyResultSchema,
|
|
52
|
+
RedactionApplyScopeSchema,
|
|
21
53
|
PageTextSnapshotSchema,
|
|
22
54
|
ChangeAnalysisSchema,
|
|
23
55
|
DocumentVersionsSchema,
|
|
24
|
-
|
|
56
|
+
SignatureCancelResultSchema,
|
|
25
57
|
SignatureCompleteBodySchema,
|
|
26
58
|
SignatureCompleteResultSchema,
|
|
27
59
|
SignaturePreparedWireSchema,
|
|
28
60
|
SignatureSnapshotSchema,
|
|
61
|
+
AttachmentListSchema,
|
|
29
62
|
wireTemplates
|
|
30
63
|
} from "@embedpdf/engine-core/wire";
|
|
31
64
|
import { z } from "zod";
|
|
@@ -162,7 +195,7 @@ var AdminImportSourceSchema = z.discriminatedUnion("kind", [
|
|
|
162
195
|
"The operator pre-registered the authority: the request names a connection and a key inside it. Which provider backs the connection (S3, GCS, Azure Blob, filesystem, ...) is deployment configuration, never wire surface."
|
|
163
196
|
)
|
|
164
197
|
]).describe(
|
|
165
|
-
"Where CloudPDF pulls the bytes from. The two shapes differ in
|
|
198
|
+
"Where CloudPDF pulls the bytes from. The two shapes differ in who supplies the authority to read, not in which storage vendor holds the file."
|
|
166
199
|
);
|
|
167
200
|
var AdminDocumentImportRequestSchema = z.object({
|
|
168
201
|
source: AdminImportSourceSchema,
|
|
@@ -171,7 +204,7 @@ var AdminDocumentImportRequestSchema = z.object({
|
|
|
171
204
|
* against the source's declared Content-Length before the transfer,
|
|
172
205
|
* `sha256` against the server-observed digest after it. When absent
|
|
173
206
|
* the server-observed values become authoritative.
|
|
174
|
-
* `dedupMode=reuse-existing`
|
|
207
|
+
* `dedupMode=reuse-existing` requires `sha256` — without a declared
|
|
175
208
|
* hash the server cannot know what content to reuse.
|
|
176
209
|
*/
|
|
177
210
|
expected: z.object({
|
|
@@ -262,7 +295,7 @@ var AdminTokenRevokeRequestSchema = z.object({
|
|
|
262
295
|
/** Optional human reason, written to the audit row. */
|
|
263
296
|
reason: z.string().max(1024).optional(),
|
|
264
297
|
/**
|
|
265
|
-
* The token's `exp` (unix seconds)
|
|
298
|
+
* The token's `exp` (unix seconds); the revocation row is garbage-collected
|
|
266
299
|
* once the token would have expired anyway. Defaults server-side to
|
|
267
300
|
* now + 30 days.
|
|
268
301
|
*/
|
|
@@ -329,10 +362,12 @@ var AdminTokenIssueDocRequestSchema = z.object({
|
|
|
329
362
|
* vocabulary — an unknown string rejects the whole request.
|
|
330
363
|
*/
|
|
331
364
|
scope: z.array(z.string().min(1).max(128)).min(1).max(64),
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
365
|
+
/**
|
|
366
|
+
* Who the token acts for: the same `Identity` the local engine takes at
|
|
367
|
+
* open time. `displayName` becomes the author of the annotations the token
|
|
368
|
+
* creates, `userId` and `groupId` their owner and group.
|
|
369
|
+
*/
|
|
370
|
+
identity: IdentitySchema.optional(),
|
|
336
371
|
/**
|
|
337
372
|
* Origin lock: web origins (scheme + host, optional port; one leading
|
|
338
373
|
* `*.` wildcard label allowed) the minted token may be presented
|
|
@@ -779,7 +814,7 @@ var adminOperations = {
|
|
|
779
814
|
403: { contentType: "application/json", schema: AdminErrorPayloadSchema },
|
|
780
815
|
404: { contentType: "application/json", schema: AdminErrorPayloadSchema }
|
|
781
816
|
},
|
|
782
|
-
notes: "The returned share id
|
|
817
|
+
notes: "The returned share id is the public share token. Mounted only when the deployment can sign (HS256 mode) \u2014 exchange mints session JWTs, so grants exist only where minting does."
|
|
783
818
|
},
|
|
784
819
|
"shares.list": {
|
|
785
820
|
operationId: "shares.list",
|
|
@@ -867,22 +902,35 @@ var DocLayerParamsSchema = DocIdParamsSchema.extend({
|
|
|
867
902
|
layerName: z.string().min(1)
|
|
868
903
|
});
|
|
869
904
|
var DocPageParamsSchema = DocLayerParamsSchema.extend({
|
|
870
|
-
|
|
905
|
+
pageKey: z.string().min(1).regex(/^obj:[1-9][0-9]*$/).describe(
|
|
906
|
+
"The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`."
|
|
907
|
+
)
|
|
871
908
|
});
|
|
872
909
|
var DocAnnotationParamsSchema = DocPageParamsSchema.extend({
|
|
873
|
-
annotKey: z.string().min(1)
|
|
910
|
+
annotKey: z.string().min(1).regex(/^(obj:[1-9][0-9]*|base:(0|[1-9][0-9]*))$/).describe(
|
|
911
|
+
"The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life."
|
|
912
|
+
)
|
|
874
913
|
});
|
|
875
914
|
var DocFieldParamsSchema = DocLayerParamsSchema.extend({
|
|
876
915
|
fieldKey: z.string().min(1)
|
|
877
916
|
});
|
|
917
|
+
var DocAttachmentParamsSchema = DocLayerParamsSchema.extend({
|
|
918
|
+
fileKey: z.string().min(1).describe(
|
|
919
|
+
"The embedded file's name-tree key (its `ref.key`), token-text encoded, as `fieldKey` is."
|
|
920
|
+
)
|
|
921
|
+
});
|
|
878
922
|
var documentPasswordHeader = {
|
|
879
923
|
name: "X-Document-Password",
|
|
880
924
|
required: false,
|
|
881
925
|
description: "Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead."
|
|
882
926
|
};
|
|
927
|
+
var idempotencyKeyHeader = {
|
|
928
|
+
name: "Idempotency-Key",
|
|
929
|
+
required: false,
|
|
930
|
+
description: "Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing."
|
|
931
|
+
};
|
|
883
932
|
var looseJson = z.record(z.string(), z.unknown());
|
|
884
933
|
var docCredentials = ["api-token", "doc-jwt"];
|
|
885
|
-
var MutationResponseSchema = z.object({ meta: MutationMetaSchema }).passthrough();
|
|
886
934
|
var DocSigningParamsSchema = DocLayerParamsSchema.extend({
|
|
887
935
|
signingId: z.string().min(1)
|
|
888
936
|
});
|
|
@@ -958,6 +1006,74 @@ var docOperations = {
|
|
|
958
1006
|
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
959
1007
|
}
|
|
960
1008
|
},
|
|
1009
|
+
"doc.metadata.custom.get": {
|
|
1010
|
+
operationId: "doc.metadata.custom.get",
|
|
1011
|
+
title: "Get custom keys",
|
|
1012
|
+
summary: "The Info dictionary's own keys for a layer: every key but the standard fields, as { key: value }.",
|
|
1013
|
+
method: "GET",
|
|
1014
|
+
path: wireTemplates.layerCustomMetadata,
|
|
1015
|
+
credentials: docCredentials,
|
|
1016
|
+
scope: [],
|
|
1017
|
+
docCapabilities: ["doc.open"],
|
|
1018
|
+
requestHeaders: [documentPasswordHeader],
|
|
1019
|
+
params: DocLayerParamsSchema,
|
|
1020
|
+
responses: {
|
|
1021
|
+
200: { contentType: "application/json", schema: CustomMetadataSchema },
|
|
1022
|
+
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1023
|
+
}
|
|
1024
|
+
},
|
|
1025
|
+
"doc.outline.get": {
|
|
1026
|
+
operationId: "doc.outline.get",
|
|
1027
|
+
title: "Get outline",
|
|
1028
|
+
summary: "The document's outline (its bookmarks) for a layer: every item, depth first, with its parent, its target in page space, its look and whether it opens. Edit it with the outline ops of a change.",
|
|
1029
|
+
method: "GET",
|
|
1030
|
+
path: wireTemplates.layerOutline,
|
|
1031
|
+
credentials: docCredentials,
|
|
1032
|
+
scope: [],
|
|
1033
|
+
docCapabilities: ["doc.open"],
|
|
1034
|
+
requestHeaders: [documentPasswordHeader],
|
|
1035
|
+
params: DocLayerParamsSchema,
|
|
1036
|
+
responses: {
|
|
1037
|
+
200: { contentType: "application/json", schema: DocumentOutlineSchema },
|
|
1038
|
+
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1039
|
+
}
|
|
1040
|
+
},
|
|
1041
|
+
"doc.attachments.list": {
|
|
1042
|
+
operationId: "doc.attachments.list",
|
|
1043
|
+
title: "List attachments",
|
|
1044
|
+
summary: "The files embedded in the document (its /EmbeddedFiles) for a layer, in key order: each with its name, type, description, size, checksum and dates, never its bytes. Add and remove them with the attachment ops of a change.",
|
|
1045
|
+
method: "GET",
|
|
1046
|
+
path: wireTemplates.layerAttachments,
|
|
1047
|
+
credentials: docCredentials,
|
|
1048
|
+
scope: [],
|
|
1049
|
+
docCapabilities: ["doc.open"],
|
|
1050
|
+
requestHeaders: [documentPasswordHeader],
|
|
1051
|
+
params: DocLayerParamsSchema,
|
|
1052
|
+
responses: {
|
|
1053
|
+
200: { contentType: "application/json", schema: AttachmentListSchema },
|
|
1054
|
+
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1055
|
+
},
|
|
1056
|
+
notes: "A file-attachment annotation's file is listed with the annotation; read its bytes with `doc.annotations.readFile`."
|
|
1057
|
+
},
|
|
1058
|
+
"doc.attachments.download": {
|
|
1059
|
+
operationId: "doc.attachments.download",
|
|
1060
|
+
title: "Download an attachment",
|
|
1061
|
+
summary: "One embedded file's bytes, decoded. Its name and type are what the listing says; `Content-Type` is its type, or `application/octet-stream` when it has none.",
|
|
1062
|
+
method: "GET",
|
|
1063
|
+
path: wireTemplates.layerAttachmentFile,
|
|
1064
|
+
credentials: docCredentials,
|
|
1065
|
+
scope: [],
|
|
1066
|
+
docCapabilities: ["doc.download"],
|
|
1067
|
+
requestHeaders: [documentPasswordHeader],
|
|
1068
|
+
params: DocAttachmentParamsSchema,
|
|
1069
|
+
responses: {
|
|
1070
|
+
200: { contentType: "application/octet-stream" },
|
|
1071
|
+
400: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
1072
|
+
404: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
1073
|
+
413: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1074
|
+
},
|
|
1075
|
+
notes: "A file that decodes past the server's limit is refused (PayloadTooLarge)."
|
|
1076
|
+
},
|
|
961
1077
|
"doc.signatures.list": {
|
|
962
1078
|
operationId: "doc.signatures.list",
|
|
963
1079
|
title: "List signatures",
|
|
@@ -1012,7 +1128,7 @@ var docOperations = {
|
|
|
1012
1128
|
404: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
1013
1129
|
409: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1014
1130
|
},
|
|
1015
|
-
notes: "
|
|
1131
|
+
notes: "Multipart: a JSON `body` part (field, subFilter, digest, contentsSize, signer, certify, lock), naming the appearance PDF it may carry as `resources: { appearance: '<key>' }`, and that PDF as the part `resource:<key>`. A certification (`certify.permission`) additionally requires `doc.sign.certify`. The layer is read-only until the signing completes, is cancelled, or expires (15 minutes). A layer behind the document head cannot sign (StaleBase)."
|
|
1016
1132
|
},
|
|
1017
1133
|
"doc.signatures.complete": {
|
|
1018
1134
|
operationId: "doc.signatures.complete",
|
|
@@ -1034,19 +1150,19 @@ var docOperations = {
|
|
|
1034
1150
|
},
|
|
1035
1151
|
notes: "`cms` is the detached CMS over the prepared digest, base64. `expectedVersion` must be what prepare returned. Idempotent by signing id: the same CMS again answers `already-completed`. Every layer of the document then sits over the new version; refetch the manifest after a completion."
|
|
1036
1152
|
},
|
|
1037
|
-
"doc.signatures.
|
|
1038
|
-
operationId: "doc.signatures.
|
|
1039
|
-
title: "
|
|
1153
|
+
"doc.signatures.cancel": {
|
|
1154
|
+
operationId: "doc.signatures.cancel",
|
|
1155
|
+
title: "Cancel a signature",
|
|
1040
1156
|
summary: "Discard a pending signing candidate.",
|
|
1041
1157
|
method: "DELETE",
|
|
1042
|
-
path: wireTemplates.
|
|
1158
|
+
path: wireTemplates.layerSignatureCancel,
|
|
1043
1159
|
credentials: docCredentials,
|
|
1044
1160
|
scope: [],
|
|
1045
1161
|
docCapabilities: ["doc.sign"],
|
|
1046
1162
|
requestHeaders: [documentPasswordHeader],
|
|
1047
1163
|
params: DocSigningParamsSchema,
|
|
1048
1164
|
responses: {
|
|
1049
|
-
200: { contentType: "application/json", schema:
|
|
1165
|
+
200: { contentType: "application/json", schema: SignatureCancelResultSchema },
|
|
1050
1166
|
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1051
1167
|
}
|
|
1052
1168
|
},
|
|
@@ -1213,7 +1329,7 @@ var docOperations = {
|
|
|
1213
1329
|
requestHeaders: [documentPasswordHeader],
|
|
1214
1330
|
params: DocPageParamsSchema,
|
|
1215
1331
|
responses: {
|
|
1216
|
-
200: { contentType: "application/json", schema:
|
|
1332
|
+
200: { contentType: "application/json", schema: AnnotationListSchema },
|
|
1217
1333
|
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1218
1334
|
}
|
|
1219
1335
|
},
|
|
@@ -1228,13 +1344,45 @@ var docOperations = {
|
|
|
1228
1344
|
docCapabilities: ["doc.annotate.read"],
|
|
1229
1345
|
requestHeaders: [documentPasswordHeader],
|
|
1230
1346
|
params: DocLayerParamsSchema,
|
|
1231
|
-
notes: "Returns one entry per page plus the audit-log cursor for reconciling subsequent document events. Page order is unspecified; join by `
|
|
1347
|
+
notes: "Returns one entry per page plus the audit-log cursor for reconciling subsequent document events. Page order is unspecified; join by `page` (a `PageRef`) when display order matters.",
|
|
1232
1348
|
responses: {
|
|
1233
|
-
200: { contentType: "application/json", schema:
|
|
1349
|
+
200: { contentType: "application/json", schema: AnnotationListSchema },
|
|
1234
1350
|
404: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
1235
1351
|
409: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1236
1352
|
}
|
|
1237
1353
|
},
|
|
1354
|
+
"doc.changes": {
|
|
1355
|
+
operationId: "doc.changes",
|
|
1356
|
+
title: "Apply changes",
|
|
1357
|
+
summary: "Apply user actions to a layer, each a change whose ops apply in order, all or none, or the undo of an earlier change.",
|
|
1358
|
+
method: "POST",
|
|
1359
|
+
path: wireTemplates.layerChanges,
|
|
1360
|
+
credentials: docCredentials,
|
|
1361
|
+
scope: [],
|
|
1362
|
+
docCapabilities: [
|
|
1363
|
+
"doc.annotate.modify",
|
|
1364
|
+
"doc.attachments.modify",
|
|
1365
|
+
"doc.forms.fill",
|
|
1366
|
+
"doc.forms.modify",
|
|
1367
|
+
"doc.metadata.modify",
|
|
1368
|
+
"doc.outline.modify",
|
|
1369
|
+
"doc.pages.assemble"
|
|
1370
|
+
],
|
|
1371
|
+
requestHeaders: [documentPasswordHeader],
|
|
1372
|
+
params: DocLayerParamsSchema,
|
|
1373
|
+
body: {
|
|
1374
|
+
contentType: ["application/json", "multipart/form-data"],
|
|
1375
|
+
schema: ChangeRequestSchema
|
|
1376
|
+
},
|
|
1377
|
+
notes: "Each change stands on its own and names itself by `opId`: a refused change rolls back alone, and the answer lists every change in order, applied with its result or refused with its error. Asked again under its `opId`, a change gets the same answer, refusals included; a different change under an answered `opId` is refused (IdempotencyKeyReused). `{ opId, undoOf }` undoes an earlier change of the caller, here or in an earlier request; an undo leaves alone what was changed since, and the undo of an undo redoes. A redaction, a flatten, a form repair or a completed signature ends undo for the changes before it (UndoUnavailable). Each op is checked against its own capability: annotation ops need `doc.annotate.modify`, form values `doc.forms.fill`, form structure `doc.forms.modify`, metadata `doc.metadata.modify`, outline `doc.outline.modify`, pages `doc.pages.assemble`, embedded files `doc.attachments.modify`. Bytes (a stamp's drawing, an attached file, a signature's artwork, a PDF whose pages come in) travel as multipart: a JSON `body` part, each op naming its files by role as `resources: { <role>: '<key>' }`, and each file as the part `resource:<key>`. At most 64 changes per request and 512 ops per change.",
|
|
1378
|
+
responses: {
|
|
1379
|
+
200: { contentType: "application/json", schema: ChangeResponseSchema },
|
|
1380
|
+
400: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
1381
|
+
404: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
1382
|
+
409: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
1383
|
+
413: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1384
|
+
}
|
|
1385
|
+
},
|
|
1238
1386
|
"doc.annotations.create": {
|
|
1239
1387
|
operationId: "doc.annotations.create",
|
|
1240
1388
|
title: "Create annotation",
|
|
@@ -1244,12 +1392,12 @@ var docOperations = {
|
|
|
1244
1392
|
credentials: docCredentials,
|
|
1245
1393
|
scope: [],
|
|
1246
1394
|
docCapabilities: ["doc.annotate.modify"],
|
|
1247
|
-
requestHeaders: [documentPasswordHeader],
|
|
1395
|
+
requestHeaders: [documentPasswordHeader, idempotencyKeyHeader],
|
|
1248
1396
|
params: DocPageParamsSchema,
|
|
1249
1397
|
body: { contentType: "application/json", schema: looseJson },
|
|
1250
1398
|
notes: "Doc JWTs may instead carry collab scopes (annotations:create:self, \u2026) that refine per-annotation authorship rules; the API token is exempt from both.",
|
|
1251
1399
|
responses: {
|
|
1252
|
-
200: { contentType: "application/json", schema:
|
|
1400
|
+
200: { contentType: "application/json", schema: AnnotationCreateResultSchema },
|
|
1253
1401
|
400: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
1254
1402
|
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1255
1403
|
}
|
|
@@ -1263,11 +1411,11 @@ var docOperations = {
|
|
|
1263
1411
|
credentials: docCredentials,
|
|
1264
1412
|
scope: [],
|
|
1265
1413
|
docCapabilities: ["doc.annotate.modify"],
|
|
1266
|
-
requestHeaders: [documentPasswordHeader],
|
|
1414
|
+
requestHeaders: [documentPasswordHeader, idempotencyKeyHeader],
|
|
1267
1415
|
params: DocAnnotationParamsSchema,
|
|
1268
1416
|
body: { contentType: "application/json", schema: looseJson },
|
|
1269
1417
|
responses: {
|
|
1270
|
-
200: { contentType: "application/json", schema:
|
|
1418
|
+
200: { contentType: "application/json", schema: AnnotationUpdateResultSchema },
|
|
1271
1419
|
400: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
1272
1420
|
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1273
1421
|
}
|
|
@@ -1281,27 +1429,45 @@ var docOperations = {
|
|
|
1281
1429
|
credentials: docCredentials,
|
|
1282
1430
|
scope: [],
|
|
1283
1431
|
docCapabilities: ["doc.annotate.modify"],
|
|
1284
|
-
requestHeaders: [documentPasswordHeader],
|
|
1432
|
+
requestHeaders: [documentPasswordHeader, idempotencyKeyHeader],
|
|
1285
1433
|
params: DocAnnotationParamsSchema,
|
|
1286
1434
|
responses: {
|
|
1287
|
-
200: { contentType: "application/json", schema:
|
|
1435
|
+
200: { contentType: "application/json", schema: AnnotationDeleteResultSchema },
|
|
1436
|
+
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1437
|
+
}
|
|
1438
|
+
},
|
|
1439
|
+
"doc.annotations.reorder": {
|
|
1440
|
+
operationId: "doc.annotations.reorder",
|
|
1441
|
+
title: "Reorder annotations",
|
|
1442
|
+
summary: "Change the stacking order of one page's annotations: they go together, in the order given, next to a neighbour annotation (`{ before }`, `{ after }`) or to the bottom (`'start'`) or top (`'end'`). Widgets paint above every annotation and have their own order (`doc.forms.reorderWidgets`): a widget is refused. Returns the page's new order.",
|
|
1443
|
+
method: "POST",
|
|
1444
|
+
path: wireTemplates.layerAnnotationItemsReorder,
|
|
1445
|
+
credentials: docCredentials,
|
|
1446
|
+
scope: [],
|
|
1447
|
+
docCapabilities: ["doc.annotate.modify"],
|
|
1448
|
+
requestHeaders: [documentPasswordHeader, idempotencyKeyHeader],
|
|
1449
|
+
params: DocPageParamsSchema,
|
|
1450
|
+
body: { contentType: "application/json", schema: AnnotationReorderBodySchema },
|
|
1451
|
+
responses: {
|
|
1452
|
+
200: { contentType: "application/json", schema: AnnotationReorderResultSchema },
|
|
1453
|
+
400: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
1288
1454
|
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1289
1455
|
}
|
|
1290
1456
|
},
|
|
1291
1457
|
"doc.annotations.flatten": {
|
|
1292
1458
|
operationId: "doc.annotations.flatten",
|
|
1293
1459
|
title: "Flatten annotations",
|
|
1294
|
-
summary: "Flatten a chosen set of one page's annotations into its content \u2014 pages.flatten for a selection. Painted annotations are removed; ineligible ones report
|
|
1460
|
+
summary: "Flatten a chosen set of one page's annotations into its content \u2014 pages.flatten for a selection. Painted annotations are removed; ineligible ones report unchanged.",
|
|
1295
1461
|
method: "POST",
|
|
1296
1462
|
path: wireTemplates.layerAnnotationItemsFlatten,
|
|
1297
1463
|
credentials: docCredentials,
|
|
1298
1464
|
scope: [],
|
|
1299
1465
|
docCapabilities: ["doc.pages.modify", "doc.annotate.modify"],
|
|
1300
|
-
requestHeaders: [documentPasswordHeader],
|
|
1466
|
+
requestHeaders: [documentPasswordHeader, idempotencyKeyHeader],
|
|
1301
1467
|
params: DocPageParamsSchema,
|
|
1302
1468
|
body: { contentType: "application/json", schema: looseJson },
|
|
1303
1469
|
responses: {
|
|
1304
|
-
200: { contentType: "application/json", schema:
|
|
1470
|
+
200: { contentType: "application/json", schema: AnnotationFlattenResultSchema },
|
|
1305
1471
|
400: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
1306
1472
|
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1307
1473
|
}
|
|
@@ -1324,10 +1490,46 @@ var docOperations = {
|
|
|
1324
1490
|
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1325
1491
|
}
|
|
1326
1492
|
},
|
|
1327
|
-
"doc.
|
|
1328
|
-
operationId: "doc.
|
|
1329
|
-
title: "
|
|
1330
|
-
summary: "
|
|
1493
|
+
"doc.annotations.readAppearance": {
|
|
1494
|
+
operationId: "doc.annotations.readAppearance",
|
|
1495
|
+
title: "Read an annotation appearance",
|
|
1496
|
+
summary: "A stamp's drawing as a one-page PDF, before the fit, rotation and opacity its data describes: with the data, the bytes to create the same stamp again. A read; the source is untouched.",
|
|
1497
|
+
method: "GET",
|
|
1498
|
+
path: wireTemplates.layerAnnotationItemAppearanceResource,
|
|
1499
|
+
credentials: docCredentials,
|
|
1500
|
+
scope: [],
|
|
1501
|
+
docCapabilities: ["doc.download"],
|
|
1502
|
+
requestHeaders: [documentPasswordHeader],
|
|
1503
|
+
params: DocAnnotationParamsSchema,
|
|
1504
|
+
responses: {
|
|
1505
|
+
200: { contentType: "application/pdf" },
|
|
1506
|
+
400: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
1507
|
+
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1508
|
+
}
|
|
1509
|
+
},
|
|
1510
|
+
"doc.annotations.readFile": {
|
|
1511
|
+
operationId: "doc.annotations.readFile",
|
|
1512
|
+
title: "Read an attached file",
|
|
1513
|
+
summary: "A file-attachment annotation's file, decoded: its `file` resource. Its name and type are what the annotation's `file` says. A read; the source is untouched.",
|
|
1514
|
+
method: "GET",
|
|
1515
|
+
path: wireTemplates.layerAnnotationItemFileResource,
|
|
1516
|
+
credentials: docCredentials,
|
|
1517
|
+
scope: [],
|
|
1518
|
+
docCapabilities: ["doc.download"],
|
|
1519
|
+
requestHeaders: [documentPasswordHeader],
|
|
1520
|
+
params: DocAnnotationParamsSchema,
|
|
1521
|
+
responses: {
|
|
1522
|
+
200: { contentType: "application/octet-stream" },
|
|
1523
|
+
400: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
1524
|
+
404: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
1525
|
+
413: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1526
|
+
},
|
|
1527
|
+
notes: "A file that decodes past the server's limit is refused (PayloadTooLarge)."
|
|
1528
|
+
},
|
|
1529
|
+
"doc.forms.list": {
|
|
1530
|
+
operationId: "doc.forms.list",
|
|
1531
|
+
title: "List form fields",
|
|
1532
|
+
summary: "The form: every field with its value, every widget's row (its place, look and state), and the calculation order. A form field's widgets come with the form, never with the annotations.",
|
|
1331
1533
|
method: "GET",
|
|
1332
1534
|
path: wireTemplates.layerForm,
|
|
1333
1535
|
credentials: docCredentials,
|
|
@@ -1349,62 +1551,100 @@ var docOperations = {
|
|
|
1349
1551
|
credentials: docCredentials,
|
|
1350
1552
|
scope: [],
|
|
1351
1553
|
docCapabilities: ["doc.forms.fill"],
|
|
1352
|
-
requestHeaders: [documentPasswordHeader],
|
|
1554
|
+
requestHeaders: [documentPasswordHeader, idempotencyKeyHeader],
|
|
1353
1555
|
params: DocFieldParamsSchema,
|
|
1354
1556
|
body: { contentType: "application/json", schema: looseJson },
|
|
1355
1557
|
responses: {
|
|
1356
|
-
200: { contentType: "application/json", schema:
|
|
1558
|
+
200: { contentType: "application/json", schema: FormSetValueResultSchema },
|
|
1357
1559
|
400: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
1358
1560
|
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1359
1561
|
}
|
|
1360
1562
|
},
|
|
1361
|
-
"doc.forms.
|
|
1362
|
-
operationId: "doc.forms.
|
|
1363
|
-
title: "
|
|
1364
|
-
summary: "
|
|
1563
|
+
"doc.forms.updateWidget": {
|
|
1564
|
+
operationId: "doc.forms.updateWidget",
|
|
1565
|
+
title: "Update form widget",
|
|
1566
|
+
summary: "Change a widget's place and look: what an annotation update takes, for a form field's widget. A widget is the form's, so the annotation routes refuse one.",
|
|
1567
|
+
method: "PATCH",
|
|
1568
|
+
path: wireTemplates.layerFormWidget,
|
|
1569
|
+
credentials: docCredentials,
|
|
1570
|
+
scope: [],
|
|
1571
|
+
docCapabilities: ["doc.forms.modify"],
|
|
1572
|
+
requestHeaders: [documentPasswordHeader, idempotencyKeyHeader],
|
|
1573
|
+
params: DocAnnotationParamsSchema,
|
|
1574
|
+
body: { contentType: "application/json", schema: FormWidgetUpdateBodySchema },
|
|
1575
|
+
responses: {
|
|
1576
|
+
200: { contentType: "application/json", schema: FormWidgetUpdateResultSchema },
|
|
1577
|
+
400: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
1578
|
+
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1579
|
+
}
|
|
1580
|
+
},
|
|
1581
|
+
"doc.forms.deleteWidget": {
|
|
1582
|
+
operationId: "doc.forms.deleteWidget",
|
|
1583
|
+
title: "Delete form widget",
|
|
1584
|
+
summary: "Delete a widget: it leaves its page, and its field when it has one. The field survives, unplaced when this was its last widget. A widget that is its field's own dictionary is refused: delete the field. A widget is the form's, so the annotation routes refuse one.",
|
|
1585
|
+
method: "DELETE",
|
|
1586
|
+
path: wireTemplates.layerFormWidget,
|
|
1587
|
+
credentials: docCredentials,
|
|
1588
|
+
scope: [],
|
|
1589
|
+
docCapabilities: ["doc.forms.modify"],
|
|
1590
|
+
requestHeaders: [documentPasswordHeader, idempotencyKeyHeader],
|
|
1591
|
+
params: DocAnnotationParamsSchema,
|
|
1592
|
+
responses: {
|
|
1593
|
+
200: { contentType: "application/json", schema: FormWidgetDeleteResultSchema },
|
|
1594
|
+
400: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
1595
|
+
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1596
|
+
}
|
|
1597
|
+
},
|
|
1598
|
+
"doc.forms.reorderWidgets": {
|
|
1599
|
+
operationId: "doc.forms.reorderWidgets",
|
|
1600
|
+
title: "Reorder form widgets",
|
|
1601
|
+
summary: "Change the stacking order of one page's widgets: they go together, in the order given, next to a neighbour widget or to the bottom (`'start'`) or top (`'end'`) of the page's widgets, which paint above every annotation. Where the page's `/Tabs` follows it, this is also the tab order. Returns the page's new widget order.",
|
|
1365
1602
|
method: "POST",
|
|
1366
|
-
path: wireTemplates.
|
|
1603
|
+
path: wireTemplates.layerFormWidgetsReorder,
|
|
1367
1604
|
credentials: docCredentials,
|
|
1368
1605
|
scope: [],
|
|
1369
|
-
docCapabilities: ["doc.forms.
|
|
1370
|
-
requestHeaders: [documentPasswordHeader],
|
|
1371
|
-
params:
|
|
1606
|
+
docCapabilities: ["doc.forms.modify"],
|
|
1607
|
+
requestHeaders: [documentPasswordHeader, idempotencyKeyHeader],
|
|
1608
|
+
params: DocPageParamsSchema,
|
|
1609
|
+
body: { contentType: "application/json", schema: FormWidgetsReorderBodySchema },
|
|
1372
1610
|
responses: {
|
|
1373
|
-
200: { contentType: "application/json", schema:
|
|
1611
|
+
200: { contentType: "application/json", schema: FormWidgetsReorderResultSchema },
|
|
1612
|
+
400: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
1374
1613
|
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1375
1614
|
}
|
|
1376
1615
|
},
|
|
1377
|
-
"doc.forms.
|
|
1378
|
-
operationId: "doc.forms.
|
|
1379
|
-
title: "
|
|
1380
|
-
summary: "
|
|
1381
|
-
method: "
|
|
1382
|
-
path: wireTemplates.
|
|
1616
|
+
"doc.forms.reorderCalculations": {
|
|
1617
|
+
operationId: "doc.forms.reorderCalculations",
|
|
1618
|
+
title: "Reorder form calculations",
|
|
1619
|
+
summary: "Change the form's calculation order, the order its fields' calculate scripts run in: the fields go together, in the order given, next to a neighbour field or to the start (`'start'`) or end (`'end'`). Every field named must have a calculate script, which puts it in the order. Returns the whole new order.",
|
|
1620
|
+
method: "POST",
|
|
1621
|
+
path: wireTemplates.layerFormCalculationsReorder,
|
|
1383
1622
|
credentials: docCredentials,
|
|
1384
1623
|
scope: [],
|
|
1385
|
-
docCapabilities: ["doc.forms.
|
|
1386
|
-
requestHeaders: [documentPasswordHeader],
|
|
1624
|
+
docCapabilities: ["doc.forms.modify"],
|
|
1625
|
+
requestHeaders: [documentPasswordHeader, idempotencyKeyHeader],
|
|
1387
1626
|
params: DocLayerParamsSchema,
|
|
1388
|
-
|
|
1627
|
+
body: { contentType: "application/json", schema: FormCalculationsReorderBodySchema },
|
|
1389
1628
|
responses: {
|
|
1390
|
-
200: { contentType:
|
|
1629
|
+
200: { contentType: "application/json", schema: FormCalculationsReorderResultSchema },
|
|
1630
|
+
400: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
1391
1631
|
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1392
1632
|
}
|
|
1393
1633
|
},
|
|
1394
|
-
"doc.forms.
|
|
1395
|
-
operationId: "doc.forms.
|
|
1396
|
-
title: "
|
|
1397
|
-
summary: "
|
|
1634
|
+
"doc.forms.reset": {
|
|
1635
|
+
operationId: "doc.forms.reset",
|
|
1636
|
+
title: "Reset form",
|
|
1637
|
+
summary: "Reset the fields named in `refs` to their default values, or the whole form without it. Returns the fields that changed.",
|
|
1398
1638
|
method: "POST",
|
|
1399
|
-
path: wireTemplates.
|
|
1639
|
+
path: wireTemplates.layerFormReset,
|
|
1400
1640
|
credentials: docCredentials,
|
|
1401
1641
|
scope: [],
|
|
1402
1642
|
docCapabilities: ["doc.forms.fill"],
|
|
1403
|
-
requestHeaders: [documentPasswordHeader],
|
|
1643
|
+
requestHeaders: [documentPasswordHeader, idempotencyKeyHeader],
|
|
1404
1644
|
params: DocLayerParamsSchema,
|
|
1405
|
-
body: { contentType: "application/json", schema:
|
|
1645
|
+
body: { contentType: "application/json", schema: FormResetBodySchema },
|
|
1406
1646
|
responses: {
|
|
1407
|
-
200: { contentType: "application/json", schema:
|
|
1647
|
+
200: { contentType: "application/json", schema: FormResetResultSchema },
|
|
1408
1648
|
400: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
1409
1649
|
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1410
1650
|
}
|
|
@@ -1421,7 +1661,7 @@ var docOperations = {
|
|
|
1421
1661
|
requestHeaders: [documentPasswordHeader],
|
|
1422
1662
|
params: DocPageParamsSchema,
|
|
1423
1663
|
responses: {
|
|
1424
|
-
200: { contentType: "application/json", schema:
|
|
1664
|
+
200: { contentType: "application/json", schema: PageMeasurementViewportListSchema },
|
|
1425
1665
|
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1426
1666
|
}
|
|
1427
1667
|
},
|
|
@@ -1434,7 +1674,7 @@ var docOperations = {
|
|
|
1434
1674
|
credentials: docCredentials,
|
|
1435
1675
|
scope: [],
|
|
1436
1676
|
docCapabilities: ["doc.annotate.modify"],
|
|
1437
|
-
requestHeaders: [documentPasswordHeader],
|
|
1677
|
+
requestHeaders: [documentPasswordHeader, idempotencyKeyHeader],
|
|
1438
1678
|
params: DocPageParamsSchema,
|
|
1439
1679
|
body: { contentType: "application/json", schema: PageScaleInputSchema },
|
|
1440
1680
|
responses: {
|
|
@@ -1443,60 +1683,6 @@ var docOperations = {
|
|
|
1443
1683
|
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1444
1684
|
}
|
|
1445
1685
|
},
|
|
1446
|
-
"doc.pages.move": {
|
|
1447
|
-
operationId: "doc.pages.move",
|
|
1448
|
-
title: "Move pages",
|
|
1449
|
-
summary: "Reorder pages.",
|
|
1450
|
-
method: "POST",
|
|
1451
|
-
path: wireTemplates.layerPagesMove,
|
|
1452
|
-
credentials: docCredentials,
|
|
1453
|
-
scope: [],
|
|
1454
|
-
docCapabilities: ["doc.pages.assemble"],
|
|
1455
|
-
requestHeaders: [documentPasswordHeader],
|
|
1456
|
-
params: DocLayerParamsSchema,
|
|
1457
|
-
body: { contentType: "application/json", schema: looseJson },
|
|
1458
|
-
responses: {
|
|
1459
|
-
200: { contentType: "application/json", schema: MutationResponseSchema },
|
|
1460
|
-
400: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
1461
|
-
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1462
|
-
}
|
|
1463
|
-
},
|
|
1464
|
-
"doc.pages.rotate": {
|
|
1465
|
-
operationId: "doc.pages.rotate",
|
|
1466
|
-
title: "Rotate pages",
|
|
1467
|
-
summary: "Set absolute rotation on pages.",
|
|
1468
|
-
method: "POST",
|
|
1469
|
-
path: wireTemplates.layerPagesRotate,
|
|
1470
|
-
credentials: docCredentials,
|
|
1471
|
-
scope: [],
|
|
1472
|
-
docCapabilities: ["doc.pages.assemble"],
|
|
1473
|
-
requestHeaders: [documentPasswordHeader],
|
|
1474
|
-
params: DocLayerParamsSchema,
|
|
1475
|
-
body: { contentType: "application/json", schema: looseJson },
|
|
1476
|
-
responses: {
|
|
1477
|
-
200: { contentType: "application/json", schema: MutationResponseSchema },
|
|
1478
|
-
400: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
1479
|
-
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1480
|
-
}
|
|
1481
|
-
},
|
|
1482
|
-
"doc.pages.delete": {
|
|
1483
|
-
operationId: "doc.pages.delete",
|
|
1484
|
-
title: "Delete pages",
|
|
1485
|
-
summary: "Delete pages.",
|
|
1486
|
-
method: "POST",
|
|
1487
|
-
path: wireTemplates.layerPagesDelete,
|
|
1488
|
-
credentials: docCredentials,
|
|
1489
|
-
scope: [],
|
|
1490
|
-
docCapabilities: ["doc.pages.assemble"],
|
|
1491
|
-
requestHeaders: [documentPasswordHeader],
|
|
1492
|
-
params: DocLayerParamsSchema,
|
|
1493
|
-
body: { contentType: "application/json", schema: looseJson },
|
|
1494
|
-
responses: {
|
|
1495
|
-
200: { contentType: "application/json", schema: MutationResponseSchema },
|
|
1496
|
-
400: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
1497
|
-
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1498
|
-
}
|
|
1499
|
-
},
|
|
1500
1686
|
"doc.pages.setName": {
|
|
1501
1687
|
operationId: "doc.pages.setName",
|
|
1502
1688
|
title: "Set page name",
|
|
@@ -1506,11 +1692,11 @@ var docOperations = {
|
|
|
1506
1692
|
credentials: docCredentials,
|
|
1507
1693
|
scope: [],
|
|
1508
1694
|
docCapabilities: ["doc.pages.assemble"],
|
|
1509
|
-
requestHeaders: [documentPasswordHeader],
|
|
1695
|
+
requestHeaders: [documentPasswordHeader, idempotencyKeyHeader],
|
|
1510
1696
|
params: DocLayerParamsSchema,
|
|
1511
1697
|
body: { contentType: "application/json", schema: looseJson },
|
|
1512
1698
|
responses: {
|
|
1513
|
-
200: { contentType: "application/json", schema:
|
|
1699
|
+
200: { contentType: "application/json", schema: PageNameResultSchema },
|
|
1514
1700
|
400: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
1515
1701
|
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1516
1702
|
}
|
|
@@ -1524,11 +1710,11 @@ var docOperations = {
|
|
|
1524
1710
|
credentials: docCredentials,
|
|
1525
1711
|
scope: [],
|
|
1526
1712
|
docCapabilities: ["doc.pages.assemble"],
|
|
1527
|
-
requestHeaders: [documentPasswordHeader],
|
|
1713
|
+
requestHeaders: [documentPasswordHeader, idempotencyKeyHeader],
|
|
1528
1714
|
params: DocLayerParamsSchema,
|
|
1529
1715
|
body: { contentType: "application/json", schema: looseJson },
|
|
1530
1716
|
responses: {
|
|
1531
|
-
200: { contentType: "application/json", schema:
|
|
1717
|
+
200: { contentType: "application/json", schema: PageNameResultSchema },
|
|
1532
1718
|
400: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
1533
1719
|
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1534
1720
|
}
|
|
@@ -1542,55 +1728,15 @@ var docOperations = {
|
|
|
1542
1728
|
credentials: docCredentials,
|
|
1543
1729
|
scope: [],
|
|
1544
1730
|
docCapabilities: ["doc.pages.modify", "doc.annotate.modify"],
|
|
1545
|
-
requestHeaders: [documentPasswordHeader],
|
|
1731
|
+
requestHeaders: [documentPasswordHeader, idempotencyKeyHeader],
|
|
1546
1732
|
params: DocLayerParamsSchema,
|
|
1547
1733
|
body: { contentType: "application/json", schema: looseJson, required: false },
|
|
1548
1734
|
responses: {
|
|
1549
|
-
200: { contentType: "application/json", schema:
|
|
1735
|
+
200: { contentType: "application/json", schema: PageFlattenResultSchema },
|
|
1550
1736
|
400: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
1551
1737
|
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1552
1738
|
}
|
|
1553
1739
|
},
|
|
1554
|
-
"doc.pages.insert": {
|
|
1555
|
-
operationId: "doc.pages.insert",
|
|
1556
|
-
title: "Insert pages from a PDF",
|
|
1557
|
-
summary: "Copy every page of an uploaded PDF into the document at an index.",
|
|
1558
|
-
method: "POST",
|
|
1559
|
-
path: wireTemplates.layerPagesInsert,
|
|
1560
|
-
credentials: docCredentials,
|
|
1561
|
-
scope: [],
|
|
1562
|
-
docCapabilities: ["doc.pages.assemble"],
|
|
1563
|
-
requestHeaders: [documentPasswordHeader],
|
|
1564
|
-
params: DocLayerParamsSchema,
|
|
1565
|
-
body: {
|
|
1566
|
-
contentType: "multipart/form-data"
|
|
1567
|
-
},
|
|
1568
|
-
responses: {
|
|
1569
|
-
200: { contentType: "application/json", schema: MutationResponseSchema },
|
|
1570
|
-
400: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
1571
|
-
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1572
|
-
},
|
|
1573
|
-
notes: 'Multipart mutation envelope: a `body` field holding `{"destIndex"?: number}` (omitted \u2192 append) plus a `resource:source` file part carrying the standalone PDF whose pages are copied in. The inserted copies get fresh page object numbers, returned in insertion order.'
|
|
1574
|
-
},
|
|
1575
|
-
"doc.pages.insertBlank": {
|
|
1576
|
-
operationId: "doc.pages.insertBlank",
|
|
1577
|
-
title: "Insert blank pages",
|
|
1578
|
-
summary: "Create blank pages of an explicit size at an index.",
|
|
1579
|
-
method: "POST",
|
|
1580
|
-
path: wireTemplates.layerPagesInsertBlank,
|
|
1581
|
-
credentials: docCredentials,
|
|
1582
|
-
scope: [],
|
|
1583
|
-
docCapabilities: ["doc.pages.assemble"],
|
|
1584
|
-
requestHeaders: [documentPasswordHeader],
|
|
1585
|
-
params: DocLayerParamsSchema,
|
|
1586
|
-
body: { contentType: "application/json", schema: looseJson },
|
|
1587
|
-
responses: {
|
|
1588
|
-
200: { contentType: "application/json", schema: MutationResponseSchema },
|
|
1589
|
-
400: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
1590
|
-
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1591
|
-
},
|
|
1592
|
-
notes: 'Body is `{"size": {"width", "height"}, "count"?, "destIndex"?}` \u2014 size in PDF points, count in [1, 100], destIndex omitted \u2192 append.'
|
|
1593
|
-
},
|
|
1594
1740
|
"doc.pages.extract": {
|
|
1595
1741
|
operationId: "doc.pages.extract",
|
|
1596
1742
|
title: "Extract pages",
|
|
@@ -1608,7 +1754,7 @@ var docOperations = {
|
|
|
1608
1754
|
400: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
1609
1755
|
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1610
1756
|
},
|
|
1611
|
-
notes: 'A read, not a mutation: the source document is untouched and no event is published. Body is `{"
|
|
1757
|
+
notes: 'A read, not a mutation: the source document is untouched and no event is published. Body is `{"pages": PageRef[], "flatten"?: {"usage"?: "display" | "print"}, "includeAnnotations"?: boolean, "includeFormFields"?: boolean}`; the response body is the new PDF. With `flatten` the copy is the pages as they draw for `usage` (`"print"`: a print copy): the annotations and form fields painted in, nothing interactive left, layers in their state for the usage. A flattened copy takes `doc.download` or `doc.download.flattened`, and paints only what the caller may read; `includeAnnotations` and `includeFormFields` choose what it paints, and are refused without `flatten`.'
|
|
1612
1758
|
},
|
|
1613
1759
|
"doc.redactions.apply": {
|
|
1614
1760
|
operationId: "doc.redactions.apply",
|
|
@@ -1619,11 +1765,11 @@ var docOperations = {
|
|
|
1619
1765
|
credentials: docCredentials,
|
|
1620
1766
|
scope: [],
|
|
1621
1767
|
docCapabilities: ["doc.pages.modify", "doc.annotate.modify", "doc.redact"],
|
|
1622
|
-
requestHeaders: [documentPasswordHeader],
|
|
1768
|
+
requestHeaders: [documentPasswordHeader, idempotencyKeyHeader],
|
|
1623
1769
|
params: DocLayerParamsSchema,
|
|
1624
|
-
body: { contentType: "application/json", schema:
|
|
1770
|
+
body: { contentType: "application/json", schema: RedactionApplyScopeSchema },
|
|
1625
1771
|
responses: {
|
|
1626
|
-
200: { contentType: "application/json", schema:
|
|
1772
|
+
200: { contentType: "application/json", schema: RedactionApplyResultSchema },
|
|
1627
1773
|
400: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
1628
1774
|
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1629
1775
|
}
|
|
@@ -1654,8 +1800,11 @@ var docsGroups = {
|
|
|
1654
1800
|
shares: { title: "Shares" },
|
|
1655
1801
|
doc: { title: "Document operations", slug: "document-operations" },
|
|
1656
1802
|
"doc.annotations": { title: "Annotations" },
|
|
1803
|
+
"doc.attachments": { title: "Attachments" },
|
|
1657
1804
|
"doc.forms": { title: "Forms" },
|
|
1658
1805
|
"doc.metadata": { title: "Metadata" },
|
|
1806
|
+
"doc.metadata.custom": { title: "Custom keys" },
|
|
1807
|
+
"doc.outline": { title: "Outline" },
|
|
1659
1808
|
"doc.pages": { title: "Pages" },
|
|
1660
1809
|
"doc.redactions": { title: "Redactions" },
|
|
1661
1810
|
"doc.signatures": { title: "Digital signatures" },
|
|
@@ -1681,18 +1830,35 @@ var SECURITY_SCHEME = {
|
|
|
1681
1830
|
};
|
|
1682
1831
|
var ADMIN_ERROR_REF = "#/components/schemas/AdminErrorPayload";
|
|
1683
1832
|
var ENGINE_ERROR_REF = "#/components/schemas/EngineErrorPayload";
|
|
1684
|
-
var SHARED_COMPONENT_SCHEMAS =
|
|
1833
|
+
var SHARED_COMPONENT_SCHEMAS = sharedComponents([
|
|
1834
|
+
{ AdminErrorPayload: AdminErrorPayloadSchema, EngineErrorPayload: EngineErrorPayloadSchema2 },
|
|
1835
|
+
DocumentWireComponents,
|
|
1836
|
+
PdfActionWireComponents,
|
|
1837
|
+
AnnotationWireComponents,
|
|
1838
|
+
FormWireComponents,
|
|
1839
|
+
OutlineWireComponents,
|
|
1840
|
+
AttachmentWireComponents,
|
|
1841
|
+
ChangeWireComponents
|
|
1842
|
+
]);
|
|
1685
1843
|
var SHARED_COMPONENT_BY_DEFINITION = new Map(
|
|
1686
1844
|
Object.entries(SHARED_COMPONENT_SCHEMAS).map(([name, schema]) => [schema._def, name])
|
|
1687
1845
|
);
|
|
1688
1846
|
var SHARED_COMPONENT_REFS = new Set(
|
|
1689
1847
|
Object.keys(SHARED_COMPONENT_SCHEMAS).map((name) => `#/components/schemas/${name}`)
|
|
1690
1848
|
);
|
|
1849
|
+
function sharedComponents(registries) {
|
|
1850
|
+
const components = {};
|
|
1851
|
+
for (const registry of registries) {
|
|
1852
|
+
for (const [name, schema] of Object.entries(registry)) {
|
|
1853
|
+
if (components[name]) throw new Error(`Duplicate shared component name: ${name}`);
|
|
1854
|
+
components[name] = schema;
|
|
1855
|
+
}
|
|
1856
|
+
}
|
|
1857
|
+
return components;
|
|
1858
|
+
}
|
|
1691
1859
|
function buildAdminOpenApiDocument(opts) {
|
|
1692
1860
|
const paths = {};
|
|
1693
1861
|
const schemas = {};
|
|
1694
|
-
registerSchema(schemas, "AdminErrorPayload", AdminErrorPayloadSchema);
|
|
1695
|
-
registerSchema(schemas, "EngineErrorPayload", EngineErrorPayloadSchema2);
|
|
1696
1862
|
for (const [name, schema] of Object.entries(SHARED_COMPONENT_SCHEMAS)) {
|
|
1697
1863
|
registerSchema(schemas, name, schema);
|
|
1698
1864
|
}
|