@embedpdf/engine-core 3.0.0-next.1 → 3.0.0-next.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/{AbortError-CjSasIlL.js → AbortError-8-9JAX1Y.js} +2 -2
  2. package/dist/{AbortError-CjSasIlL.js.map → AbortError-8-9JAX1Y.js.map} +1 -1
  3. package/dist/{AbortError-ByBflvEl.cjs → AbortError-CRSooKsk.cjs} +2 -2
  4. package/dist/{AbortError-ByBflvEl.cjs.map → AbortError-CRSooKsk.cjs.map} +1 -1
  5. package/dist/{AnnotationListSnapshot-W0RCsyDE.d.cts → AnnotationListSnapshot-C1U3XUxP.d.cts} +846 -127
  6. package/dist/{AnnotationListSnapshot-W0RCsyDE.d.ts → AnnotationListSnapshot-C1U3XUxP.d.ts} +846 -127
  7. package/dist/{DocumentSecurityService-Df79fgpe.d.cts → DocumentSecurityService-6rhztZlz.d.cts} +33 -2
  8. package/dist/{DocumentSecurityService-B-tULKNY.d.ts → DocumentSecurityService-7nL9aY75.d.ts} +33 -2
  9. package/dist/{Engine-B7Oe7f5i.d.ts → Engine-CWnAKccD.d.ts} +62 -19
  10. package/dist/{Engine-D9loFZc1.d.cts → Engine-D3868xIU.d.cts} +62 -19
  11. package/dist/{subtype-qejjVr6h.cjs → PageInsertBlankInput-CzShuSJI.cjs} +184 -1
  12. package/dist/PageInsertBlankInput-CzShuSJI.cjs.map +1 -0
  13. package/dist/{subtype-BvAzLCGC.js → PageInsertBlankInput-WKY0tr6S.js} +149 -2
  14. package/dist/PageInsertBlankInput-WKY0tr6S.js.map +1 -0
  15. package/dist/{builders-C548U47M.js → builders-Cdz34nbF.js} +566 -164
  16. package/dist/builders-Cdz34nbF.js.map +1 -0
  17. package/dist/{builders-BvikWRuO.cjs → builders-Do6_4KnS.cjs} +628 -220
  18. package/dist/builders-Do6_4KnS.cjs.map +1 -0
  19. package/dist/conformance.cjs +1039 -204
  20. package/dist/conformance.cjs.map +1 -1
  21. package/dist/conformance.d.cts +130 -6
  22. package/dist/conformance.d.ts +130 -6
  23. package/dist/conformance.js +994 -163
  24. package/dist/conformance.js.map +1 -1
  25. package/dist/{fold-CB4fAOOy.js → fold-BfyxxwS6.js} +162 -3
  26. package/dist/fold-BfyxxwS6.js.map +1 -0
  27. package/dist/{fold-IaMph3CO.cjs → fold-C7I5GpBz.cjs} +235 -4
  28. package/dist/fold-C7I5GpBz.cjs.map +1 -0
  29. package/dist/index.cjs +38 -19
  30. package/dist/index.d.cts +2 -2
  31. package/dist/index.d.ts +2 -2
  32. package/dist/index.js +5 -5
  33. package/dist/{resolver-DiPMTfcy.js → resolver-CHG4waXL.js} +2 -1
  34. package/dist/resolver-CHG4waXL.js.map +1 -0
  35. package/dist/{resolver-DAZWVoJL.cjs → resolver-D-jumvgM.cjs} +2 -1
  36. package/dist/resolver-D-jumvgM.cjs.map +1 -0
  37. package/dist/runtime.cjs +43 -24
  38. package/dist/runtime.cjs.map +1 -1
  39. package/dist/runtime.d.cts +103 -5
  40. package/dist/runtime.d.ts +103 -5
  41. package/dist/runtime.js +6 -6
  42. package/dist/{schemas-B_1VyFsm.cjs → schemas-CS5iPpX5.cjs} +305 -111
  43. package/dist/schemas-CS5iPpX5.cjs.map +1 -0
  44. package/dist/{schemas-9OpSSeM6.js → schemas-XGrNVMDd.js} +250 -92
  45. package/dist/schemas-XGrNVMDd.js.map +1 -0
  46. package/dist/wire.cjs +131 -4
  47. package/dist/wire.cjs.map +1 -1
  48. package/dist/wire.d.cts +277 -20
  49. package/dist/wire.d.ts +277 -20
  50. package/dist/wire.js +120 -5
  51. package/dist/wire.js.map +1 -1
  52. package/package.json +1 -1
  53. package/dist/builders-BvikWRuO.cjs.map +0 -1
  54. package/dist/builders-C548U47M.js.map +0 -1
  55. package/dist/fold-CB4fAOOy.js.map +0 -1
  56. package/dist/fold-IaMph3CO.cjs.map +0 -1
  57. package/dist/resolver-DAZWVoJL.cjs.map +0 -1
  58. package/dist/resolver-DiPMTfcy.js.map +0 -1
  59. package/dist/schemas-9OpSSeM6.js.map +0 -1
  60. package/dist/schemas-B_1VyFsm.cjs.map +0 -1
  61. package/dist/subtype-BvAzLCGC.js.map +0 -1
  62. package/dist/subtype-qejjVr6h.cjs.map +0 -1
@@ -1,4 +1,4 @@
1
- import { i as PdfAnnotationSubtypeCode, o as EngineErrorCode } from "./subtype-BvAzLCGC.js";
1
+ import { f as EngineErrorCode, i as charMapViolation, u as PdfAnnotationSubtypeCode } from "./PageInsertBlankInput-WKY0tr6S.js";
2
2
  import { z } from "zod";
3
3
  //#region src/geometry/schemas.ts
4
4
  /**
@@ -44,34 +44,139 @@ const PdfRotationSchema = z.union([
44
44
  z.literal(270)
45
45
  ]);
46
46
  //#endregion
47
- //#region src/dto/PdfAction.schema.ts
48
- const PdfActionTypeSchema = z.enum([
49
- "unknown",
50
- "goto",
51
- "goto-remote",
52
- "goto-embedded",
53
- "launch",
54
- "thread",
55
- "uri",
56
- "sound",
57
- "movie",
58
- "hide",
59
- "named",
60
- "submit-form",
61
- "reset-form",
62
- "import-data",
63
- "javascript",
64
- "set-ocg-state",
65
- "rendition",
66
- "transition",
67
- "goto-3d-view"
47
+ //#region src/dto/PdfDestination.schema.ts
48
+ const pageObjectNumber = z.number().int().positive();
49
+ /** Spec-nullable axis value: absent and `null` both mean "retain current". */
50
+ const axis = z.number().nullable().optional();
51
+ /**
52
+ * Runtime schema for {@link PdfDestination}. Lives beside its DTO in `dto/`
53
+ * so every destination-shaped surface (link targets, action-node payloads,
54
+ * the document `openDestination`) shares one schema without an import cycle
55
+ * through the annotation tree.
56
+ */
57
+ const PdfDestinationSchema = z.discriminatedUnion("kind", [
58
+ z.object({
59
+ kind: z.literal("xyz"),
60
+ pageObjectNumber,
61
+ left: axis,
62
+ top: axis,
63
+ zoom: axis
64
+ }),
65
+ z.object({
66
+ kind: z.literal("fit"),
67
+ pageObjectNumber
68
+ }),
69
+ z.object({
70
+ kind: z.literal("fitH"),
71
+ pageObjectNumber,
72
+ top: axis
73
+ }),
74
+ z.object({
75
+ kind: z.literal("fitV"),
76
+ pageObjectNumber,
77
+ left: axis
78
+ }),
79
+ z.object({
80
+ kind: z.literal("fitR"),
81
+ pageObjectNumber,
82
+ left: z.number(),
83
+ bottom: z.number(),
84
+ right: z.number(),
85
+ top: z.number()
86
+ }),
87
+ z.object({
88
+ kind: z.literal("fitB"),
89
+ pageObjectNumber
90
+ }),
91
+ z.object({
92
+ kind: z.literal("fitBH"),
93
+ pageObjectNumber,
94
+ top: axis
95
+ }),
96
+ z.object({
97
+ kind: z.literal("fitBV"),
98
+ pageObjectNumber,
99
+ left: axis
100
+ })
68
101
  ]);
69
- const PdfActionNodeSchema = z.lazy(() => z.object({
70
- type: PdfActionTypeSchema,
102
+ //#endregion
103
+ //#region src/dto/PdfAction.schema.ts
104
+ const PdfActionTargetRefSchema = z.discriminatedUnion("kind", [z.object({
105
+ kind: z.literal("name"),
106
+ name: z.string()
107
+ }), z.object({
108
+ kind: z.literal("objectNumber"),
109
+ objectNumber: z.number().int().positive()
110
+ })]);
111
+ /** Fields every node arm repeats — zod 3's discriminatedUnion needs plain
112
+ * object options, so the recursion (`next`) lives inline per arm and the
113
+ * whole union sits behind one `z.lazy`. */
114
+ const nodeCommon = {
71
115
  subtype: z.string(),
72
- script: z.string().optional(),
73
- next: z.array(PdfActionNodeSchema)
74
- }));
116
+ next: z.array(z.lazy(() => PdfActionNodeSchema))
117
+ };
118
+ const arm = (type, shape = {}) => z.object({
119
+ type: z.literal(type),
120
+ ...nodeCommon,
121
+ ...shape
122
+ });
123
+ const SubmitFormFlagsSchema = z.object({
124
+ raw: z.number().int().nonnegative(),
125
+ exclude: z.boolean(),
126
+ includeNoValueFields: z.boolean(),
127
+ format: z.enum([
128
+ "fdf",
129
+ "html",
130
+ "xfdf",
131
+ "pdf"
132
+ ]),
133
+ method: z.enum(["post", "get"]),
134
+ submitCoordinates: z.boolean(),
135
+ includeAppendSaves: z.boolean(),
136
+ includeAnnotations: z.boolean(),
137
+ canonicalFormat: z.boolean(),
138
+ exclNonUserAnnots: z.boolean(),
139
+ exclFKey: z.boolean(),
140
+ embedForm: z.boolean()
141
+ });
142
+ const PDF_ACTION_NODE_ARMS = [
143
+ arm("javascript", { script: z.string() }),
144
+ arm("goto", { destination: PdfDestinationSchema }),
145
+ arm("uri", {
146
+ uri: z.string(),
147
+ isMap: z.boolean()
148
+ }),
149
+ arm("named", { name: z.string() }),
150
+ arm("hide", {
151
+ targets: z.array(PdfActionTargetRefSchema),
152
+ hide: z.boolean()
153
+ }),
154
+ arm("reset-form", {
155
+ fields: z.array(PdfActionTargetRefSchema).nullable(),
156
+ exclude: z.boolean()
157
+ }),
158
+ arm("goto-remote", { filePath: z.string() }),
159
+ arm("goto-embedded", { filePath: z.string() }),
160
+ arm("launch", { filePath: z.string() }),
161
+ arm("rendition", { script: z.string().optional() }),
162
+ arm("submit-form", { payload: z.object({
163
+ url: z.string(),
164
+ fields: z.array(PdfActionTargetRefSchema).nullable(),
165
+ flags: SubmitFormFlagsSchema,
166
+ charSet: z.string().optional()
167
+ }).optional() }),
168
+ arm("thread"),
169
+ arm("sound"),
170
+ arm("movie"),
171
+ arm("import-data"),
172
+ arm("set-ocg-state"),
173
+ arm("transition"),
174
+ arm("goto-3d-view"),
175
+ arm("unknown")
176
+ ];
177
+ const PdfActionNodeSchema = z.lazy(() => z.discriminatedUnion("type", [...PDF_ACTION_NODE_ARMS]));
178
+ /** The `/S` vocabulary, derived from the union arms so it cannot drift. */
179
+ const PdfActionTypeSchema = z.enum(PDF_ACTION_NODE_ARMS.map((option) => option.shape.type.value));
75
180
  const PdfActionTreeSchema = z.object({
76
181
  root: PdfActionNodeSchema.nullable(),
77
182
  incomplete: z.boolean(),
@@ -79,7 +184,8 @@ const PdfActionTreeSchema = z.object({
79
184
  warnings: z.array(z.enum([
80
185
  "cycle-dropped",
81
186
  "malformed-next",
82
- "incomplete"
187
+ "incomplete",
188
+ "payload-dropped"
83
189
  ]))
84
190
  });
85
191
  const PdfFieldActionsSchema = z.object({
@@ -111,12 +217,34 @@ const DocumentActionsSnapshotSchema = z.object({
111
217
  action: PdfActionTreeSchema
112
218
  })),
113
219
  openAction: PdfActionTreeSchema.nullable(),
220
+ openDestination: PdfDestinationSchema.nullable().default(null),
114
221
  willClose: PdfActionTreeSchema.optional(),
115
222
  willSave: PdfActionTreeSchema.optional(),
116
223
  didSave: PdfActionTreeSchema.optional(),
117
224
  willPrint: PdfActionTreeSchema.optional(),
118
225
  didPrint: PdfActionTreeSchema.optional()
226
+ }).superRefine((snapshot, context) => {
227
+ if (snapshot.openAction !== null && (snapshot.openDestination ?? null) !== null) context.addIssue({
228
+ code: z.ZodIssueCode.custom,
229
+ message: "openAction and openDestination are mutually exclusive",
230
+ path: ["openDestination"]
231
+ });
119
232
  });
233
+ /**
234
+ * Stable public component names for generators that project the action wire
235
+ * model into OpenAPI or another schema format. Keep reusable boundaries here;
236
+ * individual action arms remain owned by `PdfActionNodeSchema`.
237
+ */
238
+ const PdfActionWireComponents = {
239
+ PdfActionTargetRef: PdfActionTargetRefSchema,
240
+ PdfDestination: PdfDestinationSchema,
241
+ PdfActionNode: PdfActionNodeSchema,
242
+ PdfActionTree: PdfActionTreeSchema,
243
+ PdfFieldActions: PdfFieldActionsSchema,
244
+ PdfPageActions: PdfPageActionsSchema,
245
+ PdfAnnotationActions: PdfAnnotationActionsSchema,
246
+ DocumentActionsSnapshot: DocumentActionsSnapshotSchema
247
+ };
120
248
  //#endregion
121
249
  //#region src/annotation/base.schema.ts
122
250
  /** @deprecated Use `PdfPointSchema` from `../geometry/schemas`. */
@@ -274,6 +402,7 @@ const AnnotationBaseShape = {
274
402
  flags: AnnotationFlagsSchema,
275
403
  rect: PdfRectSchema,
276
404
  contents: z.string().nullable(),
405
+ subject: z.string().nullable(),
277
406
  author: z.string().nullable(),
278
407
  created: z.string().datetime().nullable(),
279
408
  modified: z.string().datetime().nullable(),
@@ -296,6 +425,7 @@ const AnnotationBaseShape = {
296
425
  */
297
426
  const AnnotationDraftBaseShape = {
298
427
  contents: z.string().nullable().optional(),
428
+ subject: z.string().nullable().optional(),
299
429
  blendMode: BlendModeSchema.optional(),
300
430
  nm: z.string().optional(),
301
431
  flags: AnnotationFlagsPartialSchema.optional(),
@@ -314,6 +444,7 @@ const AnnotationDraftBaseShape = {
314
444
  */
315
445
  const AnnotationPatchBaseShape = {
316
446
  contents: z.string().nullable().optional(),
447
+ subject: z.string().nullable().optional(),
317
448
  blendMode: BlendModeSchema.optional(),
318
449
  groupId: z.string().min(1).optional(),
319
450
  flags: AnnotationFlagsPartialSchema.optional(),
@@ -360,6 +491,8 @@ const CaretDTOSchema = z.object({
360
491
  ...ColorStyleDTOShape,
361
492
  intent: CaretIntentSchema.nullable(),
362
493
  rectDifferences: PdfRectDifferencesSchema.nullable(),
494
+ rotation: z.number().optional(),
495
+ unrotatedRect: PdfRectSchema.optional(),
363
496
  subtype: z.literal("caret")
364
497
  });
365
498
  const CaretDraftSchema = z.object({
@@ -368,6 +501,8 @@ const CaretDraftSchema = z.object({
368
501
  intent: CaretIntentSchema.optional(),
369
502
  rect: PdfRectSchema,
370
503
  rectDifferences: PdfRectDifferencesSchema.nullable().optional(),
504
+ rotation: z.number().nullable().optional(),
505
+ unrotatedRect: PdfRectSchema.nullable().optional(),
371
506
  subtype: z.literal("caret")
372
507
  });
373
508
  const CaretPatchSchema = z.object({
@@ -376,6 +511,8 @@ const CaretPatchSchema = z.object({
376
511
  intent: CaretIntentSchema.optional(),
377
512
  rect: PdfRectSchema.optional(),
378
513
  rectDifferences: PdfRectDifferencesSchema.nullable().optional(),
514
+ rotation: z.number().nullable().optional(),
515
+ unrotatedRect: PdfRectSchema.nullable().optional(),
379
516
  subtype: z.literal("caret")
380
517
  });
381
518
  //#endregion
@@ -716,58 +853,6 @@ const LineKind = {
716
853
  };
717
854
  //#endregion
718
855
  //#region src/annotation/kinds/link/schema.ts
719
- const pageObjectNumber = z.number().int().positive();
720
- /** Spec-nullable axis value: absent and `null` both mean "retain current". */
721
- const axis = z.number().nullable().optional();
722
- /**
723
- * Runtime schema for {@link PdfDestination}. Lives with the link kind (its
724
- * first wire consumer); the outline/bookmark port reuses it from here.
725
- */
726
- const PdfDestinationSchema = z.discriminatedUnion("kind", [
727
- z.object({
728
- kind: z.literal("xyz"),
729
- pageObjectNumber,
730
- left: axis,
731
- top: axis,
732
- zoom: axis
733
- }),
734
- z.object({
735
- kind: z.literal("fit"),
736
- pageObjectNumber
737
- }),
738
- z.object({
739
- kind: z.literal("fitH"),
740
- pageObjectNumber,
741
- top: axis
742
- }),
743
- z.object({
744
- kind: z.literal("fitV"),
745
- pageObjectNumber,
746
- left: axis
747
- }),
748
- z.object({
749
- kind: z.literal("fitR"),
750
- pageObjectNumber,
751
- left: z.number(),
752
- bottom: z.number(),
753
- right: z.number(),
754
- top: z.number()
755
- }),
756
- z.object({
757
- kind: z.literal("fitB"),
758
- pageObjectNumber
759
- }),
760
- z.object({
761
- kind: z.literal("fitBH"),
762
- pageObjectNumber,
763
- top: axis
764
- }),
765
- z.object({
766
- kind: z.literal("fitBV"),
767
- pageObjectNumber,
768
- left: axis
769
- })
770
- ]);
771
856
  const GotoTargetSchema = z.object({
772
857
  kind: z.literal("goto"),
773
858
  destination: PdfDestinationSchema
@@ -1115,6 +1200,8 @@ const TextDTOSchema = z.object({
1115
1200
  ...AnnotationBaseShape,
1116
1201
  ...ColorStyleDTOShape,
1117
1202
  icon: NoteIconSchema,
1203
+ state: z.string().nullable(),
1204
+ stateModel: z.string().nullable(),
1118
1205
  subtype: z.literal("text")
1119
1206
  });
1120
1207
  const TextDraftSchema = z.object({
@@ -1122,6 +1209,8 @@ const TextDraftSchema = z.object({
1122
1209
  ...AnnotationDraftBaseShape,
1123
1210
  rect: PdfRectSchema,
1124
1211
  icon: NoteIconSchema.optional(),
1212
+ state: z.string().min(1).optional(),
1213
+ stateModel: z.string().min(1).optional(),
1125
1214
  subtype: z.literal("text")
1126
1215
  });
1127
1216
  const TextPatchSchema = z.object({
@@ -1129,6 +1218,8 @@ const TextPatchSchema = z.object({
1129
1218
  ...AnnotationPatchBaseShape,
1130
1219
  rect: PdfRectSchema.optional(),
1131
1220
  icon: NoteIconSchema.optional(),
1221
+ state: z.string().min(1).nullable().optional(),
1222
+ stateModel: z.string().min(1).nullable().optional(),
1132
1223
  subtype: z.literal("text")
1133
1224
  });
1134
1225
  //#endregion
@@ -1693,7 +1784,10 @@ const DocumentHeadSchema = z.object({
1693
1784
  })
1694
1785
  });
1695
1786
  const AccessRequestSchema = z.object({
1696
- docId: z.string().min(1),
1787
+ /** Deprecated: identity now rides the PATH
1788
+ * (`/v1/docs/:docId/layers/:layerName/access`). Kept optional for the
1789
+ * legacy `/v1/access` alias, which requires `docId` in the body. */
1790
+ docId: z.string().min(1).optional(),
1697
1791
  layerName: z.string().min(1).optional(),
1698
1792
  password: z.string().optional(),
1699
1793
  passwordGrant: z.string().optional(),
@@ -1945,6 +2039,7 @@ const DocumentManifestSchema = z.object({
1945
2039
  metadataVersion: z.number().int().positive(),
1946
2040
  actionsVersion: z.number().int().positive().default(1),
1947
2041
  attachmentsVersion: z.number().int().positive().default(1),
2042
+ annotationsVersion: z.number().int().positive().default(1),
1948
2043
  auditHead: z.number().int().nonnegative(),
1949
2044
  baseSha: z.string(),
1950
2045
  scopes: LayerScopesSchema.optional(),
@@ -1954,29 +2049,55 @@ const AnnotationListPageSnapshotSchema = z.object({
1954
2049
  pageState: PageStateSchema,
1955
2050
  annotations: z.array(AnnotationDTOSchema)
1956
2051
  });
1957
- const AnnotationListSnapshotAllPagesSchema = z.object({ pages: z.array(AnnotationListPageSnapshotSchema) });
2052
+ const AnnotationListSnapshotAllPagesSchema = z.object({
2053
+ pages: z.array(AnnotationListPageSnapshotSchema),
2054
+ auditHead: z.number().int().nonnegative().optional()
2055
+ });
1958
2056
  /**
1959
- * Wire shape of `GET /v1/docs/:docId/pages/:pon/text@contentVersion=N` and the
1960
- * `pages.text` worker result. Carries the same `pageState` envelope
1961
- * every page-scoped read returns, plus the full plain-text extraction
1962
- * in display order and PDFium's char-count (which may exceed
1963
- * `text.length / 1` when astral-plane characters are present).
2057
+ * Wire shape of `GET …/text/pages/:pon/data@<contentVersion>` and the
2058
+ * `pages.text` worker result: the UTF-16-faithful extraction, the CHARACTER
2059
+ * space size (`charCount` — the space geometry runs tile; NOT `text.length`),
2060
+ * and the optional character→text anchor map. Malformed maps are rejected
2061
+ * here with the shared `charMapViolation` invariants — absent/empty map
2062
+ * REQUIRES `charCount === text.length` (identity).
1964
2063
  */
1965
2064
  const PageTextSnapshotSchema = z.object({
1966
2065
  text: z.string(),
1967
- charCount: z.number().int().nonnegative()
2066
+ charCount: z.number().int().nonnegative(),
2067
+ charMap: z.array(z.tuple([z.number().int().nonnegative(), z.number().int().nonnegative()])).optional()
2068
+ }).superRefine((snapshot, ctx) => {
2069
+ const violation = charMapViolation(snapshot.charCount, snapshot.text.length, snapshot.charMap);
2070
+ if (violation !== null) ctx.addIssue({
2071
+ code: z.ZodIssueCode.custom,
2072
+ path: ["charMap"],
2073
+ message: violation
2074
+ });
1968
2075
  });
1969
2076
  const PageGeometryGlyphSchema = z.object({
1970
2077
  looseBox: PdfRectSchema,
1971
2078
  flags: z.number().int().nonnegative(),
1972
2079
  tightBox: PdfRectSchema.optional()
1973
2080
  });
1974
- const PageGeometryRunSchema = z.object({
2081
+ const RotatedGeometryGlyphSchema = z.object({
2082
+ looseQuad: PdfQuadSchema,
2083
+ flags: z.number().int().nonnegative(),
2084
+ tightQuad: PdfQuadSchema.optional()
2085
+ });
2086
+ const UprightGeometryRunSchema = z.object({
1975
2087
  rect: PdfRectSchema,
1976
2088
  charStart: z.number().int().nonnegative(),
1977
2089
  glyphs: z.array(PageGeometryGlyphSchema),
1978
2090
  fontSize: z.number().optional()
1979
2091
  });
2092
+ const RotatedGeometryRunSchema = z.object({
2093
+ rect: PdfRectSchema,
2094
+ charStart: z.number().int().nonnegative(),
2095
+ glyphs: z.array(RotatedGeometryGlyphSchema),
2096
+ rotation: z.number(),
2097
+ ascentFlip: z.boolean(),
2098
+ fontSize: z.number().optional()
2099
+ });
2100
+ const PageGeometryRunSchema = z.union([RotatedGeometryRunSchema, UprightGeometryRunSchema]);
1980
2101
  const PageGeometrySnapshotSchema = z.object({ runs: z.array(PageGeometryRunSchema) });
1981
2102
  /**
1982
2103
  * Search wire shapes: the request body of the layer search route and the
@@ -2008,11 +2129,16 @@ const SearchSnippetSchema = z.object({
2008
2129
  matchStart: z.number().int().nonnegative(),
2009
2130
  matchLength: z.number().int().positive()
2010
2131
  });
2132
+ const PdfTextSegmentSchema = z.object({
2133
+ quad: PdfQuadSchema,
2134
+ rect: PdfRectSchema,
2135
+ advance: z.union([z.literal(1), z.literal(-1)])
2136
+ });
2011
2137
  const SearchMatchSchema = z.object({
2012
2138
  pageObjectNumber: z.number().int().positive(),
2013
2139
  charStart: z.number().int().nonnegative(),
2014
2140
  charCount: z.number().int().positive(),
2015
- rects: z.array(PdfRectSchema),
2141
+ segments: z.array(PdfTextSegmentSchema),
2016
2142
  snippet: SearchSnippetSchema.optional()
2017
2143
  });
2018
2144
  const SearchSliceSchema = z.object({
@@ -2186,6 +2312,7 @@ const RefetchReasonSchema = z.enum([
2186
2312
  const CacheDeltaSchema = z.object({
2187
2313
  previousDocVersion: z.number().int().positive(),
2188
2314
  docVersion: z.number().int().positive(),
2315
+ annotationsVersion: z.number().int().positive().optional(),
2189
2316
  pages: z.array(z.object({
2190
2317
  pageObjectNumber: z.number().int().positive(),
2191
2318
  cache: CachePinsSchema
@@ -2454,6 +2581,37 @@ const PageDeleteResultSchema = z.object({
2454
2581
  cache: PageStructureCacheSchema.nullable()
2455
2582
  });
2456
2583
  /**
2584
+ * Page insert (bytes) input — the JSON `body` part of the multipart
2585
+ * mutation envelope; the PDF itself rides the `resource:source` part.
2586
+ * `destIndex` omitted → append.
2587
+ */
2588
+ const PageInsertInputSchema = z.object({ destIndex: z.number().int().nonnegative().optional() });
2589
+ /**
2590
+ * Blank-page insert input — plain JSON, pages.insert minus the bytes.
2591
+ * `size` is in PDF points (un-rotated); `count` shares the contract cap
2592
+ * with the worker so a request the schema accepts cannot then fail the
2593
+ * worker's own guard.
2594
+ */
2595
+ const PageInsertBlankInputSchema = z.object({
2596
+ size: z.object({
2597
+ width: z.number().positive().finite(),
2598
+ height: z.number().positive().finite()
2599
+ }),
2600
+ count: z.number().int().min(1).max(100).optional(),
2601
+ destIndex: z.number().int().nonnegative().optional()
2602
+ });
2603
+ /** Page extract input: the pages to export, in the order they should appear. */
2604
+ const PageExtractInputSchema = z.object({ pageObjectNumbers: z.array(z.number().int().positive()).min(1) });
2605
+ /**
2606
+ * Page insert result — shared by bytes-insert and blank-insert: the fresh
2607
+ * PONs in insertion order plus the full new layout (see `PageInsertResult`).
2608
+ */
2609
+ const PageInsertResultSchema = z.object({
2610
+ insertedPageObjectNumbers: z.array(z.number().int().positive()),
2611
+ layout: PageListSnapshotSchema,
2612
+ cache: PageStructureCacheSchema.nullable()
2613
+ });
2614
+ /**
2457
2615
  * Metadata write result. The Info dict is rewritten in place, so the
2458
2616
  * result returns the re-read `metadata` plus cloud coherence pins. No
2459
2617
  * `layoutVersion` is touched — a metadata edit bumps only `docVersion`
@@ -2488,6 +2646,6 @@ const WeakAnnotationSessionResponseSchema = z.object({
2488
2646
  });
2489
2647
  const WeakAnnotationSessionPagesRequestSchema = z.object({ pageObjectNumbers: z.array(z.number().int().positive()).transform((pages) => [...new Set(pages)]) });
2490
2648
  //#endregion
2491
- export { PageStateSchema as $, FreeTextIntentSchema as $n, SquigglyDraftSchema as $t, FormSetValueResultSchema as A, FileAttachmentPatchSchema as An, AnnotationDTOSchema as At, PageDeleteResultSchema as B, CaretDraftSchema as Bn, UnderlinePatchSchema as Bt, FormEffectSchema as C, HighlightDraftSchema as Cn, PdfRotationSchema as Cr, FormKindSchema as Ct, FormFieldUpdateResultSchema as D, FreeTextPatchSchema as Dn, ToggleFieldWidgetSchema as Dt, FormFieldDeleteResultSchema as E, FreeTextDraftSchema as En, FormWidgetRefSchema as Et, MetadataUpdateResultSchema as F, EmbeddedFileRefSchema as Fn, UnsupportedDTOSchema as Ft, PageListSnapshotSchema as G, AnnotationFlagsPartialSchema as Gn, StrikeoutDTOSchema as Gt, PageFlattenResultSchema as H, AnnotationBaseShape as Hn, TextDTOSchema as Ht, MutationMetaSchema as I, CircleDTOSchema as In, UnsupportedDraftSchema as It, PageNetworkRenderFormatSchema as J, AnnotationRefSchema as Jn, ResourceRefSchema as Jt, PageMoveInputSchema as K, AnnotationFlagsSchema as Kn, StrikeoutDraftSchema as Kt, OpenDocumentResponseSchema as L, CircleDraftSchema as Ln, UnsupportedPatchSchema as Lt, LayerScopesSchema as M, WireAttachmentFileSchema as Mn, AnnotationPatchSchema as Mt, ManifestPageSchema as N, AttachmentFileInfoSchema as Nn, KIND_BY_SUBTYPE as Nt, FormImportResultSchema as O, FileAttachmentDTOSchema as On, WidgetPlacementSchema as Ot, MetadataPatchSchema as P, EmbeddedFileItemSchema as Pn, WidgetAppearanceSchema as Pt, PageRotateResultSchema as Q, ColorSchema as Qn, SquigglyDTOSchema as Qt, PageBoxesSchema as R, CirclePatchSchema as Rn, UnderlineDTOSchema as Rt, EngineErrorPayloadSchema as S, HighlightDTOSchema as Sn, PdfRectSchema as Sr, FormFieldValueSchema as St, FormFieldCreateResultSchema as T, FreeTextDTOSchema as Tn, FormValueEntrySchema as Tt, PageGeometrySnapshotSchema as U, AnnotationBorderStyleSchema as Un, TextDraftSchema as Ut, PageFlattenInputSchema as V, CaretPatchSchema as Vn, NoteIconSchema as Vt, PageLayoutSchema as W, AnnotationDraftBaseShape as Wn, TextPatchSchema as Wt, PageRenderQuerySchema as X, BlendModeSchema as Xn, StampWireDraftSchema as Xt, PageRenderAnnotatedQuerySchema as Y, AnnotationStableIdSchema as Yn, StampDTOSchema as Yt, PageRotateInputSchema as Z, CaretIntentSchema as Zn, StampWirePatchSchema as Zt, CachePinsSchema as _, LineDraftSchema as _n, CalloutLineSchema as _r, FormFieldFlagsSchema as _t, AnnotationCreateResultSchema as a, PolylineDraftSchema as an, RectSchema as ar, RefetchReasonSchema as at, DocumentMetadataSchema as b, InkDraftSchema as bn, PdfPointSchema as br, FormFieldPatchSchema as bt, AnnotationListPageSnapshotSchema as c, PolygonDraftSchema as cn, StrikeoutIntentSchema as cr, SearchQuerySchema as ct, AnnotationUpdateResultSchema as d, LinkDraftSchema as dn, PdfActionNodeSchema as dr, SearchSnippetSchema as dt, SquigglyPatchSchema as en, InkIntentSchema as er, PageStructureCacheSchema as et, AppearanceOutcomeSchema as f, LinkPatchSchema as fn, PdfActionTreeSchema as fr, WeakAnnotationSessionPagesRequestSchema as ft, CacheDeltaSchema as g, LineDTOSchema as gn, PdfPageActionsSchema as gr, FormFieldDraftSchema as gt, AttachmentsCacheSchema as h, PdfLinkTargetWritableSchema as hn, PdfFieldActionsSchema as hr, FormFieldDTOSchema as ht, AnnotationAppearancesQuerySchema as i, PolylineDTOSchema as in, PointSchema as ir, RedactionApplyScopeSchema as it, FormWidgetLinkResultSchema as j, FileAttachmentWireDraftSchema as jn, AnnotationDraftSchema as jt, FormRepairResultSchema as k, FileAttachmentIconSchema as kn, ANNOTATION_KINDS as kt, AnnotationListSnapshotAllPagesSchema as l, PolygonPatchSchema as ln, TextAlignmentSchema as lr, SearchRequestSchema as lt, AttachmentDeleteResultSchema as m, PdfLinkTargetSchema as mn, PdfAnnotationActionsSchema as mr, FormDataFormatSchema as mt, AccessResponseSchema as n, SquareDraftSchema as nn, LineEndingsSchema as nr, PdfSaveModeSchema as nt, AnnotationDeleteResultSchema as o, PolylinePatchSchema as on, RevisionTokenSchema as or, SearchMatchSchema as ot, AttachmentCreateResultSchema as p, PdfDestinationSchema as pn, PdfActionTypeSchema as pr, WeakAnnotationSessionResponseSchema as pt, PageMoveResultSchema as q, AnnotationPatchBaseShape as qn, StrikeoutPatchSchema as qt, AnnotationAppearanceManifestSchema as r, SquarePatchSchema as rn, PdfRectDifferencesSchema as rr, RedactionApplyResultSchema as rt, AnnotationListMutationMetaSchema as s, PolygonDTOSchema as sn, StandardFontSchema as sr, SearchModeSchema as st, AccessRequestSchema as t, SquareDTOSchema as tn, LineEndingSchema as tr, PageTextSnapshotSchema as tt, AnnotationMoveResultSchema as u, LinkDTOSchema as un, DocumentActionsSnapshotSchema as ur, SearchSliceSchema as ut, DocumentHeadSchema as v, LinePatchSchema as vn, InkListSchema as vr, FormFieldOptionInputSchema as vt, FormEffectsResultSchema as w, HighlightPatchSchema as wn, PdfSizeSchema as wr, FormSnapshotSchema as wt, DocumentSecurityStateSchema as x, InkPatchSchema as xn, PdfQuadSchema as xr, FormFieldRefSchema as xt, DocumentManifestSchema as y, InkDTOSchema as yn, LinePointsSchema as yr, FormFieldOptionSchema as yt, PageDeleteInputSchema as z, CaretDTOSchema as zn, UnderlineDraftSchema as zt };
2649
+ export { PageRenderAnnotatedQuerySchema as $, BlendModeSchema as $n, StampDTOSchema as $t, FormSetValueResultSchema as A, FreeTextPatchSchema as An, PdfSizeSchema as Ar, FormWidgetRefSchema as At, PageDeleteResultSchema as B, CircleDraftSchema as Bn, UnsupportedDraftSchema as Bt, FormEffectSchema as C, InkDraftSchema as Cn, CalloutLineSchema as Cr, FormFieldOptionSchema as Ct, FormFieldUpdateResultSchema as D, HighlightPatchSchema as Dn, PdfQuadSchema as Dr, FormKindSchema as Dt, FormFieldDeleteResultSchema as E, HighlightDraftSchema as En, PdfPointSchema as Er, FormFieldValueSchema as Et, MetadataUpdateResultSchema as F, WireAttachmentFileSchema as Fn, AnnotationDraftSchema as Ft, PageInsertBlankInputSchema as G, AnnotationBaseShape as Gn, NoteIconSchema as Gt, PageFlattenInputSchema as H, CaretDTOSchema as Hn, UnderlineDTOSchema as Ht, MutationMetaSchema as I, AttachmentFileInfoSchema as In, AnnotationPatchSchema as It, PageLayoutSchema as J, AnnotationFlagsPartialSchema as Jn, TextPatchSchema as Jt, PageInsertInputSchema as K, AnnotationBorderStyleSchema as Kn, TextDTOSchema as Kt, OpenDocumentResponseSchema as L, EmbeddedFileItemSchema as Ln, KIND_BY_SUBTYPE as Lt, LayerScopesSchema as M, FileAttachmentIconSchema as Mn, WidgetPlacementSchema as Mt, ManifestPageSchema as N, FileAttachmentPatchSchema as Nn, ANNOTATION_KINDS as Nt, FormImportResultSchema as O, FreeTextDTOSchema as On, PdfRectSchema as Or, FormSnapshotSchema as Ot, MetadataPatchSchema as P, FileAttachmentWireDraftSchema as Pn, AnnotationDTOSchema as Pt, PageNetworkRenderFormatSchema as Q, AnnotationStableIdSchema as Qn, ResourceRefSchema as Qt, PageBoxesSchema as R, EmbeddedFileRefSchema as Rn, WidgetAppearanceSchema as Rt, EngineErrorPayloadSchema as S, InkDTOSchema as Sn, PdfDestinationSchema as Sr, FormFieldOptionInputSchema as St, FormFieldCreateResultSchema as T, HighlightDTOSchema as Tn, LinePointsSchema as Tr, FormFieldRefSchema as Tt, PageFlattenResultSchema as U, CaretDraftSchema as Un, UnderlineDraftSchema as Ut, PageExtractInputSchema as V, CirclePatchSchema as Vn, UnsupportedPatchSchema as Vt, PageGeometrySnapshotSchema as W, CaretPatchSchema as Wn, UnderlinePatchSchema as Wt, PageMoveInputSchema as X, AnnotationPatchBaseShape as Xn, StrikeoutDraftSchema as Xt, PageListSnapshotSchema as Y, AnnotationFlagsSchema as Yn, StrikeoutDTOSchema as Yt, PageMoveResultSchema as Z, AnnotationRefSchema as Zn, StrikeoutPatchSchema as Zt, CachePinsSchema as _, PdfLinkTargetSchema as _n, PdfActionTypeSchema as _r, WeakAnnotationSessionResponseSchema as _t, AnnotationCreateResultSchema as a, SquareDTOSchema as an, LineEndingsSchema as ar, PageTextSnapshotSchema as at, DocumentMetadataSchema as b, LineDraftSchema as bn, PdfFieldActionsSchema as br, FormFieldDraftSchema as bt, AnnotationListPageSnapshotSchema as c, PolylineDTOSchema as cn, RectSchema as cr, RedactionApplyScopeSchema as ct, AnnotationUpdateResultSchema as d, PolygonDTOSchema as dn, StrikeoutIntentSchema as dr, SearchModeSchema as dt, StampWireDraftSchema as en, CaretIntentSchema as er, PageRenderQuerySchema as et, AppearanceOutcomeSchema as f, PolygonDraftSchema as fn, TextAlignmentSchema as fr, SearchQuerySchema as ft, CacheDeltaSchema as g, LinkPatchSchema as gn, PdfActionTreeSchema as gr, WeakAnnotationSessionPagesRequestSchema as gt, AttachmentsCacheSchema as h, LinkDraftSchema as hn, PdfActionTargetRefSchema as hr, SearchSnippetSchema as ht, AnnotationAppearancesQuerySchema as i, SquigglyPatchSchema as in, LineEndingSchema as ir, PageStructureCacheSchema as it, FormWidgetLinkResultSchema as j, FileAttachmentDTOSchema as jn, ToggleFieldWidgetSchema as jt, FormRepairResultSchema as k, FreeTextDraftSchema as kn, PdfRotationSchema as kr, FormValueEntrySchema as kt, AnnotationListSnapshotAllPagesSchema as l, PolylineDraftSchema as ln, RevisionTokenSchema as lr, RefetchReasonSchema as lt, AttachmentDeleteResultSchema as m, LinkDTOSchema as mn, PdfActionNodeSchema as mr, SearchSliceSchema as mt, AccessResponseSchema as n, SquigglyDTOSchema as nn, FreeTextIntentSchema as nr, PageRotateResultSchema as nt, AnnotationDeleteResultSchema as o, SquareDraftSchema as on, PdfRectDifferencesSchema as or, PdfSaveModeSchema as ot, AttachmentCreateResultSchema as p, PolygonPatchSchema as pn, DocumentActionsSnapshotSchema as pr, SearchRequestSchema as pt, PageInsertResultSchema as q, AnnotationDraftBaseShape as qn, TextDraftSchema as qt, AnnotationAppearanceManifestSchema as r, SquigglyDraftSchema as rn, InkIntentSchema as rr, PageStateSchema as rt, AnnotationListMutationMetaSchema as s, SquarePatchSchema as sn, PointSchema as sr, RedactionApplyResultSchema as st, AccessRequestSchema as t, StampWirePatchSchema as tn, ColorSchema as tr, PageRotateInputSchema as tt, AnnotationMoveResultSchema as u, PolylinePatchSchema as un, StandardFontSchema as ur, SearchMatchSchema as ut, DocumentHeadSchema as v, PdfLinkTargetWritableSchema as vn, PdfActionWireComponents as vr, FormDataFormatSchema as vt, FormEffectsResultSchema as w, InkPatchSchema as wn, InkListSchema as wr, FormFieldPatchSchema as wt, DocumentSecurityStateSchema as x, LinePatchSchema as xn, PdfPageActionsSchema as xr, FormFieldFlagsSchema as xt, DocumentManifestSchema as y, LineDTOSchema as yn, PdfAnnotationActionsSchema as yr, FormFieldDTOSchema as yt, PageDeleteInputSchema as z, CircleDTOSchema as zn, UnsupportedDTOSchema as zt };
2492
2650
 
2493
- //# sourceMappingURL=schemas-9OpSSeM6.js.map
2651
+ //# sourceMappingURL=schemas-XGrNVMDd.js.map