@runnerpro/backend 1.0.10 → 1.0.11
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 +81 -81
- package/lib/cjs/err/index.js +7 -7
- package/lib/cjs/fetch/fetchIA.js +70 -71
- package/lib/cjs/index.js +16 -16
- package/lib/cjs/sendMail/index.js +50 -50
- package/lib/cjs/sendNotification/index.js +74 -74
- package/lib/cjs/sleep/index.js +9 -9
- package/lib/cjs/types/db/index.d.ts +3 -3
- package/lib/cjs/types/err/index.d.ts +2 -2
- package/lib/cjs/types/fetch/fetchIA.d.ts +7 -7
- package/lib/cjs/types/fetch/fetchIA.d.ts.map +1 -1
- package/lib/cjs/types/index.d.ts +7 -7
- package/lib/cjs/types/sendMail/index.d.ts +18 -18
- package/lib/cjs/types/sendNotification/index.d.ts +9 -9
- package/lib/cjs/types/sleep/index.d.ts +2 -2
- package/package.json +4 -4
package/lib/cjs/db/index.js
CHANGED
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.batchQuery = exports.query = void 0;
|
|
13
|
-
const postgresql = require('pg');
|
|
14
|
-
const { Pool } = postgresql;
|
|
15
|
-
const pool = new Pool({
|
|
16
|
-
user: process.env.DB_USER,
|
|
17
|
-
database: process.env.DB_NAME,
|
|
18
|
-
password: process.env.DB_PASSWORD,
|
|
19
|
-
host: process.env.DB_HOST,
|
|
20
|
-
port: 5432,
|
|
21
|
-
});
|
|
22
|
-
const query = (query, values = []) => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
|
-
const client = yield pool.connect();
|
|
24
|
-
const text = getParseQuery(query, values);
|
|
25
|
-
const result = yield client.query({
|
|
26
|
-
rowMode: 'json',
|
|
27
|
-
text,
|
|
28
|
-
values: values.flat(),
|
|
29
|
-
});
|
|
30
|
-
client.release();
|
|
31
|
-
return (result.rows || []).map((row) => {
|
|
32
|
-
const json = Object.keys(row);
|
|
33
|
-
const aux = {};
|
|
34
|
-
json.forEach((key) => {
|
|
35
|
-
// @ts-ignore
|
|
36
|
-
aux[camelize(key)] = row[key];
|
|
37
|
-
});
|
|
38
|
-
return aux;
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
exports.query = query;
|
|
42
|
-
function getParseQuery(query, values) {
|
|
43
|
-
query = query.split('[').join('"').split(']').join('"');
|
|
44
|
-
const splitted = query.split('?');
|
|
45
|
-
let count = 1;
|
|
46
|
-
return splitted.reduce((acc, chunk, i) => {
|
|
47
|
-
if (!(values[i] instanceof Array)) {
|
|
48
|
-
const text = `${acc}${chunk}${i + 1 === splitted.length ? '' : `$${count}`}`;
|
|
49
|
-
count++;
|
|
50
|
-
return text;
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
const aux = [];
|
|
54
|
-
values[i].forEach(() => {
|
|
55
|
-
aux.push(`$${count}`);
|
|
56
|
-
count++;
|
|
57
|
-
});
|
|
58
|
-
return `${acc}${chunk}${i + 1 === splitted.length ? '' : aux.join(',')}`;
|
|
59
|
-
}
|
|
60
|
-
}, '');
|
|
61
|
-
}
|
|
62
|
-
function camelize(str) {
|
|
63
|
-
return str
|
|
64
|
-
.toLowerCase()
|
|
65
|
-
.replace(/(?:^\w|[A-Z]|\b\w)/g, function (word, index) {
|
|
66
|
-
return index === 0 ? word.toLowerCase() : word.toUpperCase();
|
|
67
|
-
})
|
|
68
|
-
.replace(/\s+/g, '');
|
|
69
|
-
}
|
|
70
|
-
const batchQuery = (queries, length = 5) => __awaiter(void 0, void 0, void 0, function* () {
|
|
71
|
-
let promises = [];
|
|
72
|
-
for (const q of queries) {
|
|
73
|
-
promises.push(query(q.query, q.values));
|
|
74
|
-
if (promises.length === length) {
|
|
75
|
-
yield Promise.all(promises);
|
|
76
|
-
promises = [];
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
yield Promise.all(promises);
|
|
80
|
-
});
|
|
81
|
-
exports.batchQuery = batchQuery;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.batchQuery = exports.query = void 0;
|
|
13
|
+
const postgresql = require('pg');
|
|
14
|
+
const { Pool } = postgresql;
|
|
15
|
+
const pool = new Pool({
|
|
16
|
+
user: process.env.DB_USER,
|
|
17
|
+
database: process.env.DB_NAME,
|
|
18
|
+
password: process.env.DB_PASSWORD,
|
|
19
|
+
host: process.env.DB_HOST,
|
|
20
|
+
port: 5432,
|
|
21
|
+
});
|
|
22
|
+
const query = (query, values = []) => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
|
+
const client = yield pool.connect();
|
|
24
|
+
const text = getParseQuery(query, values);
|
|
25
|
+
const result = yield client.query({
|
|
26
|
+
rowMode: 'json',
|
|
27
|
+
text,
|
|
28
|
+
values: values.flat(),
|
|
29
|
+
});
|
|
30
|
+
client.release();
|
|
31
|
+
return (result.rows || []).map((row) => {
|
|
32
|
+
const json = Object.keys(row);
|
|
33
|
+
const aux = {};
|
|
34
|
+
json.forEach((key) => {
|
|
35
|
+
// @ts-ignore
|
|
36
|
+
aux[camelize(key)] = row[key];
|
|
37
|
+
});
|
|
38
|
+
return aux;
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
exports.query = query;
|
|
42
|
+
function getParseQuery(query, values) {
|
|
43
|
+
query = query.split('[').join('"').split(']').join('"');
|
|
44
|
+
const splitted = query.split('?');
|
|
45
|
+
let count = 1;
|
|
46
|
+
return splitted.reduce((acc, chunk, i) => {
|
|
47
|
+
if (!(values[i] instanceof Array)) {
|
|
48
|
+
const text = `${acc}${chunk}${i + 1 === splitted.length ? '' : `$${count}`}`;
|
|
49
|
+
count++;
|
|
50
|
+
return text;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
const aux = [];
|
|
54
|
+
values[i].forEach(() => {
|
|
55
|
+
aux.push(`$${count}`);
|
|
56
|
+
count++;
|
|
57
|
+
});
|
|
58
|
+
return `${acc}${chunk}${i + 1 === splitted.length ? '' : aux.join(',')}`;
|
|
59
|
+
}
|
|
60
|
+
}, '');
|
|
61
|
+
}
|
|
62
|
+
function camelize(str) {
|
|
63
|
+
return str
|
|
64
|
+
.toLowerCase()
|
|
65
|
+
.replace(/(?:^\w|[A-Z]|\b\w)/g, function (word, index) {
|
|
66
|
+
return index === 0 ? word.toLowerCase() : word.toUpperCase();
|
|
67
|
+
})
|
|
68
|
+
.replace(/\s+/g, '');
|
|
69
|
+
}
|
|
70
|
+
const batchQuery = (queries, length = 5) => __awaiter(void 0, void 0, void 0, function* () {
|
|
71
|
+
let promises = [];
|
|
72
|
+
for (const q of queries) {
|
|
73
|
+
promises.push(query(q.query, q.values));
|
|
74
|
+
if (promises.length === length) {
|
|
75
|
+
yield Promise.all(promises);
|
|
76
|
+
promises = [];
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
yield Promise.all(promises);
|
|
80
|
+
});
|
|
81
|
+
exports.batchQuery = batchQuery;
|
package/lib/cjs/err/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.err = void 0;
|
|
4
|
-
const err = (req, res, error) => {
|
|
5
|
-
console.log(error);
|
|
6
|
-
};
|
|
7
|
-
exports.err = err;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.err = void 0;
|
|
4
|
+
const err = (req, res, error) => {
|
|
5
|
+
console.log(error);
|
|
6
|
+
};
|
|
7
|
+
exports.err = err;
|
package/lib/cjs/fetch/fetchIA.js
CHANGED
|
@@ -1,71 +1,70 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.fetchIA = void 0;
|
|
13
|
-
const axios = require('axios');
|
|
14
|
-
const { err } = require('@runnerpro/backend');
|
|
15
|
-
const fetchIA = {
|
|
16
|
-
get: (url, params, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
|
-
return axios
|
|
18
|
-
.get(`${process.env.BACKEND_IA_URL}${!!(options === null || options === void 0 ? void 0 : options.exposed) ? '/exposed' : '/api'}${url}`, Object.assign({ params, headers: {
|
|
19
|
-
'ngrok-skip-browser-warning': true,
|
|
20
|
-
'Content-Type': 'application/json',
|
|
21
|
-
Authorization: `Bearer ${process.env.IA_ACCESS_TOKEN}`,
|
|
22
|
-
} }, options === null || options === void 0 ? void 0 : options.extra))
|
|
23
|
-
.then(({ data }) => data)
|
|
24
|
-
.catch((error) => catchAxios(error, !!(options === null || options === void 0 ? void 0 : options.bypassStatus), url));
|
|
25
|
-
}),
|
|
26
|
-
post: (url, body, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
27
|
-
return axios
|
|
28
|
-
.post(`${process.env.BACKEND_IA_URL}${!!(options === null || options === void 0 ? void 0 : options.exposed) ? '/exposed' : '/api'}${url}`, body, {
|
|
29
|
-
headers: {
|
|
30
|
-
'ngrok-skip-browser-warning': true,
|
|
31
|
-
'Content-Type': 'application/json',
|
|
32
|
-
Authorization: `Bearer ${process.env.IA_ACCESS_TOKEN}`,
|
|
33
|
-
},
|
|
34
|
-
})
|
|
35
|
-
.then(({ data }) => data)
|
|
36
|
-
.catch((error) => catchAxios(error, !!(options === null || options === void 0 ? void 0 : options.bypassStatus), url));
|
|
37
|
-
}),
|
|
38
|
-
put: (url, body, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
39
|
-
return axios
|
|
40
|
-
.put(`${process.env.BACKEND_IA_URL}${!!(options === null || options === void 0 ? void 0 : options.exposed) ? '/exposed' : '/api'}${url}`, JSON.stringify(body), {
|
|
41
|
-
headers: {
|
|
42
|
-
'ngrok-skip-browser-warning': true,
|
|
43
|
-
'Content-Type': 'application/json',
|
|
44
|
-
Authorization: `Bearer ${process.env.IA_ACCESS_TOKEN}`,
|
|
45
|
-
},
|
|
46
|
-
})
|
|
47
|
-
.then(({ data }) => data)
|
|
48
|
-
.catch((error) => catchAxios(error, !!(options === null || options === void 0 ? void 0 : options.bypassStatus), url));
|
|
49
|
-
}),
|
|
50
|
-
delete: (url, body, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
51
|
-
return axios
|
|
52
|
-
.delete(`${process.env.BACKEND_IA_URL}${!!(options === null || options === void 0 ? void 0 : options.exposed) ? '/exposed' : '/api'}${url}`, {
|
|
53
|
-
data: body,
|
|
54
|
-
headers: {
|
|
55
|
-
'ngrok-skip-browser-warning': true,
|
|
56
|
-
'Content-Type': 'application/json',
|
|
57
|
-
Authorization: `Bearer ${process.env.IA_ACCESS_TOKEN}`,
|
|
58
|
-
},
|
|
59
|
-
})
|
|
60
|
-
.then(({ data }) => data)
|
|
61
|
-
.catch((error) => catchAxios(error, !!(options === null || options === void 0 ? void 0 : options.bypassStatus), url));
|
|
62
|
-
}),
|
|
63
|
-
};
|
|
64
|
-
exports.fetchIA = fetchIA;
|
|
65
|
-
function catchAxios(error, bypassStatus, url) {
|
|
66
|
-
var _a, _b;
|
|
67
|
-
if (bypassStatus)
|
|
68
|
-
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);
|
|
70
|
-
|
|
71
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.fetchIA = void 0;
|
|
13
|
+
const axios = require('axios');
|
|
14
|
+
const { err } = require('@runnerpro/backend');
|
|
15
|
+
const fetchIA = {
|
|
16
|
+
get: (url, params, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
|
+
return axios
|
|
18
|
+
.get(`${process.env.BACKEND_IA_URL}${!!(options === null || options === void 0 ? void 0 : options.exposed) ? '/exposed' : '/api'}${url}`, Object.assign({ params, headers: {
|
|
19
|
+
'ngrok-skip-browser-warning': true, // working with ngrok
|
|
20
|
+
'Content-Type': 'application/json',
|
|
21
|
+
Authorization: `Bearer ${process.env.IA_ACCESS_TOKEN}`,
|
|
22
|
+
} }, options === null || options === void 0 ? void 0 : options.extra))
|
|
23
|
+
.then(({ data }) => data)
|
|
24
|
+
.catch((error) => catchAxios(error, !!(options === null || options === void 0 ? void 0 : options.bypassStatus), url));
|
|
25
|
+
}),
|
|
26
|
+
post: (url, body, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
27
|
+
return axios
|
|
28
|
+
.post(`${process.env.BACKEND_IA_URL}${!!(options === null || options === void 0 ? void 0 : options.exposed) ? '/exposed' : '/api'}${url}`, body, {
|
|
29
|
+
headers: {
|
|
30
|
+
'ngrok-skip-browser-warning': true, // working with ngrok
|
|
31
|
+
'Content-Type': 'application/json',
|
|
32
|
+
Authorization: `Bearer ${process.env.IA_ACCESS_TOKEN}`,
|
|
33
|
+
},
|
|
34
|
+
})
|
|
35
|
+
.then(({ data }) => data)
|
|
36
|
+
.catch((error) => catchAxios(error, !!(options === null || options === void 0 ? void 0 : options.bypassStatus), url));
|
|
37
|
+
}),
|
|
38
|
+
put: (url, body, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
39
|
+
return axios
|
|
40
|
+
.put(`${process.env.BACKEND_IA_URL}${!!(options === null || options === void 0 ? void 0 : options.exposed) ? '/exposed' : '/api'}${url}`, JSON.stringify(body), {
|
|
41
|
+
headers: {
|
|
42
|
+
'ngrok-skip-browser-warning': true, // working with ngrok
|
|
43
|
+
'Content-Type': 'application/json',
|
|
44
|
+
Authorization: `Bearer ${process.env.IA_ACCESS_TOKEN}`,
|
|
45
|
+
},
|
|
46
|
+
})
|
|
47
|
+
.then(({ data }) => data)
|
|
48
|
+
.catch((error) => catchAxios(error, !!(options === null || options === void 0 ? void 0 : options.bypassStatus), url));
|
|
49
|
+
}),
|
|
50
|
+
delete: (url, body, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
51
|
+
return axios
|
|
52
|
+
.delete(`${process.env.BACKEND_IA_URL}${!!(options === null || options === void 0 ? void 0 : options.exposed) ? '/exposed' : '/api'}${url}`, {
|
|
53
|
+
data: body,
|
|
54
|
+
headers: {
|
|
55
|
+
'ngrok-skip-browser-warning': true, // working with ngrok
|
|
56
|
+
'Content-Type': 'application/json',
|
|
57
|
+
Authorization: `Bearer ${process.env.IA_ACCESS_TOKEN}`,
|
|
58
|
+
},
|
|
59
|
+
})
|
|
60
|
+
.then(({ data }) => data)
|
|
61
|
+
.catch((error) => catchAxios(error, !!(options === null || options === void 0 ? void 0 : options.bypassStatus), url));
|
|
62
|
+
}),
|
|
63
|
+
};
|
|
64
|
+
exports.fetchIA = fetchIA;
|
|
65
|
+
function catchAxios(error, bypassStatus, url) {
|
|
66
|
+
var _a, _b;
|
|
67
|
+
if (bypassStatus)
|
|
68
|
+
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);
|
|
70
|
+
}
|
package/lib/cjs/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchIA = exports.err = exports.sendMail = exports.batchQuery = exports.query = exports.sleep = exports.sendNotification = void 0;
|
|
4
|
-
const sendNotification_1 = require("./sendNotification");
|
|
5
|
-
Object.defineProperty(exports, "sendNotification", { enumerable: true, get: function () { return sendNotification_1.sendNotification; } });
|
|
6
|
-
const sleep_1 = require("./sleep");
|
|
7
|
-
Object.defineProperty(exports, "sleep", { enumerable: true, get: function () { return sleep_1.sleep; } });
|
|
8
|
-
const db_1 = require("./db");
|
|
9
|
-
Object.defineProperty(exports, "query", { enumerable: true, get: function () { return db_1.query; } });
|
|
10
|
-
Object.defineProperty(exports, "batchQuery", { enumerable: true, get: function () { return db_1.batchQuery; } });
|
|
11
|
-
const sendMail_1 = require("./sendMail");
|
|
12
|
-
Object.defineProperty(exports, "sendMail", { enumerable: true, get: function () { return sendMail_1.sendMail; } });
|
|
13
|
-
const err_1 = require("./err");
|
|
14
|
-
Object.defineProperty(exports, "err", { enumerable: true, get: function () { return err_1.err; } });
|
|
15
|
-
const fetchIA_1 = require("./fetch/fetchIA");
|
|
16
|
-
Object.defineProperty(exports, "fetchIA", { enumerable: true, get: function () { return fetchIA_1.fetchIA; } });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchIA = exports.err = exports.sendMail = exports.batchQuery = exports.query = exports.sleep = exports.sendNotification = void 0;
|
|
4
|
+
const sendNotification_1 = require("./sendNotification");
|
|
5
|
+
Object.defineProperty(exports, "sendNotification", { enumerable: true, get: function () { return sendNotification_1.sendNotification; } });
|
|
6
|
+
const sleep_1 = require("./sleep");
|
|
7
|
+
Object.defineProperty(exports, "sleep", { enumerable: true, get: function () { return sleep_1.sleep; } });
|
|
8
|
+
const db_1 = require("./db");
|
|
9
|
+
Object.defineProperty(exports, "query", { enumerable: true, get: function () { return db_1.query; } });
|
|
10
|
+
Object.defineProperty(exports, "batchQuery", { enumerable: true, get: function () { return db_1.batchQuery; } });
|
|
11
|
+
const sendMail_1 = require("./sendMail");
|
|
12
|
+
Object.defineProperty(exports, "sendMail", { enumerable: true, get: function () { return sendMail_1.sendMail; } });
|
|
13
|
+
const err_1 = require("./err");
|
|
14
|
+
Object.defineProperty(exports, "err", { enumerable: true, get: function () { return err_1.err; } });
|
|
15
|
+
const fetchIA_1 = require("./fetch/fetchIA");
|
|
16
|
+
Object.defineProperty(exports, "fetchIA", { enumerable: true, get: function () { return fetchIA_1.fetchIA; } });
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.sendMail = void 0;
|
|
13
|
-
const nodemailer = require('nodemailer');
|
|
14
|
-
const path = require('path');
|
|
15
|
-
const transporter = nodemailer.createTransport({
|
|
16
|
-
service: 'gmail',
|
|
17
|
-
auth: {
|
|
18
|
-
user: process.env.GMAIL_EMAIL_USER,
|
|
19
|
-
pass: process.env.GMAIL_EMAIL_PWD,
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
const sendMail = ({ subject, title, body, to, link, attachments, bcc, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
|
-
const bodyHTML = getBodyHTML(title, body, link);
|
|
24
|
-
return transporter.sendMail({
|
|
25
|
-
from: process.env.GMAIL_EMAIL_USER,
|
|
26
|
-
to: process.env.NODE_ENV === 'PROD'
|
|
27
|
-
? to.map((correo) => correo).join(',')
|
|
28
|
-
: process.env.GMAIL_EMAIL_USER,
|
|
29
|
-
bcc: process.env.NODE_ENV === 'PROD' && bcc
|
|
30
|
-
? bcc.map((correo) => correo).join(',')
|
|
31
|
-
: '',
|
|
32
|
-
subject,
|
|
33
|
-
text: body + (link ? link.url : ''),
|
|
34
|
-
html: bodyHTML,
|
|
35
|
-
attachments: [
|
|
36
|
-
...(attachments || []),
|
|
37
|
-
{
|
|
38
|
-
filename: 'logo-large.png',
|
|
39
|
-
path: 'https://storage.googleapis.com/assets_runnerpro/logo-large.png',
|
|
40
|
-
cid: 'logo',
|
|
41
|
-
},
|
|
42
|
-
],
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
exports.sendMail = sendMail;
|
|
46
|
-
function getBodyHTML(title, body, link) {
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.sendMail = void 0;
|
|
13
|
+
const nodemailer = require('nodemailer');
|
|
14
|
+
const path = require('path');
|
|
15
|
+
const transporter = nodemailer.createTransport({
|
|
16
|
+
service: 'gmail',
|
|
17
|
+
auth: {
|
|
18
|
+
user: process.env.GMAIL_EMAIL_USER,
|
|
19
|
+
pass: process.env.GMAIL_EMAIL_PWD,
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
const sendMail = ({ subject, title, body, to, link, attachments, bcc, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
|
+
const bodyHTML = getBodyHTML(title, body, link);
|
|
24
|
+
return transporter.sendMail({
|
|
25
|
+
from: process.env.GMAIL_EMAIL_USER,
|
|
26
|
+
to: process.env.NODE_ENV === 'PROD'
|
|
27
|
+
? to.map((correo) => correo).join(',')
|
|
28
|
+
: process.env.GMAIL_EMAIL_USER,
|
|
29
|
+
bcc: process.env.NODE_ENV === 'PROD' && bcc
|
|
30
|
+
? bcc.map((correo) => correo).join(',')
|
|
31
|
+
: '',
|
|
32
|
+
subject,
|
|
33
|
+
text: body + (link ? link.url : ''),
|
|
34
|
+
html: bodyHTML,
|
|
35
|
+
attachments: [
|
|
36
|
+
...(attachments || []),
|
|
37
|
+
{
|
|
38
|
+
filename: 'logo-large.png',
|
|
39
|
+
path: 'https://storage.googleapis.com/assets_runnerpro/logo-large.png',
|
|
40
|
+
cid: 'logo',
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
exports.sendMail = sendMail;
|
|
46
|
+
function getBodyHTML(title, body, link) {
|
|
47
47
|
return `
|
|
48
48
|
<html lang="es">
|
|
49
49
|
<head>
|
|
@@ -92,7 +92,7 @@ function getBodyHTML(title, body, link) {
|
|
|
92
92
|
<p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family:'Sofia Sans', 'Roboto', sans-serif;">
|
|
93
93
|
${body.split('\n').join('<br>')}
|
|
94
94
|
</p>
|
|
95
|
-
${link
|
|
95
|
+
${link
|
|
96
96
|
? `
|
|
97
97
|
<table role="presentation" style="width:100%;border-collapse:collapse;border:0;border-spacing:0;background:#f0f0f0;">
|
|
98
98
|
<tr>
|
|
@@ -101,7 +101,7 @@ function getBodyHTML(title, body, link) {
|
|
|
101
101
|
</td>
|
|
102
102
|
</tr>
|
|
103
103
|
</table>
|
|
104
|
-
`
|
|
104
|
+
`
|
|
105
105
|
: ''}
|
|
106
106
|
</td>
|
|
107
107
|
</tr>
|
|
@@ -111,5 +111,5 @@ function getBodyHTML(title, body, link) {
|
|
|
111
111
|
</table>
|
|
112
112
|
</body>
|
|
113
113
|
</html>
|
|
114
|
-
`;
|
|
115
|
-
}
|
|
114
|
+
`;
|
|
115
|
+
}
|
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
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]);
|
|
17
|
-
for (const device of devices) {
|
|
18
|
-
if (device.type === 'IOS') {
|
|
19
|
-
notificationIOS({
|
|
20
|
-
title,
|
|
21
|
-
body,
|
|
22
|
-
}, device.subscription);
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
notificationWEB(firebaseMessaging, {
|
|
26
|
-
title,
|
|
27
|
-
body,
|
|
28
|
-
url: process.env.FRONTEND_URL + url,
|
|
29
|
-
}, device.subscription);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
exports.sendNotification = sendNotification;
|
|
34
|
-
function notificationIOS(msg, token) {
|
|
35
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
var options = {
|
|
37
|
-
token: {
|
|
38
|
-
key: 'env/apple_notification.p8',
|
|
39
|
-
keyId: 'B7CYLPUCAM',
|
|
40
|
-
teamId: 'UA78D3SXQG',
|
|
41
|
-
},
|
|
42
|
-
production: true,
|
|
43
|
-
};
|
|
44
|
-
var apnProvider = new apn.Provider(options);
|
|
45
|
-
var note = new apn.Notification();
|
|
46
|
-
note.expiry = Math.floor(Date.now() / 1000) + 3600 * 24; // Expires 24 hour from now.
|
|
47
|
-
note.alert = {
|
|
48
|
-
title: 'RunnerPro',
|
|
49
|
-
subtitle: msg.title || '',
|
|
50
|
-
body: msg.body,
|
|
51
|
-
};
|
|
52
|
-
note.topic = 'ios.runnerpro.cliente';
|
|
53
|
-
apnProvider.send(note, token);
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
function notificationWEB(firebaseMessaging, msg, token) {
|
|
57
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
-
if (!msg.title)
|
|
59
|
-
msg.title = '';
|
|
60
|
-
firebaseMessaging
|
|
61
|
-
.send({
|
|
62
|
-
token,
|
|
63
|
-
data: msg,
|
|
64
|
-
})
|
|
65
|
-
.catch((error) => {
|
|
66
|
-
if (error.errorInfo.code === 'messaging/registration-token-not-registered') {
|
|
67
|
-
// query(
|
|
68
|
-
// 'DELETE FROM [PUSH MANAGER] WHERE [ID CLIENTE] = ? AND [SUBSCRIPTION] = ?',
|
|
69
|
-
// [idCliente, subscription]
|
|
70
|
-
// );
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
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]);
|
|
17
|
+
for (const device of devices) {
|
|
18
|
+
if (device.type === 'IOS') {
|
|
19
|
+
notificationIOS({
|
|
20
|
+
title,
|
|
21
|
+
body,
|
|
22
|
+
}, device.subscription);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
notificationWEB(firebaseMessaging, {
|
|
26
|
+
title,
|
|
27
|
+
body,
|
|
28
|
+
url: process.env.FRONTEND_URL + url,
|
|
29
|
+
}, device.subscription);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
exports.sendNotification = sendNotification;
|
|
34
|
+
function notificationIOS(msg, token) {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
var options = {
|
|
37
|
+
token: {
|
|
38
|
+
key: 'env/apple_notification.p8',
|
|
39
|
+
keyId: 'B7CYLPUCAM',
|
|
40
|
+
teamId: 'UA78D3SXQG',
|
|
41
|
+
},
|
|
42
|
+
production: true,
|
|
43
|
+
};
|
|
44
|
+
var apnProvider = new apn.Provider(options);
|
|
45
|
+
var note = new apn.Notification();
|
|
46
|
+
note.expiry = Math.floor(Date.now() / 1000) + 3600 * 24; // Expires 24 hour from now.
|
|
47
|
+
note.alert = {
|
|
48
|
+
title: 'RunnerPro',
|
|
49
|
+
subtitle: msg.title || '',
|
|
50
|
+
body: msg.body,
|
|
51
|
+
};
|
|
52
|
+
note.topic = 'ios.runnerpro.cliente';
|
|
53
|
+
apnProvider.send(note, token);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function notificationWEB(firebaseMessaging, msg, token) {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
if (!msg.title)
|
|
59
|
+
msg.title = '';
|
|
60
|
+
firebaseMessaging
|
|
61
|
+
.send({
|
|
62
|
+
token,
|
|
63
|
+
data: msg,
|
|
64
|
+
})
|
|
65
|
+
.catch((error) => {
|
|
66
|
+
if (error.errorInfo.code === 'messaging/registration-token-not-registered') {
|
|
67
|
+
// query(
|
|
68
|
+
// 'DELETE FROM [PUSH MANAGER] WHERE [ID CLIENTE] = ? AND [SUBSCRIPTION] = ?',
|
|
69
|
+
// [idCliente, subscription]
|
|
70
|
+
// );
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
}
|
package/lib/cjs/sleep/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sleep = void 0;
|
|
4
|
-
const sleep = (ms) => {
|
|
5
|
-
return new Promise((resolve) => {
|
|
6
|
-
setTimeout(resolve, ms);
|
|
7
|
-
});
|
|
8
|
-
};
|
|
9
|
-
exports.sleep = sleep;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sleep = void 0;
|
|
4
|
+
const sleep = (ms) => {
|
|
5
|
+
return new Promise((resolve) => {
|
|
6
|
+
setTimeout(resolve, ms);
|
|
7
|
+
});
|
|
8
|
+
};
|
|
9
|
+
exports.sleep = sleep;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const query: (query: string, values?: (string | number | boolean)[]) => Promise<any>;
|
|
2
|
-
declare const batchQuery: (queries: any, length?: number) => Promise<void>;
|
|
3
|
-
export { query, batchQuery };
|
|
1
|
+
declare const query: (query: string, values?: (string | number | boolean)[]) => Promise<any>;
|
|
2
|
+
declare const batchQuery: (queries: any, length?: number) => Promise<void>;
|
|
3
|
+
export { query, batchQuery };
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const err: (req: any, res: any, error: any) => void;
|
|
2
|
-
export { err };
|
|
1
|
+
declare const err: (req: any, res: any, error: any) => void;
|
|
2
|
+
export { err };
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
declare const fetchIA: {
|
|
2
|
-
get: (url: string, params: any, options: any) => Promise<any>;
|
|
3
|
-
post: (url: string, body: any, options: any) => Promise<any>;
|
|
4
|
-
put: (url: string, body: any, options: any) => Promise<any>;
|
|
5
|
-
delete: (url: string, body: any, options: any) => Promise<any>;
|
|
6
|
-
};
|
|
7
|
-
export { fetchIA };
|
|
1
|
+
declare const fetchIA: {
|
|
2
|
+
get: (url: string, params: any, options: any) => Promise<any>;
|
|
3
|
+
post: (url: string, body: any, options: any) => Promise<any>;
|
|
4
|
+
put: (url: string, body: any, options: any) => Promise<any>;
|
|
5
|
+
delete: (url: string, body: any, options: any) => Promise<any>;
|
|
6
|
+
};
|
|
7
|
+
export { fetchIA };
|
|
8
8
|
//# sourceMappingURL=fetchIA.d.ts.map
|
|
@@ -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;
|
|
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"}
|
package/lib/cjs/types/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { sendNotification } from './sendNotification';
|
|
2
|
-
import { sleep } from './sleep';
|
|
3
|
-
import { query, batchQuery } from './db';
|
|
4
|
-
import { sendMail } from './sendMail';
|
|
5
|
-
import { err } from './err';
|
|
6
|
-
import { fetchIA } from './fetch/fetchIA';
|
|
7
|
-
export { sendNotification, sleep, query, batchQuery, sendMail, err, fetchIA };
|
|
1
|
+
import { sendNotification } from './sendNotification';
|
|
2
|
+
import { sleep } from './sleep';
|
|
3
|
+
import { query, batchQuery } from './db';
|
|
4
|
+
import { sendMail } from './sendMail';
|
|
5
|
+
import { err } from './err';
|
|
6
|
+
import { fetchIA } from './fetch/fetchIA';
|
|
7
|
+
export { sendNotification, sleep, query, batchQuery, sendMail, err, fetchIA };
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
interface Mail {
|
|
2
|
-
subject: string;
|
|
3
|
-
title: string;
|
|
4
|
-
body: string;
|
|
5
|
-
to: string[];
|
|
6
|
-
link?: {
|
|
7
|
-
url: string;
|
|
8
|
-
text: string;
|
|
9
|
-
};
|
|
10
|
-
attachments?: {
|
|
11
|
-
filename: string;
|
|
12
|
-
path: string;
|
|
13
|
-
cid?: string;
|
|
14
|
-
}[];
|
|
15
|
-
bcc?: string[];
|
|
16
|
-
}
|
|
17
|
-
declare const sendMail: ({ subject, title, body, to, link, attachments, bcc, }: Mail) => Promise<any>;
|
|
18
|
-
export { sendMail };
|
|
1
|
+
interface Mail {
|
|
2
|
+
subject: string;
|
|
3
|
+
title: string;
|
|
4
|
+
body: string;
|
|
5
|
+
to: string[];
|
|
6
|
+
link?: {
|
|
7
|
+
url: string;
|
|
8
|
+
text: string;
|
|
9
|
+
};
|
|
10
|
+
attachments?: {
|
|
11
|
+
filename: string;
|
|
12
|
+
path: string;
|
|
13
|
+
cid?: string;
|
|
14
|
+
}[];
|
|
15
|
+
bcc?: string[];
|
|
16
|
+
}
|
|
17
|
+
declare const sendMail: ({ subject, title, body, to, link, attachments, bcc, }: Mail) => Promise<any>;
|
|
18
|
+
export { sendMail };
|
|
19
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
interface Notification {
|
|
2
|
-
firebaseMessaging: any;
|
|
3
|
-
idCliente: number;
|
|
4
|
-
title?: string;
|
|
5
|
-
body: string;
|
|
6
|
-
url: string;
|
|
7
|
-
}
|
|
8
|
-
declare const sendNotification: ({ firebaseMessaging, idCliente, title, body, url, }: Notification) => Promise<void>;
|
|
9
|
-
export { sendNotification };
|
|
1
|
+
interface Notification {
|
|
2
|
+
firebaseMessaging: any;
|
|
3
|
+
idCliente: number;
|
|
4
|
+
title?: string;
|
|
5
|
+
body: string;
|
|
6
|
+
url: string;
|
|
7
|
+
}
|
|
8
|
+
declare const sendNotification: ({ firebaseMessaging, idCliente, title, body, url, }: Notification) => Promise<void>;
|
|
9
|
+
export { sendNotification };
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const sleep: (ms: number) => Promise<void>;
|
|
2
|
-
export { sleep };
|
|
1
|
+
declare const sleep: (ms: number) => Promise<void>;
|
|
2
|
+
export { sleep };
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runnerpro/backend",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"description": "A collection of common backend functions",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./lib/cjs/index.js"
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"@parse/node-apn": "6.0.1",
|
|
47
47
|
"nodemailer": "6.9.9",
|
|
48
|
-
"pg": "8.11.3"
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
"pg": "8.11.3",
|
|
49
|
+
"axios": "^1.6.7"
|
|
50
|
+
}
|
|
51
51
|
}
|