@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
- 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(),
@@ -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
@@ -2691,7 +2768,346 @@ const WeakAnnotationSessionResponseSchema = z.object({
2691
2768
  pageObjectNumbers: z.array(z.number().int().positive())
2692
2769
  });
2693
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
+ });
2694
3110
  //#endregion
2695
- export { PageListSnapshotSchema as $, AnnotationBorderStyleSchema as $n, TextDTOSchema as $t, FormFieldUpdateResultSchema as A, InkDraftSchema as An, CalloutLineSchema as Ar, FormFieldOptionSchema as At, NamedPageEntrySchema as B, FileAttachmentPatchSchema as Bn, ANNOTATION_KINDS as Bt, DocumentMetadataSchema as C, LinkPatchSchema as Cn, PdfActionTreeSchema as Cr, WeakAnnotationSessionPagesRequestSchema as Ct, FormEffectsResultSchema as D, LineDraftSchema as Dn, PdfFieldActionsSchema as Dr, FormFieldDraftSchema as Dt, FormEffectSchema as E, LineDTOSchema as En, PdfAnnotationActionsSchema as Er, FormFieldDTOSchema as Et, LayerScopesSchema as F, FreeTextDTOSchema as Fn, PdfRectSchema as Fr, FormSnapshotSchema as Ft, PageExtractInputSchema as G, EmbeddedFileRefSchema as Gn, WidgetAppearanceSchema as Gt, PageBoxesSchema as H, WireAttachmentFileSchema as Hn, AnnotationDraftSchema as Ht, ManifestPageSchema as I, FreeTextDraftSchema as In, PdfRotationSchema as Ir, FormValueEntrySchema as It, PageGeometrySnapshotSchema as J, CirclePatchSchema as Jn, UnsupportedPatchSchema as Jt, PageFlattenInputSchema as K, CircleDTOSchema as Kn, UnsupportedDTOSchema as Kt, MetadataPatchSchema as L, FreeTextPatchSchema as Ln, PdfSizeSchema as Lr, FormWidgetRefSchema as Lt, FormRepairResultSchema as M, HighlightDTOSchema as Mn, LinePointsSchema as Mr, FormFieldRefSchema as Mt, FormSetValueResultSchema as N, HighlightDraftSchema as Nn, PdfPointSchema as Nr, FormFieldValueSchema as Nt, FormFieldCreateResultSchema as O, LinePatchSchema as On, PdfPageActionsSchema as Or, FormFieldFlagsSchema as Ot, FormWidgetLinkResultSchema as P, HighlightPatchSchema as Pn, PdfQuadSchema as Pr, FormKindSchema as Pt, PageLayoutSchema as Q, AnnotationBaseShape as Qn, NoteIconSchema as Qt, MetadataUpdateResultSchema as R, FileAttachmentDTOSchema as Rn, ToggleFieldWidgetSchema as Rt, DocumentManifestSchema as S, LinkDraftSchema as Sn, PdfActionTargetRefSchema as Sr, SearchSnippetSchema as St, EngineErrorPayloadSchema as T, PdfLinkTargetWritableSchema as Tn, PdfActionWireComponents as Tr, FormDataFormatSchema as Tt, PageDeleteInputSchema as U, AttachmentFileInfoSchema as Un, AnnotationPatchSchema as Ut, OpenDocumentResponseSchema as V, FileAttachmentWireDraftSchema as Vn, AnnotationDTOSchema as Vt, PageDeleteResultSchema as W, EmbeddedFileItemSchema as Wn, KIND_BY_SUBTYPE as Wt, PageInsertInputSchema as X, CaretDraftSchema as Xn, UnderlineDraftSchema as Xt, PageInsertBlankInputSchema as Y, CaretDTOSchema as Yn, UnderlineDTOSchema as Yt, PageInsertResultSchema as Z, CaretPatchSchema as Zn, UnderlinePatchSchema as Zt, AttachmentDeleteResultSchema as _, PolylinePatchSchema as _n, StandardFontSchema as _r, SearchMatchSchema as _t, AnnotationAppearancesQuerySchema as a, ResourceRefSchema as an, AnnotationStableIdSchema as ar, PageRemoveNameInputSchema as at, CachePinsSchema as b, PolygonPatchSchema as bn, DocumentActionsSnapshotSchema as br, SearchRequestSchema as bt, AnnotationFlattenInputSchema as c, StampWirePatchSchema as cn, ColorSchema as cr, PageRotateInputSchema as ct, AnnotationListPageSnapshotSchema as d, SquigglyPatchSchema as dn, LineEndingSchema as dr, PageStructureCacheSchema as dt, TextDraftSchema as en, AnnotationDraftBaseShape as er, PageMoveInputSchema as et, AnnotationListSnapshotAllPagesSchema as f, SquareDTOSchema as fn, LineEndingsSchema as fr, PageTextSnapshotSchema as ft, AttachmentCreateResultSchema as g, PolylineDraftSchema as gn, RevisionTokenSchema as gr, RefetchReasonSchema as gt, AppearanceOutcomeSchema as h, PolylineDTOSchema as hn, RectSchema as hr, RedactionApplyScopeSchema as ht, AnnotationAppearanceManifestSchema as i, StrikeoutPatchSchema as in, AnnotationRefSchema as ir, PageNetworkRenderFormatSchema as it, FormImportResultSchema as j, InkPatchSchema as jn, InkListSchema as jr, FormFieldPatchSchema as jt, FormFieldDeleteResultSchema as k, InkDTOSchema as kn, PdfDestinationSchema as kr, FormFieldOptionInputSchema as kt, AnnotationFlattenResultSchema as l, SquigglyDTOSchema as ln, FreeTextIntentSchema as lr, PageRotateResultSchema as lt, AnnotationUpdateResultSchema as m, SquarePatchSchema as mn, PointSchema as mr, RedactionApplyResultSchema as mt, AccessResponseSchema as n, StrikeoutDTOSchema as nn, AnnotationFlagsSchema as nr, PageNameInputSchema as nt, AnnotationCreateResultSchema as o, StampDTOSchema as on, BlendModeSchema as or, PageRenderAnnotatedQuerySchema as ot, AnnotationMoveResultSchema as p, SquareDraftSchema as pn, PdfRectDifferencesSchema as pr, PdfSaveModeSchema as pt, PageFlattenResultSchema as q, CircleDraftSchema as qn, UnsupportedDraftSchema as qt, AnnotationAppearanceExportInputSchema as r, StrikeoutDraftSchema as rn, AnnotationPatchBaseShape as rr, PageNameResultSchema as rt, AnnotationDeleteResultSchema as s, StampWireDraftSchema as sn, CaretIntentSchema as sr, PageRenderQuerySchema as st, AccessRequestSchema as t, TextPatchSchema as tn, AnnotationFlagsPartialSchema as tr, PageMoveResultSchema as tt, AnnotationListMutationMetaSchema as u, SquigglyDraftSchema as un, InkIntentSchema as ur, PageStateSchema as ut, AttachmentsCacheSchema as v, PolygonDTOSchema as vn, StrikeoutIntentSchema as vr, SearchModeSchema as vt, DocumentSecurityStateSchema as w, PdfLinkTargetSchema as wn, PdfActionTypeSchema as wr, WeakAnnotationSessionResponseSchema as wt, DocumentHeadSchema as x, LinkDTOSchema as xn, PdfActionNodeSchema as xr, SearchSliceSchema as xt, CacheDeltaSchema as y, PolygonDraftSchema as yn, TextAlignmentSchema as yr, SearchQuerySchema as yt, MutationMetaSchema as z, FileAttachmentIconSchema as zn, WidgetPlacementSchema 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 };
2696
3112
 
2697
- //# sourceMappingURL=schemas-DOyVEPk7.js.map
3113
+ //# sourceMappingURL=schemas-BLARNCgx.js.map