@runnerpro/backend 1.0.17 → 1.0.19
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/lib/cjs/db/index.js +13 -7
- package/lib/cjs/err/index.js +1 -0
- package/lib/cjs/fetch/fetchIA.js +10 -7
- package/lib/cjs/sendMail/index.js +8 -9
- package/lib/cjs/sendNotification/index.js +10 -7
- package/lib/cjs/translation/index.js +22 -8
- package/lib/cjs/types/db/index.d.ts +1 -1
- package/lib/cjs/types/db/index.d.ts.map +1 -1
- package/lib/cjs/types/err/index.d.ts.map +1 -1
- package/lib/cjs/types/fetch/fetchIA.d.ts.map +1 -1
- package/lib/cjs/types/sendMail/index.d.ts +1 -1
- package/lib/cjs/types/sendMail/index.d.ts.map +1 -1
- package/lib/cjs/types/sendNotification/index.d.ts +1 -1
- package/lib/cjs/types/sendNotification/index.d.ts.map +1 -1
- package/lib/cjs/types/translation/index.d.ts +2 -2
- package/lib/cjs/types/translation/index.d.ts.map +1 -1
- package/package.json +19 -9
package/lib/cjs/db/index.js
CHANGED
|
@@ -8,10 +8,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.batchQuery = exports.query = void 0;
|
|
13
|
-
const
|
|
14
|
-
const { Pool } =
|
|
16
|
+
const pg_1 = __importDefault(require("pg"));
|
|
17
|
+
const { Pool } = pg_1.default;
|
|
15
18
|
const pool = new Pool({
|
|
16
19
|
user: process.env.DB_USER,
|
|
17
20
|
database: process.env.DB_NAME,
|
|
@@ -19,15 +22,18 @@ const pool = new Pool({
|
|
|
19
22
|
host: process.env.DB_HOST,
|
|
20
23
|
port: 5432,
|
|
21
24
|
});
|
|
22
|
-
const query = (
|
|
25
|
+
const query = (queryText, values = []) => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
26
|
const client = yield pool.connect();
|
|
24
|
-
const text = getParseQuery(
|
|
27
|
+
const text = getParseQuery(queryText, values);
|
|
25
28
|
const result = yield client.query({
|
|
29
|
+
// @ts-ignore
|
|
26
30
|
rowMode: 'json',
|
|
27
31
|
text,
|
|
32
|
+
// @ts-ignore
|
|
28
33
|
values: values.flat(),
|
|
29
34
|
});
|
|
30
35
|
client.release();
|
|
36
|
+
// @ts-ignore
|
|
31
37
|
return (result.rows || []).map((row) => {
|
|
32
38
|
const json = Object.keys(row);
|
|
33
39
|
const aux = {};
|
|
@@ -39,9 +45,9 @@ const query = (query, values = []) => __awaiter(void 0, void 0, void 0, function
|
|
|
39
45
|
});
|
|
40
46
|
});
|
|
41
47
|
exports.query = query;
|
|
42
|
-
function getParseQuery(
|
|
43
|
-
|
|
44
|
-
const splitted =
|
|
48
|
+
function getParseQuery(queryText, values) {
|
|
49
|
+
queryText = queryText.split('[').join('"').split(']').join('"');
|
|
50
|
+
const splitted = queryText.split('?');
|
|
45
51
|
let count = 1;
|
|
46
52
|
return splitted.reduce((acc, chunk, i) => {
|
|
47
53
|
if (!(values[i] instanceof Array)) {
|
package/lib/cjs/err/index.js
CHANGED
package/lib/cjs/fetch/fetchIA.js
CHANGED
|
@@ -8,13 +8,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.fetchIA = void 0;
|
|
13
|
-
const
|
|
14
|
-
const
|
|
16
|
+
const axios_1 = __importDefault(require("axios"));
|
|
17
|
+
const index_1 = require("../err/index");
|
|
15
18
|
const fetchIA = {
|
|
16
19
|
get: (url, params, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
|
-
return
|
|
20
|
+
return axios_1.default
|
|
18
21
|
.get(`${process.env.BACKEND_IA_URL}${!!(options === null || options === void 0 ? void 0 : options.exposed) ? '/exposed' : '/api'}${url}`, Object.assign({ params, headers: {
|
|
19
22
|
'ngrok-skip-browser-warning': true, // working with ngrok
|
|
20
23
|
'Content-Type': 'application/json',
|
|
@@ -24,7 +27,7 @@ const fetchIA = {
|
|
|
24
27
|
.catch((error) => catchAxios(error, !!(options === null || options === void 0 ? void 0 : options.bypassStatus), url));
|
|
25
28
|
}),
|
|
26
29
|
post: (url, body, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
27
|
-
return
|
|
30
|
+
return axios_1.default
|
|
28
31
|
.post(`${process.env.BACKEND_IA_URL}${!!(options === null || options === void 0 ? void 0 : options.exposed) ? '/exposed' : '/api'}${url}`, body, {
|
|
29
32
|
headers: {
|
|
30
33
|
'ngrok-skip-browser-warning': true, // working with ngrok
|
|
@@ -36,7 +39,7 @@ const fetchIA = {
|
|
|
36
39
|
.catch((error) => catchAxios(error, !!(options === null || options === void 0 ? void 0 : options.bypassStatus), url));
|
|
37
40
|
}),
|
|
38
41
|
put: (url, body, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
39
|
-
return
|
|
42
|
+
return axios_1.default
|
|
40
43
|
.put(`${process.env.BACKEND_IA_URL}${!!(options === null || options === void 0 ? void 0 : options.exposed) ? '/exposed' : '/api'}${url}`, JSON.stringify(body), {
|
|
41
44
|
headers: {
|
|
42
45
|
'ngrok-skip-browser-warning': true, // working with ngrok
|
|
@@ -48,7 +51,7 @@ const fetchIA = {
|
|
|
48
51
|
.catch((error) => catchAxios(error, !!(options === null || options === void 0 ? void 0 : options.bypassStatus), url));
|
|
49
52
|
}),
|
|
50
53
|
delete: (url, body, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
51
|
-
return
|
|
54
|
+
return axios_1.default
|
|
52
55
|
.delete(`${process.env.BACKEND_IA_URL}${!!(options === null || options === void 0 ? void 0 : options.exposed) ? '/exposed' : '/api'}${url}`, {
|
|
53
56
|
data: body,
|
|
54
57
|
headers: {
|
|
@@ -66,5 +69,5 @@ function catchAxios(error, bypassStatus, url) {
|
|
|
66
69
|
var _a, _b;
|
|
67
70
|
if (bypassStatus)
|
|
68
71
|
return error.response;
|
|
69
|
-
|
|
72
|
+
(0, index_1.err)(url, (_a = error.response) === null || _a === void 0 ? void 0 : _a.status, (_b = error.response) === null || _b === void 0 ? void 0 : _b.data);
|
|
70
73
|
}
|
|
@@ -8,26 +8,25 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.sendMail = void 0;
|
|
13
|
-
const
|
|
14
|
-
const transporter =
|
|
16
|
+
const nodemailer_1 = __importDefault(require("nodemailer"));
|
|
17
|
+
const transporter = nodemailer_1.default.createTransport({
|
|
15
18
|
service: 'gmail',
|
|
16
19
|
auth: {
|
|
17
20
|
user: process.env.GMAIL_EMAIL_USER,
|
|
18
21
|
pass: process.env.GMAIL_EMAIL_PWD,
|
|
19
22
|
},
|
|
20
23
|
});
|
|
21
|
-
const sendMail = ({ subject, title, body, to, link, attachments, bcc
|
|
24
|
+
const sendMail = ({ subject, title, body, to, link, attachments, bcc }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
22
25
|
const bodyHTML = getBodyHTML(title, body, link);
|
|
23
26
|
return transporter.sendMail({
|
|
24
27
|
from: process.env.GMAIL_EMAIL_USER,
|
|
25
|
-
to: process.env.NODE_ENV === 'PROD'
|
|
26
|
-
|
|
27
|
-
: process.env.GMAIL_EMAIL_USER,
|
|
28
|
-
bcc: process.env.NODE_ENV === 'PROD' && bcc
|
|
29
|
-
? bcc.map((correo) => correo).join(',')
|
|
30
|
-
: '',
|
|
28
|
+
to: process.env.NODE_ENV === 'PROD' ? to.map((correo) => correo).join(',') : process.env.GMAIL_EMAIL_USER,
|
|
29
|
+
bcc: process.env.NODE_ENV === 'PROD' && bcc ? bcc.map((correo) => correo).join(',') : '',
|
|
31
30
|
subject,
|
|
32
31
|
text: body + (link ? link.url : ''),
|
|
33
32
|
html: bodyHTML,
|
|
@@ -8,12 +8,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.sendNotification = void 0;
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const sendNotification = ({ firebaseMessaging, idCliente, title, body, url
|
|
16
|
-
const devices = yield query('SELECT [SUBSCRIPTION], [TYPE] FROM [PUSH MANAGER] WHERE [ID CLIENTE] = ?', [idCliente]);
|
|
16
|
+
const node_apn_1 = __importDefault(require("@parse/node-apn"));
|
|
17
|
+
const index_1 = require("../db/index");
|
|
18
|
+
const sendNotification = ({ firebaseMessaging, idCliente, title, body, url }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
+
const devices = yield (0, index_1.query)('SELECT [SUBSCRIPTION], [TYPE] FROM [PUSH MANAGER] WHERE [ID CLIENTE] = ?', [idCliente]);
|
|
17
20
|
for (const device of devices) {
|
|
18
21
|
if (device.type === 'IOS') {
|
|
19
22
|
notificationIOS({
|
|
@@ -33,7 +36,7 @@ const sendNotification = ({ firebaseMessaging, idCliente, title, body, url, }) =
|
|
|
33
36
|
exports.sendNotification = sendNotification;
|
|
34
37
|
function notificationIOS(msg, token) {
|
|
35
38
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
|
|
39
|
+
const options = {
|
|
37
40
|
token: {
|
|
38
41
|
key: 'env/apple_notification.p8',
|
|
39
42
|
keyId: 'B7CYLPUCAM',
|
|
@@ -41,8 +44,8 @@ function notificationIOS(msg, token) {
|
|
|
41
44
|
},
|
|
42
45
|
production: true,
|
|
43
46
|
};
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
const apnProvider = new node_apn_1.default.Provider(options);
|
|
48
|
+
const note = new node_apn_1.default.Notification();
|
|
46
49
|
note.expiry = Math.floor(Date.now() / 1000) + 3600 * 24; // Expires 24 hour from now.
|
|
47
50
|
note.alert = {
|
|
48
51
|
title: 'RunnerPro',
|
|
@@ -8,16 +8,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.useTranslation = exports.translate = exports.LANGUAGES = void 0;
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
exports
|
|
16
|
-
const
|
|
17
|
-
const translate = (text, { fromLanguage, toLanguage
|
|
16
|
+
const translate_1 = require("@google-cloud/translate");
|
|
17
|
+
const common_1 = require("@runnerpro/common");
|
|
18
|
+
Object.defineProperty(exports, "LANGUAGES", { enumerable: true, get: function () { return common_1.LANGUAGES; } });
|
|
19
|
+
const fs_1 = __importDefault(require("fs"));
|
|
20
|
+
const translate = (text, { fromLanguage, toLanguage }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
21
|
const projectId = process.env.GCP_PROYECT_ID;
|
|
19
22
|
const location = 'global';
|
|
20
|
-
const translationClient = new TranslationServiceClient();
|
|
23
|
+
const translationClient = new translate_1.TranslationServiceClient();
|
|
21
24
|
const request = {
|
|
22
25
|
parent: `projects/${projectId}/locations/${location}`,
|
|
23
26
|
contents: [text],
|
|
@@ -25,11 +28,15 @@ const translate = (text, { fromLanguage, toLanguage, }) => __awaiter(void 0, voi
|
|
|
25
28
|
sourceLanguageCode: fromLanguage,
|
|
26
29
|
targetLanguageCode: toLanguage,
|
|
27
30
|
};
|
|
31
|
+
// @ts-ignore
|
|
28
32
|
const [response] = yield translationClient.translateText(request);
|
|
33
|
+
// @ts-ignore
|
|
29
34
|
const translatedText = response.translations[0].translatedText;
|
|
30
35
|
// If the first letter of original text is uppercase, the translated text will be uppercase
|
|
36
|
+
// @ts-ignore
|
|
31
37
|
if (text[0] === text[0].toUpperCase())
|
|
32
38
|
return translatedText[0].toUpperCase() + translatedText.slice(1);
|
|
39
|
+
// @ts-ignore
|
|
33
40
|
else
|
|
34
41
|
return translatedText;
|
|
35
42
|
});
|
|
@@ -37,8 +44,15 @@ exports.translate = translate;
|
|
|
37
44
|
const useTranslation = (language, path) => {
|
|
38
45
|
return {
|
|
39
46
|
t: (text, interpolation) => {
|
|
40
|
-
|
|
41
|
-
|
|
47
|
+
let fileContent;
|
|
48
|
+
try {
|
|
49
|
+
const filePath = './src/locales' + path + '/' + language + '.json';
|
|
50
|
+
fileContent = JSON.parse(fs_1.default.readFileSync(filePath, 'utf8'));
|
|
51
|
+
}
|
|
52
|
+
catch (_a) {
|
|
53
|
+
const filePath = './src/locales' + path + '/' + common_1.LANGUAGES.EN + '.json';
|
|
54
|
+
fileContent = JSON.parse(fs_1.default.readFileSync(filePath, 'utf8'));
|
|
55
|
+
}
|
|
42
56
|
let translatedText = fileContent[text];
|
|
43
57
|
if (interpolation) {
|
|
44
58
|
Object.keys(interpolation).forEach((key) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const query: (
|
|
1
|
+
declare const query: (queryText: string, values?: (string | number | boolean)[]) => Promise<any>;
|
|
2
2
|
declare const batchQuery: (queries: any, length?: number) => Promise<void>;
|
|
3
3
|
export { query, batchQuery };
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/db/index.ts"],"names":[],"mappings":"AAYA,QAAA,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/db/index.ts"],"names":[],"mappings":"AAYA,QAAA,MAAM,KAAK,cAAqB,MAAM,WAAU,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,EAAE,iBAsB5E,CAAC;AA+BF,QAAA,MAAM,UAAU,YAAmB,GAAG,mCAUrC,CAAC;AAEF,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/err/index.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,GAAG,QAAS,GAAG,OAAO,GAAG,SAAS,GAAG,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/err/index.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,GAAG,QAAS,GAAG,OAAO,GAAG,SAAS,GAAG,SAG1C,CAAC;AAEF,OAAO,EAAE,GAAG,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchIA.d.ts","sourceRoot":"","sources":["../../../../src/fetch/fetchIA.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,OAAO;eACM,MAAM,UAAU,GAAG,WAAW,GAAG;
|
|
1
|
+
{"version":3,"file":"fetchIA.d.ts","sourceRoot":"","sources":["../../../../src/fetch/fetchIA.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,OAAO;eACM,MAAM,UAAU,GAAG,WAAW,GAAG;gBAchC,MAAM,QAAQ,GAAG,WAAW,GAAG;eAYhC,MAAM,QAAQ,GAAG,WAAW,GAAG;kBAY5B,MAAM,QAAQ,GAAG,WAAW,GAAG;CAapD,CAAC;AAOF,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -14,6 +14,6 @@ interface Mail {
|
|
|
14
14
|
}[];
|
|
15
15
|
bcc?: string[];
|
|
16
16
|
}
|
|
17
|
-
declare const sendMail: ({ subject, title, body, to, link, attachments, bcc
|
|
17
|
+
declare const sendMail: ({ subject, title, body, to, link, attachments, bcc }: Mail) => Promise<import("nodemailer/lib/smtp-transport").SentMessageInfo>;
|
|
18
18
|
export { sendMail };
|
|
19
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/sendMail/index.ts"],"names":[],"mappings":"AAUA,UAAU,IAAI;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,EAAE,CAAC;IACb,IAAI,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACrC,WAAW,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACjE,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,QAAA,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/sendMail/index.ts"],"names":[],"mappings":"AAUA,UAAU,IAAI;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,EAAE,CAAC;IACb,IAAI,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACrC,WAAW,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACjE,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,QAAA,MAAM,QAAQ,yDAAgE,IAAI,qEAkBjF,CAAC;AA2EF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -5,6 +5,6 @@ interface Notification {
|
|
|
5
5
|
body: string;
|
|
6
6
|
url: string;
|
|
7
7
|
}
|
|
8
|
-
declare const sendNotification: ({ firebaseMessaging, idCliente, title, body, url
|
|
8
|
+
declare const sendNotification: ({ firebaseMessaging, idCliente, title, body, url }: Notification) => Promise<void>;
|
|
9
9
|
export { sendNotification };
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/sendNotification/index.ts"],"names":[],"mappings":"AAGA,UAAU,YAAY;IACpB,iBAAiB,EAAE,GAAG,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED,QAAA,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/sendNotification/index.ts"],"names":[],"mappings":"AAGA,UAAU,YAAY;IACpB,iBAAiB,EAAE,GAAG,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED,QAAA,MAAM,gBAAgB,uDAA8D,YAAY,kBAwB/F,CAAC;AA4CF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { LANGUAGES } from '@runnerpro/common';
|
|
2
2
|
type LANGUAGES_TYPE = keyof typeof LANGUAGES;
|
|
3
|
-
declare const translate: (text: string, { fromLanguage, toLanguage
|
|
3
|
+
declare const translate: (text: string, { fromLanguage, toLanguage }: {
|
|
4
4
|
fromLanguage: LANGUAGES_TYPE;
|
|
5
5
|
toLanguage: LANGUAGES_TYPE;
|
|
6
6
|
}) => Promise<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/translation/index.ts"],"names":[],"mappings":"AACA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/translation/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAG9C,KAAK,cAAc,GAAG,MAAM,OAAO,SAAS,CAAC;AAE7C,QAAA,MAAM,SAAS,SACP,MAAM;kBACkC,cAAc;gBAAc,cAAc;MACvF,QAAQ,MAAM,CAwBhB,CAAC;AAEF,QAAA,MAAM,cAAc,aAAc,MAAM,QAAQ,MAAM;cAExC,MAAM,iBAAiB,GAAG;CAkBvC,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runnerpro/backend",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.19",
|
|
4
4
|
"description": "A collection of common backend functions",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./lib/cjs/index.js"
|
|
@@ -13,10 +13,13 @@
|
|
|
13
13
|
"scripts": {
|
|
14
14
|
"clean": "del-cli ./lib",
|
|
15
15
|
"build": "npm run clean && tsc -p ./configs/tsconfig.cjs.json",
|
|
16
|
-
"test": "mocha",
|
|
17
16
|
"publish": "npm run build && npm publish",
|
|
18
17
|
"deploy": "npm run build && npm publish",
|
|
19
|
-
"semantic-release": "semantic-release"
|
|
18
|
+
"semantic-release": "semantic-release",
|
|
19
|
+
"lint": "eslint --ext .ts --ignore-path .gitignore .",
|
|
20
|
+
"format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,json,css,scss,md}\"",
|
|
21
|
+
"prepare": "husky",
|
|
22
|
+
"test": "jest"
|
|
20
23
|
},
|
|
21
24
|
"release": {
|
|
22
25
|
"branches": [
|
|
@@ -33,18 +36,25 @@
|
|
|
33
36
|
"author": "Runner Pro",
|
|
34
37
|
"license": "MIT",
|
|
35
38
|
"devDependencies": {
|
|
36
|
-
"@
|
|
37
|
-
"@types/
|
|
38
|
-
"
|
|
39
|
+
"@eslint/js": "^9.6.0",
|
|
40
|
+
"@types/eslint__js": "^8.42.3",
|
|
41
|
+
"@types/nodemailer": "^6.4.15",
|
|
42
|
+
"@types/pg": "^8.11.3",
|
|
39
43
|
"del-cli": "5.1.0",
|
|
40
|
-
"
|
|
44
|
+
"eslint": "^8.57.0",
|
|
45
|
+
"eslint-config-prettier": "^9.1.0",
|
|
46
|
+
"eslint-plugin-exception-handling": "^1.0.2",
|
|
47
|
+
"eslint-plugin-sonarjs": "^1.0.3",
|
|
48
|
+
"husky": "^9.0.11",
|
|
49
|
+
"jest": "^29.7.0",
|
|
41
50
|
"semantic-release": "23.0.2",
|
|
42
51
|
"ts-node": "10.9.2",
|
|
43
|
-
"typescript": "5.3.3"
|
|
52
|
+
"typescript": "5.3.3",
|
|
53
|
+
"typescript-eslint": "^7.15.0"
|
|
44
54
|
},
|
|
45
55
|
"peerDependencies": {
|
|
46
56
|
"@parse/node-apn": "6.0.1",
|
|
47
|
-
"@runnerpro/common": "^1.2.
|
|
57
|
+
"@runnerpro/common": "^1.2.7",
|
|
48
58
|
"axios": "^1.6.7",
|
|
49
59
|
"nodemailer": "6.9.9",
|
|
50
60
|
"pg": "8.11.3"
|