@betterinternship/core 2.3.7 → 2.4.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.
- package/dist/lib/broker/tasks/index.d.ts +1 -1
- package/dist/lib/chat/chat.d.ts +51 -51
- package/dist/lib/email/email.d.ts +7 -3
- package/dist/lib/email/email.js +67 -42
- package/dist/lib/email/email.js.map +1 -1
- package/dist/lib/email/index.js +1 -1
- package/dist/lib/forms/fields.client.d.ts +30 -30
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
package/dist/lib/chat/chat.d.ts
CHANGED
|
@@ -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,7 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import { SESClient } from '@aws-sdk/client-ses';
|
|
2
|
+
export declare const sesClient: SESClient;
|
|
3
|
+
interface IEmailParams {
|
|
2
4
|
sender?: string;
|
|
3
5
|
subject: string;
|
|
4
6
|
recipient: string;
|
|
5
7
|
content: string;
|
|
6
|
-
alias?:
|
|
7
|
-
}
|
|
8
|
+
alias?: 'otp' | 'applications' | 'sign' | 'hello';
|
|
9
|
+
}
|
|
10
|
+
export declare const sendSingleEmail: (params: IEmailParams) => Promise<unknown>;
|
|
11
|
+
export {};
|
package/dist/lib/email/email.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SendEmailCommand, } from '@aws-sdk/client-ses';
|
|
2
|
+
import { SESClient } from '@aws-sdk/client-ses';
|
|
2
3
|
import * as nodemailer from 'nodemailer';
|
|
3
4
|
import { v4 } from 'uuid';
|
|
4
5
|
import { ENV } from '../env.js';
|
|
@@ -6,14 +7,15 @@ const SMTP_EMAIL = ENV.SMTP_EMAIL;
|
|
|
6
7
|
const SMTP_PASSWORD = ENV.SMTP_PASSWORD;
|
|
7
8
|
if (!SMTP_EMAIL || !SMTP_PASSWORD)
|
|
8
9
|
throw Error('[ERROR:ENV]: Missing SMTP setup.');
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
+
});
|
|
17
19
|
const transporter = nodemailer.createTransport({
|
|
18
20
|
service: 'Gmail',
|
|
19
21
|
host: 'smtp.gmail.com',
|
|
@@ -25,44 +27,67 @@ const transporter = nodemailer.createTransport({
|
|
|
25
27
|
},
|
|
26
28
|
messageId: `${v4()}${SMTP_EMAIL}`,
|
|
27
29
|
});
|
|
28
|
-
|
|
29
|
-
if (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
from: `"${sender ?? 'BetterInternship'}" <${alias}@betterinternship.com>`,
|
|
33
|
-
to: recipient,
|
|
34
|
-
subject,
|
|
35
|
-
html: content,
|
|
36
|
-
}, (error, info) => {
|
|
37
|
-
if (error) {
|
|
38
|
-
console.error('[ERROR] Could not send email.');
|
|
39
|
-
console.error('[-----] ' + error.message);
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
resolve({
|
|
43
|
-
messageId: info.messageId,
|
|
44
|
-
response: info.response,
|
|
45
|
-
});
|
|
46
|
-
console.warn('[EMAIL] Email sent to ' + recipient);
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
30
|
+
const onEmailError = (recipient, resolve) => (error, info) => {
|
|
31
|
+
if (error) {
|
|
32
|
+
console.error('[ERROR:EMAIL] Could not send email.');
|
|
33
|
+
console.error('[-----] ' + error.message);
|
|
50
34
|
}
|
|
51
35
|
else {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
name: sender ?? 'BetterInternship',
|
|
56
|
-
},
|
|
57
|
-
to: [{ email: recipient }],
|
|
58
|
-
subject,
|
|
59
|
-
htmlContent: content,
|
|
36
|
+
resolve({
|
|
37
|
+
messageId: info.messageId,
|
|
38
|
+
response: info.response,
|
|
60
39
|
});
|
|
61
|
-
console.warn('[
|
|
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);
|
|
62
69
|
return {
|
|
63
|
-
messageId:
|
|
64
|
-
response:
|
|
70
|
+
messageId: result.MessageId,
|
|
71
|
+
response: 'Successfully sent via Amazon SES.',
|
|
65
72
|
};
|
|
66
73
|
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
console.error('[ERROR:AWSSES] Could not send email.');
|
|
76
|
+
console.error('[-----] ' + error);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
export const sendSingleEmail = async (params) => {
|
|
80
|
+
if (AWS_DISABLED) {
|
|
81
|
+
return await traditionalEmailRoute(params);
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
const dice = Math.random();
|
|
85
|
+
if (dice < 0.5) {
|
|
86
|
+
return await traditionalEmailRoute(params);
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
return await amazonEmailRoute(params);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
67
92
|
};
|
|
68
93
|
//# sourceMappingURL=email.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email.js","sourceRoot":"","sources":["../../../lib/email/email.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"email.js","sourceRoot":"","sources":["../../../lib/email/email.ts"],"names":[],"mappings":"AASA,OAAO,EAEL,gBAAgB,GAEjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,UAAU,MAA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CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7C,OAAO;YACL,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,QAAQ,EAAE,mCAAmC;SAC9C,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;QACtD,OAAO,CAAC,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,CAAC;IACpC,CAAC;AACH,CAAC,CAAC;AASF,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,EAAE,MAAoB,EAAE,EAAE;IAC5D,IAAI,YAAY,EAAE,CAAC;QACjB,OAAO,MAAM,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAC7C,CAAC;SAAM,CAAC;QAGN,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QAI3B,IAAI,IAAI,GAAG,GAAG,EAAE,CAAC;YACf,OAAO,MAAM,qBAAqB,CAAC,MAAM,CAAC,CAAC;QAC7C,CAAC;aAAM,CAAC;YACN,OAAO,MAAM,gBAAgB,CAAC,MAAM,CAAC,CAAC;QACxC,CAAC;IACH,CAAC;AACH,CAAC,CAAC"}
|
package/dist/lib/email/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './email.js';
|
|
1
|
+
export * from './email.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { ZodType } from 'zod';
|
|
2
|
-
import { BLOCK_TYPES, IFormField, IFormFieldPrefiller, IFormFieldValidator, IFormPhantomField, IFormSigningParty } from './form-metadata.js';
|
|
3
|
-
type EnumValue = string | number;
|
|
4
|
-
export declare const getSchemaClientType: (s: ZodType) => ClientFieldType;
|
|
5
|
-
export type ClientFieldType = 'text' | 'number' | 'date' | 'dropdown' | 'checkbox' | 'textarea' | 'multiselect' | 'time' | 'signature';
|
|
6
|
-
export type ClientField<SourceDomains extends any[]> = Omit<IFormField, 'x' | 'y' | 'w' | 'h' | 'page' | 'type' | 'validator' | 'prefiller' | 'align_h' | 'align_v'> & {
|
|
7
|
-
type: ClientFieldType;
|
|
8
|
-
signing_party_id?: string;
|
|
9
|
-
validator: IFormFieldValidator | null;
|
|
10
|
-
prefiller: IFormFieldPrefiller<SourceDomains> | null;
|
|
11
|
-
options?: EnumValue[];
|
|
12
|
-
coerce: (s: string) => string | number | boolean | Date | Array<string>;
|
|
13
|
-
};
|
|
14
|
-
export type ClientPhantomField<SourceDomains extends any[]> = Omit<IFormPhantomField, 'type' | 'validator' | 'prefiller'> & {
|
|
15
|
-
type: ClientFieldType;
|
|
16
|
-
signing_party_id?: string;
|
|
17
|
-
validator: IFormFieldValidator | null;
|
|
18
|
-
prefiller: IFormFieldPrefiller<SourceDomains> | null;
|
|
19
|
-
options?: EnumValue[];
|
|
20
|
-
coerce: (s: string) => string | number | boolean | Date | Array<string>;
|
|
21
|
-
};
|
|
22
|
-
export interface ClientBlock<SourceDomains extends any[]> {
|
|
23
|
-
block_type: (typeof BLOCK_TYPES)[number];
|
|
24
|
-
order: number;
|
|
25
|
-
signing_party_id: IFormSigningParty['_id'];
|
|
26
|
-
text_content?: string;
|
|
27
|
-
field_schema?: ClientField<SourceDomains>;
|
|
28
|
-
phantom_field_schema?: ClientPhantomField<SourceDomains>;
|
|
29
|
-
}
|
|
30
|
-
export {};
|
|
1
|
+
import { ZodType } from 'zod';
|
|
2
|
+
import { BLOCK_TYPES, IFormField, IFormFieldPrefiller, IFormFieldValidator, IFormPhantomField, IFormSigningParty } from './form-metadata.js';
|
|
3
|
+
type EnumValue = string | number;
|
|
4
|
+
export declare const getSchemaClientType: (s: ZodType) => ClientFieldType;
|
|
5
|
+
export type ClientFieldType = 'text' | 'number' | 'date' | 'dropdown' | 'checkbox' | 'textarea' | 'multiselect' | 'time' | 'signature';
|
|
6
|
+
export type ClientField<SourceDomains extends any[]> = Omit<IFormField, 'x' | 'y' | 'w' | 'h' | 'page' | 'type' | 'validator' | 'prefiller' | 'align_h' | 'align_v'> & {
|
|
7
|
+
type: ClientFieldType;
|
|
8
|
+
signing_party_id?: string;
|
|
9
|
+
validator: IFormFieldValidator | null;
|
|
10
|
+
prefiller: IFormFieldPrefiller<SourceDomains> | null;
|
|
11
|
+
options?: EnumValue[];
|
|
12
|
+
coerce: (s: string) => string | number | boolean | Date | Array<string>;
|
|
13
|
+
};
|
|
14
|
+
export type ClientPhantomField<SourceDomains extends any[]> = Omit<IFormPhantomField, 'type' | 'validator' | 'prefiller'> & {
|
|
15
|
+
type: ClientFieldType;
|
|
16
|
+
signing_party_id?: string;
|
|
17
|
+
validator: IFormFieldValidator | null;
|
|
18
|
+
prefiller: IFormFieldPrefiller<SourceDomains> | null;
|
|
19
|
+
options?: EnumValue[];
|
|
20
|
+
coerce: (s: string) => string | number | boolean | Date | Array<string>;
|
|
21
|
+
};
|
|
22
|
+
export interface ClientBlock<SourceDomains extends any[]> {
|
|
23
|
+
block_type: (typeof BLOCK_TYPES)[number];
|
|
24
|
+
order: number;
|
|
25
|
+
signing_party_id: IFormSigningParty['_id'];
|
|
26
|
+
text_content?: string;
|
|
27
|
+
field_schema?: ClientField<SourceDomains>;
|
|
28
|
+
phantom_field_schema?: ClientPhantomField<SourceDomains>;
|
|
29
|
+
}
|
|
30
|
+
export {};
|