@pittica/drive-folder-qrcode 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/generator/drive.js +24 -13
- package/package.json +1 -1
package/dist/generator/drive.js
CHANGED
@@ -27,20 +27,20 @@ function _asyncToGenerator(n) { return function () { var t = this, e = arguments
|
|
27
27
|
// See the License for the specific language governing permissions and
|
28
28
|
// limitations under the License.
|
29
29
|
var _default = exports["default"] = /*#__PURE__*/function () {
|
30
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
30
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(drive, output, logo, colors, font, size, margin) {
|
31
31
|
var format,
|
32
32
|
credentials,
|
33
33
|
images,
|
34
|
-
|
35
|
-
return _regeneratorRuntime().wrap(function
|
36
|
-
while (1) switch (
|
34
|
+
_args2 = arguments;
|
35
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
36
|
+
while (1) switch (_context2.prev = _context2.next) {
|
37
37
|
case 0:
|
38
|
-
format =
|
39
|
-
credentials =
|
40
|
-
|
38
|
+
format = _args2.length > 7 && _args2[7] !== undefined ? _args2[7] : "PDF";
|
39
|
+
credentials = _args2.length > 8 && _args2[8] !== undefined ? _args2[8] : null;
|
40
|
+
_context2.next = 4;
|
41
41
|
return (0, _generate["default"])(drive, logo, colors, font, size, margin, credentials);
|
42
42
|
case 4:
|
43
|
-
images =
|
43
|
+
images = _context2.sent;
|
44
44
|
images.forEach(function (_ref2) {
|
45
45
|
var _ref2$folder = _ref2.folder,
|
46
46
|
id = _ref2$folder.id,
|
@@ -61,9 +61,20 @@ var _default = exports["default"] = /*#__PURE__*/function () {
|
|
61
61
|
height: (size + margin) * 0.75
|
62
62
|
});
|
63
63
|
pdf.pipe(stream);
|
64
|
-
pdf.on("end", function () {
|
65
|
-
return (
|
66
|
-
|
64
|
+
pdf.on("end", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
65
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
66
|
+
while (1) switch (_context.prev = _context.next) {
|
67
|
+
case 0:
|
68
|
+
_context.next = 2;
|
69
|
+
return (0, _folder.uploadFile)(output, Buffer.concat(stream.queue).toString(), "".concat(name, " - ").concat(id, ".pdf"), "application/pdf", credentials);
|
70
|
+
case 2:
|
71
|
+
stream.destroy();
|
72
|
+
case 3:
|
73
|
+
case "end":
|
74
|
+
return _context.stop();
|
75
|
+
}
|
76
|
+
}, _callee);
|
77
|
+
})));
|
67
78
|
pdf.end();
|
68
79
|
return;
|
69
80
|
case "SVG":
|
@@ -74,9 +85,9 @@ var _default = exports["default"] = /*#__PURE__*/function () {
|
|
74
85
|
});
|
75
86
|
case 6:
|
76
87
|
case "end":
|
77
|
-
return
|
88
|
+
return _context2.stop();
|
78
89
|
}
|
79
|
-
},
|
90
|
+
}, _callee2);
|
80
91
|
}));
|
81
92
|
return function (_x, _x2, _x3, _x4, _x5, _x6, _x7) {
|
82
93
|
return _ref.apply(this, arguments);
|