diff --git a/build.config.ts b/build.config.ts index 094ec09..a3ff749 100644 --- a/build.config.ts +++ b/build.config.ts @@ -1,17 +1,35 @@ -import { defineBuildConfig } from 'unbuild' -import { join } from "node:path" +import { defineBuildConfig } from "unbuild"; +import { join } from "node:path"; +import { obfuscator } from "rollup-obfuscator"; + export default defineBuildConfig({ - entries: ['src/index'], - clean: true, - declaration: true, - rollup: { - emitCJS: true, - inlineDependencies: true, - esbuild: { - minify: true, - }, + name: "printHelp", + entries: ["src/index"], + clean: true, + declaration: true, + rollup: { + emitCJS: true, + inlineDependencies: true, + esbuild: { + minify: true, }, - alias: { - "@": join(__dirname, 'src') + }, + alias: { + "@": join(__dirname, "src"), + }, + hooks: { + "rollup:options"(_ctx, options) { + if (Array.isArray(options?.plugins)) { + options.plugins.push( + obfuscator({ + compact: true, + sourceMap: false, + rotateStringArray: true, + stringArray: true, + stringArrayThreshold: 0.75, + }) + ); + } }, -}) \ No newline at end of file + }, +}); diff --git a/package.json b/package.json index 7f357fb..7f70bb2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@taoya7/print-help", - "version": "1.0.1", + "version": "1.0.3", "license": "MIT", "type": "module", "keywords": [ @@ -20,7 +20,7 @@ ], "scripts": { "build": "unbuild", - "push": "" + "push": "pnpm build && npm publish --access public" }, "devDependencies": { "@types/lodash-es": "^4.17.12", @@ -29,6 +29,7 @@ "unbuild": "^2.0.0" }, "dependencies": { - "lodash-es": "^4.17.21" + "lodash-es": "^4.17.21", + "rollup-obfuscator": "^4.1.1" } } \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 099c57c..a680820 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,9 @@ dependencies: lodash-es: specifier: ^4.17.21 version: 4.17.21 + rollup-obfuscator: + specifier: ^4.1.1 + version: 4.1.1(javascript-obfuscator@4.1.0)(rollup@3.29.4) devDependencies: '@types/lodash-es': @@ -437,6 +440,23 @@ packages: dev: true optional: true + /@javascript-obfuscator/escodegen@2.3.0: + resolution: {integrity: sha512-QVXwMIKqYMl3KwtTirYIA6gOCiJ0ZDtptXqAv/8KWLG9uQU2fZqTVy7a/A5RvcoZhbDoFfveTxuGxJ5ibzQtkw==} + engines: {node: '>=6.0'} + dependencies: + '@javascript-obfuscator/estraverse': 5.4.0 + esprima: 4.0.1 + esutils: 2.0.3 + optionator: 0.8.3 + optionalDependencies: + source-map: 0.6.1 + dev: false + + /@javascript-obfuscator/estraverse@5.4.0: + resolution: {integrity: sha512-CZFX7UZVN9VopGbjTx4UXaXsi9ewoM1buL0kY7j1ftYdSs7p2spv9opxFjHlQ/QGTgh4UqufYqJJ0WKLml7b6w==} + engines: {node: '>=4.0'} + dev: false + /@jridgewell/gen-mapping@0.3.5: resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==} engines: {node: '>=6.0.0'} @@ -577,7 +597,6 @@ packages: estree-walker: 2.0.2 picomatch: 2.3.1 rollup: 3.29.4 - dev: true /@trysound/sax@0.2.0: resolution: {integrity: sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==} @@ -586,7 +605,6 @@ packages: /@types/estree@1.0.5: resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} - dev: true /@types/lodash-es@4.17.12: resolution: {integrity: sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==} @@ -598,6 +616,10 @@ packages: resolution: {integrity: sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ==} dev: true + /@types/minimatch@3.0.5: + resolution: {integrity: sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==} + dev: false + /@types/node@20.11.25: resolution: {integrity: sha512-TBHyJxk2b7HceLVGFcpAUjsa5zIdsPWlR6XHfyGzd0SFu+/NFgQgMAl96MSDZgQDvJAvV6BKsFOrt6zIL09JDw==} dependencies: @@ -608,12 +630,22 @@ packages: resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} dev: true + /@types/validator@13.11.9: + resolution: {integrity: sha512-FCTsikRozryfayPuiI46QzH3fnrOoctTjvOYZkho9BTFLCOZ2rgZJHMOVgCOfttjPJcgOx52EpkY0CMfy87MIw==} + dev: false + /acorn@8.11.3: resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} engines: {node: '>=0.4.0'} hasBin: true dev: true + /acorn@8.8.2: + resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} + engines: {node: '>=0.4.0'} + hasBin: true + dev: false + /ansi-styles@3.2.1: resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} engines: {node: '>=4'} @@ -622,6 +654,37 @@ packages: color-convert: 1.9.3 dev: true + /ansi-styles@4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + dependencies: + color-convert: 2.0.1 + dev: false + + /array-differ@3.0.0: + resolution: {integrity: sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==} + engines: {node: '>=8'} + dev: false + + /array-union@2.1.0: + resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} + engines: {node: '>=8'} + dev: false + + /arrify@2.0.1: + resolution: {integrity: sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==} + engines: {node: '>=8'} + dev: false + + /assert@2.0.0: + resolution: {integrity: sha512-se5Cd+js9dXJnu6Ag2JFc00t+HmHOen+8Q+L7O9zI0PqQXr20uk2J0XQqMxZEeo5U50o8Nvmmx7dZrl+Ufr35A==} + dependencies: + es6-object-assign: 1.1.0 + is-nan: 1.3.2 + object-is: 1.1.6 + util: 0.12.5 + dev: false + /autoprefixer@10.4.18(postcss@8.4.35): resolution: {integrity: sha512-1DKbDfsr6KUElM6wg+0zRNkB/Q7WcKYAaK+pzXn+Xqmszm/5Xa9coeNdtP88Vi+dPzZnMjhge8GIV49ZQkDa+g==} engines: {node: ^10 || ^12 || >=14} @@ -638,14 +701,27 @@ packages: postcss-value-parser: 4.2.0 dev: true + /available-typed-arrays@1.0.7: + resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} + engines: {node: '>= 0.4'} + dependencies: + possible-typed-array-names: 1.0.0 + dev: false + /balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - dev: true /boolbase@1.0.0: resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} dev: true + /brace-expansion@1.1.11: + resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + dev: false + /brace-expansion@2.0.1: resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} dependencies: @@ -670,11 +746,26 @@ packages: update-browserslist-db: 1.0.13(browserslist@4.23.0) dev: true + /buffer-from@1.1.2: + resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} + dev: false + /builtin-modules@3.3.0: resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} engines: {node: '>=6'} dev: true + /call-bind@1.0.7: + resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} + engines: {node: '>= 0.4'} + dependencies: + es-define-property: 1.0.0 + es-errors: 1.3.0 + function-bind: 1.1.2 + get-intrinsic: 1.2.4 + set-function-length: 1.2.2 + dev: false + /caniuse-api@3.0.0: resolution: {integrity: sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==} dependencies: @@ -698,17 +789,46 @@ packages: supports-color: 5.5.0 dev: true + /chalk@4.1.2: + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + dev: false + /chalk@5.3.0: resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} dev: true + /chance@1.1.9: + resolution: {integrity: sha512-TfxnA/DcZXRTA4OekA2zL9GH8qscbbl6X0ZqU4tXhGveVY/mXWvEQLt5GwZcYXTEyEFflVtj+pG8nc8EwSm1RQ==} + dev: false + + /char-regex@1.0.2: + resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} + engines: {node: '>=10'} + dev: false + + /charenc@0.0.2: + resolution: {integrity: sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==} + dev: false + /citty@0.1.6: resolution: {integrity: sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==} dependencies: consola: 3.2.3 dev: true + /class-validator@0.14.0: + resolution: {integrity: sha512-ct3ltplN8I9fOwUd8GrP8UQixwff129BkEtuWDKL5W45cQuLd19xqmTLu5ge78YDm/fdje6FMt0hGOhl0lii3A==} + dependencies: + '@types/validator': 13.11.9 + libphonenumber-js: 1.10.57 + validator: 13.11.0 + dev: false + /color-convert@1.9.3: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} requiresBuild: true @@ -716,15 +836,31 @@ packages: color-name: 1.1.3 dev: true + /color-convert@2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + dependencies: + color-name: 1.1.4 + dev: false + /color-name@1.1.3: resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} requiresBuild: true dev: true + /color-name@1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + dev: false + /colord@2.9.3: resolution: {integrity: sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==} dev: true + /commander@10.0.0: + resolution: {integrity: sha512-zS5PnTI22FIRM6ylNW8G4Ap0IEOyk62fhLSD0+uHRT9McRCLGpkVNvao4bjimpK/GShynyQkFFxHhwMcETmduA==} + engines: {node: '>=14'} + dev: false + /commander@7.2.0: resolution: {integrity: sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==} engines: {node: '>= 10'} @@ -734,6 +870,10 @@ packages: resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} dev: true + /concat-map@0.0.1: + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + dev: false + /consola@3.2.3: resolution: {integrity: sha512-I5qxpzLv+sJhTVEoLYNcTW+bThDCPsit0vLNKShZx6rLtpilNpmmeTPaeqJb9ZE9dV3DGaeby6Vuhrw38WjeyQ==} engines: {node: ^14.18.0 || >=16.10.0} @@ -743,6 +883,10 @@ packages: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} dev: true + /crypt@0.0.2: + resolution: {integrity: sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==} + dev: false + /css-declaration-sorter@7.1.1(postcss@8.4.35): resolution: {integrity: sha512-dZ3bVTEEc1vxr3Bek9vGwfB5Z6ESPULhcRvO472mfjVnj8jRcTnKO8/JTczlvxM10Myb+wBM++1MtdO76eWcaQ==} engines: {node: ^14 || ^16 || >=18} @@ -867,11 +1011,33 @@ packages: ms: 2.1.2 dev: true + /deep-is@0.1.4: + resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} + dev: false + /deepmerge@4.3.1: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} dev: true + /define-data-property@1.1.4: + resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} + engines: {node: '>= 0.4'} + dependencies: + es-define-property: 1.0.0 + es-errors: 1.3.0 + gopd: 1.0.1 + dev: false + + /define-properties@1.2.1: + resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==} + engines: {node: '>= 0.4'} + dependencies: + define-data-property: 1.1.4 + has-property-descriptors: 1.0.2 + object-keys: 1.1.1 + dev: false + /defu@6.1.4: resolution: {integrity: sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==} dev: true @@ -919,6 +1085,22 @@ packages: engines: {node: '>=0.12'} dev: true + /es-define-property@1.0.0: + resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} + engines: {node: '>= 0.4'} + dependencies: + get-intrinsic: 1.2.4 + dev: false + + /es-errors@1.3.0: + resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} + engines: {node: '>= 0.4'} + dev: false + + /es6-object-assign@1.1.0: + resolution: {integrity: sha512-MEl9uirslVwqQU369iHNWZXsI8yaZYGg/D65aOgZkeyFJwHYSxilf7rQzXKI7DdDuBPrBXbfk3sl9hJhmd5AUw==} + dev: false + /esbuild@0.19.12: resolution: {integrity: sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==} engines: {node: '>=12'} @@ -961,9 +1143,48 @@ packages: requiresBuild: true dev: true + /eslint-scope@7.1.1: + resolution: {integrity: sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + esrecurse: 4.3.0 + estraverse: 5.3.0 + dev: false + + /eslint-visitor-keys@3.3.0: + resolution: {integrity: sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: false + + /esprima@4.0.1: + resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} + engines: {node: '>=4'} + hasBin: true + dev: false + + /esrecurse@4.3.0: + resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} + engines: {node: '>=4.0'} + dependencies: + estraverse: 5.3.0 + dev: false + + /estraverse@5.3.0: + resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} + engines: {node: '>=4.0'} + dev: false + /estree-walker@2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - dev: true + + /esutils@2.0.3: + resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} + engines: {node: '>=0.10.0'} + dev: false + + /fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + dev: false /fast-glob@3.3.2: resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} @@ -976,6 +1197,10 @@ packages: micromatch: 4.0.5 dev: true + /fast-levenshtein@2.0.6: + resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} + dev: false + /fastq@1.17.1: resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} dependencies: @@ -989,6 +1214,12 @@ packages: to-regex-range: 5.0.1 dev: true + /for-each@0.3.3: + resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} + dependencies: + is-callable: 1.2.7 + dev: false + /fraction.js@4.3.7: resolution: {integrity: sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==} dev: true @@ -1011,18 +1242,27 @@ packages: engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] requiresBuild: true - dev: true optional: true /function-bind@1.1.2: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - dev: true /gensync@1.0.0-beta.2: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} engines: {node: '>=6.9.0'} dev: true + /get-intrinsic@1.2.4: + resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} + engines: {node: '>= 0.4'} + dependencies: + es-errors: 1.3.0 + function-bind: 1.1.2 + has-proto: 1.0.3 + has-symbols: 1.0.3 + hasown: 2.0.2 + dev: false + /glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} @@ -1057,6 +1297,12 @@ packages: slash: 4.0.0 dev: true + /gopd@1.0.1: + resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} + dependencies: + get-intrinsic: 1.2.4 + dev: false + /graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} dev: true @@ -1067,12 +1313,39 @@ packages: requiresBuild: true dev: true + /has-flag@4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} + dev: false + + /has-property-descriptors@1.0.2: + resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} + dependencies: + es-define-property: 1.0.0 + dev: false + + /has-proto@1.0.3: + resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} + engines: {node: '>= 0.4'} + dev: false + + /has-symbols@1.0.3: + resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} + engines: {node: '>= 0.4'} + dev: false + + /has-tostringtag@1.0.2: + resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} + engines: {node: '>= 0.4'} + dependencies: + has-symbols: 1.0.3 + dev: false + /hasown@2.0.2: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} dependencies: function-bind: 1.1.2 - dev: true /hookable@5.5.3: resolution: {integrity: sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==} @@ -1092,7 +1365,22 @@ packages: /inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - dev: true + + /inversify@6.0.1: + resolution: {integrity: sha512-B3ex30927698TJENHR++8FfEaJGqoWOgI6ZY5Ht/nLUsFCwHn6akbwtnUAPCgUepAnTpe2qHxhDNjoKLyz6rgQ==} + dev: false + + /is-arguments@1.1.1: + resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + has-tostringtag: 1.0.2 + dev: false + + /is-buffer@1.1.6: + resolution: {integrity: sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==} + dev: false /is-builtin-module@3.2.1: resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==} @@ -1101,6 +1389,11 @@ packages: builtin-modules: 3.3.0 dev: true + /is-callable@1.2.7: + resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} + engines: {node: '>= 0.4'} + dev: false + /is-core-module@2.13.1: resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==} dependencies: @@ -1112,6 +1405,13 @@ packages: engines: {node: '>=0.10.0'} dev: true + /is-generator-function@1.0.10: + resolution: {integrity: sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.2 + dev: false + /is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} @@ -1123,6 +1423,14 @@ packages: resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==} dev: true + /is-nan@1.3.2: + resolution: {integrity: sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + dev: false + /is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} @@ -1134,11 +1442,54 @@ packages: '@types/estree': 1.0.5 dev: true + /is-typed-array@1.1.13: + resolution: {integrity: sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==} + engines: {node: '>= 0.4'} + dependencies: + which-typed-array: 1.1.15 + dev: false + + /javascript-obfuscator@4.1.0: + resolution: {integrity: sha512-ckC0VFKQ0/sFtLH9apW/ZLfsP8LuZqZhVEM4VTJ5KLzyLaodW6C1lTU8808eboDmddKyvd2uyRx5bzc0Me0GYg==} + engines: {node: ^12.22.0 || ^14.0.0 || ^16.0.0 || ^17.0.0 || >=18.0.0} + hasBin: true + requiresBuild: true + dependencies: + '@javascript-obfuscator/escodegen': 2.3.0 + '@javascript-obfuscator/estraverse': 5.4.0 + acorn: 8.8.2 + assert: 2.0.0 + chalk: 4.1.2 + chance: 1.1.9 + class-validator: 0.14.0 + commander: 10.0.0 + eslint-scope: 7.1.1 + eslint-visitor-keys: 3.3.0 + fast-deep-equal: 3.1.3 + inversify: 6.0.1 + js-string-escape: 1.0.1 + md5: 2.3.0 + mkdirp: 2.1.3 + multimatch: 5.0.0 + opencollective-postinstall: 2.0.3 + process: 0.11.10 + reflect-metadata: 0.1.13 + source-map-support: 0.5.21 + string-template: 1.0.0 + stringz: 2.1.0 + tslib: 2.5.0 + dev: false + /jiti@1.21.0: resolution: {integrity: sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==} hasBin: true dev: true + /js-string-escape@1.0.1: + resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} + engines: {node: '>= 0.8'} + dev: false + /js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} requiresBuild: true @@ -1168,6 +1519,18 @@ packages: graceful-fs: 4.2.11 dev: true + /levn@0.3.0: + resolution: {integrity: sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==} + engines: {node: '>= 0.8.0'} + dependencies: + prelude-ls: 1.1.2 + type-check: 0.3.2 + dev: false + + /libphonenumber-js@1.10.57: + resolution: {integrity: sha512-OjsEd9y4LgcX+Ig09SbxWqcGESxliDDFNVepFhB9KEsQZTrnk3UdEU+cO0sW1APvLprHstQpS23OQpZ3bwxy6Q==} + dev: false + /lilconfig@3.1.1: resolution: {integrity: sha512-O18pf7nyvHTckunPWCV1XUNXU1piu01y2b7ATJ0ppkUkk8ocqVWBrYjJBCwHDjD/ZWcfyrA0P4gKhzWGi5EINQ==} engines: {node: '>=14'} @@ -1198,6 +1561,14 @@ packages: '@jridgewell/sourcemap-codec': 1.4.15 dev: true + /md5@2.3.0: + resolution: {integrity: sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==} + dependencies: + charenc: 0.0.2 + crypt: 0.0.2 + is-buffer: 1.1.6 + dev: false + /mdn-data@2.0.28: resolution: {integrity: sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==} dev: true @@ -1219,6 +1590,12 @@ packages: picomatch: 2.3.1 dev: true + /minimatch@3.1.2: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + dependencies: + brace-expansion: 1.1.11 + dev: false + /minimatch@5.1.6: resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} engines: {node: '>=10'} @@ -1226,6 +1603,12 @@ packages: brace-expansion: 2.0.1 dev: true + /mkdirp@2.1.3: + resolution: {integrity: sha512-sjAkg21peAG9HS+Dkx7hlG9Ztx7HLeKnvB3NQRcu/mltCVmvkF0pisbiTSfDVYTT86XEfZrTUosLdZLStquZUw==} + engines: {node: '>=10'} + hasBin: true + dev: false + /mkdist@1.4.0(typescript@5.4.2): resolution: {integrity: sha512-LzzdzWDx6cWWPd8saIoO+kT5jnbijfeDaE6jZfmCYEi3YL2aJSyF23/tCFee/mDuh/ek1UQeSYdLeSa6oesdiw==} hasBin: true @@ -1272,6 +1655,17 @@ packages: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} dev: true + /multimatch@5.0.0: + resolution: {integrity: sha512-ypMKuglUrZUD99Tk2bUQ+xNQj43lPEfAeX2o9cTteAmShXy2VHDJpuwu1o0xqoKCt9jLVAvwyFKdLTPXKAfJyA==} + engines: {node: '>=10'} + dependencies: + '@types/minimatch': 3.0.5 + array-differ: 3.0.0 + array-union: 2.1.0 + arrify: 2.0.1 + minimatch: 3.1.2 + dev: false + /nanoid@3.3.7: resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} @@ -1293,12 +1687,42 @@ packages: boolbase: 1.0.0 dev: true + /object-is@1.1.6: + resolution: {integrity: sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + dev: false + + /object-keys@1.1.1: + resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} + engines: {node: '>= 0.4'} + dev: false + /once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} dependencies: wrappy: 1.0.2 dev: true + /opencollective-postinstall@2.0.3: + resolution: {integrity: sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==} + hasBin: true + dev: false + + /optionator@0.8.3: + resolution: {integrity: sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==} + engines: {node: '>= 0.8.0'} + dependencies: + deep-is: 0.1.4 + fast-levenshtein: 2.0.6 + levn: 0.3.0 + prelude-ls: 1.1.2 + type-check: 0.3.2 + word-wrap: 1.2.5 + dev: false + /path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} dev: true @@ -1319,7 +1743,6 @@ packages: /picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} - dev: true /pkg-types@1.0.3: resolution: {integrity: sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==} @@ -1329,6 +1752,11 @@ packages: pathe: 1.1.2 dev: true + /possible-typed-array-names@1.0.0: + resolution: {integrity: sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==} + engines: {node: '>= 0.4'} + dev: false + /postcss-calc@9.0.1(postcss@8.4.35): resolution: {integrity: sha512-TipgjGyzP5QzEhsOZUaIkeO5mKeMFpebWzRogWG/ysonUlnHcq5aJe0jOjpfzUU8PeSaBQnrE8ehR0QA5vs8PQ==} engines: {node: ^14 || ^16 || >=18.0} @@ -1642,15 +2070,29 @@ packages: source-map-js: 1.0.2 dev: true + /prelude-ls@1.1.2: + resolution: {integrity: sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==} + engines: {node: '>= 0.8.0'} + dev: false + /pretty-bytes@6.1.1: resolution: {integrity: sha512-mQUvGU6aUFQ+rNvTIAcZuWGRT9a6f6Yrg9bHs4ImKF+HZCEK+plBvnAZYSIQztknZF2qnzNtr6F8s0+IuptdlQ==} engines: {node: ^14.13.1 || >=16.0.0} dev: true + /process@0.11.10: + resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==} + engines: {node: '>= 0.6.0'} + dev: false + /queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} dev: true + /reflect-metadata@0.1.13: + resolution: {integrity: sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==} + dev: false + /resolve@1.22.8: resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} hasBin: true @@ -1665,6 +2107,17 @@ packages: engines: {iojs: '>=1.0.0', node: '>=0.10.0'} dev: true + /rollup-obfuscator@4.1.1(javascript-obfuscator@4.1.0)(rollup@3.29.4): + resolution: {integrity: sha512-eAZtlFEc8gTASEJjpWrjRrRaIMC42xNaMyRbNB95QozPKUmittoGS/Q+wYtZsqvT4N75mtHkFmzsgfFpOwpkUA==} + peerDependencies: + javascript-obfuscator: ^4.0.0 + dependencies: + '@rollup/pluginutils': 5.1.0(rollup@3.29.4) + javascript-obfuscator: 4.1.0 + transitivePeerDependencies: + - rollup + dev: false + /rollup-plugin-dts@6.1.0(rollup@3.29.4)(typescript@5.4.2): resolution: {integrity: sha512-ijSCPICkRMDKDLBK9torss07+8dl9UpY9z1N/zTeA1cIqdzMlpkV3MOOC7zukyvQfDyxa1s3Dl2+DeiP/G6DOw==} engines: {node: '>=16'} @@ -1685,7 +2138,6 @@ packages: hasBin: true optionalDependencies: fsevents: 2.3.3 - dev: true /run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} @@ -1702,6 +2154,18 @@ packages: hasBin: true dev: true + /set-function-length@1.2.2: + resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} + engines: {node: '>= 0.4'} + dependencies: + define-data-property: 1.1.4 + es-errors: 1.3.0 + function-bind: 1.1.2 + get-intrinsic: 1.2.4 + gopd: 1.0.1 + has-property-descriptors: 1.0.2 + dev: false + /slash@4.0.0: resolution: {integrity: sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==} engines: {node: '>=12'} @@ -1712,6 +2176,28 @@ packages: engines: {node: '>=0.10.0'} dev: true + /source-map-support@0.5.21: + resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} + dependencies: + buffer-from: 1.1.2 + source-map: 0.6.1 + dev: false + + /source-map@0.6.1: + resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} + engines: {node: '>=0.10.0'} + dev: false + + /string-template@1.0.0: + resolution: {integrity: sha512-SLqR3GBUXuoPP5MmYtD7ompvXiG87QjT6lzOszyXjTM86Uu7At7vNnt2xgyTLq5o9T4IxTYFyGxcULqpsmsfdg==} + dev: false + + /stringz@2.1.0: + resolution: {integrity: sha512-KlywLT+MZ+v0IRepfMxRtnSvDCMc3nR1qqCs3m/qIbSOWkNZYT8XHQA31rS3TnKp0c5xjZu3M4GY/2aRKSi/6A==} + dependencies: + char-regex: 1.0.2 + dev: false + /stylehacks@6.1.0(postcss@8.4.35): resolution: {integrity: sha512-ETErsPFgwlfYZ/CSjMO2Ddf+TsnkCVPBPaoB99Ro8WMAxf7cglzmFsRBhRmKObFjibtcvlNxFFPHuyr3sNlNUQ==} engines: {node: ^14 || ^16 || >=18.0} @@ -1731,6 +2217,13 @@ packages: has-flag: 3.0.0 dev: true + /supports-color@7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + dependencies: + has-flag: 4.0.0 + dev: false + /supports-preserve-symlinks-flag@1.0.0: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} @@ -1762,6 +2255,17 @@ packages: is-number: 7.0.0 dev: true + /tslib@2.5.0: + resolution: {integrity: sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==} + dev: false + + /type-check@0.3.2: + resolution: {integrity: sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==} + engines: {node: '>= 0.8.0'} + dependencies: + prelude-ls: 1.1.2 + dev: false + /typescript@5.4.2: resolution: {integrity: sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==} engines: {node: '>=14.17'} @@ -1850,6 +2354,37 @@ packages: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} dev: true + /util@0.12.5: + resolution: {integrity: sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==} + dependencies: + inherits: 2.0.4 + is-arguments: 1.1.1 + is-generator-function: 1.0.10 + is-typed-array: 1.1.13 + which-typed-array: 1.1.15 + dev: false + + /validator@13.11.0: + resolution: {integrity: sha512-Ii+sehpSfZy+At5nPdnyMhx78fEoPDkR2XW/zimHEL3MyGJQOCQ7WeP20jPYRz7ZCpcKLB21NxuXHF3bxjStBQ==} + engines: {node: '>= 0.10'} + dev: false + + /which-typed-array@1.1.15: + resolution: {integrity: sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==} + engines: {node: '>= 0.4'} + dependencies: + available-typed-arrays: 1.0.7 + call-bind: 1.0.7 + for-each: 0.3.3 + gopd: 1.0.1 + has-tostringtag: 1.0.2 + dev: false + + /word-wrap@1.2.5: + resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} + engines: {node: '>=0.10.0'} + dev: false + /wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} dev: true diff --git a/src/command/Label.ts b/src/command/Label.ts index d572374..848bcf6 100644 --- a/src/command/Label.ts +++ b/src/command/Label.ts @@ -1,417 +1,477 @@ - -import _ from 'lodash-es'; +import _ from "lodash-es"; export enum FOOT { - F2 = 0, - F5 = 1 + F2 = 0, + F5 = 1, } export enum SPEED { - SPEED1DIV5 = 15, - SPEED2 = 20, - SPEED3 = 30, - SPEED4 = 40, - SPEED5 = 50, - SPEED6 = 60, - SPEED7 = 70, - SPEED8 = 80, - SPEED9 = 90, - SPEED10 = 100, - SPEED11 = 110, - SPEED12 = 120 + SPEED1DIV5 = 15, + SPEED2 = 20, + SPEED3 = 30, + SPEED4 = 40, + SPEED5 = 50, + SPEED6 = 60, + SPEED7 = 70, + SPEED8 = 80, + SPEED9 = 90, + SPEED10 = 100, + SPEED11 = 110, + SPEED12 = 120, } export enum DENSITY { - DNESITY0 = 0, - DNESITY1 = 1, - DNESITY2 = 2, - DNESITY3 = 3, - DNESITY4 = 4, - DNESITY5 = 5, - DNESITY6 = 6, - DNESITY7 = 7, - DNESITY8 = 8, - DNESITY9 = 9, - DNESITY10 = 10, - DNESITY11 = 11, - DNESITY12 = 12, - DNESITY13 = 13, - DNESITY14 = 14, - DNESITY15 = 15 + DNESITY0 = 0, + DNESITY1 = 1, + DNESITY2 = 2, + DNESITY3 = 3, + DNESITY4 = 4, + DNESITY5 = 5, + DNESITY6 = 6, + DNESITY7 = 7, + DNESITY8 = 8, + DNESITY9 = 9, + DNESITY10 = 10, + DNESITY11 = 11, + DNESITY12 = 12, + DNESITY13 = 13, + DNESITY14 = 14, + DNESITY15 = 15, } export enum DIRECTION { - FORWARD = 0, - BACKWARD = 1 + FORWARD = 0, + BACKWARD = 1, } export enum MIRROR { - NORMAL = 0, - MIRROR = 1 + NORMAL = 0, + MIRROR = 1, } export enum CODEPAGE { - PC437 = 437, - PC850 = 850, - PC852 = 852, - PC860 = 860, - PC863 = 863, - PC865 = 865, - WPC1250 = 1250, - WPC1252 = 1252, - WPC1253 = 1253, - WPC1254 = 1254 + PC437 = 437, + PC850 = 850, + PC852 = 852, + PC860 = 860, + PC863 = 863, + PC865 = 865, + WPC1250 = 1250, + WPC1252 = 1252, + WPC1253 = 1253, + WPC1254 = 1254, } export enum FONTTYPE { - FONT_0 = "0.TTF", - Bold = "1.TTF", - SongTi = "2.TTF", - Thai = "4.TTF", - FONT_1 = "1", - FONT_2 = "2", - FONT_3 = "3", - FONT_4 = "4", - FONT_5 = "5", - FONT_6 = "6", - FONT_7 = "7", - FONT_8 = "8", - FONT_9 = "9", - FONT_10 = "10", - SIMPLIFIED_16_CHINESE = "TSS16.BF2", - SIMPLIFIED_20_CHINESE = "TSS20.BF2", - SIMPLIFIED_24_CHINESE = "TSS24.BF2", - SIMPLIFIED__32_CHINESE = "TSS32.BF2", - TRADITIONAL_CHINESE = "TST24.BF2", - KOREAN = "K" + FONT_0 = "0.TTF", + Bold = "1.TTF", + SongTi = "2.TTF", + Thai = "4.TTF", + FONT_1 = "1", + FONT_2 = "2", + FONT_3 = "3", + FONT_4 = "4", + FONT_5 = "5", + FONT_6 = "6", + FONT_7 = "7", + FONT_8 = "8", + FONT_9 = "9", + FONT_10 = "10", + SIMPLIFIED_16_CHINESE = "TSS16.BF2", + SIMPLIFIED_20_CHINESE = "TSS20.BF2", + SIMPLIFIED_24_CHINESE = "TSS24.BF2", + SIMPLIFIED__32_CHINESE = "TSS32.BF2", + TRADITIONAL_CHINESE = "TST24.BF2", + KOREAN = "K", } export enum ROTATION { - ROTATION_0 = 0, - ROTATION_90 = 90, - ROTATION_180 = 180, - ROTATION_270 = 270 + ROTATION_0 = 0, + ROTATION_90 = 90, + ROTATION_180 = 180, + ROTATION_270 = 270, } export enum FONTMUL { - MUL_1 = 1, - MUL_2 = 2, - MUL_3 = 3, - MUL_4 = 4, - MUL_5 = 5, - MUL_6 = 6, - MUL_7 = 7, - MUL_8 = 8, - MUL_9 = 9, - MUL_10 = 10 + MUL_1 = 1, + MUL_2 = 2, + MUL_3 = 3, + MUL_4 = 4, + MUL_5 = 5, + MUL_6 = 6, + MUL_7 = 7, + MUL_8 = 8, + MUL_9 = 9, + MUL_10 = 10, } export enum BITMAP_MODE { - OVERWRITE = 0, - OR = 1, - XOR = 2 + OVERWRITE = 0, + OR = 1, + XOR = 2, } export enum READABEL { - DISABLE = 0, - EANBEL = 1, + DISABLE = 0, + EANBEL = 1, } export enum Shape { - Square = "0", - Rectangle = "1", + Square = "0", + Rectangle = "1", } export enum EEC { - LEVEL_L = "L", - LEVEL_M = "M", - LEVEL_Q = "Q", - LEVEL_H = "H" + LEVEL_L = "L", + LEVEL_M = "M", + LEVEL_Q = "Q", + LEVEL_H = "H", } export enum BARCODETYPE { - CODE128 = "128", - CODE128M = "128M", - EAN128 = "EAN128", - ITF25 = "25", - ITF25C = "25C", - CODE39 = "39", - CODE39C = "39C", - CODE39S = "39S", - CODE93 = "93", - EAN13 = "EAN13", - EAN13_2 = "EAN13+2", - EAN13_5 = "EAN13+5", - EAN8 = "EAN8", - EAN8_2 = "EAN8+2", - EAN8_5 = "EAN8+5", - CODABAR = "CODA", - POST = "POST", - UPCA = "UPCA", - UPCA_2 = "UPCA+2", - UPCA_5 = "UPCA+5", - UPCE = "UPCE13", - UPCE_2 = "UPCE13+2", - UPCE_5 = "UPCE13+5", - CPOST = "CPOST", - MSI = "MSI", - MSIC = "MSIC", - PLESSEY = "PLESSEY", - ITF14 = "ITF14", - EAN14 = "EAN14" + CODE128 = "128", + CODE128M = "128M", + EAN128 = "EAN128", + ITF25 = "25", + ITF25C = "25C", + CODE39 = "39", + CODE39C = "39C", + CODE39S = "39S", + CODE93 = "93", + EAN13 = "EAN13", + EAN13_2 = "EAN13+2", + EAN13_5 = "EAN13+5", + EAN8 = "EAN8", + EAN8_2 = "EAN8+2", + EAN8_5 = "EAN8+5", + CODABAR = "CODA", + POST = "POST", + UPCA = "UPCA", + UPCA_2 = "UPCA+2", + UPCA_5 = "UPCA+5", + UPCE = "UPCE13", + UPCE_2 = "UPCE13+2", + UPCE_5 = "UPCE13+5", + CPOST = "CPOST", + MSI = "MSI", + MSIC = "MSIC", + PLESSEY = "PLESSEY", + ITF14 = "ITF14", + EAN14 = "EAN14", } export enum RESPONSE_MODE { - ON = "ON", - OFF = "OFF", - BATCH = "BATCH" + ON = "ON", + OFF = "OFF", + BATCH = "BATCH", } export enum ENABLE { - ON = "ON", - OFF = "OFF" + ON = "ON", + OFF = "OFF", } export class LabelCommand { - command: number[] = []; - constructor(width: number, height: number, gap: number) { - this.command = new Array(); - // this.addSize(width, height); - // this.addGap(gap); + command: number[] = []; + constructor(width: number, height: number, gap: number) { + this.command = new Array(); + this.addSize(width, height); + this.addGap(gap); + } + public clrCommand() { + this.command = []; + } + private addStrToCommand(str: string): void { + if (str !== "") { + let bs: Buffer = Buffer.from(str, "utf8"); + for (let i = 0; i < bs.length; ++i) { + this.command.push(bs[i]); + } } - public clrCommand() { - this.command = []; - } - private addStrToCommand(str: string): void { - if (str !== "") { - let bs: Buffer = Buffer.from(str, 'utf8'); - for (let i = 0; i < bs.length; ++i) { - this.command.push(bs[i]); - } - } - } - /** - * 定义两张标签之间的间隙距离 - */ - addGap(gap: number) { - let str = "GAP " + gap + " mm," + 0 + " mm\r\n"; - this.addStrToCommand(str); - } - /** - * 设定黑标高度及使用者定义标签印完后标签额外送出的长度 - */ - addBline(bline: number) { - let str = "BLINE " + bline + " mm," + 0 + " mm\r\n"; - this.addStrToCommand(str); - } - /** - * 定义标签纸的宽度及高度 - */ - addSize(width: number, height: number): void { - const str = "SIZE " + width + " mm," + height + " mm\r\n"; - this.addStrToCommand(str); - } - addCashdrwer(m: FOOT, t1: number, t2: number): void { - let str: string = `CASHDRAWER ${m},${t1},${t2}\r\n`; - this.addStrToCommand(str); - } - addOffset(offset: number): void { - let str: string = `OFFSET ${offset} mm\r\n`; - this.addStrToCommand(str); - } - addSpeed(speed: SPEED): void { - let str: string = `SPEED ${speed / 10}\r\n`; - this.addStrToCommand(str); - } - addDensity(density: DENSITY): void { - let str: string = `DENSITY ${density}\r\n`; - this.addStrToCommand(str); - } - addDirection(direction: DIRECTION, mirror: MIRROR): void { - let str: string = `DIRECTION ${direction}, ${mirror}\r\n`; - this.addStrToCommand(str); - } - addReference(x: number, y: number): void { - let str: string = `REFERENCE ${x}, ${y}\r\n`; - this.addStrToCommand(str); - } - addShift(shift: number): void { - let str: string = `SHIFT ${shift}\r\n`; - this.addStrToCommand(str); - } - addCls(): void { - let str: string = `CLS\r\n`; - this.addStrToCommand(str); - } - addFeed(dot: number): void { - let str: string = `FEED ${dot}\r\n`; - this.addStrToCommand(str); - } - addBackFeed(dot: number): void { - let str: string = `BACKFEED ${dot}\r\n`; - this.addStrToCommand(str); - } - addFormFeed(): void { - let str: string = `FORMFEED\r\n`; - this.addStrToCommand(str); - } - addHome(): void { - let str: string = `HOME\r\n`; - this.addStrToCommand(str); - } - addPrint(m: number, n?: number): void { - let str: string = n ? `PRINT ${m}, ${n}\r\n` : `PRINT ${m}\r\n`; - this.addStrToCommand(str); - } - addCodePage(page: CODEPAGE): void { - let str: string = `CODEPAGE ${page}\r\n`; - this.addStrToCommand(str); - } - addSound(level: number, interval: number): void { - let str: string = `SOUND ${level}, ${interval}\r\n`; - this.addStrToCommand(str); - } - addLimitFeed(n: number): void { - let str: string = `LIMITFEED ${n}\r\n`; - this.addStrToCommand(str); - } - addSelfTest(): void { - let str: string = `SELFTEST\r\n`; - this.addStrToCommand(str); - } - addBar(x: number, y: number, width: number, height: number): void { - let str: string = `BAR ${x}, ${y}, ${width}, ${height}\r\n`; - this.addStrToCommand(str); - } - /*** - * 添加文本 - */ - addText(x: number, y: number, font: FONTTYPE, rotation: ROTATION, Xscal: FONTMUL, Yscal: FONTMUL, text: string): void { - const str = "TEXT " + x + "," + y + ",\"" + font + "\"," + rotation + "," + Xscal + "," + Yscal + ",\"" + text + "\"\r\n"; - this.addStrToCommand(str); - } - addUserCommand(command: string): void { - this.addStrToCommand(command); - } - addCOUNTER(number: number, step: number): void { - let str: string = `SET COUNTER @${number} ${step}\r\n`; - this.addStrToCommand(str); - } - addQueryPrinterStatus(mode: RESPONSE_MODE): void { - let str: string = `SET RESPONSE ${mode}\r\n`; - this.addStrToCommand(str); - } - addPartialCutter(enable: ENABLE): void { - let str: string = `SET PARTIAL_CUTTER ${enable}\r\n`; - this.addStrToCommand(str); - } - addPrintKey(m: number | ENABLE) { - if (typeof m == 'number') { - let str: string = "SET PRINTKEY " + m + "\r\n"; - this.addStrToCommand(str); - } - else { - let str: string = "SET PRINTKEY " + m + "\r\n"; - this.addStrToCommand(str); - } - } - addCutterBatch() { - const str = "SET CUTTER BATCH\r\n"; - this.addStrToCommand(str); - } - addCutterPieces(number: number) { - const str = "SET CUTTER " + number + "\r\n"; - this.addStrToCommand(str); - } - addQueryPrinterCodePage() { - const str = "~!I\r\n"; - this.addStrToCommand(str); - } - addQueryPrinterFile() { - const str = "~!F\r\n"; - this.addStrToCommand(str); - } - addQueryPrinterMemory() { - const str = "~!A\r\n"; - this.addStrToCommand(str); - } - addQueryPrinterLife() { - const str = "~!@\r\n"; - this.addStrToCommand(str); - } - addResetPrinter(): void { - this.command.push(27, 33, 82); - } - addReprint(enable: RESPONSE_MODE): void { - let str: string = `SET REPRINT ${enable}\r\n`; - this.addStrToCommand(str); - } - addHead(enable: ENABLE): void { - let str: string = `SET HEAD ${enable}\r\n`; - this.addStrToCommand(str); + } + /** + * 定义两张标签之间的间隙距离 + */ + addGap(gap: number) { + let str = "GAP " + gap + " mm," + 0 + " mm\r\n"; + this.addStrToCommand(str); + } + /** + * 设定黑标高度及使用者定义标签印完后标签额外送出的长度 + */ + addBline(bline: number) { + let str = "BLINE " + bline + " mm," + 0 + " mm\r\n"; + this.addStrToCommand(str); + } + /** + * 定义标签纸的宽度及高度 + */ + addSize(width: number, height: number): void { + const str = "SIZE " + width + " mm," + height + " mm\r\n"; + this.addStrToCommand(str); + } + addCashdrwer(m: FOOT, t1: number, t2: number): void { + let str: string = `CASHDRAWER ${m},${t1},${t2}\r\n`; + this.addStrToCommand(str); + } + addOffset(offset: number): void { + let str: string = `OFFSET ${offset} mm\r\n`; + this.addStrToCommand(str); + } + addSpeed(speed: SPEED): void { + let str: string = `SPEED ${speed / 10}\r\n`; + this.addStrToCommand(str); + } + addDensity(density: DENSITY): void { + let str: string = `DENSITY ${density}\r\n`; + this.addStrToCommand(str); + } + addDirection(direction: DIRECTION, mirror: MIRROR): void { + let str: string = `DIRECTION ${direction}, ${mirror}\r\n`; + this.addStrToCommand(str); + } + addReference(x: number, y: number): void { + let str: string = `REFERENCE ${x}, ${y}\r\n`; + this.addStrToCommand(str); + } + addShift(shift: number): void { + let str: string = `SHIFT ${shift}\r\n`; + this.addStrToCommand(str); + } + addCls(): void { + let str: string = `CLS\r\n`; + this.addStrToCommand(str); + } + addFeed(dot: number): void { + let str: string = `FEED ${dot}\r\n`; + this.addStrToCommand(str); + } + addBackFeed(dot: number): void { + let str: string = `BACKFEED ${dot}\r\n`; + this.addStrToCommand(str); + } + addFormFeed(): void { + let str: string = `FORMFEED\r\n`; + this.addStrToCommand(str); + } + addHome(): void { + let str: string = `HOME\r\n`; + this.addStrToCommand(str); + } + addPrint(m: number, n?: number): void { + let str: string = n ? `PRINT ${m}, ${n}\r\n` : `PRINT ${m}\r\n`; + this.addStrToCommand(str); + } + addCodePage(page: CODEPAGE): void { + let str: string = `CODEPAGE ${page}\r\n`; + this.addStrToCommand(str); + } + /** + * 控制打印机蜂鳴器发聲的頻率,共有 10 阶,并可由 “interval” 参数设定音与音的间隔时间 + * @param level 音阶:0~9 + * @param interval 间隔时间: 1~4095 + */ + addSound(level: number, interval: number): void { + let str: string = `SOUND ${level}, ${interval}\r\n`; + this.addStrToCommand(str); + } + /** + * 限定定间隙校正执行的最大长度,若在此长度范围内无法测得间隙存在,则将感应器模式定在连续纸模式下 + * @param n 间隙校正的最大长度 + */ + addLimitFeed(n: number): void { + let str: string = `LIMITFEED ${n}\r\n`; + this.addStrToCommand(str); + } + /** + * 功能:不经自测动作,直接将打印机讯息印在标签纸上。 + */ + addSelfTest(): void { + let str: string = `SELFTEST\r\n`; + this.addStrToCommand(str); + } + addBar(x: number, y: number, width: number, height: number): void { + let str: string = `BAR ${x}, ${y}, ${width}, ${height}\r\n`; + this.addStrToCommand(str); + } + /*** + * 添加文本 + */ + addText( + x: number, + y: number, + font: FONTTYPE, + rotation: ROTATION, + Xscal: FONTMUL, + Yscal: FONTMUL, + text: string + ): void { + const str = + "TEXT " + + x + + "," + + y + + ',"' + + font + + '",' + + rotation + + "," + + Xscal + + "," + + Yscal + + ',"' + + text + + '"\r\n'; + this.addStrToCommand(str); + } + addUserCommand(command: string): void { + this.addStrToCommand(command); + } + addCOUNTER(number: number, step: number): void { + let str: string = `SET COUNTER @${number} ${step}\r\n`; + this.addStrToCommand(str); + } + addQueryPrinterStatus(mode: RESPONSE_MODE): void { + let str: string = `SET RESPONSE ${mode}\r\n`; + this.addStrToCommand(str); + } + addPartialCutter(enable: ENABLE): void { + let str: string = `SET PARTIAL_CUTTER ${enable}\r\n`; + this.addStrToCommand(str); + } + addPrintKey(m: number | ENABLE) { + if (typeof m == "number") { + let str: string = "SET PRINTKEY " + m + "\r\n"; + this.addStrToCommand(str); + } else { + let str: string = "SET PRINTKEY " + m + "\r\n"; + this.addStrToCommand(str); } + } + addCutterBatch() { + const str = "SET CUTTER BATCH\r\n"; + this.addStrToCommand(str); + } + addCutterPieces(number: number) { + const str = "SET CUTTER " + number + "\r\n"; + this.addStrToCommand(str); + } + addQueryPrinterCodePage() { + const str = "~!I\r\n"; + this.addStrToCommand(str); + } + addQueryPrinterFile() { + const str = "~!F\r\n"; + this.addStrToCommand(str); + } + addQueryPrinterMemory() { + const str = "~!A\r\n"; + this.addStrToCommand(str); + } + addQueryPrinterLife() { + const str = "~!@\r\n"; + this.addStrToCommand(str); + } + addResetPrinter(): void { + this.command.push(27, 33, 82); + } + addReprint(enable: RESPONSE_MODE): void { + let str: string = `SET REPRINT ${enable}\r\n`; + this.addStrToCommand(str); + } + addHead(enable: ENABLE): void { + let str: string = `SET HEAD ${enable}\r\n`; + this.addStrToCommand(str); + } - addRibbon(enable: ENABLE): void { - let str: string = `SET RIBBON ${enable}\r\n`; - this.addStrToCommand(str); - } + addRibbon(enable: ENABLE): void { + let str: string = `SET RIBBON ${enable}\r\n`; + this.addStrToCommand(str); + } - addKeyOne(enable: ENABLE): void { - let str: string = `SET KEY1 ${enable}\r\n`; - this.addStrToCommand(str); - } + addKeyOne(enable: ENABLE): void { + let str: string = `SET KEY1 ${enable}\r\n`; + this.addStrToCommand(str); + } - addKeyTwo(enable: ENABLE): void { - let str: string = `SET KEY2 ${enable}\r\n`; - this.addStrToCommand(str); - } - addPeel(enable: RESPONSE_MODE): void { - let str: string = `SET PEEL ${enable}\r\n`; - this.addStrToCommand(str); - } + addKeyTwo(enable: ENABLE): void { + let str: string = `SET KEY2 ${enable}\r\n`; + this.addStrToCommand(str); + } + addPeel(enable: RESPONSE_MODE): void { + let str: string = `SET PEEL ${enable}\r\n`; + this.addStrToCommand(str); + } - addTear(mode: RESPONSE_MODE): void { - let str: string = `SET TEAR ${mode}\r\n`; - this.addStrToCommand(str); - } + addTear(mode: RESPONSE_MODE): void { + let str: string = `SET TEAR ${mode}\r\n`; + this.addStrToCommand(str); + } - addCutter(enable: RESPONSE_MODE): void { - let str: string = `SET CUTTER ${enable}\r\n`; - this.addStrToCommand(str); - } - /** - * 获取命令 - */ - getCommand() { - return this.command; - } - /** - * 获取命令字符串 - */ - getCommandStr(command: number[]) { - let str = ""; - for (let i = 0; i < command.length; i++) { - str += String.fromCharCode(command[i]); - } - return str; - } - addQueryPrinterType(): void { - let str: string = `~!T\r\n`; - this.addStrToCommand(str); - } - public addQRCode(x: number, y: number, level: EEC, cellwidth: number, rotation: ROTATION, data: string): void { - let str: string = `QRCODE ${x}, ${y}, ${level}, ${cellwidth}, A, ${rotation}, "${data}"\r\n`; - this.addStrToCommand(str); - } - addReverse(x: number, y: number, xwidth: number, yheight: number): void { - let str = `REVERSE ${x}, ${y}, ${xwidth}, ${yheight}\r\n`; - this.addStrToCommand(str); - } - addErase(x: number, y: number, xwidth: number, yheight: number): void { - let str = `ERASE ${x},${y},${xwidth},${yheight}\r\n`; - this.addStrToCommand(str); - } - addDMATRIX(x: number, y: number, width: number, height: number, content: string): void { - let str = `DMATRIX ${x},${y},${width},${height},"${content}"\r\n`; - this.addStrToCommand(str); - } - add1DBarcode(x: number, y: number, type: BARCODETYPE, height: number, readable: READABEL, rotation: ROTATION, narrow: number, width: number, content: string): void { - let str = `BARCODE ${x},${y},"${type}",${height},${readable},${rotation},${narrow},${width},"${content}"\r\n`; - this.addStrToCommand(str); - } - - addBox(x: number, y: number, xend: number, yend: number, thickness: number): void { - let str = `BOX ${x},${y},${xend},${yend},${thickness}\r\n`; - this.addStrToCommand(str); + addCutter(enable: RESPONSE_MODE): void { + let str: string = `SET CUTTER ${enable}\r\n`; + this.addStrToCommand(str); + } + /** + * 获取命令 + */ + getCommand() { + return this.command; + } + /** + * 获取命令字符串 + */ + getCommandStr(command: number[]) { + let str = ""; + for (let i = 0; i < command.length; i++) { + str += String.fromCharCode(command[i]); } + return str; + } + addQueryPrinterType(): void { + let str: string = `~!T\r\n`; + this.addStrToCommand(str); + } + public addQRCode( + x: number, + y: number, + level: EEC, + cellwidth: number, + rotation: ROTATION, + data: string + ): void { + let str: string = `QRCODE ${x}, ${y}, ${level}, ${cellwidth}, A, ${rotation}, "${data}"\r\n`; + this.addStrToCommand(str); + } + addReverse(x: number, y: number, xwidth: number, yheight: number): void { + let str = `REVERSE ${x}, ${y}, ${xwidth}, ${yheight}\r\n`; + this.addStrToCommand(str); + } + addErase(x: number, y: number, xwidth: number, yheight: number): void { + let str = `ERASE ${x},${y},${xwidth},${yheight}\r\n`; + this.addStrToCommand(str); + } + addDMATRIX( + x: number, + y: number, + width: number, + height: number, + content: string + ): void { + let str = `DMATRIX ${x},${y},${width},${height},"${content}"\r\n`; + this.addStrToCommand(str); + } + add1DBarcode( + x: number, + y: number, + type: BARCODETYPE, + height: number, + readable: READABEL, + rotation: ROTATION, + narrow: number, + width: number, + content: string + ): void { + let str = `BARCODE ${x},${y},"${type}",${height},${readable},${rotation},${narrow},${width},"${content}"\r\n`; + this.addStrToCommand(str); + } + addBox( + x: number, + y: number, + xend: number, + yend: number, + thickness: number + ): void { + let str = `BOX ${x},${y},${xend},${yend},${thickness}\r\n`; + this.addStrToCommand(str); + } } - diff --git a/src/index.ts b/src/index.ts index de61ba6..f4c8ea9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,12 +1 @@ -export * from './command' - -import { FONTMUL, FONTTYPE, LabelCommand, ROTATION } from '@/command/Label' - -function main() { - let label = new LabelCommand(50, 30, 0); - label.addText(0, 0, FONTTYPE.FONT_1, ROTATION.ROTATION_0, FONTMUL.MUL_1, FONTMUL.MUL_1, 'Hello World'); - var command = label.getCommand(); - console.log(command);// 获取字节码 - console.log(label.getCommandStr(command)); -} -main(); \ No newline at end of file +export * from "./command";