@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
  const require_format = require("./format-Bp3QFSH1.cjs");
2
2
  const require_charmap = require("./charmap-aYlefQP9.cjs");
3
3
  require("./PageInsertBlankInput-CXHAM7l6.cjs");
4
- const require_schema = require("./schema-C-gU4vj7.cjs");
4
+ const require_schema = require("./schema-miH6tWQC.cjs");
5
5
  let zod = require("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 = zod.z.object({
144
+ kind: zod.z.literal("objectNumber"),
145
+ objectNumber: zod.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 = zod.z.object({
151
+ ref: OutlineItemRefSchema,
152
+ parent: OutlineItemRefSchema.nullable(),
153
+ title: zod.z.string(),
154
+ target: require_schema.PdfLinkTargetSchema.nullable(),
155
+ action: require_schema.PdfActionTreeSchema.nullable(),
156
+ open: zod.z.boolean(),
157
+ color: require_schema.ColorSchema.nullable(),
158
+ bold: zod.z.boolean(),
159
+ italic: zod.z.boolean()
160
+ });
161
+ /** Wire form of a `DocumentOutline` (page space): what `GET …/outline` answers. */
162
+ const DocumentOutlineSchema = zod.z.object({
163
+ items: zod.z.array(OutlineItemSchema),
164
+ incomplete: zod.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 = zod.z.string().max(32767);
171
+ const outlineFields = {
172
+ title: OutlineTitleSchema,
173
+ target: require_schema.PdfLinkTargetWritableSchema.nullable().optional(),
174
+ color: require_schema.ColorSchema.nullable().optional(),
175
+ bold: zod.z.boolean().optional(),
176
+ italic: zod.z.boolean().optional()
177
+ };
178
+ /** Wire form of an `OutlineItemDraft` (page space). */
179
+ const OutlineItemDraftSchema = zod.z.object(outlineFields).strict();
180
+ /** Wire form of an `OutlineItemPatch` (page space). */
181
+ const OutlineItemPatchSchema = zod.z.object({
182
+ ...outlineFields,
183
+ title: OutlineTitleSchema.optional(),
184
+ open: zod.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 = zod.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 = zod.z.object({
467
576
  attachmentsVersion: zod.z.number().int().positive().default(1),
468
577
  annotationsVersion: zod.z.number().int().positive().default(1),
469
578
  formsVersion: zod.z.number().int().positive().default(1),
579
+ outlineVersion: zod.z.number().int().positive().default(1),
470
580
  auditHead: zod.z.number().int().nonnegative(),
471
581
  baseSha: zod.z.string(),
472
582
  layerVersion: zod.z.number().int().nonnegative().default(0),
@@ -647,21 +757,30 @@ const AppearanceModesSchema = zod.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] = zod.z.coerce.number().int().positive().optional();
657
- return zod.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 zod.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)
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
+ }
712
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 = zod.z.object({
777
923
  layoutVersion: zod.z.number().int().positive().optional(),
778
924
  metadataVersion: zod.z.number().int().positive().optional(),
779
925
  attachmentsVersion: zod.z.number().int().positive().optional(),
926
+ outlineVersion: zod.z.number().int().positive().optional(),
780
927
  layerVersion: zod.z.number().int().nonnegative().optional(),
781
928
  working: zod.z.boolean().optional(),
782
929
  pages: zod.z.array(zod.z.object({
@@ -806,6 +953,8 @@ const PagePositionSchema = listPositionSchema(require_schema.PageRefSchema);
806
953
  const AnnotationPositionSchema = listPositionSchema(require_schema.AnnotationRefSchema);
807
954
  /** Where fields go in the form's calculation order. */
808
955
  const FieldPositionSchema = listPositionSchema(require_schema.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 = zod.z.object({
1240
1389
  });
1241
1390
  /** `pages.removeName` input — see `PageRemoveNameInput`. */
1242
1391
  const PageRemoveNameInputSchema = zod.z.object({ name: zod.z.string().min(1) });
1243
- /** Page reorder input: the pages, in their new order, and where they go. */
1244
- const PageReorderInputSchema = zod.z.object({
1245
- pages: zod.z.array(require_schema.PageRefSchema).min(1),
1246
- position: PagePositionSchema
1247
- }).strict();
1248
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 = zod.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 = zod.z.object({
1267
- pages: zod.z.array(require_schema.PageRefSchema),
1268
- rotation: require_schema.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 = zod.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 = zod.z.object({ pages: zod.z.array(require_schema.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 = zod.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 = zod.z.object({
1295
- position: PagePositionSchema.optional(),
1296
- resources: require_schema.SourceResourceKeysSchema
1297
- }).strict();
1298
- /**
1299
- * Blank-page insert input — plain JSON, pages.insert minus the bytes.
1300
- * `size` is in PDF points (un-rotated); `count` shares the contract cap
1301
- * with the worker so a request the schema accepts cannot then fail the
1302
- * worker's own guard.
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 = zod.z.object({
1428
+ const PageInsertBlankSpecSchema = zod.z.object({
1305
1429
  size: zod.z.object({
1306
1430
  width: zod.z.number().positive().finite(),
1307
1431
  height: zod.z.number().positive().finite()
1308
1432
  }),
1309
- count: zod.z.number().int().min(1).max(100).optional(),
1310
- position: PagePositionSchema.optional()
1433
+ count: zod.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 = zod.z.object({ pages: zod.z.array(require_schema.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 = zod.z.object({
1440
+ pages: zod.z.array(require_schema.PageRefSchema).min(1),
1441
+ flatten: zod.z.object({ usage: zod.z.enum(["display", "print"]).optional() }).strict().optional(),
1442
+ includeAnnotations: zod.z.boolean().optional(),
1443
+ includeFormFields: zod.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 = zod.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 = zod.z.object({
1456
+ pages: zod.z.array(require_schema.PageRefSchema),
1457
+ layout: PageListSnapshotSchema,
1458
+ meta: MutationMetaSchema
1459
+ });
1323
1460
  /** See `AttachmentMutationMeta`. */
1324
1461
  const AttachmentMutationMetaSchema = zod.z.object({
1325
1462
  affectedPages: zod.z.array(require_schema.PageRefSchema),
@@ -1332,9 +1469,22 @@ const AttachmentCreateResultSchema = zod.z.object({
1332
1469
  attachment: require_schema.AttachmentSchema,
1333
1470
  meta: AttachmentMutationMetaSchema
1334
1471
  });
1472
+ const AttachmentRestoreResultSchema = zod.z.object({
1473
+ attachment: require_schema.AttachmentSchema,
1474
+ meta: AttachmentMutationMetaSchema
1475
+ });
1335
1476
  const AttachmentDeleteResultSchema = zod.z.object({ meta: AttachmentMutationMetaSchema });
1336
1477
  /** See `AttachmentList`. */
1337
1478
  const AttachmentListSchema = zod.z.object({ attachments: zod.z.array(require_schema.AttachmentSchema) });
1479
+ /** Embedded files (`doc.attachments`): the models the OpenAPI projection names. */
1480
+ const AttachmentWireComponents = {
1481
+ AttachmentRef: require_schema.AttachmentRefSchema,
1482
+ AttachmentFileInfo: require_schema.AttachmentFileInfoSchema,
1483
+ Attachment: require_schema.AttachmentSchema,
1484
+ AttachmentList: AttachmentListSchema,
1485
+ AttachmentFileBase: require_schema.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 = zod.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 = zod.z.object({
1502
+ affectedPages: zod.z.array(require_schema.PageRefSchema),
1503
+ cacheDelta: CacheDeltaSchema.nullable(),
1504
+ opId: zod.z.string(),
1505
+ undoable: zod.z.boolean(),
1506
+ changed: zod.z.array(OutlineItemRefSchema)
1507
+ });
1508
+ /** One parent's children as a write left them; `parent: null` is the top level. */
1509
+ const OutlineOrderSchema = zod.z.object({
1510
+ parent: OutlineItemRefSchema.nullable(),
1511
+ children: zod.z.array(OutlineItemRefSchema)
1512
+ });
1513
+ const OutlineCreateResultSchema = zod.z.object({
1514
+ item: OutlineItemSchema,
1515
+ order: OutlineOrderSchema,
1516
+ meta: OutlineMutationMetaSchema
1517
+ });
1518
+ const OutlineUpdateResultSchema = zod.z.object({
1519
+ item: OutlineItemSchema,
1520
+ meta: OutlineMutationMetaSchema
1521
+ });
1522
+ const OutlineMoveResultSchema = zod.z.object({
1523
+ orders: zod.z.array(OutlineOrderSchema),
1524
+ meta: OutlineMutationMetaSchema
1525
+ });
1526
+ const OutlineDeleteResultSchema = zod.z.object({ meta: OutlineMutationMetaSchema });
1527
+ const OutlineRestoreResultSchema = zod.z.object({
1528
+ items: zod.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 = zod.z.string().regex(/^[A-Za-z0-9+/]*={0,2}$/, "base64");
1351
1548
  const DocumentVersionRefSchema = zod.z.object({
1352
1549
  baseSha256: zod.z.string().regex(/^[0-9a-f]{64}$/),
@@ -1805,6 +2002,18 @@ Object.defineProperty(exports, "AttachmentMutationMetaSchema", {
1805
2002
  return AttachmentMutationMetaSchema;
1806
2003
  }
1807
2004
  });
2005
+ Object.defineProperty(exports, "AttachmentRestoreResultSchema", {
2006
+ enumerable: true,
2007
+ get: function() {
2008
+ return AttachmentRestoreResultSchema;
2009
+ }
2010
+ });
2011
+ Object.defineProperty(exports, "AttachmentWireComponents", {
2012
+ enumerable: true,
2013
+ get: function() {
2014
+ return AttachmentWireComponents;
2015
+ }
2016
+ });
1808
2017
  Object.defineProperty(exports, "BaseVersionInfoSchema", {
1809
2018
  enumerable: true,
1810
2019
  get: function() {
@@ -1883,6 +2092,12 @@ Object.defineProperty(exports, "DocumentMetadataSchema", {
1883
2092
  return DocumentMetadataSchema;
1884
2093
  }
1885
2094
  });
2095
+ Object.defineProperty(exports, "DocumentOutlineSchema", {
2096
+ enumerable: true,
2097
+ get: function() {
2098
+ return DocumentOutlineSchema;
2099
+ }
2100
+ });
1886
2101
  Object.defineProperty(exports, "DocumentProtectionSchema", {
1887
2102
  enumerable: true,
1888
2103
  get: function() {
@@ -2183,22 +2398,112 @@ Object.defineProperty(exports, "OpenDocumentResponseSchema", {
2183
2398
  return OpenDocumentResponseSchema;
2184
2399
  }
2185
2400
  });
2186
- Object.defineProperty(exports, "PAGE_RENDER_FAMILIES", {
2401
+ Object.defineProperty(exports, "OutlineCreateResultSchema", {
2187
2402
  enumerable: true,
2188
2403
  get: function() {
2189
- return PAGE_RENDER_FAMILIES;
2404
+ return OutlineCreateResultSchema;
2190
2405
  }
2191
2406
  });
2192
- Object.defineProperty(exports, "PageBoxesSchema", {
2407
+ Object.defineProperty(exports, "OutlineDeleteResultSchema", {
2193
2408
  enumerable: true,
2194
2409
  get: function() {
2195
- return PageBoxesSchema;
2410
+ return OutlineDeleteResultSchema;
2196
2411
  }
2197
2412
  });
2198
- Object.defineProperty(exports, "PageDeleteInputSchema", {
2413
+ Object.defineProperty(exports, "OutlineItemDraftSchema", {
2199
2414
  enumerable: true,
2200
2415
  get: function() {
2201
- return PageDeleteInputSchema;
2416
+ return OutlineItemDraftSchema;
2417
+ }
2418
+ });
2419
+ Object.defineProperty(exports, "OutlineItemPatchSchema", {
2420
+ enumerable: true,
2421
+ get: function() {
2422
+ return OutlineItemPatchSchema;
2423
+ }
2424
+ });
2425
+ Object.defineProperty(exports, "OutlineItemRefSchema", {
2426
+ enumerable: true,
2427
+ get: function() {
2428
+ return OutlineItemRefSchema;
2429
+ }
2430
+ });
2431
+ Object.defineProperty(exports, "OutlineItemSchema", {
2432
+ enumerable: true,
2433
+ get: function() {
2434
+ return OutlineItemSchema;
2435
+ }
2436
+ });
2437
+ Object.defineProperty(exports, "OutlineMoveResultSchema", {
2438
+ enumerable: true,
2439
+ get: function() {
2440
+ return OutlineMoveResultSchema;
2441
+ }
2442
+ });
2443
+ Object.defineProperty(exports, "OutlineMutationMetaSchema", {
2444
+ enumerable: true,
2445
+ get: function() {
2446
+ return OutlineMutationMetaSchema;
2447
+ }
2448
+ });
2449
+ Object.defineProperty(exports, "OutlineOrderSchema", {
2450
+ enumerable: true,
2451
+ get: function() {
2452
+ return OutlineOrderSchema;
2453
+ }
2454
+ });
2455
+ Object.defineProperty(exports, "OutlinePositionSchema", {
2456
+ enumerable: true,
2457
+ get: function() {
2458
+ return OutlinePositionSchema;
2459
+ }
2460
+ });
2461
+ Object.defineProperty(exports, "OutlineRestoreResultSchema", {
2462
+ enumerable: true,
2463
+ get: function() {
2464
+ return OutlineRestoreResultSchema;
2465
+ }
2466
+ });
2467
+ Object.defineProperty(exports, "OutlineUpdateResultSchema", {
2468
+ enumerable: true,
2469
+ get: function() {
2470
+ return OutlineUpdateResultSchema;
2471
+ }
2472
+ });
2473
+ Object.defineProperty(exports, "OutlineWireComponents", {
2474
+ enumerable: true,
2475
+ get: function() {
2476
+ return OutlineWireComponents;
2477
+ }
2478
+ });
2479
+ Object.defineProperty(exports, "PAGE_PICTURES", {
2480
+ enumerable: true,
2481
+ get: function() {
2482
+ return PAGE_PICTURES;
2483
+ }
2484
+ });
2485
+ Object.defineProperty(exports, "PAGE_PRINT_FAMILIES", {
2486
+ enumerable: true,
2487
+ get: function() {
2488
+ return PAGE_PRINT_FAMILIES;
2489
+ }
2490
+ });
2491
+ Object.defineProperty(exports, "PAGE_PRINT_TIERS", {
2492
+ enumerable: true,
2493
+ get: function() {
2494
+ return PAGE_PRINT_TIERS;
2495
+ }
2496
+ });
2497
+ Object.defineProperty(exports, "PAGE_RENDER_FAMILIES", {
2498
+ enumerable: true,
2499
+ get: function() {
2500
+ return PAGE_RENDER_FAMILIES;
2501
+ }
2502
+ });
2503
+ Object.defineProperty(exports, "PageBoxesSchema", {
2504
+ enumerable: true,
2505
+ get: function() {
2506
+ return PageBoxesSchema;
2202
2507
  }
2203
2508
  });
2204
2509
  Object.defineProperty(exports, "PageDeleteResultSchema", {
@@ -2231,16 +2536,10 @@ Object.defineProperty(exports, "PageGeometrySnapshotSchema", {
2231
2536
  return PageGeometrySnapshotSchema;
2232
2537
  }
2233
2538
  });
2234
- Object.defineProperty(exports, "PageInsertBlankInputSchema", {
2539
+ Object.defineProperty(exports, "PageInsertBlankSpecSchema", {
2235
2540
  enumerable: true,
2236
2541
  get: function() {
2237
- return PageInsertBlankInputSchema;
2238
- }
2239
- });
2240
- Object.defineProperty(exports, "PageInsertInputSchema", {
2241
- enumerable: true,
2242
- get: function() {
2243
- return PageInsertInputSchema;
2542
+ return PageInsertBlankSpecSchema;
2244
2543
  }
2245
2544
  });
2246
2545
  Object.defineProperty(exports, "PageInsertResultSchema", {
@@ -2285,22 +2584,22 @@ Object.defineProperty(exports, "PagePositionSchema", {
2285
2584
  return PagePositionSchema;
2286
2585
  }
2287
2586
  });
2288
- Object.defineProperty(exports, "PageRemoveNameInputSchema", {
2587
+ Object.defineProperty(exports, "PagePrintQuerySchemas", {
2289
2588
  enumerable: true,
2290
2589
  get: function() {
2291
- return PageRemoveNameInputSchema;
2590
+ return PagePrintQuerySchemas;
2292
2591
  }
2293
2592
  });
2294
- Object.defineProperty(exports, "PageRenderQuerySchemas", {
2593
+ Object.defineProperty(exports, "PageRemoveNameInputSchema", {
2295
2594
  enumerable: true,
2296
2595
  get: function() {
2297
- return PageRenderQuerySchemas;
2596
+ return PageRemoveNameInputSchema;
2298
2597
  }
2299
2598
  });
2300
- Object.defineProperty(exports, "PageReorderInputSchema", {
2599
+ Object.defineProperty(exports, "PageRenderQuerySchemas", {
2301
2600
  enumerable: true,
2302
2601
  get: function() {
2303
- return PageReorderInputSchema;
2602
+ return PageRenderQuerySchemas;
2304
2603
  }
2305
2604
  });
2306
2605
  Object.defineProperty(exports, "PageReorderResultSchema", {
@@ -2309,10 +2608,10 @@ Object.defineProperty(exports, "PageReorderResultSchema", {
2309
2608
  return PageReorderResultSchema;
2310
2609
  }
2311
2610
  });
2312
- Object.defineProperty(exports, "PageRotateInputSchema", {
2611
+ Object.defineProperty(exports, "PageRestoreResultSchema", {
2313
2612
  enumerable: true,
2314
2613
  get: function() {
2315
- return PageRotateInputSchema;
2614
+ return PageRestoreResultSchema;
2316
2615
  }
2317
2616
  });
2318
2617
  Object.defineProperty(exports, "PageRotateResultSchema", {
@@ -2471,6 +2770,24 @@ Object.defineProperty(exports, "encodePrepared", {
2471
2770
  return encodePrepared;
2472
2771
  }
2473
2772
  });
2773
+ Object.defineProperty(exports, "pagePictureOf", {
2774
+ enumerable: true,
2775
+ get: function() {
2776
+ return pagePictureOf;
2777
+ }
2778
+ });
2779
+ Object.defineProperty(exports, "pagePictureQuerySchema", {
2780
+ enumerable: true,
2781
+ get: function() {
2782
+ return pagePictureQuerySchema;
2783
+ }
2784
+ });
2785
+ Object.defineProperty(exports, "pagePrintTierOf", {
2786
+ enumerable: true,
2787
+ get: function() {
2788
+ return pagePrintTierOf;
2789
+ }
2790
+ });
2474
2791
  Object.defineProperty(exports, "pageRenderFamilyOf", {
2475
2792
  enumerable: true,
2476
2793
  get: function() {
@@ -2478,4 +2795,4 @@ Object.defineProperty(exports, "pageRenderFamilyOf", {
2478
2795
  }
2479
2796
  });
2480
2797
 
2481
- //# sourceMappingURL=schemas-Berf1swF.cjs.map
2798
+ //# sourceMappingURL=schemas-DljJR9ut.cjs.map