@josephomills/esign 0.8.0 → 0.9.0

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.
@@ -18,6 +18,20 @@ declare function canTransition(from: EsignStatus, to: EsignStatus): boolean;
18
18
  /** Throw `EsignError('CONFLICT')` on an illegal transition. */
19
19
  declare function assertTransition(from: EsignStatus, to: EsignStatus): void;
20
20
 
21
+ /** What a placed field captures: a drawn signature or a picked date. */
22
+ type FieldType = "signature" | "date";
23
+ /**
24
+ * How a filled date renders into the sealed PDF — the creator picks one per date
25
+ * field. Pure string formats (no locale/timezone surprises).
26
+ */
27
+ type DateFormat = "DD/MM/YYYY" | "MM/DD/YYYY" | "YYYY-MM-DD" | "D MMM YYYY" | "Do MMM YYYY" | "Do MMMM YYYY" | "MMMM D, YYYY";
28
+ declare const DATE_FORMATS: readonly DateFormat[];
29
+ declare const DEFAULT_DATE_FORMAT: DateFormat;
30
+ /** Render an ISO `yyyy-mm-dd` date in the chosen format. Parses the parts directly. */
31
+ declare function formatPickedDate(iso: string, format: DateFormat): string;
32
+ /** A human label for each format, for pickers. */
33
+ declare const DATE_FORMAT_LABELS: Record<DateFormat, string>;
34
+
21
35
  type EsignChannel = "EMAIL" | "TELEGRAM" | "SMS" | "WHATSAPP";
22
36
  declare const ESIGN_CHANNELS: readonly EsignChannel[];
23
37
  declare const esignChannelSchema: z.ZodEnum<["EMAIL", "TELEGRAM", "SMS", "WHATSAPP"]>;
@@ -35,29 +49,38 @@ declare const placementSchema: z.ZodObject<{
35
49
  w: z.ZodNumber;
36
50
  h: z.ZodNumber;
37
51
  }, "strict", z.ZodTypeAny, {
52
+ y: number;
38
53
  page: number;
39
54
  x: number;
40
- y: number;
41
55
  w: number;
42
56
  h: number;
43
57
  }, {
58
+ y: number;
44
59
  page: number;
45
60
  x: number;
46
- y: number;
47
61
  w: number;
48
62
  h: number;
49
63
  }>;
64
+
50
65
  /**
51
- * A named signature field — a placement with an id + label. A document version
52
- * carries one or more; the signer signs once and the signature is stamped at
53
- * every field. Labels organize the fields in the designer ("Signature", "Initials
54
- * page 2", ); the signer always sees "Sign here".
66
+ * A named placed field — a placement with an id, label and type. A signature
67
+ * field is stamped with the signer's signature; a date field is stamped with the
68
+ * date the signer picks, rendered in `dateFormat` and bounded below by `minDate`
69
+ * (default: the document's creation date). The signer sees "Sign here" / a date
70
+ * picker; labels organize the fields in the designer.
55
71
  */
56
- interface SignatureField extends Placement {
72
+ interface DocumentField extends Placement {
57
73
  id: string;
58
74
  label: string;
59
- }
60
- declare const signatureFieldSchema: z.ZodObject<{
75
+ type: FieldType;
76
+ /** Date fields only: how the picked date renders into the PDF. */
77
+ dateFormat?: DateFormat;
78
+ /** Date fields only: earliest selectable date (ISO `yyyy-mm-dd`); null = no floor. */
79
+ minDate?: string | null;
80
+ }
81
+ /** @deprecated use {@link DocumentField}; kept as an alias for back-compat. */
82
+ type SignatureField = DocumentField;
83
+ declare const documentFieldSchema: z.ZodObject<{
61
84
  page: z.ZodNumber;
62
85
  x: z.ZodNumber;
63
86
  y: z.ZodNumber;
@@ -66,24 +89,34 @@ declare const signatureFieldSchema: z.ZodObject<{
66
89
  } & {
67
90
  id: z.ZodString;
68
91
  label: z.ZodString;
92
+ type: z.ZodDefault<z.ZodEnum<["signature", "date"]>>;
93
+ dateFormat: z.ZodOptional<z.ZodEnum<[DateFormat, ...DateFormat[]]>>;
94
+ minDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
69
95
  }, "strict", z.ZodTypeAny, {
96
+ y: number;
70
97
  page: number;
71
98
  x: number;
72
- y: number;
73
99
  w: number;
74
100
  h: number;
101
+ type: "signature" | "date";
75
102
  id: string;
76
103
  label: string;
104
+ dateFormat?: DateFormat | undefined;
105
+ minDate?: string | null | undefined;
77
106
  }, {
107
+ y: number;
78
108
  page: number;
79
109
  x: number;
80
- y: number;
81
110
  w: number;
82
111
  h: number;
83
112
  id: string;
84
113
  label: string;
114
+ type?: "signature" | "date" | undefined;
115
+ dateFormat?: DateFormat | undefined;
116
+ minDate?: string | null | undefined;
85
117
  }>;
86
- declare const placementsSchema: z.ZodArray<z.ZodObject<{
118
+ /** @deprecated use {@link documentFieldSchema}. */
119
+ declare const signatureFieldSchema: z.ZodObject<{
87
120
  page: z.ZodNumber;
88
121
  x: z.ZodNumber;
89
122
  y: z.ZodNumber;
@@ -92,23 +125,89 @@ declare const placementsSchema: z.ZodArray<z.ZodObject<{
92
125
  } & {
93
126
  id: z.ZodString;
94
127
  label: z.ZodString;
128
+ type: z.ZodDefault<z.ZodEnum<["signature", "date"]>>;
129
+ dateFormat: z.ZodOptional<z.ZodEnum<[DateFormat, ...DateFormat[]]>>;
130
+ minDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
95
131
  }, "strict", z.ZodTypeAny, {
132
+ y: number;
133
+ page: number;
134
+ x: number;
135
+ w: number;
136
+ h: number;
137
+ type: "signature" | "date";
138
+ id: string;
139
+ label: string;
140
+ dateFormat?: DateFormat | undefined;
141
+ minDate?: string | null | undefined;
142
+ }, {
143
+ y: number;
96
144
  page: number;
97
145
  x: number;
146
+ w: number;
147
+ h: number;
148
+ id: string;
149
+ label: string;
150
+ type?: "signature" | "date" | undefined;
151
+ dateFormat?: DateFormat | undefined;
152
+ minDate?: string | null | undefined;
153
+ }>;
154
+ declare const placementsSchema: z.ZodEffects<z.ZodArray<z.ZodObject<{
155
+ page: z.ZodNumber;
156
+ x: z.ZodNumber;
157
+ y: z.ZodNumber;
158
+ w: z.ZodNumber;
159
+ h: z.ZodNumber;
160
+ } & {
161
+ id: z.ZodString;
162
+ label: z.ZodString;
163
+ type: z.ZodDefault<z.ZodEnum<["signature", "date"]>>;
164
+ dateFormat: z.ZodOptional<z.ZodEnum<[DateFormat, ...DateFormat[]]>>;
165
+ minDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
166
+ }, "strict", z.ZodTypeAny, {
98
167
  y: number;
168
+ page: number;
169
+ x: number;
99
170
  w: number;
100
171
  h: number;
172
+ type: "signature" | "date";
101
173
  id: string;
102
174
  label: string;
175
+ dateFormat?: DateFormat | undefined;
176
+ minDate?: string | null | undefined;
103
177
  }, {
178
+ y: number;
179
+ page: number;
180
+ x: number;
181
+ w: number;
182
+ h: number;
183
+ id: string;
184
+ label: string;
185
+ type?: "signature" | "date" | undefined;
186
+ dateFormat?: DateFormat | undefined;
187
+ minDate?: string | null | undefined;
188
+ }>, "many">, {
189
+ y: number;
104
190
  page: number;
105
191
  x: number;
192
+ w: number;
193
+ h: number;
194
+ type: "signature" | "date";
195
+ id: string;
196
+ label: string;
197
+ dateFormat?: DateFormat | undefined;
198
+ minDate?: string | null | undefined;
199
+ }[], {
106
200
  y: number;
201
+ page: number;
202
+ x: number;
107
203
  w: number;
108
204
  h: number;
109
205
  id: string;
110
206
  label: string;
111
- }>, "many">;
207
+ type?: "signature" | "date" | undefined;
208
+ dateFormat?: DateFormat | undefined;
209
+ minDate?: string | null | undefined;
210
+ }[]>;
112
211
  /** A resolved recipient — the only thing the fan-out needs. subjectId = the host's profileId. */
113
212
  interface Recipient {
114
213
  name: string;
@@ -314,19 +413,25 @@ interface CoverageReport {
314
413
  subjectId: string;
315
414
  }[];
316
415
  }
317
- /** A drawn or typed signature, as a PNG data URL produced by the signer UI. */
416
+ /**
417
+ * The signer submit: a drawn/typed signature PNG + the picked date for each date
418
+ * field, keyed by field id (ISO `yyyy-mm-dd`).
419
+ */
318
420
  declare const submitSignatureSchema: z.ZodObject<{
319
421
  signaturePng: z.ZodString;
320
422
  signerName: z.ZodString;
321
423
  consent: z.ZodLiteral<true>;
424
+ dateValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
322
425
  }, "strict", z.ZodTypeAny, {
323
426
  signaturePng: string;
324
427
  signerName: string;
325
428
  consent: true;
429
+ dateValues?: Record<string, string> | undefined;
326
430
  }, {
327
431
  signaturePng: string;
328
432
  signerName: string;
329
433
  consent: true;
434
+ dateValues?: Record<string, string> | undefined;
330
435
  }>;
331
436
  type SubmitSignatureInput = z.infer<typeof submitSignatureSchema>;
332
437
  declare const declineSchema: z.ZodObject<{
@@ -651,4 +756,4 @@ interface EsignConfig<S> {
651
756
  defaultExpiryDays?: number;
652
757
  }
653
758
 
654
- export { isTerminal as $, ACTIVE_STATUSES as A, type RequestSummary as B, type Clock as C, type DocumentStatsRow as D, type EsignChannel as E, type SigningAuditEventDTO as F, type GroupBreakdown as G, type HooksPort as H, type SigningCampaignDTO as I, type StatusCountMap as J, type SubjectFilter as K, type SubjectFilterField as L, type SubjectSigningState as M, type NotifierPort as N, type OutstandingRequest as O, type PersistencePort as P, type SubjectSummary as Q, type ResendPolicy as R, type SubjectSelection as S, type SubmitSignatureInput as T, TERMINAL_STATUSES as U, type VersionPolicy as V, assertTransition as W, canTransition as X, declineSchema as Y, esignChannelSchema as Z, isActive as _, type SubjectsPort as a, placementSchema as a0, placementsSchema as a1, signatureFieldSchema as a2, subjectSelectionSchema as a3, submitSignatureSchema as a4, type SkippedSubject as b, type StoragePort as c, type SignatureField as d, type SigningDocumentVersionDTO as e, type SigningDocumentDTO as f, type SigningRequestDTO as g, type EsignConfig as h, type SubjectSigningStatus as i, type CoverageReport as j, type CampaignStatsRow as k, type StatsRange as l, type ScopeStatsRow as m, type SubjectTypeDescriptor as n, type Placement as o, type AffectedSubject as p, type AuthPort as q, type DeclineInput as r, type DocumentDeletionContext as s, ESIGN_CHANNELS as t, ESIGN_STATUSES as u, type EsignStatus as v, type NewAuditEventRow as w, type NewRequestRow as x, type NotifierAttachment as y, type Recipient as z };
759
+ export { TERMINAL_STATUSES as $, ACTIVE_STATUSES as A, type NewAuditEventRow as B, type Clock as C, type DocumentStatsRow as D, type EsignChannel as E, type FieldType as F, type GroupBreakdown as G, type HooksPort as H, type NewRequestRow as I, type NotifierAttachment as J, type Placement as K, type Recipient as L, type RequestSummary as M, type NotifierPort as N, type OutstandingRequest as O, type PersistencePort as P, type SigningAuditEventDTO as Q, type ResendPolicy as R, type SubjectSelection as S, type SigningCampaignDTO as T, type StatusCountMap as U, type VersionPolicy as V, type SubjectFilter as W, type SubjectFilterField as X, type SubjectSigningState as Y, type SubjectSummary as Z, type SubmitSignatureInput as _, type SubjectsPort as a, assertTransition as a0, canTransition as a1, declineSchema as a2, documentFieldSchema as a3, esignChannelSchema as a4, formatPickedDate as a5, isActive as a6, isTerminal as a7, placementSchema as a8, placementsSchema as a9, signatureFieldSchema as aa, subjectSelectionSchema as ab, submitSignatureSchema as ac, type SkippedSubject as b, type StoragePort as c, type SignatureField as d, type SigningDocumentVersionDTO as e, type SigningDocumentDTO as f, type SigningRequestDTO as g, type EsignConfig as h, type SubjectSigningStatus as i, type CoverageReport as j, type CampaignStatsRow as k, type StatsRange as l, type ScopeStatsRow as m, type SubjectTypeDescriptor as n, type DocumentField as o, type AffectedSubject as p, type AuthPort as q, DATE_FORMATS as r, DATE_FORMAT_LABELS as s, DEFAULT_DATE_FORMAT as t, type DateFormat as u, type DeclineInput as v, type DocumentDeletionContext as w, ESIGN_CHANNELS as x, ESIGN_STATUSES as y, type EsignStatus as z };
@@ -18,6 +18,20 @@ declare function canTransition(from: EsignStatus, to: EsignStatus): boolean;
18
18
  /** Throw `EsignError('CONFLICT')` on an illegal transition. */
19
19
  declare function assertTransition(from: EsignStatus, to: EsignStatus): void;
20
20
 
21
+ /** What a placed field captures: a drawn signature or a picked date. */
22
+ type FieldType = "signature" | "date";
23
+ /**
24
+ * How a filled date renders into the sealed PDF — the creator picks one per date
25
+ * field. Pure string formats (no locale/timezone surprises).
26
+ */
27
+ type DateFormat = "DD/MM/YYYY" | "MM/DD/YYYY" | "YYYY-MM-DD" | "D MMM YYYY" | "Do MMM YYYY" | "Do MMMM YYYY" | "MMMM D, YYYY";
28
+ declare const DATE_FORMATS: readonly DateFormat[];
29
+ declare const DEFAULT_DATE_FORMAT: DateFormat;
30
+ /** Render an ISO `yyyy-mm-dd` date in the chosen format. Parses the parts directly. */
31
+ declare function formatPickedDate(iso: string, format: DateFormat): string;
32
+ /** A human label for each format, for pickers. */
33
+ declare const DATE_FORMAT_LABELS: Record<DateFormat, string>;
34
+
21
35
  type EsignChannel = "EMAIL" | "TELEGRAM" | "SMS" | "WHATSAPP";
22
36
  declare const ESIGN_CHANNELS: readonly EsignChannel[];
23
37
  declare const esignChannelSchema: z.ZodEnum<["EMAIL", "TELEGRAM", "SMS", "WHATSAPP"]>;
@@ -35,29 +49,38 @@ declare const placementSchema: z.ZodObject<{
35
49
  w: z.ZodNumber;
36
50
  h: z.ZodNumber;
37
51
  }, "strict", z.ZodTypeAny, {
52
+ y: number;
38
53
  page: number;
39
54
  x: number;
40
- y: number;
41
55
  w: number;
42
56
  h: number;
43
57
  }, {
58
+ y: number;
44
59
  page: number;
45
60
  x: number;
46
- y: number;
47
61
  w: number;
48
62
  h: number;
49
63
  }>;
64
+
50
65
  /**
51
- * A named signature field — a placement with an id + label. A document version
52
- * carries one or more; the signer signs once and the signature is stamped at
53
- * every field. Labels organize the fields in the designer ("Signature", "Initials
54
- * page 2", ); the signer always sees "Sign here".
66
+ * A named placed field — a placement with an id, label and type. A signature
67
+ * field is stamped with the signer's signature; a date field is stamped with the
68
+ * date the signer picks, rendered in `dateFormat` and bounded below by `minDate`
69
+ * (default: the document's creation date). The signer sees "Sign here" / a date
70
+ * picker; labels organize the fields in the designer.
55
71
  */
56
- interface SignatureField extends Placement {
72
+ interface DocumentField extends Placement {
57
73
  id: string;
58
74
  label: string;
59
- }
60
- declare const signatureFieldSchema: z.ZodObject<{
75
+ type: FieldType;
76
+ /** Date fields only: how the picked date renders into the PDF. */
77
+ dateFormat?: DateFormat;
78
+ /** Date fields only: earliest selectable date (ISO `yyyy-mm-dd`); null = no floor. */
79
+ minDate?: string | null;
80
+ }
81
+ /** @deprecated use {@link DocumentField}; kept as an alias for back-compat. */
82
+ type SignatureField = DocumentField;
83
+ declare const documentFieldSchema: z.ZodObject<{
61
84
  page: z.ZodNumber;
62
85
  x: z.ZodNumber;
63
86
  y: z.ZodNumber;
@@ -66,24 +89,34 @@ declare const signatureFieldSchema: z.ZodObject<{
66
89
  } & {
67
90
  id: z.ZodString;
68
91
  label: z.ZodString;
92
+ type: z.ZodDefault<z.ZodEnum<["signature", "date"]>>;
93
+ dateFormat: z.ZodOptional<z.ZodEnum<[DateFormat, ...DateFormat[]]>>;
94
+ minDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
69
95
  }, "strict", z.ZodTypeAny, {
96
+ y: number;
70
97
  page: number;
71
98
  x: number;
72
- y: number;
73
99
  w: number;
74
100
  h: number;
101
+ type: "signature" | "date";
75
102
  id: string;
76
103
  label: string;
104
+ dateFormat?: DateFormat | undefined;
105
+ minDate?: string | null | undefined;
77
106
  }, {
107
+ y: number;
78
108
  page: number;
79
109
  x: number;
80
- y: number;
81
110
  w: number;
82
111
  h: number;
83
112
  id: string;
84
113
  label: string;
114
+ type?: "signature" | "date" | undefined;
115
+ dateFormat?: DateFormat | undefined;
116
+ minDate?: string | null | undefined;
85
117
  }>;
86
- declare const placementsSchema: z.ZodArray<z.ZodObject<{
118
+ /** @deprecated use {@link documentFieldSchema}. */
119
+ declare const signatureFieldSchema: z.ZodObject<{
87
120
  page: z.ZodNumber;
88
121
  x: z.ZodNumber;
89
122
  y: z.ZodNumber;
@@ -92,23 +125,89 @@ declare const placementsSchema: z.ZodArray<z.ZodObject<{
92
125
  } & {
93
126
  id: z.ZodString;
94
127
  label: z.ZodString;
128
+ type: z.ZodDefault<z.ZodEnum<["signature", "date"]>>;
129
+ dateFormat: z.ZodOptional<z.ZodEnum<[DateFormat, ...DateFormat[]]>>;
130
+ minDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
95
131
  }, "strict", z.ZodTypeAny, {
132
+ y: number;
133
+ page: number;
134
+ x: number;
135
+ w: number;
136
+ h: number;
137
+ type: "signature" | "date";
138
+ id: string;
139
+ label: string;
140
+ dateFormat?: DateFormat | undefined;
141
+ minDate?: string | null | undefined;
142
+ }, {
143
+ y: number;
96
144
  page: number;
97
145
  x: number;
146
+ w: number;
147
+ h: number;
148
+ id: string;
149
+ label: string;
150
+ type?: "signature" | "date" | undefined;
151
+ dateFormat?: DateFormat | undefined;
152
+ minDate?: string | null | undefined;
153
+ }>;
154
+ declare const placementsSchema: z.ZodEffects<z.ZodArray<z.ZodObject<{
155
+ page: z.ZodNumber;
156
+ x: z.ZodNumber;
157
+ y: z.ZodNumber;
158
+ w: z.ZodNumber;
159
+ h: z.ZodNumber;
160
+ } & {
161
+ id: z.ZodString;
162
+ label: z.ZodString;
163
+ type: z.ZodDefault<z.ZodEnum<["signature", "date"]>>;
164
+ dateFormat: z.ZodOptional<z.ZodEnum<[DateFormat, ...DateFormat[]]>>;
165
+ minDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
166
+ }, "strict", z.ZodTypeAny, {
98
167
  y: number;
168
+ page: number;
169
+ x: number;
99
170
  w: number;
100
171
  h: number;
172
+ type: "signature" | "date";
101
173
  id: string;
102
174
  label: string;
175
+ dateFormat?: DateFormat | undefined;
176
+ minDate?: string | null | undefined;
103
177
  }, {
178
+ y: number;
179
+ page: number;
180
+ x: number;
181
+ w: number;
182
+ h: number;
183
+ id: string;
184
+ label: string;
185
+ type?: "signature" | "date" | undefined;
186
+ dateFormat?: DateFormat | undefined;
187
+ minDate?: string | null | undefined;
188
+ }>, "many">, {
189
+ y: number;
104
190
  page: number;
105
191
  x: number;
192
+ w: number;
193
+ h: number;
194
+ type: "signature" | "date";
195
+ id: string;
196
+ label: string;
197
+ dateFormat?: DateFormat | undefined;
198
+ minDate?: string | null | undefined;
199
+ }[], {
106
200
  y: number;
201
+ page: number;
202
+ x: number;
107
203
  w: number;
108
204
  h: number;
109
205
  id: string;
110
206
  label: string;
111
- }>, "many">;
207
+ type?: "signature" | "date" | undefined;
208
+ dateFormat?: DateFormat | undefined;
209
+ minDate?: string | null | undefined;
210
+ }[]>;
112
211
  /** A resolved recipient — the only thing the fan-out needs. subjectId = the host's profileId. */
113
212
  interface Recipient {
114
213
  name: string;
@@ -314,19 +413,25 @@ interface CoverageReport {
314
413
  subjectId: string;
315
414
  }[];
316
415
  }
317
- /** A drawn or typed signature, as a PNG data URL produced by the signer UI. */
416
+ /**
417
+ * The signer submit: a drawn/typed signature PNG + the picked date for each date
418
+ * field, keyed by field id (ISO `yyyy-mm-dd`).
419
+ */
318
420
  declare const submitSignatureSchema: z.ZodObject<{
319
421
  signaturePng: z.ZodString;
320
422
  signerName: z.ZodString;
321
423
  consent: z.ZodLiteral<true>;
424
+ dateValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
322
425
  }, "strict", z.ZodTypeAny, {
323
426
  signaturePng: string;
324
427
  signerName: string;
325
428
  consent: true;
429
+ dateValues?: Record<string, string> | undefined;
326
430
  }, {
327
431
  signaturePng: string;
328
432
  signerName: string;
329
433
  consent: true;
434
+ dateValues?: Record<string, string> | undefined;
330
435
  }>;
331
436
  type SubmitSignatureInput = z.infer<typeof submitSignatureSchema>;
332
437
  declare const declineSchema: z.ZodObject<{
@@ -651,4 +756,4 @@ interface EsignConfig<S> {
651
756
  defaultExpiryDays?: number;
652
757
  }
653
758
 
654
- export { isTerminal as $, ACTIVE_STATUSES as A, type RequestSummary as B, type Clock as C, type DocumentStatsRow as D, type EsignChannel as E, type SigningAuditEventDTO as F, type GroupBreakdown as G, type HooksPort as H, type SigningCampaignDTO as I, type StatusCountMap as J, type SubjectFilter as K, type SubjectFilterField as L, type SubjectSigningState as M, type NotifierPort as N, type OutstandingRequest as O, type PersistencePort as P, type SubjectSummary as Q, type ResendPolicy as R, type SubjectSelection as S, type SubmitSignatureInput as T, TERMINAL_STATUSES as U, type VersionPolicy as V, assertTransition as W, canTransition as X, declineSchema as Y, esignChannelSchema as Z, isActive as _, type SubjectsPort as a, placementSchema as a0, placementsSchema as a1, signatureFieldSchema as a2, subjectSelectionSchema as a3, submitSignatureSchema as a4, type SkippedSubject as b, type StoragePort as c, type SignatureField as d, type SigningDocumentVersionDTO as e, type SigningDocumentDTO as f, type SigningRequestDTO as g, type EsignConfig as h, type SubjectSigningStatus as i, type CoverageReport as j, type CampaignStatsRow as k, type StatsRange as l, type ScopeStatsRow as m, type SubjectTypeDescriptor as n, type Placement as o, type AffectedSubject as p, type AuthPort as q, type DeclineInput as r, type DocumentDeletionContext as s, ESIGN_CHANNELS as t, ESIGN_STATUSES as u, type EsignStatus as v, type NewAuditEventRow as w, type NewRequestRow as x, type NotifierAttachment as y, type Recipient as z };
759
+ export { TERMINAL_STATUSES as $, ACTIVE_STATUSES as A, type NewAuditEventRow as B, type Clock as C, type DocumentStatsRow as D, type EsignChannel as E, type FieldType as F, type GroupBreakdown as G, type HooksPort as H, type NewRequestRow as I, type NotifierAttachment as J, type Placement as K, type Recipient as L, type RequestSummary as M, type NotifierPort as N, type OutstandingRequest as O, type PersistencePort as P, type SigningAuditEventDTO as Q, type ResendPolicy as R, type SubjectSelection as S, type SigningCampaignDTO as T, type StatusCountMap as U, type VersionPolicy as V, type SubjectFilter as W, type SubjectFilterField as X, type SubjectSigningState as Y, type SubjectSummary as Z, type SubmitSignatureInput as _, type SubjectsPort as a, assertTransition as a0, canTransition as a1, declineSchema as a2, documentFieldSchema as a3, esignChannelSchema as a4, formatPickedDate as a5, isActive as a6, isTerminal as a7, placementSchema as a8, placementsSchema as a9, signatureFieldSchema as aa, subjectSelectionSchema as ab, submitSignatureSchema as ac, type SkippedSubject as b, type StoragePort as c, type SignatureField as d, type SigningDocumentVersionDTO as e, type SigningDocumentDTO as f, type SigningRequestDTO as g, type EsignConfig as h, type SubjectSigningStatus as i, type CoverageReport as j, type CampaignStatsRow as k, type StatsRange as l, type ScopeStatsRow as m, type SubjectTypeDescriptor as n, type DocumentField as o, type AffectedSubject as p, type AuthPort as q, DATE_FORMATS as r, DATE_FORMAT_LABELS as s, DEFAULT_DATE_FORMAT as t, type DateFormat as u, type DeclineInput as v, type DocumentDeletionContext as w, ESIGN_CHANNELS as x, ESIGN_STATUSES as y, type EsignStatus as z };
@@ -39,11 +39,28 @@ var mapDoc = (r) => ({
39
39
  createdAt: iso(r.createdAt),
40
40
  updatedAt: iso(r.updatedAt)
41
41
  });
42
- function toFields(raw) {
43
- if (Array.isArray(raw)) return raw;
44
- if (raw && typeof raw === "object") {
45
- return [{ ...raw, id: "field-1", label: "Signature" }];
42
+ function toField(raw) {
43
+ const f = raw ?? {};
44
+ const type = f.type === "date" ? "date" : "signature";
45
+ const field = {
46
+ page: Number(f.page ?? 1),
47
+ x: Number(f.x ?? 0),
48
+ y: Number(f.y ?? 0),
49
+ w: Number(f.w ?? 0),
50
+ h: Number(f.h ?? 0),
51
+ id: typeof f.id === "string" ? f.id : "field-1",
52
+ label: typeof f.label === "string" ? f.label : "Signature",
53
+ type
54
+ };
55
+ if (type === "date") {
56
+ if (typeof f.dateFormat === "string") field.dateFormat = f.dateFormat;
57
+ field.minDate = typeof f.minDate === "string" ? f.minDate : null;
46
58
  }
59
+ return field;
60
+ }
61
+ function toFields(raw) {
62
+ if (Array.isArray(raw)) return raw.map(toField);
63
+ if (raw && typeof raw === "object") return [toField(raw)];
47
64
  return [];
48
65
  }
49
66
  var mapVer = (r) => ({