@betterinternship/core 2.8.8 → 2.8.10
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/lib/broker/base.process.d.ts +2 -2
- package/dist/lib/broker/base.process.js +2 -2
- package/dist/lib/broker/base.task.d.ts +40 -40
- package/dist/lib/broker/broker.d.ts +28 -28
- package/dist/lib/broker/broker.js +111 -111
- package/dist/lib/chat/chat.d.ts +51 -51
- package/dist/lib/chat/chat.js +183 -183
- package/dist/lib/chat/index.d.ts +2 -2
- package/dist/lib/chat/index.js +2 -2
- package/dist/lib/chat/pb.d.ts +3 -3
- package/dist/lib/chat/pb.js +15 -15
- package/dist/lib/email/email.d.ts +11 -11
- package/dist/lib/email/email.js +94 -94
- package/dist/lib/email/index.d.ts +1 -1
- package/dist/lib/email/index.js +1 -1
- package/dist/lib/env.d.ts +1 -1
- package/dist/lib/env.js +3 -3
- package/dist/lib/forms/constants/index.js +2 -2
- package/dist/lib/forms/field-preset-templates.js +8 -8
- package/dist/lib/forms/form-metadata.d.ts +136 -134
- package/dist/lib/forms/form-metadata.js +338 -325
- package/dist/lib/forms/form-metadata.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -5,14 +5,14 @@ const LONG_TEXT_VALIDATOR = `${TEXT_PREPROCESS}z.string().describe("textarea"))`
|
|
|
5
5
|
const NUMBER_VALIDATOR = 'z.number()';
|
|
6
6
|
const SIGNATURE_VALIDATOR = `${TEXT_PREPROCESS}z.string().nonempty({ message: "This field is required." }))`;
|
|
7
7
|
const DROPDOWN_VALIDATOR = `z.enum(["Option 1", "Option 2"], {message:"This field is required."})`;
|
|
8
|
-
const MULTISELECT_VALIDATOR = `z.array(
|
|
9
|
-
z.enum(
|
|
10
|
-
[
|
|
11
|
-
"Option 1",
|
|
12
|
-
"Option 2"
|
|
13
|
-
],
|
|
14
|
-
{ message: "This field is required." }
|
|
15
|
-
)
|
|
8
|
+
const MULTISELECT_VALIDATOR = `z.array(
|
|
9
|
+
z.enum(
|
|
10
|
+
[
|
|
11
|
+
"Option 1",
|
|
12
|
+
"Option 2"
|
|
13
|
+
],
|
|
14
|
+
{ message: "This field is required." }
|
|
15
|
+
)
|
|
16
16
|
).describe("multiselect")`;
|
|
17
17
|
const DATE_VALIDATOR = 'z.coerce.date()';
|
|
18
18
|
const TIME_VALIDATOR = 'z.string().describe("time")';
|
|
@@ -1,134 +1,136 @@
|
|
|
1
|
-
import { ZodType } from 'zod';
|
|
2
|
-
import { ClientBlock, ClientField, ClientPhantomField } from './fields.client.js';
|
|
3
|
-
import { ServerField } from './fields.server.js';
|
|
4
|
-
import { FontName } from './constants/fonts.js';
|
|
5
|
-
import type { ValidatorIRv0 } from './validator-ir.js';
|
|
6
|
-
export type FormValues = Record<string, string>;
|
|
7
|
-
export type FormErrors = Record<string, string>;
|
|
8
|
-
export declare const SCHEMA_VERSION = 1;
|
|
9
|
-
export declare const FIELD_TYPES: string[];
|
|
10
|
-
export declare const BLOCK_TYPES: string[];
|
|
11
|
-
export declare const ALIGN_H: string[];
|
|
12
|
-
export declare const ALIGN_V: string[];
|
|
13
|
-
export declare const SOURCES: string[];
|
|
14
|
-
export type { ValidatorIRv0, ValidatorBaseType } from './validator-ir.js';
|
|
15
|
-
export interface IFormMetadata {
|
|
16
|
-
name: string;
|
|
17
|
-
label: string;
|
|
18
|
-
schema_version: number;
|
|
19
|
-
schema: IForm;
|
|
20
|
-
signing_parties: IFormSigningParty[];
|
|
21
|
-
subscribers?: IFormSubscriber[];
|
|
22
|
-
}
|
|
23
|
-
export type IFormSubscriber = {
|
|
24
|
-
email: string;
|
|
25
|
-
};
|
|
26
|
-
export interface IFormSignatory {
|
|
27
|
-
name?: string;
|
|
28
|
-
email: string;
|
|
29
|
-
title?: string;
|
|
30
|
-
honorific?: string;
|
|
31
|
-
}
|
|
32
|
-
export interface IFormSigningParty {
|
|
33
|
-
_id: string;
|
|
34
|
-
order: number;
|
|
35
|
-
signatory_title: string;
|
|
36
|
-
signatory_account?: IFormSignatory;
|
|
37
|
-
signatory_source?: {
|
|
38
|
-
_id: string;
|
|
39
|
-
label: string;
|
|
40
|
-
tooltip_label: string;
|
|
41
|
-
};
|
|
42
|
-
signed?: boolean;
|
|
43
|
-
}
|
|
44
|
-
export interface IFormSignee {
|
|
45
|
-
name: string;
|
|
46
|
-
sourceEmail: string;
|
|
47
|
-
title?: string;
|
|
48
|
-
honorific?: string;
|
|
49
|
-
signedDate?: number;
|
|
50
|
-
}
|
|
51
|
-
export interface IForm {
|
|
52
|
-
blocks: IFormBlock[];
|
|
53
|
-
}
|
|
54
|
-
export interface IFormBlock {
|
|
55
|
-
_id: string;
|
|
56
|
-
block_type: (typeof BLOCK_TYPES)[number];
|
|
57
|
-
order: number;
|
|
58
|
-
signing_party_id: IFormSigningParty['_id'];
|
|
59
|
-
text_content?: string;
|
|
60
|
-
field_schema?: IFormField;
|
|
61
|
-
phantom_field_schema?: IFormPhantomField;
|
|
62
|
-
}
|
|
63
|
-
export interface IFormField {
|
|
64
|
-
field: string;
|
|
65
|
-
type: 'text' | 'signature' | 'image';
|
|
66
|
-
x: number;
|
|
67
|
-
y: number;
|
|
68
|
-
w: number;
|
|
69
|
-
h: number;
|
|
70
|
-
page: number;
|
|
71
|
-
align_h?: (typeof ALIGN_H)[number];
|
|
72
|
-
align_v?: (typeof ALIGN_V)[number];
|
|
73
|
-
label: string;
|
|
74
|
-
tooltip_label: string;
|
|
75
|
-
shared: boolean;
|
|
76
|
-
source: (typeof SOURCES)[number];
|
|
77
|
-
prefiller?: string;
|
|
78
|
-
validator?: string;
|
|
79
|
-
validator_ir?: ValidatorIRv0 | null;
|
|
80
|
-
size?: number;
|
|
81
|
-
wrap?: boolean;
|
|
82
|
-
font?: FontName;
|
|
83
|
-
}
|
|
84
|
-
export interface IFormPhantomField {
|
|
85
|
-
field: string;
|
|
86
|
-
type: 'text' | 'signature' | 'image';
|
|
87
|
-
label: string;
|
|
88
|
-
tooltip_label: string;
|
|
89
|
-
shared: boolean;
|
|
90
|
-
source: (typeof SOURCES)[number];
|
|
91
|
-
prefiller?: string;
|
|
92
|
-
validator?: string;
|
|
93
|
-
validator_ir?: ValidatorIRv0 | null;
|
|
94
|
-
}
|
|
95
|
-
export interface IFormParameters {
|
|
96
|
-
[key: string]: string | ZodType;
|
|
97
|
-
}
|
|
98
|
-
export type IFormSourceDomains<SourceDomains extends any[]> = Record<string, SourceDomains[number]>;
|
|
99
|
-
export type IFormFieldValidator = ZodType;
|
|
100
|
-
export type IFormFieldPrefiller<SourceDomains extends any[]> = (sourceDomains: IFormSourceDomains<SourceDomains>) => string;
|
|
101
|
-
export declare class FormMetadata<SourceDomains extends any[]> {
|
|
102
|
-
private readonly formMetadata;
|
|
103
|
-
private readonly blocks;
|
|
104
|
-
constructor(formMetadata: IFormMetadata);
|
|
105
|
-
getBlocksForClientService(signingPartyId?: string): ClientBlock<SourceDomains>[];
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
private
|
|
112
|
-
private
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
private
|
|
129
|
-
private
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
1
|
+
import { ZodType } from 'zod';
|
|
2
|
+
import { ClientBlock, ClientField, ClientPhantomField } from './fields.client.js';
|
|
3
|
+
import { ServerField } from './fields.server.js';
|
|
4
|
+
import { FontName } from './constants/fonts.js';
|
|
5
|
+
import type { ValidatorIRv0 } from './validator-ir.js';
|
|
6
|
+
export type FormValues = Record<string, string>;
|
|
7
|
+
export type FormErrors = Record<string, string>;
|
|
8
|
+
export declare const SCHEMA_VERSION = 1;
|
|
9
|
+
export declare const FIELD_TYPES: string[];
|
|
10
|
+
export declare const BLOCK_TYPES: string[];
|
|
11
|
+
export declare const ALIGN_H: string[];
|
|
12
|
+
export declare const ALIGN_V: string[];
|
|
13
|
+
export declare const SOURCES: string[];
|
|
14
|
+
export type { ValidatorIRv0, ValidatorBaseType } from './validator-ir.js';
|
|
15
|
+
export interface IFormMetadata {
|
|
16
|
+
name: string;
|
|
17
|
+
label: string;
|
|
18
|
+
schema_version: number;
|
|
19
|
+
schema: IForm;
|
|
20
|
+
signing_parties: IFormSigningParty[];
|
|
21
|
+
subscribers?: IFormSubscriber[];
|
|
22
|
+
}
|
|
23
|
+
export type IFormSubscriber = {
|
|
24
|
+
email: string;
|
|
25
|
+
};
|
|
26
|
+
export interface IFormSignatory {
|
|
27
|
+
name?: string;
|
|
28
|
+
email: string;
|
|
29
|
+
title?: string;
|
|
30
|
+
honorific?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface IFormSigningParty {
|
|
33
|
+
_id: string;
|
|
34
|
+
order: number;
|
|
35
|
+
signatory_title: string;
|
|
36
|
+
signatory_account?: IFormSignatory;
|
|
37
|
+
signatory_source?: {
|
|
38
|
+
_id: string;
|
|
39
|
+
label: string;
|
|
40
|
+
tooltip_label: string;
|
|
41
|
+
};
|
|
42
|
+
signed?: boolean;
|
|
43
|
+
}
|
|
44
|
+
export interface IFormSignee {
|
|
45
|
+
name: string;
|
|
46
|
+
sourceEmail: string;
|
|
47
|
+
title?: string;
|
|
48
|
+
honorific?: string;
|
|
49
|
+
signedDate?: number;
|
|
50
|
+
}
|
|
51
|
+
export interface IForm {
|
|
52
|
+
blocks: IFormBlock[];
|
|
53
|
+
}
|
|
54
|
+
export interface IFormBlock {
|
|
55
|
+
_id: string;
|
|
56
|
+
block_type: (typeof BLOCK_TYPES)[number];
|
|
57
|
+
order: number;
|
|
58
|
+
signing_party_id: IFormSigningParty['_id'];
|
|
59
|
+
text_content?: string;
|
|
60
|
+
field_schema?: IFormField;
|
|
61
|
+
phantom_field_schema?: IFormPhantomField;
|
|
62
|
+
}
|
|
63
|
+
export interface IFormField {
|
|
64
|
+
field: string;
|
|
65
|
+
type: 'text' | 'signature' | 'image';
|
|
66
|
+
x: number;
|
|
67
|
+
y: number;
|
|
68
|
+
w: number;
|
|
69
|
+
h: number;
|
|
70
|
+
page: number;
|
|
71
|
+
align_h?: (typeof ALIGN_H)[number];
|
|
72
|
+
align_v?: (typeof ALIGN_V)[number];
|
|
73
|
+
label: string;
|
|
74
|
+
tooltip_label: string;
|
|
75
|
+
shared: boolean;
|
|
76
|
+
source: (typeof SOURCES)[number];
|
|
77
|
+
prefiller?: string;
|
|
78
|
+
validator?: string;
|
|
79
|
+
validator_ir?: ValidatorIRv0 | null;
|
|
80
|
+
size?: number;
|
|
81
|
+
wrap?: boolean;
|
|
82
|
+
font?: FontName;
|
|
83
|
+
}
|
|
84
|
+
export interface IFormPhantomField {
|
|
85
|
+
field: string;
|
|
86
|
+
type: 'text' | 'signature' | 'image';
|
|
87
|
+
label: string;
|
|
88
|
+
tooltip_label: string;
|
|
89
|
+
shared: boolean;
|
|
90
|
+
source: (typeof SOURCES)[number];
|
|
91
|
+
prefiller?: string;
|
|
92
|
+
validator?: string;
|
|
93
|
+
validator_ir?: ValidatorIRv0 | null;
|
|
94
|
+
}
|
|
95
|
+
export interface IFormParameters {
|
|
96
|
+
[key: string]: string | ZodType;
|
|
97
|
+
}
|
|
98
|
+
export type IFormSourceDomains<SourceDomains extends any[]> = Record<string, SourceDomains[number]>;
|
|
99
|
+
export type IFormFieldValidator = ZodType;
|
|
100
|
+
export type IFormFieldPrefiller<SourceDomains extends any[]> = (sourceDomains: IFormSourceDomains<SourceDomains>) => string;
|
|
101
|
+
export declare class FormMetadata<SourceDomains extends any[]> {
|
|
102
|
+
private readonly formMetadata;
|
|
103
|
+
private readonly blocks;
|
|
104
|
+
constructor(formMetadata: IFormMetadata);
|
|
105
|
+
getBlocksForClientService(signingPartyId?: string): ClientBlock<SourceDomains>[];
|
|
106
|
+
getSigningPartyFieldName(signingPartyId: string): string;
|
|
107
|
+
getSigningPartyTitleFromFieldName(signingPartyFieldName: string): string | undefined;
|
|
108
|
+
getSigningPartyBlocks(sourceSigningPartyId: string): ClientBlock<SourceDomains>[];
|
|
109
|
+
getSigningPartyFields(signingPartyId: string): (ClientField<SourceDomains> | ClientPhantomField<SourceDomains>)[];
|
|
110
|
+
static getSigningPartyValues(signingParties: IFormSigningParty[], values: FormValues): Record<string, IFormSignatory>;
|
|
111
|
+
private getFields;
|
|
112
|
+
private getField;
|
|
113
|
+
private getPhantomFields;
|
|
114
|
+
private getPhantomField;
|
|
115
|
+
encodeAsJSON(): string;
|
|
116
|
+
static decodeFromJSON<SourceDomains extends any[]>(json: string): FormMetadata<SourceDomains>;
|
|
117
|
+
getLabel(): string;
|
|
118
|
+
private getFieldForClientService;
|
|
119
|
+
getFieldsForClientService(signingPartyId?: string, sourceDomains?: IFormSourceDomains<SourceDomains>, derivationBase?: IFormParameters): (ClientField<SourceDomains> | ClientPhantomField<SourceDomains>)[];
|
|
120
|
+
getSignatureFieldsForClientService(signingPartyId: string): (ClientField<SourceDomains> | ClientPhantomField<SourceDomains>)[];
|
|
121
|
+
getSignatureValueForSigningParty(values: FormValues, signingPartyId: string): string;
|
|
122
|
+
setSignatureValueForSigningParty(values: FormValues, signatureString: string, signingPartyId: string): FormValues;
|
|
123
|
+
getFieldsForEditorService(): IFormField[];
|
|
124
|
+
getPhantomFieldsForEditorService(): IFormPhantomField[];
|
|
125
|
+
getBlocksForEditorService(): IFormBlock[];
|
|
126
|
+
getFieldsForSigningService(): ServerField[];
|
|
127
|
+
inferParams(): string[];
|
|
128
|
+
private parseValidator;
|
|
129
|
+
private parsePrefiller;
|
|
130
|
+
private enumerateParams;
|
|
131
|
+
private populateParams;
|
|
132
|
+
getSchemaVersion(): number;
|
|
133
|
+
getSubscribers(): IFormSubscriber[];
|
|
134
|
+
getSigningParties(): IFormSigningParty[];
|
|
135
|
+
mayInvolveEsign(): boolean;
|
|
136
|
+
}
|