@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
- 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
  /**
@@ -44,34 +44,139 @@ const PdfRotationSchema = zod.z.union([
44
44
  zod.z.literal(270)
45
45
  ]);
46
46
  //#endregion
47
- //#region src/dto/PdfAction.schema.ts
48
- const PdfActionTypeSchema = zod.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 = zod.z.number().int().positive();
49
+ /** Spec-nullable axis value: absent and `null` both mean "retain current". */
50
+ const axis = zod.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 = zod.z.discriminatedUnion("kind", [
58
+ zod.z.object({
59
+ kind: zod.z.literal("xyz"),
60
+ pageObjectNumber,
61
+ left: axis,
62
+ top: axis,
63
+ zoom: axis
64
+ }),
65
+ zod.z.object({
66
+ kind: zod.z.literal("fit"),
67
+ pageObjectNumber
68
+ }),
69
+ zod.z.object({
70
+ kind: zod.z.literal("fitH"),
71
+ pageObjectNumber,
72
+ top: axis
73
+ }),
74
+ zod.z.object({
75
+ kind: zod.z.literal("fitV"),
76
+ pageObjectNumber,
77
+ left: axis
78
+ }),
79
+ zod.z.object({
80
+ kind: zod.z.literal("fitR"),
81
+ pageObjectNumber,
82
+ left: zod.z.number(),
83
+ bottom: zod.z.number(),
84
+ right: zod.z.number(),
85
+ top: zod.z.number()
86
+ }),
87
+ zod.z.object({
88
+ kind: zod.z.literal("fitB"),
89
+ pageObjectNumber
90
+ }),
91
+ zod.z.object({
92
+ kind: zod.z.literal("fitBH"),
93
+ pageObjectNumber,
94
+ top: axis
95
+ }),
96
+ zod.z.object({
97
+ kind: zod.z.literal("fitBV"),
98
+ pageObjectNumber,
99
+ left: axis
100
+ })
68
101
  ]);
69
- const PdfActionNodeSchema = zod.z.lazy(() => zod.z.object({
70
- type: PdfActionTypeSchema,
102
+ //#endregion
103
+ //#region src/dto/PdfAction.schema.ts
104
+ const PdfActionTargetRefSchema = zod.z.discriminatedUnion("kind", [zod.z.object({
105
+ kind: zod.z.literal("name"),
106
+ name: zod.z.string()
107
+ }), zod.z.object({
108
+ kind: zod.z.literal("objectNumber"),
109
+ objectNumber: zod.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: zod.z.string(),
72
- script: zod.z.string().optional(),
73
- next: zod.z.array(PdfActionNodeSchema)
74
- }));
116
+ next: zod.z.array(zod.z.lazy(() => PdfActionNodeSchema))
117
+ };
118
+ const arm = (type, shape = {}) => zod.z.object({
119
+ type: zod.z.literal(type),
120
+ ...nodeCommon,
121
+ ...shape
122
+ });
123
+ const SubmitFormFlagsSchema = zod.z.object({
124
+ raw: zod.z.number().int().nonnegative(),
125
+ exclude: zod.z.boolean(),
126
+ includeNoValueFields: zod.z.boolean(),
127
+ format: zod.z.enum([
128
+ "fdf",
129
+ "html",
130
+ "xfdf",
131
+ "pdf"
132
+ ]),
133
+ method: zod.z.enum(["post", "get"]),
134
+ submitCoordinates: zod.z.boolean(),
135
+ includeAppendSaves: zod.z.boolean(),
136
+ includeAnnotations: zod.z.boolean(),
137
+ canonicalFormat: zod.z.boolean(),
138
+ exclNonUserAnnots: zod.z.boolean(),
139
+ exclFKey: zod.z.boolean(),
140
+ embedForm: zod.z.boolean()
141
+ });
142
+ const PDF_ACTION_NODE_ARMS = [
143
+ arm("javascript", { script: zod.z.string() }),
144
+ arm("goto", { destination: PdfDestinationSchema }),
145
+ arm("uri", {
146
+ uri: zod.z.string(),
147
+ isMap: zod.z.boolean()
148
+ }),
149
+ arm("named", { name: zod.z.string() }),
150
+ arm("hide", {
151
+ targets: zod.z.array(PdfActionTargetRefSchema),
152
+ hide: zod.z.boolean()
153
+ }),
154
+ arm("reset-form", {
155
+ fields: zod.z.array(PdfActionTargetRefSchema).nullable(),
156
+ exclude: zod.z.boolean()
157
+ }),
158
+ arm("goto-remote", { filePath: zod.z.string() }),
159
+ arm("goto-embedded", { filePath: zod.z.string() }),
160
+ arm("launch", { filePath: zod.z.string() }),
161
+ arm("rendition", { script: zod.z.string().optional() }),
162
+ arm("submit-form", { payload: zod.z.object({
163
+ url: zod.z.string(),
164
+ fields: zod.z.array(PdfActionTargetRefSchema).nullable(),
165
+ flags: SubmitFormFlagsSchema,
166
+ charSet: zod.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 = zod.z.lazy(() => zod.z.discriminatedUnion("type", [...PDF_ACTION_NODE_ARMS]));
178
+ /** The `/S` vocabulary, derived from the union arms so it cannot drift. */
179
+ const PdfActionTypeSchema = zod.z.enum(PDF_ACTION_NODE_ARMS.map((option) => option.shape.type.value));
75
180
  const PdfActionTreeSchema = zod.z.object({
76
181
  root: PdfActionNodeSchema.nullable(),
77
182
  incomplete: zod.z.boolean(),
@@ -79,7 +184,8 @@ const PdfActionTreeSchema = zod.z.object({
79
184
  warnings: zod.z.array(zod.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 = zod.z.object({
@@ -111,12 +217,34 @@ const DocumentActionsSnapshotSchema = zod.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: zod.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: zod.z.string().nullable(),
405
+ subject: zod.z.string().nullable(),
277
406
  author: zod.z.string().nullable(),
278
407
  created: zod.z.string().datetime().nullable(),
279
408
  modified: zod.z.string().datetime().nullable(),
@@ -296,6 +425,7 @@ const AnnotationBaseShape = {
296
425
  */
297
426
  const AnnotationDraftBaseShape = {
298
427
  contents: zod.z.string().nullable().optional(),
428
+ subject: zod.z.string().nullable().optional(),
299
429
  blendMode: BlendModeSchema.optional(),
300
430
  nm: zod.z.string().optional(),
301
431
  flags: AnnotationFlagsPartialSchema.optional(),
@@ -314,6 +444,7 @@ const AnnotationDraftBaseShape = {
314
444
  */
315
445
  const AnnotationPatchBaseShape = {
316
446
  contents: zod.z.string().nullable().optional(),
447
+ subject: zod.z.string().nullable().optional(),
317
448
  blendMode: BlendModeSchema.optional(),
318
449
  groupId: zod.z.string().min(1).optional(),
319
450
  flags: AnnotationFlagsPartialSchema.optional(),
@@ -360,6 +491,8 @@ const CaretDTOSchema = zod.z.object({
360
491
  ...ColorStyleDTOShape,
361
492
  intent: CaretIntentSchema.nullable(),
362
493
  rectDifferences: PdfRectDifferencesSchema.nullable(),
494
+ rotation: zod.z.number().optional(),
495
+ unrotatedRect: PdfRectSchema.optional(),
363
496
  subtype: zod.z.literal("caret")
364
497
  });
365
498
  const CaretDraftSchema = zod.z.object({
@@ -368,6 +501,8 @@ const CaretDraftSchema = zod.z.object({
368
501
  intent: CaretIntentSchema.optional(),
369
502
  rect: PdfRectSchema,
370
503
  rectDifferences: PdfRectDifferencesSchema.nullable().optional(),
504
+ rotation: zod.z.number().nullable().optional(),
505
+ unrotatedRect: PdfRectSchema.nullable().optional(),
371
506
  subtype: zod.z.literal("caret")
372
507
  });
373
508
  const CaretPatchSchema = zod.z.object({
@@ -376,13 +511,15 @@ const CaretPatchSchema = zod.z.object({
376
511
  intent: CaretIntentSchema.optional(),
377
512
  rect: PdfRectSchema.optional(),
378
513
  rectDifferences: PdfRectDifferencesSchema.nullable().optional(),
514
+ rotation: zod.z.number().nullable().optional(),
515
+ unrotatedRect: PdfRectSchema.nullable().optional(),
379
516
  subtype: zod.z.literal("caret")
380
517
  });
381
518
  //#endregion
382
519
  //#region src/annotation/kinds/caret/index.ts
383
520
  const CaretKind = {
384
521
  subtype: "caret",
385
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.CARET,
522
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.CARET,
386
523
  dtoSchema: CaretDTOSchema,
387
524
  draftSchema: CaretDraftSchema,
388
525
  patchSchema: CaretPatchSchema
@@ -433,7 +570,7 @@ const CirclePatchSchema = zod.z.object({
433
570
  //#region src/annotation/kinds/circle/index.ts
434
571
  const CircleKind = {
435
572
  subtype: "circle",
436
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.CIRCLE,
573
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.CIRCLE,
437
574
  dtoSchema: CircleDTOSchema,
438
575
  draftSchema: CircleDraftSchema,
439
576
  patchSchema: CirclePatchSchema
@@ -517,7 +654,7 @@ const FileAttachmentPatchSchema = zod.z.object({
517
654
  */
518
655
  const FileAttachmentKind = {
519
656
  subtype: "file-attachment",
520
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.FILEATTACHMENT,
657
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.FILEATTACHMENT,
521
658
  dtoSchema: FileAttachmentDTOSchema,
522
659
  draftSchema: FileAttachmentWireDraftSchema,
523
660
  patchSchema: FileAttachmentPatchSchema
@@ -595,7 +732,7 @@ const FreeTextPatchSchema = zod.z.object({
595
732
  //#region src/annotation/kinds/free-text/index.ts
596
733
  const FreeTextKind = {
597
734
  subtype: "free-text",
598
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.FREETEXT,
735
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.FREETEXT,
599
736
  dtoSchema: FreeTextDTOSchema,
600
737
  draftSchema: FreeTextDraftSchema,
601
738
  patchSchema: FreeTextPatchSchema
@@ -635,7 +772,7 @@ const HighlightPatchSchema = zod.z.object({
635
772
  //#region src/annotation/kinds/highlight/index.ts
636
773
  const HighlightKind = {
637
774
  subtype: "highlight",
638
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.HIGHLIGHT,
775
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.HIGHLIGHT,
639
776
  dtoSchema: HighlightDTOSchema,
640
777
  draftSchema: HighlightDraftSchema,
641
778
  patchSchema: HighlightPatchSchema
@@ -672,7 +809,7 @@ const InkPatchSchema = zod.z.object({
672
809
  //#region src/annotation/kinds/ink/index.ts
673
810
  const InkKind = {
674
811
  subtype: "ink",
675
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.INK,
812
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.INK,
676
813
  dtoSchema: InkDTOSchema,
677
814
  draftSchema: InkDraftSchema,
678
815
  patchSchema: InkPatchSchema
@@ -709,65 +846,13 @@ const LinePatchSchema = zod.z.object({
709
846
  //#region src/annotation/kinds/line/index.ts
710
847
  const LineKind = {
711
848
  subtype: "line",
712
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.LINE,
849
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.LINE,
713
850
  dtoSchema: LineDTOSchema,
714
851
  draftSchema: LineDraftSchema,
715
852
  patchSchema: LinePatchSchema
716
853
  };
717
854
  //#endregion
718
855
  //#region src/annotation/kinds/link/schema.ts
719
- const pageObjectNumber = zod.z.number().int().positive();
720
- /** Spec-nullable axis value: absent and `null` both mean "retain current". */
721
- const axis = zod.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 = zod.z.discriminatedUnion("kind", [
727
- zod.z.object({
728
- kind: zod.z.literal("xyz"),
729
- pageObjectNumber,
730
- left: axis,
731
- top: axis,
732
- zoom: axis
733
- }),
734
- zod.z.object({
735
- kind: zod.z.literal("fit"),
736
- pageObjectNumber
737
- }),
738
- zod.z.object({
739
- kind: zod.z.literal("fitH"),
740
- pageObjectNumber,
741
- top: axis
742
- }),
743
- zod.z.object({
744
- kind: zod.z.literal("fitV"),
745
- pageObjectNumber,
746
- left: axis
747
- }),
748
- zod.z.object({
749
- kind: zod.z.literal("fitR"),
750
- pageObjectNumber,
751
- left: zod.z.number(),
752
- bottom: zod.z.number(),
753
- right: zod.z.number(),
754
- top: zod.z.number()
755
- }),
756
- zod.z.object({
757
- kind: zod.z.literal("fitB"),
758
- pageObjectNumber
759
- }),
760
- zod.z.object({
761
- kind: zod.z.literal("fitBH"),
762
- pageObjectNumber,
763
- top: axis
764
- }),
765
- zod.z.object({
766
- kind: zod.z.literal("fitBV"),
767
- pageObjectNumber,
768
- left: axis
769
- })
770
- ]);
771
856
  const GotoTargetSchema = zod.z.object({
772
857
  kind: zod.z.literal("goto"),
773
858
  destination: PdfDestinationSchema
@@ -817,7 +902,7 @@ const LinkPatchSchema = zod.z.object({
817
902
  //#region src/annotation/kinds/link/index.ts
818
903
  const LinkKind = {
819
904
  subtype: "link",
820
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.LINK,
905
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.LINK,
821
906
  dtoSchema: LinkDTOSchema,
822
907
  draftSchema: LinkDraftSchema,
823
908
  patchSchema: LinkPatchSchema
@@ -868,7 +953,7 @@ const PolygonPatchSchema = zod.z.object({
868
953
  //#region src/annotation/kinds/polygon/index.ts
869
954
  const PolygonKind = {
870
955
  subtype: "polygon",
871
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.POLYGON,
956
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.POLYGON,
872
957
  dtoSchema: PolygonDTOSchema,
873
958
  draftSchema: PolygonDraftSchema,
874
959
  patchSchema: PolygonPatchSchema
@@ -899,7 +984,7 @@ const PolylinePatchSchema = zod.z.object({
899
984
  //#region src/annotation/kinds/polyline/index.ts
900
985
  const PolylineKind = {
901
986
  subtype: "polyline",
902
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.POLYLINE,
987
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.POLYLINE,
903
988
  dtoSchema: PolylineDTOSchema,
904
989
  draftSchema: PolylineDraftSchema,
905
990
  patchSchema: PolylinePatchSchema
@@ -962,7 +1047,7 @@ const RedactPatchSchema = zod.z.object({
962
1047
  //#region src/annotation/kinds/redact/index.ts
963
1048
  const RedactKind = {
964
1049
  subtype: "redact",
965
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.REDACT,
1050
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.REDACT,
966
1051
  dtoSchema: RedactDTOSchema,
967
1052
  draftSchema: RedactDraftSchema,
968
1053
  patchSchema: RedactPatchSchema
@@ -987,7 +1072,7 @@ const SquarePatchSchema = zod.z.object({
987
1072
  //#region src/annotation/kinds/square/index.ts
988
1073
  const SquareKind = {
989
1074
  subtype: "square",
990
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.SQUARE,
1075
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.SQUARE,
991
1076
  dtoSchema: SquareDTOSchema,
992
1077
  draftSchema: SquareDraftSchema,
993
1078
  patchSchema: SquarePatchSchema
@@ -1012,7 +1097,7 @@ const SquigglyPatchSchema = zod.z.object({
1012
1097
  //#region src/annotation/kinds/squiggly/index.ts
1013
1098
  const SquigglyKind = {
1014
1099
  subtype: "squiggly",
1015
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.SQUIGGLY,
1100
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.SQUIGGLY,
1016
1101
  dtoSchema: SquigglyDTOSchema,
1017
1102
  draftSchema: SquigglyDraftSchema,
1018
1103
  patchSchema: SquigglyPatchSchema
@@ -1067,7 +1152,7 @@ const StampWirePatchSchema = zod.z.object({
1067
1152
  */
1068
1153
  const StampKind = {
1069
1154
  subtype: "stamp",
1070
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.STAMP,
1155
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.STAMP,
1071
1156
  dtoSchema: StampDTOSchema,
1072
1157
  draftSchema: StampWireDraftSchema,
1073
1158
  patchSchema: StampWirePatchSchema
@@ -1095,7 +1180,7 @@ const StrikeoutPatchSchema = zod.z.object({
1095
1180
  //#region src/annotation/kinds/strikeout/index.ts
1096
1181
  const StrikeoutKind = {
1097
1182
  subtype: "strikeout",
1098
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.STRIKEOUT,
1183
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.STRIKEOUT,
1099
1184
  dtoSchema: StrikeoutDTOSchema,
1100
1185
  draftSchema: StrikeoutDraftSchema,
1101
1186
  patchSchema: StrikeoutPatchSchema
@@ -1115,6 +1200,8 @@ const TextDTOSchema = zod.z.object({
1115
1200
  ...AnnotationBaseShape,
1116
1201
  ...ColorStyleDTOShape,
1117
1202
  icon: NoteIconSchema,
1203
+ state: zod.z.string().nullable(),
1204
+ stateModel: zod.z.string().nullable(),
1118
1205
  subtype: zod.z.literal("text")
1119
1206
  });
1120
1207
  const TextDraftSchema = zod.z.object({
@@ -1122,6 +1209,8 @@ const TextDraftSchema = zod.z.object({
1122
1209
  ...AnnotationDraftBaseShape,
1123
1210
  rect: PdfRectSchema,
1124
1211
  icon: NoteIconSchema.optional(),
1212
+ state: zod.z.string().min(1).optional(),
1213
+ stateModel: zod.z.string().min(1).optional(),
1125
1214
  subtype: zod.z.literal("text")
1126
1215
  });
1127
1216
  const TextPatchSchema = zod.z.object({
@@ -1129,13 +1218,15 @@ const TextPatchSchema = zod.z.object({
1129
1218
  ...AnnotationPatchBaseShape,
1130
1219
  rect: PdfRectSchema.optional(),
1131
1220
  icon: NoteIconSchema.optional(),
1221
+ state: zod.z.string().min(1).nullable().optional(),
1222
+ stateModel: zod.z.string().min(1).nullable().optional(),
1132
1223
  subtype: zod.z.literal("text")
1133
1224
  });
1134
1225
  //#endregion
1135
1226
  //#region src/annotation/kinds/text/index.ts
1136
1227
  const TextKind = {
1137
1228
  subtype: "text",
1138
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.TEXT,
1229
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.TEXT,
1139
1230
  dtoSchema: TextDTOSchema,
1140
1231
  draftSchema: TextDraftSchema,
1141
1232
  patchSchema: TextPatchSchema
@@ -1160,7 +1251,7 @@ const UnderlinePatchSchema = zod.z.object({
1160
1251
  //#region src/annotation/kinds/underline/index.ts
1161
1252
  const UnderlineKind = {
1162
1253
  subtype: "underline",
1163
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.UNDERLINE,
1254
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.UNDERLINE,
1164
1255
  dtoSchema: UnderlineDTOSchema,
1165
1256
  draftSchema: UnderlineDraftSchema,
1166
1257
  patchSchema: UnderlinePatchSchema
@@ -1179,7 +1270,7 @@ const UnsupportedPatchSchema = zod.z.never();
1179
1270
  //#region src/annotation/kinds/unsupported/index.ts
1180
1271
  const UnsupportedKind = {
1181
1272
  subtype: "unsupported",
1182
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.UNKNOWN,
1273
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.UNKNOWN,
1183
1274
  dtoSchema: UnsupportedDTOSchema,
1184
1275
  draftSchema: UnsupportedDraftSchema,
1185
1276
  patchSchema: UnsupportedPatchSchema
@@ -1242,7 +1333,7 @@ const WidgetPatchSchema = zod.z.object({
1242
1333
  //#region src/annotation/kinds/widget/index.ts
1243
1334
  const WidgetKind = {
1244
1335
  subtype: "widget",
1245
- pdfSubtypeCode: require_subtype.PdfAnnotationSubtypeCode.WIDGET,
1336
+ pdfSubtypeCode: require_PageInsertBlankInput.PdfAnnotationSubtypeCode.WIDGET,
1246
1337
  dtoSchema: WidgetDTOSchema,
1247
1338
  draftSchema: WidgetDraftSchema,
1248
1339
  patchSchema: WidgetPatchSchema
@@ -1693,7 +1784,10 @@ const DocumentHeadSchema = zod.z.object({
1693
1784
  })
1694
1785
  });
1695
1786
  const AccessRequestSchema = zod.z.object({
1696
- docId: zod.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: zod.z.string().min(1).optional(),
1697
1791
  layerName: zod.z.string().min(1).optional(),
1698
1792
  password: zod.z.string().optional(),
1699
1793
  passwordGrant: zod.z.string().optional(),
@@ -1874,7 +1968,7 @@ const AccessResponseSchema = zod.z.object({
1874
1968
  }).optional()
1875
1969
  });
1876
1970
  const PdfSaveModeSchema = zod.z.enum(["incremental", "rewrite"]);
1877
- const engineErrorCodeValues = Object.values(require_subtype.EngineErrorCode);
1971
+ const engineErrorCodeValues = Object.values(require_PageInsertBlankInput.EngineErrorCode);
1878
1972
  const EngineErrorPayloadSchema = zod.z.object({
1879
1973
  name: zod.z.literal("EngineError"),
1880
1974
  code: zod.z.enum(engineErrorCodeValues),
@@ -1945,6 +2039,7 @@ const DocumentManifestSchema = zod.z.object({
1945
2039
  metadataVersion: zod.z.number().int().positive(),
1946
2040
  actionsVersion: zod.z.number().int().positive().default(1),
1947
2041
  attachmentsVersion: zod.z.number().int().positive().default(1),
2042
+ annotationsVersion: zod.z.number().int().positive().default(1),
1948
2043
  auditHead: zod.z.number().int().nonnegative(),
1949
2044
  baseSha: zod.z.string(),
1950
2045
  scopes: LayerScopesSchema.optional(),
@@ -1954,29 +2049,55 @@ const AnnotationListPageSnapshotSchema = zod.z.object({
1954
2049
  pageState: PageStateSchema,
1955
2050
  annotations: zod.z.array(AnnotationDTOSchema)
1956
2051
  });
1957
- const AnnotationListSnapshotAllPagesSchema = zod.z.object({ pages: zod.z.array(AnnotationListPageSnapshotSchema) });
2052
+ const AnnotationListSnapshotAllPagesSchema = zod.z.object({
2053
+ pages: zod.z.array(AnnotationListPageSnapshotSchema),
2054
+ auditHead: zod.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 = zod.z.object({
1966
2065
  text: zod.z.string(),
1967
- charCount: zod.z.number().int().nonnegative()
2066
+ charCount: zod.z.number().int().nonnegative(),
2067
+ charMap: zod.z.array(zod.z.tuple([zod.z.number().int().nonnegative(), zod.z.number().int().nonnegative()])).optional()
2068
+ }).superRefine((snapshot, ctx) => {
2069
+ const violation = require_PageInsertBlankInput.charMapViolation(snapshot.charCount, snapshot.text.length, snapshot.charMap);
2070
+ if (violation !== null) ctx.addIssue({
2071
+ code: zod.z.ZodIssueCode.custom,
2072
+ path: ["charMap"],
2073
+ message: violation
2074
+ });
1968
2075
  });
1969
2076
  const PageGeometryGlyphSchema = zod.z.object({
1970
2077
  looseBox: PdfRectSchema,
1971
2078
  flags: zod.z.number().int().nonnegative(),
1972
2079
  tightBox: PdfRectSchema.optional()
1973
2080
  });
1974
- const PageGeometryRunSchema = zod.z.object({
2081
+ const RotatedGeometryGlyphSchema = zod.z.object({
2082
+ looseQuad: PdfQuadSchema,
2083
+ flags: zod.z.number().int().nonnegative(),
2084
+ tightQuad: PdfQuadSchema.optional()
2085
+ });
2086
+ const UprightGeometryRunSchema = zod.z.object({
1975
2087
  rect: PdfRectSchema,
1976
2088
  charStart: zod.z.number().int().nonnegative(),
1977
2089
  glyphs: zod.z.array(PageGeometryGlyphSchema),
1978
2090
  fontSize: zod.z.number().optional()
1979
2091
  });
2092
+ const RotatedGeometryRunSchema = zod.z.object({
2093
+ rect: PdfRectSchema,
2094
+ charStart: zod.z.number().int().nonnegative(),
2095
+ glyphs: zod.z.array(RotatedGeometryGlyphSchema),
2096
+ rotation: zod.z.number(),
2097
+ ascentFlip: zod.z.boolean(),
2098
+ fontSize: zod.z.number().optional()
2099
+ });
2100
+ const PageGeometryRunSchema = zod.z.union([RotatedGeometryRunSchema, UprightGeometryRunSchema]);
1980
2101
  const PageGeometrySnapshotSchema = zod.z.object({ runs: zod.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 = zod.z.object({
2008
2129
  matchStart: zod.z.number().int().nonnegative(),
2009
2130
  matchLength: zod.z.number().int().positive()
2010
2131
  });
2132
+ const PdfTextSegmentSchema = zod.z.object({
2133
+ quad: PdfQuadSchema,
2134
+ rect: PdfRectSchema,
2135
+ advance: zod.z.union([zod.z.literal(1), zod.z.literal(-1)])
2136
+ });
2011
2137
  const SearchMatchSchema = zod.z.object({
2012
2138
  pageObjectNumber: zod.z.number().int().positive(),
2013
2139
  charStart: zod.z.number().int().nonnegative(),
2014
2140
  charCount: zod.z.number().int().positive(),
2015
- rects: zod.z.array(PdfRectSchema),
2141
+ segments: zod.z.array(PdfTextSegmentSchema),
2016
2142
  snippet: SearchSnippetSchema.optional()
2017
2143
  });
2018
2144
  const SearchSliceSchema = zod.z.object({
@@ -2186,6 +2312,7 @@ const RefetchReasonSchema = zod.z.enum([
2186
2312
  const CacheDeltaSchema = zod.z.object({
2187
2313
  previousDocVersion: zod.z.number().int().positive(),
2188
2314
  docVersion: zod.z.number().int().positive(),
2315
+ annotationsVersion: zod.z.number().int().positive().optional(),
2189
2316
  pages: zod.z.array(zod.z.object({
2190
2317
  pageObjectNumber: zod.z.number().int().positive(),
2191
2318
  cache: CachePinsSchema
@@ -2454,6 +2581,37 @@ const PageDeleteResultSchema = zod.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 = zod.z.object({ destIndex: zod.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 = zod.z.object({
2596
+ size: zod.z.object({
2597
+ width: zod.z.number().positive().finite(),
2598
+ height: zod.z.number().positive().finite()
2599
+ }),
2600
+ count: zod.z.number().int().min(1).max(100).optional(),
2601
+ destIndex: zod.z.number().int().nonnegative().optional()
2602
+ });
2603
+ /** Page extract input: the pages to export, in the order they should appear. */
2604
+ const PageExtractInputSchema = zod.z.object({ pageObjectNumbers: zod.z.array(zod.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 = zod.z.object({
2610
+ insertedPageObjectNumbers: zod.z.array(zod.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`
@@ -3124,6 +3282,12 @@ Object.defineProperty(exports, "PageDeleteResultSchema", {
3124
3282
  return PageDeleteResultSchema;
3125
3283
  }
3126
3284
  });
3285
+ Object.defineProperty(exports, "PageExtractInputSchema", {
3286
+ enumerable: true,
3287
+ get: function() {
3288
+ return PageExtractInputSchema;
3289
+ }
3290
+ });
3127
3291
  Object.defineProperty(exports, "PageFlattenInputSchema", {
3128
3292
  enumerable: true,
3129
3293
  get: function() {
@@ -3142,6 +3306,24 @@ Object.defineProperty(exports, "PageGeometrySnapshotSchema", {
3142
3306
  return PageGeometrySnapshotSchema;
3143
3307
  }
3144
3308
  });
3309
+ Object.defineProperty(exports, "PageInsertBlankInputSchema", {
3310
+ enumerable: true,
3311
+ get: function() {
3312
+ return PageInsertBlankInputSchema;
3313
+ }
3314
+ });
3315
+ Object.defineProperty(exports, "PageInsertInputSchema", {
3316
+ enumerable: true,
3317
+ get: function() {
3318
+ return PageInsertInputSchema;
3319
+ }
3320
+ });
3321
+ Object.defineProperty(exports, "PageInsertResultSchema", {
3322
+ enumerable: true,
3323
+ get: function() {
3324
+ return PageInsertResultSchema;
3325
+ }
3326
+ });
3145
3327
  Object.defineProperty(exports, "PageLayoutSchema", {
3146
3328
  enumerable: true,
3147
3329
  get: function() {
@@ -3220,6 +3402,12 @@ Object.defineProperty(exports, "PdfActionNodeSchema", {
3220
3402
  return PdfActionNodeSchema;
3221
3403
  }
3222
3404
  });
3405
+ Object.defineProperty(exports, "PdfActionTargetRefSchema", {
3406
+ enumerable: true,
3407
+ get: function() {
3408
+ return PdfActionTargetRefSchema;
3409
+ }
3410
+ });
3223
3411
  Object.defineProperty(exports, "PdfActionTreeSchema", {
3224
3412
  enumerable: true,
3225
3413
  get: function() {
@@ -3232,6 +3420,12 @@ Object.defineProperty(exports, "PdfActionTypeSchema", {
3232
3420
  return PdfActionTypeSchema;
3233
3421
  }
3234
3422
  });
3423
+ Object.defineProperty(exports, "PdfActionWireComponents", {
3424
+ enumerable: true,
3425
+ get: function() {
3426
+ return PdfActionWireComponents;
3427
+ }
3428
+ });
3235
3429
  Object.defineProperty(exports, "PdfAnnotationActionsSchema", {
3236
3430
  enumerable: true,
3237
3431
  get: function() {
@@ -3605,4 +3799,4 @@ Object.defineProperty(exports, "WireAttachmentFileSchema", {
3605
3799
  }
3606
3800
  });
3607
3801
 
3608
- //# sourceMappingURL=schemas-B_1VyFsm.cjs.map
3802
+ //# sourceMappingURL=schemas-CS5iPpX5.cjs.map