@betterinternship/core 1.2.70 → 1.2.73

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.
@@ -1,91 +1,89 @@
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: ('university' | 'entity' | 'student' | 'student-guardian')[];
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
- party: 'university' | 'entity' | 'student' | 'student-guardian';
28
- }
29
- export type IFormSubscriber = IFormContact;
30
- export interface IFormSignatory extends IFormContact {
31
- field: string;
32
- status: 'pending' | 'signed';
33
- }
34
- export interface IFormField {
35
- field: string;
36
- type: 'text' | 'signature';
37
- x: number;
38
- y: number;
39
- w: number;
40
- h: number;
41
- page: number;
42
- align_h?: 'left' | 'center' | 'right';
43
- align_v?: 'top' | 'middle' | 'bottom';
44
- label: string;
45
- source: 'auto' | 'prefill' | 'derived' | 'manual';
46
- party: 'university' | 'entity' | 'student' | 'student-guardian';
47
- shared: boolean;
48
- descriptor?: boolean;
49
- tooltip_label: string;
50
- validator: string;
51
- prefiller: string;
52
- }
53
- export interface IFormPhantomField {
54
- field: string;
55
- label: string;
56
- type: 'email' | 'param';
57
- source: 'auto' | 'prefill' | 'derived' | 'manual';
58
- party: 'university' | 'entity' | 'student' | 'student-guardian';
59
- shared: boolean;
60
- descriptor?: boolean;
61
- tooltip_label: string;
62
- validator: string;
63
- prefiller: string;
64
- }
65
- export type IFormSourceDomains<SourceDomains extends any[]> = Record<string, SourceDomains[number]>;
66
- export type IFormFieldValidator = ZodType;
67
- export type IFormFieldPrefiller<SourceDomains extends any[]> = (sourceDomains: IFormSourceDomains<SourceDomains>) => string;
68
- export declare class FormMetadata<SourceDomains extends any[]> {
69
- private readonly formMetadata;
70
- private readonly fields;
71
- constructor(formMetadata: IFormMetadata);
72
- encodeAsJSON(): string;
73
- static decodeFromJSON<SourceDomains extends any[]>(json: string): FormMetadata<SourceDomains>;
74
- getLabel(): string;
75
- getFieldForClient(index: number, sourceDomains?: IFormSourceDomains<SourceDomains>, derivationBase?: IFormParams): ClientField<SourceDomains>;
76
- getFieldsForClient(sourceDomains?: IFormSourceDomains<SourceDomains>, derivationBase?: IFormParams): ClientField<SourceDomains>[];
77
- getFieldsForServer(): ServerField[];
78
- getPhantomFields(): IFormPhantomField[];
79
- inferParams(): string[];
80
- getParams(): IFormParams;
81
- getDescriptors(): IFormField[];
82
- getSignatoryAsValues(): Record<string, string>;
83
- private parseValidator;
84
- private parsePrefiller;
85
- private enumerateParams;
86
- private populateParams;
87
- getSignatories(): Omit<IFormContact, 'honorific'>[];
88
- getSubscribers(): IFormContact[];
89
- getRequiredParties(): string[];
90
- }
91
- 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: ('university' | 'entity' | 'student' | 'student-guardian')[];
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 interface IFormField {
33
+ field: string;
34
+ type: 'text' | 'signature';
35
+ x: number;
36
+ y: number;
37
+ w: number;
38
+ h: number;
39
+ page: number;
40
+ align_h?: 'left' | 'center' | 'right';
41
+ align_v?: 'top' | 'middle' | 'bottom';
42
+ label: string;
43
+ source: 'auto' | 'prefill' | 'derived' | 'manual';
44
+ party: 'university' | 'entity' | 'student' | 'student-guardian';
45
+ shared: boolean;
46
+ descriptor?: boolean;
47
+ tooltip_label: string;
48
+ validator: string;
49
+ prefiller: string;
50
+ }
51
+ export interface IFormPhantomField {
52
+ field: string;
53
+ label: string;
54
+ type: 'email' | 'param';
55
+ source: 'auto' | 'prefill' | 'derived' | 'manual';
56
+ party: 'university' | 'entity' | 'student' | 'student-guardian';
57
+ shared: boolean;
58
+ descriptor?: boolean;
59
+ tooltip_label: string;
60
+ validator: string;
61
+ prefiller: string;
62
+ }
63
+ export type IFormSourceDomains<SourceDomains extends any[]> = Record<string, SourceDomains[number]>;
64
+ export type IFormFieldValidator = ZodType;
65
+ export type IFormFieldPrefiller<SourceDomains extends any[]> = (sourceDomains: IFormSourceDomains<SourceDomains>) => string;
66
+ export declare class FormMetadata<SourceDomains extends any[]> {
67
+ private readonly formMetadata;
68
+ private readonly fields;
69
+ constructor(formMetadata: IFormMetadata);
70
+ encodeAsJSON(): string;
71
+ static decodeFromJSON<SourceDomains extends any[]>(json: string): FormMetadata<SourceDomains>;
72
+ getLabel(): string;
73
+ getFieldForClient(index: number, sourceDomains?: IFormSourceDomains<SourceDomains>, derivationBase?: IFormParams): ClientField<SourceDomains>;
74
+ getFieldsForClient(sourceDomains?: IFormSourceDomains<SourceDomains>, derivationBase?: IFormParams): ClientField<SourceDomains>[];
75
+ getFieldsForServer(): ServerField[];
76
+ getPhantomFields(): IFormPhantomField[];
77
+ inferParams(): string[];
78
+ getParams(): IFormParams;
79
+ getDescriptors(): IFormField[];
80
+ getSignatoryAsValues(): Record<string, string>;
81
+ private parseValidator;
82
+ private parsePrefiller;
83
+ private enumerateParams;
84
+ private populateParams;
85
+ getSignatories(): Omit<IFormContact, 'honorific'>[];
86
+ getSubscribers(): Omit<IFormContact, 'honorific'>[];
87
+ getRequiredParties(): string[];
88
+ }
89
+ export {};