@runnerpro/backend 1.0.18 → 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.
@@ -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 postgresql = require('pg');
14
- const { Pool } = postgresql;
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 = (query, values = []) => __awaiter(void 0, void 0, void 0, function* () {
25
+ const query = (queryText, values = []) => __awaiter(void 0, void 0, void 0, function* () {
23
26
  const client = yield pool.connect();
24
- const text = getParseQuery(query, values);
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(query, values) {
43
- query = query.split('[').join('"').split(']').join('"');
44
- const splitted = query.split('?');
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)) {
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.err = void 0;
4
4
  const err = (req, res, error) => {
5
+ // eslint-disable-next-line no-console
5
6
  console.log(error);
6
7
  };
7
8
  exports.err = err;
@@ -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 axios = require('axios');
14
- const { err } = require('@runnerpro/backend');
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 axios
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 axios
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 axios
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 axios
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
- err('Error in fetchIA', url, (_a = error.response) === null || _a === void 0 ? void 0 : _a.status, (_b = error.response) === null || _b === void 0 ? void 0 : _b.data);
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 nodemailer = require('nodemailer');
14
- const transporter = nodemailer.createTransport({
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, }) => __awaiter(void 0, void 0, void 0, function* () {
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
- ? to.map((correo) => correo).join(',')
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 apn = require('@parse/node-apn');
14
- const { query } = require('../db');
15
- const sendNotification = ({ firebaseMessaging, idCliente, title, body, url, }) => __awaiter(void 0, void 0, void 0, function* () {
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
- var options = {
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
- var apnProvider = new apn.Provider(options);
45
- var note = new apn.Notification();
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 { TranslationServiceClient } = require('@google-cloud/translate');
14
- const { LANGUAGES } = require('@runnerpro/common');
15
- exports.LANGUAGES = LANGUAGES;
16
- const fs = require('fs');
17
- const translate = (text, { fromLanguage, toLanguage, }) => __awaiter(void 0, void 0, void 0, function* () {
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
  });
@@ -40,11 +47,11 @@ const useTranslation = (language, path) => {
40
47
  let fileContent;
41
48
  try {
42
49
  const filePath = './src/locales' + path + '/' + language + '.json';
43
- fileContent = JSON.parse(fs.readFileSync(filePath, 'utf8'));
50
+ fileContent = JSON.parse(fs_1.default.readFileSync(filePath, 'utf8'));
44
51
  }
45
52
  catch (_a) {
46
- const filePath = './src/locales' + path + '/' + LANGUAGES.EN + '.json';
47
- fileContent = JSON.parse(fs.readFileSync(filePath, 'utf8'));
53
+ const filePath = './src/locales' + path + '/' + common_1.LANGUAGES.EN + '.json';
54
+ fileContent = JSON.parse(fs_1.default.readFileSync(filePath, 'utf8'));
48
55
  }
49
56
  let translatedText = fileContent[text];
50
57
  if (interpolation) {
@@ -1,4 +1,4 @@
1
- declare const query: (query: string, values?: (string | number | boolean)[]) => Promise<any>;
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,UACF,MAAM,WACL,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,EAAE,iBAoBtC,CAAC;AAiCF,QAAA,MAAM,UAAU,YAAmB,GAAG,mCAUrC,CAAC;AAEF,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC"}
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,SAE1C,CAAC;AAEF,OAAO,EAAE,GAAG,EAAE,CAAC"}
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;gBAmBhC,MAAM,QAAQ,GAAG,WAAW,GAAG;eAkBhC,MAAM,QAAQ,GAAG,WAAW,GAAG;kBAkB5B,MAAM,QAAQ,GAAG,WAAW,GAAG;CAkBpD,CAAC;AAOF,OAAO,EAAE,OAAO,EAAE,CAAC"}
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, }: Mail) => Promise<any>;
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,0DAQX,IAAI,iBAwBN,CAAC;AA+EF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
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, }: Notification) => Promise<void>;
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,wDAMnB,YAAY,kBA2Bd,CAAC;AAqDF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
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
- declare const LANGUAGES: any;
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,QAAA,MAAQ,SAAS,KAAiC,CAAC;AAGnD,KAAK,cAAc,GAAG,MAAM,OAAO,SAAS,CAAC;AAE7C,QAAA,MAAM,SAAS,SACP,MAAM;kBAIO,cAAc;gBAAc,cAAc;MAC5D,QAAQ,MAAM,CAqBhB,CAAC;AAEF,QAAA,MAAM,cAAc,aAAc,MAAM,QAAQ,MAAM;cAExC,MAAM,iBAAiB,GAAG;CAqBvC,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC"}
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.18",
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,14 +36,21 @@
33
36
  "author": "Runner Pro",
34
37
  "license": "MIT",
35
38
  "devDependencies": {
36
- "@types/chai": "4.3.12",
37
- "@types/mocha": "10.0.6",
38
- "chai": "5.1.0",
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
- "mocha": "10.3.0",
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",