@wecom/wecom-openclaw-cli 1.0.14 → 1.0.16
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/dist/_virtual/_commonjsHelpers.js +8 -0
- package/dist/_virtual/_commonjsHelpers.js.map +1 -0
- package/dist/_virtual/alignment-pattern.js +6 -0
- package/dist/_virtual/alignment-pattern.js.map +1 -0
- package/dist/_virtual/bitmapper.js +6 -0
- package/dist/_virtual/bitmapper.js.map +1 -0
- package/dist/_virtual/browser.js +6 -0
- package/dist/_virtual/browser.js.map +1 -0
- package/dist/_virtual/canvas.js +6 -0
- package/dist/_virtual/canvas.js.map +1 -0
- package/dist/_virtual/chunkstream.js +6 -0
- package/dist/_virtual/chunkstream.js.map +1 -0
- package/dist/_virtual/crc.js +6 -0
- package/dist/_virtual/crc.js.map +1 -0
- package/dist/_virtual/dijkstra.js +6 -0
- package/dist/_virtual/dijkstra.js.map +1 -0
- package/dist/_virtual/error-correction-code.js +6 -0
- package/dist/_virtual/error-correction-code.js.map +1 -0
- package/dist/_virtual/error-correction-level.js +6 -0
- package/dist/_virtual/error-correction-level.js.map +1 -0
- package/dist/_virtual/filter-parse-async.js +6 -0
- package/dist/_virtual/filter-parse-async.js.map +1 -0
- package/dist/_virtual/filter-parse-sync.js +6 -0
- package/dist/_virtual/filter-parse-sync.js.map +1 -0
- package/dist/_virtual/filter-parse.js +6 -0
- package/dist/_virtual/filter-parse.js.map +1 -0
- package/dist/_virtual/finder-pattern.js +6 -0
- package/dist/_virtual/finder-pattern.js.map +1 -0
- package/dist/_virtual/format-info.js +6 -0
- package/dist/_virtual/format-info.js.map +1 -0
- package/dist/_virtual/galois-field.js +6 -0
- package/dist/_virtual/galois-field.js.map +1 -0
- package/dist/_virtual/index.js +10 -0
- package/dist/_virtual/index.js.map +1 -0
- package/dist/_virtual/interlace.js +6 -0
- package/dist/_virtual/interlace.js.map +1 -0
- package/dist/_virtual/mask-pattern.js +6 -0
- package/dist/_virtual/mask-pattern.js.map +1 -0
- package/dist/_virtual/mode.js +6 -0
- package/dist/_virtual/mode.js.map +1 -0
- package/dist/_virtual/packer-async.js +6 -0
- package/dist/_virtual/packer-async.js.map +1 -0
- package/dist/_virtual/packer.js +6 -0
- package/dist/_virtual/packer.js.map +1 -0
- package/dist/_virtual/parser-async.js +6 -0
- package/dist/_virtual/parser-async.js.map +1 -0
- package/dist/_virtual/parser.js +6 -0
- package/dist/_virtual/parser.js.map +1 -0
- package/dist/_virtual/png-sync.js +6 -0
- package/dist/_virtual/png-sync.js.map +1 -0
- package/dist/_virtual/png.js +6 -0
- package/dist/_virtual/png.js.map +1 -0
- package/dist/_virtual/png2.js +6 -0
- package/dist/_virtual/png2.js.map +1 -0
- package/dist/_virtual/polynomial.js +6 -0
- package/dist/_virtual/polynomial.js.map +1 -0
- package/dist/_virtual/qrcode.js +6 -0
- package/dist/_virtual/qrcode.js.map +1 -0
- package/dist/_virtual/regex.js +6 -0
- package/dist/_virtual/regex.js.map +1 -0
- package/dist/_virtual/segments.js +6 -0
- package/dist/_virtual/segments.js.map +1 -0
- package/dist/_virtual/server.js +6 -0
- package/dist/_virtual/server.js.map +1 -0
- package/dist/_virtual/svg-tag.js +6 -0
- package/dist/_virtual/svg-tag.js.map +1 -0
- package/dist/_virtual/svg.js +6 -0
- package/dist/_virtual/svg.js.map +1 -0
- package/dist/_virtual/sync-inflate.js +6 -0
- package/dist/_virtual/sync-inflate.js.map +1 -0
- package/dist/_virtual/sync-reader.js +6 -0
- package/dist/_virtual/sync-reader.js.map +1 -0
- package/dist/_virtual/terminal-small.js +6 -0
- package/dist/_virtual/terminal-small.js.map +1 -0
- package/dist/_virtual/terminal.js +6 -0
- package/dist/_virtual/terminal.js.map +1 -0
- package/dist/_virtual/terminal2.js +6 -0
- package/dist/_virtual/terminal2.js.map +1 -0
- package/dist/_virtual/utf8.js +6 -0
- package/dist/_virtual/utf8.js.map +1 -0
- package/dist/_virtual/utils.js +6 -0
- package/dist/_virtual/utils.js.map +1 -0
- package/dist/_virtual/utils2.js +6 -0
- package/dist/_virtual/utils2.js.map +1 -0
- package/dist/_virtual/version-check.js +6 -0
- package/dist/_virtual/version-check.js.map +1 -0
- package/dist/_virtual/version.js +6 -0
- package/dist/_virtual/version.js.map +1 -0
- package/dist/node_modules/dijkstrajs/dijkstra.js +179 -0
- package/dist/node_modules/dijkstrajs/dijkstra.js.map +1 -0
- package/dist/node_modules/pngjs/lib/bitmapper.js +281 -0
- package/dist/node_modules/pngjs/lib/bitmapper.js.map +1 -0
- package/dist/node_modules/pngjs/lib/bitpacker.js +172 -0
- package/dist/node_modules/pngjs/lib/bitpacker.js.map +1 -0
- package/dist/node_modules/pngjs/lib/chunkstream.js +204 -0
- package/dist/node_modules/pngjs/lib/chunkstream.js.map +1 -0
- package/dist/node_modules/pngjs/lib/constants.js +44 -0
- package/dist/node_modules/pngjs/lib/constants.js.map +1 -0
- package/dist/node_modules/pngjs/lib/crc.js +53 -0
- package/dist/node_modules/pngjs/lib/crc.js.map +1 -0
- package/dist/node_modules/pngjs/lib/filter-pack.js +185 -0
- package/dist/node_modules/pngjs/lib/filter-pack.js.map +1 -0
- package/dist/node_modules/pngjs/lib/filter-parse-async.js +40 -0
- package/dist/node_modules/pngjs/lib/filter-parse-async.js.map +1 -0
- package/dist/node_modules/pngjs/lib/filter-parse-sync.js +36 -0
- package/dist/node_modules/pngjs/lib/filter-parse-sync.js.map +1 -0
- package/dist/node_modules/pngjs/lib/filter-parse.js +192 -0
- package/dist/node_modules/pngjs/lib/filter-parse.js.map +1 -0
- package/dist/node_modules/pngjs/lib/format-normaliser.js +105 -0
- package/dist/node_modules/pngjs/lib/format-normaliser.js.map +1 -0
- package/dist/node_modules/pngjs/lib/interlace.js +108 -0
- package/dist/node_modules/pngjs/lib/interlace.js.map +1 -0
- package/dist/node_modules/pngjs/lib/packer-async.js +67 -0
- package/dist/node_modules/pngjs/lib/packer-async.js.map +1 -0
- package/dist/node_modules/pngjs/lib/packer-sync.js +72 -0
- package/dist/node_modules/pngjs/lib/packer-sync.js.map +1 -0
- package/dist/node_modules/pngjs/lib/packer.js +147 -0
- package/dist/node_modules/pngjs/lib/packer.js.map +1 -0
- package/dist/node_modules/pngjs/lib/paeth-predictor.js +28 -0
- package/dist/node_modules/pngjs/lib/paeth-predictor.js.map +1 -0
- package/dist/node_modules/pngjs/lib/parser-async.js +185 -0
- package/dist/node_modules/pngjs/lib/parser-async.js.map +1 -0
- package/dist/node_modules/pngjs/lib/parser-sync.js +128 -0
- package/dist/node_modules/pngjs/lib/parser-sync.js.map +1 -0
- package/dist/node_modules/pngjs/lib/parser.js +305 -0
- package/dist/node_modules/pngjs/lib/parser.js.map +1 -0
- package/dist/node_modules/pngjs/lib/png-sync.js +27 -0
- package/dist/node_modules/pngjs/lib/png-sync.js.map +1 -0
- package/dist/node_modules/pngjs/lib/png.js +212 -0
- package/dist/node_modules/pngjs/lib/png.js.map +1 -0
- package/dist/node_modules/pngjs/lib/sync-inflate.js +184 -0
- package/dist/node_modules/pngjs/lib/sync-inflate.js.map +1 -0
- package/dist/node_modules/pngjs/lib/sync-reader.js +58 -0
- package/dist/node_modules/pngjs/lib/sync-reader.js.map +1 -0
- package/dist/node_modules/qrcode/lib/browser.js +93 -0
- package/dist/node_modules/qrcode/lib/browser.js.map +1 -0
- package/dist/node_modules/qrcode/lib/can-promise.js +20 -0
- package/dist/node_modules/qrcode/lib/can-promise.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/alignment-pattern.js +100 -0
- package/dist/node_modules/qrcode/lib/core/alignment-pattern.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/alphanumeric-data.js +74 -0
- package/dist/node_modules/qrcode/lib/core/alphanumeric-data.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/bit-buffer.js +50 -0
- package/dist/node_modules/qrcode/lib/core/bit-buffer.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/bit-matrix.js +79 -0
- package/dist/node_modules/qrcode/lib/core/bit-matrix.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/byte-data.js +45 -0
- package/dist/node_modules/qrcode/lib/core/byte-data.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/error-correction-code.js +150 -0
- package/dist/node_modules/qrcode/lib/core/error-correction-code.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/error-correction-level.js +66 -0
- package/dist/node_modules/qrcode/lib/core/error-correction-level.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/finder-pattern.js +37 -0
- package/dist/node_modules/qrcode/lib/core/finder-pattern.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/format-info.js +44 -0
- package/dist/node_modules/qrcode/lib/core/format-info.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/galois-field.js +83 -0
- package/dist/node_modules/qrcode/lib/core/galois-field.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/kanji-data.js +70 -0
- package/dist/node_modules/qrcode/lib/core/kanji-data.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/mask-pattern.js +251 -0
- package/dist/node_modules/qrcode/lib/core/mask-pattern.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/mode.js +185 -0
- package/dist/node_modules/qrcode/lib/core/mode.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/numeric-data.js +58 -0
- package/dist/node_modules/qrcode/lib/core/numeric-data.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/polynomial.js +79 -0
- package/dist/node_modules/qrcode/lib/core/polynomial.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/qrcode.js +522 -0
- package/dist/node_modules/qrcode/lib/core/qrcode.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/reed-solomon-encoder.js +71 -0
- package/dist/node_modules/qrcode/lib/core/reed-solomon-encoder.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/regex.js +45 -0
- package/dist/node_modules/qrcode/lib/core/regex.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/segments.js +354 -0
- package/dist/node_modules/qrcode/lib/core/segments.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/utils.js +77 -0
- package/dist/node_modules/qrcode/lib/core/utils.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/version-check.js +24 -0
- package/dist/node_modules/qrcode/lib/core/version-check.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/version.js +184 -0
- package/dist/node_modules/qrcode/lib/core/version.js.map +1 -0
- package/dist/node_modules/qrcode/lib/index.js +27 -0
- package/dist/node_modules/qrcode/lib/index.js.map +1 -0
- package/dist/node_modules/qrcode/lib/renderer/canvas.js +80 -0
- package/dist/node_modules/qrcode/lib/renderer/canvas.js.map +1 -0
- package/dist/node_modules/qrcode/lib/renderer/png.js +97 -0
- package/dist/node_modules/qrcode/lib/renderer/png.js.map +1 -0
- package/dist/node_modules/qrcode/lib/renderer/svg-tag.js +96 -0
- package/dist/node_modules/qrcode/lib/renderer/svg-tag.js.map +1 -0
- package/dist/node_modules/qrcode/lib/renderer/svg.js +37 -0
- package/dist/node_modules/qrcode/lib/renderer/svg.js.map +1 -0
- package/dist/node_modules/qrcode/lib/renderer/terminal/terminal-small.js +99 -0
- package/dist/node_modules/qrcode/lib/renderer/terminal/terminal-small.js.map +1 -0
- package/dist/node_modules/qrcode/lib/renderer/terminal/terminal.js +63 -0
- package/dist/node_modules/qrcode/lib/renderer/terminal/terminal.js.map +1 -0
- package/dist/node_modules/qrcode/lib/renderer/terminal.js +25 -0
- package/dist/node_modules/qrcode/lib/renderer/terminal.js.map +1 -0
- package/dist/node_modules/qrcode/lib/renderer/utf8.js +89 -0
- package/dist/node_modules/qrcode/lib/renderer/utf8.js.map +1 -0
- package/dist/node_modules/qrcode/lib/renderer/utils.js +115 -0
- package/dist/node_modules/qrcode/lib/renderer/utils.js.map +1 -0
- package/dist/node_modules/qrcode/lib/server.js +159 -0
- package/dist/node_modules/qrcode/lib/server.js.map +1 -0
- package/dist/package.json.js +3 -2
- package/dist/package.json.js.map +1 -1
- package/dist/utils/qrcode.d.ts.map +1 -1
- package/dist/utils/qrcode.js +20 -10
- package/dist/utils/qrcode.js.map +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var terminalSmall = require('../../../../../_virtual/terminal-small.js');
|
|
4
|
+
|
|
5
|
+
var hasRequiredTerminalSmall;
|
|
6
|
+
|
|
7
|
+
function requireTerminalSmall () {
|
|
8
|
+
if (hasRequiredTerminalSmall) return terminalSmall.__exports;
|
|
9
|
+
hasRequiredTerminalSmall = 1;
|
|
10
|
+
const backgroundWhite = '\x1b[47m';
|
|
11
|
+
const backgroundBlack = '\x1b[40m';
|
|
12
|
+
const foregroundWhite = '\x1b[37m';
|
|
13
|
+
const foregroundBlack = '\x1b[30m';
|
|
14
|
+
const reset = '\x1b[0m';
|
|
15
|
+
const lineSetupNormal = backgroundWhite + foregroundBlack; // setup colors
|
|
16
|
+
const lineSetupInverse = backgroundBlack + foregroundWhite; // setup colors
|
|
17
|
+
|
|
18
|
+
const createPalette = function (lineSetup, foregroundWhite, foregroundBlack) {
|
|
19
|
+
return {
|
|
20
|
+
// 1 ... white, 2 ... black, 0 ... transparent (default)
|
|
21
|
+
|
|
22
|
+
'00': reset + ' ' + lineSetup,
|
|
23
|
+
'01': reset + foregroundWhite + '▄' + lineSetup,
|
|
24
|
+
'02': reset + foregroundBlack + '▄' + lineSetup,
|
|
25
|
+
10: reset + foregroundWhite + '▀' + lineSetup,
|
|
26
|
+
11: ' ',
|
|
27
|
+
12: '▄',
|
|
28
|
+
20: reset + foregroundBlack + '▀' + lineSetup,
|
|
29
|
+
21: '▀',
|
|
30
|
+
22: '█'
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Returns code for QR pixel
|
|
36
|
+
* @param {boolean[][]} modules
|
|
37
|
+
* @param {number} size
|
|
38
|
+
* @param {number} x
|
|
39
|
+
* @param {number} y
|
|
40
|
+
* @return {'0' | '1' | '2'}
|
|
41
|
+
*/
|
|
42
|
+
const mkCodePixel = function (modules, size, x, y) {
|
|
43
|
+
const sizePlus = size + 1;
|
|
44
|
+
if ((x >= sizePlus) || (y >= sizePlus) || (y < -1) || (x < -1)) return '0'
|
|
45
|
+
if ((x >= size) || (y >= size) || (y < 0) || (x < 0)) return '1'
|
|
46
|
+
const idx = (y * size) + x;
|
|
47
|
+
return modules[idx] ? '2' : '1'
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Returns code for four QR pixels. Suitable as key in palette.
|
|
52
|
+
* @param {boolean[][]} modules
|
|
53
|
+
* @param {number} size
|
|
54
|
+
* @param {number} x
|
|
55
|
+
* @param {number} y
|
|
56
|
+
* @return {keyof palette}
|
|
57
|
+
*/
|
|
58
|
+
const mkCode = function (modules, size, x, y) {
|
|
59
|
+
return (
|
|
60
|
+
mkCodePixel(modules, size, x, y) +
|
|
61
|
+
mkCodePixel(modules, size, x, y + 1)
|
|
62
|
+
)
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
terminalSmall.__exports.render = function (qrData, options, cb) {
|
|
66
|
+
const size = qrData.modules.size;
|
|
67
|
+
const data = qrData.modules.data;
|
|
68
|
+
|
|
69
|
+
const inverse = !!(options && options.inverse);
|
|
70
|
+
const lineSetup = options && options.inverse ? lineSetupInverse : lineSetupNormal;
|
|
71
|
+
const white = inverse ? foregroundBlack : foregroundWhite;
|
|
72
|
+
const black = inverse ? foregroundWhite : foregroundBlack;
|
|
73
|
+
|
|
74
|
+
const palette = createPalette(lineSetup, white, black);
|
|
75
|
+
const newLine = reset + '\n' + lineSetup;
|
|
76
|
+
|
|
77
|
+
let output = lineSetup; // setup colors
|
|
78
|
+
|
|
79
|
+
for (let y = -1; y < size + 1; y += 2) {
|
|
80
|
+
for (let x = -1; x < size; x++) {
|
|
81
|
+
output += palette[mkCode(data, size, x, y)];
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
output += palette[mkCode(data, size, size, y)] + newLine;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
output += reset;
|
|
88
|
+
|
|
89
|
+
if (typeof cb === 'function') {
|
|
90
|
+
cb(null, output);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return output
|
|
94
|
+
};
|
|
95
|
+
return terminalSmall.__exports;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
exports.__require = requireTerminalSmall;
|
|
99
|
+
//# sourceMappingURL=terminal-small.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal-small.js","sources":["../../../../../../node_modules/qrcode/lib/renderer/terminal/terminal-small.js"],"sourcesContent":["const backgroundWhite = '\\x1b[47m'\nconst backgroundBlack = '\\x1b[40m'\nconst foregroundWhite = '\\x1b[37m'\nconst foregroundBlack = '\\x1b[30m'\nconst reset = '\\x1b[0m'\nconst lineSetupNormal = backgroundWhite + foregroundBlack // setup colors\nconst lineSetupInverse = backgroundBlack + foregroundWhite // setup colors\n\nconst createPalette = function (lineSetup, foregroundWhite, foregroundBlack) {\n return {\n // 1 ... white, 2 ... black, 0 ... transparent (default)\n\n '00': reset + ' ' + lineSetup,\n '01': reset + foregroundWhite + '▄' + lineSetup,\n '02': reset + foregroundBlack + '▄' + lineSetup,\n 10: reset + foregroundWhite + '▀' + lineSetup,\n 11: ' ',\n 12: '▄',\n 20: reset + foregroundBlack + '▀' + lineSetup,\n 21: '▀',\n 22: '█'\n }\n}\n\n/**\n * Returns code for QR pixel\n * @param {boolean[][]} modules\n * @param {number} size\n * @param {number} x\n * @param {number} y\n * @return {'0' | '1' | '2'}\n */\nconst mkCodePixel = function (modules, size, x, y) {\n const sizePlus = size + 1\n if ((x >= sizePlus) || (y >= sizePlus) || (y < -1) || (x < -1)) return '0'\n if ((x >= size) || (y >= size) || (y < 0) || (x < 0)) return '1'\n const idx = (y * size) + x\n return modules[idx] ? '2' : '1'\n}\n\n/**\n * Returns code for four QR pixels. Suitable as key in palette.\n * @param {boolean[][]} modules\n * @param {number} size\n * @param {number} x\n * @param {number} y\n * @return {keyof palette}\n */\nconst mkCode = function (modules, size, x, y) {\n return (\n mkCodePixel(modules, size, x, y) +\n mkCodePixel(modules, size, x, y + 1)\n )\n}\n\nexports.render = function (qrData, options, cb) {\n const size = qrData.modules.size\n const data = qrData.modules.data\n\n const inverse = !!(options && options.inverse)\n const lineSetup = options && options.inverse ? lineSetupInverse : lineSetupNormal\n const white = inverse ? foregroundBlack : foregroundWhite\n const black = inverse ? foregroundWhite : foregroundBlack\n\n const palette = createPalette(lineSetup, white, black)\n const newLine = reset + '\\n' + lineSetup\n\n let output = lineSetup // setup colors\n\n for (let y = -1; y < size + 1; y += 2) {\n for (let x = -1; x < size; x++) {\n output += palette[mkCode(data, size, x, y)]\n }\n\n output += palette[mkCode(data, size, size, y)] + newLine\n }\n\n output += reset\n\n if (typeof cb === 'function') {\n cb(null, output)\n }\n\n return output\n}\n"],"names":["terminalSmall"],"mappings":";;;;;;;;;AAAA,CAAA,MAAM,eAAe,GAAG;AACxB,CAAA,MAAM,eAAe,GAAG;AACxB,CAAA,MAAM,eAAe,GAAG;AACxB,CAAA,MAAM,eAAe,GAAG;AACxB,CAAA,MAAM,KAAK,GAAG;AACd,CAAA,MAAM,eAAe,GAAG,eAAe,GAAG,gBAAe;AACzD,CAAA,MAAM,gBAAgB,GAAG,eAAe,GAAG,gBAAe;;CAE1D,MAAM,aAAa,GAAG,UAAU,SAAS,EAAE,eAAe,EAAE,eAAe,EAAE;AAC7E,GAAE,OAAO;AACT;;AAEA,KAAI,IAAI,EAAE,KAAK,GAAG,GAAG,GAAG,SAAS;KAC7B,IAAI,EAAE,KAAK,GAAG,eAAe,GAAG,GAAG,GAAG,SAAS;KAC/C,IAAI,EAAE,KAAK,GAAG,eAAe,GAAG,GAAG,GAAG,SAAS;KAC/C,EAAE,EAAE,KAAK,GAAG,eAAe,GAAG,GAAG,GAAG,SAAS;KAC7C,EAAE,EAAE,G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AE,OAAO,IAAI,OAAO,CAAC,OAAO;GAC7C,MAAM,SAAS,GAAG,OAAO,IAAI,OAAO,CAAC,OAAO,GAAG,gBAAgB,GAAG;AACpE,GAAE,MAAM,KAAK,GAAG,OAAO,GAAG,eAAe,GAAG;AAC5C,GAAE,MAAM,KAAK,GAAG,OAAO,GAAG,eAAe,GAAG;;GAE1C,MAAM,OAAO,GAAG,aAAa,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK;AACvD,GAAE,MAAM,OAAO,GAAG,KAAK,GAAG,IAAI,GAAG;;GAE/B,IAAI,MAAM,GAAG,UAAS;;AAExB,GAAE,KAAK,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE;AACzC,KAAI,KAAK,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE;AACpC,OAAM,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;AAChD,KAAA;;AAEA,KAAI,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG;AACrD,GAAA;;AAEA,GAAE,MAAM,IAAI;;AAEZ,GAAE,IAAI,OAAO,EAAE,KAAK,UAAU,EAAE;AAChC,KAAI,EAAE,CAAC,IAAI,EAAE,MAAM;AACnB,GAAA;;AAEA,GAAE,OAAO;AACT,CAAA;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var terminal = require('../../../../../_virtual/terminal2.js');
|
|
4
|
+
|
|
5
|
+
var hasRequiredTerminal;
|
|
6
|
+
|
|
7
|
+
function requireTerminal () {
|
|
8
|
+
if (hasRequiredTerminal) return terminal.__exports;
|
|
9
|
+
hasRequiredTerminal = 1;
|
|
10
|
+
// let Utils = require('./utils')
|
|
11
|
+
|
|
12
|
+
terminal.__exports.render = function (qrData, options, cb) {
|
|
13
|
+
const size = qrData.modules.size;
|
|
14
|
+
const data = qrData.modules.data;
|
|
15
|
+
|
|
16
|
+
// let opts = Utils.getOptions(options)
|
|
17
|
+
|
|
18
|
+
// use same scheme as https://github.com/gtanner/qrcode-terminal because it actually works! =)
|
|
19
|
+
const black = '\x1b[40m \x1b[0m';
|
|
20
|
+
const white = '\x1b[47m \x1b[0m';
|
|
21
|
+
|
|
22
|
+
let output = '';
|
|
23
|
+
const hMargin = Array(size + 3).join(white);
|
|
24
|
+
const vMargin = Array(2).join(white);
|
|
25
|
+
|
|
26
|
+
output += hMargin + '\n';
|
|
27
|
+
for (let i = 0; i < size; ++i) {
|
|
28
|
+
output += white;
|
|
29
|
+
for (let j = 0; j < size; j++) {
|
|
30
|
+
// let topModule = data[i * size + j]
|
|
31
|
+
// let bottomModule = data[(i + 1) * size + j]
|
|
32
|
+
|
|
33
|
+
output += data[i * size + j] ? black : white;// getBlockChar(topModule, bottomModule)
|
|
34
|
+
}
|
|
35
|
+
// output += white+'\n'
|
|
36
|
+
output += vMargin + '\n';
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
output += hMargin + '\n';
|
|
40
|
+
|
|
41
|
+
if (typeof cb === 'function') {
|
|
42
|
+
cb(null, output);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return output
|
|
46
|
+
};
|
|
47
|
+
/*
|
|
48
|
+
exports.renderToFile = function renderToFile (path, qrData, options, cb) {
|
|
49
|
+
if (typeof cb === 'undefined') {
|
|
50
|
+
cb = options
|
|
51
|
+
options = undefined
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
let fs = require('fs')
|
|
55
|
+
let utf8 = exports.render(qrData, options)
|
|
56
|
+
fs.writeFile(path, utf8, cb)
|
|
57
|
+
}
|
|
58
|
+
*/
|
|
59
|
+
return terminal.__exports;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
exports.__require = requireTerminal;
|
|
63
|
+
//# sourceMappingURL=terminal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal.js","sources":["../../../../../../node_modules/qrcode/lib/renderer/terminal/terminal.js"],"sourcesContent":["// let Utils = require('./utils')\n\nexports.render = function (qrData, options, cb) {\n const size = qrData.modules.size\n const data = qrData.modules.data\n\n // let opts = Utils.getOptions(options)\n\n // use same scheme as https://github.com/gtanner/qrcode-terminal because it actually works! =)\n const black = '\\x1b[40m \\x1b[0m'\n const white = '\\x1b[47m \\x1b[0m'\n\n let output = ''\n const hMargin = Array(size + 3).join(white)\n const vMargin = Array(2).join(white)\n\n output += hMargin + '\\n'\n for (let i = 0; i < size; ++i) {\n output += white\n for (let j = 0; j < size; j++) {\n // let topModule = data[i * size + j]\n // let bottomModule = data[(i + 1) * size + j]\n\n output += data[i * size + j] ? black : white// getBlockChar(topModule, bottomModule)\n }\n // output += white+'\\n'\n output += vMargin + '\\n'\n }\n\n output += hMargin + '\\n'\n\n if (typeof cb === 'function') {\n cb(null, output)\n }\n\n return output\n}\n/*\nexports.renderToFile = function renderToFile (path, qrData, options, cb) {\n if (typeof cb === 'undefined') {\n cb = options\n options = undefined\n }\n\n let fs = require('fs')\n let utf8 = exports.render(qrData, options)\n fs.writeFile(path, utf8, cb)\n}\n*/\n"],"names":["terminal"],"mappings":";;;;;;;;;AAAA;;AAEA,CAAAA,kBAAA,CAAA,MAAc,GAAG,UAAU,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;AAChD,GAAE,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC;AAC9B,GAAE,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC;;AAE9B;;AAEA;GACE,MAAM,KAAK,GAAG;GACd,MAAM,KAAK,GAAG;;GAEd,IAAI,MAAM,GAAG;AACf,GAAE,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK;GAC1C,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK;;GAEnC,MAAM,IAAI,OAAO,GAAG;AACtB,GAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;AACjC,KAAI,MAAM,IAAI;AACd,KAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE;AACnC;AACA;;AAEA,OAAM,MAAM,IAAI,IAAI,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,MAAK;AAClD,KAAA;AACA;KACI,MAAM,IAAI,OAAO,GAAG;AACxB,GAAA;;GAEE,MAAM,IAAI,OAAO,GAAG;;AAEtB,GAAE,IAAI,OAAO,EAAE,KAAK,UAAU,EAAE;AAChC,KAAI,EAAE,CAAC,IAAI,EAAE,MAAM;AACnB,GAAA;;AAEA,GAAE,OAAO;AACT,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var terminal = require('../../../../_virtual/terminal.js');
|
|
4
|
+
var terminal$1 = require('./terminal/terminal.js');
|
|
5
|
+
var terminalSmall = require('./terminal/terminal-small.js');
|
|
6
|
+
|
|
7
|
+
var hasRequiredTerminal;
|
|
8
|
+
|
|
9
|
+
function requireTerminal () {
|
|
10
|
+
if (hasRequiredTerminal) return terminal.__exports;
|
|
11
|
+
hasRequiredTerminal = 1;
|
|
12
|
+
const big = terminal$1.__require();
|
|
13
|
+
const small = terminalSmall.__require();
|
|
14
|
+
|
|
15
|
+
terminal.__exports.render = function (qrData, options, cb) {
|
|
16
|
+
if (options && options.small) {
|
|
17
|
+
return small.render(qrData, options, cb)
|
|
18
|
+
}
|
|
19
|
+
return big.render(qrData, options, cb)
|
|
20
|
+
};
|
|
21
|
+
return terminal.__exports;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
exports.__require = requireTerminal;
|
|
25
|
+
//# sourceMappingURL=terminal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal.js","sources":["../../../../../node_modules/qrcode/lib/renderer/terminal.js"],"sourcesContent":["const big = require('./terminal/terminal')\nconst small = require('./terminal/terminal-small')\n\nexports.render = function (qrData, options, cb) {\n if (options && options.small) {\n return small.render(qrData, options, cb)\n }\n return big.render(qrData, options, cb)\n}\n"],"names":["require$$0","require$$1","terminal"],"mappings":";;;;;;;;;;;AAAA,CAAA,MAAM,GAAG,GAAGA,oBAAA;AACZ,CAAA,MAAM,KAAK,GAAGC,uBAAA;;AAEd,CAAAC,kBAAA,CAAA,MAAc,GAAG,UAAU,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;AAChD,GAAE,IAAI,OAAO,IAAI,OAAO,CAAC,KAAK,EAAE;KAC5B,OAAO,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE;AAC3C,GAAA;GACE,OAAO,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE;AACvC,CAAA;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var utf8 = require('../../../../_virtual/utf8.js');
|
|
4
|
+
var utils = require('./utils.js');
|
|
5
|
+
var require$$1 = require('fs');
|
|
6
|
+
|
|
7
|
+
var hasRequiredUtf8;
|
|
8
|
+
|
|
9
|
+
function requireUtf8 () {
|
|
10
|
+
if (hasRequiredUtf8) return utf8.__exports;
|
|
11
|
+
hasRequiredUtf8 = 1;
|
|
12
|
+
(function (exports$1) {
|
|
13
|
+
const Utils = utils.__require();
|
|
14
|
+
|
|
15
|
+
const BLOCK_CHAR = {
|
|
16
|
+
WW: ' ',
|
|
17
|
+
WB: '▄',
|
|
18
|
+
BB: '█',
|
|
19
|
+
BW: '▀'
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const INVERTED_BLOCK_CHAR = {
|
|
23
|
+
BB: ' ',
|
|
24
|
+
BW: '▄',
|
|
25
|
+
WW: '█',
|
|
26
|
+
WB: '▀'
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
function getBlockChar (top, bottom, blocks) {
|
|
30
|
+
if (top && bottom) return blocks.BB
|
|
31
|
+
if (top && !bottom) return blocks.BW
|
|
32
|
+
if (!top && bottom) return blocks.WB
|
|
33
|
+
return blocks.WW
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
exports$1.render = function (qrData, options, cb) {
|
|
37
|
+
const opts = Utils.getOptions(options);
|
|
38
|
+
let blocks = BLOCK_CHAR;
|
|
39
|
+
if (opts.color.dark.hex === '#ffffff' || opts.color.light.hex === '#000000') {
|
|
40
|
+
blocks = INVERTED_BLOCK_CHAR;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const size = qrData.modules.size;
|
|
44
|
+
const data = qrData.modules.data;
|
|
45
|
+
|
|
46
|
+
let output = '';
|
|
47
|
+
let hMargin = Array(size + (opts.margin * 2) + 1).join(blocks.WW);
|
|
48
|
+
hMargin = Array((opts.margin / 2) + 1).join(hMargin + '\n');
|
|
49
|
+
|
|
50
|
+
const vMargin = Array(opts.margin + 1).join(blocks.WW);
|
|
51
|
+
|
|
52
|
+
output += hMargin;
|
|
53
|
+
for (let i = 0; i < size; i += 2) {
|
|
54
|
+
output += vMargin;
|
|
55
|
+
for (let j = 0; j < size; j++) {
|
|
56
|
+
const topModule = data[i * size + j];
|
|
57
|
+
const bottomModule = data[(i + 1) * size + j];
|
|
58
|
+
|
|
59
|
+
output += getBlockChar(topModule, bottomModule, blocks);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
output += vMargin + '\n';
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
output += hMargin.slice(0, -1);
|
|
66
|
+
|
|
67
|
+
if (typeof cb === 'function') {
|
|
68
|
+
cb(null, output);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return output
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
exports$1.renderToFile = function renderToFile (path, qrData, options, cb) {
|
|
75
|
+
if (typeof cb === 'undefined') {
|
|
76
|
+
cb = options;
|
|
77
|
+
options = undefined;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const fs = require$$1;
|
|
81
|
+
const utf8 = exports$1.render(qrData, options);
|
|
82
|
+
fs.writeFile(path, utf8, cb);
|
|
83
|
+
};
|
|
84
|
+
} (utf8.__exports));
|
|
85
|
+
return utf8.__exports;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
exports.__require = requireUtf8;
|
|
89
|
+
//# sourceMappingURL=utf8.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utf8.js","sources":["../../../../../node_modules/qrcode/lib/renderer/utf8.js"],"sourcesContent":["const Utils = require('./utils')\n\nconst BLOCK_CHAR = {\n WW: ' ',\n WB: '▄',\n BB: '█',\n BW: '▀'\n}\n\nconst INVERTED_BLOCK_CHAR = {\n BB: ' ',\n BW: '▄',\n WW: '█',\n WB: '▀'\n}\n\nfunction getBlockChar (top, bottom, blocks) {\n if (top && bottom) return blocks.BB\n if (top && !bottom) return blocks.BW\n if (!top && bottom) return blocks.WB\n return blocks.WW\n}\n\nexports.render = function (qrData, options, cb) {\n const opts = Utils.getOptions(options)\n let blocks = BLOCK_CHAR\n if (opts.color.dark.hex === '#ffffff' || opts.color.light.hex === '#000000') {\n blocks = INVERTED_BLOCK_CHAR\n }\n\n const size = qrData.modules.size\n const data = qrData.modules.data\n\n let output = ''\n let hMargin = Array(size + (opts.margin * 2) + 1).join(blocks.WW)\n hMargin = Array((opts.margin / 2) + 1).join(hMargin + '\\n')\n\n const vMargin = Array(opts.margin + 1).join(blocks.WW)\n\n output += hMargin\n for (let i = 0; i < size; i += 2) {\n output += vMargin\n for (let j = 0; j < size; j++) {\n const topModule = data[i * size + j]\n const bottomModule = data[(i + 1) * size + j]\n\n output += getBlockChar(topModule, bottomModule, blocks)\n }\n\n output += vMargin + '\\n'\n }\n\n output += hMargin.slice(0, -1)\n\n if (typeof cb === 'function') {\n cb(null, output)\n }\n\n return output\n}\n\nexports.renderToFile = function renderToFile (path, qrData, options, cb) {\n if (typeof cb === 'undefined') {\n cb = options\n options = undefined\n }\n\n const fs = require('fs')\n const utf8 = exports.render(qrData, options)\n fs.writeFile(path, utf8, cb)\n}\n"],"names":["require$$0","exports"],"mappings":";;;;;;;;;;;;AAAA,EAAA,MAAM,KAAK,GAAGA,eAAA;;AAEd,EAAA,MAAM,UAAU,GAAG;IACjB,EAAE,EAAE,GAAG;IACP,EAAE,EAAE,GAAG;IACP,EAAE,EAAE,GAAG;AACT,IAAE,EAAE,EAAE;AACN;;AAEA,EAAA,MAAM,mBAAmB,GAAG;IAC1B,EAAE,EAAE,GAAG;IACP,EAAE,EAAE,GAAG;IACP,EAAE,EAAE,GAAG;AACT,IAAE,EAAE,EAAE;AACN;;AAEA,EAAA,SAAS,YAAY,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE;AAC5C,IAAE,IAAI,GAAG,IAAI,MAAM,EAAE,OAAO,MAAM,CAAC;IACjC,IAAI,GAAG,IAAI,CAAC,MAAM,EAAE,OAAO,MAAM,CAAC;IAClC,IAAI,CAAC,GAAG,IAAI,MAAM,EAAE,OAAO,MAAM,CAAC;IAClC,OAAO,MAAM,CAAC;AAChB,EAAA;;AAEA,EAAAC,SAAA,CAAA,MAAA,GAAiB,UAAU,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;AAChD,IAAE,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,OAAO;IACrC,IAAI,MAAM,GAAG;IACb,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAA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I,OAAO,EAAE,KAAK,UAAU,EAAE;AAChC,MAAI,EAAE,CAAC,IAAI,EAAE,MAAM;AACnB,IAAA;;AAEA,IAAE,OAAO;AACT,EAAA;;EAEAA,SAAA,CAAA,YAAA,GAAuB,SAAS,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;AACzE,IAAE,IAAI,OAAO,EAAE,KAAK,WAAW,EAAE;AACjC,MAAI,EAAE,GAAG;AACT,MAAI,OAAO,GAAG;AACd,IAAA;;IAEE,MAAM,EAAE,GAAG;IACX,MAAM,IAAI,GAAGA,SAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO;IAC3C,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE;AAC7B,EAAA,EAAA;;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var utils = require('../../../../_virtual/utils.js');
|
|
4
|
+
|
|
5
|
+
var hasRequiredUtils;
|
|
6
|
+
|
|
7
|
+
function requireUtils () {
|
|
8
|
+
if (hasRequiredUtils) return utils.__exports;
|
|
9
|
+
hasRequiredUtils = 1;
|
|
10
|
+
(function (exports$1) {
|
|
11
|
+
function hex2rgba (hex) {
|
|
12
|
+
if (typeof hex === 'number') {
|
|
13
|
+
hex = hex.toString();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
if (typeof hex !== 'string') {
|
|
17
|
+
throw new Error('Color should be defined as hex string')
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
let hexCode = hex.slice().replace('#', '').split('');
|
|
21
|
+
if (hexCode.length < 3 || hexCode.length === 5 || hexCode.length > 8) {
|
|
22
|
+
throw new Error('Invalid hex color: ' + hex)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Convert from short to long form (fff -> ffffff)
|
|
26
|
+
if (hexCode.length === 3 || hexCode.length === 4) {
|
|
27
|
+
hexCode = Array.prototype.concat.apply([], hexCode.map(function (c) {
|
|
28
|
+
return [c, c]
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Add default alpha value
|
|
33
|
+
if (hexCode.length === 6) hexCode.push('F', 'F');
|
|
34
|
+
|
|
35
|
+
const hexValue = parseInt(hexCode.join(''), 16);
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
r: (hexValue >> 24) & 255,
|
|
39
|
+
g: (hexValue >> 16) & 255,
|
|
40
|
+
b: (hexValue >> 8) & 255,
|
|
41
|
+
a: hexValue & 255,
|
|
42
|
+
hex: '#' + hexCode.slice(0, 6).join('')
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
exports$1.getOptions = function getOptions (options) {
|
|
47
|
+
if (!options) options = {};
|
|
48
|
+
if (!options.color) options.color = {};
|
|
49
|
+
|
|
50
|
+
const margin = typeof options.margin === 'undefined' ||
|
|
51
|
+
options.margin === null ||
|
|
52
|
+
options.margin < 0
|
|
53
|
+
? 4
|
|
54
|
+
: options.margin;
|
|
55
|
+
|
|
56
|
+
const width = options.width && options.width >= 21 ? options.width : undefined;
|
|
57
|
+
const scale = options.scale || 4;
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
width: width,
|
|
61
|
+
scale: width ? 4 : scale,
|
|
62
|
+
margin: margin,
|
|
63
|
+
color: {
|
|
64
|
+
dark: hex2rgba(options.color.dark || '#000000ff'),
|
|
65
|
+
light: hex2rgba(options.color.light || '#ffffffff')
|
|
66
|
+
},
|
|
67
|
+
type: options.type,
|
|
68
|
+
rendererOpts: options.rendererOpts || {}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
exports$1.getScale = function getScale (qrSize, opts) {
|
|
73
|
+
return opts.width && opts.width >= qrSize + opts.margin * 2
|
|
74
|
+
? opts.width / (qrSize + opts.margin * 2)
|
|
75
|
+
: opts.scale
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
exports$1.getImageWidth = function getImageWidth (qrSize, opts) {
|
|
79
|
+
const scale = exports$1.getScale(qrSize, opts);
|
|
80
|
+
return Math.floor((qrSize + opts.margin * 2) * scale)
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
exports$1.qrToImageData = function qrToImageData (imgData, qr, opts) {
|
|
84
|
+
const size = qr.modules.size;
|
|
85
|
+
const data = qr.modules.data;
|
|
86
|
+
const scale = exports$1.getScale(size, opts);
|
|
87
|
+
const symbolSize = Math.floor((size + opts.margin * 2) * scale);
|
|
88
|
+
const scaledMargin = opts.margin * scale;
|
|
89
|
+
const palette = [opts.color.light, opts.color.dark];
|
|
90
|
+
|
|
91
|
+
for (let i = 0; i < symbolSize; i++) {
|
|
92
|
+
for (let j = 0; j < symbolSize; j++) {
|
|
93
|
+
let posDst = (i * symbolSize + j) * 4;
|
|
94
|
+
let pxColor = opts.color.light;
|
|
95
|
+
|
|
96
|
+
if (i >= scaledMargin && j >= scaledMargin &&
|
|
97
|
+
i < symbolSize - scaledMargin && j < symbolSize - scaledMargin) {
|
|
98
|
+
const iSrc = Math.floor((i - scaledMargin) / scale);
|
|
99
|
+
const jSrc = Math.floor((j - scaledMargin) / scale);
|
|
100
|
+
pxColor = palette[data[iSrc * size + jSrc] ? 1 : 0];
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
imgData[posDst++] = pxColor.r;
|
|
104
|
+
imgData[posDst++] = pxColor.g;
|
|
105
|
+
imgData[posDst++] = pxColor.b;
|
|
106
|
+
imgData[posDst] = pxColor.a;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
} (utils.__exports));
|
|
111
|
+
return utils.__exports;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
exports.__require = requireUtils;
|
|
115
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../../node_modules/qrcode/lib/renderer/utils.js"],"sourcesContent":["function hex2rgba (hex) {\n if (typeof hex === 'number') {\n hex = hex.toString()\n }\n\n if (typeof hex !== 'string') {\n throw new Error('Color should be defined as hex string')\n }\n\n let hexCode = hex.slice().replace('#', '').split('')\n if (hexCode.length < 3 || hexCode.length === 5 || hexCode.length > 8) {\n throw new Error('Invalid hex color: ' + hex)\n }\n\n // Convert from short to long form (fff -> ffffff)\n if (hexCode.length === 3 || hexCode.length === 4) {\n hexCode = Array.prototype.concat.apply([], hexCode.map(function (c) {\n return [c, c]\n }))\n }\n\n // Add default alpha value\n if (hexCode.length === 6) hexCode.push('F', 'F')\n\n const hexValue = parseInt(hexCode.join(''), 16)\n\n return {\n r: (hexValue >> 24) & 255,\n g: (hexValue >> 16) & 255,\n b: (hexValue >> 8) & 255,\n a: hexValue & 255,\n hex: '#' + hexCode.slice(0, 6).join('')\n }\n}\n\nexports.getOptions = function getOptions (options) {\n if (!options) options = {}\n if (!options.color) options.color = {}\n\n const margin = typeof options.margin === 'undefined' ||\n options.margin === null ||\n options.margin < 0\n ? 4\n : options.margin\n\n const width = options.width && options.width >= 21 ? options.width : undefined\n const scale = options.scale || 4\n\n return {\n width: width,\n scale: width ? 4 : scale,\n margin: margin,\n color: {\n dark: hex2rgba(options.color.dark || '#000000ff'),\n light: hex2rgba(options.color.light || '#ffffffff')\n },\n type: options.type,\n rendererOpts: options.rendererOpts || {}\n }\n}\n\nexports.getScale = function getScale (qrSize, opts) {\n return opts.width && opts.width >= qrSize + opts.margin * 2\n ? opts.width / (qrSize + opts.margin * 2)\n : opts.scale\n}\n\nexports.getImageWidth = function getImageWidth (qrSize, opts) {\n const scale = exports.getScale(qrSize, opts)\n return Math.floor((qrSize + opts.margin * 2) * scale)\n}\n\nexports.qrToImageData = function qrToImageData (imgData, qr, opts) {\n const size = qr.modules.size\n const data = qr.modules.data\n const scale = exports.getScale(size, opts)\n const symbolSize = Math.floor((size + opts.margin * 2) * scale)\n const scaledMargin = opts.margin * scale\n const palette = [opts.color.light, opts.color.dark]\n\n for (let i = 0; i < symbolSize; i++) {\n for (let j = 0; j < symbolSize; j++) {\n let posDst = (i * symbolSize + j) * 4\n let pxColor = opts.color.light\n\n if (i >= scaledMargin && j >= scaledMargin &&\n i < symbolSize - scaledMargin && j < symbolSize - scaledMargin) {\n const iSrc = Math.floor((i - scaledMargin) / scale)\n const jSrc = Math.floor((j - scaledMargin) / scale)\n pxColor = palette[data[iSrc * size + jSrc] ? 1 : 0]\n }\n\n imgData[posDst++] = pxColor.r\n imgData[posDst++] = pxColor.g\n imgData[posDst++] = pxColor.b\n imgData[posDst] = pxColor.a\n }\n }\n}\n"],"names":["exports"],"mappings":";;;;;;;;;;EAAA,SAAS,QAAQ,EAAE,GAAG,EAAE;AACxB,IAAE,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;AAC/B,MAAI,GAAG,GAAG,GAAG,CAAC,QAAQ;AACtB,IAAA;;AAEA,IAAE,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;AAC/B,MAAI,MAAM,IAAI,KAAK,CAAC,uCAAuC;AAC3D,IAAA;;AAEA,IAAE,IAAI,OAAO,GAAG,GAAG,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE;AACrD,IAAE,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;AACxE,MAAI,MAAM,IAAI,KAAK,CAAC,qBAAqB,GAAG,GAAG;AAC/C,IAAA;;AAEA;AACA,IAAE,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;AACpD,MAAI,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;AACxE,QAAM,OAAO,CAAC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ignoreList":[0]}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var server = require('../../../_virtual/server.js');
|
|
4
|
+
var canPromise = require('./can-promise.js');
|
|
5
|
+
var qrcode = require('./core/qrcode.js');
|
|
6
|
+
var png = require('./renderer/png.js');
|
|
7
|
+
var utf8 = require('./renderer/utf8.js');
|
|
8
|
+
var terminal = require('./renderer/terminal.js');
|
|
9
|
+
var svg = require('./renderer/svg.js');
|
|
10
|
+
var browser = require('./browser.js');
|
|
11
|
+
|
|
12
|
+
var hasRequiredServer;
|
|
13
|
+
|
|
14
|
+
function requireServer () {
|
|
15
|
+
if (hasRequiredServer) return server.__exports;
|
|
16
|
+
hasRequiredServer = 1;
|
|
17
|
+
const canPromise$1 = canPromise.__require();
|
|
18
|
+
const QRCode = qrcode.__require();
|
|
19
|
+
const PngRenderer = png.__require();
|
|
20
|
+
const Utf8Renderer = utf8.__require();
|
|
21
|
+
const TerminalRenderer = terminal.__require();
|
|
22
|
+
const SvgRenderer = svg.__require();
|
|
23
|
+
|
|
24
|
+
function checkParams (text, opts, cb) {
|
|
25
|
+
if (typeof text === 'undefined') {
|
|
26
|
+
throw new Error('String required as first argument')
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (typeof cb === 'undefined') {
|
|
30
|
+
cb = opts;
|
|
31
|
+
opts = {};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (typeof cb !== 'function') {
|
|
35
|
+
if (!canPromise$1()) {
|
|
36
|
+
throw new Error('Callback required as last argument')
|
|
37
|
+
} else {
|
|
38
|
+
opts = cb || {};
|
|
39
|
+
cb = null;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
opts: opts,
|
|
45
|
+
cb: cb
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function getTypeFromFilename (path) {
|
|
50
|
+
return path.slice((path.lastIndexOf('.') - 1 >>> 0) + 2).toLowerCase()
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function getRendererFromType (type) {
|
|
54
|
+
switch (type) {
|
|
55
|
+
case 'svg':
|
|
56
|
+
return SvgRenderer
|
|
57
|
+
|
|
58
|
+
case 'txt':
|
|
59
|
+
case 'utf8':
|
|
60
|
+
return Utf8Renderer
|
|
61
|
+
|
|
62
|
+
case 'png':
|
|
63
|
+
case 'image/png':
|
|
64
|
+
default:
|
|
65
|
+
return PngRenderer
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function getStringRendererFromType (type) {
|
|
70
|
+
switch (type) {
|
|
71
|
+
case 'svg':
|
|
72
|
+
return SvgRenderer
|
|
73
|
+
|
|
74
|
+
case 'terminal':
|
|
75
|
+
return TerminalRenderer
|
|
76
|
+
|
|
77
|
+
case 'utf8':
|
|
78
|
+
default:
|
|
79
|
+
return Utf8Renderer
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function render (renderFunc, text, params) {
|
|
84
|
+
if (!params.cb) {
|
|
85
|
+
return new Promise(function (resolve, reject) {
|
|
86
|
+
try {
|
|
87
|
+
const data = QRCode.create(text, params.opts);
|
|
88
|
+
return renderFunc(data, params.opts, function (err, data) {
|
|
89
|
+
return err ? reject(err) : resolve(data)
|
|
90
|
+
})
|
|
91
|
+
} catch (e) {
|
|
92
|
+
reject(e);
|
|
93
|
+
}
|
|
94
|
+
})
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
try {
|
|
98
|
+
const data = QRCode.create(text, params.opts);
|
|
99
|
+
return renderFunc(data, params.opts, params.cb)
|
|
100
|
+
} catch (e) {
|
|
101
|
+
params.cb(e);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
server.__exports.create = QRCode.create;
|
|
106
|
+
|
|
107
|
+
server.__exports.toCanvas = browser.__require().toCanvas;
|
|
108
|
+
|
|
109
|
+
server.__exports.toString = function toString (text, opts, cb) {
|
|
110
|
+
const params = checkParams(text, opts, cb);
|
|
111
|
+
const type = params.opts ? params.opts.type : undefined;
|
|
112
|
+
const renderer = getStringRendererFromType(type);
|
|
113
|
+
return render(renderer.render, text, params)
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
server.__exports.toDataURL = function toDataURL (text, opts, cb) {
|
|
117
|
+
const params = checkParams(text, opts, cb);
|
|
118
|
+
const renderer = getRendererFromType(params.opts.type);
|
|
119
|
+
return render(renderer.renderToDataURL, text, params)
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
server.__exports.toBuffer = function toBuffer (text, opts, cb) {
|
|
123
|
+
const params = checkParams(text, opts, cb);
|
|
124
|
+
const renderer = getRendererFromType(params.opts.type);
|
|
125
|
+
return render(renderer.renderToBuffer, text, params)
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
server.__exports.toFile = function toFile (path, text, opts, cb) {
|
|
129
|
+
if (typeof path !== 'string' || !(typeof text === 'string' || typeof text === 'object')) {
|
|
130
|
+
throw new Error('Invalid argument')
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if ((arguments.length < 3) && !canPromise$1()) {
|
|
134
|
+
throw new Error('Too few arguments provided')
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const params = checkParams(text, opts, cb);
|
|
138
|
+
const type = params.opts.type || getTypeFromFilename(path);
|
|
139
|
+
const renderer = getRendererFromType(type);
|
|
140
|
+
const renderToFile = renderer.renderToFile.bind(null, path);
|
|
141
|
+
|
|
142
|
+
return render(renderToFile, text, params)
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
server.__exports.toFileStream = function toFileStream (stream, text, opts) {
|
|
146
|
+
if (arguments.length < 2) {
|
|
147
|
+
throw new Error('Too few arguments provided')
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const params = checkParams(text, opts, stream.emit.bind(stream, 'error'));
|
|
151
|
+
const renderer = getRendererFromType('png'); // Only png support for now
|
|
152
|
+
const renderToFileStream = renderer.renderToFileStream.bind(null, stream);
|
|
153
|
+
render(renderToFileStream, text, params);
|
|
154
|
+
};
|
|
155
|
+
return server.__exports;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
exports.__require = requireServer;
|
|
159
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sources":["../../../../node_modules/qrcode/lib/server.js"],"sourcesContent":["const canPromise = require('./can-promise')\nconst QRCode = require('./core/qrcode')\nconst PngRenderer = require('./renderer/png')\nconst Utf8Renderer = require('./renderer/utf8')\nconst TerminalRenderer = require('./renderer/terminal')\nconst SvgRenderer = require('./renderer/svg')\n\nfunction checkParams (text, opts, cb) {\n if (typeof text === 'undefined') {\n throw new Error('String required as first argument')\n }\n\n if (typeof cb === 'undefined') {\n cb = opts\n opts = {}\n }\n\n if (typeof cb !== 'function') {\n if (!canPromise()) {\n throw new Error('Callback required as last argument')\n } else {\n opts = cb || {}\n cb = null\n }\n }\n\n return {\n opts: opts,\n cb: cb\n }\n}\n\nfunction getTypeFromFilename (path) {\n return path.slice((path.lastIndexOf('.') - 1 >>> 0) + 2).toLowerCase()\n}\n\nfunction getRendererFromType (type) {\n switch (type) {\n case 'svg':\n return SvgRenderer\n\n case 'txt':\n case 'utf8':\n return Utf8Renderer\n\n case 'png':\n case 'image/png':\n default:\n return PngRenderer\n }\n}\n\nfunction getStringRendererFromType (type) {\n switch (type) {\n case 'svg':\n return SvgRenderer\n\n case 'terminal':\n return TerminalRenderer\n\n case 'utf8':\n default:\n return Utf8Renderer\n }\n}\n\nfunction render (renderFunc, text, params) {\n if (!params.cb) {\n return new Promise(function (resolve, reject) {\n try {\n const data = QRCode.create(text, params.opts)\n return renderFunc(data, params.opts, function (err, data) {\n return err ? reject(err) : resolve(data)\n })\n } catch (e) {\n reject(e)\n }\n })\n }\n\n try {\n const data = QRCode.create(text, params.opts)\n return renderFunc(data, params.opts, params.cb)\n } catch (e) {\n params.cb(e)\n }\n}\n\nexports.create = QRCode.create\n\nexports.toCanvas = require('./browser').toCanvas\n\nexports.toString = function toString (text, opts, cb) {\n const params = checkParams(text, opts, cb)\n const type = params.opts ? params.opts.type : undefined\n const renderer = getStringRendererFromType(type)\n return render(renderer.render, text, params)\n}\n\nexports.toDataURL = function toDataURL (text, opts, cb) {\n const params = checkParams(text, opts, cb)\n const renderer = getRendererFromType(params.opts.type)\n return render(renderer.renderToDataURL, text, params)\n}\n\nexports.toBuffer = function toBuffer (text, opts, cb) {\n const params = checkParams(text, opts, cb)\n const renderer = getRendererFromType(params.opts.type)\n return render(renderer.renderToBuffer, text, params)\n}\n\nexports.toFile = function toFile (path, text, opts, cb) {\n if (typeof path !== 'string' || !(typeof text === 'string' || typeof text === 'object')) {\n throw new Error('Invalid argument')\n }\n\n if ((arguments.length < 3) && !canPromise()) {\n throw new Error('Too few arguments provided')\n }\n\n const params = checkParams(text, opts, cb)\n const type = params.opts.type || getTypeFromFilename(path)\n const renderer = getRendererFromType(type)\n const renderToFile = renderer.renderToFile.bind(null, path)\n\n return render(renderToFile, text, params)\n}\n\nexports.toFileStream = function toFileStream (stream, text, opts) {\n if (arguments.length < 2) {\n throw new Error('Too few arguments provided')\n }\n\n const params = checkParams(text, opts, stream.emit.bind(stream, 'error'))\n const renderer = getRendererFromType('png') // Only png support for now\n const renderToFileStream = renderer.renderToFileStream.bind(null, stream)\n render(renderToFileStream, text, params)\n}\n"],"names":["canPromise","require$$0","require$$1","require$$2","require$$3","require$$4","require$$5","server","require$$6"],"mappings":";;;;;;;;;;;;;;;;AAAA,CAAA,MAAMA,YAAU,GAAGC,oBAAA;AACnB,CAAA,MAAM,MAAM,GAAGC,gBAAA;AACf,CAAA,MAAM,WAAW,GAAGC,aAAA;AACpB,CAAA,MAAM,YAAY,GAAGC,cAAA;AACrB,CAAA,MAAM,gBAAgB,GAAGC,kBAAA;AACzB,CAAA,MAAM,WAAW,GAAGC,aAAA;;AAEpB,CAAA,SAAS,WA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I,CAAC,IAAI,IAAI,mBAAmB,CAAC,IAAI;AAC3D,GAAE,MAAM,QAAQ,GAAG,mBAAmB,CAAC,IAAI;GACzC,MAAM,YAAY,GAAG,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI;;AAE5D,GAAE,OAAO,MAAM,CAAC,YAAY,EAAE,IAAI,EAAE,MAAM;AAC1C,CAAA;;AAEA,CAAAO,gBAAA,CAAA,YAAoB,GAAG,SAAS,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE;AAClE,GAAE,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;AAC5B,KAAI,MAAM,IAAI,KAAK,CAAC,4BAA4B;AAChD,GAAA;;AAEA,GAAE,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC;AAC1E,GAAE,MAAM,QAAQ,GAAG,mBAAmB,CAAC,KAAK,EAAC;GAC3C,MAAM,kBAAkB,GAAG,QAAQ,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM;AAC1E,GAAE,MAAM,CAAC,kBAAkB,EAAE,IAAI,EAAE,MAAM;AACzC,CAAA;;;;;;","x_google_ignoreList":[0]}
|
package/dist/package.json.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var name = "@wecom/wecom-openclaw-cli";
|
|
6
|
-
var version = "1.0.
|
|
6
|
+
var version = "1.0.16";
|
|
7
7
|
var description = "CLI for managing WeCom official plugin for OpenClaw";
|
|
8
8
|
var main = "dist/index.js";
|
|
9
9
|
var type = "commonjs";
|
|
@@ -35,6 +35,7 @@ var devDependencies = {
|
|
|
35
35
|
"@types/fs-extra": "^11.0.4",
|
|
36
36
|
"@types/inquirer": "^9.0.9",
|
|
37
37
|
"@types/node": "^22.0.0",
|
|
38
|
+
"@types/qrcode": "^1.5.6",
|
|
38
39
|
rimraf: "^6.0.0",
|
|
39
40
|
rollup: "^4.28.0",
|
|
40
41
|
tslib: "^2.8.0",
|
|
@@ -45,7 +46,7 @@ var dependencies = {
|
|
|
45
46
|
commander: "^14.0.3",
|
|
46
47
|
"fs-extra": "^11.3.3",
|
|
47
48
|
inquirer: "^8.2.7",
|
|
48
|
-
|
|
49
|
+
qrcode: "^1.5.4"
|
|
49
50
|
};
|
|
50
51
|
var pkg = {
|
|
51
52
|
name: name,
|
package/dist/package.json.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"package.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"qrcode.d.ts","sourceRoot":"","sources":["../../src/utils/qrcode.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"qrcode.d.ts","sourceRoot":"","sources":["../../src/utils/qrcode.ts"],"names":[],"mappings":"AAgGA;;GAEG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAYvF"}
|