@azuro-org/images-generator 1.3.3 → 1.3.4
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.
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import {_ as __awaiter,a as __generator,g as getFile,b as getBase64Image,d as downloadImage}from'../../index-82868da9.js';import path from'path';import'fs';import'util';import'stream';import'http';import'https';import'url';import'crypto';import'assert';import'tty';import'zlib';import'events';var cardTypes = {
|
|
2
2
|
'profit': {
|
|
3
3
|
rightImg: 'images/profit.png',
|
|
4
|
-
arrow: 'images/arrow-up.png',
|
|
5
4
|
bgColor: '#72FF4B',
|
|
6
5
|
},
|
|
7
6
|
'loss': {
|
|
8
7
|
rightImg: 'images/loss.png',
|
|
9
|
-
arrow: 'images/arrow-down.png',
|
|
10
8
|
bgColor: '#FF604B',
|
|
11
9
|
}
|
|
12
10
|
};
|
|
@@ -15,20 +13,20 @@ var template = {
|
|
|
15
13
|
height: 445,
|
|
16
14
|
type: 'jpeg',
|
|
17
15
|
html: function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
18
|
-
var type, trend, pnl, position, referralUrl, isProfit, _a, rightImg,
|
|
16
|
+
var type, trend, pnl, position, referralUrl, isProfit, _a, rightImg, bgColor, leverage, isLong, html, logo, bgImage, rightImage, personImage, arrowImage, trendImage, positionInfo;
|
|
19
17
|
return __generator(this, function (_b) {
|
|
20
18
|
switch (_b.label) {
|
|
21
19
|
case 0:
|
|
22
20
|
type = props.type, trend = props.trend, pnl = props.pnl, position = props.position, referralUrl = props.referralUrl;
|
|
23
21
|
isProfit = pnl > 0;
|
|
24
|
-
_a = isProfit ? cardTypes.profit : cardTypes.loss, rightImg = _a.rightImg,
|
|
22
|
+
_a = isProfit ? cardTypes.profit : cardTypes.loss, rightImg = _a.rightImg, bgColor = _a.bgColor;
|
|
25
23
|
leverage = position.leverage, isLong = position.isLong;
|
|
26
24
|
html = getFile(path.join(__dirname, 'index.html'));
|
|
27
25
|
logo = getBase64Image(path.resolve(__dirname, 'images/logo.png'));
|
|
28
26
|
bgImage = getBase64Image(path.resolve(__dirname, 'images/bg.png'));
|
|
29
27
|
rightImage = getBase64Image(path.resolve(__dirname, rightImg));
|
|
30
28
|
personImage = getBase64Image(path.resolve(__dirname, "images/".concat(type, ".png")));
|
|
31
|
-
arrowImage = getBase64Image(path.resolve(__dirname, arrow));
|
|
29
|
+
arrowImage = getBase64Image(path.resolve(__dirname, isLong ? 'images/arrow-up.png' : 'images/arrow-down.png'));
|
|
32
30
|
return [4 /*yield*/, downloadImage(trend.image)];
|
|
33
31
|
case 1:
|
|
34
32
|
trendImage = _b.sent();
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
'use strict';var index=require('../../index-de0b52f4.js'),path=require('path');require('fs'),require('util'),require('stream'),require('http'),require('https'),require('url'),require('crypto'),require('assert'),require('tty'),require('zlib'),require('events');function _interopDefaultLegacy(e){return e&&typeof e==='object'&&'default'in e?e:{'default':e}}var path__default=/*#__PURE__*/_interopDefaultLegacy(path);var cardTypes = {
|
|
2
2
|
'profit': {
|
|
3
3
|
rightImg: 'images/profit.png',
|
|
4
|
-
arrow: 'images/arrow-up.png',
|
|
5
4
|
bgColor: '#72FF4B',
|
|
6
5
|
},
|
|
7
6
|
'loss': {
|
|
8
7
|
rightImg: 'images/loss.png',
|
|
9
|
-
arrow: 'images/arrow-down.png',
|
|
10
8
|
bgColor: '#FF604B',
|
|
11
9
|
}
|
|
12
10
|
};
|
|
@@ -15,20 +13,20 @@ var template = {
|
|
|
15
13
|
height: 445,
|
|
16
14
|
type: 'jpeg',
|
|
17
15
|
html: function (props) { return index._(void 0, void 0, void 0, function () {
|
|
18
|
-
var type, trend, pnl, position, referralUrl, isProfit, _a, rightImg,
|
|
16
|
+
var type, trend, pnl, position, referralUrl, isProfit, _a, rightImg, bgColor, leverage, isLong, html, logo, bgImage, rightImage, personImage, arrowImage, trendImage, positionInfo;
|
|
19
17
|
return index.a(this, function (_b) {
|
|
20
18
|
switch (_b.label) {
|
|
21
19
|
case 0:
|
|
22
20
|
type = props.type, trend = props.trend, pnl = props.pnl, position = props.position, referralUrl = props.referralUrl;
|
|
23
21
|
isProfit = pnl > 0;
|
|
24
|
-
_a = isProfit ? cardTypes.profit : cardTypes.loss, rightImg = _a.rightImg,
|
|
22
|
+
_a = isProfit ? cardTypes.profit : cardTypes.loss, rightImg = _a.rightImg, bgColor = _a.bgColor;
|
|
25
23
|
leverage = position.leverage, isLong = position.isLong;
|
|
26
24
|
html = index.g(path__default["default"].join(__dirname, 'index.html'));
|
|
27
25
|
logo = index.b(path__default["default"].resolve(__dirname, 'images/logo.png'));
|
|
28
26
|
bgImage = index.b(path__default["default"].resolve(__dirname, 'images/bg.png'));
|
|
29
27
|
rightImage = index.b(path__default["default"].resolve(__dirname, rightImg));
|
|
30
28
|
personImage = index.b(path__default["default"].resolve(__dirname, "images/".concat(type, ".png")));
|
|
31
|
-
arrowImage = index.b(path__default["default"].resolve(__dirname, arrow));
|
|
29
|
+
arrowImage = index.b(path__default["default"].resolve(__dirname, isLong ? 'images/arrow-up.png' : 'images/arrow-down.png'));
|
|
32
30
|
return [4 /*yield*/, index.d(trend.image)];
|
|
33
31
|
case 1:
|
|
34
32
|
trendImage = _b.sent();
|