@betterinternship/core 2.3.0 → 2.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.js +5 -5
- package/dist/lib/broker/broker.d.ts +5 -1
- package/dist/lib/broker/broker.js +5 -5
- package/dist/lib/broker/broker.js.map +1 -1
- package/dist/lib/broker/tasks/base.task.d.ts +22 -0
- package/dist/lib/broker/tasks/base.task.js +34 -0
- package/dist/lib/broker/tasks/base.task.js.map +1 -0
- package/dist/lib/broker/tasks/email..task.d.ts +15 -0
- package/dist/lib/broker/tasks/email..task.js +4 -0
- package/dist/lib/broker/tasks/email..task.js.map +1 -0
- package/dist/lib/broker/tasks/index.d.ts +1 -0
- package/dist/lib/broker/tasks/index.js +2 -0
- package/dist/lib/broker/tasks/index.js.map +1 -0
- package/dist/lib/broker/tasks/sign.task.d.ts +35 -0
- package/dist/lib/broker/tasks/sign.task.js +4 -0
- package/dist/lib/broker/tasks/sign.task.js.map +1 -0
- package/dist/lib/chat/chat.d.ts +51 -51
- package/dist/lib/chat/chat.js +183 -183
- package/dist/lib/chat/index.js +2 -2
- package/dist/lib/chat/pb.js +15 -15
- package/dist/lib/email/email.js +66 -66
- package/dist/lib/email/index.js +1 -1
- package/dist/lib/env.js +3 -3
- package/dist/lib/forms/fields.client.d.ts +30 -30
- package/dist/lib/forms/fields.client.js +20 -20
- package/dist/lib/forms/fields.server.js +1 -1
- package/dist/lib/forms/form-metadata.js +320 -320
- package/dist/lib/forms/index.js +3 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './lib/chat/index.js';
|
|
2
|
-
export * from './lib/env.js';
|
|
3
|
-
export * from './lib/broker/index.js';
|
|
4
|
-
export * from './lib/email/index.js';
|
|
5
|
-
export * from './lib/forms/index.js';
|
|
1
|
+
export * from './lib/chat/index.js';
|
|
2
|
+
export * from './lib/env.js';
|
|
3
|
+
export * from './lib/broker/index.js';
|
|
4
|
+
export * from './lib/email/index.js';
|
|
5
|
+
export * from './lib/forms/index.js';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -8,5 +8,9 @@ export declare class BrokerAPI {
|
|
|
8
8
|
static instance(): Promise<BrokerAPI>;
|
|
9
9
|
assertQueue(queueId: string, options?: amqp.Options.AssertQueue): Promise<amqp.Replies.AssertQueue>;
|
|
10
10
|
sendToQueue(queueId: string, content: any): boolean;
|
|
11
|
-
readFromQueue<T>(queueId: string): Promise<
|
|
11
|
+
readFromQueue<T>(queueId: string): Promise<{
|
|
12
|
+
content: T | null;
|
|
13
|
+
resolve: () => void;
|
|
14
|
+
reject: () => void;
|
|
15
|
+
}>;
|
|
12
16
|
}
|
|
@@ -54,17 +54,17 @@ export class BrokerAPI {
|
|
|
54
54
|
this.channels.writer.nack(message);
|
|
55
55
|
console.log(`[BROKER] Message "${message.properties.messageId}" rejected from queue "${queueId}".`);
|
|
56
56
|
};
|
|
57
|
-
let
|
|
57
|
+
let resolveResultPromise;
|
|
58
|
+
const resultPromise = new Promise((r) => (resolveResultPromise = r));
|
|
58
59
|
await this.channels.reader.consume(queueId, (message) => {
|
|
59
60
|
const content = message?.content?.toString?.();
|
|
60
|
-
|
|
61
|
+
resolveResultPromise({
|
|
61
62
|
content: content ? JSON.parse(content) : null,
|
|
62
63
|
resolve: () => message && resolveFromQueue(message),
|
|
63
64
|
reject: () => message && rejectFromQueue(message),
|
|
64
|
-
};
|
|
65
|
-
return message ? result : null;
|
|
65
|
+
});
|
|
66
66
|
});
|
|
67
|
-
return
|
|
67
|
+
return resultPromise;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
//# sourceMappingURL=broker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"broker.js","sourceRoot":"","sources":["../../../lib/broker/broker.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;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C,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE;YACtD,MAAM,OAAO,GAAG,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,CAAC;YAG/C,oBAAoB,CAAC;gBACnB,OAAO,EAAE,OAAO,CAAC,CAAC,CAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAO,CAAC,CAAC,CAAC,IAAI;gBACpD,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,IAAI,gBAAgB,CAAC,OAAO,CAAC;gBACnD,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,IAAI,eAAe,CAAC,OAAO,CAAC;aAClD,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,aAAa,CAAC;IACvB,CAAC;CACF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare class BaseTaskInitiator<Request, Response> {
|
|
2
|
+
private requestQueueId;
|
|
3
|
+
private responseQueueId;
|
|
4
|
+
constructor(queueId: string);
|
|
5
|
+
sendRequest(content: Request): Promise<boolean>;
|
|
6
|
+
readResponse(): Promise<{
|
|
7
|
+
content: Response | null;
|
|
8
|
+
resolve: () => void;
|
|
9
|
+
reject: () => void;
|
|
10
|
+
}>;
|
|
11
|
+
}
|
|
12
|
+
export declare class BaseTaskHandler<Request, Response> {
|
|
13
|
+
private requestQueueId;
|
|
14
|
+
private responseQueueId;
|
|
15
|
+
constructor(queueId: string);
|
|
16
|
+
readRequest(): Promise<{
|
|
17
|
+
content: Request | null;
|
|
18
|
+
resolve: () => void;
|
|
19
|
+
reject: () => void;
|
|
20
|
+
}>;
|
|
21
|
+
sendResponse(content: Response): Promise<boolean>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { BrokerAPI } from '../broker.js';
|
|
2
|
+
export class BaseTaskInitiator {
|
|
3
|
+
requestQueueId;
|
|
4
|
+
responseQueueId;
|
|
5
|
+
constructor(queueId) {
|
|
6
|
+
this.requestQueueId = `request.${queueId}`;
|
|
7
|
+
this.responseQueueId = `response.${queueId}`;
|
|
8
|
+
}
|
|
9
|
+
async sendRequest(content) {
|
|
10
|
+
const brokerAPI = await BrokerAPI.instance();
|
|
11
|
+
return brokerAPI.sendToQueue(this.requestQueueId, content);
|
|
12
|
+
}
|
|
13
|
+
async readResponse() {
|
|
14
|
+
const brokerAPI = await BrokerAPI.instance();
|
|
15
|
+
return await brokerAPI.readFromQueue(this.responseQueueId);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export class BaseTaskHandler {
|
|
19
|
+
requestQueueId;
|
|
20
|
+
responseQueueId;
|
|
21
|
+
constructor(queueId) {
|
|
22
|
+
this.requestQueueId = `request.${queueId}`;
|
|
23
|
+
this.responseQueueId = `response.${queueId}`;
|
|
24
|
+
}
|
|
25
|
+
async readRequest() {
|
|
26
|
+
const brokerAPI = await BrokerAPI.instance();
|
|
27
|
+
return brokerAPI.readFromQueue(this.requestQueueId);
|
|
28
|
+
}
|
|
29
|
+
async sendResponse(content) {
|
|
30
|
+
const brokerAPI = await BrokerAPI.instance();
|
|
31
|
+
return brokerAPI.sendToQueue(this.responseQueueId, content);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=base.task.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.task.js","sourceRoot":"","sources":["../../../../lib/broker/tasks/base.task.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAMzC,MAAM,OAAO,iBAAiB;IACpB,cAAc,CAAS;IACvB,eAAe,CAAS;IAEhC,YAAY,OAAe;QACzB,IAAI,CAAC,cAAc,GAAG,WAAW,OAAO,EAAE,CAAC;QAC3C,IAAI,CAAC,eAAe,GAAG,YAAY,OAAO,EAAE,CAAC;IAC/C,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,OAAgB;QAChC,MAAM,SAAS,GAAG,MAAM,SAAS,CAAC,QAAQ,EAAE,CAAC;QAC7C,OAAO,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED,KAAK,CAAC,YAAY;QAKhB,MAAM,SAAS,GAAG,MAAM,SAAS,CAAC,QAAQ,EAAE,CAAC;QAC7C,OAAO,MAAM,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAC7D,CAAC;CACF;AAMD,MAAM,OAAO,eAAe;IAClB,cAAc,CAAS;IACvB,eAAe,CAAS;IAEhC,YAAY,OAAe;QACzB,IAAI,CAAC,cAAc,GAAG,WAAW,OAAO,EAAE,CAAC;QAC3C,IAAI,CAAC,eAAe,GAAG,YAAY,OAAO,EAAE,CAAC;IAC/C,CAAC;IAED,KAAK,CAAC,WAAW;QAKf,MAAM,SAAS,GAAG,MAAM,SAAS,CAAC,QAAQ,EAAE,CAAC;QAC7C,OAAO,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,OAAiB;QAClC,MAAM,SAAS,GAAG,MAAM,SAAS,CAAC,QAAQ,EAAE,CAAC;QAC7C,OAAO,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;CACF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseTaskInitiator, BaseTaskHandler } from './base.task.js';
|
|
2
|
+
export interface EmailTaskRequest {
|
|
3
|
+
sender?: string;
|
|
4
|
+
subject: string;
|
|
5
|
+
recipient: string;
|
|
6
|
+
content: string;
|
|
7
|
+
alias?: 'otp' | 'applications' | 'sign' | 'hello';
|
|
8
|
+
}
|
|
9
|
+
export interface EmailTaskResponse {
|
|
10
|
+
id: string;
|
|
11
|
+
recipient: string;
|
|
12
|
+
alias?: 'otp' | 'applications' | 'sign' | 'hello';
|
|
13
|
+
}
|
|
14
|
+
export declare const EmailTaskInitiator: BaseTaskInitiator<EmailTaskRequest, EmailTaskResponse>;
|
|
15
|
+
export declare const EmailTaskHandler: BaseTaskHandler<EmailTaskRequest, EmailTaskResponse>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email..task.js","sourceRoot":"","sources":["../../../../lib/broker/tasks/email..task.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAgBpE,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,iBAAiB,CAGrD,eAAe,CAAC,CAAC;AAEnB,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,eAAe,CAGjD,eAAe,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/broker/tasks/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { BaseTaskHandler, BaseTaskInitiator } from './base.task.js';
|
|
2
|
+
export interface SignTaskRequest {
|
|
3
|
+
populatedSchema: FilledFormSchema;
|
|
4
|
+
template: string;
|
|
5
|
+
excludeVerificationCode?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface SignTaskResponse {
|
|
8
|
+
buffer: Buffer<ArrayBuffer>;
|
|
9
|
+
inputs: object;
|
|
10
|
+
templateId: string;
|
|
11
|
+
templateHash: string;
|
|
12
|
+
formSchema: object;
|
|
13
|
+
formSchemaHash: string;
|
|
14
|
+
inputHash: string;
|
|
15
|
+
timestamp: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const SignTaskInitiator: BaseTaskInitiator<SignTaskRequest, SignTaskResponse>;
|
|
18
|
+
export declare const SignTaskHandler: BaseTaskHandler<SignTaskRequest, SignTaskResponse>;
|
|
19
|
+
type FilledFormSchema = FilledFormSchemaField[];
|
|
20
|
+
interface EmptyFormSchemaField {
|
|
21
|
+
field: string;
|
|
22
|
+
value?: string;
|
|
23
|
+
type: string;
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
w: number;
|
|
27
|
+
h: number;
|
|
28
|
+
page: number;
|
|
29
|
+
align_h?: 'center' | 'left' | 'right';
|
|
30
|
+
align_v?: 'middle' | 'top' | 'bottom';
|
|
31
|
+
}
|
|
32
|
+
interface FilledFormSchemaField extends EmptyFormSchemaField {
|
|
33
|
+
value: string;
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sign.task.js","sourceRoot":"","sources":["../../../../lib/broker/tasks/sign.task.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAmBpE,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,iBAAiB,CAGpD,cAAc,CAAC,CAAC;AAElB,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,eAAe,CAGhD,cAAc,CAAC,CAAC"}
|
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
|
+
}
|