From a7b0cb4413a3297f7449e881ae2c9b48bc60291d Mon Sep 17 00:00:00 2001 From: Puria Nafisi Azizi Date: Wed, 28 Feb 2024 11:59:50 +0100 Subject: [PATCH] feat: better reporting. Unpack zenroom trace (#66) * feat: better reporting. Unpack zenroom trace * fix: Fix tests and allow reply with broken schema --- CHANGELOG.md | 14 +- package.json | 18 +- pnpm-lock.yaml | 667 ++++++++++++++++++---------- src/cli.ts | 17 +- src/error.ts | 30 ++ src/index.ts | 82 +++- src/slangroom.ts | 35 +- src/types.ts | 4 +- src/utils.ts | 13 +- tests/fixtures/my-keyring.keys.json | 20 +- tests/workflow.stepci.yml | 33 +- tsconfig.json | 1 + 12 files changed, 607 insertions(+), 327 deletions(-) create mode 100644 src/error.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e55a9a..cca9554 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,31 +1,27 @@ # [1.16.0](https://github.com/forkbombeu/ncr/compare/v1.15.1...v1.16.0) (2024-02-27) - ### Features -* warn missing schema when introspect brokes ([#64](https://github.com/forkbombeu/ncr/issues/64)) ([be8cbf7](https://github.com/forkbombeu/ncr/commit/be8cbf7573f445de44501b16a36f9f74d5fa50d6)) +- warn missing schema when introspect brokes ([#64](https://github.com/forkbombeu/ncr/issues/64)) ([be8cbf7](https://github.com/forkbombeu/ncr/commit/be8cbf7573f445de44501b16a36f9f74d5fa50d6)) ## [1.15.1](https://github.com/forkbombeu/ncr/compare/v1.15.0...v1.15.1) (2024-02-27) - ### Bug Fixes -* tests with new zenroom version up ([706106f](https://github.com/forkbombeu/ncr/commit/706106fb57bb8485a3e2ef3869ff54da574f6afd)) -* update deps @slangroom/zencode ([#63](https://github.com/forkbombeu/ncr/issues/63)) ([4329a84](https://github.com/forkbombeu/ncr/commit/4329a84c4ec47473b9c159662d91938fc6bca9a3)) +- tests with new zenroom version up ([706106f](https://github.com/forkbombeu/ncr/commit/706106fb57bb8485a3e2ef3869ff54da574f6afd)) +- update deps @slangroom/zencode ([#63](https://github.com/forkbombeu/ncr/issues/63)) ([4329a84](https://github.com/forkbombeu/ncr/commit/4329a84c4ec47473b9c159662d91938fc6bca9a3)) # [1.15.0](https://github.com/forkbombeu/ncr/compare/v1.14.2...v1.15.0) (2024-02-27) - ### Features -* enahnce a little bit the error handling ([#62](https://github.com/forkbombeu/ncr/issues/62)) ([67e33e1](https://github.com/forkbombeu/ncr/commit/67e33e1b949a1c0010a3b3513e1b2dd806497e2e)), closes [#54](https://github.com/forkbombeu/ncr/issues/54) +- enahnce a little bit the error handling ([#62](https://github.com/forkbombeu/ncr/issues/62)) ([67e33e1](https://github.com/forkbombeu/ncr/commit/67e33e1b949a1c0010a3b3513e1b2dd806497e2e)), closes [#54](https://github.com/forkbombeu/ncr/issues/54) ## [1.14.2](https://github.com/forkbombeu/ncr/compare/v1.14.1...v1.14.2) (2024-02-27) - ### Bug Fixes -* update also the package.json on release ([#61](https://github.com/forkbombeu/ncr/issues/61)) ([1c9931c](https://github.com/forkbombeu/ncr/commit/1c9931c86166fccabc4005110494e5ed692ad35f)) +- update also the package.json on release ([#61](https://github.com/forkbombeu/ncr/issues/61)) ([1c9931c](https://github.com/forkbombeu/ncr/commit/1c9931c86166fccabc4005110494e5ed692ad35f)) ## [1.14.1](https://github.com/forkbombeu/ncr/compare/v1.14.0...v1.14.1) (2024-02-27) diff --git a/package.json b/package.json index ed6db75..801dc91 100644 --- a/package.json +++ b/package.json @@ -43,23 +43,24 @@ "@slangroom/fs": "^1.14.1", "@slangroom/git": "^1.14.1", "@slangroom/http": "^1.14.1", + "@slangroom/json-schema": "^1.14.1", "@slangroom/oauth": "^1.16.0", + "@slangroom/pocketbase": "^1.17.0", "@slangroom/wallet": "^1.14.1", "@slangroom/zencode": "^1.18.0", "@tgwf/co2": "^0.14.3", - "@typescript-eslint/parser": "^7.0.2", + "@typescript-eslint/parser": "^7.1.0", "ajv": "^8.12.0", "ajv-formats": "^2.1.1", - "commander": "^11.1.0", + "commander": "^12.0.0", "dotenv": "^16.4.5", "fs-extra": "^11.2.0", "live-directory": "^3.0.3", "lodash": "^4.17.21", "mime": "^4.0.1", - "pino": "^8.19.0", "prom-client": "^15.0.0", "uWebSockets.js": "github:uNetworking/uWebSockets.js#semver:^20", - "zenroom": "^4.12.2" + "zenroom": "^4.13.0" }, "devDependencies": { "@rollup/plugin-commonjs": "^25.0.7", @@ -72,13 +73,16 @@ "@semantic-release/npm": "^11.0.2", "@semantic-release/release-notes-generator": "^12.1.0", "@sinclair/typebox": "^0.32.14", + "@slangroom/qrcode": "^1.14.1", + "@slangroom/redis": "^1.14.1", + "@slangroom/shell": "^1.15.0", "@swc/core": "^1.4.2", "@swc/helpers": "^0.5.6", "@types/fs-extra": "^11.0.4", "@types/jest": "^29.5.12", "@types/lodash": "^4.14.202", + "@types/node": "^20.11.21", "@types/lodash.isequal": "^4.5.8", - "@types/node": "^20.11.20", "@types/tgwf__co2": "^0.14.1", "jest": "^29.7.0", "lodash.isequal": "^4.5.0", @@ -95,6 +99,8 @@ "stepci": "^2.8.0", "ts-jest": "^29.1.2", "ts-node": "^10.9.2", - "typescript": "^5.3.3" + "tslog": "^4.9.2", + "typescript": "^5.3.3", + "winston": "^3.11.0" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 774bc6f..103dfe7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,34 +7,40 @@ settings: dependencies: '@slangroom/core': specifier: ^1.14.1 - version: 1.14.1(zenroom@4.12.2) + version: 1.14.1(zenroom@4.13.0) '@slangroom/ethereum': specifier: ^1.14.1 - version: 1.14.1(typescript@5.3.3)(zenroom@4.12.2) + version: 1.14.1(typescript@5.3.3)(zenroom@4.13.0) '@slangroom/fs': specifier: ^1.14.1 - version: 1.14.1(zenroom@4.12.2) + version: 1.14.1(zenroom@4.13.0) '@slangroom/git': specifier: ^1.14.1 - version: 1.14.1(zenroom@4.12.2) + version: 1.14.1(zenroom@4.13.0) '@slangroom/http': specifier: ^1.14.1 - version: 1.14.1(zenroom@4.12.2) + version: 1.14.1(zenroom@4.13.0) + '@slangroom/json-schema': + specifier: ^1.14.1 + version: 1.14.1(zenroom@4.13.0) '@slangroom/oauth': specifier: ^1.16.0 - version: 1.16.0(zenroom@4.12.2) + version: 1.16.0(zenroom@4.13.0) + '@slangroom/pocketbase': + specifier: ^1.17.0 + version: 1.17.0(zenroom@4.13.0) '@slangroom/wallet': specifier: ^1.14.1 - version: 1.14.1(zenroom@4.12.2) + version: 1.14.1(zenroom@4.13.0) '@slangroom/zencode': specifier: ^1.18.0 - version: 1.18.0(zenroom@4.12.2) + version: 1.18.0(zenroom@4.13.0) '@tgwf/co2': specifier: ^0.14.3 version: 0.14.3 '@typescript-eslint/parser': - specifier: ^7.0.2 - version: 7.0.2(eslint@8.57.0)(typescript@5.3.3) + specifier: ^7.1.0 + version: 7.1.0(eslint@8.57.0)(typescript@5.3.3) ajv: specifier: ^8.12.0 version: 8.12.0 @@ -42,8 +48,8 @@ dependencies: specifier: ^2.1.1 version: 2.1.1(ajv@8.12.0) commander: - specifier: ^11.1.0 - version: 11.1.0 + specifier: ^12.0.0 + version: 12.0.0 dotenv: specifier: ^16.4.5 version: 16.4.5 @@ -59,9 +65,6 @@ dependencies: mime: specifier: ^4.0.1 version: 4.0.1 - pino: - specifier: ^8.19.0 - version: 8.19.0 prom-client: specifier: ^15.0.0 version: 15.1.0 @@ -69,8 +72,8 @@ dependencies: specifier: github:uNetworking/uWebSockets.js#semver:^20 version: github.com/uNetworking/uWebSockets.js/fca27c05066342b01951782248640c8013b37196 zenroom: - specifier: ^4.12.2 - version: 4.12.2 + specifier: ^4.13.0 + version: 4.13.0 devDependencies: '@rollup/plugin-commonjs': @@ -103,6 +106,15 @@ devDependencies: '@sinclair/typebox': specifier: ^0.32.14 version: 0.32.14 + '@slangroom/qrcode': + specifier: ^1.14.1 + version: 1.14.1(zenroom@4.13.0) + '@slangroom/redis': + specifier: ^1.14.1 + version: 1.14.1(zenroom@4.13.0) + '@slangroom/shell': + specifier: ^1.15.0 + version: 1.15.0(zenroom@4.13.0) '@swc/core': specifier: ^1.4.2 version: 1.4.2(@swc/helpers@0.5.6) @@ -122,14 +134,14 @@ devDependencies: specifier: ^4.5.8 version: 4.5.8 '@types/node': - specifier: ^20.11.20 - version: 20.11.20 + specifier: ^20.11.21 + version: 20.11.21 '@types/tgwf__co2': specifier: ^0.14.1 version: 0.14.1 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@20.11.20)(ts-node@10.9.2) + version: 29.7.0(@types/node@20.11.21)(ts-node@10.9.2) lodash.isequal: specifier: ^4.5.0 version: 4.5.0 @@ -171,10 +183,16 @@ devDependencies: version: 29.1.2(@babel/core@7.23.3)(jest@29.7.0)(typescript@5.3.3) ts-node: specifier: ^10.9.2 - version: 10.9.2(@swc/core@1.4.2)(@types/node@20.11.20)(typescript@5.3.3) + version: 10.9.2(@swc/core@1.4.2)(@types/node@20.11.21)(typescript@5.3.3) + tslog: + specifier: ^4.9.2 + version: 4.9.2 typescript: specifier: ^5.3.3 version: 5.3.3 + winston: + specifier: ^3.11.0 + version: 3.11.0 packages: @@ -614,22 +632,18 @@ packages: '@chevrotain/gast': 10.5.0 '@chevrotain/types': 10.5.0 lodash: 4.17.21 - dev: false /@chevrotain/gast@10.5.0: resolution: {integrity: sha512-pXdMJ9XeDAbgOWKuD1Fldz4ieCs6+nLNmyVhe2gZVqoO7v8HXuHYs5OV2EzUtbuai37TlOAQHrTDvxMnvMJz3A==} dependencies: '@chevrotain/types': 10.5.0 lodash: 4.17.21 - dev: false /@chevrotain/types@10.5.0: resolution: {integrity: sha512-f1MAia0x/pAVPWH/T73BJVyO2XU5tI4/iE7cnxb7tqdNTNhQI3Uq3XkqcoteTmD4t1aM0LbHCJOhgIDn07kl2A==} - dev: false /@chevrotain/utils@10.5.0: resolution: {integrity: sha512-hBzuU5+JjB2cqNZyszkDHZgOSrUUT8V3dhgRl8Q9Gp6dAj/H5+KILGjbhDpc3Iy9qmqlm/akuOI2ut9VUtzJxQ==} - dev: false /@colors/colors@1.5.0: resolution: {integrity: sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==} @@ -638,6 +652,11 @@ packages: dev: true optional: true + /@colors/colors@1.6.0: + resolution: {integrity: sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==} + engines: {node: '>=0.1.90'} + dev: true + /@cspotcode/source-map-support@0.8.1: resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} engines: {node: '>=12'} @@ -645,6 +664,14 @@ packages: '@jridgewell/trace-mapping': 0.3.9 dev: true + /@dabh/diagnostics@2.0.3: + resolution: {integrity: sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==} + dependencies: + colorspace: 1.1.4 + enabled: 2.0.0 + kuler: 2.0.0 + dev: true + /@eslint-community/eslint-utils@4.4.0(eslint@8.57.0): resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -710,7 +737,7 @@ packages: engines: {node: ^8.13.0 || >=10.10.0} dependencies: '@grpc/proto-loader': 0.7.10 - '@types/node': 20.11.20 + '@types/node': 20.11.21 dev: true /@grpc/proto-loader@0.7.10: @@ -775,7 +802,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 - '@types/node': 20.11.20 + '@types/node': 20.11.21 chalk: 4.1.2 jest-message-util: 29.7.0 jest-util: 29.7.0 @@ -796,14 +823,14 @@ packages: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.11.20 + '@types/node': 20.11.21 ansi-escapes: 4.3.2 chalk: 4.1.2 ci-info: 3.9.0 exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@20.11.20)(ts-node@10.9.2) + jest-config: 29.7.0(@types/node@20.11.21)(ts-node@10.9.2) jest-haste-map: 29.7.0 jest-message-util: 29.7.0 jest-regex-util: 29.6.3 @@ -831,7 +858,7 @@ packages: dependencies: '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.11.20 + '@types/node': 20.11.21 jest-mock: 29.7.0 dev: true @@ -858,7 +885,7 @@ packages: dependencies: '@jest/types': 29.6.3 '@sinonjs/fake-timers': 10.3.0 - '@types/node': 20.11.20 + '@types/node': 20.11.21 jest-message-util: 29.7.0 jest-mock: 29.7.0 jest-util: 29.7.0 @@ -891,7 +918,7 @@ packages: '@jest/transform': 29.7.0 '@jest/types': 29.6.3 '@jridgewell/trace-mapping': 0.3.20 - '@types/node': 20.11.20 + '@types/node': 20.11.21 chalk: 4.1.2 collect-v8-coverage: 1.0.2 exit: 0.1.2 @@ -979,7 +1006,7 @@ packages: '@jest/schemas': 29.6.3 '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 - '@types/node': 20.11.20 + '@types/node': 20.11.21 '@types/yargs': 17.0.31 chalk: 4.1.2 dev: true @@ -1245,6 +1272,15 @@ packages: resolution: {integrity: sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==} dev: true + /@redis/client@1.5.14: + resolution: {integrity: sha512-YGn0GqsRBFUQxklhY7v562VMOP0DcmlrHHs3IV1mFE3cbxe31IITUkqhBcIhVSI/2JqtWAJXg5mjV4aU+zD0HA==} + engines: {node: '>=14'} + dependencies: + cluster-key-slot: 1.1.2 + generic-pool: 3.9.0 + yallist: 4.0.0 + dev: true + /@rollup/plugin-commonjs@25.0.7(rollup@4.12.0): resolution: {integrity: sha512-nEvcR+LRjEjsaSsc4x3XZfCCvZIaSMenZu/OiwOKGN2UhQpAYI7ru7czFvyWbErlpoGjnSX3D5Ch5FcMA3kRWQ==} engines: {node: '>=14.0.0'} @@ -1640,30 +1676,28 @@ packages: '@sinonjs/commons': 3.0.0 dev: true - /@slangroom/core@1.14.1(zenroom@4.12.2): + /@slangroom/core@1.14.1(zenroom@4.13.0): resolution: {integrity: sha512-uRogMxV8TRw+EvtSh+VS/PZQLjk8oYGY4mLen8QfKUcHrFC5XQ0X1crRr3UFmgsjPh5w+K4PwAk6g8tcRawNaw==} dependencies: - '@slangroom/deps': 1.9.5(zenroom@4.12.2) - '@slangroom/ignored': 1.9.6(zenroom@4.12.2) - '@slangroom/shared': 1.9.6(zenroom@4.12.2) + '@slangroom/deps': 1.9.5(zenroom@4.13.0) + '@slangroom/ignored': 1.9.6(zenroom@4.13.0) + '@slangroom/shared': 1.9.6(zenroom@4.13.0) transitivePeerDependencies: - zenroom - dev: false - /@slangroom/deps@1.9.5(zenroom@4.12.2): + /@slangroom/deps@1.9.5(zenroom@4.13.0): resolution: {integrity: sha512-QSO8pSKnZhqZg2IZ00SzwqH2BHtjD96KAFCfIsaD/OeFBuKCsst5NM0Ty+hYLXfKptJmRyzJrTtd2WlQh16Q8g==} peerDependencies: zenroom: ^4.0.0 dependencies: chevrotain: 10.5.0 - zenroom: 4.12.2 - dev: false + zenroom: 4.13.0 - /@slangroom/ethereum@1.14.1(typescript@5.3.3)(zenroom@4.12.2): + /@slangroom/ethereum@1.14.1(typescript@5.3.3)(zenroom@4.13.0): resolution: {integrity: sha512-UxckQlFbYa5K0grS3awtm5OAecDD6TQkDK+3Pmd/nCya0atLCikWBVBgGuO2T8wG8y34BQvQSDpf80SMlD12pQ==} dependencies: - '@slangroom/core': 1.14.1(zenroom@4.12.2) - '@slangroom/shared': 1.9.6(zenroom@4.12.2) + '@slangroom/core': 1.14.1(zenroom@4.13.0) + '@slangroom/shared': 1.9.6(zenroom@4.13.0) axios: 1.6.7(debug@4.3.4) web3: 4.5.0(typescript@5.3.3) web3-validator: 2.0.4 @@ -1677,10 +1711,10 @@ packages: - zod dev: false - /@slangroom/fs@1.14.1(zenroom@4.12.2): + /@slangroom/fs@1.14.1(zenroom@4.13.0): resolution: {integrity: sha512-UfB/9bYdsNtiLms8TeZjEvRN3fygRBthIpilumUcGerhIl6NBUUDVrPeUlPGY9g2Bnza8R41Tmbm5aLdS8rsHg==} dependencies: - '@slangroom/core': 1.14.1(zenroom@4.12.2) + '@slangroom/core': 1.14.1(zenroom@4.13.0) axios: 1.6.7(debug@4.3.4) extract-zip: 2.0.1 transitivePeerDependencies: @@ -1689,73 +1723,121 @@ packages: - zenroom dev: false - /@slangroom/git@1.14.1(zenroom@4.12.2): + /@slangroom/git@1.14.1(zenroom@4.13.0): resolution: {integrity: sha512-1wmGbcllj41gaKqcpqU3sbWMmOF9cxwnbR+LrPEPEBZCm1kq8SiLFnG/HiLUoL5FM0mAvnWD0O/xnGYi/pmIfQ==} dependencies: - '@slangroom/core': 1.14.1(zenroom@4.12.2) + '@slangroom/core': 1.14.1(zenroom@4.13.0) isomorphic-git: 1.25.6 transitivePeerDependencies: - zenroom dev: false - /@slangroom/http@1.14.1(zenroom@4.12.2): + /@slangroom/http@1.14.1(zenroom@4.13.0): resolution: {integrity: sha512-Mn3Ub/JSp/VtxEeyO/l38AaKNGIilSmnChrlRNiP93obnyYoAYNZVWVGbJhfxAmg/xOjhXvl+usKRB4xPxIZ5w==} dependencies: - '@slangroom/core': 1.14.1(zenroom@4.12.2) - '@slangroom/shared': 1.9.6(zenroom@4.12.2) + '@slangroom/core': 1.14.1(zenroom@4.13.0) + '@slangroom/shared': 1.9.6(zenroom@4.13.0) axios: 1.6.7(debug@4.3.4) transitivePeerDependencies: - debug - zenroom dev: false - /@slangroom/ignored@1.9.6(zenroom@4.12.2): + /@slangroom/ignored@1.9.6(zenroom@4.13.0): resolution: {integrity: sha512-w6xdfXDkWeYbzn1V1TEoEPfhNRvL2yL7DPhFeYkcD60+pukCg1fMAkaJ6K7JZBd67b8tCkAwWcpdgnXWAtZpFg==} dependencies: - '@slangroom/deps': 1.9.5(zenroom@4.12.2) - '@slangroom/shared': 1.9.6(zenroom@4.12.2) + '@slangroom/deps': 1.9.5(zenroom@4.13.0) + '@slangroom/shared': 1.9.6(zenroom@4.13.0) + transitivePeerDependencies: + - zenroom + + /@slangroom/json-schema@1.14.1(zenroom@4.13.0): + resolution: {integrity: sha512-vFiGaRN6jTxn6uclmvATUlC6YXs7ZajtRSDFtpGPIQZsrqZVHzISIbyoHDl9RGOUALgeyJjx+e8/3ABXKMHMuQ==} + dependencies: + '@slangroom/core': 1.14.1(zenroom@4.13.0) + '@slangroom/shared': 1.9.6(zenroom@4.13.0) + ajv: 8.12.0 transitivePeerDependencies: - zenroom dev: false - /@slangroom/oauth@1.16.0(zenroom@4.12.2): + /@slangroom/oauth@1.16.0(zenroom@4.13.0): resolution: {integrity: sha512-mFgFNiUqPDagtJ4wDdWs7v4sTNwJPd6835mVF5j/Kyq+v/zSmmNa+e/nhhGBm3K9POPofP88Wt4N3Kh7fry+Jw==} dependencies: '@node-oauth/oauth2-server': 5.1.0 - '@slangroom/core': 1.14.1(zenroom@4.12.2) - '@slangroom/shared': 1.9.6(zenroom@4.12.2) + '@slangroom/core': 1.14.1(zenroom@4.13.0) + '@slangroom/shared': 1.9.6(zenroom@4.13.0) bs58: 5.0.0 jose: 5.2.2 transitivePeerDependencies: - zenroom dev: false - /@slangroom/shared@1.9.6(zenroom@4.12.2): - resolution: {integrity: sha512-yBMBQw0o6pIUUw+m7DRjt/2/tObmXOqyaMcHyfo/O940R2qhFV9Ut4JZLW7mVedw6P3vntRIRKTEQr5Nk459jQ==} + /@slangroom/pocketbase@1.17.0(zenroom@4.13.0): + resolution: {integrity: sha512-yYUFpHNQ8IByqNLYWDClIxwG3XLzGW6ViBhtd+daBpq+ONEdJ1/S4f1JZ9E0FhwJUekpVL+IQnN2zQrZLljndw==} dependencies: - '@slangroom/deps': 1.9.5(zenroom@4.12.2) + '@slangroom/core': 1.14.1(zenroom@4.13.0) + '@slangroom/shared': 1.9.6(zenroom@4.13.0) + dotenv: 16.4.5 + pocketbase: 0.19.0 + zod: 3.22.4 transitivePeerDependencies: - zenroom dev: false - /@slangroom/wallet@1.14.1(zenroom@4.12.2): + /@slangroom/qrcode@1.14.1(zenroom@4.13.0): + resolution: {integrity: sha512-gHR8XA+dfdub8v9d8N8Gk8CQ82MVMiT36SwRC0lyhd/MMzgiCMc0jSCqGkIqNkGyXFVFmaKsllnFFOXf8KpCwg==} + dependencies: + '@slangroom/core': 1.14.1(zenroom@4.13.0) + qrcode: 1.5.3 + transitivePeerDependencies: + - zenroom + dev: true + + /@slangroom/redis@1.14.1(zenroom@4.13.0): + resolution: {integrity: sha512-mHHFodLZlIsr/9vbxWw3FnGxYnRSExRaFDfGQcP1b16wPasFyg4DN7185TyAFVPI/4Wd4vdiigmAISL04m8wqQ==} + dependencies: + '@redis/client': 1.5.14 + '@slangroom/core': 1.14.1(zenroom@4.13.0) + '@slangroom/shared': 1.9.6(zenroom@4.13.0) + transitivePeerDependencies: + - zenroom + dev: true + + /@slangroom/shared@1.9.6(zenroom@4.13.0): + resolution: {integrity: sha512-yBMBQw0o6pIUUw+m7DRjt/2/tObmXOqyaMcHyfo/O940R2qhFV9Ut4JZLW7mVedw6P3vntRIRKTEQr5Nk459jQ==} + dependencies: + '@slangroom/deps': 1.9.5(zenroom@4.13.0) + transitivePeerDependencies: + - zenroom + + /@slangroom/shell@1.15.0(zenroom@4.13.0): + resolution: {integrity: sha512-KZyIBWZe1js7YE8fOBHrZ+LoyqWkmvrxiHR3ZHwvoeHuuRPoBYmTrUfjkaif4J7N72oynfYKPiajsIh6v1HZqw==} + dependencies: + '@slangroom/core': 1.14.1(zenroom@4.13.0) + execa: 8.0.1 + transitivePeerDependencies: + - zenroom + dev: true + + /@slangroom/wallet@1.14.1(zenroom@4.13.0): resolution: {integrity: sha512-s0hXDiQNJ0we0++nGlxrrCQ5irGyUxdtJlRAWZtrdHV0eXoXAGrTn3sJvDwDnr93WJY2iKomk7RADdaMq5W4Hw==} dependencies: '@meeco/sd-jwt': 0.0.3 '@meeco/sd-jwt-vc': 0.0.4 - '@slangroom/core': 1.14.1(zenroom@4.12.2) - '@slangroom/shared': 1.9.6(zenroom@4.12.2) + '@slangroom/core': 1.14.1(zenroom@4.13.0) + '@slangroom/shared': 1.9.6(zenroom@4.13.0) bs58: 5.0.0 jose: 5.2.2 transitivePeerDependencies: - zenroom dev: false - /@slangroom/zencode@1.18.0(zenroom@4.12.2): + /@slangroom/zencode@1.18.0(zenroom@4.13.0): resolution: {integrity: sha512-9+KtigQOzHrQ4MSaOhev6auia9ANNYuSnNN4HWL6GIHIiMqtdsvWizob0VR5Gl4lfgKRzyrOd8VYxZSJzN7DCg==} dependencies: - '@slangroom/core': 1.14.1(zenroom@4.12.2) - '@slangroom/shared': 1.9.6(zenroom@4.12.2) + '@slangroom/core': 1.14.1(zenroom@4.13.0) + '@slangroom/shared': 1.9.6(zenroom@4.13.0) transitivePeerDependencies: - zenroom dev: false @@ -2008,7 +2090,7 @@ packages: dependencies: '@types/http-cache-semantics': 4.0.4 '@types/keyv': 3.1.4 - '@types/node': 20.11.20 + '@types/node': 20.11.21 '@types/responselike': 1.0.3 dev: true @@ -2020,26 +2102,26 @@ packages: resolution: {integrity: sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ==} dependencies: '@types/jsonfile': 6.1.4 - '@types/node': 20.11.20 + '@types/node': 20.11.21 dev: true /@types/fs-extra@8.1.5: resolution: {integrity: sha512-0dzKcwO+S8s2kuF5Z9oUWatQJj5Uq/iqphEtE3GQJVRRYm/tD1LglU2UnXi2A8jLq5umkGouOXOR9y0n613ZwQ==} dependencies: - '@types/node': 20.11.20 + '@types/node': 20.11.21 dev: true /@types/glob@7.2.0: resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} dependencies: '@types/minimatch': 5.1.2 - '@types/node': 20.11.20 + '@types/node': 20.11.21 dev: true /@types/graceful-fs@4.1.9: resolution: {integrity: sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==} dependencies: - '@types/node': 20.11.20 + '@types/node': 20.11.21 dev: true /@types/http-cache-semantics@4.0.4: @@ -2076,13 +2158,13 @@ packages: /@types/jsonfile@6.1.4: resolution: {integrity: sha512-D5qGUYwjvnNNextdU59/+fI+spnwtTFmyQP0h+PfIOSkNfpU6AOICUOkm4i0OnSk+NyjdPJrxCDro0sJsWlRpQ==} dependencies: - '@types/node': 20.11.20 + '@types/node': 20.11.21 dev: true /@types/keyv@3.1.4: resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==} dependencies: - '@types/node': 20.11.20 + '@types/node': 20.11.21 dev: true /@types/lodash.isequal@4.5.8: @@ -2103,8 +2185,8 @@ packages: resolution: {integrity: sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ==} dev: true - /@types/node@20.11.20: - resolution: {integrity: sha512-7/rR21OS+fq8IyHTgtLkDK949uzsa6n8BkziAKtPVpugIkO6D+/ooXMvzXxDnZrmtXVfjb1bKQafYpb8s89LOg==} + /@types/node@20.11.21: + resolution: {integrity: sha512-/ySDLGscFPNasfqStUuWWPfL78jompfIoVzLJPVVAHBh6rpG68+pI2Gk+fNLeI8/f1yPYL4s46EleVIc20F1Ow==} dependencies: undici-types: 5.26.5 @@ -2119,7 +2201,7 @@ packages: /@types/responselike@1.0.3: resolution: {integrity: sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==} dependencies: - '@types/node': 20.11.20 + '@types/node': 20.11.21 dev: true /@types/stack-utils@2.0.3: @@ -2130,10 +2212,14 @@ packages: resolution: {integrity: sha512-q+j3WgYeg+bOZhS5iAKHxFvqOsXi00f001YGHsW6Tr2LacSw7Zkr+3+Gpj8pZyC/YJ6QiZqSlM0I/BFhfXUELw==} dev: true + /@types/triple-beam@1.3.5: + resolution: {integrity: sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==} + dev: true + /@types/ws@8.5.3: resolution: {integrity: sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==} dependencies: - '@types/node': 20.11.20 + '@types/node': 20.11.21 dev: false /@types/yargs-parser@21.0.3: @@ -2150,12 +2236,12 @@ packages: resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==} requiresBuild: true dependencies: - '@types/node': 20.11.20 + '@types/node': 20.11.21 dev: false optional: true - /@typescript-eslint/parser@7.0.2(eslint@8.57.0)(typescript@5.3.3): - resolution: {integrity: sha512-GdwfDglCxSmU+QTS9vhz2Sop46ebNCXpPPvsByK7hu0rFGRHL+AusKQJ7SoN+LbLh6APFpQwHKmDSwN35Z700Q==} + /@typescript-eslint/parser@7.1.0(eslint@8.57.0)(typescript@5.3.3): + resolution: {integrity: sha512-V1EknKUubZ1gWFjiOZhDSNToOjs63/9O0puCgGS8aDOgpZY326fzFu15QAUjwaXzRZjf/qdsdBrckYdv9YxB8w==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^8.56.0 @@ -2164,10 +2250,10 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 7.0.2 - '@typescript-eslint/types': 7.0.2 - '@typescript-eslint/typescript-estree': 7.0.2(typescript@5.3.3) - '@typescript-eslint/visitor-keys': 7.0.2 + '@typescript-eslint/scope-manager': 7.1.0 + '@typescript-eslint/types': 7.1.0 + '@typescript-eslint/typescript-estree': 7.1.0(typescript@5.3.3) + '@typescript-eslint/visitor-keys': 7.1.0 debug: 4.3.4(supports-color@5.5.0) eslint: 8.57.0 typescript: 5.3.3 @@ -2175,21 +2261,21 @@ packages: - supports-color dev: false - /@typescript-eslint/scope-manager@7.0.2: - resolution: {integrity: sha512-l6sa2jF3h+qgN2qUMjVR3uCNGjWw4ahGfzIYsCtFrQJCjhbrDPdiihYT8FnnqFwsWX+20hK592yX9I2rxKTP4g==} + /@typescript-eslint/scope-manager@7.1.0: + resolution: {integrity: sha512-6TmN4OJiohHfoOdGZ3huuLhpiUgOGTpgXNUPJgeZOZR3DnIpdSgtt83RS35OYNNXxM4TScVlpVKC9jyQSETR1A==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 7.0.2 - '@typescript-eslint/visitor-keys': 7.0.2 + '@typescript-eslint/types': 7.1.0 + '@typescript-eslint/visitor-keys': 7.1.0 dev: false - /@typescript-eslint/types@7.0.2: - resolution: {integrity: sha512-ZzcCQHj4JaXFjdOql6adYV4B/oFOFjPOC9XYwCaZFRvqN8Llfvv4gSxrkQkd2u4Ci62i2c6W6gkDwQJDaRc4nA==} + /@typescript-eslint/types@7.1.0: + resolution: {integrity: sha512-qTWjWieJ1tRJkxgZYXx6WUYtWlBc48YRxgY2JN1aGeVpkhmnopq+SUC8UEVGNXIvWH7XyuTjwALfG6bFEgCkQA==} engines: {node: ^16.0.0 || >=18.0.0} dev: false - /@typescript-eslint/typescript-estree@7.0.2(typescript@5.3.3): - resolution: {integrity: sha512-3AMc8khTcELFWcKcPc0xiLviEvvfzATpdPj/DXuOGIdQIIFybf4DMT1vKRbuAEOFMwhWt7NFLXRkbjsvKZQyvw==} + /@typescript-eslint/typescript-estree@7.1.0(typescript@5.3.3): + resolution: {integrity: sha512-k7MyrbD6E463CBbSpcOnwa8oXRdHzH1WiVzOipK3L5KSML92ZKgUBrTlehdi7PEIMT8k0bQixHUGXggPAlKnOQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: typescript: '*' @@ -2197,8 +2283,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 7.0.2 - '@typescript-eslint/visitor-keys': 7.0.2 + '@typescript-eslint/types': 7.1.0 + '@typescript-eslint/visitor-keys': 7.1.0 debug: 4.3.4(supports-color@5.5.0) globby: 11.1.0 is-glob: 4.0.3 @@ -2210,11 +2296,11 @@ packages: - supports-color dev: false - /@typescript-eslint/visitor-keys@7.0.2: - resolution: {integrity: sha512-8Y+YiBmqPighbm5xA2k4wKTxRzx9EkBu7Rlw+WHqMvRJ3RPz/BMBO9b2ru0LUNmXg120PHUXD5+SWFy2R8DqlQ==} + /@typescript-eslint/visitor-keys@7.1.0: + resolution: {integrity: sha512-FhUqNWluiGNzlvnDZiXad4mZRhtghdoKW6e98GoEOYSu5cND+E39rG5KwJMUzeENwm1ztYBRqof8wMLP+wNPIA==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 7.0.2 + '@typescript-eslint/types': 7.1.0 eslint-visitor-keys: 3.4.3 dev: false @@ -2251,13 +2337,6 @@ packages: typescript: 5.3.3 dev: false - /abort-controller@3.0.0: - resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} - engines: {node: '>=6.5'} - dependencies: - event-target-shim: 5.0.1 - dev: false - /acorn-jsx@5.3.2(acorn@8.11.3): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: @@ -2450,6 +2529,10 @@ packages: resolution: {integrity: sha512-Az2ZTpuytrtqENulXwO3GGv1Bztugx6TT37NIo7imr/Qo0gsYiGtSdBa2B6fsXhTpVZDNfu1Qn3pk531e3q+nQ==} dev: false + /async@3.2.5: + resolution: {integrity: sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==} + dev: true + /asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} @@ -2458,11 +2541,6 @@ packages: engines: {node: '>= 4.0.0'} dev: true - /atomic-sleep@1.0.0: - resolution: {integrity: sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==} - engines: {node: '>=8.0.0'} - dev: false - /atomically@1.7.0: resolution: {integrity: sha512-Xcz9l0z7y9yQ9rdDaxlmaI4uJHf/T8g9hOEzJcsEqX2SjCj4J20uK7+ldkDHMbpJDK76wF7xEIgxc/vSlsfw5w==} engines: {node: '>=10.12.0'} @@ -2573,6 +2651,7 @@ packages: /base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} + dev: true /basic-auth@2.0.1: resolution: {integrity: sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==} @@ -2680,13 +2759,6 @@ packages: ieee754: 1.2.1 dev: true - /buffer@6.0.3: - resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==} - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - dev: false - /builtin-modules@3.3.0: resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} engines: {node: '>=6'} @@ -2806,7 +2878,6 @@ packages: '@chevrotain/utils': 10.5.0 lodash: 4.17.21 regexp-to-ast: 0.5.0 - dev: false /chokidar@3.5.3: resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} @@ -2889,6 +2960,14 @@ packages: '@colors/colors': 1.5.0 dev: true + /cliui@6.0.0: + resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==} + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 6.2.0 + dev: true + /cliui@7.0.4: resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} dependencies: @@ -2912,6 +2991,11 @@ packages: mimic-response: 1.0.1 dev: true + /cluster-key-slot@1.1.2: + resolution: {integrity: sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==} + engines: {node: '>=0.10.0'} + dev: true + /co@4.6.0: resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} @@ -2940,19 +3024,40 @@ packages: /color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + /color-string@1.9.1: + resolution: {integrity: sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==} + dependencies: + color-name: 1.1.4 + simple-swizzle: 0.2.2 + dev: true + + /color@3.2.1: + resolution: {integrity: sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==} + dependencies: + color-convert: 1.9.3 + color-string: 1.9.1 + dev: true + /colorette@1.4.0: resolution: {integrity: sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==} dev: true + /colorspace@1.1.4: + resolution: {integrity: sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==} + dependencies: + color: 3.2.1 + text-hex: 1.0.0 + dev: true + /combined-stream@1.0.8: resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} engines: {node: '>= 0.8'} dependencies: delayed-stream: 1.0.0 - /commander@11.1.0: - resolution: {integrity: sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==} - engines: {node: '>=16'} + /commander@12.0.0: + resolution: {integrity: sha512-MwVNWlYjDTtOjX5PiD7o5pK0UrFU/OYgcJfjjK4RaHZETNtjJqrZa9Y9ds88+A+f+d5lv+561eZ+yCKoS3gbAA==} + engines: {node: '>=18'} dev: false /commondir@1.0.1: @@ -3065,7 +3170,7 @@ packages: hasBin: true dev: false - /create-jest@29.7.0(@types/node@20.11.20)(ts-node@10.9.2): + /create-jest@29.7.0(@types/node@20.11.21)(ts-node@10.9.2): resolution: {integrity: sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -3074,7 +3179,7 @@ packages: chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@20.11.20)(ts-node@10.9.2) + jest-config: 29.7.0(@types/node@20.11.21)(ts-node@10.9.2) jest-util: 29.7.0 prompts: 2.4.2 transitivePeerDependencies: @@ -3150,6 +3255,11 @@ packages: ms: 2.1.2 supports-color: 5.5.0 + /decamelize@1.2.0: + resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} + engines: {node: '>=0.10.0'} + dev: true + /decompress-response@6.0.0: resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} engines: {node: '>=10'} @@ -3266,6 +3376,10 @@ packages: engines: {node: '>=0.3.1'} dev: true + /dijkstrajs@1.0.3: + resolution: {integrity: sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==} + dev: true + /dir-glob@3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} @@ -3352,6 +3466,14 @@ packages: resolution: {integrity: sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==} dev: true + /enabled@2.0.0: + resolution: {integrity: sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==} + dev: true + + /encode-utf8@1.0.3: + resolution: {integrity: sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw==} + dev: true + /end-of-stream@1.4.4: resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} dependencies: @@ -3568,16 +3690,6 @@ packages: through: 2.3.8 dev: true - /event-target-shim@5.0.1: - resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==} - engines: {node: '>=6'} - dev: false - - /events@3.3.0: - resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} - engines: {node: '>=0.8.x'} - dev: false - /eventsource@2.0.2: resolution: {integrity: sha512-IzUmBGPR3+oUG9dUeXynyNmf91/3zUSJg1lCktzKw47OXuhco54U3r9B7O4XX+Rb1Itm9OZ2b0RkTs10bICOxA==} engines: {node: '>=12.0.0'} @@ -3668,11 +3780,6 @@ packages: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} dev: false - /fast-redact@3.3.0: - resolution: {integrity: sha512-6T5V1QK1u4oF+ATxs1lWUmlEk6P2T9HqJG3e2DnHOdVgZy2rFJBoEnrIedcTXlkAHU/zKC+7KETJ+KGGKwxgMQ==} - engines: {node: '>=6'} - dev: false - /fastq@1.15.0: resolution: {integrity: sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==} dependencies: @@ -3690,6 +3797,10 @@ packages: pend: 1.2.0 dev: false + /fecha@4.2.3: + resolution: {integrity: sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==} + dev: true + /figures@2.0.0: resolution: {integrity: sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==} engines: {node: '>=4'} @@ -3781,6 +3892,10 @@ packages: resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} dev: false + /fn.name@1.1.0: + resolution: {integrity: sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==} + dev: true + /follow-redirects@1.15.5(debug@4.3.4): resolution: {integrity: sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==} engines: {node: '>=4.0'} @@ -3868,6 +3983,11 @@ packages: resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} dev: true + /generic-pool@3.9.0: + resolution: {integrity: sha512-hymDOu5B53XvN4QT9dBmZxPX4CWhBPPLguTZ9MMFeFa/Kg0xWVfylOVNlJji/E7yTZWFd/q9GO5TxDLq156D7g==} + engines: {node: '>= 4'} + dev: true + /gensync@1.0.0-beta.2: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} engines: {node: '>=6.9.0'} @@ -4222,6 +4342,7 @@ packages: /ieee754@1.2.1: resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} + dev: true /ignore-by-default@1.0.1: resolution: {integrity: sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==} @@ -4356,6 +4477,10 @@ packages: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} dev: true + /is-arrayish@0.3.2: + resolution: {integrity: sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==} + dev: true + /is-bigint@1.0.4: resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} dependencies: @@ -4681,7 +4806,7 @@ packages: '@jest/expect': 29.7.0 '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.11.20 + '@types/node': 20.11.21 chalk: 4.1.2 co: 4.6.0 dedent: 1.5.1 @@ -4702,7 +4827,7 @@ packages: - supports-color dev: true - /jest-cli@29.7.0(@types/node@20.11.20)(ts-node@10.9.2): + /jest-cli@29.7.0(@types/node@20.11.21)(ts-node@10.9.2): resolution: {integrity: sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -4716,10 +4841,10 @@ packages: '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 chalk: 4.1.2 - create-jest: 29.7.0(@types/node@20.11.20)(ts-node@10.9.2) + create-jest: 29.7.0(@types/node@20.11.21)(ts-node@10.9.2) exit: 0.1.2 import-local: 3.1.0 - jest-config: 29.7.0(@types/node@20.11.20)(ts-node@10.9.2) + jest-config: 29.7.0(@types/node@20.11.21)(ts-node@10.9.2) jest-util: 29.7.0 jest-validate: 29.7.0 yargs: 17.7.2 @@ -4730,7 +4855,7 @@ packages: - ts-node dev: true - /jest-config@29.7.0(@types/node@20.11.20)(ts-node@10.9.2): + /jest-config@29.7.0(@types/node@20.11.21)(ts-node@10.9.2): resolution: {integrity: sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: @@ -4745,7 +4870,7 @@ packages: '@babel/core': 7.23.3 '@jest/test-sequencer': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.11.20 + '@types/node': 20.11.21 babel-jest: 29.7.0(@babel/core@7.23.3) chalk: 4.1.2 ci-info: 3.9.0 @@ -4765,7 +4890,7 @@ packages: pretty-format: 29.7.0 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.9.2(@swc/core@1.4.2)(@types/node@20.11.20)(typescript@5.3.3) + ts-node: 10.9.2(@swc/core@1.4.2)(@types/node@20.11.21)(typescript@5.3.3) transitivePeerDependencies: - babel-plugin-macros - supports-color @@ -4806,7 +4931,7 @@ packages: '@jest/environment': 29.7.0 '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.11.20 + '@types/node': 20.11.21 jest-mock: 29.7.0 jest-util: 29.7.0 dev: true @@ -4822,7 +4947,7 @@ packages: dependencies: '@jest/types': 29.6.3 '@types/graceful-fs': 4.1.9 - '@types/node': 20.11.20 + '@types/node': 20.11.21 anymatch: 3.1.3 fb-watchman: 2.0.2 graceful-fs: 4.2.11 @@ -4873,7 +4998,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 - '@types/node': 20.11.20 + '@types/node': 20.11.21 jest-util: 29.7.0 dev: true @@ -4928,7 +5053,7 @@ packages: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.11.20 + '@types/node': 20.11.21 chalk: 4.1.2 emittery: 0.13.1 graceful-fs: 4.2.11 @@ -4959,7 +5084,7 @@ packages: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.11.20 + '@types/node': 20.11.21 chalk: 4.1.2 cjs-module-lexer: 1.2.3 collect-v8-coverage: 1.0.2 @@ -5011,7 +5136,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 - '@types/node': 20.11.20 + '@types/node': 20.11.21 chalk: 4.1.2 ci-info: 3.9.0 graceful-fs: 4.2.11 @@ -5036,7 +5161,7 @@ packages: dependencies: '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.11.20 + '@types/node': 20.11.21 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.13.1 @@ -5048,13 +5173,13 @@ packages: resolution: {integrity: sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@types/node': 20.11.20 + '@types/node': 20.11.21 jest-util: 29.7.0 merge-stream: 2.0.0 supports-color: 8.1.1 dev: true - /jest@29.7.0(@types/node@20.11.20)(ts-node@10.9.2): + /jest@29.7.0(@types/node@20.11.21)(ts-node@10.9.2): resolution: {integrity: sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -5067,7 +5192,7 @@ packages: '@jest/core': 29.7.0(ts-node@10.9.2) '@jest/types': 29.6.3 import-local: 3.1.0 - jest-cli: 29.7.0(@types/node@20.11.20)(ts-node@10.9.2) + jest-cli: 29.7.0(@types/node@20.11.21)(ts-node@10.9.2) transitivePeerDependencies: - '@types/node' - babel-plugin-macros @@ -5208,6 +5333,10 @@ packages: engines: {node: '>=6'} dev: true + /kuler@2.0.0: + resolution: {integrity: sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==} + dev: true + /lazy-ass@1.6.0: resolution: {integrity: sha512-cc8oEVoctTvsFZ/Oje/kGnHbpWHYBe8IAJe4C0QNc3t8uM/0Y8+erSz/7Y1ALuXTEZTMvxXwO6YbX1ey3ujiZw==} engines: {node: '> 0.8'} @@ -5355,6 +5484,18 @@ packages: /lodash@4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + /logform@2.6.0: + resolution: {integrity: sha512-1ulHeNPp6k/LD8H91o7VYFBng5i1BDE7HoKxVbZiGFidS1Rj65qcywLxX+pVfAPoQJEjRdvKcusKwOupHCVOVQ==} + engines: {node: '>= 12.0.0'} + dependencies: + '@colors/colors': 1.6.0 + '@types/triple-beam': 1.3.5 + fecha: 4.2.3 + ms: 2.1.2 + safe-stable-stringify: 2.4.3 + triple-beam: 1.4.1 + dev: true + /long@5.2.3: resolution: {integrity: sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==} dev: true @@ -5784,16 +5925,17 @@ packages: object-keys: 1.1.1 dev: true - /on-exit-leak-free@2.1.2: - resolution: {integrity: sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==} - engines: {node: '>=14.0.0'} - dev: false - /once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} dependencies: wrappy: 1.0.2 + /one-time@1.0.0: + resolution: {integrity: sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==} + dependencies: + fn.name: 1.1.0 + dev: true + /onetime@5.1.2: resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} engines: {node: '>=6'} @@ -6094,34 +6236,6 @@ packages: engines: {node: '>=6'} dev: false - /pino-abstract-transport@1.1.0: - resolution: {integrity: sha512-lsleG3/2a/JIWUtf9Q5gUNErBqwIu1tUKTT3dUzaf5DySw9ra1wcqKjJjLX1VTY64Wk1eEOYsVGSaGfCK85ekA==} - dependencies: - readable-stream: 4.5.2 - split2: 4.2.0 - dev: false - - /pino-std-serializers@6.2.2: - resolution: {integrity: sha512-cHjPPsE+vhj/tnhCy/wiMh3M3z3h/j15zHQX+S9GkTBgqJuTuJzYJ4gUyACLhDaJ7kk9ba9iRDmbH2tJU03OiA==} - dev: false - - /pino@8.19.0: - resolution: {integrity: sha512-oswmokxkav9bADfJ2ifrvfHUwad6MLp73Uat0IkQWY3iAw5xTRoznXbXksZs8oaOUMpmhVWD+PZogNzllWpJaA==} - hasBin: true - dependencies: - atomic-sleep: 1.0.0 - fast-redact: 3.3.0 - on-exit-leak-free: 2.1.2 - pino-abstract-transport: 1.1.0 - pino-std-serializers: 6.2.2 - process-warning: 3.0.0 - quick-format-unescaped: 4.0.4 - real-require: 0.2.0 - safe-stable-stringify: 2.4.3 - sonic-boom: 3.8.0 - thread-stream: 2.4.1 - dev: false - /pirates@4.0.6: resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==} engines: {node: '>= 6'} @@ -6194,6 +6308,15 @@ packages: - supports-color dev: true + /pngjs@5.0.0: + resolution: {integrity: sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==} + engines: {node: '>=10.13.0'} + dev: true + + /pocketbase@0.19.0: + resolution: {integrity: sha512-bUVZfVdD17K8GnwbeDMZPEdREVg2YE0F8uHPDC0zer4VtwXUqoPCCeudTy3fhUE7pfuKnfpuPxeBSYsBY3AGIQ==} + dev: false + /possible-typed-array-names@1.0.0: resolution: {integrity: sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==} engines: {node: '>= 0.4'} @@ -6250,15 +6373,6 @@ packages: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} dev: true - /process-warning@3.0.0: - resolution: {integrity: sha512-mqn0kFRl0EoqhnL0GQ0veqFHyIN1yig9RHh/InzORTUiZHFRAur+aMtRkELNwGs9aNwKS6tg/An4NYBPGwvtzQ==} - dev: false - - /process@0.11.10: - resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==} - engines: {node: '>= 0.6.0'} - dev: false - /progress@2.0.3: resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==} engines: {node: '>=0.4.0'} @@ -6299,7 +6413,7 @@ packages: '@protobufjs/path': 1.1.2 '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.0 - '@types/node': 20.11.20 + '@types/node': 20.11.21 long: 5.2.3 dev: true @@ -6352,6 +6466,17 @@ packages: resolution: {integrity: sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA==} dev: true + /qrcode@1.5.3: + resolution: {integrity: sha512-puyri6ApkEHYiVl4CFzo1tDkAZ+ATcnbJrJ6RiBM1Fhctdn/ix9MTE3hRph33omisEbC/2fcfemsseiKgBPKZg==} + engines: {node: '>=10.13.0'} + hasBin: true + dependencies: + dijkstrajs: 1.0.3 + encode-utf8: 1.0.3 + pngjs: 5.0.0 + yargs: 15.4.1 + dev: true + /querystringify@2.2.0: resolution: {integrity: sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==} dev: true @@ -6359,10 +6484,6 @@ packages: /queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - /quick-format-unescaped@4.0.4: - resolution: {integrity: sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==} - dev: false - /quick-lru@5.1.1: resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==} engines: {node: '>=10'} @@ -6433,35 +6554,18 @@ packages: string_decoder: 1.3.0 util-deprecate: 1.0.2 - /readable-stream@4.5.2: - resolution: {integrity: sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - abort-controller: 3.0.0 - buffer: 6.0.3 - events: 3.3.0 - process: 0.11.10 - string_decoder: 1.3.0 - dev: false - /readdirp@3.6.0: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} dependencies: picomatch: 2.3.1 - /real-require@0.2.0: - resolution: {integrity: sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==} - engines: {node: '>= 12.13.0'} - dev: false - /regenerator-runtime@0.14.1: resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==} dev: true /regexp-to-ast@0.5.0: resolution: {integrity: sha512-tlbJqcMHnPKI9zSrystikWKwHkBqu2a/Sgw01h3zFjvYrMxEDYHzzoMZnUrbIfpTFEsoRnnviOXNCzFiSc54Qw==} - dev: false /regexp.prototype.flags@1.5.2: resolution: {integrity: sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==} @@ -6489,6 +6593,10 @@ packages: resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} engines: {node: '>=0.10.0'} + /require-main-filename@2.0.0: + resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} + dev: true + /requires-port@1.0.0: resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==} dev: true @@ -6610,7 +6718,7 @@ packages: /safe-stable-stringify@2.4.3: resolution: {integrity: sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==} engines: {node: '>=10'} - dev: false + dev: true /semantic-release@23.0.2(typescript@5.3.3): resolution: {integrity: sha512-OnVYJ6Xgzwe1x8MKswba7RU9+5djS1MWRTrTn5qsq3xZYpslroZkV9Pt0dA2YcIuieeuSZWJhn+yUWoBUHO5Fw==} @@ -6683,6 +6791,10 @@ packages: dependencies: lru-cache: 6.0.0 + /set-blocking@2.0.0: + resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} + dev: true + /set-function-length@1.2.1: resolution: {integrity: sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g==} engines: {node: '>= 0.4'} @@ -6768,6 +6880,12 @@ packages: resolution: {integrity: sha512-JFvMY00t6SBGtwMuJ+nqgsx9ylkMiJ5JlK9bkj8AdvniIe5615wWQYkKHXe84XtSuc40G/tlrPu0A5/NlJvv8A==} dev: true + /simple-swizzle@0.2.2: + resolution: {integrity: sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==} + dependencies: + is-arrayish: 0.3.2 + dev: true + /simple-update-notifier@2.0.0: resolution: {integrity: sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==} engines: {node: '>=10'} @@ -6819,12 +6937,6 @@ packages: smart-buffer: 4.2.0 dev: true - /sonic-boom@3.8.0: - resolution: {integrity: sha512-ybz6OYOUjoQQCQ/i4LU8kaToD8ACtYP+Cj5qd2AO36bwbdewxWJ3ArmJ2cr6AvxlL2o0PqnCcPGUgkILbfkaCA==} - dependencies: - atomic-sleep: 1.0.0 - dev: false - /source-map-support@0.5.13: resolution: {integrity: sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==} dependencies: @@ -6872,6 +6984,7 @@ packages: /split2@4.2.0: resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==} engines: {node: '>= 10.x'} + dev: true /split@0.3.3: resolution: {integrity: sha512-wD2AeVmxXRBoX44wAycgjVpMhvbwdI2aZjCkvfNcH1YqHQvJVa1duWc73OyVGJUc05fhFaTZeQ/PYsrmyH0JVA==} @@ -6887,6 +7000,10 @@ packages: resolution: {integrity: sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==} dev: true + /stack-trace@0.0.10: + resolution: {integrity: sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==} + dev: true + /stack-utils@2.0.6: resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} engines: {node: '>=10'} @@ -7107,6 +7224,10 @@ packages: engines: {node: '>=8'} dev: true + /text-hex@1.0.0: + resolution: {integrity: sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==} + dev: true + /text-table@0.2.0: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} dev: false @@ -7124,12 +7245,6 @@ packages: any-promise: 1.3.0 dev: true - /thread-stream@2.4.1: - resolution: {integrity: sha512-d/Ex2iWd1whipbT681JmTINKw0ZwOUBZm7+Gjs64DHuX34mmw8vJL2bFAaNacaW72zYiTJxSHi5abUuOi5nsfg==} - dependencies: - real-require: 0.2.0 - dev: false - /through2@2.0.5: resolution: {integrity: sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==} dependencies: @@ -7181,6 +7296,11 @@ packages: engines: {node: '>= 0.4'} dev: true + /triple-beam@1.4.1: + resolution: {integrity: sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==} + engines: {node: '>= 14.0.0'} + dev: true + /ts-api-utils@1.2.1(typescript@5.3.3): resolution: {integrity: sha512-RIYA36cJn2WiH9Hy77hdF9r7oEwxAtB/TS9/S4Qd90Ap4z5FSiin5zEiTL44OII1Y3IIlEvxwxFUVgrHSZ/UpA==} engines: {node: '>=16'} @@ -7214,7 +7334,7 @@ packages: '@babel/core': 7.23.3 bs-logger: 0.2.6 fast-json-stable-stringify: 2.1.0 - jest: 29.7.0(@types/node@20.11.20)(ts-node@10.9.2) + jest: 29.7.0(@types/node@20.11.21)(ts-node@10.9.2) jest-util: 29.7.0 json5: 2.2.3 lodash.memoize: 4.1.2 @@ -7224,7 +7344,7 @@ packages: yargs-parser: 21.1.1 dev: true - /ts-node@10.9.2(@swc/core@1.4.2)(@types/node@20.11.20)(typescript@5.3.3): + /ts-node@10.9.2(@swc/core@1.4.2)(@types/node@20.11.21)(typescript@5.3.3): resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} hasBin: true peerDependencies: @@ -7244,7 +7364,7 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 20.11.20 + '@types/node': 20.11.21 acorn: 8.11.2 acorn-walk: 8.3.1 arg: 4.1.3 @@ -7260,6 +7380,11 @@ packages: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} dev: true + /tslog@4.9.2: + resolution: {integrity: sha512-wBM+LRJoNl34Bdu8mYEFxpvmOUedpNUwMNQB/NcuPIZKwdDde6xLHUev3bBjXQU7gdurX++X/YE7gLH8eXYsiQ==} + engines: {node: '>=16'} + dev: true + /tunnel-agent@0.6.0: resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==} dependencies: @@ -7749,6 +7874,10 @@ packages: is-weakset: 2.0.2 dev: true + /which-module@2.0.1: + resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} + dev: true + /which-typed-array@1.1.14: resolution: {integrity: sha512-VnXFiIW8yNn9kIHN88xvZ4yOWchftKDsRJ8fEPacX/wl1lOvBrhsJ/OeJCXq7B0AaijRuqgzSKalJoPk+D8MPg==} engines: {node: '>= 0.4'} @@ -7766,10 +7895,45 @@ packages: dependencies: isexe: 2.0.0 + /winston-transport@4.7.0: + resolution: {integrity: sha512-ajBj65K5I7denzer2IYW6+2bNIVqLGDHqDw3Ow8Ohh+vdW+rv4MZ6eiDvHoKhfJFZ2auyN8byXieDDJ96ViONg==} + engines: {node: '>= 12.0.0'} + dependencies: + logform: 2.6.0 + readable-stream: 3.6.2 + triple-beam: 1.4.1 + dev: true + + /winston@3.11.0: + resolution: {integrity: sha512-L3yR6/MzZAOl0DsysUXHVjOwv8mKZ71TrA/41EIduGpOOV5LQVodqN+QdQ6BS6PJ/RdIshZhq84P/fStEZkk7g==} + engines: {node: '>= 12.0.0'} + dependencies: + '@colors/colors': 1.6.0 + '@dabh/diagnostics': 2.0.3 + async: 3.2.5 + is-stream: 2.0.1 + logform: 2.6.0 + one-time: 1.0.0 + readable-stream: 3.6.2 + safe-stable-stringify: 2.4.3 + stack-trace: 0.0.10 + triple-beam: 1.4.1 + winston-transport: 4.7.0 + dev: true + /wordwrap@1.0.0: resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} dev: true + /wrap-ansi@6.2.0: + resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} + engines: {node: '>=8'} + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + dev: true + /wrap-ansi@7.0.0: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} engines: {node: '>=10'} @@ -7813,6 +7977,10 @@ packages: engines: {node: '>=0.4'} dev: true + /y18n@4.0.3: + resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} + dev: true + /y18n@5.0.8: resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} engines: {node: '>=10'} @@ -7825,6 +7993,14 @@ packages: /yallist@4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} + /yargs-parser@18.1.3: + resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} + engines: {node: '>=6'} + dependencies: + camelcase: 5.3.1 + decamelize: 1.2.0 + dev: true + /yargs-parser@20.2.9: resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} engines: {node: '>=10'} @@ -7835,6 +8011,23 @@ packages: engines: {node: '>=12'} dev: true + /yargs@15.4.1: + resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==} + engines: {node: '>=8'} + dependencies: + cliui: 6.0.0 + decamelize: 1.2.0 + find-up: 4.1.0 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + require-main-filename: 2.0.0 + set-blocking: 2.0.0 + string-width: 4.2.3 + which-module: 2.0.1 + y18n: 4.0.3 + yargs-parser: 18.1.3 + dev: true + /yargs@16.2.0: resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} engines: {node: '>=10'} @@ -7866,7 +8059,6 @@ packages: engines: {node: '>=4.0.0'} hasBin: true requiresBuild: true - dev: false /yauzl@2.10.0: resolution: {integrity: sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==} @@ -7884,11 +8076,10 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} - /zenroom@4.12.2: - resolution: {integrity: sha512-4L18Bvt9Ef1aYV7sUhYoYLwIe9Gx/31Gf5JOcM//iJ9xHKTTO6HAZruyQoZHQ/lGD5JXsPWtH+Ty0GrEgQ9Tfg==} + /zenroom@4.13.0: + resolution: {integrity: sha512-iqxxHleBFnU5sG3NEKmXI/rkBQFUS4dC5L3mthBZaMryBiWvAa/nLtnFMq2GFGhjfInTkMZ4zkmTJy7tJzt1fQ==} dependencies: yarn: 1.22.21 - dev: false /zod@3.22.4: resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==} diff --git a/src/cli.ts b/src/cli.ts index 3f1d78c..f6cf4bc 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -1,12 +1,17 @@ -import { Command, Option, type OptionValues } from 'commander'; -import { statSync } from 'node:fs'; -import pino, { type Logger } from 'pino'; +import { Command, Option } from 'commander'; import 'dotenv/config'; -import { Config } from './types'; +import { statSync } from 'node:fs'; +import { Logger } from 'tslog'; import p from '../package.json' with { type: 'json' }; - +import { Config } from './types'; export const program = new Command(); -const L = pino(); +const L = new Logger({ + name: p.name, + type: 'pretty', + prettyLogTemplate: + '{{logLevelName}} {{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}}\t[{{filePathWithLine}}]\t' +}); + const bads = ['ā›”', 'šŸ’©', 'šŸ„¶', 'šŸ’£']; const bad = bads[Math.floor(Math.random() * bads.length)]; diff --git a/src/error.ts b/src/error.ts new file mode 100644 index 0000000..a3396de --- /dev/null +++ b/src/error.ts @@ -0,0 +1,30 @@ +import { Logger, type ILogObj } from 'tslog'; +import { Endpoints } from './types'; + +export const reportZenroomError = ( + error: Error, + l: Logger, + endpoints: Endpoints +): string => { + if (error.name === 'ZenroomError') { + debugZen('J64 HEAP: ', l, error); + debugZen('J64 TRACE: ', l, error); + + return error.message; + } else if (error.message.startsWith('ParseError')) { + l.error('Slangroom Syntax Error ', error.message); + return error.message; + } else { + l.error(error); + return error.message; + } +}; + +const debugZen = (type: 'J64 TRACE: ' | 'J64 HEAP: ', l: Logger, error: Error) => { + const trace = JSON.parse(error.message).filter((l: string) => l.startsWith(type)); + if (trace.length) { + const content = trace[0].split(type)[1].replaceAll("'", ''); + const decodedContent = Buffer.from(content, 'base64').toString('utf8'); + console.table(JSON.parse(decodedContent)); + } +}; diff --git a/src/index.ts b/src/index.ts index dd61c9b..d8352ac 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,6 +3,7 @@ import fs from 'fs'; import _ from 'lodash'; import mime from 'mime'; import path from 'path'; +import { IMeta } from 'tslog'; import { App, HttpRequest, @@ -16,6 +17,7 @@ import { template as proctoroom } from './applets.js'; import { autorunContracts } from './autorun.js'; import { config } from './cli.js'; import { Directory } from './directory.js'; +import { reportZenroomError } from './error.js'; import { definition, generateAppletPath, @@ -91,7 +93,7 @@ const ncrApp = async () => { .writeStatus('200 OK') .writeHeader('Content-Type', 'application/json') .end(JSON.stringify(definition)); - }) + }); }) .get('/health', async (res, _) => { res.onAborted(() => { @@ -119,7 +121,10 @@ Then print the 'result' } catch (e) { L.error(e); res.cork(() => - res.writeStatus('500').writeHeader('Content-Type', 'application/json').end((e as Error).message) + res + .writeStatus('500') + .writeHeader('Content-Type', 'application/json') + .end((e as Error).message) ); } }) @@ -168,7 +173,6 @@ Dir.ready(async () => { us_listen_socket_close(listen_socket); const app = await ncrApp(); generateRoutes(app); - // generatePublicFilesRoutes(app); app.listen(port, (socket) => { listen_socket = socket; L.info(`Swagger UI is running on http://${config.hostname}:${port}/docs`); @@ -182,6 +186,19 @@ Dir.ready(async () => { const generateRoutes = (app: TemplatedApp) => { Dir.files.forEach(async (endpoints) => { const { contract, path, keys, conf, metadata } = endpoints; + const LOG = L.getSubLogger({ + stylePrettyLogs: true, + prettyLogTemplate: + '{{logLevelName}}\tšŸ“œ {{zencode}}.zen \tšŸ•™ {{dateIsoStr}} \tšŸ“ {{filePathWithLine}}\t\t', + overwrite: { + addPlaceholders: ( + logObjMeta: IMeta, + placeholderValues: Record + ) => { + placeholderValues['zencode'] = path; + } + } + }); let schema = await getSchema(endpoints); if (!schema) { @@ -191,16 +208,19 @@ const generateRoutes = (app: TemplatedApp) => { const s = SlangroomManager.getInstance(); - const execZencodeAndReply = async (res: HttpResponse, req: HttpRequest, data: JSON) => { + const execZencodeAndReply = async ( + res: HttpResponse, + req: HttpRequest, + data: JSON | Record + ) => { res.onAborted(() => { - res.cork(() => - res.writeStatus('500').writeHeader('Content-Type', 'application/json').end('Aborted')); + res.aborted = true; + res.cork(() => res.writeStatus('400').end()); return; }); try { if (metadata.httpHeaders) { try { - if (data['http_headers'] !== undefined) { throw new Error('Name clash on input key http_headers'); } @@ -210,10 +230,13 @@ const generateRoutes = (app: TemplatedApp) => { }); data['http_headers'] = httpHeaders; } catch (e) { - L.error(e); - res.writeStatus('422 UNPROCESSABLE ENTITY') - .writeHeader('Content-Type', 'application/json') - .end((e as Error).message); + if (!res.aborted) { + LOG.fatal(e); + res + .writeStatus('422 UNPROCESSABLE ENTITY') + .writeHeader('Content-Type', 'application/json') + .end((e as Error).message); + } return; } } @@ -221,10 +244,15 @@ const generateRoutes = (app: TemplatedApp) => { try { validateData(schema, data); } catch (e) { - L.error(e); - res.writeStatus('422 UNPROCESSABLE ENTITY') - .writeHeader('Content-Type', 'application/json') - .end((e as Error).message); + if (!res.aborted) { + LOG.fatal(JSON.parse((e as Error).message)); + res.cork(() => { + res + .writeStatus('422 UNPROCESSABLE ENTITY') + .writeHeader('Content-Type', 'application/json') + .end((e as Error).message); + }); + } return; } @@ -234,9 +262,13 @@ const generateRoutes = (app: TemplatedApp) => { const { result } = await s.execute(contract, { keys, data, conf }); slangroomResult = JSON.stringify(result); } catch (e) { - L.error(e); - res.writeStatus('500').writeHeader('Content-Type', 'application/json').end((e as Error).message); - return; + if (!res.aborted) { + res.cork(() => { + const report = reportZenroomError(e as Error, LOG, endpoints); + res.writeStatus('500').writeHeader('Content-Type', 'application/json').end(report); + }); + return; + } } res.cork(() => { @@ -248,10 +280,11 @@ const generateRoutes = (app: TemplatedApp) => { return; }); } catch (e) { - L.error(e); + LOG.fatal(e); res.cork(() => res.writeStatus('500').writeHeader('Content-Type', 'application/json').end(e.message) ); + return; } }; app.options(path, (res) => { @@ -279,13 +312,13 @@ const generateRoutes = (app: TemplatedApp) => { const data = handleArrayBuffer(d); execZencodeAndReply(res, req, data); } catch (e) { - L.error(e); + LOG.fatal(e); res.writeStatus('500').writeHeader('Content-Type', 'application/json').end(e.message); return; } }); } catch (e) { - L.error(e); + LOG.fatal(e); res.writeStatus('500').writeHeader('Content-Type', 'application/json').end(e.message); } }); @@ -310,8 +343,11 @@ const generateRoutes = (app: TemplatedApp) => { } execZencodeAndReply(res, req, data); } catch (e) { - L.error(e); - res.writeStatus('500').writeHeader('Content-Type', 'application/json').end(e.message); + LOG.fatal(e); + res + .writeStatus('500') + .writeHeader('Content-Type', 'application/json') + .end((e as Error).message); } }); diff --git a/src/slangroom.ts b/src/slangroom.ts index 0f4a376..53df4b9 100644 --- a/src/slangroom.ts +++ b/src/slangroom.ts @@ -1,22 +1,33 @@ -import { type Slangroom as SlangroomType } from '@slangroom/core/build/esm/src/slangroom'; -//@ts-ignore +//@ts-nocheck import { Slangroom } from '@slangroom/core'; -//@ts-ignore -import { wallet } from '@slangroom/wallet'; -//@ts-ignore -import { http } from '@slangroom/http'; -//@ts-ignore +import { type Slangroom as SlangroomType } from '@slangroom/core/build/esm/src/slangroom'; import { fs } from '@slangroom/fs'; -//@ts-ignore -import { zencode } from '@slangroom/zencode'; -//@ts-ignore import { git } from '@slangroom/git'; -//@ts-ignore +import { http } from '@slangroom/http'; +import { JSONSchema } from '@slangroom/json-schema'; import { oauth } from '@slangroom/oauth'; +import { pocketbase } from '@slangroom/pocketbase'; +import { qrcode } from '@slangroom/qrcode'; +import { redis } from '@slangroom/redis'; +import { shell } from '@slangroom/shell'; +import { wallet } from '@slangroom/wallet'; +import { zencode } from '@slangroom/zencode'; // -const SLANGROOM_PLUGINS = [zencode, fs, wallet, http, git, oauth]; +const SLANGROOM_PLUGINS = [ + zencode, + fs, + wallet, + http, + git, + oauth, + shell, + qrcode, + JSONSchema, + redis, + pocketbase +]; export class SlangroomManager { private static instance: SlangroomType; diff --git a/src/types.ts b/src/types.ts index 7fa4759..3006e46 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,4 +1,4 @@ -import { Logger } from 'pino'; +import type { ILogObj, Logger } from 'tslog'; interface IndexableJSON { [key: string]: unknown | IndexableJSON; @@ -17,7 +17,7 @@ export interface Config { zenroomVersion: string; openapiPath: string; template: string; - logger: Logger; + logger: Logger; publicDirectory: string | undefined; } diff --git a/src/utils.ts b/src/utils.ts index 6c70cd2..f340278 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -5,7 +5,6 @@ import _ from 'lodash'; import { introspect } from 'zenroom'; import { config } from './cli.js'; import { Codec, Endpoints, JSONSchema, Metadata } from './types'; - const L = config.logger; // @@ -22,7 +21,8 @@ export async function getSchemaFromIntrospection( contract: string ): Promise { const codec: Codec = await introspect(contract); - if (_.isEqual(codec, { CACHE: [], CODEC: [], GIVEN_data: [], THEN: [], WHEN: [] })) return undefined; + if (_.isEqual(codec, { CACHE: [], CODEC: [], GIVEN_data: [], THEN: [], WHEN: [] })) + return undefined; const encodingToType = { string: Type.String(), float: Type.Number() @@ -70,8 +70,13 @@ export function removeKeysFromSchema(schema: JSONSchema, keys: JSON): JSONSchema export const validateData = (schema: JSONSchema, data: JSON | Record) => { const ajv = createAjv(); - const validate = ajv.compile(schema); - if (!validate(data)) throw new Error(formatAjvErrors(validate.errors)); + try { + const validate = ajv.compile(schema); + if (!validate(data)) throw new Error(formatAjvErrors(validate.errors)); + } catch (e) { + L.error(e); + throw e; + } return data; }; diff --git a/tests/fixtures/my-keyring.keys.json b/tests/fixtures/my-keyring.keys.json index da4d80f..9d1e435 100644 --- a/tests/fixtures/my-keyring.keys.json +++ b/tests/fixtures/my-keyring.keys.json @@ -1,11 +1,11 @@ { - "targetDID": "did:dyne:sandbox.test:6ANws7nX3cDcikwQC1uZy97GZhaaggqcK6ioJHt8wpJa", - "didServiceResolveAPIPath": "https://did.dyne.org/dids/did:dyne:sandbox.test:AVov1SYrpQDGzJdMUvKDiYVmkuCRNwMaqxa9qa2HjbGF", - "message": "breh, how you ddoing? Now with AUTH!", - "identityDID": "https://did.dyne.org/dids/", - "user": { - "keyring": { - "eddsa": "btdwbiYphJFS8ymYChBnmsfSn2WcAShQ4aqKaN9pB2H" - } - } -} \ No newline at end of file + "targetDID": "did:dyne:sandbox.test:6ANws7nX3cDcikwQC1uZy97GZhaaggqcK6ioJHt8wpJa", + "didServiceResolveAPIPath": "https://did.dyne.org/dids/did:dyne:sandbox.test:AVov1SYrpQDGzJdMUvKDiYVmkuCRNwMaqxa9qa2HjbGF", + "message": "breh, how you ddoing? Now with AUTH!", + "identityDID": "https://did.dyne.org/dids/", + "user": { + "keyring": { + "eddsa": "btdwbiYphJFS8ymYChBnmsfSn2WcAShQ4aqKaN9pB2H" + } + } +} diff --git a/tests/workflow.stepci.yml b/tests/workflow.stepci.yml index b5d0a18..d2b836c 100644 --- a/tests/workflow.stepci.yml +++ b/tests/workflow.stepci.yml @@ -129,7 +129,7 @@ tests: love: puria: 'puria' check: - status: 422 + status: 422 - name: json-schema valid but wrong data http: @@ -163,25 +163,24 @@ tests: status: 500 json: - eq: - - 'ZENROOM JSON LOG START' - - " . Release version: v4.12.2" - - " . Build commit hash: 8b32ed1e" - - " . Memory manager: mimalloc" - - " . ECDH curve is SECP256K1" - - " . ECP curve is BLS381" - - " . Rule unknown ignore" - - "[W] Zencode written for an older version: 4.12.0" - - " . Rule check version 4.12.0" + - ZENROOM JSON LOG START + - ' . Release version: v4.13.0' + - ' . Build commit hash: 4672b888' + - ' . Memory manager: mimalloc' + - ' . ECDH curve is SECP256K1' + - ' . ECP curve is BLS381' + - ' . Rule unknown ignore' + - '[W] Zencode written for an older version: 4.12.0' + - ' . Rule check version 4.12.0' - 'J64 HEAP: eyJDQUNIRSI6W10sIkNPREVDIjpbXSwiR0lWRU5fZGF0YSI6eyJtYWxlIjoicHVyaWEiLCJzb2xlIjoicHVyaWEifSwiVEhFTiI6W10sIldIRU4iOltdfQ==' - 'J64 TRACE: WyIrMyAgR2l2ZW4gSSBoYXZlIGEgJ3N0cmluZyBkaWN0aW9uYXJ5JyBuYW1lZCAnbG92ZSciLCJbIV0gRXJyb3IgYXQgWmVuY29kZSBsaW5lIDMiLCJbIV0gL3plbmNvZGVfZ2l2ZW4ubHVhOjMzODogQ2Fubm90IGZpbmQgJ2xvdmUnIGFueXdoZXJlIChudWxsIHZhbHVlPykiXQ==' - - "[!] Zencode runtime error" + - '[!] Zencode runtime error' - "[!] /zencode.lua:646: Zencode line 3: Given I have a 'string dictionary' named 'love'" - - "[!] Execution aborted with errors." - - "[*] Zenroom teardown." - - " . Memory used: 399 KB" - - 'ZENROOM JSON LOG END' - + - '[!] Execution aborted with errors.' + - '[*] Zenroom teardown.' + - ' . Memory used: 399 KB' + - ZENROOM JSON LOG END slangroom_fs: steps: @@ -207,7 +206,7 @@ tests: check: status: 500 body: $FILES_DIR must be provided - + my_keyring: steps: - name: my_keyring invalid data diff --git a/tsconfig.json b/tsconfig.json index f9a8c38..8105e6c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,6 +5,7 @@ "module": "ESNext", "moduleResolution": "Node", "esModuleInterop": true, + "inlineSourceMap": true, "forceConsistentCasingInFileNames": true, "strict": true, "skipLibCheck": true,