@embedpdf/engine-core 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/AnnotationList-DcyhF2kU.d.cts +27691 -0
- package/dist/AnnotationList-DcyhF2kU.d.ts +27691 -0
- package/dist/Change-Ct-dB8D5.cjs +1133 -0
- package/dist/Change-Ct-dB8D5.cjs.map +1 -0
- package/dist/Change-tMR34hTU.js +978 -0
- package/dist/Change-tMR34hTU.js.map +1 -0
- package/dist/DocumentRenderService-9IjSQEIU.cjs +121 -0
- package/dist/DocumentRenderService-9IjSQEIU.cjs.map +1 -0
- package/dist/DocumentRenderService-DFrZ9wfW.js +86 -0
- package/dist/DocumentRenderService-DFrZ9wfW.js.map +1 -0
- package/dist/{DocumentSecurityService-Ca6EK3-3.d.ts → DocumentSecurityService-D2zA4NKi.d.cts} +100 -112
- package/dist/{DocumentSecurityService-CIx1MT0T.d.cts → DocumentSecurityService-YJV9df8P.d.ts} +100 -112
- package/dist/LocalDocumentHandle-D02FMm-Z.cjs +53 -0
- package/dist/LocalDocumentHandle-D02FMm-Z.cjs.map +1 -0
- package/dist/LocalDocumentHandle-DAPdaOt_.js +30 -0
- package/dist/LocalDocumentHandle-DAPdaOt_.js.map +1 -0
- package/dist/LocalEngine-DBt2-GWF.d.ts +1649 -0
- package/dist/LocalEngine-IA9zh3Jh.d.cts +1649 -0
- package/dist/PageInsertBlankInput-CXHAM7l6.cjs +17 -0
- package/dist/PageInsertBlankInput-CXHAM7l6.cjs.map +1 -0
- package/dist/PageInsertBlankInput-DhVYVJ_S.js +12 -0
- package/dist/PageInsertBlankInput-DhVYVJ_S.js.map +1 -0
- package/dist/authority-BFp6XM04.cjs +2997 -0
- package/dist/authority-BFp6XM04.cjs.map +1 -0
- package/dist/authority-PuxpGFhJ.js +2506 -0
- package/dist/authority-PuxpGFhJ.js.map +1 -0
- package/dist/builders-DV62HA3I.js +165 -0
- package/dist/builders-DV62HA3I.js.map +1 -0
- package/dist/builders-DgTAj_tP.cjs +188 -0
- package/dist/builders-DgTAj_tP.cjs.map +1 -0
- package/dist/calibrate-DJbi1wuK.cjs +3012 -0
- package/dist/calibrate-DJbi1wuK.cjs.map +1 -0
- package/dist/calibrate-nQFgCuki.js +2461 -0
- package/dist/calibrate-nQFgCuki.js.map +1 -0
- package/dist/charmap-Cprti1ta.js +239 -0
- package/dist/charmap-Cprti1ta.js.map +1 -0
- package/dist/charmap-aYlefQP9.cjs +304 -0
- package/dist/charmap-aYlefQP9.cjs.map +1 -0
- package/dist/conformance.cjs +18146 -5258
- package/dist/conformance.cjs.map +1 -1
- package/dist/conformance.d.cts +1024 -170
- package/dist/conformance.d.ts +1024 -170
- package/dist/conformance.js +18148 -5309
- package/dist/conformance.js.map +1 -1
- package/dist/format-Bp3QFSH1.cjs +574 -0
- package/dist/format-Bp3QFSH1.cjs.map +1 -0
- package/dist/format-Dgg428Kb.js +461 -0
- package/dist/format-Dgg428Kb.js.map +1 -0
- package/dist/index.cjs +342 -116
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +14 -5
- package/dist/pageRefs-B3ur7Ckm.cjs +51 -0
- package/dist/pageRefs-B3ur7Ckm.cjs.map +1 -0
- package/dist/pageRefs-DkbuxSCV.js +40 -0
- package/dist/pageRefs-DkbuxSCV.js.map +1 -0
- package/dist/public.cjs +59 -0
- package/dist/public.d.cts +5 -0
- package/dist/public.d.ts +5 -0
- package/dist/public.js +9 -0
- package/dist/resolveAnnotationDraft-7Ke4nV7F.cjs +3646 -0
- package/dist/resolveAnnotationDraft-7Ke4nV7F.cjs.map +1 -0
- package/dist/resolveAnnotationDraft-CUpf0SMh.js +3167 -0
- package/dist/resolveAnnotationDraft-CUpf0SMh.js.map +1 -0
- package/dist/{resolver-inAVzsWt.js → resolver-BBggAxQc.js} +298 -145
- package/dist/resolver-BBggAxQc.js.map +1 -0
- package/dist/{resolver-CYVNV4hn.cjs → resolver-BWSWSF6R.cjs} +351 -144
- package/dist/resolver-BWSWSF6R.cjs.map +1 -0
- package/dist/runtime-BaDKjxiu.d.ts +1959 -0
- package/dist/runtime-CWEuiwbk.d.cts +1959 -0
- package/dist/runtime.cjs +986 -297
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.d.cts +5 -1372
- package/dist/runtime.d.ts +5 -1372
- package/dist/runtime.js +634 -179
- package/dist/runtime.js.map +1 -1
- package/dist/schema-6S2VmlAj.js +2087 -0
- package/dist/schema-6S2VmlAj.js.map +1 -0
- package/dist/schema-miH6tWQC.cjs +3046 -0
- package/dist/schema-miH6tWQC.cjs.map +1 -0
- package/dist/schemas-BE2QGOit.js +1851 -0
- package/dist/schemas-BE2QGOit.js.map +1 -0
- package/dist/schemas-DljJR9ut.cjs +2798 -0
- package/dist/schemas-DljJR9ut.cjs.map +1 -0
- package/dist/subtype-CG4WpIRj.js +129 -0
- package/dist/subtype-CG4WpIRj.js.map +1 -0
- package/dist/subtype-aDt5TFmK.cjs +158 -0
- package/dist/subtype-aDt5TFmK.cjs.map +1 -0
- package/dist/validation.cjs +578 -0
- package/dist/validation.cjs.map +1 -0
- package/dist/validation.d.cts +174 -0
- package/dist/validation.d.ts +174 -0
- package/dist/validation.js +571 -0
- package/dist/validation.js.map +1 -0
- package/dist/value-BFS1R8ek.cjs +435 -0
- package/dist/value-BFS1R8ek.cjs.map +1 -0
- package/dist/value-Dhc8eYcx.js +340 -0
- package/dist/value-Dhc8eYcx.js.map +1 -0
- package/dist/viewport-CHG9qQUb.cjs +671 -0
- package/dist/viewport-CHG9qQUb.cjs.map +1 -0
- package/dist/viewport-DQR5LyX3.js +540 -0
- package/dist/viewport-DQR5LyX3.js.map +1 -0
- package/dist/wire.cjs +1242 -420
- package/dist/wire.cjs.map +1 -1
- package/dist/wire.d.cts +14840 -830
- package/dist/wire.d.ts +14840 -830
- package/dist/wire.js +985 -261
- package/dist/wire.js.map +1 -1
- package/package.json +10 -1
- package/dist/AbortError-DwuHPK_I.js +0 -27
- package/dist/AbortError-DwuHPK_I.js.map +0 -1
- package/dist/AbortError-P0RU0Mgg.cjs +0 -38
- package/dist/AbortError-P0RU0Mgg.cjs.map +0 -1
- package/dist/AnnotationListSnapshot-D9R5n2Kf.d.cts +0 -7101
- package/dist/AnnotationListSnapshot-D9R5n2Kf.d.ts +0 -7101
- package/dist/Engine-EWWHhEIi.d.ts +0 -1277
- package/dist/Engine-FNaAEjfb.d.cts +0 -1277
- package/dist/derive-BbsDk_Kz.cjs +0 -880
- package/dist/derive-BbsDk_Kz.cjs.map +0 -1
- package/dist/derive-DAFJolWu.js +0 -647
- package/dist/derive-DAFJolWu.js.map +0 -1
- package/dist/format-Bbphf4zR.js +0 -435
- package/dist/format-Bbphf4zR.js.map +0 -1
- package/dist/format-D_epWlob.cjs +0 -518
- package/dist/format-D_epWlob.cjs.map +0 -1
- package/dist/resolver-CYVNV4hn.cjs.map +0 -1
- package/dist/resolver-inAVzsWt.js.map +0 -1
- package/dist/schemas-CFQGvWiu.js +0 -3243
- package/dist/schemas-CFQGvWiu.js.map +0 -1
- package/dist/schemas-D0g6tKa9.cjs +0 -4694
- package/dist/schemas-D0g6tKa9.cjs.map +0 -1
- package/dist/viewport-BWeNHZmb.cjs +0 -3503
- package/dist/viewport-BWeNHZmb.cjs.map +0 -1
- package/dist/viewport-CvMcadfQ.js +0 -3072
- package/dist/viewport-CvMcadfQ.js.map +0 -1
|
@@ -0,0 +1,1851 @@
|
|
|
1
|
+
import { y as EngineErrorCode } from "./format-Dgg428Kb.js";
|
|
2
|
+
import { c as toBase64, l as ANNOTATION_APPEARANCE_MODES, r as charMapViolation, s as fromBase64 } from "./charmap-Cprti1ta.js";
|
|
3
|
+
import "./PageInsertBlankInput-DhVYVJ_S.js";
|
|
4
|
+
import { At as AppearanceResourceKeysSchema, Cn as AnnotationRefSchema, Dt as AttachmentSchema, E as FormFieldRefSchema, En as ColorSchema, Et as AttachmentRefSchema, Kn as PageQuadSchema, Mt as ImageResourceKeysSchema, Qn as PageRefSchema, T as WidgetPatchSchema, Tt as AttachmentFileInfoSchema, Wn as PageBoxSchema, Xn as PdfRotationSchema, Yn as PdfRectSchema, Zn as PdfSizeSchema, _ as AnnotationSchema, _n as PdfPageActionsSchema, a as FormFieldPatchSchema, bn as PdfLinkTargetWritableSchema, d as FormWidgetSchema, dn as PdfActionTreeSchema, g as AnnotationPatchSchema, h as AnnotationDraftSchema, in as IsoDateTimeSchema, n as FormFieldDraftSchema, o as FormFieldValueSchema, p as WidgetPlacementSchema, rn as DateInputSchema, s as FormFieldWidgetSchema, t as FormFieldDTOSchema, w as WidgetDTOSchema, wt as AttachmentFileBaseSchema, yn as PdfLinkTargetSchema } from "./schema-6S2VmlAj.js";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
//#region src/wire/renderFamilies.ts
|
|
7
|
+
const PAGE_RENDER_FAMILIES = {
|
|
8
|
+
pages: {
|
|
9
|
+
family: "pages",
|
|
10
|
+
resource: "page-render",
|
|
11
|
+
layerResource: "layer-page-render",
|
|
12
|
+
draws: {
|
|
13
|
+
includeAnnotations: false,
|
|
14
|
+
includeFormFields: false
|
|
15
|
+
},
|
|
16
|
+
path: "render/pages",
|
|
17
|
+
needs: ["doc.render"],
|
|
18
|
+
planes: ["content"],
|
|
19
|
+
pins: ["contentVersion"],
|
|
20
|
+
print: null
|
|
21
|
+
},
|
|
22
|
+
annotations: {
|
|
23
|
+
family: "annotations",
|
|
24
|
+
resource: "page-render-annotations",
|
|
25
|
+
layerResource: "layer-page-render-annotations",
|
|
26
|
+
draws: {
|
|
27
|
+
includeAnnotations: true,
|
|
28
|
+
includeFormFields: false
|
|
29
|
+
},
|
|
30
|
+
path: "render/annotations/pages",
|
|
31
|
+
needs: ["doc.render", "doc.annotate.read"],
|
|
32
|
+
planes: ["content", "annotations"],
|
|
33
|
+
pins: ["contentVersion", "annotationVersion"],
|
|
34
|
+
print: null
|
|
35
|
+
},
|
|
36
|
+
fields: {
|
|
37
|
+
family: "fields",
|
|
38
|
+
resource: "page-render-fields",
|
|
39
|
+
layerResource: "layer-page-render-fields",
|
|
40
|
+
draws: {
|
|
41
|
+
includeAnnotations: false,
|
|
42
|
+
includeFormFields: true
|
|
43
|
+
},
|
|
44
|
+
path: "render/fields/pages",
|
|
45
|
+
needs: ["doc.render", "doc.forms.read"],
|
|
46
|
+
planes: ["content", "forms"],
|
|
47
|
+
pins: ["contentVersion", "widgetVersion"],
|
|
48
|
+
print: null
|
|
49
|
+
},
|
|
50
|
+
all: {
|
|
51
|
+
family: "all",
|
|
52
|
+
resource: "page-render-all",
|
|
53
|
+
layerResource: "layer-page-render-all",
|
|
54
|
+
draws: {
|
|
55
|
+
includeAnnotations: true,
|
|
56
|
+
includeFormFields: true
|
|
57
|
+
},
|
|
58
|
+
path: "render/all/pages",
|
|
59
|
+
needs: [
|
|
60
|
+
"doc.render",
|
|
61
|
+
"doc.annotate.read",
|
|
62
|
+
"doc.forms.read"
|
|
63
|
+
],
|
|
64
|
+
planes: [
|
|
65
|
+
"content",
|
|
66
|
+
"annotations",
|
|
67
|
+
"forms"
|
|
68
|
+
],
|
|
69
|
+
pins: [
|
|
70
|
+
"contentVersion",
|
|
71
|
+
"annotationVersion",
|
|
72
|
+
"widgetVersion"
|
|
73
|
+
],
|
|
74
|
+
print: null
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
/** The family of a picture that draws `layers`. */
|
|
78
|
+
function pageRenderFamilyOf(layers) {
|
|
79
|
+
if (layers.includeAnnotations) return layers.includeFormFields ? "all" : "annotations";
|
|
80
|
+
return layers.includeFormFields ? "fields" : "pages";
|
|
81
|
+
}
|
|
82
|
+
const PAGE_PRINT_TIERS = {
|
|
83
|
+
print: {
|
|
84
|
+
tier: "print",
|
|
85
|
+
dpi: 150,
|
|
86
|
+
needs: ["doc.print"]
|
|
87
|
+
},
|
|
88
|
+
"print-high": {
|
|
89
|
+
tier: "print-high",
|
|
90
|
+
dpi: 300,
|
|
91
|
+
needs: ["doc.print", "doc.print.high"]
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
/** The tier that prints at `dpi`. */
|
|
95
|
+
function pagePrintTierOf(dpi) {
|
|
96
|
+
return dpi === 300 ? "print-high" : "print";
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* The print pictures: each of the four families, printed at each tier. A
|
|
100
|
+
* print picture draws what its family draws, by the print rules: layers in
|
|
101
|
+
* their print state, annotations and fields by their `print` flag. So no
|
|
102
|
+
* print family is a screen picture under another name, and each needs its
|
|
103
|
+
* family's rights plus its tier's. It keeps its family's planes and pins,
|
|
104
|
+
* and its path is the family's with the tier after `render/`:
|
|
105
|
+
* `render/print-high/annotations/pages`.
|
|
106
|
+
*/
|
|
107
|
+
const PAGE_PRINT_FAMILIES = {
|
|
108
|
+
print: {
|
|
109
|
+
pages: printFamily("print", "pages", "page-print", "layer-page-print"),
|
|
110
|
+
annotations: printFamily("print", "annotations", "page-print-annotations", "layer-page-print-annotations"),
|
|
111
|
+
fields: printFamily("print", "fields", "page-print-fields", "layer-page-print-fields"),
|
|
112
|
+
all: printFamily("print", "all", "page-print-all", "layer-page-print-all")
|
|
113
|
+
},
|
|
114
|
+
"print-high": {
|
|
115
|
+
pages: printFamily("print-high", "pages", "page-print-high", "layer-page-print-high"),
|
|
116
|
+
annotations: printFamily("print-high", "annotations", "page-print-high-annotations", "layer-page-print-high-annotations"),
|
|
117
|
+
fields: printFamily("print-high", "fields", "page-print-high-fields", "layer-page-print-high-fields"),
|
|
118
|
+
all: printFamily("print-high", "all", "page-print-high-all", "layer-page-print-high-all")
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
/** Every page picture: the four screen families and the eight print ones. */
|
|
122
|
+
const PAGE_PICTURES = [...Object.values(PAGE_RENDER_FAMILIES), ...Object.values(PAGE_PRINT_FAMILIES).flatMap((tier) => Object.values(tier))];
|
|
123
|
+
/** The picture that draws `layers`, for the screen or printed at `dpi`. */
|
|
124
|
+
function pagePictureOf(layers, printDpi) {
|
|
125
|
+
const family = pageRenderFamilyOf(layers);
|
|
126
|
+
return printDpi === void 0 ? PAGE_RENDER_FAMILIES[family] : PAGE_PRINT_FAMILIES[pagePrintTierOf(printDpi)][family];
|
|
127
|
+
}
|
|
128
|
+
function printFamily(tier, family, resource, layerResource) {
|
|
129
|
+
const screen = PAGE_RENDER_FAMILIES[family];
|
|
130
|
+
const print = PAGE_PRINT_TIERS[tier];
|
|
131
|
+
return {
|
|
132
|
+
...screen,
|
|
133
|
+
resource,
|
|
134
|
+
layerResource,
|
|
135
|
+
path: `render/${tier}/${screen.path.slice(7)}`,
|
|
136
|
+
needs: [...screen.needs, ...print.needs],
|
|
137
|
+
print
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
//#endregion
|
|
141
|
+
//#region src/identity/OutlineItemRef.schema.ts
|
|
142
|
+
/** Wire form of `OutlineItemRef` — see the type. */
|
|
143
|
+
const OutlineItemRefSchema = z.object({
|
|
144
|
+
kind: z.literal("objectNumber"),
|
|
145
|
+
objectNumber: z.number().int().positive()
|
|
146
|
+
});
|
|
147
|
+
//#endregion
|
|
148
|
+
//#region src/dto/DocumentOutline.schema.ts
|
|
149
|
+
/** Wire form of an `OutlineItem` (page space) — see the type. */
|
|
150
|
+
const OutlineItemSchema = z.object({
|
|
151
|
+
ref: OutlineItemRefSchema,
|
|
152
|
+
parent: OutlineItemRefSchema.nullable(),
|
|
153
|
+
title: z.string(),
|
|
154
|
+
target: PdfLinkTargetSchema.nullable(),
|
|
155
|
+
action: PdfActionTreeSchema.nullable(),
|
|
156
|
+
open: z.boolean(),
|
|
157
|
+
color: ColorSchema.nullable(),
|
|
158
|
+
bold: z.boolean(),
|
|
159
|
+
italic: z.boolean()
|
|
160
|
+
});
|
|
161
|
+
/** Wire form of a `DocumentOutline` (page space): what `GET …/outline` answers. */
|
|
162
|
+
const DocumentOutlineSchema = z.object({
|
|
163
|
+
items: z.array(OutlineItemSchema),
|
|
164
|
+
incomplete: z.boolean()
|
|
165
|
+
});
|
|
166
|
+
/**
|
|
167
|
+
* A title as a write takes it: at most 32,767 UTF-16 code units, the most a
|
|
168
|
+
* PDF text string holds in every PDF app (ISO 32000-2 Annex C).
|
|
169
|
+
*/
|
|
170
|
+
const OutlineTitleSchema = z.string().max(32767);
|
|
171
|
+
const outlineFields = {
|
|
172
|
+
title: OutlineTitleSchema,
|
|
173
|
+
target: PdfLinkTargetWritableSchema.nullable().optional(),
|
|
174
|
+
color: ColorSchema.nullable().optional(),
|
|
175
|
+
bold: z.boolean().optional(),
|
|
176
|
+
italic: z.boolean().optional()
|
|
177
|
+
};
|
|
178
|
+
/** Wire form of an `OutlineItemDraft` (page space). */
|
|
179
|
+
const OutlineItemDraftSchema = z.object(outlineFields).strict();
|
|
180
|
+
/** Wire form of an `OutlineItemPatch` (page space). */
|
|
181
|
+
const OutlineItemPatchSchema = z.object({
|
|
182
|
+
...outlineFields,
|
|
183
|
+
title: OutlineTitleSchema.optional(),
|
|
184
|
+
open: z.boolean().optional()
|
|
185
|
+
}).strict();
|
|
186
|
+
//#endregion
|
|
187
|
+
//#region src/wire/schemas.ts
|
|
188
|
+
/** Who a session acts for; see `Identity` in `auth/scope/types.ts`. */
|
|
189
|
+
const IdentitySchema = z.object({
|
|
190
|
+
userId: z.string().min(1).max(256).optional(),
|
|
191
|
+
displayName: z.string().min(1).max(256).optional(),
|
|
192
|
+
email: z.string().min(1).max(256).optional(),
|
|
193
|
+
title: z.string().min(1).max(256).optional(),
|
|
194
|
+
organization: z.string().min(1).max(256).optional(),
|
|
195
|
+
organizationalUnit: z.string().min(1).max(256).optional(),
|
|
196
|
+
groupId: z.string().min(1).max(256).optional()
|
|
197
|
+
}).strict();
|
|
198
|
+
const DocumentMetadataSchema = z.object({
|
|
199
|
+
title: z.string().nullable(),
|
|
200
|
+
author: z.string().nullable(),
|
|
201
|
+
subject: z.string().nullable(),
|
|
202
|
+
keywords: z.string().nullable(),
|
|
203
|
+
producer: z.string().nullable(),
|
|
204
|
+
creator: z.string().nullable(),
|
|
205
|
+
createdAt: IsoDateTimeSchema.nullable(),
|
|
206
|
+
modifiedAt: IsoDateTimeSchema.nullable(),
|
|
207
|
+
trapped: z.enum([
|
|
208
|
+
"true",
|
|
209
|
+
"false",
|
|
210
|
+
"unknown"
|
|
211
|
+
])
|
|
212
|
+
});
|
|
213
|
+
/**
|
|
214
|
+
* Three-state metadata patch. Mirrors annotation patch semantics:
|
|
215
|
+
* `undefined` leaves a field, `null` clears it, a value sets it.
|
|
216
|
+
*/
|
|
217
|
+
const MetadataPatchSchema = z.object({
|
|
218
|
+
title: z.string().nullable().optional(),
|
|
219
|
+
author: z.string().nullable().optional(),
|
|
220
|
+
subject: z.string().nullable().optional(),
|
|
221
|
+
keywords: z.string().nullable().optional(),
|
|
222
|
+
producer: z.string().nullable().optional(),
|
|
223
|
+
creator: z.string().nullable().optional(),
|
|
224
|
+
createdAt: DateInputSchema.nullable().optional(),
|
|
225
|
+
modifiedAt: DateInputSchema.nullable().optional(),
|
|
226
|
+
trapped: z.enum([
|
|
227
|
+
"true",
|
|
228
|
+
"false",
|
|
229
|
+
"unknown"
|
|
230
|
+
]).optional()
|
|
231
|
+
}).strict();
|
|
232
|
+
/** The Info dict's other keys, `{ key: value }`. */
|
|
233
|
+
const CustomMetadataSchema = z.record(z.string(), z.string());
|
|
234
|
+
/**
|
|
235
|
+
* A custom-key patch: every key is a field (string sets, `null` removes, left
|
|
236
|
+
* out stays). Which keys a PDF can hold is the engine's check, so a refusal
|
|
237
|
+
* names the key the same way on both engines.
|
|
238
|
+
*/
|
|
239
|
+
const CustomMetadataPatchSchema = z.record(z.string(), z.string().nullable());
|
|
240
|
+
const OpenDocumentResponseSchema = z.object({ id: z.string() });
|
|
241
|
+
/**
|
|
242
|
+
* Wire shape of `GET /v1/docs/:docId/head`. Mirrors the server-side
|
|
243
|
+
* `DocumentHead` interface; the schema is the source of truth so
|
|
244
|
+
* older SDKs talking to newer servers degrade gracefully (extra
|
|
245
|
+
* fields are accepted and ignored).
|
|
246
|
+
*
|
|
247
|
+
* `docVersion` is the single monotonic integer per doc; it bumps on
|
|
248
|
+
* any mutation that could change the manifest's content (page list,
|
|
249
|
+
* per-page content, per-page annotations), which
|
|
250
|
+
* makes `/manifest@docVersion=N` fully content-addressed and cache-friendly.
|
|
251
|
+
* The server's layer mutations bump it.
|
|
252
|
+
*/
|
|
253
|
+
const DocumentHeadSchema = z.object({
|
|
254
|
+
id: z.string(),
|
|
255
|
+
baseSha: z.string(),
|
|
256
|
+
storageSizeBytes: z.number().int().nonnegative(),
|
|
257
|
+
docVersion: z.number().int().positive(),
|
|
258
|
+
state: z.enum([
|
|
259
|
+
"pending",
|
|
260
|
+
"ready",
|
|
261
|
+
"failed",
|
|
262
|
+
"deleting"
|
|
263
|
+
]),
|
|
264
|
+
encryption: z.object({
|
|
265
|
+
state: z.enum([
|
|
266
|
+
"unknown",
|
|
267
|
+
"none",
|
|
268
|
+
"encrypted",
|
|
269
|
+
"unsupported"
|
|
270
|
+
]),
|
|
271
|
+
requiresPassword: z.boolean().nullable()
|
|
272
|
+
}),
|
|
273
|
+
permissions: z.object({
|
|
274
|
+
known: z.boolean(),
|
|
275
|
+
bits: z.number().int().nonnegative().nullable(),
|
|
276
|
+
allAllowed: z.boolean().nullable(),
|
|
277
|
+
openedAs: z.enum([
|
|
278
|
+
"none",
|
|
279
|
+
"user",
|
|
280
|
+
"owner"
|
|
281
|
+
]).nullable(),
|
|
282
|
+
securityHandlerRevision: z.number().int().nullable(),
|
|
283
|
+
canUpgradeToOwner: z.boolean()
|
|
284
|
+
}),
|
|
285
|
+
access: z.object({
|
|
286
|
+
required: z.boolean(),
|
|
287
|
+
reasons: z.array(z.enum([
|
|
288
|
+
"password",
|
|
289
|
+
"cdn",
|
|
290
|
+
"permissions-unknown"
|
|
291
|
+
])),
|
|
292
|
+
endpoint: z.string().optional()
|
|
293
|
+
})
|
|
294
|
+
});
|
|
295
|
+
const AccessRequestSchema = z.object({
|
|
296
|
+
/** Deprecated: identity now rides the path
|
|
297
|
+
* (`/v1/docs/:docId/layers/:layerName/access`). Kept optional for the
|
|
298
|
+
* legacy `/v1/access` alias, which requires `docId` in the body. */
|
|
299
|
+
docId: z.string().min(1).optional(),
|
|
300
|
+
layerName: z.string().min(1).optional(),
|
|
301
|
+
password: z.string().optional(),
|
|
302
|
+
passwordGrant: z.string().optional(),
|
|
303
|
+
mode: z.enum(["any", "owner"]).optional(),
|
|
304
|
+
/**
|
|
305
|
+
* How many object numbers the caller's editing session wants now, at
|
|
306
|
+
* most 32: 8 for a new session when absent, 0 for a client that holds
|
|
307
|
+
* enough.
|
|
308
|
+
*/
|
|
309
|
+
objectNumbers: z.number().int().nonnegative().optional()
|
|
310
|
+
});
|
|
311
|
+
/** `first`, `first + 1`, …, `first + count - 1`. */
|
|
312
|
+
const ObjectNumberRangeSchema = z.object({
|
|
313
|
+
first: z.number().int().positive(),
|
|
314
|
+
count: z.number().int().positive()
|
|
315
|
+
});
|
|
316
|
+
/** See `EditSessionAccess`. */
|
|
317
|
+
const EditSessionAccessSchema = z.object({
|
|
318
|
+
session: z.enum([
|
|
319
|
+
"new",
|
|
320
|
+
"revived",
|
|
321
|
+
"live"
|
|
322
|
+
]),
|
|
323
|
+
expiresIn: z.number().int().nonnegative(),
|
|
324
|
+
objectNumbers: z.array(ObjectNumberRangeSchema)
|
|
325
|
+
});
|
|
326
|
+
/** See `EditSessionStatus`: the event stream's `session` event. */
|
|
327
|
+
const EditSessionStatusSchema = z.object({
|
|
328
|
+
held: z.array(ObjectNumberRangeSchema),
|
|
329
|
+
expiresIn: z.number().int().nonnegative()
|
|
330
|
+
});
|
|
331
|
+
/** `POST …/object-numbers`: a bulk reservation. */
|
|
332
|
+
const ObjectNumberReservationRequestSchema = z.object({ count: z.number().int().positive() });
|
|
333
|
+
const ObjectNumberReservationResponseSchema = z.object({
|
|
334
|
+
objectNumbers: z.array(ObjectNumberRangeSchema),
|
|
335
|
+
expiresIn: z.number().int().nonnegative()
|
|
336
|
+
});
|
|
337
|
+
/**
|
|
338
|
+
* Typed boolean view of the PDF user-access permission word. Names
|
|
339
|
+
* mirror the `PdfBits` shape in @embedpdf/engine-core/auth/scope; ISO
|
|
340
|
+
* bit numbers (3, 4, 5, 6, 9, 10, 11, 12).
|
|
341
|
+
*/
|
|
342
|
+
const PdfBitsObjectSchema = z.object({
|
|
343
|
+
bit3: z.boolean(),
|
|
344
|
+
bit4: z.boolean(),
|
|
345
|
+
bit5: z.boolean(),
|
|
346
|
+
bit6: z.boolean(),
|
|
347
|
+
bit9: z.boolean(),
|
|
348
|
+
bit10: z.boolean(),
|
|
349
|
+
bit11: z.boolean(),
|
|
350
|
+
bit12: z.boolean()
|
|
351
|
+
});
|
|
352
|
+
/**
|
|
353
|
+
* Capability-shaped advisory for the client UI. Mirrors
|
|
354
|
+
* `PdfPermissionAdvisory` in @embedpdf/engine-core/runtime; one
|
|
355
|
+
* boolean per UI badge.
|
|
356
|
+
*/
|
|
357
|
+
const PdfPermissionAdvisoryObjectSchema = z.object({
|
|
358
|
+
canPrint: z.boolean(),
|
|
359
|
+
canPrintHigh: z.boolean(),
|
|
360
|
+
canCopy: z.boolean(),
|
|
361
|
+
canAnnotate: z.boolean(),
|
|
362
|
+
canFillForms: z.boolean(),
|
|
363
|
+
canModifyForms: z.boolean(),
|
|
364
|
+
canModifyPages: z.boolean(),
|
|
365
|
+
canAssemble: z.boolean()
|
|
366
|
+
});
|
|
367
|
+
const PdfPermissionInfoSchema = z.object({
|
|
368
|
+
known: z.boolean(),
|
|
369
|
+
allAllowed: z.boolean().nullable(),
|
|
370
|
+
bits: z.number().int().nonnegative().nullable(),
|
|
371
|
+
openedAs: z.enum([
|
|
372
|
+
"none",
|
|
373
|
+
"user",
|
|
374
|
+
"owner"
|
|
375
|
+
]).nullable(),
|
|
376
|
+
securityHandlerRevision: z.number().int().nullable(),
|
|
377
|
+
flags: PdfBitsObjectSchema.optional(),
|
|
378
|
+
advisory: PdfPermissionAdvisoryObjectSchema.optional()
|
|
379
|
+
}).nullable();
|
|
380
|
+
const DocumentSecurityStateSchema = z.object({
|
|
381
|
+
encryption: z.object({
|
|
382
|
+
state: z.enum([
|
|
383
|
+
"unknown",
|
|
384
|
+
"none",
|
|
385
|
+
"encrypted",
|
|
386
|
+
"unsupported"
|
|
387
|
+
]),
|
|
388
|
+
requiresPassword: z.boolean().nullable()
|
|
389
|
+
}),
|
|
390
|
+
permissions: z.object({
|
|
391
|
+
known: z.boolean(),
|
|
392
|
+
bits: z.number().int().nonnegative().nullable(),
|
|
393
|
+
allAllowed: z.boolean().nullable(),
|
|
394
|
+
openedAs: z.enum([
|
|
395
|
+
"none",
|
|
396
|
+
"user",
|
|
397
|
+
"owner"
|
|
398
|
+
]).nullable(),
|
|
399
|
+
securityHandlerRevision: z.number().int().nullable(),
|
|
400
|
+
canUpgradeToOwner: z.boolean()
|
|
401
|
+
}),
|
|
402
|
+
access: z.object({
|
|
403
|
+
required: z.boolean(),
|
|
404
|
+
reasons: z.array(z.enum([
|
|
405
|
+
"password",
|
|
406
|
+
"cdn",
|
|
407
|
+
"permissions-unknown"
|
|
408
|
+
])),
|
|
409
|
+
endpoint: z.string().optional()
|
|
410
|
+
})
|
|
411
|
+
});
|
|
412
|
+
const positiveCount = z.number().int().positive();
|
|
413
|
+
/** See `BundleLimits`. */
|
|
414
|
+
const BundleLimitsSchema = z.object({
|
|
415
|
+
bundleBytes: positiveCount,
|
|
416
|
+
manifestBytes: positiveCount,
|
|
417
|
+
items: positiveCount,
|
|
418
|
+
pages: positiveCount,
|
|
419
|
+
resources: positiveCount,
|
|
420
|
+
resourceBytes: positiveCount,
|
|
421
|
+
imagePixels: positiveCount
|
|
422
|
+
}).strict();
|
|
423
|
+
const AccessResponseSchema = z.object({
|
|
424
|
+
security: DocumentSecurityStateSchema,
|
|
425
|
+
cdn: z.object({
|
|
426
|
+
adapter: z.enum([
|
|
427
|
+
"none",
|
|
428
|
+
"cloudfront",
|
|
429
|
+
"cloud-cdn",
|
|
430
|
+
"bunny",
|
|
431
|
+
"azure-fd",
|
|
432
|
+
"custom-hmac"
|
|
433
|
+
]),
|
|
434
|
+
expiresAt: z.number().int().positive(),
|
|
435
|
+
cache: z.object({
|
|
436
|
+
scope: z.enum(["browser-private", "edge-shared"]),
|
|
437
|
+
immutableVersionedReads: z.boolean()
|
|
438
|
+
}),
|
|
439
|
+
baseUrlOverrides: z.record(z.string(), z.string()).nullable(),
|
|
440
|
+
authHeader: z.object({
|
|
441
|
+
name: z.string(),
|
|
442
|
+
value: z.string()
|
|
443
|
+
}).nullable(),
|
|
444
|
+
signedQueryParams: z.record(z.string(), z.string()).nullable(),
|
|
445
|
+
signedCookies: z.array(z.object({
|
|
446
|
+
name: z.string(),
|
|
447
|
+
value: z.string(),
|
|
448
|
+
domain: z.string().optional(),
|
|
449
|
+
path: z.string().optional(),
|
|
450
|
+
expires: z.number().int().optional()
|
|
451
|
+
})).nullable(),
|
|
452
|
+
signedPathPolicies: z.array(z.object({
|
|
453
|
+
pathPrefix: z.string(),
|
|
454
|
+
queryParams: z.record(z.string(), z.string())
|
|
455
|
+
})).nullable()
|
|
456
|
+
}),
|
|
457
|
+
passwordGrant: z.string().nullable(),
|
|
458
|
+
pdfPermissions: PdfPermissionInfoSchema,
|
|
459
|
+
scope: z.array(z.string()),
|
|
460
|
+
/**
|
|
461
|
+
* Concrete capability set granted to this caller after expanding
|
|
462
|
+
* `pdf.permissions` and applying resolver implication rules. Client
|
|
463
|
+
* UI should drive feature visibility off this, not off raw `scope`.
|
|
464
|
+
* Always present in /access responses (server populates from
|
|
465
|
+
* `expandRawScope`). Sorted alphabetically for stable change
|
|
466
|
+
* detection.
|
|
467
|
+
*/
|
|
468
|
+
effectiveScope: z.array(z.string()),
|
|
469
|
+
/** What the document's signatures forbid; `effectiveScope` already leaves it out. */
|
|
470
|
+
protection: z.lazy(() => DocumentProtectionSchema).nullable(),
|
|
471
|
+
identity: IdentitySchema,
|
|
472
|
+
originPasswordPolicy: z.object({ mode: z.enum([
|
|
473
|
+
"not-needed",
|
|
474
|
+
"client-retry",
|
|
475
|
+
"server-session"
|
|
476
|
+
]) }),
|
|
477
|
+
expiresAt: z.number().int().positive(),
|
|
478
|
+
/**
|
|
479
|
+
* The deployment's render lattice — the canonical parameter points the
|
|
480
|
+
* server treats as durable, CDN-shared artifacts. Lives here and never in
|
|
481
|
+
* the manifest: manifests are version-pinned immutable objects; the
|
|
482
|
+
* lattice is mutable deployment policy. The SDK exposes it (and a pure
|
|
483
|
+
* `snap` helper) but never conforms requests implicitly — the same render
|
|
484
|
+
* call must not return different pixels on local vs cloud. When
|
|
485
|
+
* `enforced` is true the server rejects off-lattice render tokens with
|
|
486
|
+
* 400; when false, off-lattice renders are computed but not persisted.
|
|
487
|
+
* Absent on older servers → treat as unenforced/unknown.
|
|
488
|
+
*/
|
|
489
|
+
renderPolicy: z.object({
|
|
490
|
+
/**
|
|
491
|
+
* Full-page renders quantize on `viewport.width` — the bounded
|
|
492
|
+
* quantity is output pixels, never zoom (PDF page space is
|
|
493
|
+
* effectively unbounded, so a scale lattice bounds artifact count
|
|
494
|
+
* but not size).
|
|
495
|
+
*/
|
|
496
|
+
fullPage: z.object({ widths: z.array(z.number().int().positive()) }),
|
|
497
|
+
/**
|
|
498
|
+
* Reserved for deep-zoom tile support: scale-based pyramid ×
|
|
499
|
+
* fixed tile size, constant per-job cost. Absent until the tiling
|
|
500
|
+
* plugin ships.
|
|
501
|
+
*/
|
|
502
|
+
tiles: z.object({
|
|
503
|
+
tileSizes: z.array(z.number().int().positive()),
|
|
504
|
+
scales: z.array(z.number().positive())
|
|
505
|
+
}).optional(),
|
|
506
|
+
/**
|
|
507
|
+
* Annotation-appearance lattice — scale-based (appearances are sized
|
|
508
|
+
* by `rect × scale` and must track the page's effective render scale
|
|
509
|
+
* for crisp composites).
|
|
510
|
+
*/
|
|
511
|
+
appearances: z.object({ scales: z.array(z.number().positive()) }).optional(),
|
|
512
|
+
/** Worker-side output budget for degenerate page geometry. */
|
|
513
|
+
maxRenderPixels: z.number().int().positive().optional(),
|
|
514
|
+
formats: z.array(z.enum(["webp", "png"])),
|
|
515
|
+
background: z.enum(["white"]),
|
|
516
|
+
enforced: z.boolean()
|
|
517
|
+
}).optional(),
|
|
518
|
+
/** The deployment's limits for an annotation import (see `BundleLimits`). */
|
|
519
|
+
bundleLimits: BundleLimitsSchema,
|
|
520
|
+
/** The caller's editing session (see `DocumentAccessInfo.edit`). */
|
|
521
|
+
edit: EditSessionAccessSchema.optional()
|
|
522
|
+
});
|
|
523
|
+
const PdfSaveModeSchema = z.enum(["incremental", "rewrite"]);
|
|
524
|
+
const engineErrorCodeValues = Object.values(EngineErrorCode);
|
|
525
|
+
const EngineErrorPayloadSchema = z.object({
|
|
526
|
+
name: z.literal("EngineError"),
|
|
527
|
+
code: z.enum(engineErrorCodeValues),
|
|
528
|
+
message: z.string(),
|
|
529
|
+
details: z.record(z.string(), z.unknown()).optional()
|
|
530
|
+
});
|
|
531
|
+
const CachePinsSchema = z.object({
|
|
532
|
+
contentVersion: z.number().int().positive(),
|
|
533
|
+
annotationVersion: z.number().int().positive(),
|
|
534
|
+
widgetVersion: z.number().int().positive()
|
|
535
|
+
});
|
|
536
|
+
/**
|
|
537
|
+
* Plane scopes are derived from the version counters when a layer manifest
|
|
538
|
+
* is built, never stored. Absent on base manifests: consumers treat absence
|
|
539
|
+
* as all-'layer' (never wrong, only unshared).
|
|
540
|
+
*/
|
|
541
|
+
const LayerScopeValueSchema = z.enum(["base", "layer"]);
|
|
542
|
+
const LayerScopesSchema = z.object({
|
|
543
|
+
content: LayerScopeValueSchema,
|
|
544
|
+
annotations: LayerScopeValueSchema,
|
|
545
|
+
forms: LayerScopeValueSchema,
|
|
546
|
+
layout: LayerScopeValueSchema,
|
|
547
|
+
attachments: LayerScopeValueSchema,
|
|
548
|
+
metadata: LayerScopeValueSchema,
|
|
549
|
+
actions: LayerScopeValueSchema,
|
|
550
|
+
outline: LayerScopeValueSchema
|
|
551
|
+
});
|
|
552
|
+
/**
|
|
553
|
+
* Per-page envelope inside `DocumentManifest`: the page, plus the
|
|
554
|
+
* cache-busting integers the SDK embeds in leaf URLs
|
|
555
|
+
* (`/pages/:pon/text@contentVersion=N`, `/pages/:pon/annotations@annotationVersion=N`).
|
|
556
|
+
*
|
|
557
|
+
* `contentVersion` bumps when the page's content stream changes
|
|
558
|
+
* (text, page reorder doesn't, the pon is durable). `annotationVersion`
|
|
559
|
+
* bumps when /Annots gains/loses entries or when a tracked annotation
|
|
560
|
+
* mutates. The server derives both from its per-layer page state.
|
|
561
|
+
*/
|
|
562
|
+
const ManifestPageSchema = z.object({
|
|
563
|
+
page: PageRefSchema,
|
|
564
|
+
cache: CachePinsSchema
|
|
565
|
+
});
|
|
566
|
+
/**
|
|
567
|
+
* Wire shape of `GET /v1/docs/:docId/manifest@docVersion=N`. Content-addressed
|
|
568
|
+
* by `docVersion`; safe to cache with `Cache-Control: public,
|
|
569
|
+
* max-age=31536000, immutable`.
|
|
570
|
+
*/
|
|
571
|
+
const DocumentManifestSchema = z.object({
|
|
572
|
+
docVersion: z.number().int().positive(),
|
|
573
|
+
layoutVersion: z.number().int().positive(),
|
|
574
|
+
metadataVersion: z.number().int().positive(),
|
|
575
|
+
actionsVersion: z.number().int().positive().default(1),
|
|
576
|
+
attachmentsVersion: z.number().int().positive().default(1),
|
|
577
|
+
annotationsVersion: z.number().int().positive().default(1),
|
|
578
|
+
formsVersion: z.number().int().positive().default(1),
|
|
579
|
+
outlineVersion: z.number().int().positive().default(1),
|
|
580
|
+
auditHead: z.number().int().nonnegative(),
|
|
581
|
+
baseSha: z.string(),
|
|
582
|
+
layerVersion: z.number().int().nonnegative().default(0),
|
|
583
|
+
working: z.boolean().default(false),
|
|
584
|
+
baseByteLength: z.number().int().nonnegative().default(0),
|
|
585
|
+
scopes: LayerScopesSchema.optional(),
|
|
586
|
+
protection: z.lazy(() => DocumentProtectionSchema).nullable(),
|
|
587
|
+
pages: z.array(ManifestPageSchema)
|
|
588
|
+
});
|
|
589
|
+
/** What both engines' `annotations.list()` return, and the server's list endpoints send. */
|
|
590
|
+
const AnnotationListSchema = z.object({
|
|
591
|
+
annotations: z.array(AnnotationSchema),
|
|
592
|
+
pages: z.array(PageRefSchema),
|
|
593
|
+
auditHead: z.number().int().nonnegative().optional()
|
|
594
|
+
});
|
|
595
|
+
/**
|
|
596
|
+
* Wire shape of `GET …/text/pages/:pon/data@<contentVersion>` and the
|
|
597
|
+
* `pages.text` worker result: the UTF-16-faithful extraction, the character
|
|
598
|
+
* space size (`charCount` — the space geometry runs tile; not `text.length`),
|
|
599
|
+
* and the optional character→text anchor map. Malformed maps are rejected
|
|
600
|
+
* here with the shared `charMapViolation` invariants — absent/empty map
|
|
601
|
+
* requires `charCount === text.length` (identity).
|
|
602
|
+
*/
|
|
603
|
+
const PageTextSnapshotSchema = z.object({
|
|
604
|
+
text: z.string(),
|
|
605
|
+
charCount: z.number().int().nonnegative(),
|
|
606
|
+
charMap: z.array(z.tuple([z.number().int().nonnegative(), z.number().int().nonnegative()])).optional()
|
|
607
|
+
}).superRefine((snapshot, ctx) => {
|
|
608
|
+
const violation = charMapViolation(snapshot.charCount, snapshot.text.length, snapshot.charMap);
|
|
609
|
+
if (violation !== null) ctx.addIssue({
|
|
610
|
+
code: z.ZodIssueCode.custom,
|
|
611
|
+
path: ["charMap"],
|
|
612
|
+
message: violation
|
|
613
|
+
});
|
|
614
|
+
});
|
|
615
|
+
const PageGeometryGlyphSchema = z.object({
|
|
616
|
+
loose: PageBoxSchema,
|
|
617
|
+
tight: PageBoxSchema.optional(),
|
|
618
|
+
space: z.literal(true).optional(),
|
|
619
|
+
empty: z.literal(true).optional()
|
|
620
|
+
});
|
|
621
|
+
const RotatedGeometryGlyphSchema = z.object({
|
|
622
|
+
loose: PageQuadSchema,
|
|
623
|
+
tight: PageQuadSchema.optional(),
|
|
624
|
+
space: z.literal(true).optional(),
|
|
625
|
+
empty: z.literal(true).optional()
|
|
626
|
+
});
|
|
627
|
+
const UprightGeometryRunSchema = z.object({
|
|
628
|
+
rect: PageBoxSchema,
|
|
629
|
+
start: z.number().int().nonnegative(),
|
|
630
|
+
glyphs: z.array(PageGeometryGlyphSchema),
|
|
631
|
+
fontSize: z.number().optional()
|
|
632
|
+
});
|
|
633
|
+
const RotatedGeometryRunSchema = z.object({
|
|
634
|
+
rect: PageBoxSchema,
|
|
635
|
+
start: z.number().int().nonnegative(),
|
|
636
|
+
glyphs: z.array(RotatedGeometryGlyphSchema),
|
|
637
|
+
rotation: z.number(),
|
|
638
|
+
ascentFlip: z.boolean(),
|
|
639
|
+
fontSize: z.number().optional()
|
|
640
|
+
});
|
|
641
|
+
const PageGeometryRunSchema = z.union([RotatedGeometryRunSchema, UprightGeometryRunSchema]);
|
|
642
|
+
const PageGeometrySnapshotSchema = z.object({ runs: z.array(PageGeometryRunSchema) });
|
|
643
|
+
/**
|
|
644
|
+
* Search wire shapes: the request body of the layer search route and the
|
|
645
|
+
* `search.query` worker/route result. The server re-validates the query
|
|
646
|
+
* semantics (`validateSearchQuery`: regex dialect + flag combos) after
|
|
647
|
+
* parse — the schema only checks structure.
|
|
648
|
+
*/
|
|
649
|
+
const searchQueryObject = z.object({
|
|
650
|
+
text: z.string(),
|
|
651
|
+
regex: z.boolean().optional(),
|
|
652
|
+
matchCase: z.boolean().optional(),
|
|
653
|
+
wholeWord: z.boolean().optional(),
|
|
654
|
+
matchDiacritics: z.boolean().optional(),
|
|
655
|
+
ignoreWhitespace: z.boolean().optional()
|
|
656
|
+
});
|
|
657
|
+
const SearchQuerySchema = searchQueryObject;
|
|
658
|
+
const SearchRequestSchema = searchQueryObject.extend({
|
|
659
|
+
snippets: z.boolean().optional(),
|
|
660
|
+
from: PageRefSchema.optional(),
|
|
661
|
+
cursor: z.string().optional(),
|
|
662
|
+
limit: z.object({
|
|
663
|
+
matches: z.number().int().positive().optional(),
|
|
664
|
+
pages: z.number().int().positive().optional()
|
|
665
|
+
}).optional()
|
|
666
|
+
});
|
|
667
|
+
const SearchSnippetSchema = z.object({
|
|
668
|
+
before: z.string(),
|
|
669
|
+
match: z.string(),
|
|
670
|
+
after: z.string()
|
|
671
|
+
});
|
|
672
|
+
const PdfTextSegmentSchema = z.object({
|
|
673
|
+
quad: PageQuadSchema,
|
|
674
|
+
rect: PageBoxSchema,
|
|
675
|
+
advance: z.union([z.literal(1), z.literal(-1)])
|
|
676
|
+
});
|
|
677
|
+
const SearchMatchSchema = z.object({
|
|
678
|
+
page: PageRefSchema,
|
|
679
|
+
start: z.number().int().nonnegative(),
|
|
680
|
+
count: z.number().int().positive(),
|
|
681
|
+
segments: z.array(PdfTextSegmentSchema),
|
|
682
|
+
snippet: SearchSnippetSchema.optional()
|
|
683
|
+
});
|
|
684
|
+
const SearchSliceSchema = z.object({
|
|
685
|
+
matches: z.array(SearchMatchSchema),
|
|
686
|
+
nextCursor: z.string().nullable(),
|
|
687
|
+
pagesSearched: z.number().int().nonnegative(),
|
|
688
|
+
pageCount: z.number().int().nonnegative()
|
|
689
|
+
});
|
|
690
|
+
const PageNetworkRenderFormatSchema = z.enum(["png", "webp"]);
|
|
691
|
+
/**
|
|
692
|
+
* Wire schema for the cloud render endpoints, applied to the **nested**
|
|
693
|
+
* shape produced by `unflatten(...)` of the parsed token or query string.
|
|
694
|
+
*
|
|
695
|
+
* Adding a new render option is one change here (a new field plus any
|
|
696
|
+
* cross-field rule in `superRefine`) plus one entry in
|
|
697
|
+
* `RenderTokenSchema.fields`. The token codec, flatten/unflatten helpers,
|
|
698
|
+
* route handlers, and SDK URL builder are all generic and pick the new
|
|
699
|
+
* field up automatically.
|
|
700
|
+
*
|
|
701
|
+
* Coercion: token fields and query strings both arrive as strings, so every
|
|
702
|
+
* scalar uses `z.coerce.*`. Discriminated unions on `viewport.kind` and
|
|
703
|
+
* `target.kind` enforce viewport / rect coherence by construction — no
|
|
704
|
+
* superRefine for "fields must appear together" rules.
|
|
705
|
+
*/
|
|
706
|
+
const RenderViewportSchema = z.discriminatedUnion("kind", [z.object({
|
|
707
|
+
kind: z.literal("width"),
|
|
708
|
+
width: z.coerce.number().positive().finite()
|
|
709
|
+
}).strict(), z.object({
|
|
710
|
+
kind: z.literal("scale"),
|
|
711
|
+
scale: z.coerce.number().positive().finite().optional()
|
|
712
|
+
}).strict()]);
|
|
713
|
+
const RenderTargetSchema = z.discriminatedUnion("kind", [z.object({ kind: z.literal("page") }).strict(), z.object({
|
|
714
|
+
kind: z.literal("rect"),
|
|
715
|
+
rect: z.object({
|
|
716
|
+
x: z.coerce.number().finite(),
|
|
717
|
+
y: z.coerce.number().finite(),
|
|
718
|
+
width: z.coerce.number().positive().finite(),
|
|
719
|
+
height: z.coerce.number().positive().finite()
|
|
720
|
+
}).strict()
|
|
721
|
+
}).strict()]);
|
|
722
|
+
const RenderRotationSchema = z.preprocess((raw) => raw === void 0 ? void 0 : Number(raw), z.number().refine((n) => n === 0 || n === 90 || n === 180 || n === 270, { message: "render rotation must be 0, 90, 180, or 270" }));
|
|
723
|
+
const RenderBackgroundSchema = z.enum(["white", "transparent"]);
|
|
724
|
+
/** WebP quality, 0 (smallest) to 1 (best) — the `canvas.toBlob` scale. */
|
|
725
|
+
const RenderQualitySchema = z.coerce.number().min(0).max(1);
|
|
726
|
+
const AppearanceModeSchema = z.enum([
|
|
727
|
+
"normal",
|
|
728
|
+
"rollover",
|
|
729
|
+
"down"
|
|
730
|
+
]);
|
|
731
|
+
/**
|
|
732
|
+
* A token's `modes`: the modes it asks for, in the engine's mode order,
|
|
733
|
+
* joined by `-` (`normal-down`). Anything else is refused, so one set of
|
|
734
|
+
* modes has one spelling and one URL.
|
|
735
|
+
*/
|
|
736
|
+
const AppearanceModesSchema = z.string().transform((value, ctx) => {
|
|
737
|
+
const modes = value.split("-");
|
|
738
|
+
const canonical = ANNOTATION_APPEARANCE_MODES.filter((mode) => modes.includes(mode));
|
|
739
|
+
if (canonical.length === 0 || canonical.length === ANNOTATION_APPEARANCE_MODES.length || canonical.join("-") !== value) {
|
|
740
|
+
ctx.addIssue({
|
|
741
|
+
code: z.ZodIssueCode.custom,
|
|
742
|
+
message: "modes must name some but not all of normal, rollover, down, in that order, joined by -"
|
|
743
|
+
});
|
|
744
|
+
return z.NEVER;
|
|
745
|
+
}
|
|
746
|
+
return canonical;
|
|
747
|
+
});
|
|
748
|
+
/**
|
|
749
|
+
* The query/token schema of one picture family (`PAGE_RENDER_FAMILIES`).
|
|
750
|
+
* What a picture draws is in its path, never its token, so each family has
|
|
751
|
+
* its own schema, built from one shared base:
|
|
752
|
+
*
|
|
753
|
+
* - its pins are the family's own (`contentVersion`, plus
|
|
754
|
+
* `annotationVersion` and `widgetVersion` for the planes it draws), and
|
|
755
|
+
* `.strict()` refuses any other, so a pin the family doesn't depend on
|
|
756
|
+
* is unrepresentable;
|
|
757
|
+
* - a versioned request (one with `contentVersion`) carries every one of
|
|
758
|
+
* them, since the picture changes with each.
|
|
759
|
+
*
|
|
760
|
+
* A print picture (`PAGE_PRINT_FAMILIES`) takes only its pins and its image
|
|
761
|
+
* format: its path says what it draws and at which DPI, and its size comes
|
|
762
|
+
* from that and the paper, so a page has one print picture per family and
|
|
763
|
+
* tier.
|
|
764
|
+
*
|
|
765
|
+
* The transform stamps what the picture draws (and, for a print picture,
|
|
766
|
+
* `usage` and its `dpi` viewport) onto the parsed options, so the worker
|
|
767
|
+
* options downstream need no family.
|
|
768
|
+
*/
|
|
769
|
+
function buildPageRenderQuerySchema(picture) {
|
|
770
|
+
const { family, draws, pins, print } = picture;
|
|
771
|
+
const pinFields = {};
|
|
772
|
+
for (const pin of pins) pinFields[pin] = z.coerce.number().int().positive().optional();
|
|
773
|
+
const screenFields = print ? {} : {
|
|
774
|
+
viewport: RenderViewportSchema.optional(),
|
|
775
|
+
target: RenderTargetSchema.optional(),
|
|
776
|
+
rotation: RenderRotationSchema.optional(),
|
|
777
|
+
background: RenderBackgroundSchema.optional()
|
|
778
|
+
};
|
|
779
|
+
return z.object({
|
|
780
|
+
...pinFields,
|
|
781
|
+
format: PageNetworkRenderFormatSchema.optional(),
|
|
782
|
+
quality: RenderQualitySchema.optional(),
|
|
783
|
+
...screenFields
|
|
784
|
+
}).strict().superRefine((v, ctx) => {
|
|
785
|
+
const pinned = v;
|
|
786
|
+
if (pinned.contentVersion === void 0) {
|
|
787
|
+
for (const pin of pins) {
|
|
788
|
+
if (pinned[pin] === void 0) continue;
|
|
789
|
+
ctx.addIssue({
|
|
790
|
+
code: z.ZodIssueCode.custom,
|
|
791
|
+
path: [pin],
|
|
792
|
+
message: `${pin} requires contentVersion`
|
|
793
|
+
});
|
|
794
|
+
}
|
|
795
|
+
return;
|
|
796
|
+
}
|
|
797
|
+
if (v.format === void 0) ctx.addIssue({
|
|
798
|
+
code: z.ZodIssueCode.custom,
|
|
799
|
+
path: ["format"],
|
|
800
|
+
message: "versioned render requires format"
|
|
801
|
+
});
|
|
802
|
+
for (const pin of pins) {
|
|
803
|
+
if (pinned[pin] !== void 0) continue;
|
|
804
|
+
ctx.addIssue({
|
|
805
|
+
code: z.ZodIssueCode.custom,
|
|
806
|
+
path: [pin],
|
|
807
|
+
message: `a versioned ${family} picture requires ${pin}`
|
|
808
|
+
});
|
|
809
|
+
}
|
|
810
|
+
}).transform((v) => {
|
|
811
|
+
const pinned = v;
|
|
812
|
+
const screen = v;
|
|
813
|
+
const query = { options: {
|
|
814
|
+
...screen.target ? { target: screen.target } : {},
|
|
815
|
+
...screen.viewport ? { viewport: screen.viewport } : {},
|
|
816
|
+
...screen.rotation !== void 0 ? { rotation: screen.rotation } : {},
|
|
817
|
+
...screen.background !== void 0 ? { background: screen.background } : {},
|
|
818
|
+
...v.quality !== void 0 ? { quality: v.quality } : {},
|
|
819
|
+
...v.format !== void 0 ? { format: v.format } : {},
|
|
820
|
+
...draws,
|
|
821
|
+
...print ? {
|
|
822
|
+
usage: "print",
|
|
823
|
+
viewport: {
|
|
824
|
+
kind: "dpi",
|
|
825
|
+
dpi: print.dpi
|
|
826
|
+
}
|
|
827
|
+
} : {}
|
|
828
|
+
} };
|
|
829
|
+
for (const pin of pins) if (pinned[pin] !== void 0) query[pin] = pinned[pin];
|
|
830
|
+
return query;
|
|
831
|
+
});
|
|
832
|
+
}
|
|
833
|
+
/** Query/token schemas of the four picture families, by family. */
|
|
834
|
+
const PageRenderQuerySchemas = {
|
|
835
|
+
pages: buildPageRenderQuerySchema(PAGE_RENDER_FAMILIES.pages),
|
|
836
|
+
annotations: buildPageRenderQuerySchema(PAGE_RENDER_FAMILIES.annotations),
|
|
837
|
+
fields: buildPageRenderQuerySchema(PAGE_RENDER_FAMILIES.fields),
|
|
838
|
+
all: buildPageRenderQuerySchema(PAGE_RENDER_FAMILIES.all)
|
|
839
|
+
};
|
|
840
|
+
/** Query/token schemas of the print pictures, by tier and family. */
|
|
841
|
+
const PagePrintQuerySchemas = {
|
|
842
|
+
print: {
|
|
843
|
+
pages: buildPageRenderQuerySchema(PAGE_PRINT_FAMILIES.print.pages),
|
|
844
|
+
annotations: buildPageRenderQuerySchema(PAGE_PRINT_FAMILIES.print.annotations),
|
|
845
|
+
fields: buildPageRenderQuerySchema(PAGE_PRINT_FAMILIES.print.fields),
|
|
846
|
+
all: buildPageRenderQuerySchema(PAGE_PRINT_FAMILIES.print.all)
|
|
847
|
+
},
|
|
848
|
+
"print-high": {
|
|
849
|
+
pages: buildPageRenderQuerySchema(PAGE_PRINT_FAMILIES["print-high"].pages),
|
|
850
|
+
annotations: buildPageRenderQuerySchema(PAGE_PRINT_FAMILIES["print-high"].annotations),
|
|
851
|
+
fields: buildPageRenderQuerySchema(PAGE_PRINT_FAMILIES["print-high"].fields),
|
|
852
|
+
all: buildPageRenderQuerySchema(PAGE_PRINT_FAMILIES["print-high"].all)
|
|
853
|
+
}
|
|
854
|
+
};
|
|
855
|
+
/** The query/token schema of `picture`, screen or print. */
|
|
856
|
+
function pagePictureQuerySchema(picture) {
|
|
857
|
+
return picture.print ? PagePrintQuerySchemas[picture.print.tier][picture.family] : PageRenderQuerySchemas[picture.family];
|
|
858
|
+
}
|
|
859
|
+
/**
|
|
860
|
+
* Query/token schema of an appearance batch, keyed by `pin`. Mirrors
|
|
861
|
+
* `PageRenderQuerySchema` but without page target/background or
|
|
862
|
+
* `includeAnnotations` (appearances are always annotation-derived), and keyed
|
|
863
|
+
* by the page's pin for its family only — appearance bitmaps do not depend on
|
|
864
|
+
* page base content, so `contentVersion` is not part of the cache key. The
|
|
865
|
+
* endpoint renders every mode and state an annotation stores, or the `modes`
|
|
866
|
+
* asked for.
|
|
867
|
+
*/
|
|
868
|
+
function buildAppearancesQuerySchema(pin) {
|
|
869
|
+
return z.object({
|
|
870
|
+
[pin]: z.coerce.number().int().positive().optional(),
|
|
871
|
+
format: PageNetworkRenderFormatSchema.optional(),
|
|
872
|
+
modes: AppearanceModesSchema.optional(),
|
|
873
|
+
rotation: RenderRotationSchema.optional(),
|
|
874
|
+
viewport: RenderViewportSchema.optional(),
|
|
875
|
+
quality: RenderQualitySchema.optional()
|
|
876
|
+
}).strict().superRefine((v, ctx) => {
|
|
877
|
+
if (v[pin] !== void 0 && v.format === void 0) ctx.addIssue({
|
|
878
|
+
code: z.ZodIssueCode.custom,
|
|
879
|
+
path: ["format"],
|
|
880
|
+
message: "versioned appearance render requires format"
|
|
881
|
+
});
|
|
882
|
+
}).transform((v) => {
|
|
883
|
+
return {
|
|
884
|
+
options: {
|
|
885
|
+
...v.rotation !== void 0 ? { rotation: v.rotation } : {},
|
|
886
|
+
...v.viewport ? { viewport: v.viewport } : {},
|
|
887
|
+
...v.quality !== void 0 ? { quality: v.quality } : {},
|
|
888
|
+
...v.format !== void 0 ? { format: v.format } : {},
|
|
889
|
+
...v.modes !== void 0 ? { modes: v.modes } : {}
|
|
890
|
+
},
|
|
891
|
+
...v[pin] !== void 0 ? { [pin]: v[pin] } : {}
|
|
892
|
+
};
|
|
893
|
+
});
|
|
894
|
+
}
|
|
895
|
+
/** Query/token schema of a page's annotation images (`annotations/pages/{p}/appearances@`). */
|
|
896
|
+
const AnnotationAppearancesQuerySchema = buildAppearancesQuerySchema("annotationVersion");
|
|
897
|
+
/** Query/token schema of a page's widget images (`form/pages/{p}/appearances@`). */
|
|
898
|
+
const WidgetAppearancesQuerySchema = buildAppearancesQuerySchema("widgetVersion");
|
|
899
|
+
/**
|
|
900
|
+
* The `body` part of the appearance `multipart/form-data` response.
|
|
901
|
+
* Wire-stable; the cloud client validates the parsed `body` part against
|
|
902
|
+
* this before reconstructing image handles from the binary parts.
|
|
903
|
+
*/
|
|
904
|
+
const AnnotationAppearanceBatchSchema = z.object({
|
|
905
|
+
page: PageRefSchema,
|
|
906
|
+
appearances: z.array(z.object({
|
|
907
|
+
resources: ImageResourceKeysSchema,
|
|
908
|
+
ref: AnnotationRefSchema,
|
|
909
|
+
mode: AppearanceModeSchema,
|
|
910
|
+
state: z.string().nullable(),
|
|
911
|
+
rect: PageBoxSchema,
|
|
912
|
+
width: z.number().int().positive(),
|
|
913
|
+
height: z.number().int().positive(),
|
|
914
|
+
format: PageNetworkRenderFormatSchema,
|
|
915
|
+
contentType: z.string().min(1)
|
|
916
|
+
}))
|
|
917
|
+
});
|
|
918
|
+
const CacheDeltaSchema = z.object({
|
|
919
|
+
previousDocVersion: z.number().int().nonnegative(),
|
|
920
|
+
docVersion: z.number().int().positive(),
|
|
921
|
+
annotationsVersion: z.number().int().positive().optional(),
|
|
922
|
+
formsVersion: z.number().int().positive().optional(),
|
|
923
|
+
layoutVersion: z.number().int().positive().optional(),
|
|
924
|
+
metadataVersion: z.number().int().positive().optional(),
|
|
925
|
+
attachmentsVersion: z.number().int().positive().optional(),
|
|
926
|
+
outlineVersion: z.number().int().positive().optional(),
|
|
927
|
+
layerVersion: z.number().int().nonnegative().optional(),
|
|
928
|
+
working: z.boolean().optional(),
|
|
929
|
+
pages: z.array(z.object({
|
|
930
|
+
page: PageRefSchema,
|
|
931
|
+
cache: CachePinsSchema
|
|
932
|
+
}))
|
|
933
|
+
});
|
|
934
|
+
const MutationMetaSchema = z.object({
|
|
935
|
+
affectedPages: z.array(PageRefSchema),
|
|
936
|
+
cacheDelta: CacheDeltaSchema.nullable(),
|
|
937
|
+
opId: z.string(),
|
|
938
|
+
undoable: z.boolean()
|
|
939
|
+
});
|
|
940
|
+
/**
|
|
941
|
+
* Where rows go in their list, on the wire: `'start'`, `'end'`, or one
|
|
942
|
+
* object naming exactly one neighbour (`before` or `after`).
|
|
943
|
+
*/
|
|
944
|
+
function listPositionSchema(ref) {
|
|
945
|
+
return z.union([z.enum(["start", "end"]), z.object({
|
|
946
|
+
before: ref.optional(),
|
|
947
|
+
after: ref.optional()
|
|
948
|
+
}).strict().refine((position) => position.before === void 0 !== (position.after === void 0), { message: "exactly one of before or after" })]);
|
|
949
|
+
}
|
|
950
|
+
/** Where pages go among the document's pages. */
|
|
951
|
+
const PagePositionSchema = listPositionSchema(PageRefSchema);
|
|
952
|
+
/** Where annotations go among their page's annotations, or widgets among its widgets. */
|
|
953
|
+
const AnnotationPositionSchema = listPositionSchema(AnnotationRefSchema);
|
|
954
|
+
/** Where fields go in the form's calculation order. */
|
|
955
|
+
const FieldPositionSchema = listPositionSchema(FormFieldRefSchema);
|
|
956
|
+
/** Where outline items go among one parent's children. */
|
|
957
|
+
const OutlinePositionSchema = listPositionSchema(OutlineItemRefSchema);
|
|
958
|
+
/**
|
|
959
|
+
* Stable public component names for the models every part of the document
|
|
960
|
+
* wire shares (page refs, a write's meta, the metadata), like
|
|
961
|
+
* `AnnotationWireComponents`.
|
|
962
|
+
*/
|
|
963
|
+
const DocumentWireComponents = {
|
|
964
|
+
PageRef: PageRefSchema,
|
|
965
|
+
PagePosition: PagePositionSchema,
|
|
966
|
+
CacheDelta: CacheDeltaSchema,
|
|
967
|
+
MutationMeta: MutationMetaSchema,
|
|
968
|
+
DocumentMetadata: DocumentMetadataSchema,
|
|
969
|
+
MetadataPatch: MetadataPatchSchema
|
|
970
|
+
};
|
|
971
|
+
/** Per-page side-effect envelope every annotation mutation returns. Mirrors `AnnotationListMutationMeta`. */
|
|
972
|
+
const AnnotationListMutationMetaSchema = z.object({
|
|
973
|
+
affectedPages: z.array(PageRefSchema),
|
|
974
|
+
cacheDelta: CacheDeltaSchema.nullable(),
|
|
975
|
+
opId: z.string(),
|
|
976
|
+
undoable: z.boolean(),
|
|
977
|
+
changed: z.array(AnnotationRefSchema)
|
|
978
|
+
});
|
|
979
|
+
const AnnotationCreateResultSchema = z.object({
|
|
980
|
+
annotation: AnnotationSchema,
|
|
981
|
+
meta: AnnotationListMutationMetaSchema
|
|
982
|
+
});
|
|
983
|
+
const AnnotationImportResultSchema = z.object({
|
|
984
|
+
annotations: z.array(AnnotationSchema),
|
|
985
|
+
refMap: z.array(z.object({
|
|
986
|
+
from: AnnotationRefSchema,
|
|
987
|
+
to: AnnotationRefSchema
|
|
988
|
+
})),
|
|
989
|
+
dropped: z.array(z.object({
|
|
990
|
+
ref: AnnotationRefSchema,
|
|
991
|
+
field: z.string().optional(),
|
|
992
|
+
reason: z.enum([
|
|
993
|
+
"unsupported-kind",
|
|
994
|
+
"widget",
|
|
995
|
+
"geospatial",
|
|
996
|
+
"unknown-measure",
|
|
997
|
+
"unsupported-action",
|
|
998
|
+
"unsupported-value",
|
|
999
|
+
"name-conflict",
|
|
1000
|
+
"parent-dropped",
|
|
1001
|
+
"parent-missing",
|
|
1002
|
+
"popup-taken"
|
|
1003
|
+
])
|
|
1004
|
+
})),
|
|
1005
|
+
meta: AnnotationListMutationMetaSchema
|
|
1006
|
+
});
|
|
1007
|
+
/** The engine's `/AP` verdict riding every update result (see engine-core
|
|
1008
|
+
* `annotation/appearance.ts`). `changed` drives client raster invalidation. */
|
|
1009
|
+
const AppearanceOutcomeSchema = z.object({
|
|
1010
|
+
action: z.enum([
|
|
1011
|
+
"preserved",
|
|
1012
|
+
"regenerated",
|
|
1013
|
+
"generation-unavailable",
|
|
1014
|
+
"restored"
|
|
1015
|
+
]),
|
|
1016
|
+
changed: z.boolean()
|
|
1017
|
+
});
|
|
1018
|
+
const AnnotationUpdateResultSchema = z.object({
|
|
1019
|
+
annotation: AnnotationSchema,
|
|
1020
|
+
appearance: AppearanceOutcomeSchema,
|
|
1021
|
+
meta: AnnotationListMutationMetaSchema
|
|
1022
|
+
});
|
|
1023
|
+
const AnnotationDeleteResultSchema = z.object({ meta: AnnotationListMutationMetaSchema });
|
|
1024
|
+
/**
|
|
1025
|
+
* Stable public component names for the annotation wire model, so an OpenAPI
|
|
1026
|
+
* projection names each once (`Annotation`, not one type per response that
|
|
1027
|
+
* carries one), like `PdfActionWireComponents`.
|
|
1028
|
+
*/
|
|
1029
|
+
const AnnotationWireComponents = {
|
|
1030
|
+
Annotation: AnnotationSchema,
|
|
1031
|
+
AnnotationRef: AnnotationRefSchema,
|
|
1032
|
+
AnnotationDraft: AnnotationDraftSchema,
|
|
1033
|
+
AnnotationPatch: AnnotationPatchSchema,
|
|
1034
|
+
PdfLinkTarget: PdfLinkTargetSchema,
|
|
1035
|
+
PdfLinkTargetWritable: PdfLinkTargetWritableSchema,
|
|
1036
|
+
AnnotationList: AnnotationListSchema,
|
|
1037
|
+
AnnotationMutationMeta: AnnotationListMutationMetaSchema,
|
|
1038
|
+
AnnotationPosition: AnnotationPositionSchema
|
|
1039
|
+
};
|
|
1040
|
+
/** What `page.annotations.reorder` takes on the wire. */
|
|
1041
|
+
const AnnotationReorderBodySchema = z.object({
|
|
1042
|
+
refs: z.array(AnnotationRefSchema).min(1),
|
|
1043
|
+
position: AnnotationPositionSchema
|
|
1044
|
+
}).strict();
|
|
1045
|
+
/** A stacking-order change: the page's annotations in their new order, as refs. */
|
|
1046
|
+
const AnnotationReorderResultSchema = z.object({
|
|
1047
|
+
order: z.array(AnnotationRefSchema),
|
|
1048
|
+
meta: AnnotationListMutationMetaSchema
|
|
1049
|
+
});
|
|
1050
|
+
/** A single-field write's meta: the envelope plus the fields and widgets it changed. */
|
|
1051
|
+
const FormMutationMetaSchema = z.object({
|
|
1052
|
+
affectedPages: z.array(PageRefSchema),
|
|
1053
|
+
cacheDelta: CacheDeltaSchema.nullable(),
|
|
1054
|
+
opId: z.string(),
|
|
1055
|
+
undoable: z.boolean(),
|
|
1056
|
+
changedFields: z.array(FormFieldRefSchema),
|
|
1057
|
+
changedWidgets: z.array(FormWidgetSchema),
|
|
1058
|
+
redrawnWidgets: z.array(FormWidgetSchema)
|
|
1059
|
+
});
|
|
1060
|
+
/**
|
|
1061
|
+
* Stable public component names for the form wire model, so an OpenAPI
|
|
1062
|
+
* projection names each once (`FormField`, not one type per response that
|
|
1063
|
+
* carries one), like `AnnotationWireComponents`.
|
|
1064
|
+
*/
|
|
1065
|
+
const FormWireComponents = {
|
|
1066
|
+
FormFieldRef: FormFieldRefSchema,
|
|
1067
|
+
FormField: FormFieldDTOSchema,
|
|
1068
|
+
FormFieldValue: FormFieldValueSchema,
|
|
1069
|
+
FormWidget: FormWidgetSchema,
|
|
1070
|
+
FormFieldDraft: FormFieldDraftSchema,
|
|
1071
|
+
FormFieldPatch: FormFieldPatchSchema,
|
|
1072
|
+
FieldPosition: FieldPositionSchema,
|
|
1073
|
+
WidgetPlacement: WidgetPlacementSchema,
|
|
1074
|
+
WidgetAnnotation: WidgetDTOSchema,
|
|
1075
|
+
WidgetPatch: WidgetPatchSchema,
|
|
1076
|
+
FormMutationMeta: FormMutationMetaSchema
|
|
1077
|
+
};
|
|
1078
|
+
const FormSetValueResultSchema = z.object({
|
|
1079
|
+
field: FormFieldDTOSchema,
|
|
1080
|
+
widgets: z.array(WidgetDTOSchema),
|
|
1081
|
+
meta: FormMutationMetaSchema
|
|
1082
|
+
});
|
|
1083
|
+
const FormResetResultSchema = z.object({
|
|
1084
|
+
fields: z.array(FormFieldDTOSchema),
|
|
1085
|
+
widgets: z.array(WidgetDTOSchema),
|
|
1086
|
+
meta: FormMutationMetaSchema
|
|
1087
|
+
});
|
|
1088
|
+
/** What `reset` takes on the wire: the fields to reset, or none for the whole form. */
|
|
1089
|
+
const FormResetBodySchema = z.object({ refs: z.array(FormFieldRefSchema).optional() }).strict();
|
|
1090
|
+
/** What `updateWidget` takes on the wire: the widget patch (`PATCH …/form/widgets/{p}/{key}`). */
|
|
1091
|
+
const FormWidgetUpdateBodySchema = z.object({ patch: WidgetPatchSchema }).strict();
|
|
1092
|
+
const FormImportResultSchema = z.object({
|
|
1093
|
+
fields: z.array(FormFieldDTOSchema),
|
|
1094
|
+
widgets: z.array(WidgetDTOSchema),
|
|
1095
|
+
refMap: z.array(z.object({
|
|
1096
|
+
from: FormFieldRefSchema,
|
|
1097
|
+
to: FormFieldRefSchema
|
|
1098
|
+
})),
|
|
1099
|
+
dropped: z.array(z.object({
|
|
1100
|
+
ref: FormFieldRefSchema.nullable(),
|
|
1101
|
+
widget: AnnotationRefSchema.optional(),
|
|
1102
|
+
field: z.string().optional(),
|
|
1103
|
+
reason: z.enum([
|
|
1104
|
+
"name-conflict",
|
|
1105
|
+
"no-field",
|
|
1106
|
+
"unsupported-family",
|
|
1107
|
+
"script-not-allowed",
|
|
1108
|
+
"unsupported-action"
|
|
1109
|
+
])
|
|
1110
|
+
})),
|
|
1111
|
+
calculationOrder: z.array(FormFieldRefSchema).optional(),
|
|
1112
|
+
meta: FormMutationMetaSchema
|
|
1113
|
+
});
|
|
1114
|
+
const FormValuesImportResultSchema = z.object({
|
|
1115
|
+
fields: z.array(FormFieldDTOSchema),
|
|
1116
|
+
widgets: z.array(WidgetDTOSchema),
|
|
1117
|
+
dropped: z.array(z.object({
|
|
1118
|
+
ref: FormFieldRefSchema,
|
|
1119
|
+
reason: z.enum([
|
|
1120
|
+
"no-field",
|
|
1121
|
+
"wrong-family",
|
|
1122
|
+
"value-not-allowed",
|
|
1123
|
+
"locked",
|
|
1124
|
+
"fill-not-allowed"
|
|
1125
|
+
])
|
|
1126
|
+
})),
|
|
1127
|
+
meta: FormMutationMetaSchema
|
|
1128
|
+
});
|
|
1129
|
+
const FormFieldCreateResultSchema = z.object({
|
|
1130
|
+
field: FormFieldDTOSchema,
|
|
1131
|
+
widgets: z.array(WidgetDTOSchema),
|
|
1132
|
+
calculationOrder: z.array(FormFieldRefSchema).optional(),
|
|
1133
|
+
meta: FormMutationMetaSchema
|
|
1134
|
+
});
|
|
1135
|
+
const FormFieldUpdateResultSchema = z.object({
|
|
1136
|
+
field: FormFieldDTOSchema,
|
|
1137
|
+
widgets: z.array(WidgetDTOSchema),
|
|
1138
|
+
calculationOrder: z.array(FormFieldRefSchema).optional(),
|
|
1139
|
+
meta: FormMutationMetaSchema
|
|
1140
|
+
});
|
|
1141
|
+
const FormWidgetUpdateResultSchema = z.object({
|
|
1142
|
+
widget: WidgetDTOSchema,
|
|
1143
|
+
appearance: AppearanceOutcomeSchema,
|
|
1144
|
+
meta: FormMutationMetaSchema
|
|
1145
|
+
});
|
|
1146
|
+
/** What `forms.reorderWidgets` takes on the wire: the widgets of one page and where they go. */
|
|
1147
|
+
const FormWidgetsReorderBodySchema = z.object({
|
|
1148
|
+
widgets: z.array(AnnotationRefSchema).min(1),
|
|
1149
|
+
position: AnnotationPositionSchema
|
|
1150
|
+
}).strict();
|
|
1151
|
+
/** A widget stacking-order change: the page's widgets in their new order, as refs. */
|
|
1152
|
+
const FormWidgetsReorderResultSchema = z.object({
|
|
1153
|
+
page: PageRefSchema,
|
|
1154
|
+
order: z.array(AnnotationRefSchema),
|
|
1155
|
+
meta: FormMutationMetaSchema
|
|
1156
|
+
});
|
|
1157
|
+
const FormFieldDeleteResultSchema = z.object({
|
|
1158
|
+
calculationOrder: z.array(FormFieldRefSchema).optional(),
|
|
1159
|
+
meta: FormMutationMetaSchema
|
|
1160
|
+
});
|
|
1161
|
+
/** What `forms.reorderCalculations` takes on the wire: the fields and where they go. */
|
|
1162
|
+
const FormCalculationsReorderBodySchema = z.object({
|
|
1163
|
+
fields: z.array(FormFieldRefSchema).min(1),
|
|
1164
|
+
position: FieldPositionSchema
|
|
1165
|
+
}).strict();
|
|
1166
|
+
/** A calculation-order change: the form's whole new order. */
|
|
1167
|
+
const FormCalculationsReorderResultSchema = z.object({
|
|
1168
|
+
calculationOrder: z.array(FormFieldRefSchema),
|
|
1169
|
+
meta: FormMutationMetaSchema
|
|
1170
|
+
});
|
|
1171
|
+
const FormWidgetLinkResultSchema = z.object({
|
|
1172
|
+
field: FormFieldDTOSchema,
|
|
1173
|
+
widgets: z.array(WidgetDTOSchema),
|
|
1174
|
+
meta: FormMutationMetaSchema
|
|
1175
|
+
});
|
|
1176
|
+
const FormWidgetDeleteResultSchema = z.object({
|
|
1177
|
+
widget: AnnotationRefSchema,
|
|
1178
|
+
page: PageRefSchema,
|
|
1179
|
+
field: FormFieldDTOSchema.nullable(),
|
|
1180
|
+
meta: FormMutationMetaSchema
|
|
1181
|
+
});
|
|
1182
|
+
const FormWidgetRestoreResultSchema = z.object({
|
|
1183
|
+
field: FormFieldDTOSchema.nullable(),
|
|
1184
|
+
widgets: z.array(WidgetDTOSchema),
|
|
1185
|
+
meta: FormMutationMetaSchema
|
|
1186
|
+
});
|
|
1187
|
+
const FormRepairResultSchema = z.object({
|
|
1188
|
+
acroformCreated: z.boolean(),
|
|
1189
|
+
fieldsLinked: z.number().int().nonnegative(),
|
|
1190
|
+
widgetsLinked: z.number().int().nonnegative(),
|
|
1191
|
+
fieldsUnrepairable: z.number().int().nonnegative(),
|
|
1192
|
+
appearancesBaked: z.number().int().nonnegative(),
|
|
1193
|
+
needsAppearancesCleared: z.boolean(),
|
|
1194
|
+
meta: MutationMetaSchema
|
|
1195
|
+
});
|
|
1196
|
+
/** A page's five boxes in page space: measured from the top-left of the crop box. */
|
|
1197
|
+
const PageBoxesSchema = z.object({
|
|
1198
|
+
media: PageBoxSchema,
|
|
1199
|
+
crop: PageBoxSchema,
|
|
1200
|
+
bleed: PageBoxSchema,
|
|
1201
|
+
trim: PageBoxSchema,
|
|
1202
|
+
art: PageBoxSchema
|
|
1203
|
+
});
|
|
1204
|
+
/**
|
|
1205
|
+
* Pure geometry for one page (`pages.list()` element). No annotation
|
|
1206
|
+
* liveness — that lives on annotation reads and the manifest.
|
|
1207
|
+
*/
|
|
1208
|
+
const PageLayoutSchema = z.object({
|
|
1209
|
+
index: z.number().int().nonnegative(),
|
|
1210
|
+
ref: PageRefSchema,
|
|
1211
|
+
label: z.string().nullable(),
|
|
1212
|
+
size: PdfSizeSchema,
|
|
1213
|
+
rotation: PdfRotationSchema,
|
|
1214
|
+
userUnit: z.number().positive(),
|
|
1215
|
+
tabOrder: z.enum([
|
|
1216
|
+
"rows",
|
|
1217
|
+
"columns",
|
|
1218
|
+
"structure",
|
|
1219
|
+
"annotations",
|
|
1220
|
+
"widgets"
|
|
1221
|
+
]).nullable(),
|
|
1222
|
+
boxes: PageBoxesSchema,
|
|
1223
|
+
pdfCropBox: PdfRectSchema,
|
|
1224
|
+
actions: PdfPageActionsSchema.optional()
|
|
1225
|
+
});
|
|
1226
|
+
const PageFlattenResultSchema = z.object({
|
|
1227
|
+
pages: z.array(PageRefSchema),
|
|
1228
|
+
usage: z.enum(["display", "print"]),
|
|
1229
|
+
results: z.array(z.object({
|
|
1230
|
+
page: PageRefSchema,
|
|
1231
|
+
status: z.enum(["applied", "unchanged"])
|
|
1232
|
+
})),
|
|
1233
|
+
meta: MutationMetaSchema
|
|
1234
|
+
});
|
|
1235
|
+
/** See `AnnotationFlattenResult`. */
|
|
1236
|
+
const AnnotationFlattenResultSchema = z.object({
|
|
1237
|
+
page: PageRefSchema,
|
|
1238
|
+
usage: z.enum(["display", "print"]),
|
|
1239
|
+
results: z.array(z.object({
|
|
1240
|
+
ref: AnnotationRefSchema,
|
|
1241
|
+
status: z.enum(["applied", "unchanged"])
|
|
1242
|
+
})),
|
|
1243
|
+
meta: MutationMetaSchema
|
|
1244
|
+
});
|
|
1245
|
+
/** `annotations.flatten` input — see `AnnotationFlattenInput`. */
|
|
1246
|
+
const AnnotationFlattenInputSchema = z.object({
|
|
1247
|
+
refs: z.array(AnnotationRefSchema).min(1),
|
|
1248
|
+
usage: z.enum(["display", "print"])
|
|
1249
|
+
});
|
|
1250
|
+
/** `annotations.exportAppearance` input — see `AnnotationAppearanceExportInput`. */
|
|
1251
|
+
const AnnotationAppearanceExportInputSchema = z.object({ refs: z.array(AnnotationRefSchema).min(1) });
|
|
1252
|
+
/** `doc.annotations.export` selection — see `AnnotationExportSelection`. */
|
|
1253
|
+
const AnnotationExportSelectionSchema = z.object({
|
|
1254
|
+
refs: z.array(AnnotationRefSchema).optional(),
|
|
1255
|
+
pages: z.array(PageRefSchema).optional(),
|
|
1256
|
+
include: z.enum(["references", "threads"]).optional()
|
|
1257
|
+
}).strict();
|
|
1258
|
+
/**
|
|
1259
|
+
* The body of a POST annotation export: the pins a GET's token carries and
|
|
1260
|
+
* the selection, for one a URL can't carry.
|
|
1261
|
+
*/
|
|
1262
|
+
const AnnotationsExportRequestSchema = z.object({
|
|
1263
|
+
annotationsVersion: z.number().int().positive(),
|
|
1264
|
+
layoutVersion: z.number().int().positive(),
|
|
1265
|
+
selection: AnnotationExportSelectionSchema
|
|
1266
|
+
}).strict();
|
|
1267
|
+
/** Where an import puts each page of a bundle — see `BundleImportPages`. */
|
|
1268
|
+
const BundleImportPagesSchema = z.union([
|
|
1269
|
+
z.literal("same"),
|
|
1270
|
+
z.literal("by-position"),
|
|
1271
|
+
z.array(z.object({
|
|
1272
|
+
from: PageRefSchema,
|
|
1273
|
+
to: PageRefSchema
|
|
1274
|
+
}).strict())
|
|
1275
|
+
]);
|
|
1276
|
+
/** `doc.forms.export` selection — see `FormExportSelection`. */
|
|
1277
|
+
const FormExportSelectionSchema = z.object({
|
|
1278
|
+
fields: z.array(FormFieldRefSchema).optional(),
|
|
1279
|
+
pages: z.array(PageRefSchema).optional()
|
|
1280
|
+
}).strict();
|
|
1281
|
+
/**
|
|
1282
|
+
* The body of a POST form export: the pins a GET's token carries and the
|
|
1283
|
+
* selection, for one a URL can't carry.
|
|
1284
|
+
*/
|
|
1285
|
+
const FormExportRequestSchema = z.object({
|
|
1286
|
+
formsVersion: z.number().int().positive(),
|
|
1287
|
+
layoutVersion: z.number().int().positive(),
|
|
1288
|
+
selection: FormExportSelectionSchema
|
|
1289
|
+
}).strict();
|
|
1290
|
+
/** `doc.forms.import` options on the wire; the `opId` is the `Idempotency-Key` header. */
|
|
1291
|
+
const FormImportOptionsSchema = z.object({
|
|
1292
|
+
pages: BundleImportPagesSchema.optional(),
|
|
1293
|
+
attribution: z.enum(["restore", "stamp"]).optional(),
|
|
1294
|
+
values: z.boolean().optional()
|
|
1295
|
+
}).strict();
|
|
1296
|
+
/** `doc.forms.importValues` options on the wire. */
|
|
1297
|
+
const FormValuesImportOptionsSchema = z.object({ attribution: z.enum(["restore", "stamp"]).optional() }).strict();
|
|
1298
|
+
/** A form bundle's envelope: its rows are the worker's to check, as an annotation bundle's. */
|
|
1299
|
+
const FormBundleEnvelopeSchema = z.object({
|
|
1300
|
+
format: z.literal("embedpdf/form"),
|
|
1301
|
+
version: z.literal(1),
|
|
1302
|
+
pages: z.array(z.unknown()),
|
|
1303
|
+
fields: z.array(z.unknown()),
|
|
1304
|
+
widgets: z.array(z.unknown()),
|
|
1305
|
+
calculationOrder: z.array(z.unknown())
|
|
1306
|
+
}).strict();
|
|
1307
|
+
/** The `body` part of a form import request. */
|
|
1308
|
+
const FormImportBodySchema = z.object({
|
|
1309
|
+
bundle: FormBundleEnvelopeSchema,
|
|
1310
|
+
options: FormImportOptionsSchema
|
|
1311
|
+
}).strict();
|
|
1312
|
+
/** The `body` part of a form values import request. */
|
|
1313
|
+
const FormValuesImportBodySchema = z.object({
|
|
1314
|
+
bundle: FormBundleEnvelopeSchema,
|
|
1315
|
+
options: FormValuesImportOptionsSchema
|
|
1316
|
+
}).strict();
|
|
1317
|
+
/** `doc.annotations.import` options on the wire; the `opId` is the `Idempotency-Key` header. */
|
|
1318
|
+
const AnnotationImportOptionsSchema = z.object({
|
|
1319
|
+
pages: BundleImportPagesSchema.optional(),
|
|
1320
|
+
attribution: z.enum(["restore", "stamp"]).optional()
|
|
1321
|
+
}).strict();
|
|
1322
|
+
/**
|
|
1323
|
+
* The `body` part of an import request. Only its envelope is checked
|
|
1324
|
+
* here: the bundle's pages and items are the worker's to check, against the
|
|
1325
|
+
* limits and each kind's create schema.
|
|
1326
|
+
*/
|
|
1327
|
+
const AnnotationImportBodySchema = z.object({
|
|
1328
|
+
bundle: z.object({
|
|
1329
|
+
format: z.literal("embedpdf/annotations"),
|
|
1330
|
+
version: z.literal(1),
|
|
1331
|
+
pages: z.array(z.unknown()),
|
|
1332
|
+
items: z.array(z.unknown())
|
|
1333
|
+
}).strict(),
|
|
1334
|
+
options: AnnotationImportOptionsSchema
|
|
1335
|
+
}).strict();
|
|
1336
|
+
const PageFlattenInputSchema = z.object({
|
|
1337
|
+
pages: z.array(PageRefSchema),
|
|
1338
|
+
usage: z.enum(["display", "print"])
|
|
1339
|
+
});
|
|
1340
|
+
/**
|
|
1341
|
+
* `{ pages }` or `{ annotations }`: one object with exactly one of the two,
|
|
1342
|
+
* so the wire has no untagged union (the API reference labels variants by a
|
|
1343
|
+
* discriminating literal, and a scope has none to add).
|
|
1344
|
+
*/
|
|
1345
|
+
const RedactionApplyScopeSchema = z.object({
|
|
1346
|
+
pages: z.array(PageRefSchema).optional(),
|
|
1347
|
+
annotations: z.array(AnnotationRefSchema).optional()
|
|
1348
|
+
}).strict().refine((scope) => scope.pages === void 0 !== (scope.annotations === void 0), { message: "exactly one of pages or annotations" });
|
|
1349
|
+
const RedactionApplyResultSchema = z.object({
|
|
1350
|
+
scope: RedactionApplyScopeSchema,
|
|
1351
|
+
results: z.array(z.object({
|
|
1352
|
+
page: PageRefSchema,
|
|
1353
|
+
status: z.enum(["applied", "unchanged"]),
|
|
1354
|
+
removedAnnotationCount: z.number().int().nonnegative()
|
|
1355
|
+
})),
|
|
1356
|
+
removedAnnotationCount: z.number().int().nonnegative(),
|
|
1357
|
+
meta: MutationMetaSchema
|
|
1358
|
+
});
|
|
1359
|
+
/**
|
|
1360
|
+
* Snapshot of every page in display order. Pages are addressed by
|
|
1361
|
+
* `pageObjectNumber` everywhere except the per-element `index`, which is
|
|
1362
|
+
* display order and intentionally not an identity. Carries geometry only.
|
|
1363
|
+
*/
|
|
1364
|
+
/** See `NamedPageEntry`: decoded key + what it resolves to. */
|
|
1365
|
+
const NamedPageEntrySchema = z.object({
|
|
1366
|
+
name: z.string(),
|
|
1367
|
+
target: z.discriminatedUnion("kind", [
|
|
1368
|
+
z.object({
|
|
1369
|
+
kind: z.literal("page"),
|
|
1370
|
+
page: PageRefSchema
|
|
1371
|
+
}),
|
|
1372
|
+
z.object({
|
|
1373
|
+
kind: z.literal("template"),
|
|
1374
|
+
objectNumber: z.number().int().positive()
|
|
1375
|
+
}),
|
|
1376
|
+
z.object({ kind: z.literal("dangling") })
|
|
1377
|
+
])
|
|
1378
|
+
});
|
|
1379
|
+
const PageListSnapshotSchema = z.object({
|
|
1380
|
+
pageCount: z.number().int().nonnegative(),
|
|
1381
|
+
pages: z.array(PageLayoutSchema),
|
|
1382
|
+
namedPages: z.array(NamedPageEntrySchema)
|
|
1383
|
+
});
|
|
1384
|
+
/** `pages.setName` input — see `PageNameInput`. */
|
|
1385
|
+
const PageNameInputSchema = z.object({
|
|
1386
|
+
name: z.string().min(1),
|
|
1387
|
+
page: PageRefSchema,
|
|
1388
|
+
replace: z.string().min(1).optional()
|
|
1389
|
+
});
|
|
1390
|
+
/** `pages.removeName` input — see `PageRemoveNameInput`. */
|
|
1391
|
+
const PageRemoveNameInputSchema = z.object({ name: z.string().min(1) });
|
|
1392
|
+
/**
|
|
1393
|
+
* Page reorder result. No per-page revision is bumped (they survive a page
|
|
1394
|
+
* reorder). The whole new order is returned so callers swap their snapshot.
|
|
1395
|
+
*/
|
|
1396
|
+
const PageReorderResultSchema = z.object({
|
|
1397
|
+
pages: z.array(PageRefSchema),
|
|
1398
|
+
layout: PageListSnapshotSchema,
|
|
1399
|
+
meta: MutationMetaSchema
|
|
1400
|
+
});
|
|
1401
|
+
/** Named-page mutation result — layout-shaped, see `PageNameResult`. */
|
|
1402
|
+
const PageNameResultSchema = z.object({
|
|
1403
|
+
layout: PageListSnapshotSchema,
|
|
1404
|
+
meta: MutationMetaSchema
|
|
1405
|
+
});
|
|
1406
|
+
/**
|
|
1407
|
+
* Page rotate result. Rotation is presentation metadata over normalized
|
|
1408
|
+
* content: nothing per-page invalidates; the new `layout` carries the
|
|
1409
|
+
* rotation values (see `PageRotateResult`).
|
|
1410
|
+
*/
|
|
1411
|
+
const PageRotateResultSchema = z.object({
|
|
1412
|
+
layout: PageListSnapshotSchema,
|
|
1413
|
+
meta: MutationMetaSchema
|
|
1414
|
+
});
|
|
1415
|
+
/**
|
|
1416
|
+
* Page delete result. Deleted page object numbers are retired (never recycled); surviving
|
|
1417
|
+
* pages keep identity + revisions (see `PageDeleteResult`).
|
|
1418
|
+
*/
|
|
1419
|
+
const PageDeleteResultSchema = z.object({
|
|
1420
|
+
layout: PageListSnapshotSchema,
|
|
1421
|
+
meta: MutationMetaSchema
|
|
1422
|
+
});
|
|
1423
|
+
/**
|
|
1424
|
+
* What blank pages to make (`PageInsertBlankSpec`). `size` is in PDF points
|
|
1425
|
+
* (un-rotated); `count` shares the contract cap with the worker so a request
|
|
1426
|
+
* the schema accepts cannot then fail the worker's own guard.
|
|
1427
|
+
*/
|
|
1428
|
+
const PageInsertBlankSpecSchema = z.object({
|
|
1429
|
+
size: z.object({
|
|
1430
|
+
width: z.number().positive().finite(),
|
|
1431
|
+
height: z.number().positive().finite()
|
|
1432
|
+
}),
|
|
1433
|
+
count: z.number().int().min(1).max(100).optional()
|
|
1434
|
+
});
|
|
1435
|
+
/**
|
|
1436
|
+
* Page extract input: the pages to export, in the order they should appear,
|
|
1437
|
+
* and `pages.extract()`'s options (`PageExtractOptions`).
|
|
1438
|
+
*/
|
|
1439
|
+
const PageExtractInputSchema = z.object({
|
|
1440
|
+
pages: z.array(PageRefSchema).min(1),
|
|
1441
|
+
flatten: z.object({ usage: z.enum(["display", "print"]).optional() }).strict().optional(),
|
|
1442
|
+
includeAnnotations: z.boolean().optional(),
|
|
1443
|
+
includeFormFields: z.boolean().optional()
|
|
1444
|
+
}).strict();
|
|
1445
|
+
/**
|
|
1446
|
+
* Page insert result — shared by bytes-insert and blank-insert: the fresh
|
|
1447
|
+
* page object numbers in insertion order plus the full new layout (see `PageInsertResult`).
|
|
1448
|
+
*/
|
|
1449
|
+
const PageInsertResultSchema = z.object({
|
|
1450
|
+
insertedPages: z.array(PageRefSchema),
|
|
1451
|
+
layout: PageListSnapshotSchema,
|
|
1452
|
+
meta: MutationMetaSchema
|
|
1453
|
+
});
|
|
1454
|
+
/** Page restore result: the pages an undo brought back (see `PageRestoreResult`). */
|
|
1455
|
+
const PageRestoreResultSchema = z.object({
|
|
1456
|
+
pages: z.array(PageRefSchema),
|
|
1457
|
+
layout: PageListSnapshotSchema,
|
|
1458
|
+
meta: MutationMetaSchema
|
|
1459
|
+
});
|
|
1460
|
+
/** See `AttachmentMutationMeta`. */
|
|
1461
|
+
const AttachmentMutationMetaSchema = z.object({
|
|
1462
|
+
affectedPages: z.array(PageRefSchema),
|
|
1463
|
+
cacheDelta: CacheDeltaSchema.nullable(),
|
|
1464
|
+
opId: z.string(),
|
|
1465
|
+
undoable: z.boolean(),
|
|
1466
|
+
changed: z.array(AttachmentRefSchema)
|
|
1467
|
+
});
|
|
1468
|
+
const AttachmentCreateResultSchema = z.object({
|
|
1469
|
+
attachment: AttachmentSchema,
|
|
1470
|
+
meta: AttachmentMutationMetaSchema
|
|
1471
|
+
});
|
|
1472
|
+
const AttachmentRestoreResultSchema = z.object({
|
|
1473
|
+
attachment: AttachmentSchema,
|
|
1474
|
+
meta: AttachmentMutationMetaSchema
|
|
1475
|
+
});
|
|
1476
|
+
const AttachmentDeleteResultSchema = z.object({ meta: AttachmentMutationMetaSchema });
|
|
1477
|
+
/** See `AttachmentList`. */
|
|
1478
|
+
const AttachmentListSchema = z.object({ attachments: z.array(AttachmentSchema) });
|
|
1479
|
+
/** Embedded files (`doc.attachments`): the models the OpenAPI projection names. */
|
|
1480
|
+
const AttachmentWireComponents = {
|
|
1481
|
+
AttachmentRef: AttachmentRefSchema,
|
|
1482
|
+
AttachmentFileInfo: AttachmentFileInfoSchema,
|
|
1483
|
+
Attachment: AttachmentSchema,
|
|
1484
|
+
AttachmentList: AttachmentListSchema,
|
|
1485
|
+
AttachmentFileBase: AttachmentFileBaseSchema,
|
|
1486
|
+
AttachmentMutationMeta: AttachmentMutationMetaSchema
|
|
1487
|
+
};
|
|
1488
|
+
/**
|
|
1489
|
+
* Metadata write result: the re-read `metadata`. On the cloud,
|
|
1490
|
+
* `meta.cacheDelta` advances only `docVersion` and `metadataVersion`.
|
|
1491
|
+
*/
|
|
1492
|
+
const MetadataUpdateResultSchema = z.object({
|
|
1493
|
+
metadata: DocumentMetadataSchema,
|
|
1494
|
+
meta: MutationMetaSchema
|
|
1495
|
+
});
|
|
1496
|
+
const CustomMetadataUpdateResultSchema = z.object({
|
|
1497
|
+
custom: CustomMetadataSchema,
|
|
1498
|
+
meta: MutationMetaSchema
|
|
1499
|
+
});
|
|
1500
|
+
/** The meta of every outline write: `MutationMeta` and the items it touched. */
|
|
1501
|
+
const OutlineMutationMetaSchema = z.object({
|
|
1502
|
+
affectedPages: z.array(PageRefSchema),
|
|
1503
|
+
cacheDelta: CacheDeltaSchema.nullable(),
|
|
1504
|
+
opId: z.string(),
|
|
1505
|
+
undoable: z.boolean(),
|
|
1506
|
+
changed: z.array(OutlineItemRefSchema)
|
|
1507
|
+
});
|
|
1508
|
+
/** One parent's children as a write left them; `parent: null` is the top level. */
|
|
1509
|
+
const OutlineOrderSchema = z.object({
|
|
1510
|
+
parent: OutlineItemRefSchema.nullable(),
|
|
1511
|
+
children: z.array(OutlineItemRefSchema)
|
|
1512
|
+
});
|
|
1513
|
+
const OutlineCreateResultSchema = z.object({
|
|
1514
|
+
item: OutlineItemSchema,
|
|
1515
|
+
order: OutlineOrderSchema,
|
|
1516
|
+
meta: OutlineMutationMetaSchema
|
|
1517
|
+
});
|
|
1518
|
+
const OutlineUpdateResultSchema = z.object({
|
|
1519
|
+
item: OutlineItemSchema,
|
|
1520
|
+
meta: OutlineMutationMetaSchema
|
|
1521
|
+
});
|
|
1522
|
+
const OutlineMoveResultSchema = z.object({
|
|
1523
|
+
orders: z.array(OutlineOrderSchema),
|
|
1524
|
+
meta: OutlineMutationMetaSchema
|
|
1525
|
+
});
|
|
1526
|
+
const OutlineDeleteResultSchema = z.object({ meta: OutlineMutationMetaSchema });
|
|
1527
|
+
const OutlineRestoreResultSchema = z.object({
|
|
1528
|
+
items: z.array(OutlineItemSchema),
|
|
1529
|
+
order: OutlineOrderSchema,
|
|
1530
|
+
meta: OutlineMutationMetaSchema
|
|
1531
|
+
});
|
|
1532
|
+
/**
|
|
1533
|
+
* Stable public component names for the outline wire model, so an OpenAPI
|
|
1534
|
+
* projection names each once (`OutlineItem`, not one type per response or op
|
|
1535
|
+
* that carries one), like `AnnotationWireComponents`.
|
|
1536
|
+
*/
|
|
1537
|
+
const OutlineWireComponents = {
|
|
1538
|
+
OutlineItemRef: OutlineItemRefSchema,
|
|
1539
|
+
OutlineItem: OutlineItemSchema,
|
|
1540
|
+
DocumentOutline: DocumentOutlineSchema,
|
|
1541
|
+
OutlineItemDraft: OutlineItemDraftSchema,
|
|
1542
|
+
OutlineItemPatch: OutlineItemPatchSchema,
|
|
1543
|
+
OutlinePosition: OutlinePositionSchema,
|
|
1544
|
+
OutlineOrder: OutlineOrderSchema,
|
|
1545
|
+
OutlineMutationMeta: OutlineMutationMetaSchema
|
|
1546
|
+
};
|
|
1547
|
+
const Base64Schema = z.string().regex(/^[A-Za-z0-9+/]*={0,2}$/, "base64");
|
|
1548
|
+
const DocumentVersionRefSchema = z.object({
|
|
1549
|
+
baseSha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
1550
|
+
editsVersion: z.number().int().nonnegative()
|
|
1551
|
+
});
|
|
1552
|
+
const ByteRangeSchema = z.tuple([
|
|
1553
|
+
z.number().int().nonnegative(),
|
|
1554
|
+
z.number().int().nonnegative(),
|
|
1555
|
+
z.number().int().nonnegative(),
|
|
1556
|
+
z.number().int().nonnegative()
|
|
1557
|
+
]);
|
|
1558
|
+
/** `SignaturePrepared` with the digest as base64. */
|
|
1559
|
+
const SignaturePreparedWireSchema = z.object({
|
|
1560
|
+
signingId: z.string().min(1),
|
|
1561
|
+
digest: Base64Schema,
|
|
1562
|
+
algorithm: z.enum([
|
|
1563
|
+
"sha256",
|
|
1564
|
+
"sha384",
|
|
1565
|
+
"sha512"
|
|
1566
|
+
]),
|
|
1567
|
+
byteRange: ByteRangeSchema,
|
|
1568
|
+
contentsSize: z.number().int().positive(),
|
|
1569
|
+
subFilter: z.string(),
|
|
1570
|
+
expectedVersion: DocumentVersionRefSchema,
|
|
1571
|
+
expiresAt: z.string().nullable()
|
|
1572
|
+
});
|
|
1573
|
+
function encodePrepared(prepared) {
|
|
1574
|
+
return {
|
|
1575
|
+
...prepared,
|
|
1576
|
+
digest: toBase64(prepared.digest)
|
|
1577
|
+
};
|
|
1578
|
+
}
|
|
1579
|
+
function decodePrepared(wire) {
|
|
1580
|
+
return {
|
|
1581
|
+
...wire,
|
|
1582
|
+
digest: fromBase64(wire.digest),
|
|
1583
|
+
subFilter: wire.subFilter
|
|
1584
|
+
};
|
|
1585
|
+
}
|
|
1586
|
+
/** The JSON body of a completion: the CMS as base64 beside the fence. */
|
|
1587
|
+
const SignatureCompleteBodySchema = z.object({
|
|
1588
|
+
cms: Base64Schema.refine((v) => v.length > 0, "cms is required"),
|
|
1589
|
+
expectedVersion: DocumentVersionRefSchema
|
|
1590
|
+
});
|
|
1591
|
+
const DocMdpPermissionSchema = z.union([
|
|
1592
|
+
z.literal(1),
|
|
1593
|
+
z.literal(2),
|
|
1594
|
+
z.literal(3)
|
|
1595
|
+
]);
|
|
1596
|
+
const ModificationLevelSchema = z.enum([
|
|
1597
|
+
"none",
|
|
1598
|
+
"lta",
|
|
1599
|
+
"fill",
|
|
1600
|
+
"annotate"
|
|
1601
|
+
]);
|
|
1602
|
+
const DigestAlgorithmSchema = z.enum([
|
|
1603
|
+
"sha1",
|
|
1604
|
+
"sha256",
|
|
1605
|
+
"sha384",
|
|
1606
|
+
"sha512"
|
|
1607
|
+
]);
|
|
1608
|
+
const FieldLockSpecSchema = z.object({
|
|
1609
|
+
action: z.enum([
|
|
1610
|
+
"all",
|
|
1611
|
+
"include",
|
|
1612
|
+
"exclude"
|
|
1613
|
+
]),
|
|
1614
|
+
fields: z.array(z.string()),
|
|
1615
|
+
permission: DocMdpPermissionSchema.optional()
|
|
1616
|
+
});
|
|
1617
|
+
const SignatureSeedValueSchema = z.object({
|
|
1618
|
+
requiredFlags: z.number().int(),
|
|
1619
|
+
presentFlags: z.number().int(),
|
|
1620
|
+
version: z.number().int().nullable(),
|
|
1621
|
+
mdp: z.union([
|
|
1622
|
+
z.literal(0),
|
|
1623
|
+
z.literal(1),
|
|
1624
|
+
z.literal(2),
|
|
1625
|
+
z.literal(3)
|
|
1626
|
+
]).nullable(),
|
|
1627
|
+
filter: z.string().nullable(),
|
|
1628
|
+
subFilters: z.array(z.string()),
|
|
1629
|
+
digestMethods: z.array(z.string()),
|
|
1630
|
+
reasons: z.array(z.string()),
|
|
1631
|
+
unsupportedRequired: z.boolean()
|
|
1632
|
+
});
|
|
1633
|
+
const SignatureDTOSchema = z.object({
|
|
1634
|
+
index: z.number().int().nonnegative(),
|
|
1635
|
+
field: FormFieldRefSchema,
|
|
1636
|
+
fieldName: z.string(),
|
|
1637
|
+
widget: FormFieldWidgetSchema.nullable(),
|
|
1638
|
+
signed: z.boolean(),
|
|
1639
|
+
kind: z.enum(["signature", "timestamp"]),
|
|
1640
|
+
filter: z.string().nullable(),
|
|
1641
|
+
subFilter: z.string().nullable(),
|
|
1642
|
+
byteRange: ByteRangeSchema.nullable(),
|
|
1643
|
+
contentsSize: z.number().int().nonnegative(),
|
|
1644
|
+
coverage: z.enum([
|
|
1645
|
+
"whole-revision",
|
|
1646
|
+
"partial",
|
|
1647
|
+
"malformed"
|
|
1648
|
+
]).nullable(),
|
|
1649
|
+
revisionIndex: z.number().int().nonnegative().nullable(),
|
|
1650
|
+
signer: z.object({
|
|
1651
|
+
name: z.string().nullable(),
|
|
1652
|
+
reason: z.string().nullable(),
|
|
1653
|
+
location: z.string().nullable(),
|
|
1654
|
+
contactInfo: z.string().nullable(),
|
|
1655
|
+
signedAt: IsoDateTimeSchema.nullable()
|
|
1656
|
+
}),
|
|
1657
|
+
docMdp: DocMdpPermissionSchema.nullable(),
|
|
1658
|
+
catalogCertification: z.boolean(),
|
|
1659
|
+
fieldMdp: FieldLockSpecSchema.nullable(),
|
|
1660
|
+
lock: FieldLockSpecSchema.nullable(),
|
|
1661
|
+
seedValue: SignatureSeedValueSchema.nullable()
|
|
1662
|
+
});
|
|
1663
|
+
const DocumentProtectionSchema = z.object({
|
|
1664
|
+
enforced: ModificationLevelSchema.nullable(),
|
|
1665
|
+
judged: ModificationLevelSchema.nullable(),
|
|
1666
|
+
certification: z.object({
|
|
1667
|
+
signatureIndex: z.number().int().nonnegative(),
|
|
1668
|
+
permission: DocMdpPermissionSchema
|
|
1669
|
+
}).nullable(),
|
|
1670
|
+
fieldLocks: z.array(z.object({
|
|
1671
|
+
signatureIndex: z.number().int().nonnegative(),
|
|
1672
|
+
source: z.enum(["fieldmdp", "lock"]),
|
|
1673
|
+
spec: FieldLockSpecSchema
|
|
1674
|
+
})),
|
|
1675
|
+
policyVersion: z.number().int()
|
|
1676
|
+
});
|
|
1677
|
+
const PdfRevisionSchema = z.object({
|
|
1678
|
+
index: z.number().int().nonnegative(),
|
|
1679
|
+
end: z.number().int().nonnegative(),
|
|
1680
|
+
xrefOffset: z.number().int().nonnegative(),
|
|
1681
|
+
signatureIndex: z.number().int().nonnegative().nullable()
|
|
1682
|
+
});
|
|
1683
|
+
const SignatureSnapshotSchema = z.object({
|
|
1684
|
+
chainValid: z.boolean(),
|
|
1685
|
+
revisions: z.array(PdfRevisionSchema),
|
|
1686
|
+
signatures: z.array(SignatureDTOSchema),
|
|
1687
|
+
protection: DocumentProtectionSchema
|
|
1688
|
+
});
|
|
1689
|
+
const BaseVersionInfoSchema = z.object({
|
|
1690
|
+
sha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
1691
|
+
byteLength: z.number().int().nonnegative()
|
|
1692
|
+
});
|
|
1693
|
+
const SignatureCompleteResultSchema = z.object({
|
|
1694
|
+
status: z.enum(["completed", "already-completed"]),
|
|
1695
|
+
signature: SignatureDTOSchema,
|
|
1696
|
+
version: BaseVersionInfoSchema,
|
|
1697
|
+
previous: DocumentVersionRefSchema,
|
|
1698
|
+
protection: DocumentProtectionSchema,
|
|
1699
|
+
meta: MutationMetaSchema
|
|
1700
|
+
});
|
|
1701
|
+
const SignatureCancelResultSchema = z.object({ status: z.enum([
|
|
1702
|
+
"cancelled",
|
|
1703
|
+
"already-completed",
|
|
1704
|
+
"unknown"
|
|
1705
|
+
]) });
|
|
1706
|
+
const ChangeFindingSchema = z.object({
|
|
1707
|
+
rule: z.string(),
|
|
1708
|
+
verdict: z.enum([
|
|
1709
|
+
"permitted",
|
|
1710
|
+
"forbidden",
|
|
1711
|
+
"incomplete"
|
|
1712
|
+
]),
|
|
1713
|
+
objectNumber: z.number().int().nonnegative(),
|
|
1714
|
+
edge: z.string().optional(),
|
|
1715
|
+
detail: z.string().optional()
|
|
1716
|
+
});
|
|
1717
|
+
const AnalysisDetailSchema = z.enum(["summary", "full"]);
|
|
1718
|
+
/** The analysis: one verdict (`current`) with its findings, the restrictions it was judged under, and facts about the revisions in between. */
|
|
1719
|
+
const ChangeAnalysisSchema = z.object({
|
|
1720
|
+
mode: z.enum(["authoritative", "exploratory"]),
|
|
1721
|
+
policyVersion: z.number().int(),
|
|
1722
|
+
basis: z.object({
|
|
1723
|
+
version: BaseVersionInfoSchema,
|
|
1724
|
+
editsVersion: z.number().int().nonnegative(),
|
|
1725
|
+
source: z.enum(["persisted", "working-copy"])
|
|
1726
|
+
}),
|
|
1727
|
+
since: z.object({
|
|
1728
|
+
revisionIndex: z.number().int().nonnegative(),
|
|
1729
|
+
signatureIndex: z.number().int().nonnegative().nullable()
|
|
1730
|
+
}),
|
|
1731
|
+
until: z.object({ revisionIndex: z.number().int().nonnegative() }),
|
|
1732
|
+
restrictions: z.array(z.object({
|
|
1733
|
+
signatureIndex: z.number().int().nonnegative(),
|
|
1734
|
+
revisionIndex: z.number().int().nonnegative(),
|
|
1735
|
+
source: z.enum([
|
|
1736
|
+
"docmdp",
|
|
1737
|
+
"fieldmdp",
|
|
1738
|
+
"lock"
|
|
1739
|
+
]),
|
|
1740
|
+
own: z.boolean(),
|
|
1741
|
+
permission: z.union([
|
|
1742
|
+
z.literal(1),
|
|
1743
|
+
z.literal(2),
|
|
1744
|
+
z.literal(3)
|
|
1745
|
+
]).optional(),
|
|
1746
|
+
fields: z.unknown().optional()
|
|
1747
|
+
})),
|
|
1748
|
+
current: z.object({
|
|
1749
|
+
verdict: z.enum([
|
|
1750
|
+
"unchanged",
|
|
1751
|
+
"permitted",
|
|
1752
|
+
"forbidden",
|
|
1753
|
+
"indeterminate"
|
|
1754
|
+
]),
|
|
1755
|
+
complete: z.boolean(),
|
|
1756
|
+
primary: ChangeFindingSchema.optional(),
|
|
1757
|
+
findings: z.array(ChangeFindingSchema),
|
|
1758
|
+
method: z.enum(["net-state", "net-state+replay"])
|
|
1759
|
+
}),
|
|
1760
|
+
later: z.object({
|
|
1761
|
+
revisionCount: z.number().int().nonnegative(),
|
|
1762
|
+
undoneObjectNumbers: z.array(z.number().int().nonnegative())
|
|
1763
|
+
}),
|
|
1764
|
+
/** Equals `current.verdict`. */
|
|
1765
|
+
verdict: z.enum([
|
|
1766
|
+
"unchanged",
|
|
1767
|
+
"permitted",
|
|
1768
|
+
"forbidden",
|
|
1769
|
+
"indeterminate"
|
|
1770
|
+
]),
|
|
1771
|
+
/** The step DTOs are large and evolving; carried verbatim. */
|
|
1772
|
+
steps: z.array(z.unknown())
|
|
1773
|
+
});
|
|
1774
|
+
const SignatureSignerInputSchema = z.object({
|
|
1775
|
+
name: z.string().optional(),
|
|
1776
|
+
reason: z.string().optional(),
|
|
1777
|
+
location: z.string().optional(),
|
|
1778
|
+
contactInfo: z.string().optional(),
|
|
1779
|
+
signedAt: IsoDateTimeSchema.optional()
|
|
1780
|
+
});
|
|
1781
|
+
/** The `body` part of a visual signature fill: which part holds the one-page PDF. */
|
|
1782
|
+
const SignatureAppearanceBodySchema = z.object({ resources: AppearanceResourceKeysSchema });
|
|
1783
|
+
/**
|
|
1784
|
+
* The `body` part of a prepare: `SignaturePrepareInput` with the
|
|
1785
|
+
* appearance artwork named by the key of its part instead of inline bytes.
|
|
1786
|
+
*/
|
|
1787
|
+
const SignaturePrepareBodySchema = z.object({
|
|
1788
|
+
field: FormFieldRefSchema,
|
|
1789
|
+
kind: z.enum(["signature", "timestamp"]).optional(),
|
|
1790
|
+
subFilter: z.enum(["adbe.pkcs7.detached", "ETSI.CAdES.detached"]).optional(),
|
|
1791
|
+
digest: z.enum([
|
|
1792
|
+
"sha256",
|
|
1793
|
+
"sha384",
|
|
1794
|
+
"sha512"
|
|
1795
|
+
]).optional(),
|
|
1796
|
+
contentsSize: z.number().int().positive().optional(),
|
|
1797
|
+
signer: SignatureSignerInputSchema.optional(),
|
|
1798
|
+
certify: z.object({ permission: DocMdpPermissionSchema }).optional(),
|
|
1799
|
+
lock: FieldLockSpecSchema.optional(),
|
|
1800
|
+
resources: AppearanceResourceKeysSchema.optional()
|
|
1801
|
+
});
|
|
1802
|
+
const optionalIndex = z.coerce.number().int().nonnegative().optional();
|
|
1803
|
+
/** Layer analysis query (the current form): exactly one `since.*`; the working copy is the end. */
|
|
1804
|
+
const LayerAnalysisQuerySchema = z.object({
|
|
1805
|
+
"since.signature": optionalIndex,
|
|
1806
|
+
"since.revision": optionalIndex,
|
|
1807
|
+
level: ModificationLevelSchema.optional(),
|
|
1808
|
+
detail: AnalysisDetailSchema.optional()
|
|
1809
|
+
}).refine((q) => q["since.signature"] === void 0 !== (q["since.revision"] === void 0), { message: "exactly one of since.signature / since.revision is required" });
|
|
1810
|
+
/** Version analysis query: as the layer's, plus `until` (a revision index; default the last). */
|
|
1811
|
+
const VersionAnalysisQuerySchema = z.object({
|
|
1812
|
+
"since.signature": optionalIndex,
|
|
1813
|
+
"since.revision": optionalIndex,
|
|
1814
|
+
until: optionalIndex,
|
|
1815
|
+
level: ModificationLevelSchema.optional(),
|
|
1816
|
+
detail: AnalysisDetailSchema.optional(),
|
|
1817
|
+
/** The judging policy version the caller expects — a cache key, not an input (version responses are immutable). */
|
|
1818
|
+
policy: optionalIndex
|
|
1819
|
+
}).refine((q) => q["since.signature"] === void 0 !== (q["since.revision"] === void 0), { message: "exactly one of since.signature / since.revision is required" });
|
|
1820
|
+
function analyzeInputFromQuery(query, until) {
|
|
1821
|
+
return {
|
|
1822
|
+
since: query["since.signature"] !== void 0 ? { signatureIndex: query["since.signature"] } : { revisionIndex: query["since.revision"] ?? 0 },
|
|
1823
|
+
...until !== void 0 ? { until } : {},
|
|
1824
|
+
...query.level !== void 0 ? { exploratoryLevel: query.level } : {},
|
|
1825
|
+
...query.detail !== void 0 ? { detail: query.detail } : {}
|
|
1826
|
+
};
|
|
1827
|
+
}
|
|
1828
|
+
/** One row of the document's version catalog. */
|
|
1829
|
+
const DocumentVersionSchema = z.object({
|
|
1830
|
+
sha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
1831
|
+
byteLength: z.number().int().nonnegative(),
|
|
1832
|
+
number: z.number().int().positive(),
|
|
1833
|
+
parentSha256: z.string().nullable(),
|
|
1834
|
+
producer: z.enum(["upload", "signature"]),
|
|
1835
|
+
signingId: z.string().nullable(),
|
|
1836
|
+
createdAt: z.number().int()
|
|
1837
|
+
});
|
|
1838
|
+
const DocumentVersionsSchema = z.object({
|
|
1839
|
+
/** `documents.base_sha`: the version every layer is over, or behind. */
|
|
1840
|
+
head: z.string().regex(/^[0-9a-f]{64}$/),
|
|
1841
|
+
/** Oldest first. */
|
|
1842
|
+
versions: z.array(DocumentVersionSchema)
|
|
1843
|
+
});
|
|
1844
|
+
const PageScaleResultSchema = z.object({
|
|
1845
|
+
page: PageRefSchema,
|
|
1846
|
+
meta: MutationMetaSchema
|
|
1847
|
+
});
|
|
1848
|
+
//#endregion
|
|
1849
|
+
export { FormCalculationsReorderBodySchema as $, PageInsertBlankSpecSchema as $t, BundleLimitsSchema as A, SignaturePreparedWireSchema as An, MetadataUpdateResultSchema as At, DocumentManifestSchema as B, OutlineItemDraftSchema as Bn, OutlineMoveResultSchema as Bt, AttachmentCreateResultSchema as C, SearchSnippetSchema as Cn, FormWidgetsReorderResultSchema as Ct, AttachmentRestoreResultSchema as D, SignatureCompleteResultSchema as Dn, LayerScopesSchema as Dt, AttachmentMutationMetaSchema as E, SignatureCompleteBodySchema as En, LayerAnalysisQuerySchema as Et, CustomMetadataPatchSchema as F, analyzeInputFromQuery as Fn, ObjectNumberReservationRequestSchema as Ft, DocumentVersionSchema as G, PAGE_PRINT_FAMILIES as Gn, OutlineUpdateResultSchema as Gt, DocumentProtectionSchema as H, OutlineItemSchema as Hn, OutlineOrderSchema as Ht, CustomMetadataSchema as I, decodePrepared as In, ObjectNumberReservationResponseSchema as It, EditSessionAccessSchema as J, pagePictureOf as Jn, PageDeleteResultSchema as Jt, DocumentVersionsSchema as K, PAGE_PRINT_TIERS as Kn, OutlineWireComponents as Kt, CustomMetadataUpdateResultSchema as L, encodePrepared as Ln, OpenDocumentResponseSchema as Lt, CacheDeltaSchema as M, SignatureSnapshotSchema as Mn, MutationMetaSchema as Mt, CachePinsSchema as N, VersionAnalysisQuerySchema as Nn, NamedPageEntrySchema as Nt, AttachmentWireComponents as O, SignatureDTOSchema as On, ManifestPageSchema as Ot, ChangeAnalysisSchema as P, WidgetAppearancesQuerySchema as Pn, ObjectNumberRangeSchema as Pt, FieldPositionSchema as Q, PageGeometrySnapshotSchema as Qt, DigestAlgorithmSchema as R, pagePictureQuerySchema as Rn, OutlineCreateResultSchema as Rt, AppearanceOutcomeSchema as S, SearchSliceSchema as Sn, FormWidgetsReorderBodySchema as St, AttachmentListSchema as T, SignatureCancelResultSchema as Tn, IdentitySchema as Tt, DocumentSecurityStateSchema as U, OutlineItemRefSchema as Un, OutlinePositionSchema as Ut, DocumentMetadataSchema as V, OutlineItemPatchSchema as Vn, OutlineMutationMetaSchema as Vt, DocumentVersionRefSchema as W, PAGE_PICTURES as Wn, OutlineRestoreResultSchema as Wt, EngineErrorPayloadSchema as X, pageRenderFamilyOf as Xn, PageFlattenInputSchema as Xt, EditSessionStatusSchema as Y, pagePrintTierOf as Yn, PageExtractInputSchema as Yt, FieldLockSpecSchema as Z, PageFlattenResultSchema as Zt, AnnotationReorderBodySchema as _, RedactionApplyResultSchema as _n, FormWidgetDeleteResultSchema as _t, AnnotationAppearancesQuerySchema as a, PageNetworkRenderFormatSchema as an, FormFieldUpdateResultSchema as at, AnnotationWireComponents as b, SearchQuerySchema as bn, FormWidgetUpdateBodySchema as bt, AnnotationExportSelectionSchema as c, PageRemoveNameInputSchema as cn, FormImportResultSchema as ct, AnnotationImportBodySchema as d, PageRestoreResultSchema as dn, FormResetBodySchema as dt, PageInsertResultSchema as en, FormCalculationsReorderResultSchema as et, AnnotationImportOptionsSchema as f, PageRotateResultSchema as fn, FormResetResultSchema as ft, AnnotationPositionSchema as g, PdfSaveModeSchema as gn, FormValuesImportResultSchema as gt, AnnotationListSchema as h, PdfRevisionSchema as hn, FormValuesImportOptionsSchema as ht, AnnotationAppearanceExportInputSchema as i, PageNameResultSchema as in, FormFieldDeleteResultSchema as it, ByteRangeSchema as j, SignatureSeedValueSchema as jn, ModificationLevelSchema as jt, BaseVersionInfoSchema as k, SignaturePrepareBodySchema as kn, MetadataPatchSchema as kt, AnnotationFlattenInputSchema as l, PageRenderQuerySchemas as ln, FormMutationMetaSchema as lt, AnnotationListMutationMetaSchema as m, PageTextSnapshotSchema as mn, FormValuesImportBodySchema as mt, AccessResponseSchema as n, PageListSnapshotSchema as nn, FormExportSelectionSchema as nt, AnnotationCreateResultSchema as o, PagePositionSchema as on, FormImportBodySchema as ot, AnnotationImportResultSchema as p, PageScaleResultSchema as pn, FormSetValueResultSchema as pt, DocumentWireComponents as q, PAGE_RENDER_FAMILIES as qn, PageBoxesSchema as qt, AnnotationAppearanceBatchSchema as r, PageNameInputSchema as rn, FormFieldCreateResultSchema as rt, AnnotationDeleteResultSchema as s, PagePrintQuerySchemas as sn, FormImportOptionsSchema as st, AccessRequestSchema as t, PageLayoutSchema as tn, FormExportRequestSchema as tt, AnnotationFlattenResultSchema as u, PageReorderResultSchema as un, FormRepairResultSchema as ut, AnnotationReorderResultSchema as v, RedactionApplyScopeSchema as vn, FormWidgetLinkResultSchema as vt, AttachmentDeleteResultSchema as w, SignatureAppearanceBodySchema as wn, FormWireComponents as wt, AnnotationsExportRequestSchema as x, SearchRequestSchema as xn, FormWidgetUpdateResultSchema as xt, AnnotationUpdateResultSchema as y, SearchMatchSchema as yn, FormWidgetRestoreResultSchema as yt, DocumentHeadSchema as z, DocumentOutlineSchema as zn, OutlineDeleteResultSchema as zt };
|
|
1850
|
+
|
|
1851
|
+
//# sourceMappingURL=schemas-BE2QGOit.js.map
|