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

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 (56) 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-DDxHpJQU.d.cts} +538 -41
  6. package/dist/{AnnotationListSnapshot-W0RCsyDE.d.ts → AnnotationListSnapshot-DDxHpJQU.d.ts} +538 -41
  7. package/dist/{DocumentSecurityService-Df79fgpe.d.cts → DocumentSecurityService-BV4_YXkU.d.cts} +33 -2
  8. package/dist/{DocumentSecurityService-B-tULKNY.d.ts → DocumentSecurityService-o9aeTHwT.d.ts} +33 -2
  9. package/dist/{Engine-D9loFZc1.d.cts → Engine-D9je6GdU.d.cts} +50 -19
  10. package/dist/{Engine-B7Oe7f5i.d.ts → Engine-DOoVem7_.d.ts} +50 -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-B_KufGJ9.js} +547 -169
  16. package/dist/builders-B_KufGJ9.js.map +1 -0
  17. package/dist/{builders-BvikWRuO.cjs → builders-Cp_rlGob.cjs} +603 -225
  18. package/dist/builders-Cp_rlGob.cjs.map +1 -0
  19. package/dist/conformance.cjs +822 -198
  20. package/dist/conformance.cjs.map +1 -1
  21. package/dist/conformance.d.cts +124 -6
  22. package/dist/conformance.d.ts +124 -6
  23. package/dist/conformance.js +777 -157
  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 +36 -18
  30. package/dist/index.d.cts +2 -2
  31. package/dist/index.d.ts +2 -2
  32. package/dist/index.js +4 -4
  33. package/dist/runtime.cjs +41 -23
  34. package/dist/runtime.cjs.map +1 -1
  35. package/dist/runtime.d.cts +103 -5
  36. package/dist/runtime.d.ts +103 -5
  37. package/dist/runtime.js +5 -5
  38. package/dist/{schemas-B_1VyFsm.cjs → schemas-D1pxEv3t.cjs} +138 -32
  39. package/dist/schemas-D1pxEv3t.cjs.map +1 -0
  40. package/dist/{schemas-9OpSSeM6.js → schemas-DAnu8tuW.js} +95 -13
  41. package/dist/schemas-DAnu8tuW.js.map +1 -0
  42. package/dist/wire.cjs +89 -3
  43. package/dist/wire.cjs.map +1 -1
  44. package/dist/wire.d.cts +99 -15
  45. package/dist/wire.d.ts +99 -15
  46. package/dist/wire.js +83 -4
  47. package/dist/wire.js.map +1 -1
  48. package/package.json +1 -1
  49. package/dist/builders-BvikWRuO.cjs.map +0 -1
  50. package/dist/builders-C548U47M.js.map +0 -1
  51. package/dist/fold-CB4fAOOy.js.map +0 -1
  52. package/dist/fold-IaMph3CO.cjs.map +0 -1
  53. package/dist/schemas-9OpSSeM6.js.map +0 -1
  54. package/dist/schemas-B_1VyFsm.cjs.map +0 -1
  55. package/dist/subtype-BvAzLCGC.js.map +0 -1
  56. package/dist/subtype-qejjVr6h.cjs.map +0 -1
@@ -1,4 +1,4 @@
1
- const require_subtype = require("./subtype-qejjVr6h.cjs");
1
+ const require_PageInsertBlankInput = require("./PageInsertBlankInput-CzShuSJI.cjs");
2
2
  let zod = require("zod");
3
3
  //#region src/geometry/schemas.ts
4
4
  /**
@@ -274,6 +274,7 @@ const AnnotationBaseShape = {
274
274
  flags: AnnotationFlagsSchema,
275
275
  rect: PdfRectSchema,
276
276
  contents: zod.z.string().nullable(),
277
+ subject: zod.z.string().nullable(),
277
278
  author: zod.z.string().nullable(),
278
279
  created: zod.z.string().datetime().nullable(),
279
280
  modified: zod.z.string().datetime().nullable(),
@@ -296,6 +297,7 @@ const AnnotationBaseShape = {
296
297
  */
297
298
  const AnnotationDraftBaseShape = {
298
299
  contents: zod.z.string().nullable().optional(),
300
+ subject: zod.z.string().nullable().optional(),
299
301
  blendMode: BlendModeSchema.optional(),
300
302
  nm: zod.z.string().optional(),
301
303
  flags: AnnotationFlagsPartialSchema.optional(),
@@ -314,6 +316,7 @@ const AnnotationDraftBaseShape = {
314
316
  */
315
317
  const AnnotationPatchBaseShape = {
316
318
  contents: zod.z.string().nullable().optional(),
319
+ subject: zod.z.string().nullable().optional(),
317
320
  blendMode: BlendModeSchema.optional(),
318
321
  groupId: zod.z.string().min(1).optional(),
319
322
  flags: AnnotationFlagsPartialSchema.optional(),
@@ -360,6 +363,8 @@ const CaretDTOSchema = zod.z.object({
360
363
  ...ColorStyleDTOShape,
361
364
  intent: CaretIntentSchema.nullable(),
362
365
  rectDifferences: PdfRectDifferencesSchema.nullable(),
366
+ rotation: zod.z.number().optional(),
367
+ unrotatedRect: PdfRectSchema.optional(),
363
368
  subtype: zod.z.literal("caret")
364
369
  });
365
370
  const CaretDraftSchema = zod.z.object({
@@ -368,6 +373,8 @@ const CaretDraftSchema = zod.z.object({
368
373
  intent: CaretIntentSchema.optional(),
369
374
  rect: PdfRectSchema,
370
375
  rectDifferences: PdfRectDifferencesSchema.nullable().optional(),
376
+ rotation: zod.z.number().nullable().optional(),
377
+ unrotatedRect: PdfRectSchema.nullable().optional(),
371
378
  subtype: zod.z.literal("caret")
372
379
  });
373
380
  const CaretPatchSchema = zod.z.object({
@@ -376,13 +383,15 @@ const CaretPatchSchema = zod.z.object({
376
383
  intent: CaretIntentSchema.optional(),
377
384
  rect: PdfRectSchema.optional(),
378
385
  rectDifferences: PdfRectDifferencesSchema.nullable().optional(),
386
+ rotation: zod.z.number().nullable().optional(),
387
+ unrotatedRect: PdfRectSchema.nullable().optional(),
379
388
  subtype: zod.z.literal("caret")
380
389
  });
381
390
  //#endregion
382
391
  //#region src/annotation/kinds/caret/index.ts
383
392
  const CaretKind = {
384
393
  subtype: "caret",
385
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.CARET,
394
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.CARET,
386
395
  dtoSchema: CaretDTOSchema,
387
396
  draftSchema: CaretDraftSchema,
388
397
  patchSchema: CaretPatchSchema
@@ -433,7 +442,7 @@ const CirclePatchSchema = zod.z.object({
433
442
  //#region src/annotation/kinds/circle/index.ts
434
443
  const CircleKind = {
435
444
  subtype: "circle",
436
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.CIRCLE,
445
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.CIRCLE,
437
446
  dtoSchema: CircleDTOSchema,
438
447
  draftSchema: CircleDraftSchema,
439
448
  patchSchema: CirclePatchSchema
@@ -517,7 +526,7 @@ const FileAttachmentPatchSchema = zod.z.object({
517
526
  */
518
527
  const FileAttachmentKind = {
519
528
  subtype: "file-attachment",
520
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.FILEATTACHMENT,
529
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.FILEATTACHMENT,
521
530
  dtoSchema: FileAttachmentDTOSchema,
522
531
  draftSchema: FileAttachmentWireDraftSchema,
523
532
  patchSchema: FileAttachmentPatchSchema
@@ -595,7 +604,7 @@ const FreeTextPatchSchema = zod.z.object({
595
604
  //#region src/annotation/kinds/free-text/index.ts
596
605
  const FreeTextKind = {
597
606
  subtype: "free-text",
598
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.FREETEXT,
607
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.FREETEXT,
599
608
  dtoSchema: FreeTextDTOSchema,
600
609
  draftSchema: FreeTextDraftSchema,
601
610
  patchSchema: FreeTextPatchSchema
@@ -635,7 +644,7 @@ const HighlightPatchSchema = zod.z.object({
635
644
  //#region src/annotation/kinds/highlight/index.ts
636
645
  const HighlightKind = {
637
646
  subtype: "highlight",
638
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.HIGHLIGHT,
647
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.HIGHLIGHT,
639
648
  dtoSchema: HighlightDTOSchema,
640
649
  draftSchema: HighlightDraftSchema,
641
650
  patchSchema: HighlightPatchSchema
@@ -672,7 +681,7 @@ const InkPatchSchema = zod.z.object({
672
681
  //#region src/annotation/kinds/ink/index.ts
673
682
  const InkKind = {
674
683
  subtype: "ink",
675
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.INK,
684
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.INK,
676
685
  dtoSchema: InkDTOSchema,
677
686
  draftSchema: InkDraftSchema,
678
687
  patchSchema: InkPatchSchema
@@ -709,7 +718,7 @@ const LinePatchSchema = zod.z.object({
709
718
  //#region src/annotation/kinds/line/index.ts
710
719
  const LineKind = {
711
720
  subtype: "line",
712
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.LINE,
721
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.LINE,
713
722
  dtoSchema: LineDTOSchema,
714
723
  draftSchema: LineDraftSchema,
715
724
  patchSchema: LinePatchSchema
@@ -817,7 +826,7 @@ const LinkPatchSchema = zod.z.object({
817
826
  //#region src/annotation/kinds/link/index.ts
818
827
  const LinkKind = {
819
828
  subtype: "link",
820
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.LINK,
829
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.LINK,
821
830
  dtoSchema: LinkDTOSchema,
822
831
  draftSchema: LinkDraftSchema,
823
832
  patchSchema: LinkPatchSchema
@@ -868,7 +877,7 @@ const PolygonPatchSchema = zod.z.object({
868
877
  //#region src/annotation/kinds/polygon/index.ts
869
878
  const PolygonKind = {
870
879
  subtype: "polygon",
871
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.POLYGON,
880
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.POLYGON,
872
881
  dtoSchema: PolygonDTOSchema,
873
882
  draftSchema: PolygonDraftSchema,
874
883
  patchSchema: PolygonPatchSchema
@@ -899,7 +908,7 @@ const PolylinePatchSchema = zod.z.object({
899
908
  //#region src/annotation/kinds/polyline/index.ts
900
909
  const PolylineKind = {
901
910
  subtype: "polyline",
902
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.POLYLINE,
911
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.POLYLINE,
903
912
  dtoSchema: PolylineDTOSchema,
904
913
  draftSchema: PolylineDraftSchema,
905
914
  patchSchema: PolylinePatchSchema
@@ -962,7 +971,7 @@ const RedactPatchSchema = zod.z.object({
962
971
  //#region src/annotation/kinds/redact/index.ts
963
972
  const RedactKind = {
964
973
  subtype: "redact",
965
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.REDACT,
974
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.REDACT,
966
975
  dtoSchema: RedactDTOSchema,
967
976
  draftSchema: RedactDraftSchema,
968
977
  patchSchema: RedactPatchSchema
@@ -987,7 +996,7 @@ const SquarePatchSchema = zod.z.object({
987
996
  //#region src/annotation/kinds/square/index.ts
988
997
  const SquareKind = {
989
998
  subtype: "square",
990
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.SQUARE,
999
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.SQUARE,
991
1000
  dtoSchema: SquareDTOSchema,
992
1001
  draftSchema: SquareDraftSchema,
993
1002
  patchSchema: SquarePatchSchema
@@ -1012,7 +1021,7 @@ const SquigglyPatchSchema = zod.z.object({
1012
1021
  //#region src/annotation/kinds/squiggly/index.ts
1013
1022
  const SquigglyKind = {
1014
1023
  subtype: "squiggly",
1015
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.SQUIGGLY,
1024
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.SQUIGGLY,
1016
1025
  dtoSchema: SquigglyDTOSchema,
1017
1026
  draftSchema: SquigglyDraftSchema,
1018
1027
  patchSchema: SquigglyPatchSchema
@@ -1067,7 +1076,7 @@ const StampWirePatchSchema = zod.z.object({
1067
1076
  */
1068
1077
  const StampKind = {
1069
1078
  subtype: "stamp",
1070
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.STAMP,
1079
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.STAMP,
1071
1080
  dtoSchema: StampDTOSchema,
1072
1081
  draftSchema: StampWireDraftSchema,
1073
1082
  patchSchema: StampWirePatchSchema
@@ -1095,7 +1104,7 @@ const StrikeoutPatchSchema = zod.z.object({
1095
1104
  //#region src/annotation/kinds/strikeout/index.ts
1096
1105
  const StrikeoutKind = {
1097
1106
  subtype: "strikeout",
1098
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.STRIKEOUT,
1107
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.STRIKEOUT,
1099
1108
  dtoSchema: StrikeoutDTOSchema,
1100
1109
  draftSchema: StrikeoutDraftSchema,
1101
1110
  patchSchema: StrikeoutPatchSchema
@@ -1115,6 +1124,8 @@ const TextDTOSchema = zod.z.object({
1115
1124
  ...AnnotationBaseShape,
1116
1125
  ...ColorStyleDTOShape,
1117
1126
  icon: NoteIconSchema,
1127
+ state: zod.z.string().nullable(),
1128
+ stateModel: zod.z.string().nullable(),
1118
1129
  subtype: zod.z.literal("text")
1119
1130
  });
1120
1131
  const TextDraftSchema = zod.z.object({
@@ -1122,6 +1133,8 @@ const TextDraftSchema = zod.z.object({
1122
1133
  ...AnnotationDraftBaseShape,
1123
1134
  rect: PdfRectSchema,
1124
1135
  icon: NoteIconSchema.optional(),
1136
+ state: zod.z.string().min(1).optional(),
1137
+ stateModel: zod.z.string().min(1).optional(),
1125
1138
  subtype: zod.z.literal("text")
1126
1139
  });
1127
1140
  const TextPatchSchema = zod.z.object({
@@ -1129,13 +1142,15 @@ const TextPatchSchema = zod.z.object({
1129
1142
  ...AnnotationPatchBaseShape,
1130
1143
  rect: PdfRectSchema.optional(),
1131
1144
  icon: NoteIconSchema.optional(),
1145
+ state: zod.z.string().min(1).nullable().optional(),
1146
+ stateModel: zod.z.string().min(1).nullable().optional(),
1132
1147
  subtype: zod.z.literal("text")
1133
1148
  });
1134
1149
  //#endregion
1135
1150
  //#region src/annotation/kinds/text/index.ts
1136
1151
  const TextKind = {
1137
1152
  subtype: "text",
1138
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.TEXT,
1153
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.TEXT,
1139
1154
  dtoSchema: TextDTOSchema,
1140
1155
  draftSchema: TextDraftSchema,
1141
1156
  patchSchema: TextPatchSchema
@@ -1160,7 +1175,7 @@ const UnderlinePatchSchema = zod.z.object({
1160
1175
  //#region src/annotation/kinds/underline/index.ts
1161
1176
  const UnderlineKind = {
1162
1177
  subtype: "underline",
1163
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.UNDERLINE,
1178
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.UNDERLINE,
1164
1179
  dtoSchema: UnderlineDTOSchema,
1165
1180
  draftSchema: UnderlineDraftSchema,
1166
1181
  patchSchema: UnderlinePatchSchema
@@ -1179,7 +1194,7 @@ const UnsupportedPatchSchema = zod.z.never();
1179
1194
  //#region src/annotation/kinds/unsupported/index.ts
1180
1195
  const UnsupportedKind = {
1181
1196
  subtype: "unsupported",
1182
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.UNKNOWN,
1197
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.UNKNOWN,
1183
1198
  dtoSchema: UnsupportedDTOSchema,
1184
1199
  draftSchema: UnsupportedDraftSchema,
1185
1200
  patchSchema: UnsupportedPatchSchema
@@ -1242,7 +1257,7 @@ const WidgetPatchSchema = zod.z.object({
1242
1257
  //#region src/annotation/kinds/widget/index.ts
1243
1258
  const WidgetKind = {
1244
1259
  subtype: "widget",
1245
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.WIDGET,
1260
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.WIDGET,
1246
1261
  dtoSchema: WidgetDTOSchema,
1247
1262
  draftSchema: WidgetDraftSchema,
1248
1263
  patchSchema: WidgetPatchSchema
@@ -1693,7 +1708,10 @@ const DocumentHeadSchema = zod.z.object({
1693
1708
  })
1694
1709
  });
1695
1710
  const AccessRequestSchema = zod.z.object({
1696
- docId: zod.z.string().min(1),
1711
+ /** Deprecated: identity now rides the PATH
1712
+ * (`/v1/docs/:docId/layers/:layerName/access`). Kept optional for the
1713
+ * legacy `/v1/access` alias, which requires `docId` in the body. */
1714
+ docId: zod.z.string().min(1).optional(),
1697
1715
  layerName: zod.z.string().min(1).optional(),
1698
1716
  password: zod.z.string().optional(),
1699
1717
  passwordGrant: zod.z.string().optional(),
@@ -1874,7 +1892,7 @@ const AccessResponseSchema = zod.z.object({
1874
1892
  }).optional()
1875
1893
  });
1876
1894
  const PdfSaveModeSchema = zod.z.enum(["incremental", "rewrite"]);
1877
- const engineErrorCodeValues = Object.values(require_subtype.EngineErrorCode);
1895
+ const engineErrorCodeValues = Object.values(require_PageInsertBlankInput.EngineErrorCode);
1878
1896
  const EngineErrorPayloadSchema = zod.z.object({
1879
1897
  name: zod.z.literal("EngineError"),
1880
1898
  code: zod.z.enum(engineErrorCodeValues),
@@ -1945,6 +1963,7 @@ const DocumentManifestSchema = zod.z.object({
1945
1963
  metadataVersion: zod.z.number().int().positive(),
1946
1964
  actionsVersion: zod.z.number().int().positive().default(1),
1947
1965
  attachmentsVersion: zod.z.number().int().positive().default(1),
1966
+ annotationsVersion: zod.z.number().int().positive().default(1),
1948
1967
  auditHead: zod.z.number().int().nonnegative(),
1949
1968
  baseSha: zod.z.string(),
1950
1969
  scopes: LayerScopesSchema.optional(),
@@ -1954,29 +1973,55 @@ const AnnotationListPageSnapshotSchema = zod.z.object({
1954
1973
  pageState: PageStateSchema,
1955
1974
  annotations: zod.z.array(AnnotationDTOSchema)
1956
1975
  });
1957
- const AnnotationListSnapshotAllPagesSchema = zod.z.object({ pages: zod.z.array(AnnotationListPageSnapshotSchema) });
1976
+ const AnnotationListSnapshotAllPagesSchema = zod.z.object({
1977
+ pages: zod.z.array(AnnotationListPageSnapshotSchema),
1978
+ auditHead: zod.z.number().int().nonnegative().optional()
1979
+ });
1958
1980
  /**
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).
1981
+ * Wire shape of `GET …/text/pages/:pon/data@<contentVersion>` and the
1982
+ * `pages.text` worker result: the UTF-16-faithful extraction, the CHARACTER
1983
+ * space size (`charCount` — the space geometry runs tile; NOT `text.length`),
1984
+ * and the optional character→text anchor map. Malformed maps are rejected
1985
+ * here with the shared `charMapViolation` invariants — absent/empty map
1986
+ * REQUIRES `charCount === text.length` (identity).
1964
1987
  */
1965
1988
  const PageTextSnapshotSchema = zod.z.object({
1966
1989
  text: zod.z.string(),
1967
- charCount: zod.z.number().int().nonnegative()
1990
+ charCount: zod.z.number().int().nonnegative(),
1991
+ charMap: zod.z.array(zod.z.tuple([zod.z.number().int().nonnegative(), zod.z.number().int().nonnegative()])).optional()
1992
+ }).superRefine((snapshot, ctx) => {
1993
+ const violation = require_PageInsertBlankInput.charMapViolation(snapshot.charCount, snapshot.text.length, snapshot.charMap);
1994
+ if (violation !== null) ctx.addIssue({
1995
+ code: zod.z.ZodIssueCode.custom,
1996
+ path: ["charMap"],
1997
+ message: violation
1998
+ });
1968
1999
  });
1969
2000
  const PageGeometryGlyphSchema = zod.z.object({
1970
2001
  looseBox: PdfRectSchema,
1971
2002
  flags: zod.z.number().int().nonnegative(),
1972
2003
  tightBox: PdfRectSchema.optional()
1973
2004
  });
1974
- const PageGeometryRunSchema = zod.z.object({
2005
+ const RotatedGeometryGlyphSchema = zod.z.object({
2006
+ looseQuad: PdfQuadSchema,
2007
+ flags: zod.z.number().int().nonnegative(),
2008
+ tightQuad: PdfQuadSchema.optional()
2009
+ });
2010
+ const UprightGeometryRunSchema = zod.z.object({
1975
2011
  rect: PdfRectSchema,
1976
2012
  charStart: zod.z.number().int().nonnegative(),
1977
2013
  glyphs: zod.z.array(PageGeometryGlyphSchema),
1978
2014
  fontSize: zod.z.number().optional()
1979
2015
  });
2016
+ const RotatedGeometryRunSchema = zod.z.object({
2017
+ rect: PdfRectSchema,
2018
+ charStart: zod.z.number().int().nonnegative(),
2019
+ glyphs: zod.z.array(RotatedGeometryGlyphSchema),
2020
+ rotation: zod.z.number(),
2021
+ ascentFlip: zod.z.boolean(),
2022
+ fontSize: zod.z.number().optional()
2023
+ });
2024
+ const PageGeometryRunSchema = zod.z.union([RotatedGeometryRunSchema, UprightGeometryRunSchema]);
1980
2025
  const PageGeometrySnapshotSchema = zod.z.object({ runs: zod.z.array(PageGeometryRunSchema) });
1981
2026
  /**
1982
2027
  * Search wire shapes: the request body of the layer search route and the
@@ -2008,11 +2053,16 @@ const SearchSnippetSchema = zod.z.object({
2008
2053
  matchStart: zod.z.number().int().nonnegative(),
2009
2054
  matchLength: zod.z.number().int().positive()
2010
2055
  });
2056
+ const PdfTextSegmentSchema = zod.z.object({
2057
+ quad: PdfQuadSchema,
2058
+ rect: PdfRectSchema,
2059
+ advance: zod.z.union([zod.z.literal(1), zod.z.literal(-1)])
2060
+ });
2011
2061
  const SearchMatchSchema = zod.z.object({
2012
2062
  pageObjectNumber: zod.z.number().int().positive(),
2013
2063
  charStart: zod.z.number().int().nonnegative(),
2014
2064
  charCount: zod.z.number().int().positive(),
2015
- rects: zod.z.array(PdfRectSchema),
2065
+ segments: zod.z.array(PdfTextSegmentSchema),
2016
2066
  snippet: SearchSnippetSchema.optional()
2017
2067
  });
2018
2068
  const SearchSliceSchema = zod.z.object({
@@ -2186,6 +2236,7 @@ const RefetchReasonSchema = zod.z.enum([
2186
2236
  const CacheDeltaSchema = zod.z.object({
2187
2237
  previousDocVersion: zod.z.number().int().positive(),
2188
2238
  docVersion: zod.z.number().int().positive(),
2239
+ annotationsVersion: zod.z.number().int().positive().optional(),
2189
2240
  pages: zod.z.array(zod.z.object({
2190
2241
  pageObjectNumber: zod.z.number().int().positive(),
2191
2242
  cache: CachePinsSchema
@@ -2454,6 +2505,37 @@ const PageDeleteResultSchema = zod.z.object({
2454
2505
  cache: PageStructureCacheSchema.nullable()
2455
2506
  });
2456
2507
  /**
2508
+ * Page insert (bytes) input — the JSON `body` part of the multipart
2509
+ * mutation envelope; the PDF itself rides the `resource:source` part.
2510
+ * `destIndex` omitted → append.
2511
+ */
2512
+ const PageInsertInputSchema = zod.z.object({ destIndex: zod.z.number().int().nonnegative().optional() });
2513
+ /**
2514
+ * Blank-page insert input — plain JSON, pages.insert minus the bytes.
2515
+ * `size` is in PDF points (un-rotated); `count` shares the contract cap
2516
+ * with the worker so a request the schema accepts cannot then fail the
2517
+ * worker's own guard.
2518
+ */
2519
+ const PageInsertBlankInputSchema = zod.z.object({
2520
+ size: zod.z.object({
2521
+ width: zod.z.number().positive().finite(),
2522
+ height: zod.z.number().positive().finite()
2523
+ }),
2524
+ count: zod.z.number().int().min(1).max(100).optional(),
2525
+ destIndex: zod.z.number().int().nonnegative().optional()
2526
+ });
2527
+ /** Page extract input: the pages to export, in the order they should appear. */
2528
+ const PageExtractInputSchema = zod.z.object({ pageObjectNumbers: zod.z.array(zod.z.number().int().positive()).min(1) });
2529
+ /**
2530
+ * Page insert result — shared by bytes-insert and blank-insert: the fresh
2531
+ * PONs in insertion order plus the full new layout (see `PageInsertResult`).
2532
+ */
2533
+ const PageInsertResultSchema = zod.z.object({
2534
+ insertedPageObjectNumbers: zod.z.array(zod.z.number().int().positive()),
2535
+ layout: PageListSnapshotSchema,
2536
+ cache: PageStructureCacheSchema.nullable()
2537
+ });
2538
+ /**
2457
2539
  * Metadata write result. The Info dict is rewritten in place, so the
2458
2540
  * result returns the re-read `metadata` plus cloud coherence pins. No
2459
2541
  * `layoutVersion` is touched — a metadata edit bumps only `docVersion`
@@ -3124,6 +3206,12 @@ Object.defineProperty(exports, "PageDeleteResultSchema", {
3124
3206
  return PageDeleteResultSchema;
3125
3207
  }
3126
3208
  });
3209
+ Object.defineProperty(exports, "PageExtractInputSchema", {
3210
+ enumerable: true,
3211
+ get: function() {
3212
+ return PageExtractInputSchema;
3213
+ }
3214
+ });
3127
3215
  Object.defineProperty(exports, "PageFlattenInputSchema", {
3128
3216
  enumerable: true,
3129
3217
  get: function() {
@@ -3142,6 +3230,24 @@ Object.defineProperty(exports, "PageGeometrySnapshotSchema", {
3142
3230
  return PageGeometrySnapshotSchema;
3143
3231
  }
3144
3232
  });
3233
+ Object.defineProperty(exports, "PageInsertBlankInputSchema", {
3234
+ enumerable: true,
3235
+ get: function() {
3236
+ return PageInsertBlankInputSchema;
3237
+ }
3238
+ });
3239
+ Object.defineProperty(exports, "PageInsertInputSchema", {
3240
+ enumerable: true,
3241
+ get: function() {
3242
+ return PageInsertInputSchema;
3243
+ }
3244
+ });
3245
+ Object.defineProperty(exports, "PageInsertResultSchema", {
3246
+ enumerable: true,
3247
+ get: function() {
3248
+ return PageInsertResultSchema;
3249
+ }
3250
+ });
3145
3251
  Object.defineProperty(exports, "PageLayoutSchema", {
3146
3252
  enumerable: true,
3147
3253
  get: function() {
@@ -3605,4 +3711,4 @@ Object.defineProperty(exports, "WireAttachmentFileSchema", {
3605
3711
  }
3606
3712
  });
3607
3713
 
3608
- //# sourceMappingURL=schemas-B_1VyFsm.cjs.map
3714
+ //# sourceMappingURL=schemas-D1pxEv3t.cjs.map