@betterinternship/core 1.2.23 → 1.2.25

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,51 +1,51 @@
1
- import { RecordModel } from "pocketbase";
2
- export interface Message {
3
- message: string;
4
- sender_id: string;
5
- timestamp: number;
6
- digested?: boolean;
7
- }
8
- export interface Consumer extends RecordModel {
9
- email: string;
10
- last_reads: {
11
- [conversationId: string]: Message;
12
- };
13
- last_unreads: {
14
- [conversationId: string]: Message;
15
- };
16
- conversations: string[];
17
- }
18
- export interface Conversation extends RecordModel {
19
- id: string;
20
- subscribers: string[];
21
- contents: Message[];
22
- last_message: Message;
23
- }
24
- export declare class ConsumerService {
25
- findOne(id: string): Promise<Consumer>;
26
- findAll(): Promise<Consumer[]>;
27
- register(id: string, email: string): Promise<Consumer>;
28
- setLastRead(id: string, conversationId: string, message: Message): Promise<RecordModel>;
29
- authenticateAs(id: string): Promise<{
30
- token: string;
31
- user: import("pocketbase").AuthRecord;
32
- }>;
33
- }
34
- export declare class MessageService {
35
- private readonly consumerService;
36
- private readonly conversationService;
37
- private updateConversationUnread;
38
- send(senderId: string, conversationId: string, messageContent: string): Promise<Message>;
39
- read(consumerId: string, conversationId: string): Promise<Message>;
40
- digest(consumerId: string, conversationId: string): Promise<Message>;
41
- }
42
- export declare class ConversationService {
43
- consumerService: ConsumerService;
44
- findOne(id: string): Promise<Conversation>;
45
- appendMessage(conversationId: string, message: Message): Promise<Conversation>;
46
- subscribe(subscriberId: string, conversationId: string): Promise<Conversation>;
47
- getSubscriptions(subscriberId: any): Promise<Conversation[]>;
48
- findExisting(userId: string, employerId: string): Promise<Conversation>;
49
- checkIfSubscribed(subscriberId: string, conversationId: string): Promise<boolean>;
50
- create(userId: string, employerId: string): Promise<Conversation>;
51
- }
1
+ import { RecordModel } from "pocketbase";
2
+ export interface Message {
3
+ message: string;
4
+ sender_id: string;
5
+ timestamp: number;
6
+ digested?: boolean;
7
+ }
8
+ export interface Consumer extends RecordModel {
9
+ email: string;
10
+ last_reads: {
11
+ [conversationId: string]: Message;
12
+ };
13
+ last_unreads: {
14
+ [conversationId: string]: Message;
15
+ };
16
+ conversations: string[];
17
+ }
18
+ export interface Conversation extends RecordModel {
19
+ id: string;
20
+ subscribers: string[];
21
+ contents: Message[];
22
+ last_message: Message;
23
+ }
24
+ export declare class ConsumerService {
25
+ findOne(id: string): Promise<Consumer>;
26
+ findAll(): Promise<Consumer[]>;
27
+ register(id: string, email: string): Promise<Consumer>;
28
+ setLastRead(id: string, conversationId: string, message: Message): Promise<RecordModel>;
29
+ authenticateAs(id: string): Promise<{
30
+ token: string;
31
+ user: import("pocketbase").AuthRecord;
32
+ }>;
33
+ }
34
+ export declare class MessageService {
35
+ private readonly consumerService;
36
+ private readonly conversationService;
37
+ private updateConversationUnread;
38
+ send(senderId: string, conversationId: string, messageContent: string): Promise<Message>;
39
+ read(consumerId: string, conversationId: string): Promise<Message>;
40
+ digest(consumerId: string, conversationId: string): Promise<Message>;
41
+ }
42
+ export declare class ConversationService {
43
+ consumerService: ConsumerService;
44
+ findOne(id: string): Promise<Conversation>;
45
+ appendMessage(conversationId: string, message: Message): Promise<Conversation>;
46
+ subscribe(subscriberId: string, conversationId: string): Promise<Conversation>;
47
+ getSubscriptions(subscriberId: any): Promise<Conversation[]>;
48
+ findExisting(userId: string, employerId: string): Promise<Conversation>;
49
+ checkIfSubscribed(subscriberId: string, conversationId: string): Promise<boolean>;
50
+ create(userId: string, employerId: string): Promise<Conversation>;
51
+ }
@@ -1,190 +1,190 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ConversationService = exports.MessageService = exports.ConsumerService = void 0;
4
- const uuid_1 = require("uuid");
5
- const pb_1 = require("./pb");
6
- const generator = require("generate-password");
7
- class ConsumerService {
8
- async findOne(id) {
9
- return await pb_1.pb.collection("users").getOne(id);
10
- }
11
- async findAll() {
12
- return await pb_1.pb.collection("users").getFullList();
13
- }
14
- async register(id, email) {
15
- try {
16
- return await pb_1.pb.collection("users").getOne(id);
17
- }
18
- catch (error) {
19
- const e = error;
20
- if (e.status !== 404)
21
- throw error;
22
- }
23
- const password = generator.generate({
24
- length: 10,
25
- numbers: true,
26
- symbols: true,
27
- uppercase: true,
28
- lowercase: true,
29
- strict: true,
30
- });
31
- return await pb_1.pb.collection("users").create({
32
- id,
33
- email,
34
- password,
35
- passwordConfirm: password,
36
- last_reads: {},
37
- last_unreads: {},
38
- conversations: [],
39
- });
40
- }
41
- async setLastRead(id, conversationId, message) {
42
- const subscriber = (await pb_1.pb.collection("users").getOne(id));
43
- const last_reads = subscriber.last_reads;
44
- const last_unreads = subscriber.last_unreads;
45
- return await pb_1.pb.collection("users").update(id, {
46
- last_reads: {
47
- ...last_reads,
48
- [conversationId]: last_reads?.[conversationId]?.timestamp < message.timestamp
49
- ? message
50
- : last_reads?.[conversationId],
51
- },
52
- last_unreads: {
53
- ...last_unreads,
54
- [conversationId]: last_unreads?.[conversationId]?.timestamp < message.timestamp
55
- ? message
56
- : last_unreads?.[conversationId],
57
- },
58
- });
59
- }
60
- async authenticateAs(id) {
61
- const asUser = await pb_1.pb.collection("users").impersonate(id, 60 * 60 * 24);
62
- const token = asUser.authStore.token;
63
- const record = asUser.authStore.record;
64
- return { token, user: record };
65
- }
66
- }
67
- exports.ConsumerService = ConsumerService;
68
- class MessageService {
69
- consumerService = new ConsumerService();
70
- conversationService = new ConversationService();
71
- async updateConversationUnread(subscriberId, conversationId, message) {
72
- let subscriber;
73
- try {
74
- subscriber = await this.consumerService.findOne(subscriberId);
75
- }
76
- catch (error) {
77
- const e = error;
78
- if (e.status !== 404)
79
- throw error;
80
- subscriber = await this.consumerService.register(subscriberId, "");
81
- }
82
- await pb_1.pb.collection("users").update(subscriberId, {
83
- last_unreads: {
84
- ...subscriber.last_unreads,
85
- [conversationId]: subscriber.last_unreads?.[conversationId]?.timestamp <
86
- message.timestamp
87
- ? message
88
- : subscriber.last_unreads?.[conversationId],
89
- },
90
- });
91
- }
92
- async send(senderId, conversationId, messageContent) {
93
- const message = {
94
- sender_id: senderId,
95
- message: messageContent,
96
- timestamp: new Date().getTime(),
97
- };
98
- const conversation = await this.conversationService.appendMessage(conversationId, message);
99
- await this.consumerService.setLastRead(senderId, conversationId, message);
100
- await Promise.all(conversation.subscribers.map((subscriberId) => this.updateConversationUnread(subscriberId, conversationId, message)));
101
- return message;
102
- }
103
- async read(consumerId, conversationId) {
104
- const consumer = await pb_1.pb.collection("users").getOne(consumerId);
105
- const conversation = await pb_1.pb
106
- .collection("conversations")
107
- .getOne(conversationId);
108
- await pb_1.pb.collection("users").update(consumerId, {
109
- last_reads: {
110
- ...consumer.last_reads,
111
- [conversationId]: conversation.last_message,
112
- },
113
- last_unreads: {
114
- ...consumer.last_unreads,
115
- [conversationId]: conversation.last_message,
116
- },
117
- });
118
- return conversation.last_message;
119
- }
120
- async digest(consumerId, conversationId) {
121
- const consumer = await pb_1.pb.collection("users").getOne(consumerId);
122
- const conversation = await pb_1.pb
123
- .collection("conversations")
124
- .getOne(conversationId);
125
- await pb_1.pb.collection("users").update(consumerId, {
126
- last_unreads: {
127
- ...consumer.last_unreads,
128
- [conversationId]: {
129
- ...conversation.last_message,
130
- digested: true,
131
- },
132
- },
133
- });
134
- return { ...conversation.last_message, digested: true };
135
- }
136
- }
137
- exports.MessageService = MessageService;
138
- class ConversationService {
139
- consumerService = new ConsumerService();
140
- async findOne(id) {
141
- return await pb_1.pb.collection("conversations").getOne(id);
142
- }
143
- async appendMessage(conversationId, message) {
144
- const conversation = await this.findOne(conversationId);
145
- return await pb_1.pb.collection("conversations").update(conversationId, {
146
- contents: [...conversation.contents, message],
147
- last_message: message,
148
- });
149
- }
150
- async subscribe(subscriberId, conversationId) {
151
- const conversation = await this.findOne(conversationId);
152
- const subscriber = await this.consumerService.findOne(subscriberId);
153
- await pb_1.pb.collection("users").update(subscriberId, {
154
- conversations: [...subscriber.conversations, conversationId],
155
- });
156
- return await pb_1.pb.collection("conversations").update(conversationId, {
157
- subscribers: [...conversation.subscribers, subscriberId],
158
- });
159
- }
160
- async getSubscriptions(subscriberId) {
161
- return await pb_1.pb.collection("conversations").getFullList({
162
- filter: `subscribers ~ '${subscriberId}'`,
163
- });
164
- }
165
- async findExisting(userId, employerId) {
166
- return await pb_1.pb
167
- .collection("conversations")
168
- .getFirstListItem(`subscribers ~ '${userId}' && subscribers ~ '${employerId}'`);
169
- }
170
- async checkIfSubscribed(subscriberId, conversationId) {
171
- const conversation = await this.findOne(conversationId);
172
- if (!conversation)
173
- return false;
174
- if (!conversation.subscribers.includes(subscriberId))
175
- return false;
176
- return true;
177
- }
178
- async create(userId, employerId) {
179
- const conversationId = (0, uuid_1.v4)();
180
- const newConversation = await pb_1.pb.collection("conversations").create({
181
- id: conversationId,
182
- subscribers: [userId, employerId],
183
- contents: [],
184
- last_message: {},
185
- });
186
- return newConversation;
187
- }
188
- }
189
- exports.ConversationService = ConversationService;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConversationService = exports.MessageService = exports.ConsumerService = void 0;
4
+ const uuid_1 = require("uuid");
5
+ const pb_1 = require("./pb");
6
+ const generator = require("generate-password");
7
+ class ConsumerService {
8
+ async findOne(id) {
9
+ return await pb_1.pb.collection("users").getOne(id);
10
+ }
11
+ async findAll() {
12
+ return await pb_1.pb.collection("users").getFullList();
13
+ }
14
+ async register(id, email) {
15
+ try {
16
+ return await pb_1.pb.collection("users").getOne(id);
17
+ }
18
+ catch (error) {
19
+ const e = error;
20
+ if (e.status !== 404)
21
+ throw error;
22
+ }
23
+ const password = generator.generate({
24
+ length: 10,
25
+ numbers: true,
26
+ symbols: true,
27
+ uppercase: true,
28
+ lowercase: true,
29
+ strict: true,
30
+ });
31
+ return await pb_1.pb.collection("users").create({
32
+ id,
33
+ email,
34
+ password,
35
+ passwordConfirm: password,
36
+ last_reads: {},
37
+ last_unreads: {},
38
+ conversations: [],
39
+ });
40
+ }
41
+ async setLastRead(id, conversationId, message) {
42
+ const subscriber = (await pb_1.pb.collection("users").getOne(id));
43
+ const last_reads = subscriber.last_reads;
44
+ const last_unreads = subscriber.last_unreads;
45
+ return await pb_1.pb.collection("users").update(id, {
46
+ last_reads: {
47
+ ...last_reads,
48
+ [conversationId]: last_reads?.[conversationId]?.timestamp < message.timestamp
49
+ ? message
50
+ : last_reads?.[conversationId],
51
+ },
52
+ last_unreads: {
53
+ ...last_unreads,
54
+ [conversationId]: last_unreads?.[conversationId]?.timestamp < message.timestamp
55
+ ? message
56
+ : last_unreads?.[conversationId],
57
+ },
58
+ });
59
+ }
60
+ async authenticateAs(id) {
61
+ const asUser = await pb_1.pb.collection("users").impersonate(id, 60 * 60 * 24);
62
+ const token = asUser.authStore.token;
63
+ const record = asUser.authStore.record;
64
+ return { token, user: record };
65
+ }
66
+ }
67
+ exports.ConsumerService = ConsumerService;
68
+ class MessageService {
69
+ consumerService = new ConsumerService();
70
+ conversationService = new ConversationService();
71
+ async updateConversationUnread(subscriberId, conversationId, message) {
72
+ let subscriber;
73
+ try {
74
+ subscriber = await this.consumerService.findOne(subscriberId);
75
+ }
76
+ catch (error) {
77
+ const e = error;
78
+ if (e.status !== 404)
79
+ throw error;
80
+ subscriber = await this.consumerService.register(subscriberId, "");
81
+ }
82
+ await pb_1.pb.collection("users").update(subscriberId, {
83
+ last_unreads: {
84
+ ...subscriber.last_unreads,
85
+ [conversationId]: subscriber.last_unreads?.[conversationId]?.timestamp <
86
+ message.timestamp
87
+ ? message
88
+ : subscriber.last_unreads?.[conversationId],
89
+ },
90
+ });
91
+ }
92
+ async send(senderId, conversationId, messageContent) {
93
+ const message = {
94
+ sender_id: senderId,
95
+ message: messageContent,
96
+ timestamp: new Date().getTime(),
97
+ };
98
+ const conversation = await this.conversationService.appendMessage(conversationId, message);
99
+ await this.consumerService.setLastRead(senderId, conversationId, message);
100
+ await Promise.all(conversation.subscribers.map((subscriberId) => this.updateConversationUnread(subscriberId, conversationId, message)));
101
+ return message;
102
+ }
103
+ async read(consumerId, conversationId) {
104
+ const consumer = await pb_1.pb.collection("users").getOne(consumerId);
105
+ const conversation = await pb_1.pb
106
+ .collection("conversations")
107
+ .getOne(conversationId);
108
+ await pb_1.pb.collection("users").update(consumerId, {
109
+ last_reads: {
110
+ ...consumer.last_reads,
111
+ [conversationId]: conversation.last_message,
112
+ },
113
+ last_unreads: {
114
+ ...consumer.last_unreads,
115
+ [conversationId]: conversation.last_message,
116
+ },
117
+ });
118
+ return conversation.last_message;
119
+ }
120
+ async digest(consumerId, conversationId) {
121
+ const consumer = await pb_1.pb.collection("users").getOne(consumerId);
122
+ const conversation = await pb_1.pb
123
+ .collection("conversations")
124
+ .getOne(conversationId);
125
+ await pb_1.pb.collection("users").update(consumerId, {
126
+ last_unreads: {
127
+ ...consumer.last_unreads,
128
+ [conversationId]: {
129
+ ...conversation.last_message,
130
+ digested: true,
131
+ },
132
+ },
133
+ });
134
+ return { ...conversation.last_message, digested: true };
135
+ }
136
+ }
137
+ exports.MessageService = MessageService;
138
+ class ConversationService {
139
+ consumerService = new ConsumerService();
140
+ async findOne(id) {
141
+ return await pb_1.pb.collection("conversations").getOne(id);
142
+ }
143
+ async appendMessage(conversationId, message) {
144
+ const conversation = await this.findOne(conversationId);
145
+ return await pb_1.pb.collection("conversations").update(conversationId, {
146
+ contents: [...conversation.contents, message],
147
+ last_message: message,
148
+ });
149
+ }
150
+ async subscribe(subscriberId, conversationId) {
151
+ const conversation = await this.findOne(conversationId);
152
+ const subscriber = await this.consumerService.findOne(subscriberId);
153
+ await pb_1.pb.collection("users").update(subscriberId, {
154
+ conversations: [...subscriber.conversations, conversationId],
155
+ });
156
+ return await pb_1.pb.collection("conversations").update(conversationId, {
157
+ subscribers: [...conversation.subscribers, subscriberId],
158
+ });
159
+ }
160
+ async getSubscriptions(subscriberId) {
161
+ return await pb_1.pb.collection("conversations").getFullList({
162
+ filter: `subscribers ~ '${subscriberId}'`,
163
+ });
164
+ }
165
+ async findExisting(userId, employerId) {
166
+ return await pb_1.pb
167
+ .collection("conversations")
168
+ .getFirstListItem(`subscribers ~ '${userId}' && subscribers ~ '${employerId}'`);
169
+ }
170
+ async checkIfSubscribed(subscriberId, conversationId) {
171
+ const conversation = await this.findOne(conversationId);
172
+ if (!conversation)
173
+ return false;
174
+ if (!conversation.subscribers.includes(subscriberId))
175
+ return false;
176
+ return true;
177
+ }
178
+ async create(userId, employerId) {
179
+ const conversationId = (0, uuid_1.v4)();
180
+ const newConversation = await pb_1.pb.collection("conversations").create({
181
+ id: conversationId,
182
+ subscribers: [userId, employerId],
183
+ contents: [],
184
+ last_message: {},
185
+ });
186
+ return newConversation;
187
+ }
188
+ }
189
+ exports.ConversationService = ConversationService;
190
190
  //# sourceMappingURL=chat.js.map
@@ -1,20 +1,20 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.authenticatePocketbase = exports.pb = void 0;
4
- const pocketbase_1 = require("pocketbase");
5
- const env_1 = require("../env");
6
- let _pb = {};
7
- if (!env_1.ENV.BICORE_IGNORE_POCKETBASE) {
8
- _pb = new pocketbase_1.default(env_1.ENV.PB_URL);
9
- _pb.autoCancellation(false);
10
- }
11
- exports.pb = _pb;
12
- const authenticatePocketbase = async () => {
13
- await _pb
14
- .collection("_superusers")
15
- .authWithPassword(env_1.ENV.PB_ADMIN_EMAIL, env_1.ENV.PB_ADMIN_PASSWORD, { autoRefreshThreshold: 30 * 60 });
16
- };
17
- exports.authenticatePocketbase = authenticatePocketbase;
18
- if (!env_1.ENV.BICORE_IGNORE_POCKETBASE)
19
- (0, exports.authenticatePocketbase)();
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.authenticatePocketbase = exports.pb = void 0;
4
+ const pocketbase_1 = require("pocketbase");
5
+ const env_1 = require("../env");
6
+ let _pb = {};
7
+ if (!env_1.ENV.BICORE_IGNORE_POCKETBASE) {
8
+ _pb = new pocketbase_1.default(env_1.ENV.PB_URL);
9
+ _pb.autoCancellation(false);
10
+ }
11
+ exports.pb = _pb;
12
+ const authenticatePocketbase = async () => {
13
+ await _pb
14
+ .collection("_superusers")
15
+ .authWithPassword(env_1.ENV.PB_ADMIN_EMAIL, env_1.ENV.PB_ADMIN_PASSWORD, { autoRefreshThreshold: 30 * 60 });
16
+ };
17
+ exports.authenticatePocketbase = authenticatePocketbase;
18
+ if (!env_1.ENV.BICORE_IGNORE_POCKETBASE)
19
+ (0, exports.authenticatePocketbase)();
20
20
  //# sourceMappingURL=pb.js.map
@@ -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 ?? 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
package/dist/lib/env.js CHANGED
@@ -1,7 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ENV = void 0;
4
- const dotenv = require("dotenv");
5
- dotenv.config();
6
- exports.ENV = process.env;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ENV = void 0;
4
+ const dotenv = require("dotenv");
5
+ dotenv.config();
6
+ exports.ENV = process.env;
7
7
  //# sourceMappingURL=env.js.map
@@ -1,5 +1,7 @@
1
+ import 'zod-metadata/register';
1
2
  import z, { ZodType } from 'zod';
2
3
  import { EnumValue } from 'zod/v4/core/util.cjs';
4
+ import { FieldClientType } from './zschema';
3
5
  export declare const SCHEMA_VERSION = 0;
4
6
  export interface IFormMetadata {
5
7
  name: string;
@@ -39,6 +41,7 @@ export declare class FormMetadata<SourceDomains extends any[]> {
39
41
  encodeAsJSON(): string;
40
42
  static decodeFromJSON<SourceDomains extends any[]>(json: string): FormMetadata<SourceDomains>;
41
43
  getFieldForClient(fieldname: string, params?: any): Omit<IFormField, 'x' | 'y' | 'w' | 'h' | 'page' | 'type' | 'validator' | 'prefiller'> & {
44
+ type: FieldClientType;
42
45
  validator: IFormFieldValidator | null;
43
46
  prefiller: IFormFieldPrefiller<SourceDomains> | null;
44
47
  options?: EnumValue[];