@betterinternship/core 1.3.1 → 1.3.2
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.
- package/dist/index.d.ts +5 -5
- package/dist/lib/email/email.d.ts +6 -6
- package/dist/lib/email/email.js +39 -39
- package/dist/lib/email/email.js.map +1 -1
- package/dist/lib/forms/fields.client.d.ts +14 -14
- package/dist/lib/forms/fields.client.js +24 -24
- package/dist/lib/forms/form-metadata.d.ts +93 -93
- package/dist/lib/forms/form-metadata.js +223 -223
- package/dist/lib/forms/index.d.ts +2 -2
- package/dist/lib/forms/index.js +18 -18
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './lib/chat';
|
|
2
|
-
export * from './lib/env';
|
|
3
|
-
export * from './lib/notice';
|
|
4
|
-
export * from './lib/email';
|
|
5
|
-
export * from './lib/forms';
|
|
1
|
+
export * from './lib/chat';
|
|
2
|
+
export * from './lib/env';
|
|
3
|
+
export * from './lib/notice';
|
|
4
|
+
export * from './lib/email';
|
|
5
|
+
export * from './lib/forms';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare const sendSingleEmail: ({ sender, subject, recipient, content, }: {
|
|
2
|
-
sender?: string;
|
|
3
|
-
subject: string;
|
|
4
|
-
recipient: string;
|
|
5
|
-
content: string;
|
|
6
|
-
}) => void;
|
|
1
|
+
export declare const sendSingleEmail: ({ sender, subject, recipient, content, }: {
|
|
2
|
+
sender?: string;
|
|
3
|
+
subject: string;
|
|
4
|
+
recipient: string;
|
|
5
|
+
content: string;
|
|
6
|
+
}) => void;
|
package/dist/lib/email/email.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sendSingleEmail = void 0;
|
|
4
|
-
const nodemailer = require("nodemailer");
|
|
5
|
-
const uuid_1 = require("uuid");
|
|
6
|
-
const env_1 = require("../env");
|
|
7
|
-
const SMTP_EMAIL = env_1.ENV.SMTP_EMAIL;
|
|
8
|
-
const SMTP_PASSWORD = env_1.ENV.SMTP_PASSWORD;
|
|
9
|
-
if (!SMTP_EMAIL || !SMTP_PASSWORD)
|
|
10
|
-
throw Error('[ERROR:ENV]: Missing SMTP setup.');
|
|
11
|
-
const transporter = nodemailer.createTransport({
|
|
12
|
-
service: 'Gmail',
|
|
13
|
-
host: 'smtp.gmail.com',
|
|
14
|
-
port: 465,
|
|
15
|
-
secure: true,
|
|
16
|
-
auth: {
|
|
17
|
-
user: SMTP_EMAIL,
|
|
18
|
-
pass: SMTP_PASSWORD,
|
|
19
|
-
},
|
|
20
|
-
messageId: `${(0, uuid_1.v4)()}${SMTP_EMAIL}`,
|
|
21
|
-
});
|
|
22
|
-
const sendSingleEmail = ({ sender, subject, recipient, content, }) => {
|
|
23
|
-
transporter.sendMail({
|
|
24
|
-
from: sender ?? SMTP_EMAIL
|
|
25
|
-
to: recipient,
|
|
26
|
-
subject,
|
|
27
|
-
html: content,
|
|
28
|
-
}, (error, info) => {
|
|
29
|
-
if (error) {
|
|
30
|
-
console.error('[ERROR] Could not send email.');
|
|
31
|
-
console.error('[-----] ' + error.message);
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
console.warn('[LOG] Email sent to ' + recipient);
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
return;
|
|
38
|
-
};
|
|
39
|
-
exports.sendSingleEmail = sendSingleEmail;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendSingleEmail = void 0;
|
|
4
|
+
const nodemailer = require("nodemailer");
|
|
5
|
+
const uuid_1 = require("uuid");
|
|
6
|
+
const env_1 = require("../env");
|
|
7
|
+
const SMTP_EMAIL = env_1.ENV.SMTP_EMAIL;
|
|
8
|
+
const SMTP_PASSWORD = env_1.ENV.SMTP_PASSWORD;
|
|
9
|
+
if (!SMTP_EMAIL || !SMTP_PASSWORD)
|
|
10
|
+
throw Error('[ERROR:ENV]: Missing SMTP setup.');
|
|
11
|
+
const transporter = nodemailer.createTransport({
|
|
12
|
+
service: 'Gmail',
|
|
13
|
+
host: 'smtp.gmail.com',
|
|
14
|
+
port: 465,
|
|
15
|
+
secure: true,
|
|
16
|
+
auth: {
|
|
17
|
+
user: SMTP_EMAIL,
|
|
18
|
+
pass: SMTP_PASSWORD,
|
|
19
|
+
},
|
|
20
|
+
messageId: `${(0, uuid_1.v4)()}${SMTP_EMAIL}`,
|
|
21
|
+
});
|
|
22
|
+
const sendSingleEmail = ({ sender, subject, recipient, content, }) => {
|
|
23
|
+
transporter.sendMail({
|
|
24
|
+
from: sender ?? `"Internship HQ" <${SMTP_EMAIL}>`,
|
|
25
|
+
to: recipient,
|
|
26
|
+
subject,
|
|
27
|
+
html: content,
|
|
28
|
+
}, (error, info) => {
|
|
29
|
+
if (error) {
|
|
30
|
+
console.error('[ERROR] Could not send email.');
|
|
31
|
+
console.error('[-----] ' + error.message);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
console.warn('[LOG] Email sent to ' + recipient);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
return;
|
|
38
|
+
};
|
|
39
|
+
exports.sendSingleEmail = sendSingleEmail;
|
|
40
40
|
//# sourceMappingURL=email.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email.js","sourceRoot":"","sources":["../../../lib/email/email.ts"],"names":[],"mappings":";;;AASA,yCAAyC;AACzC,+BAA0B;AAC1B,gCAA6B;AAE7B,MAAM,UAAU,GAAG,SAAG,CAAC,UAAU,CAAC;AAClC,MAAM,aAAa,GAAG,SAAG,CAAC,aAAa,CAAC;AAExC,IAAI,CAAC,UAAU,IAAI,CAAC,aAAa;IAC/B,MAAM,KAAK,CAAC,kCAAkC,CAAC,CAAC;AAKlD,MAAM,WAAW,GAAG,UAAU,CAAC,eAAe,CAAC;IAC7C,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE,GAAG;IACT,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE;QACJ,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,aAAa;KACpB;IACD,SAAS,EAAE,GAAG,IAAA,SAAE,GAAE,GAAG,UAAU,EAAE;CAClC,CAAC,CAAC;AAQI,MAAM,eAAe,GAAG,CAAC,EAC9B,MAAM,EACN,OAAO,EACP,SAAS,EACT,OAAO,GAMR,EAAE,EAAE;IACH,WAAW,CAAC,QAAQ,CAClB;QACE,IAAI,EAAE,MAAM,IAAI,UAAU;
|
|
1
|
+
{"version":3,"file":"email.js","sourceRoot":"","sources":["../../../lib/email/email.ts"],"names":[],"mappings":";;;AASA,yCAAyC;AACzC,+BAA0B;AAC1B,gCAA6B;AAE7B,MAAM,UAAU,GAAG,SAAG,CAAC,UAAU,CAAC;AAClC,MAAM,aAAa,GAAG,SAAG,CAAC,aAAa,CAAC;AAExC,IAAI,CAAC,UAAU,IAAI,CAAC,aAAa;IAC/B,MAAM,KAAK,CAAC,kCAAkC,CAAC,CAAC;AAKlD,MAAM,WAAW,GAAG,UAAU,CAAC,eAAe,CAAC;IAC7C,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE,GAAG;IACT,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE;QACJ,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,aAAa;KACpB;IACD,SAAS,EAAE,GAAG,IAAA,SAAE,GAAE,GAAG,UAAU,EAAE;CAClC,CAAC,CAAC;AAQI,MAAM,eAAe,GAAG,CAAC,EAC9B,MAAM,EACN,OAAO,EACP,SAAS,EACT,OAAO,GAMR,EAAE,EAAE;IACH,WAAW,CAAC,QAAQ,CAClB;QACE,IAAI,EAAE,MAAM,IAAI,oBAAoB,UAAU,GAAG;QACjD,EAAE,EAAE,SAAS;QACb,OAAO;QACP,IAAI,EAAE,OAAO;KACd,EACD,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QACd,IAAI,KAAK,EAAE,CAAC;YACV,OAAO,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;YAC/C,OAAO,CAAC,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;QAC5C,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,IAAI,CAAC,sBAAsB,GAAG,SAAS,CAAC,CAAC;QACnD,CAAC;IACH,CAAC,CACF,CAAC;IAEF,OAAO;AACT,CAAC,CAAC;AA7BW,QAAA,eAAe,mBA6B1B"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { ZodType } from 'zod';
|
|
2
|
-
import { IFormField, IFormFieldPrefiller, IFormFieldValidator } from './form-metadata';
|
|
3
|
-
import { EnumValue } from 'zod/v4/core/util.cjs';
|
|
4
|
-
export declare const getSchemaClientType: (s: ZodType) => ClientFieldType;
|
|
5
|
-
export type ClientFieldType = 'text' | 'number' | 'date' | 'dropdown' | 'checkbox' | 'textarea' | 'multiselect' | 'time' | 'signature';
|
|
6
|
-
export type ClientFieldSection = 'student' | 'internship' | 'entity' | 'university' | 'report' | 'feedback';
|
|
7
|
-
export type ClientField<SourceDomains extends any[]> = Omit<IFormField, 'x' | 'y' | 'w' | 'h' | 'page' | 'type' | 'validator' | 'prefiller' | 'align_h' | 'align_v'> & {
|
|
8
|
-
type: ClientFieldType;
|
|
9
|
-
validator: IFormFieldValidator | null;
|
|
10
|
-
prefiller: IFormFieldPrefiller<SourceDomains> | null;
|
|
11
|
-
section: ClientFieldSection;
|
|
12
|
-
options?: EnumValue[];
|
|
13
|
-
coerce: (s: string) => string | number | boolean | Date | Array<string>;
|
|
14
|
-
};
|
|
1
|
+
import { ZodType } from 'zod';
|
|
2
|
+
import { IFormField, IFormFieldPrefiller, IFormFieldValidator } from './form-metadata';
|
|
3
|
+
import { EnumValue } from 'zod/v4/core/util.cjs';
|
|
4
|
+
export declare const getSchemaClientType: (s: ZodType) => ClientFieldType;
|
|
5
|
+
export type ClientFieldType = 'text' | 'number' | 'date' | 'dropdown' | 'checkbox' | 'textarea' | 'multiselect' | 'time' | 'signature';
|
|
6
|
+
export type ClientFieldSection = 'student' | 'internship' | 'entity' | 'university' | 'report' | 'feedback';
|
|
7
|
+
export type ClientField<SourceDomains extends any[]> = Omit<IFormField, 'x' | 'y' | 'w' | 'h' | 'page' | 'type' | 'validator' | 'prefiller' | 'align_h' | 'align_v'> & {
|
|
8
|
+
type: ClientFieldType;
|
|
9
|
+
validator: IFormFieldValidator | null;
|
|
10
|
+
prefiller: IFormFieldPrefiller<SourceDomains> | null;
|
|
11
|
+
section: ClientFieldSection;
|
|
12
|
+
options?: EnumValue[];
|
|
13
|
+
coerce: (s: string) => string | number | boolean | Date | Array<string>;
|
|
14
|
+
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSchemaClientType = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const getSchemaClientType = (s) => {
|
|
6
|
-
const infer = s.type;
|
|
7
|
-
const desc = s.description;
|
|
8
|
-
if (infer === 'date' || desc === 'date')
|
|
9
|
-
return 'date';
|
|
10
|
-
if (infer === 'number' || desc === 'number')
|
|
11
|
-
return 'number';
|
|
12
|
-
if (infer === 'enum' || desc === 'dropdown')
|
|
13
|
-
return 'dropdown';
|
|
14
|
-
if (infer === 'boolean' || desc === 'checkbox')
|
|
15
|
-
return 'checkbox';
|
|
16
|
-
if (s instanceof zod_1.default.ZodArray && desc === 'multiselect')
|
|
17
|
-
return 'multiselect';
|
|
18
|
-
if (desc === 'textarea')
|
|
19
|
-
return 'textarea';
|
|
20
|
-
if (desc === 'time')
|
|
21
|
-
return 'time';
|
|
22
|
-
return 'text';
|
|
23
|
-
};
|
|
24
|
-
exports.getSchemaClientType = getSchemaClientType;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSchemaClientType = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const getSchemaClientType = (s) => {
|
|
6
|
+
const infer = s.type;
|
|
7
|
+
const desc = s.description;
|
|
8
|
+
if (infer === 'date' || desc === 'date')
|
|
9
|
+
return 'date';
|
|
10
|
+
if (infer === 'number' || desc === 'number')
|
|
11
|
+
return 'number';
|
|
12
|
+
if (infer === 'enum' || desc === 'dropdown')
|
|
13
|
+
return 'dropdown';
|
|
14
|
+
if (infer === 'boolean' || desc === 'checkbox')
|
|
15
|
+
return 'checkbox';
|
|
16
|
+
if (s instanceof zod_1.default.ZodArray && desc === 'multiselect')
|
|
17
|
+
return 'multiselect';
|
|
18
|
+
if (desc === 'textarea')
|
|
19
|
+
return 'textarea';
|
|
20
|
+
if (desc === 'time')
|
|
21
|
+
return 'time';
|
|
22
|
+
return 'text';
|
|
23
|
+
};
|
|
24
|
+
exports.getSchemaClientType = getSchemaClientType;
|
|
25
25
|
//# sourceMappingURL=fields.client.js.map
|
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
import { ZodType } from 'zod';
|
|
2
|
-
import { ClientField } from './fields.client';
|
|
3
|
-
import { ServerField } from './fields.server';
|
|
4
|
-
export declare const SCHEMA_VERSION = 0;
|
|
5
|
-
export declare const PARTIES: string[];
|
|
6
|
-
export declare const SOURCES: string[];
|
|
7
|
-
export declare const FIELD_TYPES: string[];
|
|
8
|
-
export interface IFormMetadata {
|
|
9
|
-
name: string;
|
|
10
|
-
label: string;
|
|
11
|
-
schema_version: number;
|
|
12
|
-
schema: IFormField[];
|
|
13
|
-
schema_phantoms?: IFormPhantomField[];
|
|
14
|
-
subscribers: IFormSubscriber[];
|
|
15
|
-
signatories: IFormSignatory[];
|
|
16
|
-
required_parties: IFormPendingParties[];
|
|
17
|
-
params?: IFormParams;
|
|
18
|
-
}
|
|
19
|
-
export interface IFormParams {
|
|
20
|
-
[key: string]: string | IFormParams;
|
|
21
|
-
}
|
|
22
|
-
interface IFormContact {
|
|
23
|
-
name: string;
|
|
24
|
-
honorific: string;
|
|
25
|
-
title: string;
|
|
26
|
-
email: string;
|
|
27
|
-
}
|
|
28
|
-
export type IFormSubscriber = IFormContact;
|
|
29
|
-
export interface IFormSignatory extends IFormContact {
|
|
30
|
-
field: string;
|
|
31
|
-
}
|
|
32
|
-
export type IFormPendingParties = {
|
|
33
|
-
party: string;
|
|
34
|
-
order: number;
|
|
35
|
-
};
|
|
36
|
-
export interface IFormField {
|
|
37
|
-
field: string;
|
|
38
|
-
type: 'text' | 'signature';
|
|
39
|
-
x: number;
|
|
40
|
-
y: number;
|
|
41
|
-
w: number;
|
|
42
|
-
h: number;
|
|
43
|
-
page: number;
|
|
44
|
-
align_h?: 'left' | 'center' | 'right';
|
|
45
|
-
align_v?: 'top' | 'middle' | 'bottom';
|
|
46
|
-
label: string;
|
|
47
|
-
source: 'auto' | 'prefill' | 'derived' | 'manual';
|
|
48
|
-
party: 'university' | 'entity' | 'student' | 'student-guardian';
|
|
49
|
-
shared: boolean;
|
|
50
|
-
descriptor?: boolean;
|
|
51
|
-
tooltip_label: string;
|
|
52
|
-
validator: string;
|
|
53
|
-
prefiller: string;
|
|
54
|
-
}
|
|
55
|
-
export interface IFormPhantomField {
|
|
56
|
-
field: string;
|
|
57
|
-
label: string;
|
|
58
|
-
type: 'email' | 'param';
|
|
59
|
-
source: 'auto' | 'prefill' | 'derived' | 'manual';
|
|
60
|
-
party: 'university' | 'entity' | 'student' | 'student-guardian';
|
|
61
|
-
shared: boolean;
|
|
62
|
-
descriptor?: boolean;
|
|
63
|
-
tooltip_label: string;
|
|
64
|
-
validator: string;
|
|
65
|
-
prefiller: string;
|
|
66
|
-
}
|
|
67
|
-
export type IFormSourceDomains<SourceDomains extends any[]> = Record<string, SourceDomains[number]>;
|
|
68
|
-
export type IFormFieldValidator = ZodType;
|
|
69
|
-
export type IFormFieldPrefiller<SourceDomains extends any[]> = (sourceDomains: IFormSourceDomains<SourceDomains>) => string;
|
|
70
|
-
export declare class FormMetadata<SourceDomains extends any[]> {
|
|
71
|
-
private readonly formMetadata;
|
|
72
|
-
private readonly fields;
|
|
73
|
-
constructor(formMetadata: IFormMetadata);
|
|
74
|
-
encodeAsJSON(): string;
|
|
75
|
-
static decodeFromJSON<SourceDomains extends any[]>(json: string): FormMetadata<SourceDomains>;
|
|
76
|
-
getLabel(): string;
|
|
77
|
-
getFieldForClient(index: number, sourceDomains?: IFormSourceDomains<SourceDomains>, derivationBase?: IFormParams): ClientField<SourceDomains>;
|
|
78
|
-
getFieldsForClient(sourceDomains?: IFormSourceDomains<SourceDomains>, derivationBase?: IFormParams): ClientField<SourceDomains>[];
|
|
79
|
-
getFieldsForServer(): ServerField[];
|
|
80
|
-
getPhantomFields(): IFormPhantomField[];
|
|
81
|
-
inferParams(): string[];
|
|
82
|
-
getParams(): IFormParams;
|
|
83
|
-
getDescriptors(): IFormField[];
|
|
84
|
-
getSignatoryAsValues(): Record<string, string>;
|
|
85
|
-
private parseValidator;
|
|
86
|
-
private parsePrefiller;
|
|
87
|
-
private enumerateParams;
|
|
88
|
-
private populateParams;
|
|
89
|
-
getSignatories(): IFormContact[];
|
|
90
|
-
getSubscribers(): IFormContact[];
|
|
91
|
-
getRequiredParties(): IFormPendingParties[];
|
|
92
|
-
}
|
|
93
|
-
export {};
|
|
1
|
+
import { ZodType } from 'zod';
|
|
2
|
+
import { ClientField } from './fields.client';
|
|
3
|
+
import { ServerField } from './fields.server';
|
|
4
|
+
export declare const SCHEMA_VERSION = 0;
|
|
5
|
+
export declare const PARTIES: string[];
|
|
6
|
+
export declare const SOURCES: string[];
|
|
7
|
+
export declare const FIELD_TYPES: string[];
|
|
8
|
+
export interface IFormMetadata {
|
|
9
|
+
name: string;
|
|
10
|
+
label: string;
|
|
11
|
+
schema_version: number;
|
|
12
|
+
schema: IFormField[];
|
|
13
|
+
schema_phantoms?: IFormPhantomField[];
|
|
14
|
+
subscribers: IFormSubscriber[];
|
|
15
|
+
signatories: IFormSignatory[];
|
|
16
|
+
required_parties: IFormPendingParties[];
|
|
17
|
+
params?: IFormParams;
|
|
18
|
+
}
|
|
19
|
+
export interface IFormParams {
|
|
20
|
+
[key: string]: string | IFormParams;
|
|
21
|
+
}
|
|
22
|
+
interface IFormContact {
|
|
23
|
+
name: string;
|
|
24
|
+
honorific: string;
|
|
25
|
+
title: string;
|
|
26
|
+
email: string;
|
|
27
|
+
}
|
|
28
|
+
export type IFormSubscriber = IFormContact;
|
|
29
|
+
export interface IFormSignatory extends IFormContact {
|
|
30
|
+
field: string;
|
|
31
|
+
}
|
|
32
|
+
export type IFormPendingParties = {
|
|
33
|
+
party: string;
|
|
34
|
+
order: number;
|
|
35
|
+
};
|
|
36
|
+
export interface IFormField {
|
|
37
|
+
field: string;
|
|
38
|
+
type: 'text' | 'signature';
|
|
39
|
+
x: number;
|
|
40
|
+
y: number;
|
|
41
|
+
w: number;
|
|
42
|
+
h: number;
|
|
43
|
+
page: number;
|
|
44
|
+
align_h?: 'left' | 'center' | 'right';
|
|
45
|
+
align_v?: 'top' | 'middle' | 'bottom';
|
|
46
|
+
label: string;
|
|
47
|
+
source: 'auto' | 'prefill' | 'derived' | 'manual';
|
|
48
|
+
party: 'university' | 'entity' | 'student' | 'student-guardian';
|
|
49
|
+
shared: boolean;
|
|
50
|
+
descriptor?: boolean;
|
|
51
|
+
tooltip_label: string;
|
|
52
|
+
validator: string;
|
|
53
|
+
prefiller: string;
|
|
54
|
+
}
|
|
55
|
+
export interface IFormPhantomField {
|
|
56
|
+
field: string;
|
|
57
|
+
label: string;
|
|
58
|
+
type: 'email' | 'param';
|
|
59
|
+
source: 'auto' | 'prefill' | 'derived' | 'manual';
|
|
60
|
+
party: 'university' | 'entity' | 'student' | 'student-guardian';
|
|
61
|
+
shared: boolean;
|
|
62
|
+
descriptor?: boolean;
|
|
63
|
+
tooltip_label: string;
|
|
64
|
+
validator: string;
|
|
65
|
+
prefiller: string;
|
|
66
|
+
}
|
|
67
|
+
export type IFormSourceDomains<SourceDomains extends any[]> = Record<string, SourceDomains[number]>;
|
|
68
|
+
export type IFormFieldValidator = ZodType;
|
|
69
|
+
export type IFormFieldPrefiller<SourceDomains extends any[]> = (sourceDomains: IFormSourceDomains<SourceDomains>) => string;
|
|
70
|
+
export declare class FormMetadata<SourceDomains extends any[]> {
|
|
71
|
+
private readonly formMetadata;
|
|
72
|
+
private readonly fields;
|
|
73
|
+
constructor(formMetadata: IFormMetadata);
|
|
74
|
+
encodeAsJSON(): string;
|
|
75
|
+
static decodeFromJSON<SourceDomains extends any[]>(json: string): FormMetadata<SourceDomains>;
|
|
76
|
+
getLabel(): string;
|
|
77
|
+
getFieldForClient(index: number, sourceDomains?: IFormSourceDomains<SourceDomains>, derivationBase?: IFormParams): ClientField<SourceDomains>;
|
|
78
|
+
getFieldsForClient(sourceDomains?: IFormSourceDomains<SourceDomains>, derivationBase?: IFormParams): ClientField<SourceDomains>[];
|
|
79
|
+
getFieldsForServer(): ServerField[];
|
|
80
|
+
getPhantomFields(): IFormPhantomField[];
|
|
81
|
+
inferParams(): string[];
|
|
82
|
+
getParams(): IFormParams;
|
|
83
|
+
getDescriptors(): IFormField[];
|
|
84
|
+
getSignatoryAsValues(): Record<string, string>;
|
|
85
|
+
private parseValidator;
|
|
86
|
+
private parsePrefiller;
|
|
87
|
+
private enumerateParams;
|
|
88
|
+
private populateParams;
|
|
89
|
+
getSignatories(): IFormContact[];
|
|
90
|
+
getSubscribers(): IFormContact[];
|
|
91
|
+
getRequiredParties(): IFormPendingParties[];
|
|
92
|
+
}
|
|
93
|
+
export {};
|