diff --git a/plugins/barcode-generator/barcode-generator.zip b/plugins/barcode-generator/barcode-generator.zip index 4990d6af..88843a99 100644 Binary files a/plugins/barcode-generator/barcode-generator.zip and b/plugins/barcode-generator/barcode-generator.zip differ diff --git a/plugins/barcode-generator/src/composer.json b/plugins/barcode-generator/src/composer.json index 7c00d237..9bc19153 100644 --- a/plugins/barcode-generator/src/composer.json +++ b/plugins/barcode-generator/src/composer.json @@ -10,10 +10,12 @@ } }, "require": { - "tecnickcom/tc-lib-barcode": "^1.17", "monolog/monolog": "^2.7", "symfony/http-foundation": "^6.0", - "ubnt/ucrm-plugin-sdk": "^0.10.0" + "ubnt/ucrm-plugin-sdk": "^0.10.0", + "symfony/filesystem": "^6.4", + "tecnickcom/tc-lib-barcode": "^2.2", + "nette/utils": "^4.0" }, "require-dev": { "roave/security-advisories": "dev-latest" diff --git a/plugins/barcode-generator/src/composer.lock b/plugins/barcode-generator/src/composer.lock index 7c1a83f1..e75cfbc9 100644 --- a/plugins/barcode-generator/src/composer.lock +++ b/plugins/barcode-generator/src/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9274e2d671824364963f530b055569f3", + "content-hash": "66f9ba65f8265bc39a16076ab89d5577", "packages": [ { "name": "guzzlehttp/guzzle", @@ -435,6 +435,92 @@ ], "time": "2022-06-09T08:59:12+00:00" }, + { + "name": "nette/utils", + "version": "v4.0.4", + "source": { + "type": "git", + "url": "https://github.com/nette/utils.git", + "reference": "d3ad0aa3b9f934602cb3e3902ebccf10be34d218" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/utils/zipball/d3ad0aa3b9f934602cb3e3902ebccf10be34d218", + "reference": "d3ad0aa3b9f934602cb3e3902ebccf10be34d218", + "shasum": "" + }, + "require": { + "php": ">=8.0 <8.4" + }, + "conflict": { + "nette/finder": "<3", + "nette/schema": "<1.2.2" + }, + "require-dev": { + "jetbrains/phpstorm-attributes": "dev-master", + "nette/tester": "^2.5", + "phpstan/phpstan": "^1.0", + "tracy/tracy": "^2.9" + }, + "suggest": { + "ext-gd": "to use Image", + "ext-iconv": "to use Strings::webalize(), toAscii(), chr() and reverse()", + "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()", + "ext-json": "to use Nette\\Utils\\Json", + "ext-mbstring": "to use Strings::lower() etc...", + "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0-only", + "GPL-3.0-only" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "🛠 Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.", + "homepage": "https://nette.org", + "keywords": [ + "array", + "core", + "datetime", + "images", + "json", + "nette", + "paginator", + "password", + "slugify", + "string", + "unicode", + "utf-8", + "utility", + "validation" + ], + "support": { + "issues": "https://github.com/nette/utils/issues", + "source": "https://github.com/nette/utils/tree/v4.0.4" + }, + "time": "2024-01-17T16:50:36+00:00" + }, { "name": "psr/http-client", "version": "1.0.3", @@ -758,16 +844,16 @@ }, { "name": "symfony/filesystem", - "version": "v6.4.0", + "version": "v6.4.8", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "952a8cb588c3bc6ce76f6023000fb932f16a6e59" + "reference": "4d37529150e7081c51b3c5d5718c55a04a9503f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/952a8cb588c3bc6ce76f6023000fb932f16a6e59", - "reference": "952a8cb588c3bc6ce76f6023000fb932f16a6e59", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/4d37529150e7081c51b3c5d5718c55a04a9503f3", + "reference": "4d37529150e7081c51b3c5d5718c55a04a9503f3", "shasum": "" }, "require": { @@ -775,6 +861,9 @@ "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.8" }, + "require-dev": { + "symfony/process": "^5.4|^6.4|^7.0" + }, "type": "library", "autoload": { "psr-4": { @@ -801,7 +890,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.4.0" + "source": "https://github.com/symfony/filesystem/tree/v6.4.8" }, "funding": [ { @@ -817,7 +906,7 @@ "type": "tidelift" } ], - "time": "2023-07-26T17:27:13+00:00" + "time": "2024-05-31T14:49:08+00:00" }, { "name": "symfony/http-foundation", @@ -1058,16 +1147,16 @@ }, { "name": "tecnickcom/tc-lib-barcode", - "version": "1.17.14", + "version": "2.2.1", "source": { "type": "git", "url": "https://github.com/tecnickcom/tc-lib-barcode.git", - "reference": "4907ef1e384dbb7d3100c897925e7dc071a419a3" + "reference": "6877202fe7b3f746f22032e22d454c60c3db20fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tecnickcom/tc-lib-barcode/zipball/4907ef1e384dbb7d3100c897925e7dc071a419a3", - "reference": "4907ef1e384dbb7d3100c897925e7dc071a419a3", + "url": "https://api.github.com/repos/tecnickcom/tc-lib-barcode/zipball/6877202fe7b3f746f22032e22d454c60c3db20fc", + "reference": "6877202fe7b3f746f22032e22d454c60c3db20fc", "shasum": "" }, "require": { @@ -1075,16 +1164,14 @@ "ext-date": "*", "ext-gd": "*", "ext-pcre": "*", - "php": ">=5.4", - "tecnickcom/tc-lib-color": "^1.14" + "php": ">=8.0", + "tecnickcom/tc-lib-color": "^2.0" }, "require-dev": { - "pdepend/pdepend": "2.10.2", - "phploc/phploc": "7.0.2 || 6.0.2 || 5.0.0 || 4.0.1 || 3.0.1 || 2.1.5", - "phpmd/phpmd": "2.11.1", - "phpunit/phpunit": "9.5.11 || 8.5.13 || 7.5.20 || 6.5.14 || 5.7.27 || 4.8.36", - "sebastian/phpcpd": "6.0.3 || 5.0.2 || 4.1.0 || 3.0.1 || 2.0.4", - "squizlabs/php_codesniffer": "3.6.2 || 2.9.2" + "pdepend/pdepend": "2.13.0", + "phpmd/phpmd": "2.13.0", + "phpunit/phpunit": "10.1.2 || 9.6.13", + "squizlabs/php_codesniffer": "3.7.2" }, "type": "library", "autoload": { @@ -1094,7 +1181,7 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-3.0" + "LGPL-3.0-or-later" ], "authors": [ { @@ -1117,6 +1204,9 @@ "EAN 13", "EAN 8", "ECC200", + "ISO IEC 15438 2006", + "ISO IEC 16022", + "ISO IEC 24778 2008", "Intelligent Mail Barcode", "Interleaved 2 of 5", "KIX", @@ -1133,6 +1223,7 @@ "USD-3", "USPS-B-3200", "USS-93", + "aztec", "barcode", "datamatrix", "pdf417", @@ -1144,7 +1235,7 @@ ], "support": { "issues": "https://github.com/tecnickcom/tc-lib-barcode/issues", - "source": "https://github.com/tecnickcom/tc-lib-barcode/tree/1.17.14" + "source": "https://github.com/tecnickcom/tc-lib-barcode/tree/2.2.1" }, "funding": [ { @@ -1152,33 +1243,31 @@ "type": "custom" } ], - "time": "2022-06-14T09:12:04+00:00" + "time": "2024-04-12T04:55:21+00:00" }, { "name": "tecnickcom/tc-lib-color", - "version": "1.14.14", + "version": "2.0.8", "source": { "type": "git", "url": "https://github.com/tecnickcom/tc-lib-color.git", - "reference": "f9e45c59496418227184626ad31e83470153c11f" + "reference": "62a67d7795a3d303e5029dd3ffc7b2d5f8bf614b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tecnickcom/tc-lib-color/zipball/f9e45c59496418227184626ad31e83470153c11f", - "reference": "f9e45c59496418227184626ad31e83470153c11f", + "url": "https://api.github.com/repos/tecnickcom/tc-lib-color/zipball/62a67d7795a3d303e5029dd3ffc7b2d5f8bf614b", + "reference": "62a67d7795a3d303e5029dd3ffc7b2d5f8bf614b", "shasum": "" }, "require": { "ext-pcre": "*", - "php": ">=5.3" + "php": ">=8.0" }, "require-dev": { - "pdepend/pdepend": "2.10.2", - "phploc/phploc": "7.0.2 || 6.0.2 || 5.0.0 || 4.0.1 || 3.0.1 || 2.1.5", - "phpmd/phpmd": "2.11.1", - "phpunit/phpunit": "9.5.11 || 8.5.13 || 7.5.20 || 6.5.14 || 5.7.27 || 4.8.36", - "sebastian/phpcpd": "6.0.3 || 5.0.2 || 4.1.0 || 3.0.1 || 2.0.4", - "squizlabs/php_codesniffer": "3.6.2 || 2.9.2" + "pdepend/pdepend": "2.13.0", + "phpmd/phpmd": "2.13.0", + "phpunit/phpunit": "10.1.2 || 9.6.13", + "squizlabs/php_codesniffer": "3.7.2" }, "type": "library", "autoload": { @@ -1188,7 +1277,7 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-3.0" + "LGPL-3.0-or-later" ], "authors": [ { @@ -1215,7 +1304,7 @@ ], "support": { "issues": "https://github.com/tecnickcom/tc-lib-color/issues", - "source": "https://github.com/tecnickcom/tc-lib-color/tree/1.14.14" + "source": "https://github.com/tecnickcom/tc-lib-color/tree/2.0.8" }, "funding": [ { @@ -1223,7 +1312,7 @@ "type": "custom" } ], - "time": "2022-06-14T09:09:40+00:00" + "time": "2024-04-12T04:53:29+00:00" }, { "name": "ubnt/ucrm-plugin-sdk", diff --git a/plugins/barcode-generator/src/hook_install.php b/plugins/barcode-generator/src/hook_install.php new file mode 100644 index 00000000..691b624c --- /dev/null +++ b/plugins/barcode-generator/src/hook_install.php @@ -0,0 +1,21 @@ +pushHandler(new StreamHandler('data/plugin.log')); + +$logManager = PluginLogManager::create(); + +(new TokenInstaller())->install(); + +$logger->info('Security token has been generated. Use it as a part of request string.'); diff --git a/plugins/barcode-generator/src/manifest.json b/plugins/barcode-generator/src/manifest.json index e21e9200..17b1b44e 100644 --- a/plugins/barcode-generator/src/manifest.json +++ b/plugins/barcode-generator/src/manifest.json @@ -19,8 +19,8 @@ "configuration": [ { "key": "token", - "label": "Security token", - "description": "Fill it with random string and use it as a part of request.", + "label": "Security token (token)", + "description": "This is a generated random string for use as a part of the request.", "required": 1 } ] diff --git a/plugins/barcode-generator/src/src/Service/TokenInstaller.php b/plugins/barcode-generator/src/src/Service/TokenInstaller.php new file mode 100644 index 00000000..4eec45b8 --- /dev/null +++ b/plugins/barcode-generator/src/src/Service/TokenInstaller.php @@ -0,0 +1,28 @@ +filesystem = new Filesystem(); + $this->token = Strings::generateUuidWithDashes(); + } + + public function install(): void + { + $this->filesystem->dumpFile('data/config.json', Json::encode(['token' => $this->token])); + } +} diff --git a/plugins/barcode-generator/src/src/Util/Strings.php b/plugins/barcode-generator/src/src/Util/Strings.php new file mode 100644 index 00000000..6b4c7465 --- /dev/null +++ b/plugins/barcode-generator/src/src/Util/Strings.php @@ -0,0 +1,19 @@ +