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

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 (59) hide show
  1. package/dist/{AbortError-CRSooKsk.cjs → AbortError-Cq2igpZ6.cjs} +2 -2
  2. package/dist/{AbortError-CRSooKsk.cjs.map → AbortError-Cq2igpZ6.cjs.map} +1 -1
  3. package/dist/{AbortError-8-9JAX1Y.js → AbortError-DHqPBnYc.js} +2 -2
  4. package/dist/{AbortError-8-9JAX1Y.js.map → AbortError-DHqPBnYc.js.map} +1 -1
  5. package/dist/{AnnotationListSnapshot-C1U3XUxP.d.cts → AnnotationListSnapshot-D3mFut1e.d.cts} +1323 -214
  6. package/dist/{AnnotationListSnapshot-C1U3XUxP.d.ts → AnnotationListSnapshot-D3mFut1e.d.ts} +1323 -214
  7. package/dist/{DocumentSecurityService-6rhztZlz.d.cts → DocumentSecurityService-ClTZc0zO.d.cts} +2 -2
  8. package/dist/{DocumentSecurityService-7nL9aY75.d.ts → DocumentSecurityService-_JRjqvoI.d.ts} +2 -2
  9. package/dist/{Engine-D3868xIU.d.cts → Engine-Bx0NOfmd.d.cts} +219 -11
  10. package/dist/{Engine-CWnAKccD.d.ts → Engine-DxtpCYcP.d.ts} +219 -11
  11. package/dist/{PageInsertBlankInput-CzShuSJI.cjs → PageInsertBlankInput-CqXBmFhN.cjs} +37 -2
  12. package/dist/PageInsertBlankInput-CqXBmFhN.cjs.map +1 -0
  13. package/dist/{PageInsertBlankInput-WKY0tr6S.js → PageInsertBlankInput-cHq9-i-z.js} +37 -2
  14. package/dist/PageInsertBlankInput-cHq9-i-z.js.map +1 -0
  15. package/dist/{builders-Do6_4KnS.cjs → builders-Bqm8yTpi.cjs} +1483 -11
  16. package/dist/builders-Bqm8yTpi.cjs.map +1 -0
  17. package/dist/{builders-Cdz34nbF.js → builders-Dqo2X-dt.js} +1364 -12
  18. package/dist/builders-Dqo2X-dt.js.map +1 -0
  19. package/dist/conformance.cjs +1630 -107
  20. package/dist/conformance.cjs.map +1 -1
  21. package/dist/conformance.d.cts +117 -3
  22. package/dist/conformance.d.ts +117 -3
  23. package/dist/conformance.js +1627 -108
  24. package/dist/conformance.js.map +1 -1
  25. package/dist/{fold-C7I5GpBz.cjs → fold-2V29cxCV.cjs} +2 -2
  26. package/dist/{fold-C7I5GpBz.cjs.map → fold-2V29cxCV.cjs.map} +1 -1
  27. package/dist/{fold-BfyxxwS6.js → fold-CdEJTBTn.js} +2 -2
  28. package/dist/{fold-BfyxxwS6.js.map → fold-CdEJTBTn.js.map} +1 -1
  29. package/dist/index.cjs +33 -4
  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-D-jumvgM.cjs → resolver-CYVNV4hn.cjs} +216 -10
  34. package/dist/resolver-CYVNV4hn.cjs.map +1 -0
  35. package/dist/{resolver-CHG4waXL.js → resolver-inAVzsWt.js} +157 -11
  36. package/dist/resolver-inAVzsWt.js.map +1 -0
  37. package/dist/runtime.cjs +34 -5
  38. package/dist/runtime.d.cts +253 -5
  39. package/dist/runtime.d.ts +253 -5
  40. package/dist/runtime.js +6 -6
  41. package/dist/{schemas-XGrNVMDd.js → schemas-BLARNCgx.js} +469 -7
  42. package/dist/schemas-BLARNCgx.js.map +1 -0
  43. package/dist/{schemas-CS5iPpX5.cjs → schemas-DIqFMmrC.cjs} +672 -6
  44. package/dist/schemas-DIqFMmrC.cjs.map +1 -0
  45. package/dist/wire.cjs +250 -12
  46. package/dist/wire.cjs.map +1 -1
  47. package/dist/wire.d.cts +444 -4
  48. package/dist/wire.d.ts +444 -4
  49. package/dist/wire.js +214 -13
  50. package/dist/wire.js.map +1 -1
  51. package/package.json +1 -1
  52. package/dist/PageInsertBlankInput-CzShuSJI.cjs.map +0 -1
  53. package/dist/PageInsertBlankInput-WKY0tr6S.js.map +0 -1
  54. package/dist/builders-Cdz34nbF.js.map +0 -1
  55. package/dist/builders-Do6_4KnS.cjs.map +0 -1
  56. package/dist/resolver-CHG4waXL.js.map +0 -1
  57. package/dist/resolver-D-jumvgM.cjs.map +0 -1
  58. package/dist/schemas-CS5iPpX5.cjs.map +0 -1
  59. package/dist/schemas-XGrNVMDd.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { f as EngineErrorCode, i as charMapViolation, u as PdfAnnotationSubtypeCode } from "./PageInsertBlankInput-WKY0tr6S.js";
1
+ import { f as EngineErrorCode, i as charMapViolation, u as PdfAnnotationSubtypeCode } from "./PageInsertBlankInput-cHq9-i-z.js";
2
2
  import { z } from "zod";
3
3
  //#region src/geometry/schemas.ts
4
4
  /**
@@ -666,12 +666,77 @@ const FileAttachmentKind = {
666
666
  * key that was never registered fails loud there). The read-back DTO keeps the
667
667
  * narrower {@link StandardFontSchema}. */
668
668
  const FreeTextFontSchema = z.string().min(1);
669
+ const HexColorSchema = z.string().regex(/^#[0-9a-fA-F]{6}$/);
670
+ const RichTextRunStyleShape = {
671
+ family: z.string().min(1),
672
+ weight: z.number().int().min(100).max(900),
673
+ italic: z.boolean(),
674
+ size: z.number().nonnegative(),
675
+ color: HexColorSchema,
676
+ decoration: z.array(z.enum([
677
+ "underline",
678
+ "line-through",
679
+ "word"
680
+ ])),
681
+ script: z.enum([
682
+ "normal",
683
+ "sub",
684
+ "super"
685
+ ]),
686
+ letterSpacing: z.number(),
687
+ horizontalScale: z.number().positive(),
688
+ unknown: z.string().optional()
689
+ };
690
+ const RichTextParagraphPropsShape = {
691
+ align: z.enum([
692
+ "left",
693
+ "center",
694
+ "right",
695
+ "justify"
696
+ ]),
697
+ dir: z.enum(["ltr", "rtl"]),
698
+ lineHeight: z.number().positive().optional(),
699
+ margins: z.object({
700
+ top: z.number(),
701
+ bottom: z.number(),
702
+ left: z.number(),
703
+ right: z.number()
704
+ }).optional(),
705
+ textIndent: z.number().optional(),
706
+ unknown: z.string().optional()
707
+ };
708
+ const RichTextRunStyleDeltaSchema = z.object(RichTextRunStyleShape).partial();
709
+ const RichTextParagraphSchema = z.object({
710
+ ...RichTextParagraphPropsShape,
711
+ runs: z.array(z.object({
712
+ text: z.string(),
713
+ style: RichTextRunStyleDeltaSchema.optional()
714
+ }))
715
+ }).partial({
716
+ align: true,
717
+ dir: true
718
+ });
719
+ const RichTextDocumentSchema = z.object({
720
+ body: z.object({
721
+ ...RichTextRunStyleShape,
722
+ ...RichTextParagraphPropsShape
723
+ }),
724
+ paragraphs: z.array(RichTextParagraphSchema)
725
+ });
726
+ const RichTextDocumentInputSchema = z.object({
727
+ body: z.object({
728
+ ...RichTextRunStyleShape,
729
+ ...RichTextParagraphPropsShape
730
+ }).partial().optional(),
731
+ paragraphs: z.array(RichTextParagraphSchema)
732
+ });
669
733
  const FreeTextDTOSchema = z.object({
670
734
  ...AnnotationBaseShape,
671
735
  intent: FreeTextIntentSchema,
672
- fontFamily: StandardFontSchema,
736
+ fontFamily: FreeTextFontSchema,
673
737
  fontSize: z.number().positive(),
674
738
  textAlign: TextAlignmentSchema,
739
+ richText: RichTextDocumentSchema,
675
740
  color: ColorSchema,
676
741
  fontColor: ColorSchema.optional(),
677
742
  interiorColor: ColorSchema.nullable(),
@@ -692,6 +757,7 @@ const FreeTextDraftSchema = z.object({
692
757
  fontFamily: FreeTextFontSchema,
693
758
  fontSize: z.number().positive(),
694
759
  textAlign: TextAlignmentSchema,
760
+ richText: RichTextDocumentInputSchema.optional(),
695
761
  rect: PdfRectSchema,
696
762
  color: ColorSchema.optional(),
697
763
  fontColor: ColorSchema.optional(),
@@ -713,6 +779,7 @@ const FreeTextPatchSchema = z.object({
713
779
  fontFamily: FreeTextFontSchema.optional(),
714
780
  fontSize: z.number().positive().optional(),
715
781
  textAlign: TextAlignmentSchema.optional(),
782
+ richText: RichTextDocumentInputSchema.optional(),
716
783
  rect: PdfRectSchema.optional(),
717
784
  color: ColorSchema.optional(),
718
785
  fontColor: ColorSchema.optional(),
@@ -1126,7 +1193,7 @@ const StampWireDraftSchema = z.object({
1126
1193
  ...AnnotationDraftBaseShape,
1127
1194
  rect: PdfRectSchema,
1128
1195
  source: ResourceRefSchema,
1129
- name: z.string().optional(),
1196
+ name: z.string().min(1).optional(),
1130
1197
  fit: StampFitSchema.optional(),
1131
1198
  rotation: z.number().nullable().optional(),
1132
1199
  unrotatedRect: PdfRectSchema.nullable().optional(),
@@ -1136,7 +1203,7 @@ const StampWirePatchSchema = z.object({
1136
1203
  ...AnnotationPatchBaseShape,
1137
1204
  rect: PdfRectSchema.optional(),
1138
1205
  source: ResourceRefSchema.optional(),
1139
- name: z.string().optional(),
1206
+ name: z.string().min(1).nullable().optional(),
1140
1207
  fit: StampFitSchema.optional(),
1141
1208
  rotation: z.number().nullable().optional(),
1142
1209
  unrotatedRect: PdfRectSchema.nullable().optional(),
@@ -1644,6 +1711,11 @@ const FormFieldDraftSchema = z.discriminatedUnion("family", [
1644
1711
  multiSelect: z.boolean().optional(),
1645
1712
  options: z.array(FormFieldOptionInputSchema).optional(),
1646
1713
  widget: WidgetPlacementSchema.optional()
1714
+ }),
1715
+ z.object({
1716
+ ...FormFieldDraftBaseShape,
1717
+ family: z.literal("signature"),
1718
+ widget: WidgetPlacementSchema.optional()
1647
1719
  })
1648
1720
  ]);
1649
1721
  const FormFieldPatchBaseShape = {
@@ -2042,6 +2114,9 @@ const DocumentManifestSchema = z.object({
2042
2114
  annotationsVersion: z.number().int().positive().default(1),
2043
2115
  auditHead: z.number().int().nonnegative(),
2044
2116
  baseSha: z.string(),
2117
+ layerVersion: z.number().int().nonnegative().default(0),
2118
+ working: z.boolean().default(false),
2119
+ baseByteLength: z.number().int().nonnegative().default(0),
2045
2120
  scopes: LayerScopesSchema.optional(),
2046
2121
  pages: z.array(ManifestPageSchema)
2047
2122
  });
@@ -2313,6 +2388,8 @@ const CacheDeltaSchema = z.object({
2313
2388
  previousDocVersion: z.number().int().positive(),
2314
2389
  docVersion: z.number().int().positive(),
2315
2390
  annotationsVersion: z.number().int().positive().optional(),
2391
+ layerVersion: z.number().int().nonnegative().optional(),
2392
+ working: z.boolean().optional(),
2316
2393
  pages: z.array(z.object({
2317
2394
  pageObjectNumber: z.number().int().positive(),
2318
2395
  cache: CachePinsSchema
@@ -2491,6 +2568,23 @@ const PageFlattenResultSchema = z.object({
2491
2568
  })),
2492
2569
  meta: MutationMetaSchema.nullable()
2493
2570
  });
2571
+ /** See `AnnotationFlattenResult`. */
2572
+ const AnnotationFlattenResultSchema = z.object({
2573
+ pageObjectNumber: z.number().int().positive(),
2574
+ usage: z.enum(["display", "print"]),
2575
+ results: z.array(z.object({
2576
+ ref: AnnotationRefSchema,
2577
+ status: z.enum(["applied", "skipped"])
2578
+ })),
2579
+ meta: MutationMetaSchema.nullable()
2580
+ });
2581
+ /** `annotations.flatten` input — see `AnnotationFlattenInput`. */
2582
+ const AnnotationFlattenInputSchema = z.object({
2583
+ refs: z.array(AnnotationRefSchema).min(1),
2584
+ usage: z.enum(["display", "print"])
2585
+ });
2586
+ /** `annotations.exportAppearance` input — see `AnnotationAppearanceExportInput`. */
2587
+ const AnnotationAppearanceExportInputSchema = z.object({ refs: z.array(AnnotationRefSchema).min(1) });
2494
2588
  const PageFlattenInputSchema = z.object({
2495
2589
  pageObjectNumbers: z.array(z.number().int().positive()),
2496
2590
  usage: z.enum(["display", "print"])
@@ -2523,10 +2617,34 @@ const RedactionApplyResultSchema = z.object({
2523
2617
  * `pageObjectNumber` everywhere except the per-element `index`, which is
2524
2618
  * display order and intentionally not an identity. Carries geometry only.
2525
2619
  */
2620
+ /** See `NamedPageEntry`: decoded key + what it resolves to. */
2621
+ const NamedPageEntrySchema = z.object({
2622
+ name: z.string(),
2623
+ target: z.discriminatedUnion("kind", [
2624
+ z.object({
2625
+ kind: z.literal("page"),
2626
+ pageObjectNumber: z.number().int().positive()
2627
+ }),
2628
+ z.object({
2629
+ kind: z.literal("template"),
2630
+ objectNumber: z.number().int().positive()
2631
+ }),
2632
+ z.object({ kind: z.literal("dangling") })
2633
+ ])
2634
+ });
2526
2635
  const PageListSnapshotSchema = z.object({
2527
2636
  pageCount: z.number().int().nonnegative(),
2528
- pages: z.array(PageLayoutSchema)
2637
+ pages: z.array(PageLayoutSchema),
2638
+ namedPages: z.array(NamedPageEntrySchema).optional()
2639
+ });
2640
+ /** `pages.setName` input — see `PageNameInput`. */
2641
+ const PageNameInputSchema = z.object({
2642
+ name: z.string().min(1),
2643
+ pageObjectNumber: z.number().int().positive(),
2644
+ replace: z.string().min(1).optional()
2529
2645
  });
2646
+ /** `pages.removeName` input — see `PageRemoveNameInput`. */
2647
+ const PageRemoveNameInputSchema = z.object({ name: z.string().min(1) });
2530
2648
  /**
2531
2649
  * Page reorder input. Pages are always addressed by `pageObjectNumber`;
2532
2650
  * `destIndex` is the insertion point in the post-removal index space.
@@ -2553,6 +2671,11 @@ const PageMoveResultSchema = z.object({
2553
2671
  layout: PageListSnapshotSchema,
2554
2672
  cache: PageStructureCacheSchema.nullable()
2555
2673
  });
2674
+ /** Named-page mutation result — layout-shaped, see `PageNameResult`. */
2675
+ const PageNameResultSchema = z.object({
2676
+ layout: PageListSnapshotSchema,
2677
+ cache: PageStructureCacheSchema.nullable()
2678
+ });
2556
2679
  /**
2557
2680
  * Page rotate input. ABSOLUTE rotation (idempotent — see `PageRotateInput`),
2558
2681
  * one value applied to every listed page.
@@ -2645,7 +2768,346 @@ const WeakAnnotationSessionResponseSchema = z.object({
2645
2768
  pageObjectNumbers: z.array(z.number().int().positive())
2646
2769
  });
2647
2770
  const WeakAnnotationSessionPagesRequestSchema = z.object({ pageObjectNumbers: z.array(z.number().int().positive()).transform((pages) => [...new Set(pages)]) });
2771
+ const BASE64_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
2772
+ /** Standard base64 (padded). Dependency-free: no Buffer, runs in browsers too. */
2773
+ function toBase64(bytes) {
2774
+ let out = "";
2775
+ for (let i = 0; i < bytes.length; i += 3) {
2776
+ const b0 = bytes[i];
2777
+ const b1 = bytes[i + 1];
2778
+ const b2 = bytes[i + 2];
2779
+ out += BASE64_ALPHABET[b0 >> 2];
2780
+ out += BASE64_ALPHABET[(b0 & 3) << 4 | (b1 ?? 0) >> 4];
2781
+ out += b1 === void 0 ? "=" : BASE64_ALPHABET[(b1 & 15) << 2 | (b2 ?? 0) >> 6];
2782
+ out += b2 === void 0 ? "=" : BASE64_ALPHABET[b2 & 63];
2783
+ }
2784
+ return out;
2785
+ }
2786
+ function fromBase64(encoded) {
2787
+ let end = encoded.length;
2788
+ while (end > 0 && encoded[end - 1] === "=") end -= 1;
2789
+ const clean = encoded.slice(0, end);
2790
+ if (clean.length % 4 === 1 || /[^A-Za-z0-9+/]/.test(clean)) throw new Error("malformed base64");
2791
+ const bytes = [];
2792
+ let buffer = 0;
2793
+ let bits = 0;
2794
+ for (const ch of clean) {
2795
+ buffer = buffer << 6 | BASE64_ALPHABET.indexOf(ch);
2796
+ bits += 6;
2797
+ if (bits >= 8) {
2798
+ bits -= 8;
2799
+ bytes.push(buffer >> bits & 255);
2800
+ }
2801
+ }
2802
+ return Uint8Array.from(bytes);
2803
+ }
2804
+ const Base64Schema = z.string().regex(/^[A-Za-z0-9+/]*={0,2}$/, "base64");
2805
+ const DocumentVersionRefSchema = z.object({
2806
+ baseSha256: z.string().regex(/^[0-9a-f]{64}$/),
2807
+ editsVersion: z.number().int().nonnegative()
2808
+ });
2809
+ const ByteRangeSchema = z.tuple([
2810
+ z.number().int().nonnegative(),
2811
+ z.number().int().nonnegative(),
2812
+ z.number().int().nonnegative(),
2813
+ z.number().int().nonnegative()
2814
+ ]);
2815
+ /** `SignaturePrepared` with the digest as base64. */
2816
+ const SignaturePreparedWireSchema = z.object({
2817
+ signingId: z.string().min(1),
2818
+ digest: Base64Schema,
2819
+ algorithm: z.enum([
2820
+ "sha256",
2821
+ "sha384",
2822
+ "sha512"
2823
+ ]),
2824
+ byteRange: ByteRangeSchema,
2825
+ contentsSize: z.number().int().positive(),
2826
+ subFilter: z.string(),
2827
+ expectedVersion: DocumentVersionRefSchema,
2828
+ expiresAt: z.string().nullable()
2829
+ });
2830
+ function encodePrepared(prepared) {
2831
+ return {
2832
+ ...prepared,
2833
+ digest: toBase64(prepared.digest)
2834
+ };
2835
+ }
2836
+ function decodePrepared(wire) {
2837
+ return {
2838
+ ...wire,
2839
+ digest: fromBase64(wire.digest),
2840
+ subFilter: wire.subFilter
2841
+ };
2842
+ }
2843
+ /** The JSON body of a completion: the CMS as base64 beside the fence. */
2844
+ const SignatureCompleteBodySchema = z.object({
2845
+ cms: Base64Schema.refine((v) => v.length > 0, "cms is required"),
2846
+ expectedVersion: DocumentVersionRefSchema
2847
+ });
2848
+ const DocMdpPermissionSchema = z.union([
2849
+ z.literal(1),
2850
+ z.literal(2),
2851
+ z.literal(3)
2852
+ ]);
2853
+ const ModificationLevelSchema = z.enum([
2854
+ "none",
2855
+ "lta",
2856
+ "fill",
2857
+ "annotate"
2858
+ ]);
2859
+ const DigestAlgorithmSchema = z.enum([
2860
+ "sha1",
2861
+ "sha256",
2862
+ "sha384",
2863
+ "sha512"
2864
+ ]);
2865
+ const FieldLockSpecSchema = z.object({
2866
+ action: z.enum([
2867
+ "all",
2868
+ "include",
2869
+ "exclude"
2870
+ ]),
2871
+ fields: z.array(z.string()),
2872
+ permission: DocMdpPermissionSchema.optional()
2873
+ });
2874
+ const SignatureSeedValueSchema = z.object({
2875
+ requiredFlags: z.number().int(),
2876
+ presentFlags: z.number().int(),
2877
+ version: z.number().int().nullable(),
2878
+ mdp: z.union([
2879
+ z.literal(0),
2880
+ z.literal(1),
2881
+ z.literal(2),
2882
+ z.literal(3)
2883
+ ]).nullable(),
2884
+ filter: z.string().nullable(),
2885
+ subFilters: z.array(z.string()),
2886
+ digestMethods: z.array(z.string()),
2887
+ reasons: z.array(z.string()),
2888
+ unsupportedRequired: z.boolean()
2889
+ });
2890
+ const SignatureDTOSchema = z.object({
2891
+ index: z.number().int().nonnegative(),
2892
+ field: FormFieldRefSchema,
2893
+ fieldName: z.string(),
2894
+ widget: FormWidgetRefSchema.nullable(),
2895
+ signed: z.boolean(),
2896
+ kind: z.enum(["signature", "timestamp"]),
2897
+ filter: z.string().nullable(),
2898
+ subFilter: z.string().nullable(),
2899
+ byteRange: ByteRangeSchema.nullable(),
2900
+ contentsSize: z.number().int().nonnegative(),
2901
+ coverage: z.enum([
2902
+ "whole-revision",
2903
+ "partial",
2904
+ "malformed"
2905
+ ]).nullable(),
2906
+ revisionIndex: z.number().int().nonnegative().nullable(),
2907
+ signer: z.object({
2908
+ name: z.string().nullable(),
2909
+ reason: z.string().nullable(),
2910
+ location: z.string().nullable(),
2911
+ contactInfo: z.string().nullable(),
2912
+ claimedTime: z.string().nullable()
2913
+ }),
2914
+ docMdp: DocMdpPermissionSchema.nullable(),
2915
+ catalogCertification: z.boolean(),
2916
+ fieldMdp: FieldLockSpecSchema.nullable(),
2917
+ lock: FieldLockSpecSchema.nullable(),
2918
+ seedValue: SignatureSeedValueSchema.nullable()
2919
+ });
2920
+ const DocumentProtectionSchema = z.object({
2921
+ enforced: ModificationLevelSchema.nullable(),
2922
+ judged: ModificationLevelSchema.nullable(),
2923
+ certification: z.object({
2924
+ signatureIndex: z.number().int().nonnegative(),
2925
+ permission: DocMdpPermissionSchema
2926
+ }).nullable(),
2927
+ fieldLocks: z.array(z.object({
2928
+ signatureIndex: z.number().int().nonnegative(),
2929
+ source: z.enum(["fieldmdp", "lock"]),
2930
+ spec: FieldLockSpecSchema
2931
+ })),
2932
+ policyVersion: z.number().int()
2933
+ });
2934
+ const PdfRevisionSchema = z.object({
2935
+ index: z.number().int().nonnegative(),
2936
+ end: z.number().int().nonnegative(),
2937
+ xrefOffset: z.number().int().nonnegative(),
2938
+ signatureIndex: z.number().int().nonnegative().nullable()
2939
+ });
2940
+ const SignatureSnapshotSchema = z.object({
2941
+ chainValid: z.boolean(),
2942
+ revisions: z.array(PdfRevisionSchema),
2943
+ signatures: z.array(SignatureDTOSchema),
2944
+ protection: DocumentProtectionSchema
2945
+ });
2946
+ const BaseVersionInfoSchema = z.object({
2947
+ sha256: z.string().regex(/^[0-9a-f]{64}$/),
2948
+ byteLength: z.number().int().nonnegative()
2949
+ });
2950
+ const SignatureCompleteResultSchema = z.object({
2951
+ status: z.enum(["completed", "already-completed"]),
2952
+ signature: SignatureDTOSchema,
2953
+ version: BaseVersionInfoSchema,
2954
+ previous: DocumentVersionRefSchema,
2955
+ protection: DocumentProtectionSchema,
2956
+ meta: MutationMetaSchema
2957
+ });
2958
+ const SignatureAbortResultSchema = z.object({ status: z.enum([
2959
+ "aborted",
2960
+ "already-completed",
2961
+ "unknown"
2962
+ ]) });
2963
+ const ChangeFindingSchema = z.object({
2964
+ rule: z.string(),
2965
+ verdict: z.enum([
2966
+ "permitted",
2967
+ "forbidden",
2968
+ "incomplete"
2969
+ ]),
2970
+ objectNumber: z.number().int().nonnegative(),
2971
+ edge: z.string().optional(),
2972
+ detail: z.string().optional()
2973
+ });
2974
+ const AnalysisDetailSchema = z.enum(["summary", "full"]);
2975
+ /** The analysis: one verdict (`current`) with its findings, the restrictions it was judged under, and facts about the revisions in between. */
2976
+ const ChangeAnalysisSchema = z.object({
2977
+ mode: z.enum(["authoritative", "exploratory"]),
2978
+ policyVersion: z.number().int(),
2979
+ basis: z.object({
2980
+ version: BaseVersionInfoSchema,
2981
+ editsVersion: z.number().int().nonnegative(),
2982
+ source: z.enum(["persisted", "working-copy"])
2983
+ }),
2984
+ since: z.object({
2985
+ revisionIndex: z.number().int().nonnegative(),
2986
+ signatureIndex: z.number().int().nonnegative().nullable()
2987
+ }),
2988
+ until: z.object({ revisionIndex: z.number().int().nonnegative() }),
2989
+ restrictions: z.array(z.object({
2990
+ signatureIndex: z.number().int().nonnegative(),
2991
+ revisionIndex: z.number().int().nonnegative(),
2992
+ source: z.enum([
2993
+ "docmdp",
2994
+ "fieldmdp",
2995
+ "lock"
2996
+ ]),
2997
+ own: z.boolean(),
2998
+ permission: z.union([
2999
+ z.literal(1),
3000
+ z.literal(2),
3001
+ z.literal(3)
3002
+ ]).optional(),
3003
+ fields: z.unknown().optional()
3004
+ })),
3005
+ current: z.object({
3006
+ verdict: z.enum([
3007
+ "unchanged",
3008
+ "permitted",
3009
+ "forbidden",
3010
+ "indeterminate"
3011
+ ]),
3012
+ complete: z.boolean(),
3013
+ primary: ChangeFindingSchema.optional(),
3014
+ findings: z.array(ChangeFindingSchema),
3015
+ method: z.enum(["net-state", "net-state+replay"])
3016
+ }),
3017
+ later: z.object({
3018
+ revisionCount: z.number().int().nonnegative(),
3019
+ undoneObjectNumbers: z.array(z.number().int().nonnegative())
3020
+ }),
3021
+ /** Equals `current.verdict`. */
3022
+ verdict: z.enum([
3023
+ "unchanged",
3024
+ "permitted",
3025
+ "forbidden",
3026
+ "indeterminate"
3027
+ ]),
3028
+ /** The step DTOs are large and evolving; carried verbatim. */
3029
+ steps: z.array(z.unknown())
3030
+ });
3031
+ const SignatureAttributionSchema = z.object({
3032
+ name: z.string().optional(),
3033
+ reason: z.string().optional(),
3034
+ location: z.string().optional(),
3035
+ contactInfo: z.string().optional()
3036
+ });
3037
+ /** The JSON part of a visual signature fill (multipart envelope): which resource part holds the PDF, and its page. */
3038
+ const SignatureAppearanceBodySchema = z.object({
3039
+ resource: z.string().min(1),
3040
+ pageIndex: z.number().int().nonnegative().optional()
3041
+ });
3042
+ /**
3043
+ * The JSON part of a prepare (multipart envelope): `SignaturePrepareInput`
3044
+ * with the appearance artwork referenced by its resource part instead of
3045
+ * inline bytes.
3046
+ */
3047
+ const SignaturePrepareBodySchema = z.object({
3048
+ field: FormFieldRefSchema,
3049
+ kind: z.enum(["signature", "timestamp"]).optional(),
3050
+ subFilter: z.enum(["adbe.pkcs7.detached", "ETSI.CAdES.detached"]).optional(),
3051
+ digest: z.enum([
3052
+ "sha256",
3053
+ "sha384",
3054
+ "sha512"
3055
+ ]).optional(),
3056
+ contentsSize: z.number().int().positive().optional(),
3057
+ attribution: SignatureAttributionSchema.optional(),
3058
+ /** @deprecated the pre-rename spelling of `attribution`; servers read either. */
3059
+ signer: SignatureAttributionSchema.optional(),
3060
+ signingTime: z.string().optional(),
3061
+ certify: z.object({ permission: DocMdpPermissionSchema }).optional(),
3062
+ lock: FieldLockSpecSchema.optional(),
3063
+ appearance: z.object({
3064
+ resource: z.string().min(1),
3065
+ pageIndex: z.number().int().nonnegative().optional()
3066
+ }).optional()
3067
+ });
3068
+ const optionalIndex = z.coerce.number().int().nonnegative().optional();
3069
+ /** Layer analysis query (the current form): exactly one `since.*`; the working copy is the end. */
3070
+ const LayerAnalysisQuerySchema = z.object({
3071
+ "since.signature": optionalIndex,
3072
+ "since.revision": optionalIndex,
3073
+ level: ModificationLevelSchema.optional(),
3074
+ detail: AnalysisDetailSchema.optional()
3075
+ }).refine((q) => q["since.signature"] === void 0 !== (q["since.revision"] === void 0), { message: "exactly one of since.signature / since.revision is required" });
3076
+ /** Version analysis query: as the layer's, plus `until` (a revision index; default the last). */
3077
+ const VersionAnalysisQuerySchema = z.object({
3078
+ "since.signature": optionalIndex,
3079
+ "since.revision": optionalIndex,
3080
+ until: optionalIndex,
3081
+ level: ModificationLevelSchema.optional(),
3082
+ detail: AnalysisDetailSchema.optional(),
3083
+ /** The judging policy version the caller expects — a cache key, not an input (version responses are immutable). */
3084
+ policy: optionalIndex
3085
+ }).refine((q) => q["since.signature"] === void 0 !== (q["since.revision"] === void 0), { message: "exactly one of since.signature / since.revision is required" });
3086
+ function analyzeInputFromQuery(query, until) {
3087
+ return {
3088
+ since: query["since.signature"] !== void 0 ? { signatureIndex: query["since.signature"] } : { revisionIndex: query["since.revision"] ?? 0 },
3089
+ ...until !== void 0 ? { until } : {},
3090
+ ...query.level !== void 0 ? { exploratoryLevel: query.level } : {},
3091
+ ...query.detail !== void 0 ? { detail: query.detail } : {}
3092
+ };
3093
+ }
3094
+ /** One row of the document's version catalog. */
3095
+ const DocumentVersionSchema = z.object({
3096
+ sha256: z.string().regex(/^[0-9a-f]{64}$/),
3097
+ byteLength: z.number().int().nonnegative(),
3098
+ number: z.number().int().positive(),
3099
+ parentSha256: z.string().nullable(),
3100
+ producer: z.enum(["upload", "signature"]),
3101
+ signingId: z.string().nullable(),
3102
+ createdAt: z.number().int()
3103
+ });
3104
+ const DocumentVersionsSchema = z.object({
3105
+ /** `documents.base_sha`: the version every layer is over, or behind. */
3106
+ head: z.string().regex(/^[0-9a-f]{64}$/),
3107
+ /** Oldest first. */
3108
+ versions: z.array(DocumentVersionSchema)
3109
+ });
2648
3110
  //#endregion
2649
- export { PageRenderAnnotatedQuerySchema as $, BlendModeSchema as $n, StampDTOSchema as $t, FormSetValueResultSchema as A, FreeTextPatchSchema as An, PdfSizeSchema as Ar, FormWidgetRefSchema as At, PageDeleteResultSchema as B, CircleDraftSchema as Bn, UnsupportedDraftSchema as Bt, FormEffectSchema as C, InkDraftSchema as Cn, CalloutLineSchema as Cr, FormFieldOptionSchema as Ct, FormFieldUpdateResultSchema as D, HighlightPatchSchema as Dn, PdfQuadSchema as Dr, FormKindSchema as Dt, FormFieldDeleteResultSchema as E, HighlightDraftSchema as En, PdfPointSchema as Er, FormFieldValueSchema as Et, MetadataUpdateResultSchema as F, WireAttachmentFileSchema as Fn, AnnotationDraftSchema as Ft, PageInsertBlankInputSchema as G, AnnotationBaseShape as Gn, NoteIconSchema as Gt, PageFlattenInputSchema as H, CaretDTOSchema as Hn, UnderlineDTOSchema as Ht, MutationMetaSchema as I, AttachmentFileInfoSchema as In, AnnotationPatchSchema as It, PageLayoutSchema as J, AnnotationFlagsPartialSchema as Jn, TextPatchSchema as Jt, PageInsertInputSchema as K, AnnotationBorderStyleSchema as Kn, TextDTOSchema as Kt, OpenDocumentResponseSchema as L, EmbeddedFileItemSchema as Ln, KIND_BY_SUBTYPE as Lt, LayerScopesSchema as M, FileAttachmentIconSchema as Mn, WidgetPlacementSchema as Mt, ManifestPageSchema as N, FileAttachmentPatchSchema as Nn, ANNOTATION_KINDS as Nt, FormImportResultSchema as O, FreeTextDTOSchema as On, PdfRectSchema as Or, FormSnapshotSchema as Ot, MetadataPatchSchema as P, FileAttachmentWireDraftSchema as Pn, AnnotationDTOSchema as Pt, PageNetworkRenderFormatSchema as Q, AnnotationStableIdSchema as Qn, ResourceRefSchema as Qt, PageBoxesSchema as R, EmbeddedFileRefSchema as Rn, WidgetAppearanceSchema as Rt, EngineErrorPayloadSchema as S, InkDTOSchema as Sn, PdfDestinationSchema as Sr, FormFieldOptionInputSchema as St, FormFieldCreateResultSchema as T, HighlightDTOSchema as Tn, LinePointsSchema as Tr, FormFieldRefSchema as Tt, PageFlattenResultSchema as U, CaretDraftSchema as Un, UnderlineDraftSchema as Ut, PageExtractInputSchema as V, CirclePatchSchema as Vn, UnsupportedPatchSchema as Vt, PageGeometrySnapshotSchema as W, CaretPatchSchema as Wn, UnderlinePatchSchema as Wt, PageMoveInputSchema as X, AnnotationPatchBaseShape as Xn, StrikeoutDraftSchema as Xt, PageListSnapshotSchema as Y, AnnotationFlagsSchema as Yn, StrikeoutDTOSchema as Yt, PageMoveResultSchema as Z, AnnotationRefSchema as Zn, StrikeoutPatchSchema as Zt, CachePinsSchema as _, PdfLinkTargetSchema as _n, PdfActionTypeSchema as _r, WeakAnnotationSessionResponseSchema as _t, AnnotationCreateResultSchema as a, SquareDTOSchema as an, LineEndingsSchema as ar, PageTextSnapshotSchema as at, DocumentMetadataSchema as b, LineDraftSchema as bn, PdfFieldActionsSchema as br, FormFieldDraftSchema as bt, AnnotationListPageSnapshotSchema as c, PolylineDTOSchema as cn, RectSchema as cr, RedactionApplyScopeSchema as ct, AnnotationUpdateResultSchema as d, PolygonDTOSchema as dn, StrikeoutIntentSchema as dr, SearchModeSchema as dt, StampWireDraftSchema as en, CaretIntentSchema as er, PageRenderQuerySchema as et, AppearanceOutcomeSchema as f, PolygonDraftSchema as fn, TextAlignmentSchema as fr, SearchQuerySchema as ft, CacheDeltaSchema as g, LinkPatchSchema as gn, PdfActionTreeSchema as gr, WeakAnnotationSessionPagesRequestSchema as gt, AttachmentsCacheSchema as h, LinkDraftSchema as hn, PdfActionTargetRefSchema as hr, SearchSnippetSchema as ht, AnnotationAppearancesQuerySchema as i, SquigglyPatchSchema as in, LineEndingSchema as ir, PageStructureCacheSchema as it, FormWidgetLinkResultSchema as j, FileAttachmentDTOSchema as jn, ToggleFieldWidgetSchema as jt, FormRepairResultSchema as k, FreeTextDraftSchema as kn, PdfRotationSchema as kr, FormValueEntrySchema as kt, AnnotationListSnapshotAllPagesSchema as l, PolylineDraftSchema as ln, RevisionTokenSchema as lr, RefetchReasonSchema as lt, AttachmentDeleteResultSchema as m, LinkDTOSchema as mn, PdfActionNodeSchema as mr, SearchSliceSchema as mt, AccessResponseSchema as n, SquigglyDTOSchema as nn, FreeTextIntentSchema as nr, PageRotateResultSchema as nt, AnnotationDeleteResultSchema as o, SquareDraftSchema as on, PdfRectDifferencesSchema as or, PdfSaveModeSchema as ot, AttachmentCreateResultSchema as p, PolygonPatchSchema as pn, DocumentActionsSnapshotSchema as pr, SearchRequestSchema as pt, PageInsertResultSchema as q, AnnotationDraftBaseShape as qn, TextDraftSchema as qt, AnnotationAppearanceManifestSchema as r, SquigglyDraftSchema as rn, InkIntentSchema as rr, PageStateSchema as rt, AnnotationListMutationMetaSchema as s, SquarePatchSchema as sn, PointSchema as sr, RedactionApplyResultSchema as st, AccessRequestSchema as t, StampWirePatchSchema as tn, ColorSchema as tr, PageRotateInputSchema as tt, AnnotationMoveResultSchema as u, PolylinePatchSchema as un, StandardFontSchema as ur, SearchMatchSchema as ut, DocumentHeadSchema as v, PdfLinkTargetWritableSchema as vn, PdfActionWireComponents as vr, FormDataFormatSchema as vt, FormEffectsResultSchema as w, InkPatchSchema as wn, InkListSchema as wr, FormFieldPatchSchema as wt, DocumentSecurityStateSchema as x, LinePatchSchema as xn, PdfPageActionsSchema as xr, FormFieldFlagsSchema as xt, DocumentManifestSchema as y, LineDTOSchema as yn, PdfAnnotationActionsSchema as yr, FormFieldDTOSchema as yt, PageDeleteInputSchema as z, CircleDTOSchema as zn, UnsupportedDTOSchema as zt };
3111
+ export { PageBoxesSchema as $, LineDTOSchema as $n, PdfAnnotationActionsSchema as $r, FormFieldDTOSchema as $t, DocumentVersionRefSchema as A, StrikeoutDraftSchema as An, AnnotationPatchBaseShape as Ar, SearchModeSchema as At, FormImportResultSchema as B, SquareDraftSchema as Bn, PdfRectDifferencesSchema as Br, SignaturePrepareBodySchema as Bt, ChangeAnalysisSchema as C, UnderlineDraftSchema as Cn, CaretDraftSchema as Cr, PageTextSnapshotSchema as Ct, DocumentMetadataSchema as D, TextDraftSchema as Dn, AnnotationDraftBaseShape as Dr, RedactionApplyScopeSchema as Dt, DocumentManifestSchema as E, TextDTOSchema as En, AnnotationBorderStyleSchema as Er, RedactionApplyResultSchema as Et, FormEffectSchema as F, StampWirePatchSchema as Fn, ColorSchema as Fr, SignatureAbortResultSchema as Ft, LayerScopesSchema as G, PolygonDTOSchema as Gn, StrikeoutIntentSchema as Gr, WeakAnnotationSessionPagesRequestSchema as Gt, FormSetValueResultSchema as H, PolylineDTOSchema as Hn, RectSchema as Hr, SignatureSeedValueSchema as Ht, FormEffectsResultSchema as I, SquigglyDTOSchema as In, FreeTextIntentSchema as Ir, SignatureAppearanceBodySchema as It, MetadataUpdateResultSchema as J, LinkDTOSchema as Jn, PdfActionNodeSchema as Jr, decodePrepared as Jt, ManifestPageSchema as K, PolygonDraftSchema as Kn, TextAlignmentSchema as Kr, WeakAnnotationSessionResponseSchema as Kt, FormFieldCreateResultSchema as L, SquigglyDraftSchema as Ln, InkIntentSchema as Lr, SignatureCompleteBodySchema as Lt, DocumentVersionsSchema as M, ResourceRefSchema as Mn, AnnotationStableIdSchema as Mr, SearchRequestSchema as Mt, EngineErrorPayloadSchema as N, StampDTOSchema as Nn, BlendModeSchema as Nr, SearchSliceSchema as Nt, DocumentProtectionSchema as O, TextPatchSchema as On, AnnotationFlagsPartialSchema as Or, RefetchReasonSchema as Ot, FieldLockSpecSchema as P, StampWireDraftSchema as Pn, CaretIntentSchema as Pr, SearchSnippetSchema as Pt, OpenDocumentResponseSchema as Q, PdfLinkTargetWritableSchema as Qn, PdfActionWireComponents as Qr, FormDataFormatSchema as Qt, FormFieldDeleteResultSchema as R, SquigglyPatchSchema as Rn, LineEndingSchema as Rr, SignatureCompleteResultSchema as Rt, CachePinsSchema as S, UnderlineDTOSchema as Sn, CaretDTOSchema as Sr, PageStructureCacheSchema as St, DocumentHeadSchema as T, NoteIconSchema as Tn, AnnotationBaseShape as Tr, PdfSaveModeSchema as Tt, FormWidgetLinkResultSchema as U, PolylineDraftSchema as Un, RevisionTokenSchema as Ur, SignatureSnapshotSchema as Ut, FormRepairResultSchema as V, SquarePatchSchema as Vn, PointSchema as Vr, SignaturePreparedWireSchema as Vt, LayerAnalysisQuerySchema as W, PolylinePatchSchema as Wn, StandardFontSchema as Wr, VersionAnalysisQuerySchema as Wt, MutationMetaSchema as X, LinkPatchSchema as Xn, PdfActionTreeSchema as Xr, fromBase64 as Xt, ModificationLevelSchema as Y, LinkDraftSchema as Yn, PdfActionTargetRefSchema as Yr, encodePrepared as Yt, NamedPageEntrySchema as Z, PdfLinkTargetSchema as Zn, PdfActionTypeSchema as Zr, toBase64 as Zt, AttachmentDeleteResultSchema as _, KIND_BY_SUBTYPE as _n, EmbeddedFileItemSchema as _r, PageRenderAnnotatedQuerySchema as _t, AnnotationAppearancesQuerySchema as a, LinePointsSchema as ai, FormFieldRefSchema as an, HighlightDTOSchema as ar, PageGeometrySnapshotSchema as at, ByteRangeSchema as b, UnsupportedDraftSchema as bn, CircleDraftSchema as br, PageRotateResultSchema as bt, AnnotationFlattenInputSchema as c, PdfRectSchema as ci, FormSnapshotSchema as cn, FreeTextDTOSchema as cr, PageInsertResultSchema as ct, AnnotationListPageSnapshotSchema as d, ToggleFieldWidgetSchema as dn, FileAttachmentDTOSchema as dr, PageMoveInputSchema as dt, PdfFieldActionsSchema as ei, FormFieldDraftSchema as en, LineDraftSchema as er, PageDeleteInputSchema as et, AnnotationListSnapshotAllPagesSchema as f, WidgetPlacementSchema as fn, FileAttachmentIconSchema as fr, PageMoveResultSchema as ft, AttachmentCreateResultSchema as g, AnnotationPatchSchema as gn, AttachmentFileInfoSchema as gr, PageRemoveNameInputSchema as gt, AppearanceOutcomeSchema as h, AnnotationDraftSchema as hn, WireAttachmentFileSchema as hr, PageNetworkRenderFormatSchema as ht, AnnotationAppearanceManifestSchema as i, InkListSchema as ii, FormFieldPatchSchema as in, InkPatchSchema as ir, PageFlattenResultSchema as it, DocumentVersionSchema as j, StrikeoutPatchSchema as jn, AnnotationRefSchema as jr, SearchQuerySchema as jt, DocumentSecurityStateSchema as k, StrikeoutDTOSchema as kn, AnnotationFlagsSchema as kr, SearchMatchSchema as kt, AnnotationFlattenResultSchema as l, PdfRotationSchema as li, FormValueEntrySchema as ln, FreeTextDraftSchema as lr, PageLayoutSchema as lt, AnnotationUpdateResultSchema as m, AnnotationDTOSchema as mn, FileAttachmentWireDraftSchema as mr, PageNameResultSchema as mt, AccessResponseSchema as n, PdfDestinationSchema as ni, FormFieldOptionInputSchema as nn, InkDTOSchema as nr, PageExtractInputSchema as nt, AnnotationCreateResultSchema as o, PdfPointSchema as oi, FormFieldValueSchema as on, HighlightDraftSchema as or, PageInsertBlankInputSchema as ot, AnnotationMoveResultSchema as p, ANNOTATION_KINDS as pn, FileAttachmentPatchSchema as pr, PageNameInputSchema as pt, MetadataPatchSchema as q, PolygonPatchSchema as qn, DocumentActionsSnapshotSchema as qr, analyzeInputFromQuery as qt, AnnotationAppearanceExportInputSchema as r, CalloutLineSchema as ri, FormFieldOptionSchema as rn, InkDraftSchema as rr, PageFlattenInputSchema as rt, AnnotationDeleteResultSchema as s, PdfQuadSchema as si, FormKindSchema as sn, HighlightPatchSchema as sr, PageInsertInputSchema as st, AccessRequestSchema as t, PdfPageActionsSchema as ti, FormFieldFlagsSchema as tn, LinePatchSchema as tr, PageDeleteResultSchema as tt, AnnotationListMutationMetaSchema as u, PdfSizeSchema as ui, FormWidgetRefSchema as un, FreeTextPatchSchema as ur, PageListSnapshotSchema as ut, AttachmentsCacheSchema as v, WidgetAppearanceSchema as vn, EmbeddedFileRefSchema as vr, PageRenderQuerySchema as vt, DigestAlgorithmSchema as w, UnderlinePatchSchema as wn, CaretPatchSchema as wr, PdfRevisionSchema as wt, CacheDeltaSchema as x, UnsupportedPatchSchema as xn, CirclePatchSchema as xr, PageStateSchema as xt, BaseVersionInfoSchema as y, UnsupportedDTOSchema as yn, CircleDTOSchema as yr, PageRotateInputSchema as yt, FormFieldUpdateResultSchema as z, SquareDTOSchema as zn, LineEndingsSchema as zr, SignatureDTOSchema as zt };
2650
3112
 
2651
- //# sourceMappingURL=schemas-XGrNVMDd.js.map
3113
+ //# sourceMappingURL=schemas-BLARNCgx.js.map