@betterinternship/core 2.4.1 → 2.5.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.
Files changed (38) hide show
  1. package/dist/index.js +5 -5
  2. package/dist/lib/broker/broker.d.ts +16 -16
  3. package/dist/lib/broker/broker.js +69 -69
  4. package/dist/lib/broker/index.d.ts +1 -1
  5. package/dist/lib/broker/index.js +1 -1
  6. package/dist/lib/broker/tasks/base.task.d.ts +22 -22
  7. package/dist/lib/broker/tasks/base.task.js +33 -33
  8. package/dist/lib/broker/tasks/email..task.d.ts +15 -15
  9. package/dist/lib/broker/tasks/email..task.js +3 -3
  10. package/dist/lib/broker/tasks/index.d.ts +1 -1
  11. package/dist/lib/broker/tasks/sign.task.d.ts +35 -35
  12. package/dist/lib/broker/tasks/sign.task.js +3 -3
  13. package/dist/lib/chat/chat.d.ts +51 -51
  14. package/dist/lib/chat/index.d.ts +2 -2
  15. package/dist/lib/chat/pb.d.ts +3 -3
  16. package/dist/lib/chat/pb.js +15 -15
  17. package/dist/lib/email/email.d.ts +11 -11
  18. package/dist/lib/email/email.js +93 -93
  19. package/dist/lib/email/index.d.ts +1 -1
  20. package/dist/lib/email/index.js +1 -1
  21. package/dist/lib/env.d.ts +1 -1
  22. package/dist/lib/forms/constants/fonts.d.ts +131 -0
  23. package/dist/lib/forms/constants/fonts.js +55 -0
  24. package/dist/lib/forms/constants/fonts.js.map +1 -0
  25. package/dist/lib/forms/constants/index.d.ts +1 -0
  26. package/dist/lib/forms/constants/index.js +2 -0
  27. package/dist/lib/forms/constants/index.js.map +1 -0
  28. package/dist/lib/forms/fields.client.js +20 -20
  29. package/dist/lib/forms/fields.server.d.ts +2 -0
  30. package/dist/lib/forms/fields.server.js +1 -1
  31. package/dist/lib/forms/form-metadata.d.ts +2 -0
  32. package/dist/lib/forms/form-metadata.js +322 -320
  33. package/dist/lib/forms/form-metadata.js.map +1 -1
  34. package/dist/lib/forms/index.d.ts +1 -0
  35. package/dist/lib/forms/index.js +4 -3
  36. package/dist/lib/forms/index.js.map +1 -1
  37. package/dist/tsconfig.tsbuildinfo +1 -1
  38. package/package.json +1 -1
@@ -1,94 +1,94 @@
1
- import { SendEmailCommand } from '@aws-sdk/client-ses';
2
- import { SESClient } from '@aws-sdk/client-ses';
3
- import * as nodemailer from 'nodemailer';
4
- import { v4 } from 'uuid';
5
- import { ENV } from '../env.js';
6
- const SMTP_EMAIL = ENV.SMTP_EMAIL;
7
- const SMTP_PASSWORD = ENV.SMTP_PASSWORD;
8
- if (!SMTP_EMAIL || !SMTP_PASSWORD)
9
- throw Error('[ERROR:ENV]: Missing SMTP setup.');
10
- const AWS_ACCESS_KEY_ID = ENV.AWS_ACCESS_KEY_ID;
11
- const AWS_SECRET_ACCESS_KEY = ENV.AWS_SECRET_ACCESS_KEY;
12
- const AWS_REGION = ENV.AWS_REGION;
13
- const AWS_DISABLED = !AWS_ACCESS_KEY_ID || !AWS_SECRET_ACCESS_KEY || !AWS_REGION;
14
- if (AWS_DISABLED)
15
- console.error('[ERROR:ENV]: Missing Amazon setup.');
16
- export const sesClient = new SESClient({
17
- region: ENV.AWS_REGION,
18
- });
19
- const transporter = nodemailer.createTransport({
20
- service: 'Gmail',
21
- host: 'smtp.gmail.com',
22
- port: 465,
23
- secure: true,
24
- auth: {
25
- user: SMTP_EMAIL,
26
- pass: SMTP_PASSWORD,
27
- },
28
- messageId: `${v4()}${SMTP_EMAIL}`,
29
- });
30
- const onEmailError = (recipient, resolve) => (error, info) => {
31
- if (error) {
32
- console.error('[ERROR:EMAIL] Could not send email.');
33
- console.error('[-----] ' + error.message);
34
- }
35
- else {
36
- resolve({
37
- messageId: info.messageId,
38
- response: info.response,
39
- });
40
- console.warn('[EMAIL] Email sent to ' + recipient);
41
- }
42
- };
43
- const traditionalEmailRoute = async ({ sender, subject, recipient, content, alias = 'hello', }) => {
44
- return new Promise((resolve) => {
45
- transporter.sendMail({
46
- from: `"${sender ?? 'BetterInternship'}" <${alias}@betterinternship.com>`,
47
- to: recipient,
48
- subject,
49
- html: content,
50
- }, onEmailError(recipient, resolve));
51
- });
52
- };
53
- const amazonEmailRoute = async ({ sender, subject, recipient, content, alias = 'hello', }) => {
54
- const params = {
55
- Destination: {
56
- ToAddresses: [recipient],
57
- },
58
- Message: {
59
- Subject: { Data: subject },
60
- Body: {
61
- Html: { Data: content },
62
- },
63
- },
64
- Source: `"${sender ?? 'BetterInternship'}" <${alias}@betterinternship.com>`,
65
- };
66
- try {
67
- const command = new SendEmailCommand(params);
68
- const result = await sesClient.send(command);
69
- console.warn('[AWSSES] Email sent to ' + recipient);
70
- return {
71
- messageId: result.MessageId,
72
- response: 'Successfully sent via Amazon SES.',
73
- };
74
- }
75
- catch (error) {
76
- console.error('[ERROR:AWSSES] Could not send email.');
77
- console.error('[-----] ' + error);
78
- }
79
- };
80
- export const sendSingleEmail = async (params) => {
81
- if (AWS_DISABLED) {
82
- return await traditionalEmailRoute(params);
83
- }
84
- else {
85
- const dice = Math.random();
86
- if (dice < 0.5) {
87
- return await traditionalEmailRoute(params);
88
- }
89
- else {
90
- return await amazonEmailRoute(params);
91
- }
92
- }
93
- };
1
+ import { SendEmailCommand } from '@aws-sdk/client-ses';
2
+ import { SESClient } from '@aws-sdk/client-ses';
3
+ import * as nodemailer from 'nodemailer';
4
+ import { v4 } from 'uuid';
5
+ import { ENV } from '../env.js';
6
+ const SMTP_EMAIL = ENV.SMTP_EMAIL;
7
+ const SMTP_PASSWORD = ENV.SMTP_PASSWORD;
8
+ if (!SMTP_EMAIL || !SMTP_PASSWORD)
9
+ throw Error('[ERROR:ENV]: Missing SMTP setup.');
10
+ const AWS_ACCESS_KEY_ID = ENV.AWS_ACCESS_KEY_ID;
11
+ const AWS_SECRET_ACCESS_KEY = ENV.AWS_SECRET_ACCESS_KEY;
12
+ const AWS_REGION = ENV.AWS_REGION;
13
+ const AWS_DISABLED = !AWS_ACCESS_KEY_ID || !AWS_SECRET_ACCESS_KEY || !AWS_REGION;
14
+ if (AWS_DISABLED)
15
+ console.error('[ERROR:ENV]: Missing Amazon setup.');
16
+ export const sesClient = new SESClient({
17
+ region: ENV.AWS_REGION,
18
+ });
19
+ const transporter = nodemailer.createTransport({
20
+ service: 'Gmail',
21
+ host: 'smtp.gmail.com',
22
+ port: 465,
23
+ secure: true,
24
+ auth: {
25
+ user: SMTP_EMAIL,
26
+ pass: SMTP_PASSWORD,
27
+ },
28
+ messageId: `${v4()}${SMTP_EMAIL}`,
29
+ });
30
+ const onEmailError = (recipient, resolve) => (error, info) => {
31
+ if (error) {
32
+ console.error('[ERROR:EMAIL] Could not send email.');
33
+ console.error('[-----] ' + error.message);
34
+ }
35
+ else {
36
+ resolve({
37
+ messageId: info.messageId,
38
+ response: info.response,
39
+ });
40
+ console.warn('[EMAIL] Email sent to ' + recipient);
41
+ }
42
+ };
43
+ const traditionalEmailRoute = async ({ sender, subject, recipient, content, alias = 'hello', }) => {
44
+ return new Promise((resolve) => {
45
+ transporter.sendMail({
46
+ from: `"${sender ?? 'BetterInternship'}" <${alias}@betterinternship.com>`,
47
+ to: recipient,
48
+ subject,
49
+ html: content,
50
+ }, onEmailError(recipient, resolve));
51
+ });
52
+ };
53
+ const amazonEmailRoute = async ({ sender, subject, recipient, content, alias = 'hello', }) => {
54
+ const params = {
55
+ Destination: {
56
+ ToAddresses: [recipient],
57
+ },
58
+ Message: {
59
+ Subject: { Data: subject },
60
+ Body: {
61
+ Html: { Data: content },
62
+ },
63
+ },
64
+ Source: `"${sender ?? 'BetterInternship'}" <${alias}@betterinternship.com>`,
65
+ };
66
+ try {
67
+ const command = new SendEmailCommand(params);
68
+ const result = await sesClient.send(command);
69
+ console.warn('[AWSSES] Email sent to ' + recipient);
70
+ return {
71
+ messageId: result.MessageId,
72
+ response: 'Successfully sent via Amazon SES.',
73
+ };
74
+ }
75
+ catch (error) {
76
+ console.error('[ERROR:AWSSES] Could not send email.');
77
+ console.error('[-----] ' + error);
78
+ }
79
+ };
80
+ export const sendSingleEmail = async (params) => {
81
+ if (AWS_DISABLED) {
82
+ return await traditionalEmailRoute(params);
83
+ }
84
+ else {
85
+ const dice = Math.random();
86
+ if (dice < 0.5) {
87
+ return await traditionalEmailRoute(params);
88
+ }
89
+ else {
90
+ return await amazonEmailRoute(params);
91
+ }
92
+ }
93
+ };
94
94
  //# sourceMappingURL=email.js.map
@@ -1 +1 @@
1
- export * from './email.js';
1
+ export * from './email.js';
@@ -1,2 +1,2 @@
1
- export * from './email.js';
1
+ export * from './email.js';
2
2
  //# sourceMappingURL=index.js.map
package/dist/lib/env.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const ENV: NodeJS.ProcessEnv;
1
+ export declare const ENV: NodeJS.ProcessEnv;
@@ -0,0 +1,131 @@
1
+ export declare const FONTS: readonly [{
2
+ readonly name: "Arial";
3
+ readonly filename: "arial.ttf";
4
+ }, {
5
+ readonly name: "Arial Bold";
6
+ readonly filename: "arialbd.ttf";
7
+ }, {
8
+ readonly name: "Arial Bold Italic";
9
+ readonly filename: "arialbi.ttf";
10
+ }, {
11
+ readonly name: "Arial Italic";
12
+ readonly filename: "ariali.ttf";
13
+ }, {
14
+ readonly name: "Arial Narrow";
15
+ readonly filename: "ARIALN.TTF";
16
+ }, {
17
+ readonly name: "Arial Narrow Bold";
18
+ readonly filename: "ARIALNB.TTF";
19
+ }, {
20
+ readonly name: "Arial Narrow Bold Italic";
21
+ readonly filename: "ARIALNBI.TTF";
22
+ }, {
23
+ readonly name: "Arial Narrow Italic";
24
+ readonly filename: "ARIALNI.TTF";
25
+ }, {
26
+ readonly name: "Arial Black";
27
+ readonly filename: "ariblk.ttf";
28
+ }, {
29
+ readonly name: "Roboto Regular";
30
+ readonly filename: "Roboto-Regular.ttf";
31
+ }, {
32
+ readonly name: "Roboto Thin";
33
+ readonly filename: "Roboto-Thin.ttf";
34
+ }, {
35
+ readonly name: "Roboto Thin Italic";
36
+ readonly filename: "Roboto-ThinItalic.ttf";
37
+ }, {
38
+ readonly name: "Roboto Light";
39
+ readonly filename: "Roboto-Light.ttf";
40
+ }, {
41
+ readonly name: "Roboto Light Italic";
42
+ readonly filename: "Roboto-LightItalic.ttf";
43
+ }, {
44
+ readonly name: "Roboto Medium";
45
+ readonly filename: "Roboto-Medium.ttf";
46
+ }, {
47
+ readonly name: "Roboto Medium Italic";
48
+ readonly filename: "Roboto-MediumItalic.ttf";
49
+ }, {
50
+ readonly name: "Roboto Bold";
51
+ readonly filename: "Roboto-Bold.ttf";
52
+ }, {
53
+ readonly name: "Roboto Bold Italic";
54
+ readonly filename: "Roboto-BoldItalic.ttf";
55
+ }, {
56
+ readonly name: "Roboto Black";
57
+ readonly filename: "Roboto-Black.ttf";
58
+ }, {
59
+ readonly name: "Roboto Black Italic";
60
+ readonly filename: "Roboto-BlackItalic.ttf";
61
+ }, {
62
+ readonly name: "Roboto Italic";
63
+ readonly filename: "Roboto-Italic.ttf";
64
+ }, {
65
+ readonly name: "Roboto Condensed Regular";
66
+ readonly filename: "RobotoCondensed-Regular.ttf";
67
+ }, {
68
+ readonly name: "Roboto Condensed Light";
69
+ readonly filename: "RobotoCondensed-Light.ttf";
70
+ }, {
71
+ readonly name: "Roboto Condensed Light Italic";
72
+ readonly filename: "RobotoCondensed-LightItalic.ttf";
73
+ }, {
74
+ readonly name: "Roboto Condensed Bold";
75
+ readonly filename: "RobotoCondensed-Bold.ttf";
76
+ }, {
77
+ readonly name: "Roboto Condensed Bold Italic";
78
+ readonly filename: "RobotoCondensed-BoldItalic.ttf";
79
+ }, {
80
+ readonly name: "Roboto Condensed Italic";
81
+ readonly filename: "RobotoCondensed-Italic.ttf";
82
+ }, {
83
+ readonly name: "Times New Roman";
84
+ readonly filename: "TIMES.TTF";
85
+ }, {
86
+ readonly name: "Times New Roman Bold";
87
+ readonly filename: "TIMESBD.TTF";
88
+ }, {
89
+ readonly name: "Times New Roman Bold Italic";
90
+ readonly filename: "TIMESBI.TTF";
91
+ }, {
92
+ readonly name: "Times New Roman Italic";
93
+ readonly filename: "TIMESI.TTF";
94
+ }, {
95
+ readonly name: "Ubuntu Mono Regular";
96
+ readonly filename: "UbuntuMono-Regular.ttf";
97
+ }, {
98
+ readonly name: "Ubuntu Mono Bold";
99
+ readonly filename: "UbuntuMono-Bold.ttf";
100
+ }, {
101
+ readonly name: "Ubuntu Mono Bold Italic";
102
+ readonly filename: "UbuntuMono-BoldItalic.ttf";
103
+ }, {
104
+ readonly name: "Ubuntu Mono Italic";
105
+ readonly filename: "UbuntuMono-Italic.ttf";
106
+ }, {
107
+ readonly name: "Inter";
108
+ readonly filename: "Inter-Regular.ttf";
109
+ }, {
110
+ readonly name: "Italianno";
111
+ readonly filename: "Italianno-Regular.ttf";
112
+ }, {
113
+ readonly name: "High Empathy";
114
+ readonly filename: "high-empathy.regular.ttf";
115
+ }, {
116
+ readonly name: "Megastina";
117
+ readonly filename: "megastina.regular.ttf";
118
+ }, {
119
+ readonly name: "Royalty Free";
120
+ readonly filename: "royalty-free.regular.ttf";
121
+ }, {
122
+ readonly name: "Testimonia";
123
+ readonly filename: "Testimonia.ttf";
124
+ }, {
125
+ readonly name: "The Signature";
126
+ readonly filename: "thesignature.regular.ttf";
127
+ }];
128
+ export type FontRecord = (typeof FONTS)[number];
129
+ export type FontName = FontRecord['name'];
130
+ export type FontFilename = FontRecord['filename'];
131
+ export declare function getFontFilename(name: FontName): FontFilename;
@@ -0,0 +1,55 @@
1
+ export const FONTS = [
2
+ { name: 'Arial', filename: 'arial.ttf' },
3
+ { name: 'Arial Bold', filename: 'arialbd.ttf' },
4
+ { name: 'Arial Bold Italic', filename: 'arialbi.ttf' },
5
+ { name: 'Arial Italic', filename: 'ariali.ttf' },
6
+ { name: 'Arial Narrow', filename: 'ARIALN.TTF' },
7
+ { name: 'Arial Narrow Bold', filename: 'ARIALNB.TTF' },
8
+ { name: 'Arial Narrow Bold Italic', filename: 'ARIALNBI.TTF' },
9
+ { name: 'Arial Narrow Italic', filename: 'ARIALNI.TTF' },
10
+ { name: 'Arial Black', filename: 'ariblk.ttf' },
11
+ { name: 'Roboto Regular', filename: 'Roboto-Regular.ttf' },
12
+ { name: 'Roboto Thin', filename: 'Roboto-Thin.ttf' },
13
+ { name: 'Roboto Thin Italic', filename: 'Roboto-ThinItalic.ttf' },
14
+ { name: 'Roboto Light', filename: 'Roboto-Light.ttf' },
15
+ { name: 'Roboto Light Italic', filename: 'Roboto-LightItalic.ttf' },
16
+ { name: 'Roboto Medium', filename: 'Roboto-Medium.ttf' },
17
+ { name: 'Roboto Medium Italic', filename: 'Roboto-MediumItalic.ttf' },
18
+ { name: 'Roboto Bold', filename: 'Roboto-Bold.ttf' },
19
+ { name: 'Roboto Bold Italic', filename: 'Roboto-BoldItalic.ttf' },
20
+ { name: 'Roboto Black', filename: 'Roboto-Black.ttf' },
21
+ { name: 'Roboto Black Italic', filename: 'Roboto-BlackItalic.ttf' },
22
+ { name: 'Roboto Italic', filename: 'Roboto-Italic.ttf' },
23
+ { name: 'Roboto Condensed Regular', filename: 'RobotoCondensed-Regular.ttf' },
24
+ { name: 'Roboto Condensed Light', filename: 'RobotoCondensed-Light.ttf' },
25
+ {
26
+ name: 'Roboto Condensed Light Italic',
27
+ filename: 'RobotoCondensed-LightItalic.ttf',
28
+ },
29
+ { name: 'Roboto Condensed Bold', filename: 'RobotoCondensed-Bold.ttf' },
30
+ {
31
+ name: 'Roboto Condensed Bold Italic',
32
+ filename: 'RobotoCondensed-BoldItalic.ttf',
33
+ },
34
+ { name: 'Roboto Condensed Italic', filename: 'RobotoCondensed-Italic.ttf' },
35
+ { name: 'Times New Roman', filename: 'TIMES.TTF' },
36
+ { name: 'Times New Roman Bold', filename: 'TIMESBD.TTF' },
37
+ { name: 'Times New Roman Bold Italic', filename: 'TIMESBI.TTF' },
38
+ { name: 'Times New Roman Italic', filename: 'TIMESI.TTF' },
39
+ { name: 'Ubuntu Mono Regular', filename: 'UbuntuMono-Regular.ttf' },
40
+ { name: 'Ubuntu Mono Bold', filename: 'UbuntuMono-Bold.ttf' },
41
+ { name: 'Ubuntu Mono Bold Italic', filename: 'UbuntuMono-BoldItalic.ttf' },
42
+ { name: 'Ubuntu Mono Italic', filename: 'UbuntuMono-Italic.ttf' },
43
+ { name: 'Inter', filename: 'Inter-Regular.ttf' },
44
+ { name: 'Italianno', filename: 'Italianno-Regular.ttf' },
45
+ { name: 'High Empathy', filename: 'high-empathy.regular.ttf' },
46
+ { name: 'Megastina', filename: 'megastina.regular.ttf' },
47
+ { name: 'Royalty Free', filename: 'royalty-free.regular.ttf' },
48
+ { name: 'Testimonia', filename: 'Testimonia.ttf' },
49
+ { name: 'The Signature', filename: 'thesignature.regular.ttf' },
50
+ ];
51
+ export function getFontFilename(name) {
52
+ const font = FONTS.find((f) => f.name === name);
53
+ return font?.filename ?? FONTS[0].filename;
54
+ }
55
+ //# sourceMappingURL=fonts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fonts.js","sourceRoot":"","sources":["../../../../lib/forms/constants/fonts.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,KAAK,GAAG;IAEnB,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE;IACxC,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE;IAC/C,EAAE,IAAI,EAAE,mBAAmB,EAAE,QAAQ,EAAE,aAAa,EAAE;IACtD,EAAE,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,YAAY,EAAE;IAChD,EAAE,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,YAAY,EAAE;IAChD,EAAE,IAAI,EAAE,mBAAmB,EAAE,QAAQ,EAAE,aAAa,EAAE;IACtD,EAAE,IAAI,EAAE,0BAA0B,EAAE,QAAQ,EAAE,cAAc,EAAE;IAC9D,EAAE,IAAI,EAAE,qBAAqB,EAAE,QAAQ,EAAE,aAAa,EAAE;IACxD,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAY,EAAE;IAG/C,EAAE,IAAI,EA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ts.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/forms/constants/index.ts"],"names":[],"mappings":"AAKA,cAAc,YAAY,CAAC"}
@@ -1,21 +1,21 @@
1
- import z from 'zod';
2
- export const getSchemaClientType = (s) => {
3
- const infer = s.type;
4
- const desc = s.description;
5
- if (infer === 'date' || desc === 'date')
6
- return 'date';
7
- if (infer === 'number' || desc === 'number')
8
- return 'number';
9
- if (infer === 'enum' || desc === 'dropdown')
10
- return 'dropdown';
11
- if (infer === 'boolean' || desc === 'checkbox')
12
- return 'checkbox';
13
- if (s instanceof z.ZodArray && desc === 'multiselect')
14
- return 'multiselect';
15
- if (desc === 'textarea')
16
- return 'textarea';
17
- if (desc === 'time')
18
- return 'time';
19
- return 'text';
20
- };
1
+ import z from 'zod';
2
+ export const getSchemaClientType = (s) => {
3
+ const infer = s.type;
4
+ const desc = s.description;
5
+ if (infer === 'date' || desc === 'date')
6
+ return 'date';
7
+ if (infer === 'number' || desc === 'number')
8
+ return 'number';
9
+ if (infer === 'enum' || desc === 'dropdown')
10
+ return 'dropdown';
11
+ if (infer === 'boolean' || desc === 'checkbox')
12
+ return 'checkbox';
13
+ if (s instanceof z.ZodArray && desc === 'multiselect')
14
+ return 'multiselect';
15
+ if (desc === 'textarea')
16
+ return 'textarea';
17
+ if (desc === 'time')
18
+ return 'time';
19
+ return 'text';
20
+ };
21
21
  //# sourceMappingURL=fields.client.js.map
@@ -1,3 +1,4 @@
1
+ import { FontFilename } from './constants/fonts.js';
1
2
  export type ServerField = {
2
3
  x: number;
3
4
  y: number;
@@ -11,4 +12,5 @@ export type ServerField = {
11
12
  align_v: 'middle' | 'top' | 'bottom';
12
13
  size?: number;
13
14
  wrap?: boolean;
15
+ font?: FontFilename;
14
16
  };
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=fields.server.js.map
@@ -1,6 +1,7 @@
1
1
  import { ZodType } from 'zod';
2
2
  import { ClientBlock, ClientField, ClientPhantomField } from './fields.client.js';
3
3
  import { ServerField } from './fields.server.js';
4
+ import { FontName } from './constants/fonts.js';
4
5
  export type FormValues = Record<string, string>;
5
6
  export type FormErrors = Record<string, string>;
6
7
  export declare const SCHEMA_VERSION = 1;
@@ -75,6 +76,7 @@ export interface IFormField {
75
76
  validator?: string;
76
77
  size?: number;
77
78
  wrap?: boolean;
79
+ font?: FontName;
78
80
  }
79
81
  export interface IFormPhantomField {
80
82
  field: string;