@runnerpro/backend 1.3.4 → 1.3.6
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/googleSheet/index.js +3 -0
- package/lib/cjs/image/getDefaultWorkoutImage.js +30 -0
- package/lib/cjs/image/reduceSizeImage.js +1 -0
- package/lib/cjs/index.js +3 -1
- package/lib/cjs/types/googleSheet/index.d.ts.map +1 -1
- package/lib/cjs/types/image/generateShareMap.d.ts +1 -1
- package/lib/cjs/types/image/generateShareMap.d.ts.map +1 -1
- package/lib/cjs/types/image/getDefaultWorkoutImage.d.ts +4 -0
- package/lib/cjs/types/image/getDefaultWorkoutImage.d.ts.map +1 -0
- package/lib/cjs/types/image/reduceSizeImage.d.ts +1 -1
- package/lib/cjs/types/image/reduceSizeImage.d.ts.map +1 -1
- package/lib/cjs/types/index.d.ts +2 -1
- package/lib/cjs/types/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -44,6 +44,7 @@ function readSheet({ sheetInstance, sheetName, sheetPage, cellPositionStart, cel
|
|
|
44
44
|
return infoObjectFromSheet.data.values;
|
|
45
45
|
}
|
|
46
46
|
catch (error) {
|
|
47
|
+
// eslint-disable-next-line no-console
|
|
47
48
|
console.log(error);
|
|
48
49
|
(0, err_1.err)(null, null, error, null);
|
|
49
50
|
}
|
|
@@ -132,6 +133,7 @@ const writeSheet = ({ sheetInstance, sheetName, sheetPage, cellValue, cellPositi
|
|
|
132
133
|
});
|
|
133
134
|
}
|
|
134
135
|
catch (error) {
|
|
136
|
+
// eslint-disable-next-line no-console
|
|
135
137
|
console.log(error);
|
|
136
138
|
(0, err_1.err)(null, null, error, null);
|
|
137
139
|
}
|
|
@@ -153,6 +155,7 @@ const appendSheet = ({ sheetInstance, sheetName, sheetPage, cellValues, cellPosi
|
|
|
153
155
|
});
|
|
154
156
|
}
|
|
155
157
|
catch (error) {
|
|
158
|
+
// eslint-disable-next-line no-console
|
|
156
159
|
console.log(error);
|
|
157
160
|
(0, err_1.err)(null, null, error, null);
|
|
158
161
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getDefaultWorkoutImage = void 0;
|
|
7
|
+
const common_1 = require("@runnerpro/common");
|
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const getDefaultWorkoutImage = (type) => {
|
|
11
|
+
let fileName = '';
|
|
12
|
+
if (type === common_1.WORKOUT_TYPE.CORRER)
|
|
13
|
+
fileName = 'run-workout.png';
|
|
14
|
+
else if (type === common_1.WORKOUT_TYPE.COMPETICION)
|
|
15
|
+
fileName = 'race-workout.png';
|
|
16
|
+
else if (type === common_1.WORKOUT_TYPE.TRAIL)
|
|
17
|
+
fileName = 'trail-workout.png';
|
|
18
|
+
else if (type === common_1.WORKOUT_TYPE.BIKE)
|
|
19
|
+
fileName = 'bike-workout.png';
|
|
20
|
+
else if (type === common_1.WORKOUT_TYPE.SWIM)
|
|
21
|
+
fileName = 'swim-workout.png';
|
|
22
|
+
else if (type === common_1.WORKOUT_TYPE.WALK)
|
|
23
|
+
fileName = 'walk-workout.png';
|
|
24
|
+
else if (type === common_1.WORKOUT_TYPE.SPORT)
|
|
25
|
+
fileName = 'sport-workout.png';
|
|
26
|
+
else
|
|
27
|
+
fileName = 'strength-workout.png';
|
|
28
|
+
return fs_1.default.readFileSync(path_1.default.join(process.cwd(), 'src', 'image', 'workout', fileName));
|
|
29
|
+
};
|
|
30
|
+
exports.getDefaultWorkoutImage = getDefaultWorkoutImage;
|
|
@@ -31,6 +31,7 @@ const reduceSizeImage = (file, newWidth = 100, quality = 80) => __awaiter(void 0
|
|
|
31
31
|
// If it's not an object, it's already a file path
|
|
32
32
|
filePath = file;
|
|
33
33
|
}
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
34
35
|
const sizeOf = (0, util_1.promisify)(require('image-size'));
|
|
35
36
|
const dimensions = yield sizeOf(filePath);
|
|
36
37
|
const imageWidth = dimensions.width;
|
package/lib/cjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.generateShareMap = exports.reduceSizeImage = exports.getLetter = exports.getNumberByLetter = exports.appendSheet = exports.writeSheet = exports.findCellByValue = exports.readSheet = exports.NOTION_DATABASES_ID = exports.notionEditPage = exports.notionAddPage = exports.notionGetDatabase = exports.notionGetUsers = exports.getCountNotificaciones = exports.chatExposed = exports.chatApi = exports.chat = exports.getExerciseTranslatedDescription = exports.useTranslation = exports.LANGUAGES = exports.translate = exports.CHANNEL_SLACK = exports.notifySlack = exports.fetchIA = exports.err = exports.sendMail = exports.batchQuery = exports.query = exports.sleep = exports.sendNotification = void 0;
|
|
3
|
+
exports.getDefaultWorkoutImage = exports.generateShareMap = exports.reduceSizeImage = exports.getLetter = exports.getNumberByLetter = exports.appendSheet = exports.writeSheet = exports.findCellByValue = exports.readSheet = exports.NOTION_DATABASES_ID = exports.notionEditPage = exports.notionAddPage = exports.notionGetDatabase = exports.notionGetUsers = exports.getCountNotificaciones = exports.chatExposed = exports.chatApi = exports.chat = exports.getExerciseTranslatedDescription = exports.useTranslation = exports.LANGUAGES = exports.translate = exports.CHANNEL_SLACK = exports.notifySlack = exports.fetchIA = exports.err = exports.sendMail = exports.batchQuery = exports.query = exports.sleep = exports.sendNotification = void 0;
|
|
4
4
|
const sendNotification_1 = require("./sendNotification");
|
|
5
5
|
Object.defineProperty(exports, "sendNotification", { enumerable: true, get: function () { return sendNotification_1.sendNotification; } });
|
|
6
6
|
const sleep_1 = require("./sleep");
|
|
@@ -44,3 +44,5 @@ const reduceSizeImage_1 = require("./image/reduceSizeImage");
|
|
|
44
44
|
Object.defineProperty(exports, "reduceSizeImage", { enumerable: true, get: function () { return reduceSizeImage_1.reduceSizeImage; } });
|
|
45
45
|
const generateShareMap_1 = require("./image/generateShareMap");
|
|
46
46
|
Object.defineProperty(exports, "generateShareMap", { enumerable: true, get: function () { return generateShareMap_1.generateShareMap; } });
|
|
47
|
+
const getDefaultWorkoutImage_1 = require("./image/getDefaultWorkoutImage");
|
|
48
|
+
Object.defineProperty(exports, "getDefaultWorkoutImage", { enumerable: true, get: function () { return getDefaultWorkoutImage_1.getDefaultWorkoutImage; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/googleSheet/index.ts"],"names":[],"mappings":"AA4BA,iBAAe,SAAS,CAAC,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,iBAAiB,EAAE,eAAe,EAAE;;;;;;CAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/googleSheet/index.ts"],"names":[],"mappings":"AA4BA,iBAAe,SAAS,CAAC,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,iBAAiB,EAAE,eAAe,EAAE;;;;;;CAAA,gBAgBnG;AAED,QAAA,MAAM,eAAe;;;;;;;;;0BAiCpB,CAAC;AAGF,iBAAS,SAAS,CAAC,MAAM,KAAA,UAaxB;AAED,iBAAS,iBAAiB,CAAC,MAAM,KAAA,UAOhC;AAED,QAAA,MAAM,UAAU;;;;;;mBAkBf,CAAC;AAEF,QAAA,MAAM,WAAW;;;;;;mBAmBhB,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateShareMap.d.ts","sourceRoot":"","sources":["../../../../src/image/generateShareMap.ts"],"names":[],"mappings":";AAcA,QAAA,MAAM,gBAAgB,+DAkBrB,
|
|
1
|
+
{"version":3,"file":"generateShareMap.d.ts","sourceRoot":"","sources":["../../../../src/image/generateShareMap.ts"],"names":[],"mappings":";AAcA,QAAA,MAAM,gBAAgB,+DAkBrB,CAAC;AA0HF,OAAO,EACL,gBAAgB,GACjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDefaultWorkoutImage.d.ts","sourceRoot":"","sources":["../../../../src/image/getDefaultWorkoutImage.ts"],"names":[],"mappings":";AAIA,QAAA,MAAM,sBAAsB,uBAW3B,CAAC;AAEF,OAAO,EACH,sBAAsB,GACzB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reduceSizeImage.d.ts","sourceRoot":"","sources":["../../../../src/image/reduceSizeImage.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"reduceSizeImage.d.ts","sourceRoot":"","sources":["../../../../src/image/reduceSizeImage.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,eAAe,kEAoCpB,CAAC;AAEF,OAAO,EACH,eAAe,GAClB,CAAC"}
|
package/lib/cjs/types/index.d.ts
CHANGED
|
@@ -11,5 +11,6 @@ import { notionGetUsers, notionGetDatabase, notionAddPage, notionEditPage, NOTIO
|
|
|
11
11
|
import { readSheet, findCellByValue, writeSheet, appendSheet, getNumberByLetter, getLetter } from './googleSheet';
|
|
12
12
|
import { reduceSizeImage } from './image/reduceSizeImage';
|
|
13
13
|
import { generateShareMap } from './image/generateShareMap';
|
|
14
|
-
|
|
14
|
+
import { getDefaultWorkoutImage } from './image/getDefaultWorkoutImage';
|
|
15
|
+
export { sendNotification, sleep, query, batchQuery, sendMail, err, fetchIA, notifySlack, CHANNEL_SLACK, translate, LANGUAGES, useTranslation, getExerciseTranslatedDescription, chat, chatApi, chatExposed, getCountNotificaciones, notionGetUsers, notionGetDatabase, notionAddPage, notionEditPage, NOTION_DATABASES_ID, readSheet, findCellByValue, writeSheet, appendSheet, getNumberByLetter, getLetter, reduceSizeImage, generateShareMap, getDefaultWorkoutImage, };
|
|
15
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,gCAAgC,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,QAAQ,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,aAAa,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACjH,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAClH,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO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