@embedpdf/engine-core 3.0.0-next.13 → 3.0.0-next.15

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.
Files changed (135) hide show
  1. package/dist/AnnotationList-CkijRHet.d.cts +27163 -0
  2. package/dist/AnnotationList-CkijRHet.d.ts +27163 -0
  3. package/dist/Change-CKoxfTNY.js +889 -0
  4. package/dist/Change-CKoxfTNY.js.map +1 -0
  5. package/dist/Change-CjImsrN0.cjs +1020 -0
  6. package/dist/Change-CjImsrN0.cjs.map +1 -0
  7. package/dist/DocumentRenderService-BfFdFSwI.cjs +120 -0
  8. package/dist/DocumentRenderService-BfFdFSwI.cjs.map +1 -0
  9. package/dist/DocumentRenderService-DV3J9lMz.js +85 -0
  10. package/dist/DocumentRenderService-DV3J9lMz.js.map +1 -0
  11. package/dist/{DocumentSecurityService-_JRjqvoI.d.ts → DocumentSecurityService-CU1M6Q7m.d.ts} +100 -112
  12. package/dist/{DocumentSecurityService-ClTZc0zO.d.cts → DocumentSecurityService-e6vp2de8.d.cts} +100 -112
  13. package/dist/LocalDocumentHandle-D02FMm-Z.cjs +53 -0
  14. package/dist/LocalDocumentHandle-D02FMm-Z.cjs.map +1 -0
  15. package/dist/LocalDocumentHandle-DAPdaOt_.js +30 -0
  16. package/dist/LocalDocumentHandle-DAPdaOt_.js.map +1 -0
  17. package/dist/LocalEngine-DFoBm4B3.d.cts +1565 -0
  18. package/dist/LocalEngine-DPriFujS.d.ts +1565 -0
  19. package/dist/PageInsertBlankInput-CXHAM7l6.cjs +17 -0
  20. package/dist/PageInsertBlankInput-CXHAM7l6.cjs.map +1 -0
  21. package/dist/PageInsertBlankInput-DhVYVJ_S.js +12 -0
  22. package/dist/PageInsertBlankInput-DhVYVJ_S.js.map +1 -0
  23. package/dist/authority-B3BklsB4.js +2239 -0
  24. package/dist/authority-B3BklsB4.js.map +1 -0
  25. package/dist/authority-DLMNR7ff.cjs +2676 -0
  26. package/dist/authority-DLMNR7ff.cjs.map +1 -0
  27. package/dist/builders-CNj0POeY.js +161 -0
  28. package/dist/builders-CNj0POeY.js.map +1 -0
  29. package/dist/builders-Cgdp_YCn.cjs +184 -0
  30. package/dist/builders-Cgdp_YCn.cjs.map +1 -0
  31. package/dist/calibrate-7T3fnP8-.js +2404 -0
  32. package/dist/calibrate-7T3fnP8-.js.map +1 -0
  33. package/dist/calibrate-DJBXnhLE.cjs +2919 -0
  34. package/dist/calibrate-DJBXnhLE.cjs.map +1 -0
  35. package/dist/charmap-Cprti1ta.js +239 -0
  36. package/dist/charmap-Cprti1ta.js.map +1 -0
  37. package/dist/charmap-aYlefQP9.cjs +304 -0
  38. package/dist/charmap-aYlefQP9.cjs.map +1 -0
  39. package/dist/conformance.cjs +16753 -5247
  40. package/dist/conformance.cjs.map +1 -1
  41. package/dist/conformance.d.cts +928 -165
  42. package/dist/conformance.d.ts +928 -165
  43. package/dist/conformance.js +16731 -5268
  44. package/dist/conformance.js.map +1 -1
  45. package/dist/format-Bp3QFSH1.cjs +574 -0
  46. package/dist/format-Bp3QFSH1.cjs.map +1 -0
  47. package/dist/format-Dgg428Kb.js +461 -0
  48. package/dist/format-Dgg428Kb.js.map +1 -0
  49. package/dist/index.cjs +330 -103
  50. package/dist/index.d.cts +2 -2
  51. package/dist/index.d.ts +2 -2
  52. package/dist/index.js +14 -5
  53. package/dist/pageRefs-B3ur7Ckm.cjs +51 -0
  54. package/dist/pageRefs-B3ur7Ckm.cjs.map +1 -0
  55. package/dist/pageRefs-DkbuxSCV.js +40 -0
  56. package/dist/pageRefs-DkbuxSCV.js.map +1 -0
  57. package/dist/public.cjs +57 -0
  58. package/dist/public.d.cts +5 -0
  59. package/dist/public.d.ts +5 -0
  60. package/dist/public.js +9 -0
  61. package/dist/resolveAnnotationDraft-7Ke4nV7F.cjs +3646 -0
  62. package/dist/resolveAnnotationDraft-7Ke4nV7F.cjs.map +1 -0
  63. package/dist/resolveAnnotationDraft-CUpf0SMh.js +3167 -0
  64. package/dist/resolveAnnotationDraft-CUpf0SMh.js.map +1 -0
  65. package/dist/{resolver-inAVzsWt.js → resolver-CzxmD9Ck.js} +294 -144
  66. package/dist/resolver-CzxmD9Ck.js.map +1 -0
  67. package/dist/{resolver-CYVNV4hn.cjs → resolver-D2OCtE8F.cjs} +347 -143
  68. package/dist/resolver-D2OCtE8F.cjs.map +1 -0
  69. package/dist/runtime-Cl0v56mm.d.ts +2032 -0
  70. package/dist/runtime-p1WDzDo4.d.cts +2032 -0
  71. package/dist/runtime.cjs +733 -284
  72. package/dist/runtime.cjs.map +1 -1
  73. package/dist/runtime.d.cts +5 -1348
  74. package/dist/runtime.d.ts +5 -1348
  75. package/dist/runtime.js +396 -179
  76. package/dist/runtime.js.map +1 -1
  77. package/dist/schema-C-gU4vj7.cjs +3034 -0
  78. package/dist/schema-C-gU4vj7.cjs.map +1 -0
  79. package/dist/schema-DzlUNk38.js +2081 -0
  80. package/dist/schema-DzlUNk38.js.map +1 -0
  81. package/dist/schemas-Berf1swF.cjs +2481 -0
  82. package/dist/schemas-Berf1swF.cjs.map +1 -0
  83. package/dist/schemas-D6xOGjqg.js +1654 -0
  84. package/dist/schemas-D6xOGjqg.js.map +1 -0
  85. package/dist/subtype-CG4WpIRj.js +129 -0
  86. package/dist/subtype-CG4WpIRj.js.map +1 -0
  87. package/dist/subtype-aDt5TFmK.cjs +158 -0
  88. package/dist/subtype-aDt5TFmK.cjs.map +1 -0
  89. package/dist/validation.cjs +578 -0
  90. package/dist/validation.cjs.map +1 -0
  91. package/dist/validation.d.cts +174 -0
  92. package/dist/validation.d.ts +174 -0
  93. package/dist/validation.js +571 -0
  94. package/dist/validation.js.map +1 -0
  95. package/dist/value-BFS1R8ek.cjs +435 -0
  96. package/dist/value-BFS1R8ek.cjs.map +1 -0
  97. package/dist/value-Dhc8eYcx.js +340 -0
  98. package/dist/value-Dhc8eYcx.js.map +1 -0
  99. package/dist/viewport-BJW13EGZ.js +540 -0
  100. package/dist/viewport-BJW13EGZ.js.map +1 -0
  101. package/dist/viewport-DlL5Bxbg.cjs +671 -0
  102. package/dist/viewport-DlL5Bxbg.cjs.map +1 -0
  103. package/dist/wire.cjs +1056 -379
  104. package/dist/wire.cjs.map +1 -1
  105. package/dist/wire.d.cts +15069 -725
  106. package/dist/wire.d.ts +15069 -725
  107. package/dist/wire.js +825 -239
  108. package/dist/wire.js.map +1 -1
  109. package/package.json +10 -1
  110. package/dist/AbortError-Cq2igpZ6.cjs +0 -38
  111. package/dist/AbortError-Cq2igpZ6.cjs.map +0 -1
  112. package/dist/AbortError-DHqPBnYc.js +0 -27
  113. package/dist/AbortError-DHqPBnYc.js.map +0 -1
  114. package/dist/AnnotationListSnapshot-D3mFut1e.d.cts +0 -6871
  115. package/dist/AnnotationListSnapshot-D3mFut1e.d.ts +0 -6871
  116. package/dist/Engine-Bx0NOfmd.d.cts +0 -1264
  117. package/dist/Engine-DxtpCYcP.d.ts +0 -1264
  118. package/dist/PageInsertBlankInput-CqXBmFhN.cjs +0 -449
  119. package/dist/PageInsertBlankInput-CqXBmFhN.cjs.map +0 -1
  120. package/dist/PageInsertBlankInput-cHq9-i-z.js +0 -378
  121. package/dist/PageInsertBlankInput-cHq9-i-z.js.map +0 -1
  122. package/dist/builders-Bqm8yTpi.cjs +0 -3564
  123. package/dist/builders-Bqm8yTpi.cjs.map +0 -1
  124. package/dist/builders-Dqo2X-dt.js +0 -3121
  125. package/dist/builders-Dqo2X-dt.js.map +0 -1
  126. package/dist/fold-2V29cxCV.cjs +0 -447
  127. package/dist/fold-2V29cxCV.cjs.map +0 -1
  128. package/dist/fold-CdEJTBTn.js +0 -334
  129. package/dist/fold-CdEJTBTn.js.map +0 -1
  130. package/dist/resolver-CYVNV4hn.cjs.map +0 -1
  131. package/dist/resolver-inAVzsWt.js.map +0 -1
  132. package/dist/schemas-BLARNCgx.js +0 -3113
  133. package/dist/schemas-BLARNCgx.js.map +0 -1
  134. package/dist/schemas-DIqFMmrC.cjs +0 -4468
  135. package/dist/schemas-DIqFMmrC.cjs.map +0 -1
@@ -0,0 +1,2481 @@
1
+ const require_format = require("./format-Bp3QFSH1.cjs");
2
+ const require_charmap = require("./charmap-aYlefQP9.cjs");
3
+ require("./PageInsertBlankInput-CXHAM7l6.cjs");
4
+ const require_schema = require("./schema-C-gU4vj7.cjs");
5
+ let zod = require("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
+ },
21
+ annotations: {
22
+ family: "annotations",
23
+ resource: "page-render-annotations",
24
+ layerResource: "layer-page-render-annotations",
25
+ draws: {
26
+ includeAnnotations: true,
27
+ includeFormFields: false
28
+ },
29
+ path: "render/annotations/pages",
30
+ needs: ["doc.render", "doc.annotate.read"],
31
+ planes: ["content", "annotations"],
32
+ pins: ["contentVersion", "annotationVersion"]
33
+ },
34
+ fields: {
35
+ family: "fields",
36
+ resource: "page-render-fields",
37
+ layerResource: "layer-page-render-fields",
38
+ draws: {
39
+ includeAnnotations: false,
40
+ includeFormFields: true
41
+ },
42
+ path: "render/fields/pages",
43
+ needs: ["doc.render", "doc.forms.read"],
44
+ planes: ["content", "forms"],
45
+ pins: ["contentVersion", "widgetVersion"]
46
+ },
47
+ all: {
48
+ family: "all",
49
+ resource: "page-render-all",
50
+ layerResource: "layer-page-render-all",
51
+ draws: {
52
+ includeAnnotations: true,
53
+ includeFormFields: true
54
+ },
55
+ path: "render/all/pages",
56
+ needs: [
57
+ "doc.render",
58
+ "doc.annotate.read",
59
+ "doc.forms.read"
60
+ ],
61
+ planes: [
62
+ "content",
63
+ "annotations",
64
+ "forms"
65
+ ],
66
+ pins: [
67
+ "contentVersion",
68
+ "annotationVersion",
69
+ "widgetVersion"
70
+ ]
71
+ }
72
+ };
73
+ /** The family of a picture that draws `layers`. */
74
+ function pageRenderFamilyOf(layers) {
75
+ if (layers.includeAnnotations) return layers.includeFormFields ? "all" : "annotations";
76
+ return layers.includeFormFields ? "fields" : "pages";
77
+ }
78
+ //#endregion
79
+ //#region src/wire/schemas.ts
80
+ /** Who a session acts for; see `Identity` in `auth/scope/types.ts`. */
81
+ const IdentitySchema = zod.z.object({
82
+ userId: zod.z.string().min(1).max(256).optional(),
83
+ displayName: zod.z.string().min(1).max(256).optional(),
84
+ email: zod.z.string().min(1).max(256).optional(),
85
+ title: zod.z.string().min(1).max(256).optional(),
86
+ organization: zod.z.string().min(1).max(256).optional(),
87
+ organizationalUnit: zod.z.string().min(1).max(256).optional(),
88
+ groupId: zod.z.string().min(1).max(256).optional()
89
+ }).strict();
90
+ const DocumentMetadataSchema = zod.z.object({
91
+ title: zod.z.string().nullable(),
92
+ author: zod.z.string().nullable(),
93
+ subject: zod.z.string().nullable(),
94
+ keywords: zod.z.string().nullable(),
95
+ producer: zod.z.string().nullable(),
96
+ creator: zod.z.string().nullable(),
97
+ createdAt: require_schema.IsoDateTimeSchema.nullable(),
98
+ modifiedAt: require_schema.IsoDateTimeSchema.nullable(),
99
+ trapped: zod.z.enum([
100
+ "true",
101
+ "false",
102
+ "unknown"
103
+ ])
104
+ });
105
+ /**
106
+ * Three-state metadata patch. Mirrors annotation patch semantics:
107
+ * `undefined` leaves a field, `null` clears it, a value sets it.
108
+ */
109
+ const MetadataPatchSchema = zod.z.object({
110
+ title: zod.z.string().nullable().optional(),
111
+ author: zod.z.string().nullable().optional(),
112
+ subject: zod.z.string().nullable().optional(),
113
+ keywords: zod.z.string().nullable().optional(),
114
+ producer: zod.z.string().nullable().optional(),
115
+ creator: zod.z.string().nullable().optional(),
116
+ createdAt: require_schema.DateInputSchema.nullable().optional(),
117
+ modifiedAt: require_schema.DateInputSchema.nullable().optional(),
118
+ trapped: zod.z.enum([
119
+ "true",
120
+ "false",
121
+ "unknown"
122
+ ]).optional()
123
+ }).strict();
124
+ /** The Info dict's other keys, `{ key: value }`. */
125
+ const CustomMetadataSchema = zod.z.record(zod.z.string(), zod.z.string());
126
+ /**
127
+ * A custom-key patch: every key is a field (string sets, `null` removes, left
128
+ * out stays). Which keys a PDF can hold is the engine's check, so a refusal
129
+ * names the key the same way on both engines.
130
+ */
131
+ const CustomMetadataPatchSchema = zod.z.record(zod.z.string(), zod.z.string().nullable());
132
+ const OpenDocumentResponseSchema = zod.z.object({ id: zod.z.string() });
133
+ /**
134
+ * Wire shape of `GET /v1/docs/:docId/head`. Mirrors the server-side
135
+ * `DocumentHead` interface; the schema is the source of truth so
136
+ * older SDKs talking to newer servers degrade gracefully (extra
137
+ * fields are accepted and ignored).
138
+ *
139
+ * `docVersion` is the single monotonic integer per doc; it bumps on
140
+ * any mutation that could change the manifest's content (page list,
141
+ * per-page content, per-page annotations), which
142
+ * makes `/manifest@docVersion=N` fully content-addressed and cache-friendly.
143
+ * The server's layer mutations bump it.
144
+ */
145
+ const DocumentHeadSchema = zod.z.object({
146
+ id: zod.z.string(),
147
+ baseSha: zod.z.string(),
148
+ storageSizeBytes: zod.z.number().int().nonnegative(),
149
+ docVersion: zod.z.number().int().positive(),
150
+ state: zod.z.enum([
151
+ "pending",
152
+ "ready",
153
+ "failed",
154
+ "deleting"
155
+ ]),
156
+ encryption: zod.z.object({
157
+ state: zod.z.enum([
158
+ "unknown",
159
+ "none",
160
+ "encrypted",
161
+ "unsupported"
162
+ ]),
163
+ requiresPassword: zod.z.boolean().nullable()
164
+ }),
165
+ permissions: zod.z.object({
166
+ known: zod.z.boolean(),
167
+ bits: zod.z.number().int().nonnegative().nullable(),
168
+ allAllowed: zod.z.boolean().nullable(),
169
+ openedAs: zod.z.enum([
170
+ "none",
171
+ "user",
172
+ "owner"
173
+ ]).nullable(),
174
+ securityHandlerRevision: zod.z.number().int().nullable(),
175
+ canUpgradeToOwner: zod.z.boolean()
176
+ }),
177
+ access: zod.z.object({
178
+ required: zod.z.boolean(),
179
+ reasons: zod.z.array(zod.z.enum([
180
+ "password",
181
+ "cdn",
182
+ "permissions-unknown"
183
+ ])),
184
+ endpoint: zod.z.string().optional()
185
+ })
186
+ });
187
+ const AccessRequestSchema = zod.z.object({
188
+ /** Deprecated: identity now rides the path
189
+ * (`/v1/docs/:docId/layers/:layerName/access`). Kept optional for the
190
+ * legacy `/v1/access` alias, which requires `docId` in the body. */
191
+ docId: zod.z.string().min(1).optional(),
192
+ layerName: zod.z.string().min(1).optional(),
193
+ password: zod.z.string().optional(),
194
+ passwordGrant: zod.z.string().optional(),
195
+ mode: zod.z.enum(["any", "owner"]).optional(),
196
+ /**
197
+ * How many object numbers the caller's editing session wants now, at
198
+ * most 32: 8 for a new session when absent, 0 for a client that holds
199
+ * enough.
200
+ */
201
+ objectNumbers: zod.z.number().int().nonnegative().optional()
202
+ });
203
+ /** `first`, `first + 1`, …, `first + count - 1`. */
204
+ const ObjectNumberRangeSchema = zod.z.object({
205
+ first: zod.z.number().int().positive(),
206
+ count: zod.z.number().int().positive()
207
+ });
208
+ /** See `EditSessionAccess`. */
209
+ const EditSessionAccessSchema = zod.z.object({
210
+ session: zod.z.enum([
211
+ "new",
212
+ "revived",
213
+ "live"
214
+ ]),
215
+ expiresIn: zod.z.number().int().nonnegative(),
216
+ objectNumbers: zod.z.array(ObjectNumberRangeSchema)
217
+ });
218
+ /** See `EditSessionStatus`: the event stream's `session` event. */
219
+ const EditSessionStatusSchema = zod.z.object({
220
+ held: zod.z.array(ObjectNumberRangeSchema),
221
+ expiresIn: zod.z.number().int().nonnegative()
222
+ });
223
+ /** `POST …/object-numbers`: a bulk reservation. */
224
+ const ObjectNumberReservationRequestSchema = zod.z.object({ count: zod.z.number().int().positive() });
225
+ const ObjectNumberReservationResponseSchema = zod.z.object({
226
+ objectNumbers: zod.z.array(ObjectNumberRangeSchema),
227
+ expiresIn: zod.z.number().int().nonnegative()
228
+ });
229
+ /**
230
+ * Typed boolean view of the PDF user-access permission word. Names
231
+ * mirror the `PdfBits` shape in @embedpdf/engine-core/auth/scope; ISO
232
+ * bit numbers (3, 4, 5, 6, 9, 10, 11, 12).
233
+ */
234
+ const PdfBitsObjectSchema = zod.z.object({
235
+ bit3: zod.z.boolean(),
236
+ bit4: zod.z.boolean(),
237
+ bit5: zod.z.boolean(),
238
+ bit6: zod.z.boolean(),
239
+ bit9: zod.z.boolean(),
240
+ bit10: zod.z.boolean(),
241
+ bit11: zod.z.boolean(),
242
+ bit12: zod.z.boolean()
243
+ });
244
+ /**
245
+ * Capability-shaped advisory for the client UI. Mirrors
246
+ * `PdfPermissionAdvisory` in @embedpdf/engine-core/runtime; one
247
+ * boolean per UI badge.
248
+ */
249
+ const PdfPermissionAdvisoryObjectSchema = zod.z.object({
250
+ canPrint: zod.z.boolean(),
251
+ canPrintHigh: zod.z.boolean(),
252
+ canCopy: zod.z.boolean(),
253
+ canAnnotate: zod.z.boolean(),
254
+ canFillForms: zod.z.boolean(),
255
+ canModifyForms: zod.z.boolean(),
256
+ canModifyPages: zod.z.boolean(),
257
+ canAssemble: zod.z.boolean()
258
+ });
259
+ const PdfPermissionInfoSchema = zod.z.object({
260
+ known: zod.z.boolean(),
261
+ allAllowed: zod.z.boolean().nullable(),
262
+ bits: zod.z.number().int().nonnegative().nullable(),
263
+ openedAs: zod.z.enum([
264
+ "none",
265
+ "user",
266
+ "owner"
267
+ ]).nullable(),
268
+ securityHandlerRevision: zod.z.number().int().nullable(),
269
+ flags: PdfBitsObjectSchema.optional(),
270
+ advisory: PdfPermissionAdvisoryObjectSchema.optional()
271
+ }).nullable();
272
+ const DocumentSecurityStateSchema = zod.z.object({
273
+ encryption: zod.z.object({
274
+ state: zod.z.enum([
275
+ "unknown",
276
+ "none",
277
+ "encrypted",
278
+ "unsupported"
279
+ ]),
280
+ requiresPassword: zod.z.boolean().nullable()
281
+ }),
282
+ permissions: zod.z.object({
283
+ known: zod.z.boolean(),
284
+ bits: zod.z.number().int().nonnegative().nullable(),
285
+ allAllowed: zod.z.boolean().nullable(),
286
+ openedAs: zod.z.enum([
287
+ "none",
288
+ "user",
289
+ "owner"
290
+ ]).nullable(),
291
+ securityHandlerRevision: zod.z.number().int().nullable(),
292
+ canUpgradeToOwner: zod.z.boolean()
293
+ }),
294
+ access: zod.z.object({
295
+ required: zod.z.boolean(),
296
+ reasons: zod.z.array(zod.z.enum([
297
+ "password",
298
+ "cdn",
299
+ "permissions-unknown"
300
+ ])),
301
+ endpoint: zod.z.string().optional()
302
+ })
303
+ });
304
+ const positiveCount = zod.z.number().int().positive();
305
+ /** See `BundleLimits`. */
306
+ const BundleLimitsSchema = zod.z.object({
307
+ bundleBytes: positiveCount,
308
+ manifestBytes: positiveCount,
309
+ items: positiveCount,
310
+ pages: positiveCount,
311
+ resources: positiveCount,
312
+ resourceBytes: positiveCount,
313
+ imagePixels: positiveCount
314
+ }).strict();
315
+ const AccessResponseSchema = zod.z.object({
316
+ security: DocumentSecurityStateSchema,
317
+ cdn: zod.z.object({
318
+ adapter: zod.z.enum([
319
+ "none",
320
+ "cloudfront",
321
+ "cloud-cdn",
322
+ "bunny",
323
+ "azure-fd",
324
+ "custom-hmac"
325
+ ]),
326
+ expiresAt: zod.z.number().int().positive(),
327
+ cache: zod.z.object({
328
+ scope: zod.z.enum(["browser-private", "edge-shared"]),
329
+ immutableVersionedReads: zod.z.boolean()
330
+ }),
331
+ baseUrlOverrides: zod.z.record(zod.z.string(), zod.z.string()).nullable(),
332
+ authHeader: zod.z.object({
333
+ name: zod.z.string(),
334
+ value: zod.z.string()
335
+ }).nullable(),
336
+ signedQueryParams: zod.z.record(zod.z.string(), zod.z.string()).nullable(),
337
+ signedCookies: zod.z.array(zod.z.object({
338
+ name: zod.z.string(),
339
+ value: zod.z.string(),
340
+ domain: zod.z.string().optional(),
341
+ path: zod.z.string().optional(),
342
+ expires: zod.z.number().int().optional()
343
+ })).nullable(),
344
+ signedPathPolicies: zod.z.array(zod.z.object({
345
+ pathPrefix: zod.z.string(),
346
+ queryParams: zod.z.record(zod.z.string(), zod.z.string())
347
+ })).nullable()
348
+ }),
349
+ passwordGrant: zod.z.string().nullable(),
350
+ pdfPermissions: PdfPermissionInfoSchema,
351
+ scope: zod.z.array(zod.z.string()),
352
+ /**
353
+ * Concrete capability set granted to this caller after expanding
354
+ * `pdf.permissions` and applying resolver implication rules. Client
355
+ * UI should drive feature visibility off this, not off raw `scope`.
356
+ * Always present in /access responses (server populates from
357
+ * `expandRawScope`). Sorted alphabetically for stable change
358
+ * detection.
359
+ */
360
+ effectiveScope: zod.z.array(zod.z.string()),
361
+ /** What the document's signatures forbid; `effectiveScope` already leaves it out. */
362
+ protection: zod.z.lazy(() => DocumentProtectionSchema).nullable(),
363
+ identity: IdentitySchema,
364
+ originPasswordPolicy: zod.z.object({ mode: zod.z.enum([
365
+ "not-needed",
366
+ "client-retry",
367
+ "server-session"
368
+ ]) }),
369
+ expiresAt: zod.z.number().int().positive(),
370
+ /**
371
+ * The deployment's render lattice — the canonical parameter points the
372
+ * server treats as durable, CDN-shared artifacts. Lives here and never in
373
+ * the manifest: manifests are version-pinned immutable objects; the
374
+ * lattice is mutable deployment policy. The SDK exposes it (and a pure
375
+ * `snap` helper) but never conforms requests implicitly — the same render
376
+ * call must not return different pixels on local vs cloud. When
377
+ * `enforced` is true the server rejects off-lattice render tokens with
378
+ * 400; when false, off-lattice renders are computed but not persisted.
379
+ * Absent on older servers → treat as unenforced/unknown.
380
+ */
381
+ renderPolicy: zod.z.object({
382
+ /**
383
+ * Full-page renders quantize on `viewport.width` — the bounded
384
+ * quantity is output pixels, never zoom (PDF page space is
385
+ * effectively unbounded, so a scale lattice bounds artifact count
386
+ * but not size).
387
+ */
388
+ fullPage: zod.z.object({ widths: zod.z.array(zod.z.number().int().positive()) }),
389
+ /**
390
+ * Reserved for deep-zoom tile support: scale-based pyramid ×
391
+ * fixed tile size, constant per-job cost. Absent until the tiling
392
+ * plugin ships.
393
+ */
394
+ tiles: zod.z.object({
395
+ tileSizes: zod.z.array(zod.z.number().int().positive()),
396
+ scales: zod.z.array(zod.z.number().positive())
397
+ }).optional(),
398
+ /**
399
+ * Annotation-appearance lattice — scale-based (appearances are sized
400
+ * by `rect × scale` and must track the page's effective render scale
401
+ * for crisp composites).
402
+ */
403
+ appearances: zod.z.object({ scales: zod.z.array(zod.z.number().positive()) }).optional(),
404
+ /** Worker-side output budget for degenerate page geometry. */
405
+ maxRenderPixels: zod.z.number().int().positive().optional(),
406
+ formats: zod.z.array(zod.z.enum(["webp", "png"])),
407
+ background: zod.z.enum(["white"]),
408
+ enforced: zod.z.boolean()
409
+ }).optional(),
410
+ /** The deployment's limits for an annotation import (see `BundleLimits`). */
411
+ bundleLimits: BundleLimitsSchema,
412
+ /** The caller's editing session (see `DocumentAccessInfo.edit`). */
413
+ edit: EditSessionAccessSchema.optional()
414
+ });
415
+ const PdfSaveModeSchema = zod.z.enum(["incremental", "rewrite"]);
416
+ const engineErrorCodeValues = Object.values(require_format.EngineErrorCode);
417
+ const EngineErrorPayloadSchema = zod.z.object({
418
+ name: zod.z.literal("EngineError"),
419
+ code: zod.z.enum(engineErrorCodeValues),
420
+ message: zod.z.string(),
421
+ details: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
422
+ });
423
+ const CachePinsSchema = zod.z.object({
424
+ contentVersion: zod.z.number().int().positive(),
425
+ annotationVersion: zod.z.number().int().positive(),
426
+ widgetVersion: zod.z.number().int().positive()
427
+ });
428
+ /**
429
+ * Plane scopes are derived from the version counters when a layer manifest
430
+ * is built, never stored. Absent on base manifests: consumers treat absence
431
+ * as all-'layer' (never wrong, only unshared).
432
+ */
433
+ const LayerScopeValueSchema = zod.z.enum(["base", "layer"]);
434
+ const LayerScopesSchema = zod.z.object({
435
+ content: LayerScopeValueSchema,
436
+ annotations: LayerScopeValueSchema,
437
+ forms: LayerScopeValueSchema,
438
+ layout: LayerScopeValueSchema,
439
+ attachments: LayerScopeValueSchema,
440
+ metadata: LayerScopeValueSchema,
441
+ actions: LayerScopeValueSchema
442
+ });
443
+ /**
444
+ * Per-page envelope inside `DocumentManifest`: the page, plus the
445
+ * cache-busting integers the SDK embeds in leaf URLs
446
+ * (`/pages/:pon/text@contentVersion=N`, `/pages/:pon/annotations@annotationVersion=N`).
447
+ *
448
+ * `contentVersion` bumps when the page's content stream changes
449
+ * (text, page reorder doesn't, the pon is durable). `annotationVersion`
450
+ * bumps when /Annots gains/loses entries or when a tracked annotation
451
+ * mutates. The server derives both from its per-layer page state.
452
+ */
453
+ const ManifestPageSchema = zod.z.object({
454
+ page: require_schema.PageRefSchema,
455
+ cache: CachePinsSchema
456
+ });
457
+ /**
458
+ * Wire shape of `GET /v1/docs/:docId/manifest@docVersion=N`. Content-addressed
459
+ * by `docVersion`; safe to cache with `Cache-Control: public,
460
+ * max-age=31536000, immutable`.
461
+ */
462
+ const DocumentManifestSchema = zod.z.object({
463
+ docVersion: zod.z.number().int().positive(),
464
+ layoutVersion: zod.z.number().int().positive(),
465
+ metadataVersion: zod.z.number().int().positive(),
466
+ actionsVersion: zod.z.number().int().positive().default(1),
467
+ attachmentsVersion: zod.z.number().int().positive().default(1),
468
+ annotationsVersion: zod.z.number().int().positive().default(1),
469
+ formsVersion: zod.z.number().int().positive().default(1),
470
+ auditHead: zod.z.number().int().nonnegative(),
471
+ baseSha: zod.z.string(),
472
+ layerVersion: zod.z.number().int().nonnegative().default(0),
473
+ working: zod.z.boolean().default(false),
474
+ baseByteLength: zod.z.number().int().nonnegative().default(0),
475
+ scopes: LayerScopesSchema.optional(),
476
+ protection: zod.z.lazy(() => DocumentProtectionSchema).nullable(),
477
+ pages: zod.z.array(ManifestPageSchema)
478
+ });
479
+ /** What both engines' `annotations.list()` return, and the server's list endpoints send. */
480
+ const AnnotationListSchema = zod.z.object({
481
+ annotations: zod.z.array(require_schema.AnnotationSchema),
482
+ pages: zod.z.array(require_schema.PageRefSchema),
483
+ auditHead: zod.z.number().int().nonnegative().optional()
484
+ });
485
+ /**
486
+ * Wire shape of `GET …/text/pages/:pon/data@<contentVersion>` and the
487
+ * `pages.text` worker result: the UTF-16-faithful extraction, the character
488
+ * space size (`charCount` — the space geometry runs tile; not `text.length`),
489
+ * and the optional character→text anchor map. Malformed maps are rejected
490
+ * here with the shared `charMapViolation` invariants — absent/empty map
491
+ * requires `charCount === text.length` (identity).
492
+ */
493
+ const PageTextSnapshotSchema = zod.z.object({
494
+ text: zod.z.string(),
495
+ charCount: zod.z.number().int().nonnegative(),
496
+ charMap: zod.z.array(zod.z.tuple([zod.z.number().int().nonnegative(), zod.z.number().int().nonnegative()])).optional()
497
+ }).superRefine((snapshot, ctx) => {
498
+ const violation = require_charmap.charMapViolation(snapshot.charCount, snapshot.text.length, snapshot.charMap);
499
+ if (violation !== null) ctx.addIssue({
500
+ code: zod.z.ZodIssueCode.custom,
501
+ path: ["charMap"],
502
+ message: violation
503
+ });
504
+ });
505
+ const PageGeometryGlyphSchema = zod.z.object({
506
+ loose: require_schema.PageBoxSchema,
507
+ tight: require_schema.PageBoxSchema.optional(),
508
+ space: zod.z.literal(true).optional(),
509
+ empty: zod.z.literal(true).optional()
510
+ });
511
+ const RotatedGeometryGlyphSchema = zod.z.object({
512
+ loose: require_schema.PageQuadSchema,
513
+ tight: require_schema.PageQuadSchema.optional(),
514
+ space: zod.z.literal(true).optional(),
515
+ empty: zod.z.literal(true).optional()
516
+ });
517
+ const UprightGeometryRunSchema = zod.z.object({
518
+ rect: require_schema.PageBoxSchema,
519
+ start: zod.z.number().int().nonnegative(),
520
+ glyphs: zod.z.array(PageGeometryGlyphSchema),
521
+ fontSize: zod.z.number().optional()
522
+ });
523
+ const RotatedGeometryRunSchema = zod.z.object({
524
+ rect: require_schema.PageBoxSchema,
525
+ start: zod.z.number().int().nonnegative(),
526
+ glyphs: zod.z.array(RotatedGeometryGlyphSchema),
527
+ rotation: zod.z.number(),
528
+ ascentFlip: zod.z.boolean(),
529
+ fontSize: zod.z.number().optional()
530
+ });
531
+ const PageGeometryRunSchema = zod.z.union([RotatedGeometryRunSchema, UprightGeometryRunSchema]);
532
+ const PageGeometrySnapshotSchema = zod.z.object({ runs: zod.z.array(PageGeometryRunSchema) });
533
+ /**
534
+ * Search wire shapes: the request body of the layer search route and the
535
+ * `search.query` worker/route result. The server re-validates the query
536
+ * semantics (`validateSearchQuery`: regex dialect + flag combos) after
537
+ * parse — the schema only checks structure.
538
+ */
539
+ const searchQueryObject = zod.z.object({
540
+ text: zod.z.string(),
541
+ regex: zod.z.boolean().optional(),
542
+ matchCase: zod.z.boolean().optional(),
543
+ wholeWord: zod.z.boolean().optional(),
544
+ matchDiacritics: zod.z.boolean().optional(),
545
+ ignoreWhitespace: zod.z.boolean().optional()
546
+ });
547
+ const SearchQuerySchema = searchQueryObject;
548
+ const SearchRequestSchema = searchQueryObject.extend({
549
+ snippets: zod.z.boolean().optional(),
550
+ from: require_schema.PageRefSchema.optional(),
551
+ cursor: zod.z.string().optional(),
552
+ limit: zod.z.object({
553
+ matches: zod.z.number().int().positive().optional(),
554
+ pages: zod.z.number().int().positive().optional()
555
+ }).optional()
556
+ });
557
+ const SearchSnippetSchema = zod.z.object({
558
+ before: zod.z.string(),
559
+ match: zod.z.string(),
560
+ after: zod.z.string()
561
+ });
562
+ const PdfTextSegmentSchema = zod.z.object({
563
+ quad: require_schema.PageQuadSchema,
564
+ rect: require_schema.PageBoxSchema,
565
+ advance: zod.z.union([zod.z.literal(1), zod.z.literal(-1)])
566
+ });
567
+ const SearchMatchSchema = zod.z.object({
568
+ page: require_schema.PageRefSchema,
569
+ start: zod.z.number().int().nonnegative(),
570
+ count: zod.z.number().int().positive(),
571
+ segments: zod.z.array(PdfTextSegmentSchema),
572
+ snippet: SearchSnippetSchema.optional()
573
+ });
574
+ const SearchSliceSchema = zod.z.object({
575
+ matches: zod.z.array(SearchMatchSchema),
576
+ nextCursor: zod.z.string().nullable(),
577
+ pagesSearched: zod.z.number().int().nonnegative(),
578
+ pageCount: zod.z.number().int().nonnegative()
579
+ });
580
+ const PageNetworkRenderFormatSchema = zod.z.enum(["png", "webp"]);
581
+ /**
582
+ * Wire schema for the cloud render endpoints, applied to the **nested**
583
+ * shape produced by `unflatten(...)` of the parsed token or query string.
584
+ *
585
+ * Adding a new render option is one change here (a new field plus any
586
+ * cross-field rule in `superRefine`) plus one entry in
587
+ * `RenderTokenSchema.fields`. The token codec, flatten/unflatten helpers,
588
+ * route handlers, and SDK URL builder are all generic and pick the new
589
+ * field up automatically.
590
+ *
591
+ * Coercion: token fields and query strings both arrive as strings, so every
592
+ * scalar uses `z.coerce.*`. Discriminated unions on `viewport.kind` and
593
+ * `target.kind` enforce viewport / rect coherence by construction — no
594
+ * superRefine for "fields must appear together" rules.
595
+ */
596
+ const RenderViewportSchema = zod.z.discriminatedUnion("kind", [zod.z.object({
597
+ kind: zod.z.literal("width"),
598
+ width: zod.z.coerce.number().positive().finite()
599
+ }).strict(), zod.z.object({
600
+ kind: zod.z.literal("scale"),
601
+ scale: zod.z.coerce.number().positive().finite().optional()
602
+ }).strict()]);
603
+ const RenderTargetSchema = zod.z.discriminatedUnion("kind", [zod.z.object({ kind: zod.z.literal("page") }).strict(), zod.z.object({
604
+ kind: zod.z.literal("rect"),
605
+ rect: zod.z.object({
606
+ x: zod.z.coerce.number().finite(),
607
+ y: zod.z.coerce.number().finite(),
608
+ width: zod.z.coerce.number().positive().finite(),
609
+ height: zod.z.coerce.number().positive().finite()
610
+ }).strict()
611
+ }).strict()]);
612
+ const RenderRotationSchema = zod.z.preprocess((raw) => raw === void 0 ? void 0 : Number(raw), zod.z.number().refine((n) => n === 0 || n === 90 || n === 180 || n === 270, { message: "render rotation must be 0, 90, 180, or 270" }));
613
+ const RenderBackgroundSchema = zod.z.enum(["white", "transparent"]);
614
+ /** WebP quality, 0 (smallest) to 1 (best) — the `canvas.toBlob` scale. */
615
+ const RenderQualitySchema = zod.z.coerce.number().min(0).max(1);
616
+ const AppearanceModeSchema = zod.z.enum([
617
+ "normal",
618
+ "rollover",
619
+ "down"
620
+ ]);
621
+ /**
622
+ * A token's `modes`: the modes it asks for, in the engine's mode order,
623
+ * joined by `-` (`normal-down`). Anything else is refused, so one set of
624
+ * modes has one spelling and one URL.
625
+ */
626
+ const AppearanceModesSchema = zod.z.string().transform((value, ctx) => {
627
+ const modes = value.split("-");
628
+ const canonical = require_charmap.ANNOTATION_APPEARANCE_MODES.filter((mode) => modes.includes(mode));
629
+ if (canonical.length === 0 || canonical.length === require_charmap.ANNOTATION_APPEARANCE_MODES.length || canonical.join("-") !== value) {
630
+ ctx.addIssue({
631
+ code: zod.z.ZodIssueCode.custom,
632
+ message: "modes must name some but not all of normal, rollover, down, in that order, joined by -"
633
+ });
634
+ return zod.z.NEVER;
635
+ }
636
+ return canonical;
637
+ });
638
+ /**
639
+ * The query/token schema of one picture family (`PAGE_RENDER_FAMILIES`).
640
+ * What a picture draws is in its path, never its token, so each family has
641
+ * its own schema, built from one shared base:
642
+ *
643
+ * - its pins are the family's own (`contentVersion`, plus
644
+ * `annotationVersion` and `widgetVersion` for the planes it draws), and
645
+ * `.strict()` refuses any other, so a pin the family doesn't depend on
646
+ * is unrepresentable;
647
+ * - a versioned request (one with `contentVersion`) carries every one of
648
+ * them, since the picture changes with each.
649
+ *
650
+ * The transform stamps what the family draws onto the parsed options, so
651
+ * the worker options downstream need no family.
652
+ */
653
+ function buildPageRenderQuerySchema(family) {
654
+ const { draws, pins } = PAGE_RENDER_FAMILIES[family];
655
+ const pinFields = {};
656
+ for (const pin of pins) pinFields[pin] = zod.z.coerce.number().int().positive().optional();
657
+ return zod.z.object({
658
+ ...pinFields,
659
+ format: PageNetworkRenderFormatSchema.optional(),
660
+ viewport: RenderViewportSchema.optional(),
661
+ target: RenderTargetSchema.optional(),
662
+ rotation: RenderRotationSchema.optional(),
663
+ background: RenderBackgroundSchema.optional(),
664
+ quality: RenderQualitySchema.optional()
665
+ }).strict().superRefine((v, ctx) => {
666
+ const pinned = v;
667
+ if (pinned.contentVersion === void 0) {
668
+ for (const pin of pins) {
669
+ if (pinned[pin] === void 0) continue;
670
+ ctx.addIssue({
671
+ code: zod.z.ZodIssueCode.custom,
672
+ path: [pin],
673
+ message: `${pin} requires contentVersion`
674
+ });
675
+ }
676
+ return;
677
+ }
678
+ if (v.format === void 0) ctx.addIssue({
679
+ code: zod.z.ZodIssueCode.custom,
680
+ path: ["format"],
681
+ message: "versioned render requires format"
682
+ });
683
+ for (const pin of pins) {
684
+ if (pinned[pin] !== void 0) continue;
685
+ ctx.addIssue({
686
+ code: zod.z.ZodIssueCode.custom,
687
+ path: [pin],
688
+ message: `a versioned ${family} picture requires ${pin}`
689
+ });
690
+ }
691
+ }).transform((v) => {
692
+ const pinned = v;
693
+ const query = { options: {
694
+ ...v.target ? { target: v.target } : {},
695
+ ...v.viewport ? { viewport: v.viewport } : {},
696
+ ...v.rotation !== void 0 ? { rotation: v.rotation } : {},
697
+ ...v.background !== void 0 ? { background: v.background } : {},
698
+ ...v.quality !== void 0 ? { quality: v.quality } : {},
699
+ ...v.format !== void 0 ? { format: v.format } : {},
700
+ ...draws
701
+ } };
702
+ for (const pin of pins) if (pinned[pin] !== void 0) query[pin] = pinned[pin];
703
+ return query;
704
+ });
705
+ }
706
+ /** Query/token schemas of the four picture families, by family. */
707
+ const PageRenderQuerySchemas = {
708
+ pages: buildPageRenderQuerySchema("pages"),
709
+ annotations: buildPageRenderQuerySchema("annotations"),
710
+ fields: buildPageRenderQuerySchema("fields"),
711
+ all: buildPageRenderQuerySchema("all")
712
+ };
713
+ /**
714
+ * Query/token schema of an appearance batch, keyed by `pin`. Mirrors
715
+ * `PageRenderQuerySchema` but without page target/background or
716
+ * `includeAnnotations` (appearances are always annotation-derived), and keyed
717
+ * by the page's pin for its family only — appearance bitmaps do not depend on
718
+ * page base content, so `contentVersion` is not part of the cache key. The
719
+ * endpoint renders every mode and state an annotation stores, or the `modes`
720
+ * asked for.
721
+ */
722
+ function buildAppearancesQuerySchema(pin) {
723
+ return zod.z.object({
724
+ [pin]: zod.z.coerce.number().int().positive().optional(),
725
+ format: PageNetworkRenderFormatSchema.optional(),
726
+ modes: AppearanceModesSchema.optional(),
727
+ rotation: RenderRotationSchema.optional(),
728
+ viewport: RenderViewportSchema.optional(),
729
+ quality: RenderQualitySchema.optional()
730
+ }).strict().superRefine((v, ctx) => {
731
+ if (v[pin] !== void 0 && v.format === void 0) ctx.addIssue({
732
+ code: zod.z.ZodIssueCode.custom,
733
+ path: ["format"],
734
+ message: "versioned appearance render requires format"
735
+ });
736
+ }).transform((v) => {
737
+ return {
738
+ options: {
739
+ ...v.rotation !== void 0 ? { rotation: v.rotation } : {},
740
+ ...v.viewport ? { viewport: v.viewport } : {},
741
+ ...v.quality !== void 0 ? { quality: v.quality } : {},
742
+ ...v.format !== void 0 ? { format: v.format } : {},
743
+ ...v.modes !== void 0 ? { modes: v.modes } : {}
744
+ },
745
+ ...v[pin] !== void 0 ? { [pin]: v[pin] } : {}
746
+ };
747
+ });
748
+ }
749
+ /** Query/token schema of a page's annotation images (`annotations/pages/{p}/appearances@`). */
750
+ const AnnotationAppearancesQuerySchema = buildAppearancesQuerySchema("annotationVersion");
751
+ /** Query/token schema of a page's widget images (`form/pages/{p}/appearances@`). */
752
+ const WidgetAppearancesQuerySchema = buildAppearancesQuerySchema("widgetVersion");
753
+ /**
754
+ * The `body` part of the appearance `multipart/form-data` response.
755
+ * Wire-stable; the cloud client validates the parsed `body` part against
756
+ * this before reconstructing image handles from the binary parts.
757
+ */
758
+ const AnnotationAppearanceBatchSchema = zod.z.object({
759
+ page: require_schema.PageRefSchema,
760
+ appearances: zod.z.array(zod.z.object({
761
+ resources: require_schema.ImageResourceKeysSchema,
762
+ ref: require_schema.AnnotationRefSchema,
763
+ mode: AppearanceModeSchema,
764
+ state: zod.z.string().nullable(),
765
+ rect: require_schema.PageBoxSchema,
766
+ width: zod.z.number().int().positive(),
767
+ height: zod.z.number().int().positive(),
768
+ format: PageNetworkRenderFormatSchema,
769
+ contentType: zod.z.string().min(1)
770
+ }))
771
+ });
772
+ const CacheDeltaSchema = zod.z.object({
773
+ previousDocVersion: zod.z.number().int().nonnegative(),
774
+ docVersion: zod.z.number().int().positive(),
775
+ annotationsVersion: zod.z.number().int().positive().optional(),
776
+ formsVersion: zod.z.number().int().positive().optional(),
777
+ layoutVersion: zod.z.number().int().positive().optional(),
778
+ metadataVersion: zod.z.number().int().positive().optional(),
779
+ attachmentsVersion: zod.z.number().int().positive().optional(),
780
+ layerVersion: zod.z.number().int().nonnegative().optional(),
781
+ working: zod.z.boolean().optional(),
782
+ pages: zod.z.array(zod.z.object({
783
+ page: require_schema.PageRefSchema,
784
+ cache: CachePinsSchema
785
+ }))
786
+ });
787
+ const MutationMetaSchema = zod.z.object({
788
+ affectedPages: zod.z.array(require_schema.PageRefSchema),
789
+ cacheDelta: CacheDeltaSchema.nullable(),
790
+ opId: zod.z.string(),
791
+ undoable: zod.z.boolean()
792
+ });
793
+ /**
794
+ * Where rows go in their list, on the wire: `'start'`, `'end'`, or one
795
+ * object naming exactly one neighbour (`before` or `after`).
796
+ */
797
+ function listPositionSchema(ref) {
798
+ return zod.z.union([zod.z.enum(["start", "end"]), zod.z.object({
799
+ before: ref.optional(),
800
+ after: ref.optional()
801
+ }).strict().refine((position) => position.before === void 0 !== (position.after === void 0), { message: "exactly one of before or after" })]);
802
+ }
803
+ /** Where pages go among the document's pages. */
804
+ const PagePositionSchema = listPositionSchema(require_schema.PageRefSchema);
805
+ /** Where annotations go among their page's annotations, or widgets among its widgets. */
806
+ const AnnotationPositionSchema = listPositionSchema(require_schema.AnnotationRefSchema);
807
+ /** Where fields go in the form's calculation order. */
808
+ const FieldPositionSchema = listPositionSchema(require_schema.FormFieldRefSchema);
809
+ /**
810
+ * Stable public component names for the models every part of the document
811
+ * wire shares (page refs, a write's meta, the metadata), like
812
+ * `AnnotationWireComponents`.
813
+ */
814
+ const DocumentWireComponents = {
815
+ PageRef: require_schema.PageRefSchema,
816
+ PagePosition: PagePositionSchema,
817
+ CacheDelta: CacheDeltaSchema,
818
+ MutationMeta: MutationMetaSchema,
819
+ DocumentMetadata: DocumentMetadataSchema,
820
+ MetadataPatch: MetadataPatchSchema
821
+ };
822
+ /** Per-page side-effect envelope every annotation mutation returns. Mirrors `AnnotationListMutationMeta`. */
823
+ const AnnotationListMutationMetaSchema = zod.z.object({
824
+ affectedPages: zod.z.array(require_schema.PageRefSchema),
825
+ cacheDelta: CacheDeltaSchema.nullable(),
826
+ opId: zod.z.string(),
827
+ undoable: zod.z.boolean(),
828
+ changed: zod.z.array(require_schema.AnnotationRefSchema)
829
+ });
830
+ const AnnotationCreateResultSchema = zod.z.object({
831
+ annotation: require_schema.AnnotationSchema,
832
+ meta: AnnotationListMutationMetaSchema
833
+ });
834
+ const AnnotationImportResultSchema = zod.z.object({
835
+ annotations: zod.z.array(require_schema.AnnotationSchema),
836
+ refMap: zod.z.array(zod.z.object({
837
+ from: require_schema.AnnotationRefSchema,
838
+ to: require_schema.AnnotationRefSchema
839
+ })),
840
+ dropped: zod.z.array(zod.z.object({
841
+ ref: require_schema.AnnotationRefSchema,
842
+ field: zod.z.string().optional(),
843
+ reason: zod.z.enum([
844
+ "unsupported-kind",
845
+ "widget",
846
+ "geospatial",
847
+ "unknown-measure",
848
+ "unsupported-action",
849
+ "unsupported-value",
850
+ "name-conflict",
851
+ "parent-dropped",
852
+ "parent-missing",
853
+ "popup-taken"
854
+ ])
855
+ })),
856
+ meta: AnnotationListMutationMetaSchema
857
+ });
858
+ /** The engine's `/AP` verdict riding every update result (see engine-core
859
+ * `annotation/appearance.ts`). `changed` drives client raster invalidation. */
860
+ const AppearanceOutcomeSchema = zod.z.object({
861
+ action: zod.z.enum([
862
+ "preserved",
863
+ "regenerated",
864
+ "generation-unavailable",
865
+ "restored"
866
+ ]),
867
+ changed: zod.z.boolean()
868
+ });
869
+ const AnnotationUpdateResultSchema = zod.z.object({
870
+ annotation: require_schema.AnnotationSchema,
871
+ appearance: AppearanceOutcomeSchema,
872
+ meta: AnnotationListMutationMetaSchema
873
+ });
874
+ const AnnotationDeleteResultSchema = zod.z.object({ meta: AnnotationListMutationMetaSchema });
875
+ /**
876
+ * Stable public component names for the annotation wire model, so an OpenAPI
877
+ * projection names each once (`Annotation`, not one type per response that
878
+ * carries one), like `PdfActionWireComponents`.
879
+ */
880
+ const AnnotationWireComponents = {
881
+ Annotation: require_schema.AnnotationSchema,
882
+ AnnotationRef: require_schema.AnnotationRefSchema,
883
+ AnnotationDraft: require_schema.AnnotationDraftSchema,
884
+ AnnotationPatch: require_schema.AnnotationPatchSchema,
885
+ PdfLinkTarget: require_schema.PdfLinkTargetSchema,
886
+ PdfLinkTargetWritable: require_schema.PdfLinkTargetWritableSchema,
887
+ AnnotationList: AnnotationListSchema,
888
+ AnnotationMutationMeta: AnnotationListMutationMetaSchema,
889
+ AnnotationPosition: AnnotationPositionSchema
890
+ };
891
+ /** What `page.annotations.reorder` takes on the wire. */
892
+ const AnnotationReorderBodySchema = zod.z.object({
893
+ refs: zod.z.array(require_schema.AnnotationRefSchema).min(1),
894
+ position: AnnotationPositionSchema
895
+ }).strict();
896
+ /** A stacking-order change: the page's annotations in their new order, as refs. */
897
+ const AnnotationReorderResultSchema = zod.z.object({
898
+ order: zod.z.array(require_schema.AnnotationRefSchema),
899
+ meta: AnnotationListMutationMetaSchema
900
+ });
901
+ /** A single-field write's meta: the envelope plus the fields and widgets it changed. */
902
+ const FormMutationMetaSchema = zod.z.object({
903
+ affectedPages: zod.z.array(require_schema.PageRefSchema),
904
+ cacheDelta: CacheDeltaSchema.nullable(),
905
+ opId: zod.z.string(),
906
+ undoable: zod.z.boolean(),
907
+ changedFields: zod.z.array(require_schema.FormFieldRefSchema),
908
+ changedWidgets: zod.z.array(require_schema.FormWidgetSchema),
909
+ redrawnWidgets: zod.z.array(require_schema.FormWidgetSchema)
910
+ });
911
+ /**
912
+ * Stable public component names for the form wire model, so an OpenAPI
913
+ * projection names each once (`FormField`, not one type per response that
914
+ * carries one), like `AnnotationWireComponents`.
915
+ */
916
+ const FormWireComponents = {
917
+ FormFieldRef: require_schema.FormFieldRefSchema,
918
+ FormField: require_schema.FormFieldDTOSchema,
919
+ FormFieldValue: require_schema.FormFieldValueSchema,
920
+ FormWidget: require_schema.FormWidgetSchema,
921
+ FormFieldDraft: require_schema.FormFieldDraftSchema,
922
+ FormFieldPatch: require_schema.FormFieldPatchSchema,
923
+ FieldPosition: FieldPositionSchema,
924
+ WidgetPlacement: require_schema.WidgetPlacementSchema,
925
+ WidgetAnnotation: require_schema.WidgetDTOSchema,
926
+ WidgetPatch: require_schema.WidgetPatchSchema,
927
+ FormMutationMeta: FormMutationMetaSchema
928
+ };
929
+ const FormSetValueResultSchema = zod.z.object({
930
+ field: require_schema.FormFieldDTOSchema,
931
+ widgets: zod.z.array(require_schema.WidgetDTOSchema),
932
+ meta: FormMutationMetaSchema
933
+ });
934
+ const FormResetResultSchema = zod.z.object({
935
+ fields: zod.z.array(require_schema.FormFieldDTOSchema),
936
+ widgets: zod.z.array(require_schema.WidgetDTOSchema),
937
+ meta: FormMutationMetaSchema
938
+ });
939
+ /** What `reset` takes on the wire: the fields to reset, or none for the whole form. */
940
+ const FormResetBodySchema = zod.z.object({ refs: zod.z.array(require_schema.FormFieldRefSchema).optional() }).strict();
941
+ /** What `updateWidget` takes on the wire: the widget patch (`PATCH …/form/widgets/{p}/{key}`). */
942
+ const FormWidgetUpdateBodySchema = zod.z.object({ patch: require_schema.WidgetPatchSchema }).strict();
943
+ const FormImportResultSchema = zod.z.object({
944
+ fields: zod.z.array(require_schema.FormFieldDTOSchema),
945
+ widgets: zod.z.array(require_schema.WidgetDTOSchema),
946
+ refMap: zod.z.array(zod.z.object({
947
+ from: require_schema.FormFieldRefSchema,
948
+ to: require_schema.FormFieldRefSchema
949
+ })),
950
+ dropped: zod.z.array(zod.z.object({
951
+ ref: require_schema.FormFieldRefSchema.nullable(),
952
+ widget: require_schema.AnnotationRefSchema.optional(),
953
+ field: zod.z.string().optional(),
954
+ reason: zod.z.enum([
955
+ "name-conflict",
956
+ "no-field",
957
+ "unsupported-family",
958
+ "script-not-allowed",
959
+ "unsupported-action"
960
+ ])
961
+ })),
962
+ calculationOrder: zod.z.array(require_schema.FormFieldRefSchema).optional(),
963
+ meta: FormMutationMetaSchema
964
+ });
965
+ const FormValuesImportResultSchema = zod.z.object({
966
+ fields: zod.z.array(require_schema.FormFieldDTOSchema),
967
+ widgets: zod.z.array(require_schema.WidgetDTOSchema),
968
+ dropped: zod.z.array(zod.z.object({
969
+ ref: require_schema.FormFieldRefSchema,
970
+ reason: zod.z.enum([
971
+ "no-field",
972
+ "wrong-family",
973
+ "value-not-allowed",
974
+ "locked",
975
+ "fill-not-allowed"
976
+ ])
977
+ })),
978
+ meta: FormMutationMetaSchema
979
+ });
980
+ const FormFieldCreateResultSchema = zod.z.object({
981
+ field: require_schema.FormFieldDTOSchema,
982
+ widgets: zod.z.array(require_schema.WidgetDTOSchema),
983
+ calculationOrder: zod.z.array(require_schema.FormFieldRefSchema).optional(),
984
+ meta: FormMutationMetaSchema
985
+ });
986
+ const FormFieldUpdateResultSchema = zod.z.object({
987
+ field: require_schema.FormFieldDTOSchema,
988
+ widgets: zod.z.array(require_schema.WidgetDTOSchema),
989
+ calculationOrder: zod.z.array(require_schema.FormFieldRefSchema).optional(),
990
+ meta: FormMutationMetaSchema
991
+ });
992
+ const FormWidgetUpdateResultSchema = zod.z.object({
993
+ widget: require_schema.WidgetDTOSchema,
994
+ appearance: AppearanceOutcomeSchema,
995
+ meta: FormMutationMetaSchema
996
+ });
997
+ /** What `forms.reorderWidgets` takes on the wire: the widgets of one page and where they go. */
998
+ const FormWidgetsReorderBodySchema = zod.z.object({
999
+ widgets: zod.z.array(require_schema.AnnotationRefSchema).min(1),
1000
+ position: AnnotationPositionSchema
1001
+ }).strict();
1002
+ /** A widget stacking-order change: the page's widgets in their new order, as refs. */
1003
+ const FormWidgetsReorderResultSchema = zod.z.object({
1004
+ page: require_schema.PageRefSchema,
1005
+ order: zod.z.array(require_schema.AnnotationRefSchema),
1006
+ meta: FormMutationMetaSchema
1007
+ });
1008
+ const FormFieldDeleteResultSchema = zod.z.object({
1009
+ calculationOrder: zod.z.array(require_schema.FormFieldRefSchema).optional(),
1010
+ meta: FormMutationMetaSchema
1011
+ });
1012
+ /** What `forms.reorderCalculations` takes on the wire: the fields and where they go. */
1013
+ const FormCalculationsReorderBodySchema = zod.z.object({
1014
+ fields: zod.z.array(require_schema.FormFieldRefSchema).min(1),
1015
+ position: FieldPositionSchema
1016
+ }).strict();
1017
+ /** A calculation-order change: the form's whole new order. */
1018
+ const FormCalculationsReorderResultSchema = zod.z.object({
1019
+ calculationOrder: zod.z.array(require_schema.FormFieldRefSchema),
1020
+ meta: FormMutationMetaSchema
1021
+ });
1022
+ const FormWidgetLinkResultSchema = zod.z.object({
1023
+ field: require_schema.FormFieldDTOSchema,
1024
+ widgets: zod.z.array(require_schema.WidgetDTOSchema),
1025
+ meta: FormMutationMetaSchema
1026
+ });
1027
+ const FormWidgetDeleteResultSchema = zod.z.object({
1028
+ widget: require_schema.AnnotationRefSchema,
1029
+ page: require_schema.PageRefSchema,
1030
+ field: require_schema.FormFieldDTOSchema.nullable(),
1031
+ meta: FormMutationMetaSchema
1032
+ });
1033
+ const FormWidgetRestoreResultSchema = zod.z.object({
1034
+ field: require_schema.FormFieldDTOSchema.nullable(),
1035
+ widgets: zod.z.array(require_schema.WidgetDTOSchema),
1036
+ meta: FormMutationMetaSchema
1037
+ });
1038
+ const FormRepairResultSchema = zod.z.object({
1039
+ acroformCreated: zod.z.boolean(),
1040
+ fieldsLinked: zod.z.number().int().nonnegative(),
1041
+ widgetsLinked: zod.z.number().int().nonnegative(),
1042
+ fieldsUnrepairable: zod.z.number().int().nonnegative(),
1043
+ appearancesBaked: zod.z.number().int().nonnegative(),
1044
+ needsAppearancesCleared: zod.z.boolean(),
1045
+ meta: MutationMetaSchema
1046
+ });
1047
+ /** A page's five boxes in page space: measured from the top-left of the crop box. */
1048
+ const PageBoxesSchema = zod.z.object({
1049
+ media: require_schema.PageBoxSchema,
1050
+ crop: require_schema.PageBoxSchema,
1051
+ bleed: require_schema.PageBoxSchema,
1052
+ trim: require_schema.PageBoxSchema,
1053
+ art: require_schema.PageBoxSchema
1054
+ });
1055
+ /**
1056
+ * Pure geometry for one page (`pages.list()` element). No annotation
1057
+ * liveness — that lives on annotation reads and the manifest.
1058
+ */
1059
+ const PageLayoutSchema = zod.z.object({
1060
+ index: zod.z.number().int().nonnegative(),
1061
+ ref: require_schema.PageRefSchema,
1062
+ label: zod.z.string().nullable(),
1063
+ size: require_schema.PdfSizeSchema,
1064
+ rotation: require_schema.PdfRotationSchema,
1065
+ userUnit: zod.z.number().positive(),
1066
+ tabOrder: zod.z.enum([
1067
+ "rows",
1068
+ "columns",
1069
+ "structure",
1070
+ "annotations",
1071
+ "widgets"
1072
+ ]).nullable(),
1073
+ boxes: PageBoxesSchema,
1074
+ pdfCropBox: require_schema.PdfRectSchema,
1075
+ actions: require_schema.PdfPageActionsSchema.optional()
1076
+ });
1077
+ const PageFlattenResultSchema = zod.z.object({
1078
+ pages: zod.z.array(require_schema.PageRefSchema),
1079
+ usage: zod.z.enum(["display", "print"]),
1080
+ results: zod.z.array(zod.z.object({
1081
+ page: require_schema.PageRefSchema,
1082
+ status: zod.z.enum(["applied", "unchanged"])
1083
+ })),
1084
+ meta: MutationMetaSchema
1085
+ });
1086
+ /** See `AnnotationFlattenResult`. */
1087
+ const AnnotationFlattenResultSchema = zod.z.object({
1088
+ page: require_schema.PageRefSchema,
1089
+ usage: zod.z.enum(["display", "print"]),
1090
+ results: zod.z.array(zod.z.object({
1091
+ ref: require_schema.AnnotationRefSchema,
1092
+ status: zod.z.enum(["applied", "unchanged"])
1093
+ })),
1094
+ meta: MutationMetaSchema
1095
+ });
1096
+ /** `annotations.flatten` input — see `AnnotationFlattenInput`. */
1097
+ const AnnotationFlattenInputSchema = zod.z.object({
1098
+ refs: zod.z.array(require_schema.AnnotationRefSchema).min(1),
1099
+ usage: zod.z.enum(["display", "print"])
1100
+ });
1101
+ /** `annotations.exportAppearance` input — see `AnnotationAppearanceExportInput`. */
1102
+ const AnnotationAppearanceExportInputSchema = zod.z.object({ refs: zod.z.array(require_schema.AnnotationRefSchema).min(1) });
1103
+ /** `doc.annotations.export` selection — see `AnnotationExportSelection`. */
1104
+ const AnnotationExportSelectionSchema = zod.z.object({
1105
+ refs: zod.z.array(require_schema.AnnotationRefSchema).optional(),
1106
+ pages: zod.z.array(require_schema.PageRefSchema).optional(),
1107
+ include: zod.z.enum(["references", "threads"]).optional()
1108
+ }).strict();
1109
+ /**
1110
+ * The body of a POST annotation export: the pins a GET's token carries and
1111
+ * the selection, for one a URL can't carry.
1112
+ */
1113
+ const AnnotationsExportRequestSchema = zod.z.object({
1114
+ annotationsVersion: zod.z.number().int().positive(),
1115
+ layoutVersion: zod.z.number().int().positive(),
1116
+ selection: AnnotationExportSelectionSchema
1117
+ }).strict();
1118
+ /** Where an import puts each page of a bundle — see `BundleImportPages`. */
1119
+ const BundleImportPagesSchema = zod.z.union([
1120
+ zod.z.literal("same"),
1121
+ zod.z.literal("by-position"),
1122
+ zod.z.array(zod.z.object({
1123
+ from: require_schema.PageRefSchema,
1124
+ to: require_schema.PageRefSchema
1125
+ }).strict())
1126
+ ]);
1127
+ /** `doc.forms.export` selection — see `FormExportSelection`. */
1128
+ const FormExportSelectionSchema = zod.z.object({
1129
+ fields: zod.z.array(require_schema.FormFieldRefSchema).optional(),
1130
+ pages: zod.z.array(require_schema.PageRefSchema).optional()
1131
+ }).strict();
1132
+ /**
1133
+ * The body of a POST form export: the pins a GET's token carries and the
1134
+ * selection, for one a URL can't carry.
1135
+ */
1136
+ const FormExportRequestSchema = zod.z.object({
1137
+ formsVersion: zod.z.number().int().positive(),
1138
+ layoutVersion: zod.z.number().int().positive(),
1139
+ selection: FormExportSelectionSchema
1140
+ }).strict();
1141
+ /** `doc.forms.import` options on the wire; the `opId` is the `Idempotency-Key` header. */
1142
+ const FormImportOptionsSchema = zod.z.object({
1143
+ pages: BundleImportPagesSchema.optional(),
1144
+ attribution: zod.z.enum(["restore", "stamp"]).optional(),
1145
+ values: zod.z.boolean().optional()
1146
+ }).strict();
1147
+ /** `doc.forms.importValues` options on the wire. */
1148
+ const FormValuesImportOptionsSchema = zod.z.object({ attribution: zod.z.enum(["restore", "stamp"]).optional() }).strict();
1149
+ /** A form bundle's envelope: its rows are the worker's to check, as an annotation bundle's. */
1150
+ const FormBundleEnvelopeSchema = zod.z.object({
1151
+ format: zod.z.literal("embedpdf/form"),
1152
+ version: zod.z.literal(1),
1153
+ pages: zod.z.array(zod.z.unknown()),
1154
+ fields: zod.z.array(zod.z.unknown()),
1155
+ widgets: zod.z.array(zod.z.unknown()),
1156
+ calculationOrder: zod.z.array(zod.z.unknown())
1157
+ }).strict();
1158
+ /** The `body` part of a form import request. */
1159
+ const FormImportBodySchema = zod.z.object({
1160
+ bundle: FormBundleEnvelopeSchema,
1161
+ options: FormImportOptionsSchema
1162
+ }).strict();
1163
+ /** The `body` part of a form values import request. */
1164
+ const FormValuesImportBodySchema = zod.z.object({
1165
+ bundle: FormBundleEnvelopeSchema,
1166
+ options: FormValuesImportOptionsSchema
1167
+ }).strict();
1168
+ /** `doc.annotations.import` options on the wire; the `opId` is the `Idempotency-Key` header. */
1169
+ const AnnotationImportOptionsSchema = zod.z.object({
1170
+ pages: BundleImportPagesSchema.optional(),
1171
+ attribution: zod.z.enum(["restore", "stamp"]).optional()
1172
+ }).strict();
1173
+ /**
1174
+ * The `body` part of an import request. Only its envelope is checked
1175
+ * here: the bundle's pages and items are the worker's to check, against the
1176
+ * limits and each kind's create schema.
1177
+ */
1178
+ const AnnotationImportBodySchema = zod.z.object({
1179
+ bundle: zod.z.object({
1180
+ format: zod.z.literal("embedpdf/annotations"),
1181
+ version: zod.z.literal(1),
1182
+ pages: zod.z.array(zod.z.unknown()),
1183
+ items: zod.z.array(zod.z.unknown())
1184
+ }).strict(),
1185
+ options: AnnotationImportOptionsSchema
1186
+ }).strict();
1187
+ const PageFlattenInputSchema = zod.z.object({
1188
+ pages: zod.z.array(require_schema.PageRefSchema),
1189
+ usage: zod.z.enum(["display", "print"])
1190
+ });
1191
+ /**
1192
+ * `{ pages }` or `{ annotations }`: one object with exactly one of the two,
1193
+ * so the wire has no untagged union (the API reference labels variants by a
1194
+ * discriminating literal, and a scope has none to add).
1195
+ */
1196
+ const RedactionApplyScopeSchema = zod.z.object({
1197
+ pages: zod.z.array(require_schema.PageRefSchema).optional(),
1198
+ annotations: zod.z.array(require_schema.AnnotationRefSchema).optional()
1199
+ }).strict().refine((scope) => scope.pages === void 0 !== (scope.annotations === void 0), { message: "exactly one of pages or annotations" });
1200
+ const RedactionApplyResultSchema = zod.z.object({
1201
+ scope: RedactionApplyScopeSchema,
1202
+ results: zod.z.array(zod.z.object({
1203
+ page: require_schema.PageRefSchema,
1204
+ status: zod.z.enum(["applied", "unchanged"]),
1205
+ removedAnnotationCount: zod.z.number().int().nonnegative()
1206
+ })),
1207
+ removedAnnotationCount: zod.z.number().int().nonnegative(),
1208
+ meta: MutationMetaSchema
1209
+ });
1210
+ /**
1211
+ * Snapshot of every page in display order. Pages are addressed by
1212
+ * `pageObjectNumber` everywhere except the per-element `index`, which is
1213
+ * display order and intentionally not an identity. Carries geometry only.
1214
+ */
1215
+ /** See `NamedPageEntry`: decoded key + what it resolves to. */
1216
+ const NamedPageEntrySchema = zod.z.object({
1217
+ name: zod.z.string(),
1218
+ target: zod.z.discriminatedUnion("kind", [
1219
+ zod.z.object({
1220
+ kind: zod.z.literal("page"),
1221
+ page: require_schema.PageRefSchema
1222
+ }),
1223
+ zod.z.object({
1224
+ kind: zod.z.literal("template"),
1225
+ objectNumber: zod.z.number().int().positive()
1226
+ }),
1227
+ zod.z.object({ kind: zod.z.literal("dangling") })
1228
+ ])
1229
+ });
1230
+ const PageListSnapshotSchema = zod.z.object({
1231
+ pageCount: zod.z.number().int().nonnegative(),
1232
+ pages: zod.z.array(PageLayoutSchema),
1233
+ namedPages: zod.z.array(NamedPageEntrySchema)
1234
+ });
1235
+ /** `pages.setName` input — see `PageNameInput`. */
1236
+ const PageNameInputSchema = zod.z.object({
1237
+ name: zod.z.string().min(1),
1238
+ page: require_schema.PageRefSchema,
1239
+ replace: zod.z.string().min(1).optional()
1240
+ });
1241
+ /** `pages.removeName` input — see `PageRemoveNameInput`. */
1242
+ const PageRemoveNameInputSchema = zod.z.object({ name: zod.z.string().min(1) });
1243
+ /** Page reorder input: the pages, in their new order, and where they go. */
1244
+ const PageReorderInputSchema = zod.z.object({
1245
+ pages: zod.z.array(require_schema.PageRefSchema).min(1),
1246
+ position: PagePositionSchema
1247
+ }).strict();
1248
+ /**
1249
+ * Page reorder result. No per-page revision is bumped (they survive a page
1250
+ * reorder). The whole new order is returned so callers swap their snapshot.
1251
+ */
1252
+ const PageReorderResultSchema = zod.z.object({
1253
+ pages: zod.z.array(require_schema.PageRefSchema),
1254
+ layout: PageListSnapshotSchema,
1255
+ meta: MutationMetaSchema
1256
+ });
1257
+ /** Named-page mutation result — layout-shaped, see `PageNameResult`. */
1258
+ const PageNameResultSchema = zod.z.object({
1259
+ layout: PageListSnapshotSchema,
1260
+ meta: MutationMetaSchema
1261
+ });
1262
+ /**
1263
+ * Page rotate input. Absolute rotation (idempotent — see `PageRotateInput`),
1264
+ * one value applied to every listed page.
1265
+ */
1266
+ const PageRotateInputSchema = zod.z.object({
1267
+ pages: zod.z.array(require_schema.PageRefSchema),
1268
+ rotation: require_schema.PdfRotationSchema
1269
+ });
1270
+ /**
1271
+ * Page rotate result. Rotation is presentation metadata over normalized
1272
+ * content: nothing per-page invalidates; the new `layout` carries the
1273
+ * rotation values (see `PageRotateResult`).
1274
+ */
1275
+ const PageRotateResultSchema = zod.z.object({
1276
+ layout: PageListSnapshotSchema,
1277
+ meta: MutationMetaSchema
1278
+ });
1279
+ /** Page delete input. Deleting every page is rejected server/worker-side. */
1280
+ const PageDeleteInputSchema = zod.z.object({ pages: zod.z.array(require_schema.PageRefSchema) });
1281
+ /**
1282
+ * Page delete result. Deleted page object numbers are retired (never recycled); surviving
1283
+ * pages keep identity + revisions (see `PageDeleteResult`).
1284
+ */
1285
+ const PageDeleteResultSchema = zod.z.object({
1286
+ layout: PageListSnapshotSchema,
1287
+ meta: MutationMetaSchema
1288
+ });
1289
+ /**
1290
+ * Page insert (bytes) input — the `body` part of the multipart envelope;
1291
+ * the PDF rides the part `resources.source` names. `position` omitted →
1292
+ * `'end'`.
1293
+ */
1294
+ const PageInsertInputSchema = zod.z.object({
1295
+ position: PagePositionSchema.optional(),
1296
+ resources: require_schema.SourceResourceKeysSchema
1297
+ }).strict();
1298
+ /**
1299
+ * Blank-page insert input — plain JSON, pages.insert minus the bytes.
1300
+ * `size` is in PDF points (un-rotated); `count` shares the contract cap
1301
+ * with the worker so a request the schema accepts cannot then fail the
1302
+ * worker's own guard.
1303
+ */
1304
+ const PageInsertBlankInputSchema = zod.z.object({
1305
+ size: zod.z.object({
1306
+ width: zod.z.number().positive().finite(),
1307
+ height: zod.z.number().positive().finite()
1308
+ }),
1309
+ count: zod.z.number().int().min(1).max(100).optional(),
1310
+ position: PagePositionSchema.optional()
1311
+ });
1312
+ /** Page extract input: the pages to export, in the order they should appear. */
1313
+ const PageExtractInputSchema = zod.z.object({ pages: zod.z.array(require_schema.PageRefSchema).min(1) });
1314
+ /**
1315
+ * Page insert result — shared by bytes-insert and blank-insert: the fresh
1316
+ * page object numbers in insertion order plus the full new layout (see `PageInsertResult`).
1317
+ */
1318
+ const PageInsertResultSchema = zod.z.object({
1319
+ insertedPages: zod.z.array(require_schema.PageRefSchema),
1320
+ layout: PageListSnapshotSchema,
1321
+ meta: MutationMetaSchema
1322
+ });
1323
+ /** See `AttachmentMutationMeta`. */
1324
+ const AttachmentMutationMetaSchema = zod.z.object({
1325
+ affectedPages: zod.z.array(require_schema.PageRefSchema),
1326
+ cacheDelta: CacheDeltaSchema.nullable(),
1327
+ opId: zod.z.string(),
1328
+ undoable: zod.z.boolean(),
1329
+ changed: zod.z.array(require_schema.AttachmentRefSchema)
1330
+ });
1331
+ const AttachmentCreateResultSchema = zod.z.object({
1332
+ attachment: require_schema.AttachmentSchema,
1333
+ meta: AttachmentMutationMetaSchema
1334
+ });
1335
+ const AttachmentDeleteResultSchema = zod.z.object({ meta: AttachmentMutationMetaSchema });
1336
+ /** See `AttachmentList`. */
1337
+ const AttachmentListSchema = zod.z.object({ attachments: zod.z.array(require_schema.AttachmentSchema) });
1338
+ /**
1339
+ * Metadata write result: the re-read `metadata`. On the cloud,
1340
+ * `meta.cacheDelta` advances only `docVersion` and `metadataVersion`.
1341
+ */
1342
+ const MetadataUpdateResultSchema = zod.z.object({
1343
+ metadata: DocumentMetadataSchema,
1344
+ meta: MutationMetaSchema
1345
+ });
1346
+ const CustomMetadataUpdateResultSchema = zod.z.object({
1347
+ custom: CustomMetadataSchema,
1348
+ meta: MutationMetaSchema
1349
+ });
1350
+ const Base64Schema = zod.z.string().regex(/^[A-Za-z0-9+/]*={0,2}$/, "base64");
1351
+ const DocumentVersionRefSchema = zod.z.object({
1352
+ baseSha256: zod.z.string().regex(/^[0-9a-f]{64}$/),
1353
+ editsVersion: zod.z.number().int().nonnegative()
1354
+ });
1355
+ const ByteRangeSchema = zod.z.tuple([
1356
+ zod.z.number().int().nonnegative(),
1357
+ zod.z.number().int().nonnegative(),
1358
+ zod.z.number().int().nonnegative(),
1359
+ zod.z.number().int().nonnegative()
1360
+ ]);
1361
+ /** `SignaturePrepared` with the digest as base64. */
1362
+ const SignaturePreparedWireSchema = zod.z.object({
1363
+ signingId: zod.z.string().min(1),
1364
+ digest: Base64Schema,
1365
+ algorithm: zod.z.enum([
1366
+ "sha256",
1367
+ "sha384",
1368
+ "sha512"
1369
+ ]),
1370
+ byteRange: ByteRangeSchema,
1371
+ contentsSize: zod.z.number().int().positive(),
1372
+ subFilter: zod.z.string(),
1373
+ expectedVersion: DocumentVersionRefSchema,
1374
+ expiresAt: zod.z.string().nullable()
1375
+ });
1376
+ function encodePrepared(prepared) {
1377
+ return {
1378
+ ...prepared,
1379
+ digest: require_charmap.toBase64(prepared.digest)
1380
+ };
1381
+ }
1382
+ function decodePrepared(wire) {
1383
+ return {
1384
+ ...wire,
1385
+ digest: require_charmap.fromBase64(wire.digest),
1386
+ subFilter: wire.subFilter
1387
+ };
1388
+ }
1389
+ /** The JSON body of a completion: the CMS as base64 beside the fence. */
1390
+ const SignatureCompleteBodySchema = zod.z.object({
1391
+ cms: Base64Schema.refine((v) => v.length > 0, "cms is required"),
1392
+ expectedVersion: DocumentVersionRefSchema
1393
+ });
1394
+ const DocMdpPermissionSchema = zod.z.union([
1395
+ zod.z.literal(1),
1396
+ zod.z.literal(2),
1397
+ zod.z.literal(3)
1398
+ ]);
1399
+ const ModificationLevelSchema = zod.z.enum([
1400
+ "none",
1401
+ "lta",
1402
+ "fill",
1403
+ "annotate"
1404
+ ]);
1405
+ const DigestAlgorithmSchema = zod.z.enum([
1406
+ "sha1",
1407
+ "sha256",
1408
+ "sha384",
1409
+ "sha512"
1410
+ ]);
1411
+ const FieldLockSpecSchema = zod.z.object({
1412
+ action: zod.z.enum([
1413
+ "all",
1414
+ "include",
1415
+ "exclude"
1416
+ ]),
1417
+ fields: zod.z.array(zod.z.string()),
1418
+ permission: DocMdpPermissionSchema.optional()
1419
+ });
1420
+ const SignatureSeedValueSchema = zod.z.object({
1421
+ requiredFlags: zod.z.number().int(),
1422
+ presentFlags: zod.z.number().int(),
1423
+ version: zod.z.number().int().nullable(),
1424
+ mdp: zod.z.union([
1425
+ zod.z.literal(0),
1426
+ zod.z.literal(1),
1427
+ zod.z.literal(2),
1428
+ zod.z.literal(3)
1429
+ ]).nullable(),
1430
+ filter: zod.z.string().nullable(),
1431
+ subFilters: zod.z.array(zod.z.string()),
1432
+ digestMethods: zod.z.array(zod.z.string()),
1433
+ reasons: zod.z.array(zod.z.string()),
1434
+ unsupportedRequired: zod.z.boolean()
1435
+ });
1436
+ const SignatureDTOSchema = zod.z.object({
1437
+ index: zod.z.number().int().nonnegative(),
1438
+ field: require_schema.FormFieldRefSchema,
1439
+ fieldName: zod.z.string(),
1440
+ widget: require_schema.FormFieldWidgetSchema.nullable(),
1441
+ signed: zod.z.boolean(),
1442
+ kind: zod.z.enum(["signature", "timestamp"]),
1443
+ filter: zod.z.string().nullable(),
1444
+ subFilter: zod.z.string().nullable(),
1445
+ byteRange: ByteRangeSchema.nullable(),
1446
+ contentsSize: zod.z.number().int().nonnegative(),
1447
+ coverage: zod.z.enum([
1448
+ "whole-revision",
1449
+ "partial",
1450
+ "malformed"
1451
+ ]).nullable(),
1452
+ revisionIndex: zod.z.number().int().nonnegative().nullable(),
1453
+ signer: zod.z.object({
1454
+ name: zod.z.string().nullable(),
1455
+ reason: zod.z.string().nullable(),
1456
+ location: zod.z.string().nullable(),
1457
+ contactInfo: zod.z.string().nullable(),
1458
+ signedAt: require_schema.IsoDateTimeSchema.nullable()
1459
+ }),
1460
+ docMdp: DocMdpPermissionSchema.nullable(),
1461
+ catalogCertification: zod.z.boolean(),
1462
+ fieldMdp: FieldLockSpecSchema.nullable(),
1463
+ lock: FieldLockSpecSchema.nullable(),
1464
+ seedValue: SignatureSeedValueSchema.nullable()
1465
+ });
1466
+ const DocumentProtectionSchema = zod.z.object({
1467
+ enforced: ModificationLevelSchema.nullable(),
1468
+ judged: ModificationLevelSchema.nullable(),
1469
+ certification: zod.z.object({
1470
+ signatureIndex: zod.z.number().int().nonnegative(),
1471
+ permission: DocMdpPermissionSchema
1472
+ }).nullable(),
1473
+ fieldLocks: zod.z.array(zod.z.object({
1474
+ signatureIndex: zod.z.number().int().nonnegative(),
1475
+ source: zod.z.enum(["fieldmdp", "lock"]),
1476
+ spec: FieldLockSpecSchema
1477
+ })),
1478
+ policyVersion: zod.z.number().int()
1479
+ });
1480
+ const PdfRevisionSchema = zod.z.object({
1481
+ index: zod.z.number().int().nonnegative(),
1482
+ end: zod.z.number().int().nonnegative(),
1483
+ xrefOffset: zod.z.number().int().nonnegative(),
1484
+ signatureIndex: zod.z.number().int().nonnegative().nullable()
1485
+ });
1486
+ const SignatureSnapshotSchema = zod.z.object({
1487
+ chainValid: zod.z.boolean(),
1488
+ revisions: zod.z.array(PdfRevisionSchema),
1489
+ signatures: zod.z.array(SignatureDTOSchema),
1490
+ protection: DocumentProtectionSchema
1491
+ });
1492
+ const BaseVersionInfoSchema = zod.z.object({
1493
+ sha256: zod.z.string().regex(/^[0-9a-f]{64}$/),
1494
+ byteLength: zod.z.number().int().nonnegative()
1495
+ });
1496
+ const SignatureCompleteResultSchema = zod.z.object({
1497
+ status: zod.z.enum(["completed", "already-completed"]),
1498
+ signature: SignatureDTOSchema,
1499
+ version: BaseVersionInfoSchema,
1500
+ previous: DocumentVersionRefSchema,
1501
+ protection: DocumentProtectionSchema,
1502
+ meta: MutationMetaSchema
1503
+ });
1504
+ const SignatureCancelResultSchema = zod.z.object({ status: zod.z.enum([
1505
+ "cancelled",
1506
+ "already-completed",
1507
+ "unknown"
1508
+ ]) });
1509
+ const ChangeFindingSchema = zod.z.object({
1510
+ rule: zod.z.string(),
1511
+ verdict: zod.z.enum([
1512
+ "permitted",
1513
+ "forbidden",
1514
+ "incomplete"
1515
+ ]),
1516
+ objectNumber: zod.z.number().int().nonnegative(),
1517
+ edge: zod.z.string().optional(),
1518
+ detail: zod.z.string().optional()
1519
+ });
1520
+ const AnalysisDetailSchema = zod.z.enum(["summary", "full"]);
1521
+ /** The analysis: one verdict (`current`) with its findings, the restrictions it was judged under, and facts about the revisions in between. */
1522
+ const ChangeAnalysisSchema = zod.z.object({
1523
+ mode: zod.z.enum(["authoritative", "exploratory"]),
1524
+ policyVersion: zod.z.number().int(),
1525
+ basis: zod.z.object({
1526
+ version: BaseVersionInfoSchema,
1527
+ editsVersion: zod.z.number().int().nonnegative(),
1528
+ source: zod.z.enum(["persisted", "working-copy"])
1529
+ }),
1530
+ since: zod.z.object({
1531
+ revisionIndex: zod.z.number().int().nonnegative(),
1532
+ signatureIndex: zod.z.number().int().nonnegative().nullable()
1533
+ }),
1534
+ until: zod.z.object({ revisionIndex: zod.z.number().int().nonnegative() }),
1535
+ restrictions: zod.z.array(zod.z.object({
1536
+ signatureIndex: zod.z.number().int().nonnegative(),
1537
+ revisionIndex: zod.z.number().int().nonnegative(),
1538
+ source: zod.z.enum([
1539
+ "docmdp",
1540
+ "fieldmdp",
1541
+ "lock"
1542
+ ]),
1543
+ own: zod.z.boolean(),
1544
+ permission: zod.z.union([
1545
+ zod.z.literal(1),
1546
+ zod.z.literal(2),
1547
+ zod.z.literal(3)
1548
+ ]).optional(),
1549
+ fields: zod.z.unknown().optional()
1550
+ })),
1551
+ current: zod.z.object({
1552
+ verdict: zod.z.enum([
1553
+ "unchanged",
1554
+ "permitted",
1555
+ "forbidden",
1556
+ "indeterminate"
1557
+ ]),
1558
+ complete: zod.z.boolean(),
1559
+ primary: ChangeFindingSchema.optional(),
1560
+ findings: zod.z.array(ChangeFindingSchema),
1561
+ method: zod.z.enum(["net-state", "net-state+replay"])
1562
+ }),
1563
+ later: zod.z.object({
1564
+ revisionCount: zod.z.number().int().nonnegative(),
1565
+ undoneObjectNumbers: zod.z.array(zod.z.number().int().nonnegative())
1566
+ }),
1567
+ /** Equals `current.verdict`. */
1568
+ verdict: zod.z.enum([
1569
+ "unchanged",
1570
+ "permitted",
1571
+ "forbidden",
1572
+ "indeterminate"
1573
+ ]),
1574
+ /** The step DTOs are large and evolving; carried verbatim. */
1575
+ steps: zod.z.array(zod.z.unknown())
1576
+ });
1577
+ const SignatureSignerInputSchema = zod.z.object({
1578
+ name: zod.z.string().optional(),
1579
+ reason: zod.z.string().optional(),
1580
+ location: zod.z.string().optional(),
1581
+ contactInfo: zod.z.string().optional(),
1582
+ signedAt: require_schema.IsoDateTimeSchema.optional()
1583
+ });
1584
+ /** The `body` part of a visual signature fill: which part holds the one-page PDF. */
1585
+ const SignatureAppearanceBodySchema = zod.z.object({ resources: require_schema.AppearanceResourceKeysSchema });
1586
+ /**
1587
+ * The `body` part of a prepare: `SignaturePrepareInput` with the
1588
+ * appearance artwork named by the key of its part instead of inline bytes.
1589
+ */
1590
+ const SignaturePrepareBodySchema = zod.z.object({
1591
+ field: require_schema.FormFieldRefSchema,
1592
+ kind: zod.z.enum(["signature", "timestamp"]).optional(),
1593
+ subFilter: zod.z.enum(["adbe.pkcs7.detached", "ETSI.CAdES.detached"]).optional(),
1594
+ digest: zod.z.enum([
1595
+ "sha256",
1596
+ "sha384",
1597
+ "sha512"
1598
+ ]).optional(),
1599
+ contentsSize: zod.z.number().int().positive().optional(),
1600
+ signer: SignatureSignerInputSchema.optional(),
1601
+ certify: zod.z.object({ permission: DocMdpPermissionSchema }).optional(),
1602
+ lock: FieldLockSpecSchema.optional(),
1603
+ resources: require_schema.AppearanceResourceKeysSchema.optional()
1604
+ });
1605
+ const optionalIndex = zod.z.coerce.number().int().nonnegative().optional();
1606
+ /** Layer analysis query (the current form): exactly one `since.*`; the working copy is the end. */
1607
+ const LayerAnalysisQuerySchema = zod.z.object({
1608
+ "since.signature": optionalIndex,
1609
+ "since.revision": optionalIndex,
1610
+ level: ModificationLevelSchema.optional(),
1611
+ detail: AnalysisDetailSchema.optional()
1612
+ }).refine((q) => q["since.signature"] === void 0 !== (q["since.revision"] === void 0), { message: "exactly one of since.signature / since.revision is required" });
1613
+ /** Version analysis query: as the layer's, plus `until` (a revision index; default the last). */
1614
+ const VersionAnalysisQuerySchema = zod.z.object({
1615
+ "since.signature": optionalIndex,
1616
+ "since.revision": optionalIndex,
1617
+ until: optionalIndex,
1618
+ level: ModificationLevelSchema.optional(),
1619
+ detail: AnalysisDetailSchema.optional(),
1620
+ /** The judging policy version the caller expects — a cache key, not an input (version responses are immutable). */
1621
+ policy: optionalIndex
1622
+ }).refine((q) => q["since.signature"] === void 0 !== (q["since.revision"] === void 0), { message: "exactly one of since.signature / since.revision is required" });
1623
+ function analyzeInputFromQuery(query, until) {
1624
+ return {
1625
+ since: query["since.signature"] !== void 0 ? { signatureIndex: query["since.signature"] } : { revisionIndex: query["since.revision"] ?? 0 },
1626
+ ...until !== void 0 ? { until } : {},
1627
+ ...query.level !== void 0 ? { exploratoryLevel: query.level } : {},
1628
+ ...query.detail !== void 0 ? { detail: query.detail } : {}
1629
+ };
1630
+ }
1631
+ /** One row of the document's version catalog. */
1632
+ const DocumentVersionSchema = zod.z.object({
1633
+ sha256: zod.z.string().regex(/^[0-9a-f]{64}$/),
1634
+ byteLength: zod.z.number().int().nonnegative(),
1635
+ number: zod.z.number().int().positive(),
1636
+ parentSha256: zod.z.string().nullable(),
1637
+ producer: zod.z.enum(["upload", "signature"]),
1638
+ signingId: zod.z.string().nullable(),
1639
+ createdAt: zod.z.number().int()
1640
+ });
1641
+ const DocumentVersionsSchema = zod.z.object({
1642
+ /** `documents.base_sha`: the version every layer is over, or behind. */
1643
+ head: zod.z.string().regex(/^[0-9a-f]{64}$/),
1644
+ /** Oldest first. */
1645
+ versions: zod.z.array(DocumentVersionSchema)
1646
+ });
1647
+ const PageScaleResultSchema = zod.z.object({
1648
+ page: require_schema.PageRefSchema,
1649
+ meta: MutationMetaSchema
1650
+ });
1651
+ //#endregion
1652
+ Object.defineProperty(exports, "AccessRequestSchema", {
1653
+ enumerable: true,
1654
+ get: function() {
1655
+ return AccessRequestSchema;
1656
+ }
1657
+ });
1658
+ Object.defineProperty(exports, "AccessResponseSchema", {
1659
+ enumerable: true,
1660
+ get: function() {
1661
+ return AccessResponseSchema;
1662
+ }
1663
+ });
1664
+ Object.defineProperty(exports, "AnnotationAppearanceBatchSchema", {
1665
+ enumerable: true,
1666
+ get: function() {
1667
+ return AnnotationAppearanceBatchSchema;
1668
+ }
1669
+ });
1670
+ Object.defineProperty(exports, "AnnotationAppearanceExportInputSchema", {
1671
+ enumerable: true,
1672
+ get: function() {
1673
+ return AnnotationAppearanceExportInputSchema;
1674
+ }
1675
+ });
1676
+ Object.defineProperty(exports, "AnnotationAppearancesQuerySchema", {
1677
+ enumerable: true,
1678
+ get: function() {
1679
+ return AnnotationAppearancesQuerySchema;
1680
+ }
1681
+ });
1682
+ Object.defineProperty(exports, "AnnotationCreateResultSchema", {
1683
+ enumerable: true,
1684
+ get: function() {
1685
+ return AnnotationCreateResultSchema;
1686
+ }
1687
+ });
1688
+ Object.defineProperty(exports, "AnnotationDeleteResultSchema", {
1689
+ enumerable: true,
1690
+ get: function() {
1691
+ return AnnotationDeleteResultSchema;
1692
+ }
1693
+ });
1694
+ Object.defineProperty(exports, "AnnotationExportSelectionSchema", {
1695
+ enumerable: true,
1696
+ get: function() {
1697
+ return AnnotationExportSelectionSchema;
1698
+ }
1699
+ });
1700
+ Object.defineProperty(exports, "AnnotationFlattenInputSchema", {
1701
+ enumerable: true,
1702
+ get: function() {
1703
+ return AnnotationFlattenInputSchema;
1704
+ }
1705
+ });
1706
+ Object.defineProperty(exports, "AnnotationFlattenResultSchema", {
1707
+ enumerable: true,
1708
+ get: function() {
1709
+ return AnnotationFlattenResultSchema;
1710
+ }
1711
+ });
1712
+ Object.defineProperty(exports, "AnnotationImportBodySchema", {
1713
+ enumerable: true,
1714
+ get: function() {
1715
+ return AnnotationImportBodySchema;
1716
+ }
1717
+ });
1718
+ Object.defineProperty(exports, "AnnotationImportOptionsSchema", {
1719
+ enumerable: true,
1720
+ get: function() {
1721
+ return AnnotationImportOptionsSchema;
1722
+ }
1723
+ });
1724
+ Object.defineProperty(exports, "AnnotationImportResultSchema", {
1725
+ enumerable: true,
1726
+ get: function() {
1727
+ return AnnotationImportResultSchema;
1728
+ }
1729
+ });
1730
+ Object.defineProperty(exports, "AnnotationListMutationMetaSchema", {
1731
+ enumerable: true,
1732
+ get: function() {
1733
+ return AnnotationListMutationMetaSchema;
1734
+ }
1735
+ });
1736
+ Object.defineProperty(exports, "AnnotationListSchema", {
1737
+ enumerable: true,
1738
+ get: function() {
1739
+ return AnnotationListSchema;
1740
+ }
1741
+ });
1742
+ Object.defineProperty(exports, "AnnotationPositionSchema", {
1743
+ enumerable: true,
1744
+ get: function() {
1745
+ return AnnotationPositionSchema;
1746
+ }
1747
+ });
1748
+ Object.defineProperty(exports, "AnnotationReorderBodySchema", {
1749
+ enumerable: true,
1750
+ get: function() {
1751
+ return AnnotationReorderBodySchema;
1752
+ }
1753
+ });
1754
+ Object.defineProperty(exports, "AnnotationReorderResultSchema", {
1755
+ enumerable: true,
1756
+ get: function() {
1757
+ return AnnotationReorderResultSchema;
1758
+ }
1759
+ });
1760
+ Object.defineProperty(exports, "AnnotationUpdateResultSchema", {
1761
+ enumerable: true,
1762
+ get: function() {
1763
+ return AnnotationUpdateResultSchema;
1764
+ }
1765
+ });
1766
+ Object.defineProperty(exports, "AnnotationWireComponents", {
1767
+ enumerable: true,
1768
+ get: function() {
1769
+ return AnnotationWireComponents;
1770
+ }
1771
+ });
1772
+ Object.defineProperty(exports, "AnnotationsExportRequestSchema", {
1773
+ enumerable: true,
1774
+ get: function() {
1775
+ return AnnotationsExportRequestSchema;
1776
+ }
1777
+ });
1778
+ Object.defineProperty(exports, "AppearanceOutcomeSchema", {
1779
+ enumerable: true,
1780
+ get: function() {
1781
+ return AppearanceOutcomeSchema;
1782
+ }
1783
+ });
1784
+ Object.defineProperty(exports, "AttachmentCreateResultSchema", {
1785
+ enumerable: true,
1786
+ get: function() {
1787
+ return AttachmentCreateResultSchema;
1788
+ }
1789
+ });
1790
+ Object.defineProperty(exports, "AttachmentDeleteResultSchema", {
1791
+ enumerable: true,
1792
+ get: function() {
1793
+ return AttachmentDeleteResultSchema;
1794
+ }
1795
+ });
1796
+ Object.defineProperty(exports, "AttachmentListSchema", {
1797
+ enumerable: true,
1798
+ get: function() {
1799
+ return AttachmentListSchema;
1800
+ }
1801
+ });
1802
+ Object.defineProperty(exports, "AttachmentMutationMetaSchema", {
1803
+ enumerable: true,
1804
+ get: function() {
1805
+ return AttachmentMutationMetaSchema;
1806
+ }
1807
+ });
1808
+ Object.defineProperty(exports, "BaseVersionInfoSchema", {
1809
+ enumerable: true,
1810
+ get: function() {
1811
+ return BaseVersionInfoSchema;
1812
+ }
1813
+ });
1814
+ Object.defineProperty(exports, "BundleLimitsSchema", {
1815
+ enumerable: true,
1816
+ get: function() {
1817
+ return BundleLimitsSchema;
1818
+ }
1819
+ });
1820
+ Object.defineProperty(exports, "ByteRangeSchema", {
1821
+ enumerable: true,
1822
+ get: function() {
1823
+ return ByteRangeSchema;
1824
+ }
1825
+ });
1826
+ Object.defineProperty(exports, "CacheDeltaSchema", {
1827
+ enumerable: true,
1828
+ get: function() {
1829
+ return CacheDeltaSchema;
1830
+ }
1831
+ });
1832
+ Object.defineProperty(exports, "CachePinsSchema", {
1833
+ enumerable: true,
1834
+ get: function() {
1835
+ return CachePinsSchema;
1836
+ }
1837
+ });
1838
+ Object.defineProperty(exports, "ChangeAnalysisSchema", {
1839
+ enumerable: true,
1840
+ get: function() {
1841
+ return ChangeAnalysisSchema;
1842
+ }
1843
+ });
1844
+ Object.defineProperty(exports, "CustomMetadataPatchSchema", {
1845
+ enumerable: true,
1846
+ get: function() {
1847
+ return CustomMetadataPatchSchema;
1848
+ }
1849
+ });
1850
+ Object.defineProperty(exports, "CustomMetadataSchema", {
1851
+ enumerable: true,
1852
+ get: function() {
1853
+ return CustomMetadataSchema;
1854
+ }
1855
+ });
1856
+ Object.defineProperty(exports, "CustomMetadataUpdateResultSchema", {
1857
+ enumerable: true,
1858
+ get: function() {
1859
+ return CustomMetadataUpdateResultSchema;
1860
+ }
1861
+ });
1862
+ Object.defineProperty(exports, "DigestAlgorithmSchema", {
1863
+ enumerable: true,
1864
+ get: function() {
1865
+ return DigestAlgorithmSchema;
1866
+ }
1867
+ });
1868
+ Object.defineProperty(exports, "DocumentHeadSchema", {
1869
+ enumerable: true,
1870
+ get: function() {
1871
+ return DocumentHeadSchema;
1872
+ }
1873
+ });
1874
+ Object.defineProperty(exports, "DocumentManifestSchema", {
1875
+ enumerable: true,
1876
+ get: function() {
1877
+ return DocumentManifestSchema;
1878
+ }
1879
+ });
1880
+ Object.defineProperty(exports, "DocumentMetadataSchema", {
1881
+ enumerable: true,
1882
+ get: function() {
1883
+ return DocumentMetadataSchema;
1884
+ }
1885
+ });
1886
+ Object.defineProperty(exports, "DocumentProtectionSchema", {
1887
+ enumerable: true,
1888
+ get: function() {
1889
+ return DocumentProtectionSchema;
1890
+ }
1891
+ });
1892
+ Object.defineProperty(exports, "DocumentSecurityStateSchema", {
1893
+ enumerable: true,
1894
+ get: function() {
1895
+ return DocumentSecurityStateSchema;
1896
+ }
1897
+ });
1898
+ Object.defineProperty(exports, "DocumentVersionRefSchema", {
1899
+ enumerable: true,
1900
+ get: function() {
1901
+ return DocumentVersionRefSchema;
1902
+ }
1903
+ });
1904
+ Object.defineProperty(exports, "DocumentVersionSchema", {
1905
+ enumerable: true,
1906
+ get: function() {
1907
+ return DocumentVersionSchema;
1908
+ }
1909
+ });
1910
+ Object.defineProperty(exports, "DocumentVersionsSchema", {
1911
+ enumerable: true,
1912
+ get: function() {
1913
+ return DocumentVersionsSchema;
1914
+ }
1915
+ });
1916
+ Object.defineProperty(exports, "DocumentWireComponents", {
1917
+ enumerable: true,
1918
+ get: function() {
1919
+ return DocumentWireComponents;
1920
+ }
1921
+ });
1922
+ Object.defineProperty(exports, "EditSessionAccessSchema", {
1923
+ enumerable: true,
1924
+ get: function() {
1925
+ return EditSessionAccessSchema;
1926
+ }
1927
+ });
1928
+ Object.defineProperty(exports, "EditSessionStatusSchema", {
1929
+ enumerable: true,
1930
+ get: function() {
1931
+ return EditSessionStatusSchema;
1932
+ }
1933
+ });
1934
+ Object.defineProperty(exports, "EngineErrorPayloadSchema", {
1935
+ enumerable: true,
1936
+ get: function() {
1937
+ return EngineErrorPayloadSchema;
1938
+ }
1939
+ });
1940
+ Object.defineProperty(exports, "FieldLockSpecSchema", {
1941
+ enumerable: true,
1942
+ get: function() {
1943
+ return FieldLockSpecSchema;
1944
+ }
1945
+ });
1946
+ Object.defineProperty(exports, "FieldPositionSchema", {
1947
+ enumerable: true,
1948
+ get: function() {
1949
+ return FieldPositionSchema;
1950
+ }
1951
+ });
1952
+ Object.defineProperty(exports, "FormCalculationsReorderBodySchema", {
1953
+ enumerable: true,
1954
+ get: function() {
1955
+ return FormCalculationsReorderBodySchema;
1956
+ }
1957
+ });
1958
+ Object.defineProperty(exports, "FormCalculationsReorderResultSchema", {
1959
+ enumerable: true,
1960
+ get: function() {
1961
+ return FormCalculationsReorderResultSchema;
1962
+ }
1963
+ });
1964
+ Object.defineProperty(exports, "FormExportRequestSchema", {
1965
+ enumerable: true,
1966
+ get: function() {
1967
+ return FormExportRequestSchema;
1968
+ }
1969
+ });
1970
+ Object.defineProperty(exports, "FormExportSelectionSchema", {
1971
+ enumerable: true,
1972
+ get: function() {
1973
+ return FormExportSelectionSchema;
1974
+ }
1975
+ });
1976
+ Object.defineProperty(exports, "FormFieldCreateResultSchema", {
1977
+ enumerable: true,
1978
+ get: function() {
1979
+ return FormFieldCreateResultSchema;
1980
+ }
1981
+ });
1982
+ Object.defineProperty(exports, "FormFieldDeleteResultSchema", {
1983
+ enumerable: true,
1984
+ get: function() {
1985
+ return FormFieldDeleteResultSchema;
1986
+ }
1987
+ });
1988
+ Object.defineProperty(exports, "FormFieldUpdateResultSchema", {
1989
+ enumerable: true,
1990
+ get: function() {
1991
+ return FormFieldUpdateResultSchema;
1992
+ }
1993
+ });
1994
+ Object.defineProperty(exports, "FormImportBodySchema", {
1995
+ enumerable: true,
1996
+ get: function() {
1997
+ return FormImportBodySchema;
1998
+ }
1999
+ });
2000
+ Object.defineProperty(exports, "FormImportOptionsSchema", {
2001
+ enumerable: true,
2002
+ get: function() {
2003
+ return FormImportOptionsSchema;
2004
+ }
2005
+ });
2006
+ Object.defineProperty(exports, "FormImportResultSchema", {
2007
+ enumerable: true,
2008
+ get: function() {
2009
+ return FormImportResultSchema;
2010
+ }
2011
+ });
2012
+ Object.defineProperty(exports, "FormMutationMetaSchema", {
2013
+ enumerable: true,
2014
+ get: function() {
2015
+ return FormMutationMetaSchema;
2016
+ }
2017
+ });
2018
+ Object.defineProperty(exports, "FormRepairResultSchema", {
2019
+ enumerable: true,
2020
+ get: function() {
2021
+ return FormRepairResultSchema;
2022
+ }
2023
+ });
2024
+ Object.defineProperty(exports, "FormResetBodySchema", {
2025
+ enumerable: true,
2026
+ get: function() {
2027
+ return FormResetBodySchema;
2028
+ }
2029
+ });
2030
+ Object.defineProperty(exports, "FormResetResultSchema", {
2031
+ enumerable: true,
2032
+ get: function() {
2033
+ return FormResetResultSchema;
2034
+ }
2035
+ });
2036
+ Object.defineProperty(exports, "FormSetValueResultSchema", {
2037
+ enumerable: true,
2038
+ get: function() {
2039
+ return FormSetValueResultSchema;
2040
+ }
2041
+ });
2042
+ Object.defineProperty(exports, "FormValuesImportBodySchema", {
2043
+ enumerable: true,
2044
+ get: function() {
2045
+ return FormValuesImportBodySchema;
2046
+ }
2047
+ });
2048
+ Object.defineProperty(exports, "FormValuesImportOptionsSchema", {
2049
+ enumerable: true,
2050
+ get: function() {
2051
+ return FormValuesImportOptionsSchema;
2052
+ }
2053
+ });
2054
+ Object.defineProperty(exports, "FormValuesImportResultSchema", {
2055
+ enumerable: true,
2056
+ get: function() {
2057
+ return FormValuesImportResultSchema;
2058
+ }
2059
+ });
2060
+ Object.defineProperty(exports, "FormWidgetDeleteResultSchema", {
2061
+ enumerable: true,
2062
+ get: function() {
2063
+ return FormWidgetDeleteResultSchema;
2064
+ }
2065
+ });
2066
+ Object.defineProperty(exports, "FormWidgetLinkResultSchema", {
2067
+ enumerable: true,
2068
+ get: function() {
2069
+ return FormWidgetLinkResultSchema;
2070
+ }
2071
+ });
2072
+ Object.defineProperty(exports, "FormWidgetRestoreResultSchema", {
2073
+ enumerable: true,
2074
+ get: function() {
2075
+ return FormWidgetRestoreResultSchema;
2076
+ }
2077
+ });
2078
+ Object.defineProperty(exports, "FormWidgetUpdateBodySchema", {
2079
+ enumerable: true,
2080
+ get: function() {
2081
+ return FormWidgetUpdateBodySchema;
2082
+ }
2083
+ });
2084
+ Object.defineProperty(exports, "FormWidgetUpdateResultSchema", {
2085
+ enumerable: true,
2086
+ get: function() {
2087
+ return FormWidgetUpdateResultSchema;
2088
+ }
2089
+ });
2090
+ Object.defineProperty(exports, "FormWidgetsReorderBodySchema", {
2091
+ enumerable: true,
2092
+ get: function() {
2093
+ return FormWidgetsReorderBodySchema;
2094
+ }
2095
+ });
2096
+ Object.defineProperty(exports, "FormWidgetsReorderResultSchema", {
2097
+ enumerable: true,
2098
+ get: function() {
2099
+ return FormWidgetsReorderResultSchema;
2100
+ }
2101
+ });
2102
+ Object.defineProperty(exports, "FormWireComponents", {
2103
+ enumerable: true,
2104
+ get: function() {
2105
+ return FormWireComponents;
2106
+ }
2107
+ });
2108
+ Object.defineProperty(exports, "IdentitySchema", {
2109
+ enumerable: true,
2110
+ get: function() {
2111
+ return IdentitySchema;
2112
+ }
2113
+ });
2114
+ Object.defineProperty(exports, "LayerAnalysisQuerySchema", {
2115
+ enumerable: true,
2116
+ get: function() {
2117
+ return LayerAnalysisQuerySchema;
2118
+ }
2119
+ });
2120
+ Object.defineProperty(exports, "LayerScopesSchema", {
2121
+ enumerable: true,
2122
+ get: function() {
2123
+ return LayerScopesSchema;
2124
+ }
2125
+ });
2126
+ Object.defineProperty(exports, "ManifestPageSchema", {
2127
+ enumerable: true,
2128
+ get: function() {
2129
+ return ManifestPageSchema;
2130
+ }
2131
+ });
2132
+ Object.defineProperty(exports, "MetadataPatchSchema", {
2133
+ enumerable: true,
2134
+ get: function() {
2135
+ return MetadataPatchSchema;
2136
+ }
2137
+ });
2138
+ Object.defineProperty(exports, "MetadataUpdateResultSchema", {
2139
+ enumerable: true,
2140
+ get: function() {
2141
+ return MetadataUpdateResultSchema;
2142
+ }
2143
+ });
2144
+ Object.defineProperty(exports, "ModificationLevelSchema", {
2145
+ enumerable: true,
2146
+ get: function() {
2147
+ return ModificationLevelSchema;
2148
+ }
2149
+ });
2150
+ Object.defineProperty(exports, "MutationMetaSchema", {
2151
+ enumerable: true,
2152
+ get: function() {
2153
+ return MutationMetaSchema;
2154
+ }
2155
+ });
2156
+ Object.defineProperty(exports, "NamedPageEntrySchema", {
2157
+ enumerable: true,
2158
+ get: function() {
2159
+ return NamedPageEntrySchema;
2160
+ }
2161
+ });
2162
+ Object.defineProperty(exports, "ObjectNumberRangeSchema", {
2163
+ enumerable: true,
2164
+ get: function() {
2165
+ return ObjectNumberRangeSchema;
2166
+ }
2167
+ });
2168
+ Object.defineProperty(exports, "ObjectNumberReservationRequestSchema", {
2169
+ enumerable: true,
2170
+ get: function() {
2171
+ return ObjectNumberReservationRequestSchema;
2172
+ }
2173
+ });
2174
+ Object.defineProperty(exports, "ObjectNumberReservationResponseSchema", {
2175
+ enumerable: true,
2176
+ get: function() {
2177
+ return ObjectNumberReservationResponseSchema;
2178
+ }
2179
+ });
2180
+ Object.defineProperty(exports, "OpenDocumentResponseSchema", {
2181
+ enumerable: true,
2182
+ get: function() {
2183
+ return OpenDocumentResponseSchema;
2184
+ }
2185
+ });
2186
+ Object.defineProperty(exports, "PAGE_RENDER_FAMILIES", {
2187
+ enumerable: true,
2188
+ get: function() {
2189
+ return PAGE_RENDER_FAMILIES;
2190
+ }
2191
+ });
2192
+ Object.defineProperty(exports, "PageBoxesSchema", {
2193
+ enumerable: true,
2194
+ get: function() {
2195
+ return PageBoxesSchema;
2196
+ }
2197
+ });
2198
+ Object.defineProperty(exports, "PageDeleteInputSchema", {
2199
+ enumerable: true,
2200
+ get: function() {
2201
+ return PageDeleteInputSchema;
2202
+ }
2203
+ });
2204
+ Object.defineProperty(exports, "PageDeleteResultSchema", {
2205
+ enumerable: true,
2206
+ get: function() {
2207
+ return PageDeleteResultSchema;
2208
+ }
2209
+ });
2210
+ Object.defineProperty(exports, "PageExtractInputSchema", {
2211
+ enumerable: true,
2212
+ get: function() {
2213
+ return PageExtractInputSchema;
2214
+ }
2215
+ });
2216
+ Object.defineProperty(exports, "PageFlattenInputSchema", {
2217
+ enumerable: true,
2218
+ get: function() {
2219
+ return PageFlattenInputSchema;
2220
+ }
2221
+ });
2222
+ Object.defineProperty(exports, "PageFlattenResultSchema", {
2223
+ enumerable: true,
2224
+ get: function() {
2225
+ return PageFlattenResultSchema;
2226
+ }
2227
+ });
2228
+ Object.defineProperty(exports, "PageGeometrySnapshotSchema", {
2229
+ enumerable: true,
2230
+ get: function() {
2231
+ return PageGeometrySnapshotSchema;
2232
+ }
2233
+ });
2234
+ Object.defineProperty(exports, "PageInsertBlankInputSchema", {
2235
+ enumerable: true,
2236
+ get: function() {
2237
+ return PageInsertBlankInputSchema;
2238
+ }
2239
+ });
2240
+ Object.defineProperty(exports, "PageInsertInputSchema", {
2241
+ enumerable: true,
2242
+ get: function() {
2243
+ return PageInsertInputSchema;
2244
+ }
2245
+ });
2246
+ Object.defineProperty(exports, "PageInsertResultSchema", {
2247
+ enumerable: true,
2248
+ get: function() {
2249
+ return PageInsertResultSchema;
2250
+ }
2251
+ });
2252
+ Object.defineProperty(exports, "PageLayoutSchema", {
2253
+ enumerable: true,
2254
+ get: function() {
2255
+ return PageLayoutSchema;
2256
+ }
2257
+ });
2258
+ Object.defineProperty(exports, "PageListSnapshotSchema", {
2259
+ enumerable: true,
2260
+ get: function() {
2261
+ return PageListSnapshotSchema;
2262
+ }
2263
+ });
2264
+ Object.defineProperty(exports, "PageNameInputSchema", {
2265
+ enumerable: true,
2266
+ get: function() {
2267
+ return PageNameInputSchema;
2268
+ }
2269
+ });
2270
+ Object.defineProperty(exports, "PageNameResultSchema", {
2271
+ enumerable: true,
2272
+ get: function() {
2273
+ return PageNameResultSchema;
2274
+ }
2275
+ });
2276
+ Object.defineProperty(exports, "PageNetworkRenderFormatSchema", {
2277
+ enumerable: true,
2278
+ get: function() {
2279
+ return PageNetworkRenderFormatSchema;
2280
+ }
2281
+ });
2282
+ Object.defineProperty(exports, "PagePositionSchema", {
2283
+ enumerable: true,
2284
+ get: function() {
2285
+ return PagePositionSchema;
2286
+ }
2287
+ });
2288
+ Object.defineProperty(exports, "PageRemoveNameInputSchema", {
2289
+ enumerable: true,
2290
+ get: function() {
2291
+ return PageRemoveNameInputSchema;
2292
+ }
2293
+ });
2294
+ Object.defineProperty(exports, "PageRenderQuerySchemas", {
2295
+ enumerable: true,
2296
+ get: function() {
2297
+ return PageRenderQuerySchemas;
2298
+ }
2299
+ });
2300
+ Object.defineProperty(exports, "PageReorderInputSchema", {
2301
+ enumerable: true,
2302
+ get: function() {
2303
+ return PageReorderInputSchema;
2304
+ }
2305
+ });
2306
+ Object.defineProperty(exports, "PageReorderResultSchema", {
2307
+ enumerable: true,
2308
+ get: function() {
2309
+ return PageReorderResultSchema;
2310
+ }
2311
+ });
2312
+ Object.defineProperty(exports, "PageRotateInputSchema", {
2313
+ enumerable: true,
2314
+ get: function() {
2315
+ return PageRotateInputSchema;
2316
+ }
2317
+ });
2318
+ Object.defineProperty(exports, "PageRotateResultSchema", {
2319
+ enumerable: true,
2320
+ get: function() {
2321
+ return PageRotateResultSchema;
2322
+ }
2323
+ });
2324
+ Object.defineProperty(exports, "PageScaleResultSchema", {
2325
+ enumerable: true,
2326
+ get: function() {
2327
+ return PageScaleResultSchema;
2328
+ }
2329
+ });
2330
+ Object.defineProperty(exports, "PageTextSnapshotSchema", {
2331
+ enumerable: true,
2332
+ get: function() {
2333
+ return PageTextSnapshotSchema;
2334
+ }
2335
+ });
2336
+ Object.defineProperty(exports, "PdfRevisionSchema", {
2337
+ enumerable: true,
2338
+ get: function() {
2339
+ return PdfRevisionSchema;
2340
+ }
2341
+ });
2342
+ Object.defineProperty(exports, "PdfSaveModeSchema", {
2343
+ enumerable: true,
2344
+ get: function() {
2345
+ return PdfSaveModeSchema;
2346
+ }
2347
+ });
2348
+ Object.defineProperty(exports, "RedactionApplyResultSchema", {
2349
+ enumerable: true,
2350
+ get: function() {
2351
+ return RedactionApplyResultSchema;
2352
+ }
2353
+ });
2354
+ Object.defineProperty(exports, "RedactionApplyScopeSchema", {
2355
+ enumerable: true,
2356
+ get: function() {
2357
+ return RedactionApplyScopeSchema;
2358
+ }
2359
+ });
2360
+ Object.defineProperty(exports, "SearchMatchSchema", {
2361
+ enumerable: true,
2362
+ get: function() {
2363
+ return SearchMatchSchema;
2364
+ }
2365
+ });
2366
+ Object.defineProperty(exports, "SearchQuerySchema", {
2367
+ enumerable: true,
2368
+ get: function() {
2369
+ return SearchQuerySchema;
2370
+ }
2371
+ });
2372
+ Object.defineProperty(exports, "SearchRequestSchema", {
2373
+ enumerable: true,
2374
+ get: function() {
2375
+ return SearchRequestSchema;
2376
+ }
2377
+ });
2378
+ Object.defineProperty(exports, "SearchSliceSchema", {
2379
+ enumerable: true,
2380
+ get: function() {
2381
+ return SearchSliceSchema;
2382
+ }
2383
+ });
2384
+ Object.defineProperty(exports, "SearchSnippetSchema", {
2385
+ enumerable: true,
2386
+ get: function() {
2387
+ return SearchSnippetSchema;
2388
+ }
2389
+ });
2390
+ Object.defineProperty(exports, "SignatureAppearanceBodySchema", {
2391
+ enumerable: true,
2392
+ get: function() {
2393
+ return SignatureAppearanceBodySchema;
2394
+ }
2395
+ });
2396
+ Object.defineProperty(exports, "SignatureCancelResultSchema", {
2397
+ enumerable: true,
2398
+ get: function() {
2399
+ return SignatureCancelResultSchema;
2400
+ }
2401
+ });
2402
+ Object.defineProperty(exports, "SignatureCompleteBodySchema", {
2403
+ enumerable: true,
2404
+ get: function() {
2405
+ return SignatureCompleteBodySchema;
2406
+ }
2407
+ });
2408
+ Object.defineProperty(exports, "SignatureCompleteResultSchema", {
2409
+ enumerable: true,
2410
+ get: function() {
2411
+ return SignatureCompleteResultSchema;
2412
+ }
2413
+ });
2414
+ Object.defineProperty(exports, "SignatureDTOSchema", {
2415
+ enumerable: true,
2416
+ get: function() {
2417
+ return SignatureDTOSchema;
2418
+ }
2419
+ });
2420
+ Object.defineProperty(exports, "SignaturePrepareBodySchema", {
2421
+ enumerable: true,
2422
+ get: function() {
2423
+ return SignaturePrepareBodySchema;
2424
+ }
2425
+ });
2426
+ Object.defineProperty(exports, "SignaturePreparedWireSchema", {
2427
+ enumerable: true,
2428
+ get: function() {
2429
+ return SignaturePreparedWireSchema;
2430
+ }
2431
+ });
2432
+ Object.defineProperty(exports, "SignatureSeedValueSchema", {
2433
+ enumerable: true,
2434
+ get: function() {
2435
+ return SignatureSeedValueSchema;
2436
+ }
2437
+ });
2438
+ Object.defineProperty(exports, "SignatureSnapshotSchema", {
2439
+ enumerable: true,
2440
+ get: function() {
2441
+ return SignatureSnapshotSchema;
2442
+ }
2443
+ });
2444
+ Object.defineProperty(exports, "VersionAnalysisQuerySchema", {
2445
+ enumerable: true,
2446
+ get: function() {
2447
+ return VersionAnalysisQuerySchema;
2448
+ }
2449
+ });
2450
+ Object.defineProperty(exports, "WidgetAppearancesQuerySchema", {
2451
+ enumerable: true,
2452
+ get: function() {
2453
+ return WidgetAppearancesQuerySchema;
2454
+ }
2455
+ });
2456
+ Object.defineProperty(exports, "analyzeInputFromQuery", {
2457
+ enumerable: true,
2458
+ get: function() {
2459
+ return analyzeInputFromQuery;
2460
+ }
2461
+ });
2462
+ Object.defineProperty(exports, "decodePrepared", {
2463
+ enumerable: true,
2464
+ get: function() {
2465
+ return decodePrepared;
2466
+ }
2467
+ });
2468
+ Object.defineProperty(exports, "encodePrepared", {
2469
+ enumerable: true,
2470
+ get: function() {
2471
+ return encodePrepared;
2472
+ }
2473
+ });
2474
+ Object.defineProperty(exports, "pageRenderFamilyOf", {
2475
+ enumerable: true,
2476
+ get: function() {
2477
+ return pageRenderFamilyOf;
2478
+ }
2479
+ });
2480
+
2481
+ //# sourceMappingURL=schemas-Berf1swF.cjs.map