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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/{AnnotationList-CkijRHet.d.cts → AnnotationList-DcyhF2kU.d.cts} +1836 -1308
  2. package/dist/{AnnotationList-CkijRHet.d.ts → AnnotationList-DcyhF2kU.d.ts} +1836 -1308
  3. package/dist/{Change-CjImsrN0.cjs → Change-Ct-dB8D5.cjs} +115 -2
  4. package/dist/Change-Ct-dB8D5.cjs.map +1 -0
  5. package/dist/{Change-CKoxfTNY.js → Change-tMR34hTU.js} +92 -3
  6. package/dist/Change-tMR34hTU.js.map +1 -0
  7. package/dist/{DocumentRenderService-BfFdFSwI.cjs → DocumentRenderService-9IjSQEIU.cjs} +2 -1
  8. package/dist/{DocumentRenderService-BfFdFSwI.cjs.map → DocumentRenderService-9IjSQEIU.cjs.map} +1 -1
  9. package/dist/{DocumentRenderService-DV3J9lMz.js → DocumentRenderService-DFrZ9wfW.js} +2 -1
  10. package/dist/{DocumentRenderService-DV3J9lMz.js.map → DocumentRenderService-DFrZ9wfW.js.map} +1 -1
  11. package/dist/{DocumentSecurityService-e6vp2de8.d.cts → DocumentSecurityService-D2zA4NKi.d.cts} +2 -2
  12. package/dist/{DocumentSecurityService-CU1M6Q7m.d.ts → DocumentSecurityService-YJV9df8P.d.ts} +2 -2
  13. package/dist/{LocalEngine-DFoBm4B3.d.cts → LocalEngine-DBt2-GWF.d.ts} +102 -18
  14. package/dist/{LocalEngine-DPriFujS.d.ts → LocalEngine-IA9zh3Jh.d.cts} +102 -18
  15. package/dist/{authority-DLMNR7ff.cjs → authority-BFp6XM04.cjs} +373 -52
  16. package/dist/authority-BFp6XM04.cjs.map +1 -0
  17. package/dist/{authority-B3BklsB4.js → authority-PuxpGFhJ.js} +320 -53
  18. package/dist/authority-PuxpGFhJ.js.map +1 -0
  19. package/dist/{builders-CNj0POeY.js → builders-DV62HA3I.js} +6 -2
  20. package/dist/builders-DV62HA3I.js.map +1 -0
  21. package/dist/{builders-Cgdp_YCn.cjs → builders-DgTAj_tP.cjs} +6 -2
  22. package/dist/builders-DgTAj_tP.cjs.map +1 -0
  23. package/dist/{calibrate-DJBXnhLE.cjs → calibrate-DJbi1wuK.cjs} +118 -25
  24. package/dist/calibrate-DJbi1wuK.cjs.map +1 -0
  25. package/dist/{calibrate-7T3fnP8-.js → calibrate-nQFgCuki.js} +83 -26
  26. package/dist/calibrate-nQFgCuki.js.map +1 -0
  27. package/dist/charmap-Cprti1ta.js.map +1 -1
  28. package/dist/charmap-aYlefQP9.cjs.map +1 -1
  29. package/dist/conformance.cjs +1744 -75
  30. package/dist/conformance.cjs.map +1 -1
  31. package/dist/conformance.d.cts +105 -10
  32. package/dist/conformance.d.ts +105 -10
  33. package/dist/conformance.js +1738 -76
  34. package/dist/conformance.js.map +1 -1
  35. package/dist/index.cjs +25 -6
  36. package/dist/index.d.cts +2 -2
  37. package/dist/index.d.ts +2 -2
  38. package/dist/index.js +7 -7
  39. package/dist/public.cjs +6 -4
  40. package/dist/public.d.cts +5 -5
  41. package/dist/public.d.ts +5 -5
  42. package/dist/public.js +5 -5
  43. package/dist/{resolver-CzxmD9Ck.js → resolver-BBggAxQc.js} +6 -3
  44. package/dist/resolver-BBggAxQc.js.map +1 -0
  45. package/dist/{resolver-D2OCtE8F.cjs → resolver-BWSWSF6R.cjs} +6 -3
  46. package/dist/resolver-BWSWSF6R.cjs.map +1 -0
  47. package/dist/{runtime-Cl0v56mm.d.ts → runtime-BaDKjxiu.d.ts} +67 -140
  48. package/dist/{runtime-p1WDzDo4.d.cts → runtime-CWEuiwbk.d.cts} +67 -140
  49. package/dist/runtime.cjs +267 -7
  50. package/dist/runtime.cjs.map +1 -1
  51. package/dist/runtime.d.cts +5 -5
  52. package/dist/runtime.d.ts +5 -5
  53. package/dist/runtime.js +246 -8
  54. package/dist/runtime.js.map +1 -1
  55. package/dist/{schema-DzlUNk38.js → schema-6S2VmlAj.js} +8 -2
  56. package/dist/schema-6S2VmlAj.js.map +1 -0
  57. package/dist/{schema-C-gU4vj7.cjs → schema-miH6tWQC.cjs} +13 -1
  58. package/dist/schema-miH6tWQC.cjs.map +1 -0
  59. package/dist/{schemas-D6xOGjqg.js → schemas-BE2QGOit.js} +256 -59
  60. package/dist/schemas-BE2QGOit.js.map +1 -0
  61. package/dist/{schemas-Berf1swF.cjs → schemas-DljJR9ut.cjs} +397 -80
  62. package/dist/schemas-DljJR9ut.cjs.map +1 -0
  63. package/dist/validation.cjs +1 -1
  64. package/dist/validation.d.cts +1 -1
  65. package/dist/validation.d.ts +1 -1
  66. package/dist/validation.js +1 -1
  67. package/dist/{viewport-DlL5Bxbg.cjs → viewport-CHG9qQUb.cjs} +2 -2
  68. package/dist/{viewport-DlL5Bxbg.cjs.map → viewport-CHG9qQUb.cjs.map} +1 -1
  69. package/dist/{viewport-BJW13EGZ.js → viewport-DQR5LyX3.js} +2 -2
  70. package/dist/{viewport-BJW13EGZ.js.map → viewport-DQR5LyX3.js.map} +1 -1
  71. package/dist/wire.cjs +225 -57
  72. package/dist/wire.cjs.map +1 -1
  73. package/dist/wire.d.cts +3548 -1151
  74. package/dist/wire.d.ts +3548 -1151
  75. package/dist/wire.js +198 -53
  76. package/dist/wire.js.map +1 -1
  77. package/package.json +1 -1
  78. package/dist/Change-CKoxfTNY.js.map +0 -1
  79. package/dist/Change-CjImsrN0.cjs.map +0 -1
  80. package/dist/authority-B3BklsB4.js.map +0 -1
  81. package/dist/authority-DLMNR7ff.cjs.map +0 -1
  82. package/dist/builders-CNj0POeY.js.map +0 -1
  83. package/dist/builders-Cgdp_YCn.cjs.map +0 -1
  84. package/dist/calibrate-7T3fnP8-.js.map +0 -1
  85. package/dist/calibrate-DJBXnhLE.cjs.map +0 -1
  86. package/dist/resolver-CzxmD9Ck.js.map +0 -1
  87. package/dist/resolver-D2OCtE8F.cjs.map +0 -1
  88. package/dist/schema-C-gU4vj7.cjs.map +0 -1
  89. package/dist/schema-DzlUNk38.js.map +0 -1
  90. package/dist/schemas-Berf1swF.cjs.map +0 -1
  91. package/dist/schemas-D6xOGjqg.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { y as EngineErrorCode } from "./format-Dgg428Kb.js";
2
2
  import { c as toBase64, l as ANNOTATION_APPEARANCE_MODES, r as charMapViolation, s as fromBase64 } from "./charmap-Cprti1ta.js";
3
3
  import "./PageInsertBlankInput-DhVYVJ_S.js";
4
- import { E as FormFieldRefSchema, Et as AttachmentSchema, Gn as PageQuadSchema, Jn as PdfRectSchema, Nt as SourceResourceKeysSchema, Sn as AnnotationRefSchema, T as WidgetPatchSchema, Tt as AttachmentRefSchema, Un as PageBoxSchema, Xn as PdfSizeSchema, Yn as PdfRotationSchema, Zn as PageRefSchema, _ as AnnotationSchema, a as FormFieldPatchSchema, d as FormWidgetSchema, g as AnnotationPatchSchema, gn as PdfPageActionsSchema, h as AnnotationDraftSchema, jt as ImageResourceKeysSchema, kt as AppearanceResourceKeysSchema, n as FormFieldDraftSchema, nn as DateInputSchema, o as FormFieldValueSchema, p as WidgetPlacementSchema, rn as IsoDateTimeSchema, s as FormFieldWidgetSchema, t as FormFieldDTOSchema, vn as PdfLinkTargetSchema, w as WidgetDTOSchema, yn as PdfLinkTargetWritableSchema } from "./schema-DzlUNk38.js";
4
+ import { At as AppearanceResourceKeysSchema, Cn as AnnotationRefSchema, Dt as AttachmentSchema, E as FormFieldRefSchema, En as ColorSchema, Et as AttachmentRefSchema, Kn as PageQuadSchema, Mt as ImageResourceKeysSchema, Qn as PageRefSchema, T as WidgetPatchSchema, Tt as AttachmentFileInfoSchema, Wn as PageBoxSchema, Xn as PdfRotationSchema, Yn as PdfRectSchema, Zn as PdfSizeSchema, _ as AnnotationSchema, _n as PdfPageActionsSchema, a as FormFieldPatchSchema, bn as PdfLinkTargetWritableSchema, d as FormWidgetSchema, dn as PdfActionTreeSchema, g as AnnotationPatchSchema, h as AnnotationDraftSchema, in as IsoDateTimeSchema, n as FormFieldDraftSchema, o as FormFieldValueSchema, p as WidgetPlacementSchema, rn as DateInputSchema, s as FormFieldWidgetSchema, t as FormFieldDTOSchema, w as WidgetDTOSchema, wt as AttachmentFileBaseSchema, yn as PdfLinkTargetSchema } from "./schema-6S2VmlAj.js";
5
5
  import { z } from "zod";
6
6
  //#region src/wire/renderFamilies.ts
7
7
  const PAGE_RENDER_FAMILIES = {
@@ -16,7 +16,8 @@ const PAGE_RENDER_FAMILIES = {
16
16
  path: "render/pages",
17
17
  needs: ["doc.render"],
18
18
  planes: ["content"],
19
- pins: ["contentVersion"]
19
+ pins: ["contentVersion"],
20
+ print: null
20
21
  },
21
22
  annotations: {
22
23
  family: "annotations",
@@ -29,7 +30,8 @@ const PAGE_RENDER_FAMILIES = {
29
30
  path: "render/annotations/pages",
30
31
  needs: ["doc.render", "doc.annotate.read"],
31
32
  planes: ["content", "annotations"],
32
- pins: ["contentVersion", "annotationVersion"]
33
+ pins: ["contentVersion", "annotationVersion"],
34
+ print: null
33
35
  },
34
36
  fields: {
35
37
  family: "fields",
@@ -42,7 +44,8 @@ const PAGE_RENDER_FAMILIES = {
42
44
  path: "render/fields/pages",
43
45
  needs: ["doc.render", "doc.forms.read"],
44
46
  planes: ["content", "forms"],
45
- pins: ["contentVersion", "widgetVersion"]
47
+ pins: ["contentVersion", "widgetVersion"],
48
+ print: null
46
49
  },
47
50
  all: {
48
51
  family: "all",
@@ -67,7 +70,8 @@ const PAGE_RENDER_FAMILIES = {
67
70
  "contentVersion",
68
71
  "annotationVersion",
69
72
  "widgetVersion"
70
- ]
73
+ ],
74
+ print: null
71
75
  }
72
76
  };
73
77
  /** The family of a picture that draws `layers`. */
@@ -75,6 +79,110 @@ function pageRenderFamilyOf(layers) {
75
79
  if (layers.includeAnnotations) return layers.includeFormFields ? "all" : "annotations";
76
80
  return layers.includeFormFields ? "fields" : "pages";
77
81
  }
82
+ const PAGE_PRINT_TIERS = {
83
+ print: {
84
+ tier: "print",
85
+ dpi: 150,
86
+ needs: ["doc.print"]
87
+ },
88
+ "print-high": {
89
+ tier: "print-high",
90
+ dpi: 300,
91
+ needs: ["doc.print", "doc.print.high"]
92
+ }
93
+ };
94
+ /** The tier that prints at `dpi`. */
95
+ function pagePrintTierOf(dpi) {
96
+ return dpi === 300 ? "print-high" : "print";
97
+ }
98
+ /**
99
+ * The print pictures: each of the four families, printed at each tier. A
100
+ * print picture draws what its family draws, by the print rules: layers in
101
+ * their print state, annotations and fields by their `print` flag. So no
102
+ * print family is a screen picture under another name, and each needs its
103
+ * family's rights plus its tier's. It keeps its family's planes and pins,
104
+ * and its path is the family's with the tier after `render/`:
105
+ * `render/print-high/annotations/pages`.
106
+ */
107
+ const PAGE_PRINT_FAMILIES = {
108
+ print: {
109
+ pages: printFamily("print", "pages", "page-print", "layer-page-print"),
110
+ annotations: printFamily("print", "annotations", "page-print-annotations", "layer-page-print-annotations"),
111
+ fields: printFamily("print", "fields", "page-print-fields", "layer-page-print-fields"),
112
+ all: printFamily("print", "all", "page-print-all", "layer-page-print-all")
113
+ },
114
+ "print-high": {
115
+ pages: printFamily("print-high", "pages", "page-print-high", "layer-page-print-high"),
116
+ annotations: printFamily("print-high", "annotations", "page-print-high-annotations", "layer-page-print-high-annotations"),
117
+ fields: printFamily("print-high", "fields", "page-print-high-fields", "layer-page-print-high-fields"),
118
+ all: printFamily("print-high", "all", "page-print-high-all", "layer-page-print-high-all")
119
+ }
120
+ };
121
+ /** Every page picture: the four screen families and the eight print ones. */
122
+ const PAGE_PICTURES = [...Object.values(PAGE_RENDER_FAMILIES), ...Object.values(PAGE_PRINT_FAMILIES).flatMap((tier) => Object.values(tier))];
123
+ /** The picture that draws `layers`, for the screen or printed at `dpi`. */
124
+ function pagePictureOf(layers, printDpi) {
125
+ const family = pageRenderFamilyOf(layers);
126
+ return printDpi === void 0 ? PAGE_RENDER_FAMILIES[family] : PAGE_PRINT_FAMILIES[pagePrintTierOf(printDpi)][family];
127
+ }
128
+ function printFamily(tier, family, resource, layerResource) {
129
+ const screen = PAGE_RENDER_FAMILIES[family];
130
+ const print = PAGE_PRINT_TIERS[tier];
131
+ return {
132
+ ...screen,
133
+ resource,
134
+ layerResource,
135
+ path: `render/${tier}/${screen.path.slice(7)}`,
136
+ needs: [...screen.needs, ...print.needs],
137
+ print
138
+ };
139
+ }
140
+ //#endregion
141
+ //#region src/identity/OutlineItemRef.schema.ts
142
+ /** Wire form of `OutlineItemRef` — see the type. */
143
+ const OutlineItemRefSchema = z.object({
144
+ kind: z.literal("objectNumber"),
145
+ objectNumber: z.number().int().positive()
146
+ });
147
+ //#endregion
148
+ //#region src/dto/DocumentOutline.schema.ts
149
+ /** Wire form of an `OutlineItem` (page space) — see the type. */
150
+ const OutlineItemSchema = z.object({
151
+ ref: OutlineItemRefSchema,
152
+ parent: OutlineItemRefSchema.nullable(),
153
+ title: z.string(),
154
+ target: PdfLinkTargetSchema.nullable(),
155
+ action: PdfActionTreeSchema.nullable(),
156
+ open: z.boolean(),
157
+ color: ColorSchema.nullable(),
158
+ bold: z.boolean(),
159
+ italic: z.boolean()
160
+ });
161
+ /** Wire form of a `DocumentOutline` (page space): what `GET …/outline` answers. */
162
+ const DocumentOutlineSchema = z.object({
163
+ items: z.array(OutlineItemSchema),
164
+ incomplete: z.boolean()
165
+ });
166
+ /**
167
+ * A title as a write takes it: at most 32,767 UTF-16 code units, the most a
168
+ * PDF text string holds in every PDF app (ISO 32000-2 Annex C).
169
+ */
170
+ const OutlineTitleSchema = z.string().max(32767);
171
+ const outlineFields = {
172
+ title: OutlineTitleSchema,
173
+ target: PdfLinkTargetWritableSchema.nullable().optional(),
174
+ color: ColorSchema.nullable().optional(),
175
+ bold: z.boolean().optional(),
176
+ italic: z.boolean().optional()
177
+ };
178
+ /** Wire form of an `OutlineItemDraft` (page space). */
179
+ const OutlineItemDraftSchema = z.object(outlineFields).strict();
180
+ /** Wire form of an `OutlineItemPatch` (page space). */
181
+ const OutlineItemPatchSchema = z.object({
182
+ ...outlineFields,
183
+ title: OutlineTitleSchema.optional(),
184
+ open: z.boolean().optional()
185
+ }).strict();
78
186
  //#endregion
79
187
  //#region src/wire/schemas.ts
80
188
  /** Who a session acts for; see `Identity` in `auth/scope/types.ts`. */
@@ -438,7 +546,8 @@ const LayerScopesSchema = z.object({
438
546
  layout: LayerScopeValueSchema,
439
547
  attachments: LayerScopeValueSchema,
440
548
  metadata: LayerScopeValueSchema,
441
- actions: LayerScopeValueSchema
549
+ actions: LayerScopeValueSchema,
550
+ outline: LayerScopeValueSchema
442
551
  });
443
552
  /**
444
553
  * Per-page envelope inside `DocumentManifest`: the page, plus the
@@ -467,6 +576,7 @@ const DocumentManifestSchema = z.object({
467
576
  attachmentsVersion: z.number().int().positive().default(1),
468
577
  annotationsVersion: z.number().int().positive().default(1),
469
578
  formsVersion: z.number().int().positive().default(1),
579
+ outlineVersion: z.number().int().positive().default(1),
470
580
  auditHead: z.number().int().nonnegative(),
471
581
  baseSha: z.string(),
472
582
  layerVersion: z.number().int().nonnegative().default(0),
@@ -647,21 +757,30 @@ const AppearanceModesSchema = z.string().transform((value, ctx) => {
647
757
  * - a versioned request (one with `contentVersion`) carries every one of
648
758
  * them, since the picture changes with each.
649
759
  *
650
- * The transform stamps what the family draws onto the parsed options, so
651
- * the worker options downstream need no family.
760
+ * A print picture (`PAGE_PRINT_FAMILIES`) takes only its pins and its image
761
+ * format: its path says what it draws and at which DPI, and its size comes
762
+ * from that and the paper, so a page has one print picture per family and
763
+ * tier.
764
+ *
765
+ * The transform stamps what the picture draws (and, for a print picture,
766
+ * `usage` and its `dpi` viewport) onto the parsed options, so the worker
767
+ * options downstream need no family.
652
768
  */
653
- function buildPageRenderQuerySchema(family) {
654
- const { draws, pins } = PAGE_RENDER_FAMILIES[family];
769
+ function buildPageRenderQuerySchema(picture) {
770
+ const { family, draws, pins, print } = picture;
655
771
  const pinFields = {};
656
772
  for (const pin of pins) pinFields[pin] = z.coerce.number().int().positive().optional();
657
- return z.object({
658
- ...pinFields,
659
- format: PageNetworkRenderFormatSchema.optional(),
773
+ const screenFields = print ? {} : {
660
774
  viewport: RenderViewportSchema.optional(),
661
775
  target: RenderTargetSchema.optional(),
662
776
  rotation: RenderRotationSchema.optional(),
663
- background: RenderBackgroundSchema.optional(),
664
- quality: RenderQualitySchema.optional()
777
+ background: RenderBackgroundSchema.optional()
778
+ };
779
+ return z.object({
780
+ ...pinFields,
781
+ format: PageNetworkRenderFormatSchema.optional(),
782
+ quality: RenderQualitySchema.optional(),
783
+ ...screenFields
665
784
  }).strict().superRefine((v, ctx) => {
666
785
  const pinned = v;
667
786
  if (pinned.contentVersion === void 0) {
@@ -690,14 +809,22 @@ function buildPageRenderQuerySchema(family) {
690
809
  }
691
810
  }).transform((v) => {
692
811
  const pinned = v;
812
+ const screen = v;
693
813
  const query = { options: {
694
- ...v.target ? { target: v.target } : {},
695
- ...v.viewport ? { viewport: v.viewport } : {},
696
- ...v.rotation !== void 0 ? { rotation: v.rotation } : {},
697
- ...v.background !== void 0 ? { background: v.background } : {},
814
+ ...screen.target ? { target: screen.target } : {},
815
+ ...screen.viewport ? { viewport: screen.viewport } : {},
816
+ ...screen.rotation !== void 0 ? { rotation: screen.rotation } : {},
817
+ ...screen.background !== void 0 ? { background: screen.background } : {},
698
818
  ...v.quality !== void 0 ? { quality: v.quality } : {},
699
819
  ...v.format !== void 0 ? { format: v.format } : {},
700
- ...draws
820
+ ...draws,
821
+ ...print ? {
822
+ usage: "print",
823
+ viewport: {
824
+ kind: "dpi",
825
+ dpi: print.dpi
826
+ }
827
+ } : {}
701
828
  } };
702
829
  for (const pin of pins) if (pinned[pin] !== void 0) query[pin] = pinned[pin];
703
830
  return query;
@@ -705,11 +832,30 @@ function buildPageRenderQuerySchema(family) {
705
832
  }
706
833
  /** Query/token schemas of the four picture families, by family. */
707
834
  const PageRenderQuerySchemas = {
708
- pages: buildPageRenderQuerySchema("pages"),
709
- annotations: buildPageRenderQuerySchema("annotations"),
710
- fields: buildPageRenderQuerySchema("fields"),
711
- all: buildPageRenderQuerySchema("all")
835
+ pages: buildPageRenderQuerySchema(PAGE_RENDER_FAMILIES.pages),
836
+ annotations: buildPageRenderQuerySchema(PAGE_RENDER_FAMILIES.annotations),
837
+ fields: buildPageRenderQuerySchema(PAGE_RENDER_FAMILIES.fields),
838
+ all: buildPageRenderQuerySchema(PAGE_RENDER_FAMILIES.all)
712
839
  };
840
+ /** Query/token schemas of the print pictures, by tier and family. */
841
+ const PagePrintQuerySchemas = {
842
+ print: {
843
+ pages: buildPageRenderQuerySchema(PAGE_PRINT_FAMILIES.print.pages),
844
+ annotations: buildPageRenderQuerySchema(PAGE_PRINT_FAMILIES.print.annotations),
845
+ fields: buildPageRenderQuerySchema(PAGE_PRINT_FAMILIES.print.fields),
846
+ all: buildPageRenderQuerySchema(PAGE_PRINT_FAMILIES.print.all)
847
+ },
848
+ "print-high": {
849
+ pages: buildPageRenderQuerySchema(PAGE_PRINT_FAMILIES["print-high"].pages),
850
+ annotations: buildPageRenderQuerySchema(PAGE_PRINT_FAMILIES["print-high"].annotations),
851
+ fields: buildPageRenderQuerySchema(PAGE_PRINT_FAMILIES["print-high"].fields),
852
+ all: buildPageRenderQuerySchema(PAGE_PRINT_FAMILIES["print-high"].all)
853
+ }
854
+ };
855
+ /** The query/token schema of `picture`, screen or print. */
856
+ function pagePictureQuerySchema(picture) {
857
+ return picture.print ? PagePrintQuerySchemas[picture.print.tier][picture.family] : PageRenderQuerySchemas[picture.family];
858
+ }
713
859
  /**
714
860
  * Query/token schema of an appearance batch, keyed by `pin`. Mirrors
715
861
  * `PageRenderQuerySchema` but without page target/background or
@@ -777,6 +923,7 @@ const CacheDeltaSchema = z.object({
777
923
  layoutVersion: z.number().int().positive().optional(),
778
924
  metadataVersion: z.number().int().positive().optional(),
779
925
  attachmentsVersion: z.number().int().positive().optional(),
926
+ outlineVersion: z.number().int().positive().optional(),
780
927
  layerVersion: z.number().int().nonnegative().optional(),
781
928
  working: z.boolean().optional(),
782
929
  pages: z.array(z.object({
@@ -806,6 +953,8 @@ const PagePositionSchema = listPositionSchema(PageRefSchema);
806
953
  const AnnotationPositionSchema = listPositionSchema(AnnotationRefSchema);
807
954
  /** Where fields go in the form's calculation order. */
808
955
  const FieldPositionSchema = listPositionSchema(FormFieldRefSchema);
956
+ /** Where outline items go among one parent's children. */
957
+ const OutlinePositionSchema = listPositionSchema(OutlineItemRefSchema);
809
958
  /**
810
959
  * Stable public component names for the models every part of the document
811
960
  * wire shares (page refs, a write's meta, the metadata), like
@@ -1240,11 +1389,6 @@ const PageNameInputSchema = z.object({
1240
1389
  });
1241
1390
  /** `pages.removeName` input — see `PageRemoveNameInput`. */
1242
1391
  const PageRemoveNameInputSchema = z.object({ name: z.string().min(1) });
1243
- /** Page reorder input: the pages, in their new order, and where they go. */
1244
- const PageReorderInputSchema = z.object({
1245
- pages: z.array(PageRefSchema).min(1),
1246
- position: PagePositionSchema
1247
- }).strict();
1248
1392
  /**
1249
1393
  * Page reorder result. No per-page revision is bumped (they survive a page
1250
1394
  * reorder). The whole new order is returned so callers swap their snapshot.
@@ -1260,14 +1404,6 @@ const PageNameResultSchema = z.object({
1260
1404
  meta: MutationMetaSchema
1261
1405
  });
1262
1406
  /**
1263
- * Page rotate input. Absolute rotation (idempotent — see `PageRotateInput`),
1264
- * one value applied to every listed page.
1265
- */
1266
- const PageRotateInputSchema = z.object({
1267
- pages: z.array(PageRefSchema),
1268
- rotation: PdfRotationSchema
1269
- });
1270
- /**
1271
1407
  * Page rotate result. Rotation is presentation metadata over normalized
1272
1408
  * content: nothing per-page invalidates; the new `layout` carries the
1273
1409
  * rotation values (see `PageRotateResult`).
@@ -1276,8 +1412,6 @@ const PageRotateResultSchema = z.object({
1276
1412
  layout: PageListSnapshotSchema,
1277
1413
  meta: MutationMetaSchema
1278
1414
  });
1279
- /** Page delete input. Deleting every page is rejected server/worker-side. */
1280
- const PageDeleteInputSchema = z.object({ pages: z.array(PageRefSchema) });
1281
1415
  /**
1282
1416
  * Page delete result. Deleted page object numbers are retired (never recycled); surviving
1283
1417
  * pages keep identity + revisions (see `PageDeleteResult`).
@@ -1287,30 +1421,27 @@ const PageDeleteResultSchema = z.object({
1287
1421
  meta: MutationMetaSchema
1288
1422
  });
1289
1423
  /**
1290
- * Page insert (bytes) input — the `body` part of the multipart envelope;
1291
- * the PDF rides the part `resources.source` names. `position` omitted →
1292
- * `'end'`.
1293
- */
1294
- const PageInsertInputSchema = z.object({
1295
- position: PagePositionSchema.optional(),
1296
- resources: SourceResourceKeysSchema
1297
- }).strict();
1298
- /**
1299
- * Blank-page insert input — plain JSON, pages.insert minus the bytes.
1300
- * `size` is in PDF points (un-rotated); `count` shares the contract cap
1301
- * with the worker so a request the schema accepts cannot then fail the
1302
- * worker's own guard.
1424
+ * What blank pages to make (`PageInsertBlankSpec`). `size` is in PDF points
1425
+ * (un-rotated); `count` shares the contract cap with the worker so a request
1426
+ * the schema accepts cannot then fail the worker's own guard.
1303
1427
  */
1304
- const PageInsertBlankInputSchema = z.object({
1428
+ const PageInsertBlankSpecSchema = z.object({
1305
1429
  size: z.object({
1306
1430
  width: z.number().positive().finite(),
1307
1431
  height: z.number().positive().finite()
1308
1432
  }),
1309
- count: z.number().int().min(1).max(100).optional(),
1310
- position: PagePositionSchema.optional()
1433
+ count: z.number().int().min(1).max(100).optional()
1311
1434
  });
1312
- /** Page extract input: the pages to export, in the order they should appear. */
1313
- const PageExtractInputSchema = z.object({ pages: z.array(PageRefSchema).min(1) });
1435
+ /**
1436
+ * Page extract input: the pages to export, in the order they should appear,
1437
+ * and `pages.extract()`'s options (`PageExtractOptions`).
1438
+ */
1439
+ const PageExtractInputSchema = z.object({
1440
+ pages: z.array(PageRefSchema).min(1),
1441
+ flatten: z.object({ usage: z.enum(["display", "print"]).optional() }).strict().optional(),
1442
+ includeAnnotations: z.boolean().optional(),
1443
+ includeFormFields: z.boolean().optional()
1444
+ }).strict();
1314
1445
  /**
1315
1446
  * Page insert result — shared by bytes-insert and blank-insert: the fresh
1316
1447
  * page object numbers in insertion order plus the full new layout (see `PageInsertResult`).
@@ -1320,6 +1451,12 @@ const PageInsertResultSchema = z.object({
1320
1451
  layout: PageListSnapshotSchema,
1321
1452
  meta: MutationMetaSchema
1322
1453
  });
1454
+ /** Page restore result: the pages an undo brought back (see `PageRestoreResult`). */
1455
+ const PageRestoreResultSchema = z.object({
1456
+ pages: z.array(PageRefSchema),
1457
+ layout: PageListSnapshotSchema,
1458
+ meta: MutationMetaSchema
1459
+ });
1323
1460
  /** See `AttachmentMutationMeta`. */
1324
1461
  const AttachmentMutationMetaSchema = z.object({
1325
1462
  affectedPages: z.array(PageRefSchema),
@@ -1332,9 +1469,22 @@ const AttachmentCreateResultSchema = z.object({
1332
1469
  attachment: AttachmentSchema,
1333
1470
  meta: AttachmentMutationMetaSchema
1334
1471
  });
1472
+ const AttachmentRestoreResultSchema = z.object({
1473
+ attachment: AttachmentSchema,
1474
+ meta: AttachmentMutationMetaSchema
1475
+ });
1335
1476
  const AttachmentDeleteResultSchema = z.object({ meta: AttachmentMutationMetaSchema });
1336
1477
  /** See `AttachmentList`. */
1337
1478
  const AttachmentListSchema = z.object({ attachments: z.array(AttachmentSchema) });
1479
+ /** Embedded files (`doc.attachments`): the models the OpenAPI projection names. */
1480
+ const AttachmentWireComponents = {
1481
+ AttachmentRef: AttachmentRefSchema,
1482
+ AttachmentFileInfo: AttachmentFileInfoSchema,
1483
+ Attachment: AttachmentSchema,
1484
+ AttachmentList: AttachmentListSchema,
1485
+ AttachmentFileBase: AttachmentFileBaseSchema,
1486
+ AttachmentMutationMeta: AttachmentMutationMetaSchema
1487
+ };
1338
1488
  /**
1339
1489
  * Metadata write result: the re-read `metadata`. On the cloud,
1340
1490
  * `meta.cacheDelta` advances only `docVersion` and `metadataVersion`.
@@ -1347,6 +1497,53 @@ const CustomMetadataUpdateResultSchema = z.object({
1347
1497
  custom: CustomMetadataSchema,
1348
1498
  meta: MutationMetaSchema
1349
1499
  });
1500
+ /** The meta of every outline write: `MutationMeta` and the items it touched. */
1501
+ const OutlineMutationMetaSchema = z.object({
1502
+ affectedPages: z.array(PageRefSchema),
1503
+ cacheDelta: CacheDeltaSchema.nullable(),
1504
+ opId: z.string(),
1505
+ undoable: z.boolean(),
1506
+ changed: z.array(OutlineItemRefSchema)
1507
+ });
1508
+ /** One parent's children as a write left them; `parent: null` is the top level. */
1509
+ const OutlineOrderSchema = z.object({
1510
+ parent: OutlineItemRefSchema.nullable(),
1511
+ children: z.array(OutlineItemRefSchema)
1512
+ });
1513
+ const OutlineCreateResultSchema = z.object({
1514
+ item: OutlineItemSchema,
1515
+ order: OutlineOrderSchema,
1516
+ meta: OutlineMutationMetaSchema
1517
+ });
1518
+ const OutlineUpdateResultSchema = z.object({
1519
+ item: OutlineItemSchema,
1520
+ meta: OutlineMutationMetaSchema
1521
+ });
1522
+ const OutlineMoveResultSchema = z.object({
1523
+ orders: z.array(OutlineOrderSchema),
1524
+ meta: OutlineMutationMetaSchema
1525
+ });
1526
+ const OutlineDeleteResultSchema = z.object({ meta: OutlineMutationMetaSchema });
1527
+ const OutlineRestoreResultSchema = z.object({
1528
+ items: z.array(OutlineItemSchema),
1529
+ order: OutlineOrderSchema,
1530
+ meta: OutlineMutationMetaSchema
1531
+ });
1532
+ /**
1533
+ * Stable public component names for the outline wire model, so an OpenAPI
1534
+ * projection names each once (`OutlineItem`, not one type per response or op
1535
+ * that carries one), like `AnnotationWireComponents`.
1536
+ */
1537
+ const OutlineWireComponents = {
1538
+ OutlineItemRef: OutlineItemRefSchema,
1539
+ OutlineItem: OutlineItemSchema,
1540
+ DocumentOutline: DocumentOutlineSchema,
1541
+ OutlineItemDraft: OutlineItemDraftSchema,
1542
+ OutlineItemPatch: OutlineItemPatchSchema,
1543
+ OutlinePosition: OutlinePositionSchema,
1544
+ OutlineOrder: OutlineOrderSchema,
1545
+ OutlineMutationMeta: OutlineMutationMetaSchema
1546
+ };
1350
1547
  const Base64Schema = z.string().regex(/^[A-Za-z0-9+/]*={0,2}$/, "base64");
1351
1548
  const DocumentVersionRefSchema = z.object({
1352
1549
  baseSha256: z.string().regex(/^[0-9a-f]{64}$/),
@@ -1649,6 +1846,6 @@ const PageScaleResultSchema = z.object({
1649
1846
  meta: MutationMetaSchema
1650
1847
  });
1651
1848
  //#endregion
1652
- export { FormExportRequestSchema as $, PageRenderQuerySchemas as $t, CacheDeltaSchema as A, pageRenderFamilyOf as An, MutationMetaSchema as At, DocumentProtectionSchema as B, PageFlattenInputSchema as Bt, AttachmentCreateResultSchema as C, SignatureSnapshotSchema as Cn, IdentitySchema as Ct, BaseVersionInfoSchema as D, decodePrepared as Dn, MetadataPatchSchema as Dt, AttachmentMutationMetaSchema as E, analyzeInputFromQuery as En, ManifestPageSchema as Et, CustomMetadataUpdateResultSchema as F, OpenDocumentResponseSchema as Ft, DocumentWireComponents as G, PageInsertResultSchema as Gt, DocumentVersionRefSchema as H, PageGeometrySnapshotSchema as Ht, DigestAlgorithmSchema as I, PageBoxesSchema as It, EngineErrorPayloadSchema as J, PageNameInputSchema as Jt, EditSessionAccessSchema as K, PageLayoutSchema as Kt, DocumentHeadSchema as L, PageDeleteInputSchema as Lt, ChangeAnalysisSchema as M, ObjectNumberRangeSchema as Mt, CustomMetadataPatchSchema as N, ObjectNumberReservationRequestSchema as Nt, BundleLimitsSchema as O, encodePrepared as On, MetadataUpdateResultSchema as Ot, CustomMetadataSchema as P, ObjectNumberReservationResponseSchema as Pt, FormCalculationsReorderResultSchema as Q, PageRemoveNameInputSchema as Qt, DocumentManifestSchema as R, PageDeleteResultSchema as Rt, AppearanceOutcomeSchema as S, SignatureSeedValueSchema as Sn, FormWireComponents as St, AttachmentListSchema as T, WidgetAppearancesQuerySchema as Tn, LayerScopesSchema as Tt, DocumentVersionSchema as U, PageInsertBlankInputSchema as Ut, DocumentSecurityStateSchema as V, PageFlattenResultSchema as Vt, DocumentVersionsSchema as W, PageInsertInputSchema as Wt, FieldPositionSchema as X, PageNetworkRenderFormatSchema as Xt, FieldLockSpecSchema as Y, PageNameResultSchema as Yt, FormCalculationsReorderBodySchema as Z, PagePositionSchema as Zt, AnnotationReorderBodySchema as _, SignatureCompleteBodySchema as _n, FormWidgetRestoreResultSchema as _t, AnnotationAppearancesQuerySchema as a, PageTextSnapshotSchema as an, FormImportOptionsSchema as at, AnnotationWireComponents as b, SignaturePrepareBodySchema as bn, FormWidgetsReorderBodySchema as bt, AnnotationExportSelectionSchema as c, RedactionApplyResultSchema as cn, FormRepairResultSchema as ct, AnnotationImportBodySchema as d, SearchQuerySchema as dn, FormSetValueResultSchema as dt, PageReorderInputSchema as en, FormExportSelectionSchema as et, AnnotationImportOptionsSchema as f, SearchRequestSchema as fn, FormValuesImportBodySchema as ft, AnnotationPositionSchema as g, SignatureCancelResultSchema as gn, FormWidgetLinkResultSchema as gt, AnnotationListSchema as h, SignatureAppearanceBodySchema as hn, FormWidgetDeleteResultSchema as ht, AnnotationAppearanceExportInputSchema as i, PageScaleResultSchema as in, FormImportBodySchema as it, CachePinsSchema as j, NamedPageEntrySchema as jt, ByteRangeSchema as k, PAGE_RENDER_FAMILIES as kn, ModificationLevelSchema as kt, AnnotationFlattenInputSchema as l, RedactionApplyScopeSchema as ln, FormResetBodySchema as lt, AnnotationListMutationMetaSchema as m, SearchSnippetSchema as mn, FormValuesImportResultSchema as mt, AccessResponseSchema as n, PageRotateInputSchema as nn, FormFieldDeleteResultSchema as nt, AnnotationCreateResultSchema as o, PdfRevisionSchema as on, FormImportResultSchema as ot, AnnotationImportResultSchema as p, SearchSliceSchema as pn, FormValuesImportOptionsSchema as pt, EditSessionStatusSchema as q, PageListSnapshotSchema as qt, AnnotationAppearanceBatchSchema as r, PageRotateResultSchema as rn, FormFieldUpdateResultSchema as rt, AnnotationDeleteResultSchema as s, PdfSaveModeSchema as sn, FormMutationMetaSchema as st, AccessRequestSchema as t, PageReorderResultSchema as tn, FormFieldCreateResultSchema as tt, AnnotationFlattenResultSchema as u, SearchMatchSchema as un, FormResetResultSchema as ut, AnnotationReorderResultSchema as v, SignatureCompleteResultSchema as vn, FormWidgetUpdateBodySchema as vt, AttachmentDeleteResultSchema as w, VersionAnalysisQuerySchema as wn, LayerAnalysisQuerySchema as wt, AnnotationsExportRequestSchema as x, SignaturePreparedWireSchema as xn, FormWidgetsReorderResultSchema as xt, AnnotationUpdateResultSchema as y, SignatureDTOSchema as yn, FormWidgetUpdateResultSchema as yt, DocumentMetadataSchema as z, PageExtractInputSchema as zt };
1849
+ export { FormCalculationsReorderBodySchema as $, PageInsertBlankSpecSchema as $t, BundleLimitsSchema as A, SignaturePreparedWireSchema as An, MetadataUpdateResultSchema as At, DocumentManifestSchema as B, OutlineItemDraftSchema as Bn, OutlineMoveResultSchema as Bt, AttachmentCreateResultSchema as C, SearchSnippetSchema as Cn, FormWidgetsReorderResultSchema as Ct, AttachmentRestoreResultSchema as D, SignatureCompleteResultSchema as Dn, LayerScopesSchema as Dt, AttachmentMutationMetaSchema as E, SignatureCompleteBodySchema as En, LayerAnalysisQuerySchema as Et, CustomMetadataPatchSchema as F, analyzeInputFromQuery as Fn, ObjectNumberReservationRequestSchema as Ft, DocumentVersionSchema as G, PAGE_PRINT_FAMILIES as Gn, OutlineUpdateResultSchema as Gt, DocumentProtectionSchema as H, OutlineItemSchema as Hn, OutlineOrderSchema as Ht, CustomMetadataSchema as I, decodePrepared as In, ObjectNumberReservationResponseSchema as It, EditSessionAccessSchema as J, pagePictureOf as Jn, PageDeleteResultSchema as Jt, DocumentVersionsSchema as K, PAGE_PRINT_TIERS as Kn, OutlineWireComponents as Kt, CustomMetadataUpdateResultSchema as L, encodePrepared as Ln, OpenDocumentResponseSchema as Lt, CacheDeltaSchema as M, SignatureSnapshotSchema as Mn, MutationMetaSchema as Mt, CachePinsSchema as N, VersionAnalysisQuerySchema as Nn, NamedPageEntrySchema as Nt, AttachmentWireComponents as O, SignatureDTOSchema as On, ManifestPageSchema as Ot, ChangeAnalysisSchema as P, WidgetAppearancesQuerySchema as Pn, ObjectNumberRangeSchema as Pt, FieldPositionSchema as Q, PageGeometrySnapshotSchema as Qt, DigestAlgorithmSchema as R, pagePictureQuerySchema as Rn, OutlineCreateResultSchema as Rt, AppearanceOutcomeSchema as S, SearchSliceSchema as Sn, FormWidgetsReorderBodySchema as St, AttachmentListSchema as T, SignatureCancelResultSchema as Tn, IdentitySchema as Tt, DocumentSecurityStateSchema as U, OutlineItemRefSchema as Un, OutlinePositionSchema as Ut, DocumentMetadataSchema as V, OutlineItemPatchSchema as Vn, OutlineMutationMetaSchema as Vt, DocumentVersionRefSchema as W, PAGE_PICTURES as Wn, OutlineRestoreResultSchema as Wt, EngineErrorPayloadSchema as X, pageRenderFamilyOf as Xn, PageFlattenInputSchema as Xt, EditSessionStatusSchema as Y, pagePrintTierOf as Yn, PageExtractInputSchema as Yt, FieldLockSpecSchema as Z, PageFlattenResultSchema as Zt, AnnotationReorderBodySchema as _, RedactionApplyResultSchema as _n, FormWidgetDeleteResultSchema as _t, AnnotationAppearancesQuerySchema as a, PageNetworkRenderFormatSchema as an, FormFieldUpdateResultSchema as at, AnnotationWireComponents as b, SearchQuerySchema as bn, FormWidgetUpdateBodySchema as bt, AnnotationExportSelectionSchema as c, PageRemoveNameInputSchema as cn, FormImportResultSchema as ct, AnnotationImportBodySchema as d, PageRestoreResultSchema as dn, FormResetBodySchema as dt, PageInsertResultSchema as en, FormCalculationsReorderResultSchema as et, AnnotationImportOptionsSchema as f, PageRotateResultSchema as fn, FormResetResultSchema as ft, AnnotationPositionSchema as g, PdfSaveModeSchema as gn, FormValuesImportResultSchema as gt, AnnotationListSchema as h, PdfRevisionSchema as hn, FormValuesImportOptionsSchema as ht, AnnotationAppearanceExportInputSchema as i, PageNameResultSchema as in, FormFieldDeleteResultSchema as it, ByteRangeSchema as j, SignatureSeedValueSchema as jn, ModificationLevelSchema as jt, BaseVersionInfoSchema as k, SignaturePrepareBodySchema as kn, MetadataPatchSchema as kt, AnnotationFlattenInputSchema as l, PageRenderQuerySchemas as ln, FormMutationMetaSchema as lt, AnnotationListMutationMetaSchema as m, PageTextSnapshotSchema as mn, FormValuesImportBodySchema as mt, AccessResponseSchema as n, PageListSnapshotSchema as nn, FormExportSelectionSchema as nt, AnnotationCreateResultSchema as o, PagePositionSchema as on, FormImportBodySchema as ot, AnnotationImportResultSchema as p, PageScaleResultSchema as pn, FormSetValueResultSchema as pt, DocumentWireComponents as q, PAGE_RENDER_FAMILIES as qn, PageBoxesSchema as qt, AnnotationAppearanceBatchSchema as r, PageNameInputSchema as rn, FormFieldCreateResultSchema as rt, AnnotationDeleteResultSchema as s, PagePrintQuerySchemas as sn, FormImportOptionsSchema as st, AccessRequestSchema as t, PageLayoutSchema as tn, FormExportRequestSchema as tt, AnnotationFlattenResultSchema as u, PageReorderResultSchema as un, FormRepairResultSchema as ut, AnnotationReorderResultSchema as v, RedactionApplyScopeSchema as vn, FormWidgetLinkResultSchema as vt, AttachmentDeleteResultSchema as w, SignatureAppearanceBodySchema as wn, FormWireComponents as wt, AnnotationsExportRequestSchema as x, SearchRequestSchema as xn, FormWidgetUpdateResultSchema as xt, AnnotationUpdateResultSchema as y, SearchMatchSchema as yn, FormWidgetRestoreResultSchema as yt, DocumentHeadSchema as z, DocumentOutlineSchema as zn, OutlineDeleteResultSchema as zt };
1653
1850
 
1654
- //# sourceMappingURL=schemas-D6xOGjqg.js.map
1851
+ //# sourceMappingURL=schemas-BE2QGOit.js.map