ei-dev-shared 1.0.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/README.md +54 -0
- package/dist/adminQueries/adminQueries.type.d.ts +58 -0
- package/dist/adminQueries/adminQueries.type.d.ts.map +1 -0
- package/dist/adminQueries/adminQueries.type.js +1 -0
- package/dist/chat/chat.type.d.ts +151 -0
- package/dist/chat/chat.type.d.ts.map +1 -0
- package/dist/chat/chat.type.js +1 -0
- package/dist/cjs/adminQueries/adminQueries.type.js +2 -0
- package/dist/cjs/chat/chat.type.js +2 -0
- package/dist/cjs/dataSrouces/DishData.type.js +8 -0
- package/dist/cjs/nats/nats.patterns.js +27 -0
- package/dist/cjs/user/User.keys.js +32 -0
- package/dist/cjs/user/User.type.js +11 -0
- package/dist/cjs/user/UserSession.type.js +2 -0
- package/dist/dataSrouces/DishData.type.d.ts +15 -0
- package/dist/dataSrouces/DishData.type.d.ts.map +1 -0
- package/dist/dataSrouces/DishData.type.js +5 -0
- package/dist/index.cjs +23 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/nats/nats.patterns.d.ts +25 -0
- package/dist/nats/nats.patterns.d.ts.map +1 -0
- package/dist/nats/nats.patterns.js +24 -0
- package/dist/user/User.keys.d.ts +3 -0
- package/dist/user/User.keys.d.ts.map +1 -0
- package/dist/user/User.keys.js +29 -0
- package/dist/user/User.type.d.ts +63 -0
- package/dist/user/User.type.d.ts.map +1 -0
- package/dist/user/User.type.js +8 -0
- package/dist/user/UserSession.type.d.ts +20 -0
- package/dist/user/UserSession.type.d.ts.map +1 -0
- package/dist/user/UserSession.type.js +1 -0
- package/package.json +40 -0
package/README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# EI Dev Shared
|
|
2
|
+
|
|
3
|
+
This repository contains shared backend services for the ENABLEINDIA project.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [EI Dev Shared](#ei-dev-shared)
|
|
8
|
+
- [Table of Contents](#table-of-contents)
|
|
9
|
+
- [Introduction](#introduction)
|
|
10
|
+
- [Installation](#installation)
|
|
11
|
+
- [Usage](#usage)
|
|
12
|
+
- [Contributing](#contributing)
|
|
13
|
+
- [License](#license)
|
|
14
|
+
|
|
15
|
+
## Introduction
|
|
16
|
+
|
|
17
|
+
The `ei-dev-shared` repository includes common backend services and utilities used across various ENABLEINDIA projects. It aims to provide reusable components to streamline development and ensure consistency.
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
To install the dependencies, run the following command:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
To start the development server, use:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm start
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
For running tests:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm test
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Contributing
|
|
42
|
+
|
|
43
|
+
We welcome contributions! Please follow these steps:
|
|
44
|
+
|
|
45
|
+
1. Fork the repository.
|
|
46
|
+
2. Create a new branch (`git checkout -b feature-branch`).
|
|
47
|
+
3. Make your changes.
|
|
48
|
+
4. Commit your changes (`git commit -m 'Add new feature'`).
|
|
49
|
+
5. Push to the branch (`git push origin feature-branch`).
|
|
50
|
+
6. Open a pull request.
|
|
51
|
+
|
|
52
|
+
## License
|
|
53
|
+
|
|
54
|
+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ChatQuery } from "../chat/chat.type";
|
|
2
|
+
import { DishData } from "../dataSrouces/DishData.type";
|
|
3
|
+
import { RegisteredVia, UserForAdminDTO } from "../user/User.type";
|
|
4
|
+
export type AdminDataUsersQuery = {
|
|
5
|
+
query: Partial<UserForAdminDTO>;
|
|
6
|
+
queryingApp: RegisteredVia;
|
|
7
|
+
queryOptions: {
|
|
8
|
+
skip?: number;
|
|
9
|
+
limit?: number;
|
|
10
|
+
sort?: {
|
|
11
|
+
[key in keyof UserForAdminDTO]?: "ASC" | "DESC" | 1 | -1;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export type AdminDataUsersQueryResponse = {
|
|
16
|
+
data: UserForAdminDTO[] | UserForAdminDTO;
|
|
17
|
+
total: number;
|
|
18
|
+
};
|
|
19
|
+
export type AdminDataQuestionsQuery = {
|
|
20
|
+
query: Partial<ChatQuery>;
|
|
21
|
+
queryingApp: RegisteredVia;
|
|
22
|
+
queryOptions: {
|
|
23
|
+
skip?: number;
|
|
24
|
+
limit?: number;
|
|
25
|
+
sort?: {
|
|
26
|
+
[key in keyof ChatQuery]?: "ASC" | "DESC" | 1 | -1;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export type AdminDataQuestionsQueryResponse = {
|
|
31
|
+
data: ChatQuery[] | ChatQuery;
|
|
32
|
+
total: number;
|
|
33
|
+
};
|
|
34
|
+
export type AdminDataBankQuery = {
|
|
35
|
+
query: Partial<DishData>;
|
|
36
|
+
queryingApp: RegisteredVia;
|
|
37
|
+
queryOptions: {
|
|
38
|
+
onlySources?: boolean;
|
|
39
|
+
onlyCount?: boolean;
|
|
40
|
+
skip?: number;
|
|
41
|
+
limit?: number;
|
|
42
|
+
sort?: {
|
|
43
|
+
[key in keyof DishData]?: "ASC" | "DESC" | 1 | -1;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export type AdminDataBankQuerySourcesOnlyResponse = {
|
|
48
|
+
sources: string[];
|
|
49
|
+
};
|
|
50
|
+
export type AdminDataBankQueryCountOnlyResponse = {
|
|
51
|
+
count: number;
|
|
52
|
+
};
|
|
53
|
+
export type AdminDataBankQueryDataResponse = {
|
|
54
|
+
data: DishData[] | DishData;
|
|
55
|
+
total: number;
|
|
56
|
+
};
|
|
57
|
+
export type AdminDataBankQueryResponse = AdminDataBankQuerySourcesOnlyResponse | AdminDataBankQueryCountOnlyResponse | AdminDataBankQueryDataResponse;
|
|
58
|
+
//# sourceMappingURL=adminQueries.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adminQueries.type.d.ts","sourceRoot":"","sources":["../../src/adminQueries/adminQueries.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AACvD,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAElE,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;IAC/B,WAAW,EAAE,aAAa,CAAA;IAC1B,YAAY,EAAE;QACZ,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,IAAI,CAAC,EAAE;aACJ,GAAG,IAAI,MAAM,eAAe,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC;SACzD,CAAA;KACF,CAAA;CACF,CAAA;AAED,MAAM,MAAM,2BAA2B,GAAG;IACxC,IAAI,EAAE,eAAe,EAAE,GAAG,eAAe,CAAA;IACzC,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,KAAK,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;IACzB,WAAW,EAAE,aAAa,CAAA;IAC1B,YAAY,EAAE;QACZ,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,IAAI,CAAC,EAAE;aACJ,GAAG,IAAI,MAAM,SAAS,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC;SACnD,CAAA;KACF,CAAA;CACF,CAAA;AAED,MAAM,MAAM,+BAA+B,GAAG;IAC5C,IAAI,EAAE,SAAS,EAAE,GAAG,SAAS,CAAA;IAC7B,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAA;IACxB,WAAW,EAAE,aAAa,CAAA;IAC1B,YAAY,EAAE;QACZ,WAAW,CAAC,EAAE,OAAO,CAAA;QACrB,SAAS,CAAC,EAAE,OAAO,CAAA;QACnB,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,IAAI,CAAC,EAAE;aACJ,GAAG,IAAI,MAAM,QAAQ,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC;SAClD,CAAA;KACF,CAAA;CACF,CAAA;AAED,MAAM,MAAM,qCAAqC,GAAG;IAClD,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,mCAAmC,GAAG;IAChD,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,8BAA8B,GAAG;IAC3C,IAAI,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAAA;IAC3B,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,0BAA0B,GAClC,qCAAqC,GACrC,mCAAmC,GACnC,8BAA8B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
export type ChatMessage = {
|
|
2
|
+
text: string;
|
|
3
|
+
type: "user" | "bot" | "articulation";
|
|
4
|
+
isAudio?: boolean;
|
|
5
|
+
audioURI?: string;
|
|
6
|
+
audioBlob?: Blob;
|
|
7
|
+
links?: {
|
|
8
|
+
url: string;
|
|
9
|
+
title: string;
|
|
10
|
+
}[];
|
|
11
|
+
};
|
|
12
|
+
export type ChatDetectedLanguageResponse = {
|
|
13
|
+
lang_code?: string;
|
|
14
|
+
lang_name?: string;
|
|
15
|
+
error?: string;
|
|
16
|
+
};
|
|
17
|
+
export type ChatTranslationResponse = {
|
|
18
|
+
text?: string;
|
|
19
|
+
error?: string;
|
|
20
|
+
lang_code?: string;
|
|
21
|
+
};
|
|
22
|
+
export type ChatTranscriptionResponse = {
|
|
23
|
+
source_lang_name?: string;
|
|
24
|
+
source_lang_code?: string;
|
|
25
|
+
error?: string;
|
|
26
|
+
text?: string;
|
|
27
|
+
};
|
|
28
|
+
export type ChatQueryResponse = {
|
|
29
|
+
answer?: string;
|
|
30
|
+
completion_tokens?: number;
|
|
31
|
+
error?: string;
|
|
32
|
+
};
|
|
33
|
+
export type ChatVoiceResponse = {
|
|
34
|
+
links?: {
|
|
35
|
+
url: string;
|
|
36
|
+
title: string;
|
|
37
|
+
}[];
|
|
38
|
+
audioPath?: string;
|
|
39
|
+
error?: string;
|
|
40
|
+
};
|
|
41
|
+
export type ChatArticulationResponse = {
|
|
42
|
+
text: string;
|
|
43
|
+
error?: string;
|
|
44
|
+
};
|
|
45
|
+
export type ChatQuery = {
|
|
46
|
+
sessionId: string;
|
|
47
|
+
sourceProject: "blimey" | "dish";
|
|
48
|
+
sourceMode: "wa" | "web" | "windows" | "mac" | "linux" | "ios" | "android";
|
|
49
|
+
queryTimestamp: Date;
|
|
50
|
+
responseTimestamp?: Date;
|
|
51
|
+
history: ChatHistoryItem[];
|
|
52
|
+
};
|
|
53
|
+
export type ChatHistoryItem = (Omit<ChatQueryPayloadText, "sessionId" | "sourceProject" | "sourceMode"> & {
|
|
54
|
+
type: "query";
|
|
55
|
+
timestamp: Date;
|
|
56
|
+
}) | (Omit<ChatQueryPayloadVoice, "sessionId" | "sourceProject" | "sourceMode"> & {
|
|
57
|
+
type: "voice-query";
|
|
58
|
+
timestamp: Date;
|
|
59
|
+
}) | (Omit<ChatQueryPayloadText, "sessionId" | "sourceProject" | "sourceMode"> & {
|
|
60
|
+
type: "detect-language-query";
|
|
61
|
+
timestamp: Date;
|
|
62
|
+
}) | (Omit<ChatQueryPayloadTTS, "sessionId" | "sourceProject" | "sourceMode"> & {
|
|
63
|
+
type: "tts-query";
|
|
64
|
+
timestamp: Date;
|
|
65
|
+
}) | (Omit<ChatQueryPayloadTranslation, "sessionId" | "sourceProject" | "sourceMode"> & {
|
|
66
|
+
type: "translation-query";
|
|
67
|
+
timestamp: Date;
|
|
68
|
+
}) | (Omit<ChatDetectedLanguageResponse, "sessionId" | "sourceProject" | "sourceMode"> & {
|
|
69
|
+
type: "detected-language";
|
|
70
|
+
timestamp: Date;
|
|
71
|
+
}) | (Omit<ChatTranslationResponse, "sessionId" | "sourceProject" | "sourceMode"> & {
|
|
72
|
+
type: "translation";
|
|
73
|
+
timestamp: Date;
|
|
74
|
+
}) | (Omit<ChatTranscriptionResponse, "sessionId" | "sourceProject" | "sourceMode"> & {
|
|
75
|
+
type: "transcription";
|
|
76
|
+
timestamp: Date;
|
|
77
|
+
}) | (Omit<ChatQueryResponse, "sessionId" | "sourceProject" | "sourceMode"> & {
|
|
78
|
+
type: "query-response";
|
|
79
|
+
timestamp: Date;
|
|
80
|
+
}) | (Omit<ChatVoiceResponse, "sessionId" | "sourceProject" | "sourceMode"> & {
|
|
81
|
+
type: "voice-response";
|
|
82
|
+
timestamp: Date;
|
|
83
|
+
}) | {
|
|
84
|
+
type: "error";
|
|
85
|
+
message: string;
|
|
86
|
+
timestamp: Date;
|
|
87
|
+
};
|
|
88
|
+
export type ChatQueryPayloadText = Pick<ChatQuery, "sessionId" | "sourceProject" | "sourceMode"> & {
|
|
89
|
+
query: string;
|
|
90
|
+
};
|
|
91
|
+
export type ChatQueryPayloadVoice = Pick<ChatQuery, "sessionId" | "sourceProject" | "sourceMode"> & {
|
|
92
|
+
audioPath?: string;
|
|
93
|
+
audioBuffer?: ArrayBuffer;
|
|
94
|
+
};
|
|
95
|
+
export type ChatQueryPayloadTranslation = Pick<ChatQuery, "sessionId" | "sourceProject" | "sourceMode"> & {
|
|
96
|
+
query: string;
|
|
97
|
+
source_lang_name: string;
|
|
98
|
+
target_lang_name: string;
|
|
99
|
+
target_lang_code: string;
|
|
100
|
+
};
|
|
101
|
+
export type ChatQueryPayloadTTS = Pick<ChatQuery, "sessionId" | "sourceProject" | "sourceMode"> & {
|
|
102
|
+
text: string;
|
|
103
|
+
};
|
|
104
|
+
export type ChatResponsePayload = Pick<ChatQuery, "sessionId"> & {
|
|
105
|
+
response?: ChatQueryResponse | ChatVoiceResponse | ChatArticulationResponse;
|
|
106
|
+
};
|
|
107
|
+
export type ChatIncomingMessageEvent = {
|
|
108
|
+
event: "answer-text" | "answer-voice" | "articulating";
|
|
109
|
+
content: ChatResponsePayload;
|
|
110
|
+
};
|
|
111
|
+
export type ChatOutgoingMessageEvent = {
|
|
112
|
+
event: "question-text" | "question-voice";
|
|
113
|
+
content: ChatQueryPayloadText | ChatQueryPayloadVoice;
|
|
114
|
+
};
|
|
115
|
+
export type RAGContext = {
|
|
116
|
+
id: number;
|
|
117
|
+
distance: number;
|
|
118
|
+
entity: {
|
|
119
|
+
content: string;
|
|
120
|
+
org: string;
|
|
121
|
+
url: string;
|
|
122
|
+
title: string;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
export type RAGResponse = {
|
|
126
|
+
query: string;
|
|
127
|
+
session_id: string;
|
|
128
|
+
context: RAGContext[];
|
|
129
|
+
};
|
|
130
|
+
export type UserMessage = {
|
|
131
|
+
message: {
|
|
132
|
+
role: "user";
|
|
133
|
+
content: string;
|
|
134
|
+
};
|
|
135
|
+
promptTokens: number;
|
|
136
|
+
};
|
|
137
|
+
export type SystemMessage = {
|
|
138
|
+
message: {
|
|
139
|
+
role: "system";
|
|
140
|
+
content: string;
|
|
141
|
+
};
|
|
142
|
+
promptTokens: number;
|
|
143
|
+
};
|
|
144
|
+
export type AssistantMessage = {
|
|
145
|
+
message: {
|
|
146
|
+
role: "assistant";
|
|
147
|
+
content: string;
|
|
148
|
+
};
|
|
149
|
+
promptTokens: number;
|
|
150
|
+
};
|
|
151
|
+
//# sourceMappingURL=chat.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat.type.d.ts","sourceRoot":"","sources":["../../src/chat/chat.type.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,cAAc,CAAA;IACrC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,IAAI,CAAA;IAChB,KAAK,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CACzC,CAAA;AAED,MAAM,MAAM,4BAA4B,GAAG;IACzC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,KAAK,C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;CACF,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,UAAU,EAAE,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,YAAY,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE;QACP,IAAI,EAAE,QAAQ,CAAA;QACd,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,YAAY,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE;QACP,IAAI,EAAE,WAAW,CAAA;QACjB,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,YAAY,EAAE,MAAM,CAAA;CACrB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ResourceType = void 0;
|
|
4
|
+
var ResourceType;
|
|
5
|
+
(function (ResourceType) {
|
|
6
|
+
ResourceType["Web"] = "web";
|
|
7
|
+
ResourceType["Video"] = "video";
|
|
8
|
+
})(ResourceType || (exports.ResourceType = ResourceType = {}));
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NATS_Queues = exports.NATS_Patterns = void 0;
|
|
4
|
+
exports.NATS_Patterns = {
|
|
5
|
+
auth_register: "userauth.register",
|
|
6
|
+
auth_login: "userauth.login",
|
|
7
|
+
auth_me: "userauth.me",
|
|
8
|
+
auth_wa_login: "userauth.wa-login",
|
|
9
|
+
auth_wa_me: "userauth.wa-me",
|
|
10
|
+
aichat_questionText: "aichat.question-text",
|
|
11
|
+
aichat_transcribe: "aichat.transcribe",
|
|
12
|
+
aichat_translate: "aichat.translate",
|
|
13
|
+
aichat_getLanguage: "aichat.get-language",
|
|
14
|
+
aichat_tts: "aichat.tts",
|
|
15
|
+
aichat_clearContext: "aichat.clear-context",
|
|
16
|
+
aichat_logQuery: "aichat.log-query",
|
|
17
|
+
waupdate_progress: "waupdate.progress",
|
|
18
|
+
admin_data_users: "admindata.users",
|
|
19
|
+
admin_data_questions: "admindata.questions",
|
|
20
|
+
admin_data_bank: "admindata.bank",
|
|
21
|
+
};
|
|
22
|
+
exports.NATS_Queues = {
|
|
23
|
+
user_auth: "queue.userauth",
|
|
24
|
+
aichat: "queue.aichat",
|
|
25
|
+
wa_update: "queue.waupdate",
|
|
26
|
+
admin_data: "queue.admindata",
|
|
27
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserForAdminDTOKeys = exports.UserDTOKeys = void 0;
|
|
4
|
+
exports.UserDTOKeys = [
|
|
5
|
+
"email",
|
|
6
|
+
"phone",
|
|
7
|
+
"adminType",
|
|
8
|
+
"emailVerified",
|
|
9
|
+
"phoneVerified",
|
|
10
|
+
"registeredVia",
|
|
11
|
+
"isBlocked",
|
|
12
|
+
"name",
|
|
13
|
+
"isActive",
|
|
14
|
+
"isAdmin",
|
|
15
|
+
"sessionId",
|
|
16
|
+
"whatsappId",
|
|
17
|
+
"customProps",
|
|
18
|
+
];
|
|
19
|
+
exports.UserForAdminDTOKeys = [
|
|
20
|
+
"email",
|
|
21
|
+
"phone",
|
|
22
|
+
"adminType",
|
|
23
|
+
"emailVerified",
|
|
24
|
+
"phoneVerified",
|
|
25
|
+
"registeredVia",
|
|
26
|
+
"isBlocked",
|
|
27
|
+
"name",
|
|
28
|
+
"isActive",
|
|
29
|
+
"isAdmin",
|
|
30
|
+
"whatsappId",
|
|
31
|
+
"customProps",
|
|
32
|
+
];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RegisteredVia = void 0;
|
|
4
|
+
var RegisteredVia;
|
|
5
|
+
(function (RegisteredVia) {
|
|
6
|
+
RegisteredVia["DISH"] = "dish";
|
|
7
|
+
RegisteredVia["BLIMEY"] = "blimey";
|
|
8
|
+
RegisteredVia["OPUN"] = "opun";
|
|
9
|
+
RegisteredVia["GSC"] = "gsc";
|
|
10
|
+
RegisteredVia["SPELLING_TOOL"] = "spelling_tool";
|
|
11
|
+
})(RegisteredVia || (exports.RegisteredVia = RegisteredVia = {}));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare enum ResourceType {
|
|
2
|
+
Web = "web",
|
|
3
|
+
Video = "video"
|
|
4
|
+
}
|
|
5
|
+
export type DishData = {
|
|
6
|
+
title: string;
|
|
7
|
+
body: string;
|
|
8
|
+
tags: string[];
|
|
9
|
+
country: string;
|
|
10
|
+
url: string;
|
|
11
|
+
resource_type: ResourceType;
|
|
12
|
+
source: string;
|
|
13
|
+
thumbnail?: string;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=DishData.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DishData.type.d.ts","sourceRoot":"","sources":["../../src/dataSrouces/DishData.type.ts"],"names":[],"mappings":"AAAA,oBAAY,YAAY;IACtB,GAAG,QAAQ;IACX,KAAK,UAAU;CAChB;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,GAAG,EAAE,MAAM,CAAA;IACX,aAAa,EAAE,YAAY,CAAA;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA"}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./user/User.type"), exports);
|
|
18
|
+
__exportStar(require("./user/User.keys"), exports);
|
|
19
|
+
__exportStar(require("./user/UserSession.type"), exports);
|
|
20
|
+
__exportStar(require("./nats/nats.patterns"), exports);
|
|
21
|
+
__exportStar(require("./chat/chat.type"), exports);
|
|
22
|
+
__exportStar(require("./adminQueries/adminQueries.type"), exports);
|
|
23
|
+
__exportStar(require("./dataSrouces/DishData.type"), exports);
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./user/User.type";
|
|
2
|
+
export * from "./user/User.keys";
|
|
3
|
+
export * from "./user/UserSession.type";
|
|
4
|
+
export * from "./nats/nats.patterns";
|
|
5
|
+
export * from "./chat/chat.type";
|
|
6
|
+
export * from "./adminQueries/adminQueries.type";
|
|
7
|
+
export * from "./dataSrouces/DishData.type";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAChC,cAAc,yBAAyB,CAAA;AACvC,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,kCAAkC,CAAA;AAChD,cAAc,6BAA6B,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "./user/User.type";
|
|
2
|
+
export * from "./user/User.keys";
|
|
3
|
+
export * from "./user/UserSession.type";
|
|
4
|
+
export * from "./nats/nats.patterns";
|
|
5
|
+
export * from "./chat/chat.type";
|
|
6
|
+
export * from "./adminQueries/adminQueries.type";
|
|
7
|
+
export * from "./dataSrouces/DishData.type";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const NATS_Patterns: {
|
|
2
|
+
auth_register: string;
|
|
3
|
+
auth_login: string;
|
|
4
|
+
auth_me: string;
|
|
5
|
+
auth_wa_login: string;
|
|
6
|
+
auth_wa_me: string;
|
|
7
|
+
aichat_questionText: string;
|
|
8
|
+
aichat_transcribe: string;
|
|
9
|
+
aichat_translate: string;
|
|
10
|
+
aichat_getLanguage: string;
|
|
11
|
+
aichat_tts: string;
|
|
12
|
+
aichat_clearContext: string;
|
|
13
|
+
aichat_logQuery: string;
|
|
14
|
+
waupdate_progress: string;
|
|
15
|
+
admin_data_users: string;
|
|
16
|
+
admin_data_questions: string;
|
|
17
|
+
admin_data_bank: string;
|
|
18
|
+
};
|
|
19
|
+
export declare const NATS_Queues: {
|
|
20
|
+
user_auth: string;
|
|
21
|
+
aichat: string;
|
|
22
|
+
wa_update: string;
|
|
23
|
+
admin_data: string;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=nats.patterns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nats.patterns.d.ts","sourceRoot":"","sources":["../../src/nats/nats.patterns.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;CAiBzB,CAAA;AAED,eAAO,MAAM,WAAW;;;;;CAKvB,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export const NATS_Patterns = {
|
|
2
|
+
auth_register: "userauth.register",
|
|
3
|
+
auth_login: "userauth.login",
|
|
4
|
+
auth_me: "userauth.me",
|
|
5
|
+
auth_wa_login: "userauth.wa-login",
|
|
6
|
+
auth_wa_me: "userauth.wa-me",
|
|
7
|
+
aichat_questionText: "aichat.question-text",
|
|
8
|
+
aichat_transcribe: "aichat.transcribe",
|
|
9
|
+
aichat_translate: "aichat.translate",
|
|
10
|
+
aichat_getLanguage: "aichat.get-language",
|
|
11
|
+
aichat_tts: "aichat.tts",
|
|
12
|
+
aichat_clearContext: "aichat.clear-context",
|
|
13
|
+
aichat_logQuery: "aichat.log-query",
|
|
14
|
+
waupdate_progress: "waupdate.progress",
|
|
15
|
+
admin_data_users: "admindata.users",
|
|
16
|
+
admin_data_questions: "admindata.questions",
|
|
17
|
+
admin_data_bank: "admindata.bank",
|
|
18
|
+
};
|
|
19
|
+
export const NATS_Queues = {
|
|
20
|
+
user_auth: "queue.userauth",
|
|
21
|
+
aichat: "queue.aichat",
|
|
22
|
+
wa_update: "queue.waupdate",
|
|
23
|
+
admin_data: "queue.admindata",
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"User.keys.d.ts","sourceRoot":"","sources":["../../src/user/User.keys.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,UAcvB,CAAA;AAED,eAAO,MAAM,mBAAmB,UAa/B,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export const UserDTOKeys = [
|
|
2
|
+
"email",
|
|
3
|
+
"phone",
|
|
4
|
+
"adminType",
|
|
5
|
+
"emailVerified",
|
|
6
|
+
"phoneVerified",
|
|
7
|
+
"registeredVia",
|
|
8
|
+
"isBlocked",
|
|
9
|
+
"name",
|
|
10
|
+
"isActive",
|
|
11
|
+
"isAdmin",
|
|
12
|
+
"sessionId",
|
|
13
|
+
"whatsappId",
|
|
14
|
+
"customProps",
|
|
15
|
+
];
|
|
16
|
+
export const UserForAdminDTOKeys = [
|
|
17
|
+
"email",
|
|
18
|
+
"phone",
|
|
19
|
+
"adminType",
|
|
20
|
+
"emailVerified",
|
|
21
|
+
"phoneVerified",
|
|
22
|
+
"registeredVia",
|
|
23
|
+
"isBlocked",
|
|
24
|
+
"name",
|
|
25
|
+
"isActive",
|
|
26
|
+
"isAdmin",
|
|
27
|
+
"whatsappId",
|
|
28
|
+
"customProps",
|
|
29
|
+
];
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export declare enum RegisteredVia {
|
|
2
|
+
DISH = "dish",
|
|
3
|
+
BLIMEY = "blimey",
|
|
4
|
+
OPUN = "opun",
|
|
5
|
+
GSC = "gsc",
|
|
6
|
+
SPELLING_TOOL = "spelling_tool"
|
|
7
|
+
}
|
|
8
|
+
export type UserBase = {
|
|
9
|
+
id: number;
|
|
10
|
+
name: string;
|
|
11
|
+
isActive: boolean;
|
|
12
|
+
isAdmin: boolean;
|
|
13
|
+
email?: string;
|
|
14
|
+
phone?: string;
|
|
15
|
+
adminType?: "super" | "division" | "tech";
|
|
16
|
+
emailVerified: boolean;
|
|
17
|
+
phoneVerified: boolean;
|
|
18
|
+
registeredVia: RegisteredVia;
|
|
19
|
+
isBlocked?: boolean;
|
|
20
|
+
created_at: Date;
|
|
21
|
+
updated_at: Date;
|
|
22
|
+
whatsappId?: string;
|
|
23
|
+
customProps?: {
|
|
24
|
+
[key in RegisteredVia]?: Record<string, any>;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export type User = Omit<UserBase, "email" | "phone"> & ({
|
|
28
|
+
email?: string;
|
|
29
|
+
phone: string;
|
|
30
|
+
} | {
|
|
31
|
+
email: string;
|
|
32
|
+
phone?: string;
|
|
33
|
+
});
|
|
34
|
+
export type UserForEmailVerification = User & {
|
|
35
|
+
emailVerificationToken?: string;
|
|
36
|
+
emailVerificationTokenExpires?: Date;
|
|
37
|
+
};
|
|
38
|
+
export type UserForPasswordReset = User & {
|
|
39
|
+
passwordResetToken?: string;
|
|
40
|
+
passwordResetTokenExpires?: Date;
|
|
41
|
+
};
|
|
42
|
+
export type UserForPhoneVerification = User & {
|
|
43
|
+
phoneVerificationToken?: string;
|
|
44
|
+
phoneVerificationTokenExpires?: Date;
|
|
45
|
+
};
|
|
46
|
+
export type UserForLogin = User & {
|
|
47
|
+
hashedPassword: string;
|
|
48
|
+
};
|
|
49
|
+
export type UpdateUserDto = Partial<Omit<User, "id" | "created_at" | "updated_at"> & {
|
|
50
|
+
password?: string;
|
|
51
|
+
}>;
|
|
52
|
+
export type CreateUserDtoForWhatsApp = Omit<User, "id" | "created_at" | "updated_at" | "emailVerified" | "phoneVerified" | "isBlocked" | "email" | "whatsappId"> & {
|
|
53
|
+
whatsappId: string;
|
|
54
|
+
};
|
|
55
|
+
export type CreateUserDtoForWebApp = Omit<User, "id" | "created_at" | "updated_at" | "emailVerified" | "phoneVerified" | "isBlocked" | "whatsappId"> & {
|
|
56
|
+
password: string;
|
|
57
|
+
};
|
|
58
|
+
export type CreateUserDto = CreateUserDtoForWebApp | CreateUserDtoForWhatsApp;
|
|
59
|
+
export type UserDTO = Omit<User, "id" | "created_at" | "updated_at"> & {
|
|
60
|
+
sessionId: string;
|
|
61
|
+
};
|
|
62
|
+
export type UserForAdminDTO = Omit<User, "id" | "created_at" | "updated_at" | "customProps">;
|
|
63
|
+
//# sourceMappingURL=User.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"User.type.d.ts","sourceRoot":"","sources":["../../src/user/User.type.ts"],"names":[],"mappings":"AAAA,oBAAY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5
|
+
RegisteredVia["OPUN"] = "opun";
|
|
6
|
+
RegisteredVia["GSC"] = "gsc";
|
|
7
|
+
RegisteredVia["SPELLING_TOOL"] = "spelling_tool";
|
|
8
|
+
})(RegisteredVia || (RegisteredVia = {}));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type UserSession = {
|
|
2
|
+
id: number;
|
|
3
|
+
sessionId: string;
|
|
4
|
+
userId: number;
|
|
5
|
+
name: string;
|
|
6
|
+
email?: string;
|
|
7
|
+
phone?: string;
|
|
8
|
+
whatsappId?: string;
|
|
9
|
+
created_at: Date;
|
|
10
|
+
updated_at: Date;
|
|
11
|
+
};
|
|
12
|
+
export type CreateUserSessionDTO = {
|
|
13
|
+
userId: number;
|
|
14
|
+
name: string;
|
|
15
|
+
sessionId: string;
|
|
16
|
+
email?: string;
|
|
17
|
+
phone?: string;
|
|
18
|
+
whatsappId?: string;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=UserSession.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserSession.type.d.ts","sourceRoot":"","sources":["../../src/user/UserSession.type.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,IAAI,CAAA;IAChB,UAAU,EAAE,IAAI,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ei-dev-shared",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Shared components for EnAble India Projects",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/enableindia-blr/ei-dev-shared.git"
|
|
8
|
+
},
|
|
9
|
+
"type": "module",
|
|
10
|
+
"main": "dist/index.cjs",
|
|
11
|
+
"module": "dist/index.js",
|
|
12
|
+
"types": "dist/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
"import": "./dist/index.js",
|
|
15
|
+
"require": "./dist/index.cjs"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc && tsc --project tsconfig.cjs.json && mv dist/cjs/index.js dist/index.cjs"
|
|
22
|
+
},
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"author": {
|
|
25
|
+
"name": "Mridul Dudeja"
|
|
26
|
+
},
|
|
27
|
+
"keywords": [
|
|
28
|
+
"ei",
|
|
29
|
+
"enable",
|
|
30
|
+
"india",
|
|
31
|
+
"shared",
|
|
32
|
+
"components"
|
|
33
|
+
],
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"typescript": "^5.7.2"
|
|
36
|
+
},
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public"
|
|
39
|
+
}
|
|
40
|
+
}
|