@cloudpdf/contract 3.0.0-next.1 → 3.0.0-next.11
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/README.md +1 -1
- package/dist/index.d.ts +6998 -2549
- package/dist/index.js +542 -17
- package/dist/index.js.map +1 -1
- package/dist/openapi.d.ts +5 -1
- package/dist/openapi.js +637 -20
- package/dist/openapi.js.map +1 -1
- package/openapi.json +9377 -2843
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
-
import { z } from "zod";
|
|
3
2
|
import {
|
|
4
3
|
AnnotationListPageSnapshotSchema,
|
|
4
|
+
AnnotationListSnapshotAllPagesSchema,
|
|
5
5
|
DocumentHeadSchema,
|
|
6
6
|
DocumentManifestSchema,
|
|
7
7
|
DocumentMetadataSchema,
|
|
@@ -11,26 +11,50 @@ import {
|
|
|
11
11
|
PageTextSnapshotSchema,
|
|
12
12
|
wireTemplates
|
|
13
13
|
} from "@embedpdf/engine-core/wire";
|
|
14
|
+
import { z } from "zod";
|
|
14
15
|
var sha256Hex = /^[0-9a-f]{64}$/i;
|
|
15
16
|
var docIdPattern = /^[A-Za-z0-9_-]+$/;
|
|
16
17
|
var tenantIdPattern = /^[A-Za-z0-9_-]+$/;
|
|
18
|
+
var originPattern = /^https?:\/\/(\*\.)?[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)*(:\d{1,5})?$/;
|
|
19
|
+
var originPatternArray = z.array(
|
|
20
|
+
z.string().max(262).regex(
|
|
21
|
+
originPattern,
|
|
22
|
+
"must be a web origin like https://example.com (optionally one leading *. wildcard label, optional port, no path)"
|
|
23
|
+
)
|
|
24
|
+
).min(1).max(32);
|
|
25
|
+
var shareTokenPattern = /^shr_[A-Za-z0-9_-]{24}$/;
|
|
17
26
|
var adminWirePaths = {
|
|
18
27
|
tenants: "/v1/tenants",
|
|
19
28
|
tenant: (tenantId) => `/v1/tenants/${encodeURIComponent(tenantId)}`,
|
|
20
29
|
documents: (tenantId) => `/v1/tenants/${encodeURIComponent(tenantId)}/documents`,
|
|
21
30
|
documentsInit: (tenantId) => `/v1/tenants/${encodeURIComponent(tenantId)}/documents/init`,
|
|
31
|
+
documentsImport: (tenantId) => `/v1/tenants/${encodeURIComponent(tenantId)}/documents/import`,
|
|
22
32
|
document: (tenantId, docId) => `/v1/tenants/${encodeURIComponent(tenantId)}/documents/${encodeURIComponent(docId)}`,
|
|
23
33
|
documentCommit: (tenantId, docId) => `/v1/tenants/${encodeURIComponent(tenantId)}/documents/${encodeURIComponent(docId)}/commit`,
|
|
24
|
-
|
|
34
|
+
documentUploadProxy: (tenantId, docId) => `/v1/tenants/${encodeURIComponent(tenantId)}/documents/${encodeURIComponent(docId)}/upload-proxy`,
|
|
25
35
|
documentDownload: (tenantId, docId) => `/v1/tenants/${encodeURIComponent(tenantId)}/documents/${encodeURIComponent(docId)}/download`,
|
|
26
36
|
/** The warmed dashboard-tile artifact. Returns 404 while `pending`/`locked`. */
|
|
27
37
|
documentThumbnail: (tenantId, docId) => `/v1/tenants/${encodeURIComponent(tenantId)}/documents/${encodeURIComponent(docId)}/thumbnail`,
|
|
28
38
|
tokenIssue: (tenantId) => `/v1/tenants/${encodeURIComponent(tenantId)}/tokens`,
|
|
29
39
|
tokenRevoke: (tenantId, jti) => `/v1/tenants/${encodeURIComponent(tenantId)}/tokens/${encodeURIComponent(jti)}/revoke`,
|
|
40
|
+
shares: (tenantId) => `/v1/tenants/${encodeURIComponent(tenantId)}/shares`,
|
|
41
|
+
share: (tenantId, shareId) => `/v1/tenants/${encodeURIComponent(tenantId)}/shares/${encodeURIComponent(shareId)}`,
|
|
42
|
+
tenantUsage: (tenantId) => `/v1/tenants/${encodeURIComponent(tenantId)}/usage`,
|
|
43
|
+
tenantSuspend: (tenantId) => `/v1/tenants/${encodeURIComponent(tenantId)}/suspend`,
|
|
44
|
+
tenantResume: (tenantId) => `/v1/tenants/${encodeURIComponent(tenantId)}/resume`,
|
|
45
|
+
/**
|
|
46
|
+
* The public share-session exchange. Deliberately outside any tenant
|
|
47
|
+
* subtree: the caller holds only a share token and does not know the
|
|
48
|
+
* tenant — the grant row resolves it server-side.
|
|
49
|
+
*/
|
|
50
|
+
shareSessions: "/v1/share-sessions",
|
|
30
51
|
/** Deployment-global singletons: API-token only, no tenant context. */
|
|
31
52
|
deploymentLicenseStatus: "/v1/deployment/license/status"
|
|
32
53
|
};
|
|
33
|
-
var DedupModeSchema = z.enum(["always-create", "reuse-existing"])
|
|
54
|
+
var DedupModeSchema = z.enum(["always-create", "reuse-existing"]).describe(
|
|
55
|
+
"always-create (default) creates a new document every time. reuse-existing returns a document that already holds the same content instead of storing it twice."
|
|
56
|
+
);
|
|
57
|
+
var UploadPreferenceSchema = z.enum(["auto", "presigned", "proxy"]);
|
|
34
58
|
var DocumentStateSchema = z.enum(["pending", "ready", "failed", "deleting"]);
|
|
35
59
|
var AdminDocumentRecordSchema = z.object({
|
|
36
60
|
id: z.string(),
|
|
@@ -55,7 +79,8 @@ var AdminDocumentInitRequestSchema = z.object({
|
|
|
55
79
|
idempotencyKey: z.string().optional(),
|
|
56
80
|
dedupMode: DedupModeSchema.optional(),
|
|
57
81
|
docId: z.string().regex(docIdPattern).optional(),
|
|
58
|
-
uploadTtlSec: z.number().finite().min(60).max(3600).optional()
|
|
82
|
+
uploadTtlSec: z.number().finite().min(60).max(3600).optional(),
|
|
83
|
+
uploadPreference: UploadPreferenceSchema.optional()
|
|
59
84
|
});
|
|
60
85
|
var AdminPresignedUploadSchema = z.object({
|
|
61
86
|
url: z.string(),
|
|
@@ -70,7 +95,7 @@ var AdminInitUploadSchema = z.discriminatedUnion("kind", [
|
|
|
70
95
|
key: z.string()
|
|
71
96
|
}),
|
|
72
97
|
z.object({
|
|
73
|
-
kind: z.literal("
|
|
98
|
+
kind: z.literal("proxy"),
|
|
74
99
|
url: z.string(),
|
|
75
100
|
key: z.string()
|
|
76
101
|
})
|
|
@@ -97,6 +122,79 @@ var AdminDocumentCommitRequestSchema = z.object({
|
|
|
97
122
|
var AdminDocumentCommitResponseSchema = z.object({
|
|
98
123
|
document: AdminDocumentRecordSchema
|
|
99
124
|
});
|
|
125
|
+
var utf8ByteLength = (s) => new TextEncoder().encode(s).length;
|
|
126
|
+
var AdminImportSourceSchema = z.discriminatedUnion("kind", [
|
|
127
|
+
z.object({
|
|
128
|
+
kind: z.literal("url"),
|
|
129
|
+
url: z.string().url().max(8192).describe(
|
|
130
|
+
"The URL to fetch. Must be allowed by the deployment import policy (scheme, network range, size) and must declare a length."
|
|
131
|
+
)
|
|
132
|
+
}).describe(
|
|
133
|
+
"The caller supplies the authority: a presigned S3/GCS/Azure/R2/MinIO GET, or any HTTPS endpoint the deployment import policy allows. The URL is a capability \u2014 treat it as a secret. CloudPDF never echoes its query string back in errors, logs, or stored failure reasons."
|
|
134
|
+
),
|
|
135
|
+
z.object({
|
|
136
|
+
kind: z.literal("connection"),
|
|
137
|
+
connectionId: z.string().min(1).max(128).describe("The operator-registered storage connection to read from."),
|
|
138
|
+
key: z.string().min(1).refine((k) => !k.includes("\0"), "key must not contain NUL").refine((k) => utf8ByteLength(k) <= 1024, "key must be at most 1024 UTF-8 bytes").describe(
|
|
139
|
+
"The object key to read, inside the connection's configured scope. At most 1024 UTF-8 bytes."
|
|
140
|
+
),
|
|
141
|
+
revision: z.string().min(1).max(1024).optional().describe(
|
|
142
|
+
"Pins a specific version of the object. Provider-interpreted (S3 VersionId, GCS generation, Azure version id); providers without versioning reject it."
|
|
143
|
+
)
|
|
144
|
+
}).describe(
|
|
145
|
+
"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."
|
|
146
|
+
)
|
|
147
|
+
]).describe(
|
|
148
|
+
"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."
|
|
149
|
+
);
|
|
150
|
+
var AdminDocumentImportRequestSchema = z.object({
|
|
151
|
+
source: AdminImportSourceSchema,
|
|
152
|
+
/**
|
|
153
|
+
* Optional integrity pins, enforced when present: `sizeBytes`
|
|
154
|
+
* against the source's declared Content-Length before the transfer,
|
|
155
|
+
* `sha256` against the server-observed digest after it. When absent
|
|
156
|
+
* the server-observed values become authoritative.
|
|
157
|
+
* `dedupMode=reuse-existing` REQUIRES `sha256` — without a declared
|
|
158
|
+
* hash the server cannot know what content to reuse.
|
|
159
|
+
*/
|
|
160
|
+
expected: z.object({
|
|
161
|
+
sizeBytes: z.number().int().min(1).optional().describe("Checked against the source's declared Content-Length before the transfer."),
|
|
162
|
+
sha256: z.string().regex(sha256Hex).optional().describe(
|
|
163
|
+
"Checked against the server-observed digest after the transfer. Required when dedupMode is reuse-existing."
|
|
164
|
+
)
|
|
165
|
+
}).optional().describe(
|
|
166
|
+
"Integrity pins, enforced when present. When absent, the server-observed values become authoritative."
|
|
167
|
+
),
|
|
168
|
+
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
169
|
+
idempotencyKey: z.string().optional().describe(
|
|
170
|
+
"Retrying with the same key resumes the same document rather than importing a second copy \u2014 including after a 502."
|
|
171
|
+
),
|
|
172
|
+
dedupMode: DedupModeSchema.optional(),
|
|
173
|
+
docId: z.string().regex(docIdPattern).optional(),
|
|
174
|
+
/**
|
|
175
|
+
* `sync` (default) holds the response open for the whole transfer.
|
|
176
|
+
* `async` accepts the request (202, document `pending`), transfers
|
|
177
|
+
* in the background, and the caller polls the document. Async
|
|
178
|
+
* requires a `connection` source (URLs are secrets and expire, so
|
|
179
|
+
* they cannot sit in a durable job); filesystem connections
|
|
180
|
+
* additionally require `expected.sha256`, since they have no
|
|
181
|
+
* revisions to pin retries to.
|
|
182
|
+
*/
|
|
183
|
+
mode: z.enum(["sync", "async"]).optional().describe(
|
|
184
|
+
"sync (default) holds the response open for the whole transfer. async answers 202 with the document pending and transfers in the background; it requires a connection source, and filesystem connections additionally require expected.sha256."
|
|
185
|
+
)
|
|
186
|
+
});
|
|
187
|
+
var AdminDocumentImportResponseSchema = z.object({
|
|
188
|
+
/**
|
|
189
|
+
* `imported` — bytes were pulled, verified, and committed (sync).
|
|
190
|
+
* `deduped` — an existing document satisfied the request without a
|
|
191
|
+
* transfer (content dedup or idempotent replay).
|
|
192
|
+
* `accepted` — async: the job is queued (HTTP 202); poll the
|
|
193
|
+
* document until `ready` or `failed`.
|
|
194
|
+
*/
|
|
195
|
+
tag: z.enum(["imported", "deduped", "accepted"]),
|
|
196
|
+
document: AdminDocumentRecordSchema
|
|
197
|
+
});
|
|
100
198
|
var AdminDocumentResponseSchema = z.object({
|
|
101
199
|
document: AdminDocumentRecordSchema
|
|
102
200
|
});
|
|
@@ -116,7 +214,7 @@ var AdminDocumentListResponseSchema = z.object({
|
|
|
116
214
|
*/
|
|
117
215
|
nextCursor: z.string().nullable().optional()
|
|
118
216
|
});
|
|
119
|
-
var
|
|
217
|
+
var AdminUploadProxyResponseSchema = z.object({
|
|
120
218
|
sha256: z.string().regex(sha256Hex)
|
|
121
219
|
});
|
|
122
220
|
var AdminErrorPayloadSchema = z.object({
|
|
@@ -163,6 +261,13 @@ var AdminTenantRecordSchema = z.object({
|
|
|
163
261
|
name: z.string(),
|
|
164
262
|
/** True when the namespace materialized on first use rather than via explicit create. */
|
|
165
263
|
autoProvisioned: z.boolean(),
|
|
264
|
+
/**
|
|
265
|
+
* `suspended` tenants fail closed: every tenant JWT, doc JWT, and
|
|
266
|
+
* share exchange is refused until resume. The API token is exempt —
|
|
267
|
+
* the operator must be able to inspect, resume, or delete a
|
|
268
|
+
* suspended tenant. Optional because older servers omit it.
|
|
269
|
+
*/
|
|
270
|
+
status: z.enum(["active", "suspended"]).optional(),
|
|
166
271
|
createdAt: z.number()
|
|
167
272
|
});
|
|
168
273
|
var AdminTenantCreateRequestSchema = z.object({
|
|
@@ -192,7 +297,8 @@ var adminTenantScopes = [
|
|
|
192
297
|
"docs.read",
|
|
193
298
|
"docs.delete",
|
|
194
299
|
"tokens.issue-doc",
|
|
195
|
-
"tokens.revoke"
|
|
300
|
+
"tokens.revoke",
|
|
301
|
+
"shares.manage"
|
|
196
302
|
];
|
|
197
303
|
var AdminTokenIssueDocRequestSchema = z.object({
|
|
198
304
|
kind: z.literal("doc"),
|
|
@@ -210,6 +316,14 @@ var AdminTokenIssueDocRequestSchema = z.object({
|
|
|
210
316
|
displayName: z.string().max(256).optional(),
|
|
211
317
|
groupId: z.string().max(256).optional(),
|
|
212
318
|
groups: z.array(z.string().max(256)).max(64).optional(),
|
|
319
|
+
/**
|
|
320
|
+
* Origin lock: web origins (scheme + host, optional port; one leading
|
|
321
|
+
* `*.` wildcard label allowed) the minted token may be presented
|
|
322
|
+
* from. Enforced on every engine request that carries a browser
|
|
323
|
+
* `Origin` header — hotlink prevention, not DRM: non-browser callers
|
|
324
|
+
* are governed by the token itself.
|
|
325
|
+
*/
|
|
326
|
+
origins: originPatternArray.optional(),
|
|
213
327
|
/** Token lifetime in seconds. */
|
|
214
328
|
expiresIn: z.number().int().min(60).max(60 * 60 * 24 * 90)
|
|
215
329
|
});
|
|
@@ -230,10 +344,111 @@ var AdminTokenIssueResponseSchema = z.object({
|
|
|
230
344
|
/** Unix seconds. */
|
|
231
345
|
expiresAt: z.number()
|
|
232
346
|
});
|
|
347
|
+
var ShareGrantRecordSchema = z.object({
|
|
348
|
+
/** Grant id; doubles as the public share token (`shr_…`). */
|
|
349
|
+
id: z.string(),
|
|
350
|
+
tenantId: z.string(),
|
|
351
|
+
docId: z.string(),
|
|
352
|
+
layerName: z.string(),
|
|
353
|
+
/** Doc capabilities the exchanged session carries. */
|
|
354
|
+
scope: z.array(z.string()),
|
|
355
|
+
/** Origin allowlist; null means any origin. */
|
|
356
|
+
origins: z.array(z.string()).nullable(),
|
|
357
|
+
/** True when a passphrase is required at exchange. The passphrase itself is never returned. */
|
|
358
|
+
passwordProtected: z.boolean(),
|
|
359
|
+
/** Lifetime of each exchanged session token, in seconds. */
|
|
360
|
+
sessionTtlSeconds: z.number(),
|
|
361
|
+
/** Paused grants refuse exchange (404) but keep their configuration. */
|
|
362
|
+
disabled: z.boolean(),
|
|
363
|
+
/** Unix epoch ms after which exchange returns 410; null = no expiry. */
|
|
364
|
+
expiresAt: z.number().nullable(),
|
|
365
|
+
/** Total successful exchanges — a dashboard convenience, not the usage meter. */
|
|
366
|
+
exchangeCount: z.number(),
|
|
367
|
+
lastExchangedAt: z.number().nullable(),
|
|
368
|
+
createdBy: z.string(),
|
|
369
|
+
createdAt: z.number(),
|
|
370
|
+
updatedAt: z.number()
|
|
371
|
+
});
|
|
372
|
+
var ShareGrantCreateRequestSchema = z.object({
|
|
373
|
+
docId: z.string().regex(docIdPattern),
|
|
374
|
+
layerName: z.string().min(1).max(256).optional(),
|
|
375
|
+
/**
|
|
376
|
+
* Doc capability scopes the exchanged session will carry. Validated
|
|
377
|
+
* server-side against the engine's scope vocabulary, same as
|
|
378
|
+
* `tokens.issue`.
|
|
379
|
+
*/
|
|
380
|
+
scope: z.array(z.string().min(1).max(128)).min(1).max(64),
|
|
381
|
+
/** Origin allowlist; omit to allow any origin. */
|
|
382
|
+
origins: originPatternArray.optional(),
|
|
383
|
+
/** Optional passphrase gate, checked at exchange. Stored as a hash; never returned. */
|
|
384
|
+
password: z.string().min(1).max(1024).optional(),
|
|
385
|
+
/** Lifetime of exchanged session tokens. Default 600. */
|
|
386
|
+
sessionTtlSeconds: z.number().int().min(60).max(60 * 60).optional(),
|
|
387
|
+
/** Unix epoch ms after which the grant stops exchanging; omit for no expiry. */
|
|
388
|
+
expiresAt: z.number().int().positive().optional()
|
|
389
|
+
});
|
|
390
|
+
var ShareGrantUpdateRequestSchema = z.object({
|
|
391
|
+
scope: z.array(z.string().min(1).max(128)).min(1).max(64).optional(),
|
|
392
|
+
origins: originPatternArray.nullable().optional(),
|
|
393
|
+
password: z.string().min(1).max(1024).nullable().optional(),
|
|
394
|
+
sessionTtlSeconds: z.number().int().min(60).max(60 * 60).optional(),
|
|
395
|
+
disabled: z.boolean().optional(),
|
|
396
|
+
expiresAt: z.number().int().positive().nullable().optional()
|
|
397
|
+
});
|
|
398
|
+
var ShareGrantResponseSchema = z.object({
|
|
399
|
+
share: ShareGrantRecordSchema
|
|
400
|
+
});
|
|
401
|
+
var ShareGrantListQuerySchema = z.object({
|
|
402
|
+
limit: z.coerce.number().int().min(1).max(ADMIN_DOCUMENT_LIST_MAX_LIMIT).default(ADMIN_DOCUMENT_LIST_DEFAULT_LIMIT),
|
|
403
|
+
cursor: z.string().min(1).optional(),
|
|
404
|
+
/** Filter to one document's grants. */
|
|
405
|
+
docId: z.string().regex(docIdPattern).optional()
|
|
406
|
+
});
|
|
407
|
+
var ShareGrantListResponseSchema = z.object({
|
|
408
|
+
shares: z.array(ShareGrantRecordSchema),
|
|
409
|
+
/** Opaque cursor for the next page; `null` on the last page. */
|
|
410
|
+
nextCursor: z.string().nullable().optional()
|
|
411
|
+
});
|
|
412
|
+
var AdminTenantShareParamsSchema = z.object({
|
|
413
|
+
tenantId: z.string().regex(tenantIdPattern),
|
|
414
|
+
shareId: z.string().regex(shareTokenPattern)
|
|
415
|
+
});
|
|
416
|
+
var ShareExchangeRequestSchema = z.object({
|
|
417
|
+
shareToken: z.string().regex(shareTokenPattern),
|
|
418
|
+
/** Required when the grant is passphrase-protected (422 otherwise). */
|
|
419
|
+
password: z.string().min(1).max(1024).optional()
|
|
420
|
+
});
|
|
421
|
+
var ShareSessionResponseSchema = z.object({
|
|
422
|
+
/** A doc-scoped session JWT carrying the grant's capabilities and origin lock. */
|
|
423
|
+
token: z.string(),
|
|
424
|
+
docId: z.string(),
|
|
425
|
+
layerName: z.string(),
|
|
426
|
+
/** Unix seconds when the session token expires; exchange again for a fresh one. */
|
|
427
|
+
expiresAt: z.number()
|
|
428
|
+
});
|
|
429
|
+
var TenantUsageQuerySchema = z.object({
|
|
430
|
+
/** UTC month to report, `YYYY-MM`. Defaults to the current month. */
|
|
431
|
+
period: z.string().regex(/^\d{4}-(0[1-9]|1[0-2])$/).optional()
|
|
432
|
+
});
|
|
433
|
+
var TenantUsageResponseSchema = z.object({
|
|
434
|
+
tenantId: z.string(),
|
|
435
|
+
periodStart: z.string(),
|
|
436
|
+
periodEnd: z.string(),
|
|
437
|
+
metrics: z.object({
|
|
438
|
+
"pdf.views": z.number(),
|
|
439
|
+
"pdf.uploads": z.number(),
|
|
440
|
+
"storage.bytes": z.number()
|
|
441
|
+
})
|
|
442
|
+
});
|
|
443
|
+
var TenantSuspendRequestSchema = z.object({
|
|
444
|
+
/** Optional operator reason, written to the security-events trail. */
|
|
445
|
+
reason: z.string().max(1024).optional()
|
|
446
|
+
});
|
|
233
447
|
var adminCredentials = ["api-token", "tenant-jwt", "doc-jwt"];
|
|
234
448
|
var adminOperations = {
|
|
235
449
|
"tenants.create": {
|
|
236
450
|
operationId: "tenants.create",
|
|
451
|
+
title: "Create tenant",
|
|
237
452
|
summary: "Create a tenant, or confirm it already exists \u2014 ensure-style, idempotent.",
|
|
238
453
|
method: "POST",
|
|
239
454
|
path: adminWirePaths.tenants,
|
|
@@ -247,6 +462,7 @@ var adminOperations = {
|
|
|
247
462
|
},
|
|
248
463
|
"tenants.list": {
|
|
249
464
|
operationId: "tenants.list",
|
|
465
|
+
title: "List tenants",
|
|
250
466
|
summary: "List tenants, newest first, cursor-paginated.",
|
|
251
467
|
method: "GET",
|
|
252
468
|
path: adminWirePaths.tenants,
|
|
@@ -260,6 +476,7 @@ var adminOperations = {
|
|
|
260
476
|
},
|
|
261
477
|
"tenants.get": {
|
|
262
478
|
operationId: "tenants.get",
|
|
479
|
+
title: "Get tenant",
|
|
263
480
|
summary: "Fetch one tenant record.",
|
|
264
481
|
method: "GET",
|
|
265
482
|
path: "/v1/tenants/:tenantId",
|
|
@@ -273,6 +490,7 @@ var adminOperations = {
|
|
|
273
490
|
},
|
|
274
491
|
"tenants.delete": {
|
|
275
492
|
operationId: "tenants.delete",
|
|
493
|
+
title: "Delete tenant",
|
|
276
494
|
summary: "Delete a tenant and everything under it.",
|
|
277
495
|
method: "DELETE",
|
|
278
496
|
path: "/v1/tenants/:tenantId",
|
|
@@ -287,6 +505,7 @@ var adminOperations = {
|
|
|
287
505
|
},
|
|
288
506
|
"documents.init": {
|
|
289
507
|
operationId: "documents.init",
|
|
508
|
+
title: "Initialize upload",
|
|
290
509
|
summary: "Begin an upload: create (or resume/dedupe) a pending document and issue upload access.",
|
|
291
510
|
method: "POST",
|
|
292
511
|
path: "/v1/tenants/:tenantId/documents/init",
|
|
@@ -301,6 +520,7 @@ var adminOperations = {
|
|
|
301
520
|
},
|
|
302
521
|
"documents.commit": {
|
|
303
522
|
operationId: "documents.commit",
|
|
523
|
+
title: "Commit upload",
|
|
304
524
|
summary: "Finish an upload: verify the SHA-256 and promote the document to ready.",
|
|
305
525
|
method: "POST",
|
|
306
526
|
path: "/v1/tenants/:tenantId/documents/:id/commit",
|
|
@@ -314,24 +534,47 @@ var adminOperations = {
|
|
|
314
534
|
404: { contentType: "application/json", schema: AdminErrorPayloadSchema }
|
|
315
535
|
}
|
|
316
536
|
},
|
|
317
|
-
"documents.
|
|
318
|
-
operationId: "documents.
|
|
319
|
-
|
|
537
|
+
"documents.uploadProxy": {
|
|
538
|
+
operationId: "documents.uploadProxy",
|
|
539
|
+
title: "Upload document through the origin",
|
|
540
|
+
summary: "Upload a bounded PDF through the API when the initialized transfer kind is proxy.",
|
|
320
541
|
method: "POST",
|
|
321
|
-
path: "/v1/tenants/:tenantId/documents/:id/upload-
|
|
542
|
+
path: "/v1/tenants/:tenantId/documents/:id/upload-proxy",
|
|
322
543
|
credentials: ["api-token", "tenant-jwt"],
|
|
323
544
|
scope: ["docs.create"],
|
|
324
545
|
params: AdminTenantDocParamsSchema,
|
|
325
546
|
body: {
|
|
326
|
-
contentType:
|
|
547
|
+
contentType: "multipart/form-data"
|
|
327
548
|
},
|
|
328
549
|
responses: {
|
|
329
|
-
200: { contentType: "application/json", schema:
|
|
330
|
-
400: { contentType: "application/json", schema: AdminErrorPayloadSchema }
|
|
331
|
-
|
|
550
|
+
200: { contentType: "application/json", schema: AdminUploadProxyResponseSchema },
|
|
551
|
+
400: { contentType: "application/json", schema: AdminErrorPayloadSchema },
|
|
552
|
+
409: { contentType: "application/json", schema: AdminErrorPayloadSchema }
|
|
553
|
+
},
|
|
554
|
+
notes: "This bounded origin-mediated fallback must only be used after documents.init returns upload.kind=proxy. Auto mode prefers a presigned object-store PUT whenever available."
|
|
555
|
+
},
|
|
556
|
+
"documents.importFrom": {
|
|
557
|
+
operationId: "documents.importFrom",
|
|
558
|
+
title: "Import document",
|
|
559
|
+
summary: "Server-side pull: fetch a PDF from a caller-supplied URL (e.g. a presigned object-store GET) or an operator-registered storage connection into CloudPDF-owned storage, verify it, and commit it.",
|
|
560
|
+
method: "POST",
|
|
561
|
+
path: "/v1/tenants/:tenantId/documents/import",
|
|
562
|
+
credentials: ["api-token", "tenant-jwt"],
|
|
563
|
+
scope: ["docs.create"],
|
|
564
|
+
params: AdminTenantParamsSchema,
|
|
565
|
+
body: { contentType: "application/json", schema: AdminDocumentImportRequestSchema },
|
|
566
|
+
responses: {
|
|
567
|
+
200: { contentType: "application/json", schema: AdminDocumentImportResponseSchema },
|
|
568
|
+
202: { contentType: "application/json", schema: AdminDocumentImportResponseSchema },
|
|
569
|
+
400: { contentType: "application/json", schema: AdminErrorPayloadSchema },
|
|
570
|
+
403: { contentType: "application/json", schema: AdminErrorPayloadSchema },
|
|
571
|
+
502: { contentType: "application/json", schema: AdminErrorPayloadSchema }
|
|
572
|
+
},
|
|
573
|
+
notes: "Default mode is synchronous and bounded: the response returns only after the transfer verified and committed (or failed). mode=async (connection sources only) answers 202 immediately and an in-process worker performs the transfer with leased, fenced retries; poll the document until ready/failed. The deployment import policy gates scheme, network range, and size; sources must declare a length. CloudPDF copies and owns the bytes \u2014 the source is never referenced in place. A 502 marks a retryable upstream failure: retry with the same idempotencyKey to resume the same document. URL sources are capabilities and never echoed back. Connection sources name operator-registered storage (bucket/prefix scope, allowed credential classes, and tenant bindings are deployment configuration); `revision` is provider-interpreted (S3 VersionId, GCS generation, Azure version id)."
|
|
332
574
|
},
|
|
333
575
|
"documents.list": {
|
|
334
576
|
operationId: "documents.list",
|
|
577
|
+
title: "List documents",
|
|
335
578
|
summary: "List documents in the tenant, newest first, cursor-paginated.",
|
|
336
579
|
method: "GET",
|
|
337
580
|
path: "/v1/tenants/:tenantId/documents",
|
|
@@ -346,6 +589,7 @@ var adminOperations = {
|
|
|
346
589
|
},
|
|
347
590
|
"documents.get": {
|
|
348
591
|
operationId: "documents.get",
|
|
592
|
+
title: "Get document",
|
|
349
593
|
summary: "Fetch one document record.",
|
|
350
594
|
method: "GET",
|
|
351
595
|
path: "/v1/tenants/:tenantId/documents/:id",
|
|
@@ -360,6 +604,7 @@ var adminOperations = {
|
|
|
360
604
|
},
|
|
361
605
|
"documents.download": {
|
|
362
606
|
operationId: "documents.download",
|
|
607
|
+
title: "Download document",
|
|
363
608
|
summary: "Download the stored base PDF bytes.",
|
|
364
609
|
method: "GET",
|
|
365
610
|
path: "/v1/tenants/:tenantId/documents/:id/download",
|
|
@@ -374,6 +619,7 @@ var adminOperations = {
|
|
|
374
619
|
},
|
|
375
620
|
"documents.delete": {
|
|
376
621
|
operationId: "documents.delete",
|
|
622
|
+
title: "Delete document",
|
|
377
623
|
summary: "Delete a document and its stored artifacts.",
|
|
378
624
|
method: "DELETE",
|
|
379
625
|
path: "/v1/tenants/:tenantId/documents/:id",
|
|
@@ -388,6 +634,7 @@ var adminOperations = {
|
|
|
388
634
|
},
|
|
389
635
|
"documents.thumbnail": {
|
|
390
636
|
operationId: "documents.thumbnail",
|
|
637
|
+
title: "Get thumbnail",
|
|
391
638
|
summary: "Fetch the warmed dashboard-tile render for a document.",
|
|
392
639
|
method: "GET",
|
|
393
640
|
path: "/v1/tenants/:tenantId/documents/:id/thumbnail",
|
|
@@ -401,6 +648,7 @@ var adminOperations = {
|
|
|
401
648
|
},
|
|
402
649
|
"deployment.licenseStatus": {
|
|
403
650
|
operationId: "deployment.licenseStatus",
|
|
651
|
+
title: "License status",
|
|
404
652
|
summary: "License decision plus usage-reporting and meter snapshots for this deployment.",
|
|
405
653
|
method: "GET",
|
|
406
654
|
path: adminWirePaths.deploymentLicenseStatus,
|
|
@@ -412,6 +660,7 @@ var adminOperations = {
|
|
|
412
660
|
},
|
|
413
661
|
"tokens.issue": {
|
|
414
662
|
operationId: "tokens.issue",
|
|
663
|
+
title: "Issue token",
|
|
415
664
|
summary: "Mint a delegated JWT: a doc token, or (API token only) a tenant token.",
|
|
416
665
|
method: "POST",
|
|
417
666
|
path: "/v1/tenants/:tenantId/tokens",
|
|
@@ -429,6 +678,7 @@ var adminOperations = {
|
|
|
429
678
|
},
|
|
430
679
|
"tokens.revoke": {
|
|
431
680
|
operationId: "tokens.revoke",
|
|
681
|
+
title: "Revoke token",
|
|
432
682
|
summary: "Revoke a token by jti; live sessions drop on their next heartbeat.",
|
|
433
683
|
method: "POST",
|
|
434
684
|
path: "/v1/tenants/:tenantId/tokens/:jti/revoke",
|
|
@@ -445,6 +695,153 @@ var adminOperations = {
|
|
|
445
695
|
400: { contentType: "application/json", schema: AdminErrorPayloadSchema }
|
|
446
696
|
},
|
|
447
697
|
notes: "Mounted only when the deployment enables token revocation."
|
|
698
|
+
},
|
|
699
|
+
"tenants.usage": {
|
|
700
|
+
operationId: "tenants.usage",
|
|
701
|
+
title: "Tenant usage",
|
|
702
|
+
summary: "Per-tenant usage facts (views, uploads, stored bytes) for one UTC month.",
|
|
703
|
+
method: "GET",
|
|
704
|
+
path: "/v1/tenants/:tenantId/usage",
|
|
705
|
+
credentials: ["api-token", "tenant-jwt"],
|
|
706
|
+
scope: ["docs.read"],
|
|
707
|
+
params: AdminTenantParamsSchema,
|
|
708
|
+
query: TenantUsageQuerySchema,
|
|
709
|
+
responses: {
|
|
710
|
+
200: { contentType: "application/json", schema: TenantUsageResponseSchema },
|
|
711
|
+
400: { contentType: "application/json", schema: AdminErrorPayloadSchema },
|
|
712
|
+
404: { contentType: "application/json", schema: AdminErrorPayloadSchema }
|
|
713
|
+
},
|
|
714
|
+
notes: "Facts only \u2014 no limits or billing state. Views count share exchanges plus authorized /v1/access grants, deduplicated across the two."
|
|
715
|
+
},
|
|
716
|
+
"tenants.suspend": {
|
|
717
|
+
operationId: "tenants.suspend",
|
|
718
|
+
title: "Suspend tenant",
|
|
719
|
+
summary: "Fail the tenant closed: refuse every tenant JWT, doc JWT, and share exchange.",
|
|
720
|
+
method: "POST",
|
|
721
|
+
path: "/v1/tenants/:tenantId/suspend",
|
|
722
|
+
credentials: ["api-token"],
|
|
723
|
+
scope: [],
|
|
724
|
+
params: AdminTenantParamsSchema,
|
|
725
|
+
body: {
|
|
726
|
+
contentType: "application/json",
|
|
727
|
+
schema: TenantSuspendRequestSchema,
|
|
728
|
+
required: false
|
|
729
|
+
},
|
|
730
|
+
responses: {
|
|
731
|
+
204: {},
|
|
732
|
+
404: { contentType: "application/json", schema: AdminErrorPayloadSchema }
|
|
733
|
+
},
|
|
734
|
+
notes: "Instantly reversible with resume. The API token is exempt, so a suspended tenant can still be inspected, exported, resumed, or deleted."
|
|
735
|
+
},
|
|
736
|
+
"tenants.resume": {
|
|
737
|
+
operationId: "tenants.resume",
|
|
738
|
+
title: "Resume tenant",
|
|
739
|
+
summary: "Lift a suspension; credentials for the tenant verify again.",
|
|
740
|
+
method: "POST",
|
|
741
|
+
path: "/v1/tenants/:tenantId/resume",
|
|
742
|
+
credentials: ["api-token"],
|
|
743
|
+
scope: [],
|
|
744
|
+
params: AdminTenantParamsSchema,
|
|
745
|
+
responses: {
|
|
746
|
+
204: {},
|
|
747
|
+
404: { contentType: "application/json", schema: AdminErrorPayloadSchema }
|
|
748
|
+
}
|
|
749
|
+
},
|
|
750
|
+
"shares.create": {
|
|
751
|
+
operationId: "shares.create",
|
|
752
|
+
title: "Create share",
|
|
753
|
+
summary: "Create a standing share grant for one document \u2014 the no-backend embed credential.",
|
|
754
|
+
method: "POST",
|
|
755
|
+
path: "/v1/tenants/:tenantId/shares",
|
|
756
|
+
credentials: ["api-token", "tenant-jwt"],
|
|
757
|
+
scope: ["shares.manage"],
|
|
758
|
+
params: AdminTenantParamsSchema,
|
|
759
|
+
body: { contentType: "application/json", schema: ShareGrantCreateRequestSchema },
|
|
760
|
+
responses: {
|
|
761
|
+
200: { contentType: "application/json", schema: ShareGrantResponseSchema },
|
|
762
|
+
400: { contentType: "application/json", schema: AdminErrorPayloadSchema },
|
|
763
|
+
403: { contentType: "application/json", schema: AdminErrorPayloadSchema },
|
|
764
|
+
404: { contentType: "application/json", schema: AdminErrorPayloadSchema }
|
|
765
|
+
},
|
|
766
|
+
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."
|
|
767
|
+
},
|
|
768
|
+
"shares.list": {
|
|
769
|
+
operationId: "shares.list",
|
|
770
|
+
title: "List shares",
|
|
771
|
+
summary: "List share grants in the tenant, newest first, cursor-paginated.",
|
|
772
|
+
method: "GET",
|
|
773
|
+
path: "/v1/tenants/:tenantId/shares",
|
|
774
|
+
credentials: ["api-token", "tenant-jwt"],
|
|
775
|
+
scope: ["shares.manage"],
|
|
776
|
+
params: AdminTenantParamsSchema,
|
|
777
|
+
query: ShareGrantListQuerySchema,
|
|
778
|
+
responses: {
|
|
779
|
+
200: { contentType: "application/json", schema: ShareGrantListResponseSchema },
|
|
780
|
+
400: { contentType: "application/json", schema: AdminErrorPayloadSchema }
|
|
781
|
+
}
|
|
782
|
+
},
|
|
783
|
+
"shares.get": {
|
|
784
|
+
operationId: "shares.get",
|
|
785
|
+
title: "Get share",
|
|
786
|
+
summary: "Fetch one share grant.",
|
|
787
|
+
method: "GET",
|
|
788
|
+
path: "/v1/tenants/:tenantId/shares/:shareId",
|
|
789
|
+
credentials: ["api-token", "tenant-jwt"],
|
|
790
|
+
scope: ["shares.manage"],
|
|
791
|
+
params: AdminTenantShareParamsSchema,
|
|
792
|
+
responses: {
|
|
793
|
+
200: { contentType: "application/json", schema: ShareGrantResponseSchema },
|
|
794
|
+
404: { contentType: "application/json", schema: AdminErrorPayloadSchema }
|
|
795
|
+
}
|
|
796
|
+
},
|
|
797
|
+
"shares.update": {
|
|
798
|
+
operationId: "shares.update",
|
|
799
|
+
title: "Update share",
|
|
800
|
+
summary: "Edit a grant in place \u2014 every embedded copy of the token follows the row.",
|
|
801
|
+
method: "PATCH",
|
|
802
|
+
path: "/v1/tenants/:tenantId/shares/:shareId",
|
|
803
|
+
credentials: ["api-token", "tenant-jwt"],
|
|
804
|
+
scope: ["shares.manage"],
|
|
805
|
+
params: AdminTenantShareParamsSchema,
|
|
806
|
+
body: { contentType: "application/json", schema: ShareGrantUpdateRequestSchema },
|
|
807
|
+
responses: {
|
|
808
|
+
200: { contentType: "application/json", schema: ShareGrantResponseSchema },
|
|
809
|
+
400: { contentType: "application/json", schema: AdminErrorPayloadSchema },
|
|
810
|
+
404: { contentType: "application/json", schema: AdminErrorPayloadSchema }
|
|
811
|
+
}
|
|
812
|
+
},
|
|
813
|
+
"shares.delete": {
|
|
814
|
+
operationId: "shares.delete",
|
|
815
|
+
title: "Revoke share",
|
|
816
|
+
summary: "Delete a grant; exchange stops immediately, live sessions lapse at their exp.",
|
|
817
|
+
method: "DELETE",
|
|
818
|
+
path: "/v1/tenants/:tenantId/shares/:shareId",
|
|
819
|
+
credentials: ["api-token", "tenant-jwt"],
|
|
820
|
+
scope: ["shares.manage"],
|
|
821
|
+
params: AdminTenantShareParamsSchema,
|
|
822
|
+
responses: {
|
|
823
|
+
204: {},
|
|
824
|
+
404: { contentType: "application/json", schema: AdminErrorPayloadSchema }
|
|
825
|
+
}
|
|
826
|
+
},
|
|
827
|
+
"shares.exchange": {
|
|
828
|
+
operationId: "shares.exchange",
|
|
829
|
+
title: "Exchange share token",
|
|
830
|
+
summary: "Trade a public share token for a short-lived document session JWT.",
|
|
831
|
+
method: "POST",
|
|
832
|
+
path: adminWirePaths.shareSessions,
|
|
833
|
+
credentials: [],
|
|
834
|
+
scope: [],
|
|
835
|
+
body: { contentType: "application/json", schema: ShareExchangeRequestSchema },
|
|
836
|
+
responses: {
|
|
837
|
+
200: { contentType: "application/json", schema: ShareSessionResponseSchema },
|
|
838
|
+
400: { contentType: "application/json", schema: AdminErrorPayloadSchema },
|
|
839
|
+
403: { contentType: "application/json", schema: AdminErrorPayloadSchema },
|
|
840
|
+
404: { contentType: "application/json", schema: AdminErrorPayloadSchema },
|
|
841
|
+
410: { contentType: "application/json", schema: AdminErrorPayloadSchema },
|
|
842
|
+
422: { contentType: "application/json", schema: AdminErrorPayloadSchema }
|
|
843
|
+
},
|
|
844
|
+
notes: "Unauthenticated, but requires a browser Origin header, checked against the grant allowlist. Unknown, revoked, and disabled tokens are indistinguishable (404). Passphrase-protected grants return 422 SharePasswordRequired until `password` is supplied. Mounted only when the deployment can sign (HS256 mode)."
|
|
448
845
|
}
|
|
449
846
|
};
|
|
450
847
|
var DocIdParamsSchema = z.object({
|
|
@@ -473,6 +870,7 @@ var MutationResponseSchema = z.object({ meta: MutationMetaSchema }).passthrough(
|
|
|
473
870
|
var docOperations = {
|
|
474
871
|
"doc.head": {
|
|
475
872
|
operationId: "doc.head",
|
|
873
|
+
title: "Open document",
|
|
476
874
|
summary: "Open a document and return its head (versions, page count, security).",
|
|
477
875
|
method: "GET",
|
|
478
876
|
path: wireTemplates.docHead,
|
|
@@ -488,6 +886,7 @@ var docOperations = {
|
|
|
488
886
|
},
|
|
489
887
|
"doc.manifest": {
|
|
490
888
|
operationId: "doc.manifest",
|
|
889
|
+
title: "Get manifest",
|
|
491
890
|
summary: "Full layer manifest at the layer's current version.",
|
|
492
891
|
method: "GET",
|
|
493
892
|
path: wireTemplates.layerManifest,
|
|
@@ -503,6 +902,7 @@ var docOperations = {
|
|
|
503
902
|
},
|
|
504
903
|
"doc.metadata.get": {
|
|
505
904
|
operationId: "doc.metadata.get",
|
|
905
|
+
title: "Get metadata",
|
|
506
906
|
summary: "Document metadata (PDF info dictionary view) for a layer.",
|
|
507
907
|
method: "GET",
|
|
508
908
|
path: wireTemplates.layerMetadata,
|
|
@@ -518,6 +918,7 @@ var docOperations = {
|
|
|
518
918
|
},
|
|
519
919
|
"doc.render": {
|
|
520
920
|
operationId: "doc.render",
|
|
921
|
+
title: "Render page",
|
|
521
922
|
summary: "Render one page as an image at the current layer version.",
|
|
522
923
|
method: "GET",
|
|
523
924
|
path: wireTemplates.layerRenderPage,
|
|
@@ -534,6 +935,7 @@ var docOperations = {
|
|
|
534
935
|
},
|
|
535
936
|
"doc.text": {
|
|
536
937
|
operationId: "doc.text",
|
|
938
|
+
title: "Extract page text",
|
|
537
939
|
summary: "Extracted text content for one page.",
|
|
538
940
|
method: "GET",
|
|
539
941
|
path: wireTemplates.layerTextPage,
|
|
@@ -549,6 +951,7 @@ var docOperations = {
|
|
|
549
951
|
},
|
|
550
952
|
"doc.annotations.list": {
|
|
551
953
|
operationId: "doc.annotations.list",
|
|
954
|
+
title: "List annotations",
|
|
552
955
|
summary: "One page's annotations at the current layer version.",
|
|
553
956
|
method: "GET",
|
|
554
957
|
path: wireTemplates.layerAnnotationItems,
|
|
@@ -562,8 +965,27 @@ var docOperations = {
|
|
|
562
965
|
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
563
966
|
}
|
|
564
967
|
},
|
|
968
|
+
"doc.annotations.listAll": {
|
|
969
|
+
operationId: "doc.annotations.listAll",
|
|
970
|
+
title: "List all annotations",
|
|
971
|
+
summary: "All pages' annotations as one coherent snapshot at the current layer version.",
|
|
972
|
+
method: "GET",
|
|
973
|
+
path: wireTemplates.layerAnnotationItemsAll,
|
|
974
|
+
credentials: docCredentials,
|
|
975
|
+
scope: [],
|
|
976
|
+
docCapabilities: ["doc.annotate.read"],
|
|
977
|
+
requestHeaders: [documentPasswordHeader],
|
|
978
|
+
params: DocLayerParamsSchema,
|
|
979
|
+
notes: "Returns one entry per page plus the audit-log cursor for reconciling subsequent document events. Page order is unspecified; join by `pageState.pageObjectNumber` when display order matters.",
|
|
980
|
+
responses: {
|
|
981
|
+
200: { contentType: "application/json", schema: AnnotationListSnapshotAllPagesSchema },
|
|
982
|
+
404: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
983
|
+
409: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
984
|
+
}
|
|
985
|
+
},
|
|
565
986
|
"doc.annotations.create": {
|
|
566
987
|
operationId: "doc.annotations.create",
|
|
988
|
+
title: "Create annotation",
|
|
567
989
|
summary: "Create an annotation on a page.",
|
|
568
990
|
method: "POST",
|
|
569
991
|
path: wireTemplates.layerAnnotationItems,
|
|
@@ -582,6 +1004,7 @@ var docOperations = {
|
|
|
582
1004
|
},
|
|
583
1005
|
"doc.annotations.update": {
|
|
584
1006
|
operationId: "doc.annotations.update",
|
|
1007
|
+
title: "Update annotation",
|
|
585
1008
|
summary: "Update one annotation by key.",
|
|
586
1009
|
method: "PATCH",
|
|
587
1010
|
path: wireTemplates.layerAnnotationItem,
|
|
@@ -599,6 +1022,7 @@ var docOperations = {
|
|
|
599
1022
|
},
|
|
600
1023
|
"doc.annotations.delete": {
|
|
601
1024
|
operationId: "doc.annotations.delete",
|
|
1025
|
+
title: "Delete annotation",
|
|
602
1026
|
summary: "Delete one annotation by key.",
|
|
603
1027
|
method: "DELETE",
|
|
604
1028
|
path: wireTemplates.layerAnnotationItem,
|
|
@@ -614,6 +1038,7 @@ var docOperations = {
|
|
|
614
1038
|
},
|
|
615
1039
|
"doc.forms.get": {
|
|
616
1040
|
operationId: "doc.forms.get",
|
|
1041
|
+
title: "Get form snapshot",
|
|
617
1042
|
summary: "Reconciled form snapshot: fields, widgets, values.",
|
|
618
1043
|
method: "GET",
|
|
619
1044
|
path: wireTemplates.layerForm,
|
|
@@ -629,6 +1054,7 @@ var docOperations = {
|
|
|
629
1054
|
},
|
|
630
1055
|
"doc.forms.setValue": {
|
|
631
1056
|
operationId: "doc.forms.setValue",
|
|
1057
|
+
title: "Set form value",
|
|
632
1058
|
summary: "Set one form field's value.",
|
|
633
1059
|
method: "POST",
|
|
634
1060
|
path: wireTemplates.layerFormFieldValue,
|
|
@@ -646,6 +1072,7 @@ var docOperations = {
|
|
|
646
1072
|
},
|
|
647
1073
|
"doc.forms.reset": {
|
|
648
1074
|
operationId: "doc.forms.reset",
|
|
1075
|
+
title: "Reset form field",
|
|
649
1076
|
summary: "Reset one form field to its default value.",
|
|
650
1077
|
method: "POST",
|
|
651
1078
|
path: wireTemplates.layerFormFieldReset,
|
|
@@ -661,6 +1088,7 @@ var docOperations = {
|
|
|
661
1088
|
},
|
|
662
1089
|
"doc.forms.exportData": {
|
|
663
1090
|
operationId: "doc.forms.exportData",
|
|
1091
|
+
title: "Export form data",
|
|
664
1092
|
summary: "Export form data as FDF or XFDF.",
|
|
665
1093
|
method: "GET",
|
|
666
1094
|
path: wireTemplates.layerFormData,
|
|
@@ -677,6 +1105,7 @@ var docOperations = {
|
|
|
677
1105
|
},
|
|
678
1106
|
"doc.forms.importData": {
|
|
679
1107
|
operationId: "doc.forms.importData",
|
|
1108
|
+
title: "Import form data",
|
|
680
1109
|
summary: "Import form data (FDF/XFDF), filling matching fields.",
|
|
681
1110
|
method: "POST",
|
|
682
1111
|
path: wireTemplates.layerFormData,
|
|
@@ -694,6 +1123,7 @@ var docOperations = {
|
|
|
694
1123
|
},
|
|
695
1124
|
"doc.pages.move": {
|
|
696
1125
|
operationId: "doc.pages.move",
|
|
1126
|
+
title: "Move pages",
|
|
697
1127
|
summary: "Reorder pages.",
|
|
698
1128
|
method: "POST",
|
|
699
1129
|
path: wireTemplates.layerPagesMove,
|
|
@@ -711,6 +1141,7 @@ var docOperations = {
|
|
|
711
1141
|
},
|
|
712
1142
|
"doc.pages.rotate": {
|
|
713
1143
|
operationId: "doc.pages.rotate",
|
|
1144
|
+
title: "Rotate pages",
|
|
714
1145
|
summary: "Set absolute rotation on pages.",
|
|
715
1146
|
method: "POST",
|
|
716
1147
|
path: wireTemplates.layerPagesRotate,
|
|
@@ -728,6 +1159,7 @@ var docOperations = {
|
|
|
728
1159
|
},
|
|
729
1160
|
"doc.pages.delete": {
|
|
730
1161
|
operationId: "doc.pages.delete",
|
|
1162
|
+
title: "Delete pages",
|
|
731
1163
|
summary: "Delete pages.",
|
|
732
1164
|
method: "POST",
|
|
733
1165
|
path: wireTemplates.layerPagesDelete,
|
|
@@ -745,6 +1177,7 @@ var docOperations = {
|
|
|
745
1177
|
},
|
|
746
1178
|
"doc.pages.flatten": {
|
|
747
1179
|
operationId: "doc.pages.flatten",
|
|
1180
|
+
title: "Flatten pages",
|
|
748
1181
|
summary: "Flatten annotations and form fields into page content.",
|
|
749
1182
|
method: "POST",
|
|
750
1183
|
path: wireTemplates.layerPagesFlatten,
|
|
@@ -760,8 +1193,68 @@ var docOperations = {
|
|
|
760
1193
|
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
761
1194
|
}
|
|
762
1195
|
},
|
|
1196
|
+
"doc.pages.insert": {
|
|
1197
|
+
operationId: "doc.pages.insert",
|
|
1198
|
+
title: "Insert pages from a PDF",
|
|
1199
|
+
summary: "Copy every page of an uploaded PDF into the document at an index.",
|
|
1200
|
+
method: "POST",
|
|
1201
|
+
path: wireTemplates.layerPagesInsert,
|
|
1202
|
+
credentials: docCredentials,
|
|
1203
|
+
scope: [],
|
|
1204
|
+
docCapabilities: ["doc.pages.assemble"],
|
|
1205
|
+
requestHeaders: [documentPasswordHeader],
|
|
1206
|
+
params: DocLayerParamsSchema,
|
|
1207
|
+
body: {
|
|
1208
|
+
contentType: "multipart/form-data"
|
|
1209
|
+
},
|
|
1210
|
+
responses: {
|
|
1211
|
+
200: { contentType: "application/json", schema: MutationResponseSchema },
|
|
1212
|
+
400: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
1213
|
+
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1214
|
+
},
|
|
1215
|
+
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.'
|
|
1216
|
+
},
|
|
1217
|
+
"doc.pages.insertBlank": {
|
|
1218
|
+
operationId: "doc.pages.insertBlank",
|
|
1219
|
+
title: "Insert blank pages",
|
|
1220
|
+
summary: "Create blank pages of an explicit size at an index.",
|
|
1221
|
+
method: "POST",
|
|
1222
|
+
path: wireTemplates.layerPagesInsertBlank,
|
|
1223
|
+
credentials: docCredentials,
|
|
1224
|
+
scope: [],
|
|
1225
|
+
docCapabilities: ["doc.pages.assemble"],
|
|
1226
|
+
requestHeaders: [documentPasswordHeader],
|
|
1227
|
+
params: DocLayerParamsSchema,
|
|
1228
|
+
body: { contentType: "application/json", schema: looseJson },
|
|
1229
|
+
responses: {
|
|
1230
|
+
200: { contentType: "application/json", schema: MutationResponseSchema },
|
|
1231
|
+
400: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
1232
|
+
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1233
|
+
},
|
|
1234
|
+
notes: 'Body is `{"size": {"width", "height"}, "count"?, "destIndex"?}` \u2014 size in PDF points, count in [1, 100], destIndex omitted \u2192 append.'
|
|
1235
|
+
},
|
|
1236
|
+
"doc.pages.extract": {
|
|
1237
|
+
operationId: "doc.pages.extract",
|
|
1238
|
+
title: "Extract pages",
|
|
1239
|
+
summary: "Export the listed pages, in order, as a standalone PDF.",
|
|
1240
|
+
method: "POST",
|
|
1241
|
+
path: wireTemplates.layerPagesExtract,
|
|
1242
|
+
credentials: docCredentials,
|
|
1243
|
+
scope: [],
|
|
1244
|
+
docCapabilities: ["doc.download"],
|
|
1245
|
+
requestHeaders: [documentPasswordHeader],
|
|
1246
|
+
params: DocLayerParamsSchema,
|
|
1247
|
+
body: { contentType: "application/json", schema: looseJson },
|
|
1248
|
+
responses: {
|
|
1249
|
+
200: { contentType: "application/pdf" },
|
|
1250
|
+
400: { contentType: "application/json", schema: EngineErrorPayloadSchema },
|
|
1251
|
+
404: { contentType: "application/json", schema: EngineErrorPayloadSchema }
|
|
1252
|
+
},
|
|
1253
|
+
notes: 'A read, not a mutation: the source document is untouched and no event is published. Body is `{"pageObjectNumbers": number[]}`; the response body is the new PDF.'
|
|
1254
|
+
},
|
|
763
1255
|
"doc.redactions.apply": {
|
|
764
1256
|
operationId: "doc.redactions.apply",
|
|
1257
|
+
title: "Apply redactions",
|
|
765
1258
|
summary: "Apply pending redactions, permanently removing content.",
|
|
766
1259
|
method: "POST",
|
|
767
1260
|
path: wireTemplates.layerRedactionsApply,
|
|
@@ -779,6 +1272,7 @@ var docOperations = {
|
|
|
779
1272
|
},
|
|
780
1273
|
"doc.download": {
|
|
781
1274
|
operationId: "doc.download",
|
|
1275
|
+
title: "Download PDF",
|
|
782
1276
|
summary: "Download the layer's current PDF (base plus layer edits).",
|
|
783
1277
|
method: "GET",
|
|
784
1278
|
path: wireTemplates.layerDownload,
|
|
@@ -794,11 +1288,26 @@ var docOperations = {
|
|
|
794
1288
|
}
|
|
795
1289
|
};
|
|
796
1290
|
var allOperations = { ...adminOperations, ...docOperations };
|
|
1291
|
+
var docsGroups = {
|
|
1292
|
+
deployment: { title: "Deployment" },
|
|
1293
|
+
tenants: { title: "Tenants" },
|
|
1294
|
+
documents: { title: "Tenant documents" },
|
|
1295
|
+
tokens: { title: "Tokens" },
|
|
1296
|
+
shares: { title: "Shares" },
|
|
1297
|
+
doc: { title: "Document operations", slug: "document-operations" },
|
|
1298
|
+
"doc.annotations": { title: "Annotations" },
|
|
1299
|
+
"doc.forms": { title: "Forms" },
|
|
1300
|
+
"doc.metadata": { title: "Metadata" },
|
|
1301
|
+
"doc.pages": { title: "Pages" },
|
|
1302
|
+
"doc.redactions": { title: "Redactions" }
|
|
1303
|
+
};
|
|
797
1304
|
export {
|
|
798
1305
|
ADMIN_DOCUMENT_LIST_DEFAULT_LIMIT,
|
|
799
1306
|
ADMIN_DOCUMENT_LIST_MAX_LIMIT,
|
|
800
1307
|
AdminDocumentCommitRequestSchema,
|
|
801
1308
|
AdminDocumentCommitResponseSchema,
|
|
1309
|
+
AdminDocumentImportRequestSchema,
|
|
1310
|
+
AdminDocumentImportResponseSchema,
|
|
802
1311
|
AdminDocumentInitRequestSchema,
|
|
803
1312
|
AdminDocumentInitResponseSchema,
|
|
804
1313
|
AdminDocumentListQuerySchema,
|
|
@@ -806,6 +1315,7 @@ export {
|
|
|
806
1315
|
AdminDocumentRecordSchema,
|
|
807
1316
|
AdminDocumentResponseSchema,
|
|
808
1317
|
AdminErrorPayloadSchema,
|
|
1318
|
+
AdminImportSourceSchema,
|
|
809
1319
|
AdminInitUploadSchema,
|
|
810
1320
|
AdminLicenseStatusResponseSchema,
|
|
811
1321
|
AdminPresignedUploadSchema,
|
|
@@ -818,13 +1328,14 @@ export {
|
|
|
818
1328
|
AdminTenantParamsSchema,
|
|
819
1329
|
AdminTenantRecordSchema,
|
|
820
1330
|
AdminTenantResponseSchema,
|
|
1331
|
+
AdminTenantShareParamsSchema,
|
|
821
1332
|
AdminThumbnailUnavailablePayloadSchema,
|
|
822
1333
|
AdminTokenIssueDocRequestSchema,
|
|
823
1334
|
AdminTokenIssueRequestSchema,
|
|
824
1335
|
AdminTokenIssueResponseSchema,
|
|
825
1336
|
AdminTokenIssueTenantRequestSchema,
|
|
826
1337
|
AdminTokenRevokeRequestSchema,
|
|
827
|
-
|
|
1338
|
+
AdminUploadProxyResponseSchema,
|
|
828
1339
|
DedupModeSchema,
|
|
829
1340
|
DocAnnotationParamsSchema,
|
|
830
1341
|
DocFieldParamsSchema,
|
|
@@ -832,12 +1343,26 @@ export {
|
|
|
832
1343
|
DocLayerParamsSchema,
|
|
833
1344
|
DocPageParamsSchema,
|
|
834
1345
|
DocumentStateSchema,
|
|
1346
|
+
ShareExchangeRequestSchema,
|
|
1347
|
+
ShareGrantCreateRequestSchema,
|
|
1348
|
+
ShareGrantListQuerySchema,
|
|
1349
|
+
ShareGrantListResponseSchema,
|
|
1350
|
+
ShareGrantRecordSchema,
|
|
1351
|
+
ShareGrantResponseSchema,
|
|
1352
|
+
ShareGrantUpdateRequestSchema,
|
|
1353
|
+
ShareSessionResponseSchema,
|
|
1354
|
+
TenantSuspendRequestSchema,
|
|
1355
|
+
TenantUsageQuerySchema,
|
|
1356
|
+
TenantUsageResponseSchema,
|
|
1357
|
+
UploadPreferenceSchema,
|
|
835
1358
|
adminCredentials,
|
|
836
1359
|
adminOperations,
|
|
837
1360
|
adminTenantScopes,
|
|
838
1361
|
adminWirePaths,
|
|
839
1362
|
allOperations,
|
|
840
1363
|
docOperations,
|
|
841
|
-
|
|
1364
|
+
docsGroups,
|
|
1365
|
+
documentPasswordHeader,
|
|
1366
|
+
tenantIdPattern
|
|
842
1367
|
};
|
|
843
1368
|
//# sourceMappingURL=index.js.map
|