@embedpdf/engine-core 3.0.0-next.12 → 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-x6tKulNV.d.cts → AnnotationListSnapshot-D3mFut1e.d.cts} +1155 -171
  6. package/dist/{AnnotationListSnapshot-x6tKulNV.d.ts → AnnotationListSnapshot-D3mFut1e.d.ts} +1155 -171
  7. package/dist/{DocumentSecurityService-CK0pejAK.d.cts → DocumentSecurityService-ClTZc0zO.d.cts} +2 -2
  8. package/dist/{DocumentSecurityService-9MawYxP-.d.ts → DocumentSecurityService-_JRjqvoI.d.ts} +2 -2
  9. package/dist/{Engine-Ds0ytbl6.d.ts → Engine-Bx0NOfmd.d.cts} +166 -11
  10. package/dist/{Engine--0XF0UAK.d.cts → Engine-DxtpCYcP.d.ts} +166 -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-8Hl1AYNU.cjs → builders-Bqm8yTpi.cjs} +1470 -4
  16. package/dist/builders-Bqm8yTpi.cjs.map +1 -0
  17. package/dist/{builders-DOjcKDWQ.js → builders-Dqo2X-dt.js} +1351 -5
  18. package/dist/builders-Dqo2X-dt.js.map +1 -0
  19. package/dist/conformance.cjs +1079 -13
  20. package/dist/conformance.cjs.map +1 -1
  21. package/dist/conformance.d.cts +70 -3
  22. package/dist/conformance.d.ts +70 -3
  23. package/dist/conformance.js +1079 -14
  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 +192 -5
  39. package/dist/runtime.d.ts +192 -5
  40. package/dist/runtime.js +6 -6
  41. package/dist/{schemas-DOyVEPk7.js → schemas-BLARNCgx.js} +420 -4
  42. package/dist/schemas-BLARNCgx.js.map +1 -0
  43. package/dist/{schemas-RChsAMWw.cjs → schemas-DIqFMmrC.cjs} +581 -3
  44. package/dist/schemas-DIqFMmrC.cjs.map +1 -0
  45. package/dist/wire.cjs +228 -12
  46. package/dist/wire.cjs.map +1 -1
  47. package/dist/wire.d.cts +415 -4
  48. package/dist/wire.d.ts +415 -4
  49. package/dist/wire.js +199 -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-8Hl1AYNU.cjs.map +0 -1
  55. package/dist/builders-DOjcKDWQ.js.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-DOyVEPk7.js.map +0 -1
  59. package/dist/schemas-RChsAMWw.cjs.map +0 -1
@@ -1,4 +1,4 @@
1
- const require_PageInsertBlankInput = require("./PageInsertBlankInput-CzShuSJI.cjs");
1
+ const require_PageInsertBlankInput = require("./PageInsertBlankInput-CqXBmFhN.cjs");
2
2
  let zod = require("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 = zod.z.string().min(1);
669
+ const HexColorSchema = zod.z.string().regex(/^#[0-9a-fA-F]{6}$/);
670
+ const RichTextRunStyleShape = {
671
+ family: zod.z.string().min(1),
672
+ weight: zod.z.number().int().min(100).max(900),
673
+ italic: zod.z.boolean(),
674
+ size: zod.z.number().nonnegative(),
675
+ color: HexColorSchema,
676
+ decoration: zod.z.array(zod.z.enum([
677
+ "underline",
678
+ "line-through",
679
+ "word"
680
+ ])),
681
+ script: zod.z.enum([
682
+ "normal",
683
+ "sub",
684
+ "super"
685
+ ]),
686
+ letterSpacing: zod.z.number(),
687
+ horizontalScale: zod.z.number().positive(),
688
+ unknown: zod.z.string().optional()
689
+ };
690
+ const RichTextParagraphPropsShape = {
691
+ align: zod.z.enum([
692
+ "left",
693
+ "center",
694
+ "right",
695
+ "justify"
696
+ ]),
697
+ dir: zod.z.enum(["ltr", "rtl"]),
698
+ lineHeight: zod.z.number().positive().optional(),
699
+ margins: zod.z.object({
700
+ top: zod.z.number(),
701
+ bottom: zod.z.number(),
702
+ left: zod.z.number(),
703
+ right: zod.z.number()
704
+ }).optional(),
705
+ textIndent: zod.z.number().optional(),
706
+ unknown: zod.z.string().optional()
707
+ };
708
+ const RichTextRunStyleDeltaSchema = zod.z.object(RichTextRunStyleShape).partial();
709
+ const RichTextParagraphSchema = zod.z.object({
710
+ ...RichTextParagraphPropsShape,
711
+ runs: zod.z.array(zod.z.object({
712
+ text: zod.z.string(),
713
+ style: RichTextRunStyleDeltaSchema.optional()
714
+ }))
715
+ }).partial({
716
+ align: true,
717
+ dir: true
718
+ });
719
+ const RichTextDocumentSchema = zod.z.object({
720
+ body: zod.z.object({
721
+ ...RichTextRunStyleShape,
722
+ ...RichTextParagraphPropsShape
723
+ }),
724
+ paragraphs: zod.z.array(RichTextParagraphSchema)
725
+ });
726
+ const RichTextDocumentInputSchema = zod.z.object({
727
+ body: zod.z.object({
728
+ ...RichTextRunStyleShape,
729
+ ...RichTextParagraphPropsShape
730
+ }).partial().optional(),
731
+ paragraphs: zod.z.array(RichTextParagraphSchema)
732
+ });
669
733
  const FreeTextDTOSchema = zod.z.object({
670
734
  ...AnnotationBaseShape,
671
735
  intent: FreeTextIntentSchema,
672
- fontFamily: StandardFontSchema,
736
+ fontFamily: FreeTextFontSchema,
673
737
  fontSize: zod.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 = zod.z.object({
692
757
  fontFamily: FreeTextFontSchema,
693
758
  fontSize: zod.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 = zod.z.object({
713
779
  fontFamily: FreeTextFontSchema.optional(),
714
780
  fontSize: zod.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(),
@@ -1644,6 +1711,11 @@ const FormFieldDraftSchema = zod.z.discriminatedUnion("family", [
1644
1711
  multiSelect: zod.z.boolean().optional(),
1645
1712
  options: zod.z.array(FormFieldOptionInputSchema).optional(),
1646
1713
  widget: WidgetPlacementSchema.optional()
1714
+ }),
1715
+ zod.z.object({
1716
+ ...FormFieldDraftBaseShape,
1717
+ family: zod.z.literal("signature"),
1718
+ widget: WidgetPlacementSchema.optional()
1647
1719
  })
1648
1720
  ]);
1649
1721
  const FormFieldPatchBaseShape = {
@@ -2042,6 +2114,9 @@ const DocumentManifestSchema = zod.z.object({
2042
2114
  annotationsVersion: zod.z.number().int().positive().default(1),
2043
2115
  auditHead: zod.z.number().int().nonnegative(),
2044
2116
  baseSha: zod.z.string(),
2117
+ layerVersion: zod.z.number().int().nonnegative().default(0),
2118
+ working: zod.z.boolean().default(false),
2119
+ baseByteLength: zod.z.number().int().nonnegative().default(0),
2045
2120
  scopes: LayerScopesSchema.optional(),
2046
2121
  pages: zod.z.array(ManifestPageSchema)
2047
2122
  });
@@ -2313,6 +2388,8 @@ const CacheDeltaSchema = zod.z.object({
2313
2388
  previousDocVersion: zod.z.number().int().positive(),
2314
2389
  docVersion: zod.z.number().int().positive(),
2315
2390
  annotationsVersion: zod.z.number().int().positive().optional(),
2391
+ layerVersion: zod.z.number().int().nonnegative().optional(),
2392
+ working: zod.z.boolean().optional(),
2316
2393
  pages: zod.z.array(zod.z.object({
2317
2394
  pageObjectNumber: zod.z.number().int().positive(),
2318
2395
  cache: CachePinsSchema
@@ -2691,6 +2768,345 @@ const WeakAnnotationSessionResponseSchema = zod.z.object({
2691
2768
  pageObjectNumbers: zod.z.array(zod.z.number().int().positive())
2692
2769
  });
2693
2770
  const WeakAnnotationSessionPagesRequestSchema = zod.z.object({ pageObjectNumbers: zod.z.array(zod.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 = zod.z.string().regex(/^[A-Za-z0-9+/]*={0,2}$/, "base64");
2805
+ const DocumentVersionRefSchema = zod.z.object({
2806
+ baseSha256: zod.z.string().regex(/^[0-9a-f]{64}$/),
2807
+ editsVersion: zod.z.number().int().nonnegative()
2808
+ });
2809
+ const ByteRangeSchema = zod.z.tuple([
2810
+ zod.z.number().int().nonnegative(),
2811
+ zod.z.number().int().nonnegative(),
2812
+ zod.z.number().int().nonnegative(),
2813
+ zod.z.number().int().nonnegative()
2814
+ ]);
2815
+ /** `SignaturePrepared` with the digest as base64. */
2816
+ const SignaturePreparedWireSchema = zod.z.object({
2817
+ signingId: zod.z.string().min(1),
2818
+ digest: Base64Schema,
2819
+ algorithm: zod.z.enum([
2820
+ "sha256",
2821
+ "sha384",
2822
+ "sha512"
2823
+ ]),
2824
+ byteRange: ByteRangeSchema,
2825
+ contentsSize: zod.z.number().int().positive(),
2826
+ subFilter: zod.z.string(),
2827
+ expectedVersion: DocumentVersionRefSchema,
2828
+ expiresAt: zod.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 = zod.z.object({
2845
+ cms: Base64Schema.refine((v) => v.length > 0, "cms is required"),
2846
+ expectedVersion: DocumentVersionRefSchema
2847
+ });
2848
+ const DocMdpPermissionSchema = zod.z.union([
2849
+ zod.z.literal(1),
2850
+ zod.z.literal(2),
2851
+ zod.z.literal(3)
2852
+ ]);
2853
+ const ModificationLevelSchema = zod.z.enum([
2854
+ "none",
2855
+ "lta",
2856
+ "fill",
2857
+ "annotate"
2858
+ ]);
2859
+ const DigestAlgorithmSchema = zod.z.enum([
2860
+ "sha1",
2861
+ "sha256",
2862
+ "sha384",
2863
+ "sha512"
2864
+ ]);
2865
+ const FieldLockSpecSchema = zod.z.object({
2866
+ action: zod.z.enum([
2867
+ "all",
2868
+ "include",
2869
+ "exclude"
2870
+ ]),
2871
+ fields: zod.z.array(zod.z.string()),
2872
+ permission: DocMdpPermissionSchema.optional()
2873
+ });
2874
+ const SignatureSeedValueSchema = zod.z.object({
2875
+ requiredFlags: zod.z.number().int(),
2876
+ presentFlags: zod.z.number().int(),
2877
+ version: zod.z.number().int().nullable(),
2878
+ mdp: zod.z.union([
2879
+ zod.z.literal(0),
2880
+ zod.z.literal(1),
2881
+ zod.z.literal(2),
2882
+ zod.z.literal(3)
2883
+ ]).nullable(),
2884
+ filter: zod.z.string().nullable(),
2885
+ subFilters: zod.z.array(zod.z.string()),
2886
+ digestMethods: zod.z.array(zod.z.string()),
2887
+ reasons: zod.z.array(zod.z.string()),
2888
+ unsupportedRequired: zod.z.boolean()
2889
+ });
2890
+ const SignatureDTOSchema = zod.z.object({
2891
+ index: zod.z.number().int().nonnegative(),
2892
+ field: FormFieldRefSchema,
2893
+ fieldName: zod.z.string(),
2894
+ widget: FormWidgetRefSchema.nullable(),
2895
+ signed: zod.z.boolean(),
2896
+ kind: zod.z.enum(["signature", "timestamp"]),
2897
+ filter: zod.z.string().nullable(),
2898
+ subFilter: zod.z.string().nullable(),
2899
+ byteRange: ByteRangeSchema.nullable(),
2900
+ contentsSize: zod.z.number().int().nonnegative(),
2901
+ coverage: zod.z.enum([
2902
+ "whole-revision",
2903
+ "partial",
2904
+ "malformed"
2905
+ ]).nullable(),
2906
+ revisionIndex: zod.z.number().int().nonnegative().nullable(),
2907
+ signer: zod.z.object({
2908
+ name: zod.z.string().nullable(),
2909
+ reason: zod.z.string().nullable(),
2910
+ location: zod.z.string().nullable(),
2911
+ contactInfo: zod.z.string().nullable(),
2912
+ claimedTime: zod.z.string().nullable()
2913
+ }),
2914
+ docMdp: DocMdpPermissionSchema.nullable(),
2915
+ catalogCertification: zod.z.boolean(),
2916
+ fieldMdp: FieldLockSpecSchema.nullable(),
2917
+ lock: FieldLockSpecSchema.nullable(),
2918
+ seedValue: SignatureSeedValueSchema.nullable()
2919
+ });
2920
+ const DocumentProtectionSchema = zod.z.object({
2921
+ enforced: ModificationLevelSchema.nullable(),
2922
+ judged: ModificationLevelSchema.nullable(),
2923
+ certification: zod.z.object({
2924
+ signatureIndex: zod.z.number().int().nonnegative(),
2925
+ permission: DocMdpPermissionSchema
2926
+ }).nullable(),
2927
+ fieldLocks: zod.z.array(zod.z.object({
2928
+ signatureIndex: zod.z.number().int().nonnegative(),
2929
+ source: zod.z.enum(["fieldmdp", "lock"]),
2930
+ spec: FieldLockSpecSchema
2931
+ })),
2932
+ policyVersion: zod.z.number().int()
2933
+ });
2934
+ const PdfRevisionSchema = zod.z.object({
2935
+ index: zod.z.number().int().nonnegative(),
2936
+ end: zod.z.number().int().nonnegative(),
2937
+ xrefOffset: zod.z.number().int().nonnegative(),
2938
+ signatureIndex: zod.z.number().int().nonnegative().nullable()
2939
+ });
2940
+ const SignatureSnapshotSchema = zod.z.object({
2941
+ chainValid: zod.z.boolean(),
2942
+ revisions: zod.z.array(PdfRevisionSchema),
2943
+ signatures: zod.z.array(SignatureDTOSchema),
2944
+ protection: DocumentProtectionSchema
2945
+ });
2946
+ const BaseVersionInfoSchema = zod.z.object({
2947
+ sha256: zod.z.string().regex(/^[0-9a-f]{64}$/),
2948
+ byteLength: zod.z.number().int().nonnegative()
2949
+ });
2950
+ const SignatureCompleteResultSchema = zod.z.object({
2951
+ status: zod.z.enum(["completed", "already-completed"]),
2952
+ signature: SignatureDTOSchema,
2953
+ version: BaseVersionInfoSchema,
2954
+ previous: DocumentVersionRefSchema,
2955
+ protection: DocumentProtectionSchema,
2956
+ meta: MutationMetaSchema
2957
+ });
2958
+ const SignatureAbortResultSchema = zod.z.object({ status: zod.z.enum([
2959
+ "aborted",
2960
+ "already-completed",
2961
+ "unknown"
2962
+ ]) });
2963
+ const ChangeFindingSchema = zod.z.object({
2964
+ rule: zod.z.string(),
2965
+ verdict: zod.z.enum([
2966
+ "permitted",
2967
+ "forbidden",
2968
+ "incomplete"
2969
+ ]),
2970
+ objectNumber: zod.z.number().int().nonnegative(),
2971
+ edge: zod.z.string().optional(),
2972
+ detail: zod.z.string().optional()
2973
+ });
2974
+ const AnalysisDetailSchema = zod.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 = zod.z.object({
2977
+ mode: zod.z.enum(["authoritative", "exploratory"]),
2978
+ policyVersion: zod.z.number().int(),
2979
+ basis: zod.z.object({
2980
+ version: BaseVersionInfoSchema,
2981
+ editsVersion: zod.z.number().int().nonnegative(),
2982
+ source: zod.z.enum(["persisted", "working-copy"])
2983
+ }),
2984
+ since: zod.z.object({
2985
+ revisionIndex: zod.z.number().int().nonnegative(),
2986
+ signatureIndex: zod.z.number().int().nonnegative().nullable()
2987
+ }),
2988
+ until: zod.z.object({ revisionIndex: zod.z.number().int().nonnegative() }),
2989
+ restrictions: zod.z.array(zod.z.object({
2990
+ signatureIndex: zod.z.number().int().nonnegative(),
2991
+ revisionIndex: zod.z.number().int().nonnegative(),
2992
+ source: zod.z.enum([
2993
+ "docmdp",
2994
+ "fieldmdp",
2995
+ "lock"
2996
+ ]),
2997
+ own: zod.z.boolean(),
2998
+ permission: zod.z.union([
2999
+ zod.z.literal(1),
3000
+ zod.z.literal(2),
3001
+ zod.z.literal(3)
3002
+ ]).optional(),
3003
+ fields: zod.z.unknown().optional()
3004
+ })),
3005
+ current: zod.z.object({
3006
+ verdict: zod.z.enum([
3007
+ "unchanged",
3008
+ "permitted",
3009
+ "forbidden",
3010
+ "indeterminate"
3011
+ ]),
3012
+ complete: zod.z.boolean(),
3013
+ primary: ChangeFindingSchema.optional(),
3014
+ findings: zod.z.array(ChangeFindingSchema),
3015
+ method: zod.z.enum(["net-state", "net-state+replay"])
3016
+ }),
3017
+ later: zod.z.object({
3018
+ revisionCount: zod.z.number().int().nonnegative(),
3019
+ undoneObjectNumbers: zod.z.array(zod.z.number().int().nonnegative())
3020
+ }),
3021
+ /** Equals `current.verdict`. */
3022
+ verdict: zod.z.enum([
3023
+ "unchanged",
3024
+ "permitted",
3025
+ "forbidden",
3026
+ "indeterminate"
3027
+ ]),
3028
+ /** The step DTOs are large and evolving; carried verbatim. */
3029
+ steps: zod.z.array(zod.z.unknown())
3030
+ });
3031
+ const SignatureAttributionSchema = zod.z.object({
3032
+ name: zod.z.string().optional(),
3033
+ reason: zod.z.string().optional(),
3034
+ location: zod.z.string().optional(),
3035
+ contactInfo: zod.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 = zod.z.object({
3039
+ resource: zod.z.string().min(1),
3040
+ pageIndex: zod.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 = zod.z.object({
3048
+ field: FormFieldRefSchema,
3049
+ kind: zod.z.enum(["signature", "timestamp"]).optional(),
3050
+ subFilter: zod.z.enum(["adbe.pkcs7.detached", "ETSI.CAdES.detached"]).optional(),
3051
+ digest: zod.z.enum([
3052
+ "sha256",
3053
+ "sha384",
3054
+ "sha512"
3055
+ ]).optional(),
3056
+ contentsSize: zod.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: zod.z.string().optional(),
3061
+ certify: zod.z.object({ permission: DocMdpPermissionSchema }).optional(),
3062
+ lock: FieldLockSpecSchema.optional(),
3063
+ appearance: zod.z.object({
3064
+ resource: zod.z.string().min(1),
3065
+ pageIndex: zod.z.number().int().nonnegative().optional()
3066
+ }).optional()
3067
+ });
3068
+ const optionalIndex = zod.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 = zod.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 = zod.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 = zod.z.object({
3096
+ sha256: zod.z.string().regex(/^[0-9a-f]{64}$/),
3097
+ byteLength: zod.z.number().int().nonnegative(),
3098
+ number: zod.z.number().int().positive(),
3099
+ parentSha256: zod.z.string().nullable(),
3100
+ producer: zod.z.enum(["upload", "signature"]),
3101
+ signingId: zod.z.string().nullable(),
3102
+ createdAt: zod.z.number().int()
3103
+ });
3104
+ const DocumentVersionsSchema = zod.z.object({
3105
+ /** `documents.base_sha`: the version every layer is over, or behind. */
3106
+ head: zod.z.string().regex(/^[0-9a-f]{64}$/),
3107
+ /** Oldest first. */
3108
+ versions: zod.z.array(DocumentVersionSchema)
3109
+ });
2694
3110
  //#endregion
2695
3111
  Object.defineProperty(exports, "ANNOTATION_KINDS", {
2696
3112
  enumerable: true,
@@ -2878,12 +3294,24 @@ Object.defineProperty(exports, "AttachmentsCacheSchema", {
2878
3294
  return AttachmentsCacheSchema;
2879
3295
  }
2880
3296
  });
3297
+ Object.defineProperty(exports, "BaseVersionInfoSchema", {
3298
+ enumerable: true,
3299
+ get: function() {
3300
+ return BaseVersionInfoSchema;
3301
+ }
3302
+ });
2881
3303
  Object.defineProperty(exports, "BlendModeSchema", {
2882
3304
  enumerable: true,
2883
3305
  get: function() {
2884
3306
  return BlendModeSchema;
2885
3307
  }
2886
3308
  });
3309
+ Object.defineProperty(exports, "ByteRangeSchema", {
3310
+ enumerable: true,
3311
+ get: function() {
3312
+ return ByteRangeSchema;
3313
+ }
3314
+ });
2887
3315
  Object.defineProperty(exports, "CacheDeltaSchema", {
2888
3316
  enumerable: true,
2889
3317
  get: function() {
@@ -2926,6 +3354,12 @@ Object.defineProperty(exports, "CaretPatchSchema", {
2926
3354
  return CaretPatchSchema;
2927
3355
  }
2928
3356
  });
3357
+ Object.defineProperty(exports, "ChangeAnalysisSchema", {
3358
+ enumerable: true,
3359
+ get: function() {
3360
+ return ChangeAnalysisSchema;
3361
+ }
3362
+ });
2929
3363
  Object.defineProperty(exports, "CircleDTOSchema", {
2930
3364
  enumerable: true,
2931
3365
  get: function() {
@@ -2950,6 +3384,12 @@ Object.defineProperty(exports, "ColorSchema", {
2950
3384
  return ColorSchema;
2951
3385
  }
2952
3386
  });
3387
+ Object.defineProperty(exports, "DigestAlgorithmSchema", {
3388
+ enumerable: true,
3389
+ get: function() {
3390
+ return DigestAlgorithmSchema;
3391
+ }
3392
+ });
2953
3393
  Object.defineProperty(exports, "DocumentActionsSnapshotSchema", {
2954
3394
  enumerable: true,
2955
3395
  get: function() {
@@ -2974,12 +3414,36 @@ Object.defineProperty(exports, "DocumentMetadataSchema", {
2974
3414
  return DocumentMetadataSchema;
2975
3415
  }
2976
3416
  });
3417
+ Object.defineProperty(exports, "DocumentProtectionSchema", {
3418
+ enumerable: true,
3419
+ get: function() {
3420
+ return DocumentProtectionSchema;
3421
+ }
3422
+ });
2977
3423
  Object.defineProperty(exports, "DocumentSecurityStateSchema", {
2978
3424
  enumerable: true,
2979
3425
  get: function() {
2980
3426
  return DocumentSecurityStateSchema;
2981
3427
  }
2982
3428
  });
3429
+ Object.defineProperty(exports, "DocumentVersionRefSchema", {
3430
+ enumerable: true,
3431
+ get: function() {
3432
+ return DocumentVersionRefSchema;
3433
+ }
3434
+ });
3435
+ Object.defineProperty(exports, "DocumentVersionSchema", {
3436
+ enumerable: true,
3437
+ get: function() {
3438
+ return DocumentVersionSchema;
3439
+ }
3440
+ });
3441
+ Object.defineProperty(exports, "DocumentVersionsSchema", {
3442
+ enumerable: true,
3443
+ get: function() {
3444
+ return DocumentVersionsSchema;
3445
+ }
3446
+ });
2983
3447
  Object.defineProperty(exports, "EmbeddedFileItemSchema", {
2984
3448
  enumerable: true,
2985
3449
  get: function() {
@@ -2998,6 +3462,12 @@ Object.defineProperty(exports, "EngineErrorPayloadSchema", {
2998
3462
  return EngineErrorPayloadSchema;
2999
3463
  }
3000
3464
  });
3465
+ Object.defineProperty(exports, "FieldLockSpecSchema", {
3466
+ enumerable: true,
3467
+ get: function() {
3468
+ return FieldLockSpecSchema;
3469
+ }
3470
+ });
3001
3471
  Object.defineProperty(exports, "FileAttachmentDTOSchema", {
3002
3472
  enumerable: true,
3003
3473
  get: function() {
@@ -3232,6 +3702,12 @@ Object.defineProperty(exports, "KIND_BY_SUBTYPE", {
3232
3702
  return KIND_BY_SUBTYPE;
3233
3703
  }
3234
3704
  });
3705
+ Object.defineProperty(exports, "LayerAnalysisQuerySchema", {
3706
+ enumerable: true,
3707
+ get: function() {
3708
+ return LayerAnalysisQuerySchema;
3709
+ }
3710
+ });
3235
3711
  Object.defineProperty(exports, "LayerScopesSchema", {
3236
3712
  enumerable: true,
3237
3713
  get: function() {
@@ -3310,6 +3786,12 @@ Object.defineProperty(exports, "MetadataUpdateResultSchema", {
3310
3786
  return MetadataUpdateResultSchema;
3311
3787
  }
3312
3788
  });
3789
+ Object.defineProperty(exports, "ModificationLevelSchema", {
3790
+ enumerable: true,
3791
+ get: function() {
3792
+ return ModificationLevelSchema;
3793
+ }
3794
+ });
3313
3795
  Object.defineProperty(exports, "MutationMetaSchema", {
3314
3796
  enumerable: true,
3315
3797
  get: function() {
@@ -3574,6 +4056,12 @@ Object.defineProperty(exports, "PdfRectSchema", {
3574
4056
  return PdfRectSchema;
3575
4057
  }
3576
4058
  });
4059
+ Object.defineProperty(exports, "PdfRevisionSchema", {
4060
+ enumerable: true,
4061
+ get: function() {
4062
+ return PdfRevisionSchema;
4063
+ }
4064
+ });
3577
4065
  Object.defineProperty(exports, "PdfRotationSchema", {
3578
4066
  enumerable: true,
3579
4067
  get: function() {
@@ -3706,6 +4194,60 @@ Object.defineProperty(exports, "SearchSnippetSchema", {
3706
4194
  return SearchSnippetSchema;
3707
4195
  }
3708
4196
  });
4197
+ Object.defineProperty(exports, "SignatureAbortResultSchema", {
4198
+ enumerable: true,
4199
+ get: function() {
4200
+ return SignatureAbortResultSchema;
4201
+ }
4202
+ });
4203
+ Object.defineProperty(exports, "SignatureAppearanceBodySchema", {
4204
+ enumerable: true,
4205
+ get: function() {
4206
+ return SignatureAppearanceBodySchema;
4207
+ }
4208
+ });
4209
+ Object.defineProperty(exports, "SignatureCompleteBodySchema", {
4210
+ enumerable: true,
4211
+ get: function() {
4212
+ return SignatureCompleteBodySchema;
4213
+ }
4214
+ });
4215
+ Object.defineProperty(exports, "SignatureCompleteResultSchema", {
4216
+ enumerable: true,
4217
+ get: function() {
4218
+ return SignatureCompleteResultSchema;
4219
+ }
4220
+ });
4221
+ Object.defineProperty(exports, "SignatureDTOSchema", {
4222
+ enumerable: true,
4223
+ get: function() {
4224
+ return SignatureDTOSchema;
4225
+ }
4226
+ });
4227
+ Object.defineProperty(exports, "SignaturePrepareBodySchema", {
4228
+ enumerable: true,
4229
+ get: function() {
4230
+ return SignaturePrepareBodySchema;
4231
+ }
4232
+ });
4233
+ Object.defineProperty(exports, "SignaturePreparedWireSchema", {
4234
+ enumerable: true,
4235
+ get: function() {
4236
+ return SignaturePreparedWireSchema;
4237
+ }
4238
+ });
4239
+ Object.defineProperty(exports, "SignatureSeedValueSchema", {
4240
+ enumerable: true,
4241
+ get: function() {
4242
+ return SignatureSeedValueSchema;
4243
+ }
4244
+ });
4245
+ Object.defineProperty(exports, "SignatureSnapshotSchema", {
4246
+ enumerable: true,
4247
+ get: function() {
4248
+ return SignatureSnapshotSchema;
4249
+ }
4250
+ });
3709
4251
  Object.defineProperty(exports, "SquareDTOSchema", {
3710
4252
  enumerable: true,
3711
4253
  get: function() {
@@ -3856,6 +4398,12 @@ Object.defineProperty(exports, "UnsupportedPatchSchema", {
3856
4398
  return UnsupportedPatchSchema;
3857
4399
  }
3858
4400
  });
4401
+ Object.defineProperty(exports, "VersionAnalysisQuerySchema", {
4402
+ enumerable: true,
4403
+ get: function() {
4404
+ return VersionAnalysisQuerySchema;
4405
+ }
4406
+ });
3859
4407
  Object.defineProperty(exports, "WeakAnnotationSessionPagesRequestSchema", {
3860
4408
  enumerable: true,
3861
4409
  get: function() {
@@ -3886,5 +4434,35 @@ Object.defineProperty(exports, "WireAttachmentFileSchema", {
3886
4434
  return WireAttachmentFileSchema;
3887
4435
  }
3888
4436
  });
4437
+ Object.defineProperty(exports, "analyzeInputFromQuery", {
4438
+ enumerable: true,
4439
+ get: function() {
4440
+ return analyzeInputFromQuery;
4441
+ }
4442
+ });
4443
+ Object.defineProperty(exports, "decodePrepared", {
4444
+ enumerable: true,
4445
+ get: function() {
4446
+ return decodePrepared;
4447
+ }
4448
+ });
4449
+ Object.defineProperty(exports, "encodePrepared", {
4450
+ enumerable: true,
4451
+ get: function() {
4452
+ return encodePrepared;
4453
+ }
4454
+ });
4455
+ Object.defineProperty(exports, "fromBase64", {
4456
+ enumerable: true,
4457
+ get: function() {
4458
+ return fromBase64;
4459
+ }
4460
+ });
4461
+ Object.defineProperty(exports, "toBase64", {
4462
+ enumerable: true,
4463
+ get: function() {
4464
+ return toBase64;
4465
+ }
4466
+ });
3889
4467
 
3890
- //# sourceMappingURL=schemas-RChsAMWw.cjs.map
4468
+ //# sourceMappingURL=schemas-DIqFMmrC.cjs.map