@pittica/drive-folder-qrcode 2.1.0 → 2.2.0
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/README.md +1 -0
- package/dist/generator/generator.js +13 -15
- package/dist/index.js +2 -6
- package/dist/scripts.js +65 -44
- package/dist/settings/settings.js +14 -0
- package/package.json +1 -1
- package/dist/generator/drive.js +0 -68
- package/dist/generator/local.js +0 -68
package/README.md
CHANGED
@@ -24,6 +24,7 @@ Creates QR codes from Google Drive folder names.
|
|
24
24
|
| DRIVE_QRCODER_SIZE | Integer | 300 | QR code image size. |
|
25
25
|
| DRIVE_QRCODER_MARGIN | Integer | 15 | Image margin size. |
|
26
26
|
| DRIVE_QRCODER_ROUNDED | Boolean | False | Indicates whether the image has rounde borders. |
|
27
|
+
| DRIVE_QRCODER_LOGO | String | null | The path or URL of the SVG logo image. |
|
27
28
|
| DRIVE_QRCODER_FORMAT | String | PDF | Output format. Possibile formats "SVG" or "PDF". |
|
28
29
|
| DRIVE_QRCODER_COLOR_FORE | String | #000000 | Foreground color. |
|
29
30
|
| DRIVE_QRCODER_COLOR_DOTS | String | #000000 | QR code dots color. |
|
@@ -68,14 +68,13 @@ var Generator = exports["default"] = /*#__PURE__*/function () {
|
|
68
68
|
/**
|
69
69
|
* Generates graphics.
|
70
70
|
*
|
71
|
-
* @param {string} logo Logo image path.
|
72
71
|
* @param {function} captionCallback Caption text filter.
|
73
72
|
* @returns {boolean} A value indicating whether the file has been created.
|
74
73
|
*/
|
75
74
|
return _createClass(Generator, [{
|
76
75
|
key: "generate",
|
77
76
|
value: (function () {
|
78
|
-
var _generate = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(
|
77
|
+
var _generate = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
79
78
|
var captionCallback,
|
80
79
|
result,
|
81
80
|
source,
|
@@ -88,7 +87,7 @@ var Generator = exports["default"] = /*#__PURE__*/function () {
|
|
88
87
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
89
88
|
while (1) switch (_context.prev = _context.next) {
|
90
89
|
case 0:
|
91
|
-
captionCallback = _args.length >
|
90
|
+
captionCallback = _args.length > 0 && _args[0] !== undefined ? _args[0] : null;
|
92
91
|
result = [];
|
93
92
|
source = this._settings.getSource();
|
94
93
|
_this$_settings$getSe = this._settings.getSettings(), size = _this$_settings$getSe.size;
|
@@ -96,7 +95,7 @@ var Generator = exports["default"] = /*#__PURE__*/function () {
|
|
96
95
|
_context.next = 17;
|
97
96
|
break;
|
98
97
|
}
|
99
|
-
image = new _logo["default"](
|
98
|
+
image = new _logo["default"](this._settings.getLogo());
|
100
99
|
_context.next = 8;
|
101
100
|
return image.getData(size);
|
102
101
|
case 8:
|
@@ -107,7 +106,7 @@ var Generator = exports["default"] = /*#__PURE__*/function () {
|
|
107
106
|
folders = _context.sent;
|
108
107
|
console.info("Processing \"".concat(source, "\"..."));
|
109
108
|
_context.next = 15;
|
110
|
-
return this.process(folders,
|
109
|
+
return this.process(folders, data, captionCallback, result);
|
111
110
|
case 15:
|
112
111
|
_context.next = 18;
|
113
112
|
break;
|
@@ -121,7 +120,7 @@ var Generator = exports["default"] = /*#__PURE__*/function () {
|
|
121
120
|
}
|
122
121
|
}, _callee, this);
|
123
122
|
}));
|
124
|
-
function generate(
|
123
|
+
function generate() {
|
125
124
|
return _generate.apply(this, arguments);
|
126
125
|
}
|
127
126
|
return generate;
|
@@ -158,7 +157,7 @@ var Generator = exports["default"] = /*#__PURE__*/function () {
|
|
158
157
|
}
|
159
158
|
}, _callee2, this);
|
160
159
|
}));
|
161
|
-
function existsDrive(
|
160
|
+
function existsDrive(_x) {
|
162
161
|
return _existsDrive.apply(this, arguments);
|
163
162
|
}
|
164
163
|
return existsDrive;
|
@@ -192,7 +191,7 @@ var Generator = exports["default"] = /*#__PURE__*/function () {
|
|
192
191
|
}
|
193
192
|
}, _callee3, this);
|
194
193
|
}));
|
195
|
-
function existsLocal(
|
194
|
+
function existsLocal(_x2) {
|
196
195
|
return _existsLocal.apply(this, arguments);
|
197
196
|
}
|
198
197
|
return existsLocal;
|
@@ -247,7 +246,7 @@ var Generator = exports["default"] = /*#__PURE__*/function () {
|
|
247
246
|
}
|
248
247
|
}, _callee4, this);
|
249
248
|
}));
|
250
|
-
function needsUpate(
|
249
|
+
function needsUpate(_x3) {
|
251
250
|
return _needsUpate.apply(this, arguments);
|
252
251
|
}
|
253
252
|
return needsUpate;
|
@@ -256,7 +255,6 @@ var Generator = exports["default"] = /*#__PURE__*/function () {
|
|
256
255
|
* Processes the folder data.
|
257
256
|
*
|
258
257
|
* @param {Array} folders An array of folder paths or IDs.
|
259
|
-
* @param {string} image Logo path.
|
260
258
|
* @param {string} data Logo image data.
|
261
259
|
* @param {function} captionCallback Caption text filter.
|
262
260
|
* @param {Array} result An array of folder paths or IDs containing the created files.
|
@@ -266,7 +264,7 @@ var Generator = exports["default"] = /*#__PURE__*/function () {
|
|
266
264
|
}, {
|
267
265
|
key: "process",
|
268
266
|
value: (function () {
|
269
|
-
var _process = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(folders,
|
267
|
+
var _process = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(folders, data, captionCallback, result) {
|
270
268
|
var index,
|
271
269
|
folder,
|
272
270
|
_this$_settings$getSe2,
|
@@ -282,7 +280,7 @@ var Generator = exports["default"] = /*#__PURE__*/function () {
|
|
282
280
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
283
281
|
while (1) switch (_context5.prev = _context5.next) {
|
284
282
|
case 0:
|
285
|
-
index = _args5.length >
|
283
|
+
index = _args5.length > 4 && _args5[4] !== undefined ? _args5[4] : 0;
|
286
284
|
if (!(typeof folders[index] !== "undefined")) {
|
287
285
|
_context5.next = 30;
|
288
286
|
break;
|
@@ -298,7 +296,7 @@ var Generator = exports["default"] = /*#__PURE__*/function () {
|
|
298
296
|
}
|
299
297
|
_this$_settings$getSe2 = this._settings.getSettings(), size = _this$_settings$getSe2.size, margin = _this$_settings$getSe2.margin, rounded = _this$_settings$getSe2.rounded, format = _this$_settings$getSe2.format;
|
300
298
|
_this$_settings$getDe4 = this._settings.getDestination(), local = _this$_settings$getDe4.local, drive = _this$_settings$getDe4.drive;
|
301
|
-
qr = new _image["default"](folder, size, margin,
|
299
|
+
qr = new _image["default"](folder, size, margin, this._settings.getLogo(), data, this._settings.getColors(), this._settings.getFont(), rounded, typeof captionCallback === "function" ? captionCallback(folder) : folder.name);
|
302
300
|
console.info("Creating QR code for \"".concat(folder.name, "\"."));
|
303
301
|
if (!local) {
|
304
302
|
_context5.next = 17;
|
@@ -323,7 +321,7 @@ var Generator = exports["default"] = /*#__PURE__*/function () {
|
|
323
321
|
_context5.t2.push.call(_context5.t2, _context5.t3);
|
324
322
|
case 23:
|
325
323
|
_context5.next = 25;
|
326
|
-
return this.process(folders,
|
324
|
+
return this.process(folders, data, captionCallback, result, index + 1);
|
327
325
|
case 25:
|
328
326
|
_context5.next = 30;
|
329
327
|
break;
|
@@ -337,7 +335,7 @@ var Generator = exports["default"] = /*#__PURE__*/function () {
|
|
337
335
|
}
|
338
336
|
}, _callee5, this, [[3, 27]]);
|
339
337
|
}));
|
340
|
-
function process(_x5, _x6, _x7
|
338
|
+
function process(_x4, _x5, _x6, _x7) {
|
341
339
|
return _process.apply(this, arguments);
|
342
340
|
}
|
343
341
|
return process;
|
package/dist/index.js
CHANGED
@@ -4,8 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports["default"] = void 0;
|
7
|
-
var
|
8
|
-
var _drive = _interopRequireDefault(require("./generator/drive"));
|
7
|
+
var _generator = _interopRequireDefault(require("./generator/generator"));
|
9
8
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
10
9
|
// Copyright 2024-2025 Pittica S.r.l.
|
11
10
|
//
|
@@ -20,7 +19,4 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default":
|
|
20
19
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
21
20
|
// See the License for the specific language governing permissions and
|
22
21
|
// limitations under the License.
|
23
|
-
var _default = exports["default"] =
|
24
|
-
local: _local["default"],
|
25
|
-
drive: _drive["default"]
|
26
|
-
};
|
22
|
+
var _default = exports["default"] = _generator["default"];
|
package/dist/scripts.js
CHANGED
@@ -5,8 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
6
6
|
});
|
7
7
|
exports.local = exports.drive = exports["default"] = exports.count = void 0;
|
8
|
-
var
|
9
|
-
var _drive2 = _interopRequireDefault(require("./generator/drive"));
|
8
|
+
var _generator = _interopRequireDefault(require("./generator/generator"));
|
10
9
|
var _client = _interopRequireDefault(require("./drive/client"));
|
11
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
12
11
|
function _regeneratorRuntime() { "use strict"; var r = _regenerator(), e = r.m(_regeneratorRuntime), t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor; function n(r) { var e = "function" == typeof r && r.constructor; return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name)); } var o = { "throw": 1, "return": 2, "break": 3, "continue": 3 }; function a(r) { var e, t; return function (n) { e || (e = { stop: function stop() { return t(n.a, 2); }, "catch": function _catch() { return n.v; }, abrupt: function abrupt(r, e) { return t(n.a, o[r], e); }, delegateYield: function delegateYield(r, o, a) { return e.resultName = o, t(n.d, _regeneratorValues(r), a); }, finish: function finish(r) { return t(n.f, r); } }, t = function t(r, _t, o) { n.p = e.prev, n.n = e.next; try { return r(_t, o); } finally { e.next = n.n; } }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n; try { return r.call(this, e); } finally { n.p = e.prev, n.n = e.next; } }; } return (_regeneratorRuntime = function _regeneratorRuntime() { return { wrap: function wrap(e, t, n, o) { return r.w(a(e), t, n, o && o.reverse()); }, isGeneratorFunction: n, mark: r.m, awrap: function awrap(r, e) { return new _OverloadYield(r, e); }, AsyncIterator: _regeneratorAsyncIterator, async: function async(r, e, t, o, u) { return (n(e) ? _regeneratorAsyncGen : _regeneratorAsync)(a(r), e, t, o, u); }, keys: _regeneratorKeys, values: _regeneratorValues }; })(); }
|
@@ -65,7 +64,7 @@ var count = exports.count = /*#__PURE__*/function () {
|
|
65
64
|
/**
|
66
65
|
* Generates QR codes in the Google Drive given folder.
|
67
66
|
*
|
68
|
-
* @param {string}
|
67
|
+
* @param {string} source Source folder ID.
|
69
68
|
* @param {string} output Output folder folder ID.
|
70
69
|
* @param {string} logo Logo image path.
|
71
70
|
* @param {number} size QR code size.
|
@@ -86,7 +85,7 @@ var count = exports.count = /*#__PURE__*/function () {
|
|
86
85
|
* @returns {boolean} A value indicating whether the file has been created.
|
87
86
|
*/
|
88
87
|
var drive = exports.drive = /*#__PURE__*/function () {
|
89
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(
|
88
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(source, output, logo, size, margin) {
|
90
89
|
var format,
|
91
90
|
credentials,
|
92
91
|
colorFore,
|
@@ -100,6 +99,7 @@ var drive = exports.drive = /*#__PURE__*/function () {
|
|
100
99
|
rounded,
|
101
100
|
file,
|
102
101
|
callback,
|
102
|
+
generator,
|
103
103
|
_args2 = arguments;
|
104
104
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
105
105
|
while (1) switch (_context2.prev = _context2.next) {
|
@@ -117,26 +117,36 @@ var drive = exports.drive = /*#__PURE__*/function () {
|
|
117
117
|
rounded = _args2.length > 15 && _args2[15] !== undefined ? _args2[15] : false;
|
118
118
|
file = _args2.length > 16 && _args2[16] !== undefined ? _args2[16] : null;
|
119
119
|
callback = _args2.length > 17 && _args2[17] !== undefined ? _args2[17] : null;
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
120
|
+
generator = new _generator["default"](credentials, file, {
|
121
|
+
source: source,
|
122
|
+
destination: {
|
123
|
+
drive: output
|
124
|
+
},
|
125
|
+
settings: {
|
126
|
+
size: parseFloat(size),
|
127
|
+
margin: parseFloat(margin),
|
128
|
+
rounded: rounded,
|
129
|
+
format: format
|
130
|
+
},
|
131
|
+
logo: logo,
|
132
|
+
colors: {
|
133
|
+
fore: colorFore,
|
134
|
+
dots: colorDots,
|
135
|
+
square: colorSquare,
|
136
|
+
background: colorBackground,
|
137
|
+
border: colorBorder
|
138
|
+
},
|
139
|
+
font: {
|
140
|
+
color: fontColor,
|
141
|
+
path: fontPath,
|
142
|
+
family: fontFamily
|
143
|
+
}
|
144
|
+
});
|
145
|
+
_context2.next = 16;
|
146
|
+
return generator.generate(callback);
|
139
147
|
case 16:
|
148
|
+
return _context2.abrupt("return", _context2.sent);
|
149
|
+
case 17:
|
140
150
|
case "end":
|
141
151
|
return _context2.stop();
|
142
152
|
}
|
@@ -150,7 +160,7 @@ var drive = exports.drive = /*#__PURE__*/function () {
|
|
150
160
|
/**
|
151
161
|
* Generates QR codes in the given local folder.
|
152
162
|
*
|
153
|
-
* @param {string}
|
163
|
+
* @param {string} source Source folder ID.
|
154
164
|
* @param {string} output Output folder folder ID.
|
155
165
|
* @param {string} logo Logo image path.
|
156
166
|
* @param {number} size QR code size.
|
@@ -171,7 +181,7 @@ var drive = exports.drive = /*#__PURE__*/function () {
|
|
171
181
|
* @returns {boolean} A value indicating whether the file has been created.
|
172
182
|
*/
|
173
183
|
var local = exports.local = /*#__PURE__*/function () {
|
174
|
-
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(
|
184
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(source, output, logo, size, margin) {
|
175
185
|
var format,
|
176
186
|
credentials,
|
177
187
|
colorFore,
|
@@ -185,6 +195,7 @@ var local = exports.local = /*#__PURE__*/function () {
|
|
185
195
|
rounded,
|
186
196
|
file,
|
187
197
|
callback,
|
198
|
+
generator,
|
188
199
|
_args3 = arguments;
|
189
200
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
190
201
|
while (1) switch (_context3.prev = _context3.next) {
|
@@ -202,26 +213,36 @@ var local = exports.local = /*#__PURE__*/function () {
|
|
202
213
|
rounded = _args3.length > 15 && _args3[15] !== undefined ? _args3[15] : false;
|
203
214
|
file = _args3.length > 16 && _args3[16] !== undefined ? _args3[16] : null;
|
204
215
|
callback = _args3.length > 17 && _args3[17] !== undefined ? _args3[17] : null;
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
216
|
+
generator = new _generator["default"](credentials, file, {
|
217
|
+
source: source,
|
218
|
+
destination: {
|
219
|
+
local: output
|
220
|
+
},
|
221
|
+
settings: {
|
222
|
+
size: parseFloat(size),
|
223
|
+
margin: parseFloat(margin),
|
224
|
+
rounded: rounded,
|
225
|
+
format: format
|
226
|
+
},
|
227
|
+
logo: logo,
|
228
|
+
colors: {
|
229
|
+
fore: colorFore,
|
230
|
+
dots: colorDots,
|
231
|
+
square: colorSquare,
|
232
|
+
background: colorBackground,
|
233
|
+
border: colorBorder
|
234
|
+
},
|
235
|
+
font: {
|
236
|
+
color: fontColor,
|
237
|
+
path: fontPath,
|
238
|
+
family: fontFamily
|
239
|
+
}
|
240
|
+
});
|
241
|
+
_context3.next = 16;
|
242
|
+
return generator.generate(callback);
|
224
243
|
case 16:
|
244
|
+
return _context3.abrupt("return", _context3.sent);
|
245
|
+
case 17:
|
225
246
|
case "end":
|
226
247
|
return _context3.stop();
|
227
248
|
}
|
@@ -51,6 +51,7 @@ var Settings = exports["default"] = /*#__PURE__*/function () {
|
|
51
51
|
rounded: process.env.DRIVE_QRCODER_ROUNDED ? true : false,
|
52
52
|
format: process.env.DRIVE_QRCODER_FORMAT || "PDF"
|
53
53
|
},
|
54
|
+
logo: process.env.DRIVE_QRCODER_LOGO || null,
|
54
55
|
colors: {
|
55
56
|
fore: process.env.DRIVE_QRCODER_COLOR_FORE || "#000000",
|
56
57
|
dots: process.env.DRIVE_QRCODER_COLOR_DOTS || "#000000",
|
@@ -114,6 +115,17 @@ var Settings = exports["default"] = /*#__PURE__*/function () {
|
|
114
115
|
return settings;
|
115
116
|
}
|
116
117
|
|
118
|
+
/**
|
119
|
+
* Gets the logo image path.
|
120
|
+
*
|
121
|
+
* @returns {string|null} The logo image path.
|
122
|
+
*/
|
123
|
+
}, {
|
124
|
+
key: "getLogo",
|
125
|
+
value: function getLogo() {
|
126
|
+
return this._settings.logo;
|
127
|
+
}
|
128
|
+
|
117
129
|
/**
|
118
130
|
* Gets the image color settings.
|
119
131
|
*
|
@@ -150,12 +162,14 @@ var Settings = exports["default"] = /*#__PURE__*/function () {
|
|
150
162
|
var source = _ref.source,
|
151
163
|
destination = _ref.destination,
|
152
164
|
settings = _ref.settings,
|
165
|
+
logo = _ref.logo,
|
153
166
|
colors = _ref.colors,
|
154
167
|
font = _ref.font;
|
155
168
|
this._settings = {
|
156
169
|
source: source || this.getSource(),
|
157
170
|
destination: _objectSpread(_objectSpread({}, this.getDestination()), this.filter(destination)),
|
158
171
|
settings: _objectSpread(_objectSpread({}, this.getSettings()), this.filter(settings)),
|
172
|
+
logo: logo || this.getLogo(),
|
159
173
|
colors: _objectSpread(_objectSpread({}, this.getColors()), this.filter(colors)),
|
160
174
|
font: _objectSpread(_objectSpread({}, this.getFont()), this.filter(font))
|
161
175
|
};
|
package/package.json
CHANGED
package/dist/generator/drive.js
DELETED
@@ -1,68 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
5
|
-
value: true
|
6
|
-
});
|
7
|
-
exports["default"] = void 0;
|
8
|
-
var _generator = _interopRequireDefault(require("./generator"));
|
9
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
10
|
-
function _regeneratorRuntime() { "use strict"; var r = _regenerator(), e = r.m(_regeneratorRuntime), t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor; function n(r) { var e = "function" == typeof r && r.constructor; return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name)); } var o = { "throw": 1, "return": 2, "break": 3, "continue": 3 }; function a(r) { var e, t; return function (n) { e || (e = { stop: function stop() { return t(n.a, 2); }, "catch": function _catch() { return n.v; }, abrupt: function abrupt(r, e) { return t(n.a, o[r], e); }, delegateYield: function delegateYield(r, o, a) { return e.resultName = o, t(n.d, _regeneratorValues(r), a); }, finish: function finish(r) { return t(n.f, r); } }, t = function t(r, _t, o) { n.p = e.prev, n.n = e.next; try { return r(_t, o); } finally { e.next = n.n; } }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n; try { return r.call(this, e); } finally { n.p = e.prev, n.n = e.next; } }; } return (_regeneratorRuntime = function _regeneratorRuntime() { return { wrap: function wrap(e, t, n, o) { return r.w(a(e), t, n, o && o.reverse()); }, isGeneratorFunction: n, mark: r.m, awrap: function awrap(r, e) { return new _OverloadYield(r, e); }, AsyncIterator: _regeneratorAsyncIterator, async: function async(r, e, t, o, u) { return (n(e) ? _regeneratorAsyncGen : _regeneratorAsync)(a(r), e, t, o, u); }, keys: _regeneratorKeys, values: _regeneratorValues }; })(); }
|
11
|
-
function _regeneratorValues(e) { if (null != e) { var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"], r = 0; if (t) return t.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) return { next: function next() { return e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e }; } }; } throw new TypeError(_typeof(e) + " is not iterable"); }
|
12
|
-
function _regeneratorKeys(e) { var n = Object(e), r = []; for (var t in n) r.unshift(t); return function e() { for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e; return e.done = !0, e; }; }
|
13
|
-
function _regeneratorAsync(n, e, r, t, o) { var a = _regeneratorAsyncGen(n, e, r, t, o); return a.next().then(function (n) { return n.done ? n.value : a.next(); }); }
|
14
|
-
function _regeneratorAsyncGen(r, e, t, o, n) { return new _regeneratorAsyncIterator(_regenerator().w(r, e, t, o), n || Promise); }
|
15
|
-
function _regeneratorAsyncIterator(t, e) { function n(r, o, i, f) { try { var c = t[r](o), u = c.value; return u instanceof _OverloadYield ? e.resolve(u.v).then(function (t) { n("next", t, i, f); }, function (t) { n("throw", t, i, f); }) : e.resolve(u).then(function (t) { c.value = t, i(c); }, function (t) { return n("throw", t, i, f); }); } catch (t) { f(t); } } var r; this.next || (_regeneratorDefine2(_regeneratorAsyncIterator.prototype), _regeneratorDefine2(_regeneratorAsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () { return this; })), _regeneratorDefine2(this, "_invoke", function (t, o, i) { function f() { return new e(function (e, r) { n(t, i, e, r); }); } return r = r ? r.then(f, f) : f(); }, !0); }
|
16
|
-
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (c = i[4] || 3, u = i[5] === e ? i[3] : i[5], i[4] = 3, i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
17
|
-
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); }
|
18
|
-
function _OverloadYield(e, d) { this.v = e, this.k = d; }
|
19
|
-
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
20
|
-
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } // Copyright 2024-2025 Pittica S.r.l.
|
21
|
-
//
|
22
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
23
|
-
// you may not use this file except in compliance with the License.
|
24
|
-
// You may obtain a copy of the License at
|
25
|
-
//
|
26
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
27
|
-
//
|
28
|
-
// Unless required by applicable law or agreed to in writing, software
|
29
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
30
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
31
|
-
// See the License for the specific language governing permissions and
|
32
|
-
// limitations under the License.
|
33
|
-
var _default = exports["default"] = /*#__PURE__*/function () {
|
34
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(source, output, logo, settings, colors, font) {
|
35
|
-
var credentials,
|
36
|
-
captionCallback,
|
37
|
-
file,
|
38
|
-
generator,
|
39
|
-
_args = arguments;
|
40
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
41
|
-
while (1) switch (_context.prev = _context.next) {
|
42
|
-
case 0:
|
43
|
-
credentials = _args.length > 6 && _args[6] !== undefined ? _args[6] : null;
|
44
|
-
captionCallback = _args.length > 7 && _args[7] !== undefined ? _args[7] : null;
|
45
|
-
file = _args.length > 8 && _args[8] !== undefined ? _args[8] : null;
|
46
|
-
generator = new _generator["default"](credentials, file, {
|
47
|
-
source: source,
|
48
|
-
destination: {
|
49
|
-
drive: output
|
50
|
-
},
|
51
|
-
settings: settings,
|
52
|
-
colors: colors,
|
53
|
-
font: font
|
54
|
-
});
|
55
|
-
_context.next = 6;
|
56
|
-
return generator.generate(logo, captionCallback);
|
57
|
-
case 6:
|
58
|
-
return _context.abrupt("return", _context.sent);
|
59
|
-
case 7:
|
60
|
-
case "end":
|
61
|
-
return _context.stop();
|
62
|
-
}
|
63
|
-
}, _callee);
|
64
|
-
}));
|
65
|
-
return function (_x, _x2, _x3, _x4, _x5, _x6) {
|
66
|
-
return _ref.apply(this, arguments);
|
67
|
-
};
|
68
|
-
}();
|
package/dist/generator/local.js
DELETED
@@ -1,68 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
5
|
-
value: true
|
6
|
-
});
|
7
|
-
exports["default"] = void 0;
|
8
|
-
var _generator = _interopRequireDefault(require("./generator"));
|
9
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
10
|
-
function _regeneratorRuntime() { "use strict"; var r = _regenerator(), e = r.m(_regeneratorRuntime), t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor; function n(r) { var e = "function" == typeof r && r.constructor; return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name)); } var o = { "throw": 1, "return": 2, "break": 3, "continue": 3 }; function a(r) { var e, t; return function (n) { e || (e = { stop: function stop() { return t(n.a, 2); }, "catch": function _catch() { return n.v; }, abrupt: function abrupt(r, e) { return t(n.a, o[r], e); }, delegateYield: function delegateYield(r, o, a) { return e.resultName = o, t(n.d, _regeneratorValues(r), a); }, finish: function finish(r) { return t(n.f, r); } }, t = function t(r, _t, o) { n.p = e.prev, n.n = e.next; try { return r(_t, o); } finally { e.next = n.n; } }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n; try { return r.call(this, e); } finally { n.p = e.prev, n.n = e.next; } }; } return (_regeneratorRuntime = function _regeneratorRuntime() { return { wrap: function wrap(e, t, n, o) { return r.w(a(e), t, n, o && o.reverse()); }, isGeneratorFunction: n, mark: r.m, awrap: function awrap(r, e) { return new _OverloadYield(r, e); }, AsyncIterator: _regeneratorAsyncIterator, async: function async(r, e, t, o, u) { return (n(e) ? _regeneratorAsyncGen : _regeneratorAsync)(a(r), e, t, o, u); }, keys: _regeneratorKeys, values: _regeneratorValues }; })(); }
|
11
|
-
function _regeneratorValues(e) { if (null != e) { var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"], r = 0; if (t) return t.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) return { next: function next() { return e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e }; } }; } throw new TypeError(_typeof(e) + " is not iterable"); }
|
12
|
-
function _regeneratorKeys(e) { var n = Object(e), r = []; for (var t in n) r.unshift(t); return function e() { for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e; return e.done = !0, e; }; }
|
13
|
-
function _regeneratorAsync(n, e, r, t, o) { var a = _regeneratorAsyncGen(n, e, r, t, o); return a.next().then(function (n) { return n.done ? n.value : a.next(); }); }
|
14
|
-
function _regeneratorAsyncGen(r, e, t, o, n) { return new _regeneratorAsyncIterator(_regenerator().w(r, e, t, o), n || Promise); }
|
15
|
-
function _regeneratorAsyncIterator(t, e) { function n(r, o, i, f) { try { var c = t[r](o), u = c.value; return u instanceof _OverloadYield ? e.resolve(u.v).then(function (t) { n("next", t, i, f); }, function (t) { n("throw", t, i, f); }) : e.resolve(u).then(function (t) { c.value = t, i(c); }, function (t) { return n("throw", t, i, f); }); } catch (t) { f(t); } } var r; this.next || (_regeneratorDefine2(_regeneratorAsyncIterator.prototype), _regeneratorDefine2(_regeneratorAsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () { return this; })), _regeneratorDefine2(this, "_invoke", function (t, o, i) { function f() { return new e(function (e, r) { n(t, i, e, r); }); } return r = r ? r.then(f, f) : f(); }, !0); }
|
16
|
-
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (c = i[4] || 3, u = i[5] === e ? i[3] : i[5], i[4] = 3, i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
17
|
-
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); }
|
18
|
-
function _OverloadYield(e, d) { this.v = e, this.k = d; }
|
19
|
-
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
20
|
-
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } // Copyright 2024-2025 Pittica S.r.l.
|
21
|
-
//
|
22
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
23
|
-
// you may not use this file except in compliance with the License.
|
24
|
-
// You may obtain a copy of the License at
|
25
|
-
//
|
26
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
27
|
-
//
|
28
|
-
// Unless required by applicable law or agreed to in writing, software
|
29
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
30
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
31
|
-
// See the License for the specific language governing permissions and
|
32
|
-
// limitations under the License.
|
33
|
-
var _default = exports["default"] = /*#__PURE__*/function () {
|
34
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(source, output, logo, settings, colors, font) {
|
35
|
-
var credentials,
|
36
|
-
captionCallback,
|
37
|
-
file,
|
38
|
-
generator,
|
39
|
-
_args = arguments;
|
40
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
41
|
-
while (1) switch (_context.prev = _context.next) {
|
42
|
-
case 0:
|
43
|
-
credentials = _args.length > 6 && _args[6] !== undefined ? _args[6] : null;
|
44
|
-
captionCallback = _args.length > 7 && _args[7] !== undefined ? _args[7] : null;
|
45
|
-
file = _args.length > 8 && _args[8] !== undefined ? _args[8] : null;
|
46
|
-
generator = new _generator["default"](credentials, file, {
|
47
|
-
source: source,
|
48
|
-
destination: {
|
49
|
-
local: output
|
50
|
-
},
|
51
|
-
settings: settings,
|
52
|
-
colors: colors,
|
53
|
-
font: font
|
54
|
-
});
|
55
|
-
_context.next = 6;
|
56
|
-
return generator.generate(logo, captionCallback);
|
57
|
-
case 6:
|
58
|
-
return _context.abrupt("return", _context.sent);
|
59
|
-
case 7:
|
60
|
-
case "end":
|
61
|
-
return _context.stop();
|
62
|
-
}
|
63
|
-
}, _callee);
|
64
|
-
}));
|
65
|
-
return function (_x, _x2, _x3, _x4, _x5, _x6) {
|
66
|
-
return _ref.apply(this, arguments);
|
67
|
-
};
|
68
|
-
}();
|